diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..68bb3af9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-monitoring-dashboards/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. monitoring-dashboards version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..0bd0ee06 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1 @@ +Fixes # (it's a good idea to open an issue first for context and/or discussion) \ No newline at end of file diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..dce2c845 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..48ec8bf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Packages +dist +bin +var +sdist +target + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject +*.iml +.idea +.settings +.DS_Store +.classpath + +# Built documentation +docs/ + +# Python utilities +*.pyc diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..86804f21 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" github/java-monitoring-dashboards/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..dc2936ef --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + bash ${KOKORO_GFILE_DIR}/codecov.sh + bash .kokoro/coerce_logs.sh + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + bash .kokoro/coerce_logs.sh + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + ;; +*) + ;; +esac diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 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. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..26c3b230 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/build.sh" +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..e0e198b3 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/dependencies.cfg b/.kokoro/continuous/dependencies.cfg new file mode 100644 index 00000000..3978703e --- /dev/null +++ b/.kokoro/continuous/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/dependencies.sh" +} diff --git a/.kokoro/continuous/integration.cfg b/.kokoro/continuous/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/integration.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/continuous/java11.cfg b/.kokoro/continuous/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/continuous/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/continuous/java7.cfg b/.kokoro/continuous/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/continuous/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/continuous/java8-osx.cfg b/.kokoro/continuous/java8-osx.cfg new file mode 100644 index 00000000..23e34253 --- /dev/null +++ b/.kokoro/continuous/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-monitoring-dashboards/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 00000000..fd9d0d2e --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-monitoring-dashboards/.kokoro/build.bat" diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/continuous/lint.cfg b/.kokoro/continuous/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/continuous/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/continuous/propose_release.cfg b/.kokoro/continuous/propose_release.cfg new file mode 100644 index 00000000..271fbb74 --- /dev/null +++ b/.kokoro/continuous/propose_release.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/continuous/propose_release.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/continuous/propose_release.sh b/.kokoro/continuous/propose_release.sh new file mode 100755 index 00000000..990ddc39 --- /dev/null +++ b/.kokoro/continuous/propose_release.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Copyright 2019 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. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the release PR as new commits are merged. + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-monitoring-dashboards \ + --package-name="monitoring-dashboards" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --release-type=java-yoshi +fi diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..32014727 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +cd github/java-monitoring-dashboards/ + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 00000000..93f70079 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail +# Display commands being run. +set -x + +cd github/java-monitoring-dashboards/ + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..e0e198b3 --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/dependencies.cfg b/.kokoro/nightly/dependencies.cfg new file mode 100644 index 00000000..3978703e --- /dev/null +++ b/.kokoro/nightly/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/dependencies.sh" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..23e34253 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-monitoring-dashboards/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..fd9d0d2e --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-monitoring-dashboards/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/nightly/lint.cfg b/.kokoro/nightly/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/nightly/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..e00bef99 --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..3978703e --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..141f90c1 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..23e34253 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-monitoring-dashboards/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..fd9d0d2e --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-monitoring-dashboards/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..e14238ca --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..bd924055 --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh new file mode 100755 index 00000000..487d9914 --- /dev/null +++ b/.kokoro/release/bump_snapshot.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Copyright 2019 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. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the snapshot release PR immediately after publishing a release + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-monitoring-dashboards \ + --package-name="monitoring-dashboards" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --snapshot \ + --release-type=java-auth-yoshi +fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..737139bb --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-monitoring-dashboards/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..e2b1e39e --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..ba1e5a3e --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..bf8e23bb --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/release/publish_javadoc.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..49de8667 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# 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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -DskipTests=true + +NAME=google-cloud-monitoring-dashboards +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..f5201f62 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..098168a7 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..a18b581c --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,44 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-monitoring-dashboards/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-monitoring-dashboards/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-monitoring-dashboards" + } +} + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..3c482cbc --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..ba17ce01 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..d04b9271 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,12 @@ +{ + "name": "monitoring-dashboards", + "name_pretty": "Google Cloud Monitoring Dashboards", + "product_documentation": "https://cloud.google.com/monitoring/charts/dashboards", + "client_documentation": "https://googleapis.dev/java/java-monitoring-dashboards/latest", + "release_level": "beta", + "language": "java", + "repo": "googleapis/java-monitoring-dashboards", + "repo_short": "java-monitoring-dashboards", + "distribution_name": "com.google.cloud:google-cloud-monitoring-dashboards", + "api_id": "monitoring.googleapis.com" +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..6b2238bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the +Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..ebbb59e5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/README.md b/README.md new file mode 100644 index 00000000..66ea7b4c --- /dev/null +++ b/README.md @@ -0,0 +1,129 @@ +# Google Cloud Java Client for Google Cloud Monitoring Dashboards + +Java idiomatic client for [Google Cloud Monitoring Dashboards][api-reference]. + +[![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 + +[//]: # ({x-version-update-start:monitoring-dashboards:released}) +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-monitoring-dashboards + 0.0.0 + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-monitoring-dashboards:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-monitoring-dashboards" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## About Google Cloud Monitoring Dashboards + +[Google Cloud Monitoring Dashboards][api-reference] are one way for you to view and analyze metric +data that is important to you. The Stackdriver Monitoring console provides predefined dashboards for +the resources and services that you use. These dashboards require no setup or configuration effort. + +See the [Google Cloud Monitoring Dashboards client library docs][javadocs] to learn how to +use this Google Cloud Monitoring Dashboards Client Library. + +## Getting Started + +### Prerequisites + +You will need a [Google Developers Console][developer-console] project with the +Google Cloud Monitoring Dashboards API enabled. [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 SDK][cloud-sdk] 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-monitoring-dashboards` library. See the [Quickstart](#quickstart) section +to add `google-cloud-monitoring-dashboards` as a dependency in your code. + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Google Cloud Monitoring Dashboards uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## 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.md][contributing] documentation for more information on 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 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] +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] + +[api-reference]: https://cloud.google.com/monitoring/dashboards/api-dashboard +[product-docs]: https://cloud.google.com/monitoring/charts/dashboards +[javadocs]: https://googleapis.dev/java/java-monitoring-dashboards/latest +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring-dashboards/java11.html +[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-monitoring-dashboards.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-monitoring-dashboards&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-monitoring-dashboards/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-monitoring-dashboards/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-monitoring-dashboards/blob/master/LICENSE \ No newline at end of file diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-monitoring-dashboard-bom/pom.xml b/google-cloud-monitoring-dashboard-bom/pom.xml new file mode 100644 index 00000000..545b8c65 --- /dev/null +++ b/google-cloud-monitoring-dashboard-bom/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + com.google.cloud + google-cloud-monitoring-dashboard-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.3.0 + + + Google Cloud monitoring-dashboard BOM + https://github.com/googleapis/java-monitoring-dashboard + + BOM for Google Cloud monitoring-dashboard + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-monitoring-dashboard.git + scm:git:git@github.com:googleapis/java-monitoring-dashboard.git + https://github.com/googleapis/java-monitoring-dashboard + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.api.grpc + proto-google-cloud-monitoring-dashboard-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-monitoring-dashboard-v1 + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-monitoring-dashboard + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-monitoring-dashboard/pom.xml b/google-cloud-monitoring-dashboard/pom.xml new file mode 100644 index 00000000..36becdcc --- /dev/null +++ b/google-cloud-monitoring-dashboard/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + com.google.cloud + google-cloud-monitoring-dashboard + 0.0.1-SNAPSHOT + jar + Google Cloud monitoring-dashboard + https://github.com/googleapis/java-monitoring-dashboard + Java idiomatic client for Google Cloud monitoring-dashboard + + com.google.cloud + google-cloud-monitoring-dashboard-parent + 0.0.1-SNAPSHOT + + + google-cloud-monitoring-dashboard + + + + 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-monitoring-dashboard-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-monitoring-dashboard-v1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java new file mode 100644 index 00000000..8e36c377 --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java @@ -0,0 +1,580 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.monitoring.dashboard.v1.stub.DashboardsServiceStub; +import com.google.cloud.monitoring.dashboard.v1.stub.DashboardsServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.monitoring.dashboard.v1.CreateDashboardRequest; +import com.google.monitoring.dashboard.v1.Dashboard; +import com.google.monitoring.dashboard.v1.DeleteDashboardRequest; +import com.google.monitoring.dashboard.v1.GetDashboardRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsResponse; +import com.google.monitoring.dashboard.v1.UpdateDashboardRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Manages Stackdriver dashboards. A dashboard is an arrangement of data + * display widgets in a specific layout. + * + *

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

+ * 
+ * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+ *   String parent = "";
+ *   Dashboard dashboard = Dashboard.newBuilder().build();
+ *   CreateDashboardRequest request = CreateDashboardRequest.newBuilder()
+ *     .setParent(parent)
+ *     .setDashboard(dashboard)
+ *     .build();
+ *   Dashboard response = dashboardsServiceClient.createDashboard(request);
+ * }
+ * 
+ * 
+ * + *

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

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

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

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

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

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

To customize credentials: + * + *

+ * 
+ * DashboardsServiceSettings dashboardsServiceSettings =
+ *     DashboardsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DashboardsServiceClient dashboardsServiceClient =
+ *     DashboardsServiceClient.create(dashboardsServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * DashboardsServiceSettings dashboardsServiceSettings =
+ *     DashboardsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DashboardsServiceClient dashboardsServiceClient =
+ *     DashboardsServiceClient.create(dashboardsServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DashboardsServiceClient implements BackgroundResource { + private final DashboardsServiceSettings settings; + private final DashboardsServiceStub stub; + + /** Constructs an instance of DashboardsServiceClient with default settings. */ + public static final DashboardsServiceClient create() throws IOException { + return create(DashboardsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DashboardsServiceClient, 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 DashboardsServiceClient create(DashboardsServiceSettings settings) + throws IOException { + return new DashboardsServiceClient(settings); + } + + /** + * Constructs an instance of DashboardsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use DashboardsServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DashboardsServiceClient create(DashboardsServiceStub stub) { + return new DashboardsServiceClient(stub); + } + + /** + * Constructs an instance of DashboardsServiceClient, 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 DashboardsServiceClient(DashboardsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DashboardsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected DashboardsServiceClient(DashboardsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DashboardsServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DashboardsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new custom dashboard. + * + *

This method requires the `monitoring.dashboards.create` permission on the specified project. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String parent = "";
+   *   Dashboard dashboard = Dashboard.newBuilder().build();
+   *   CreateDashboardRequest request = CreateDashboardRequest.newBuilder()
+   *     .setParent(parent)
+   *     .setDashboard(dashboard)
+   *     .build();
+   *   Dashboard response = dashboardsServiceClient.createDashboard(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 Dashboard createDashboard(CreateDashboardRequest request) { + return createDashboardCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new custom dashboard. + * + *

This method requires the `monitoring.dashboards.create` permission on the specified project. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String parent = "";
+   *   Dashboard dashboard = Dashboard.newBuilder().build();
+   *   CreateDashboardRequest request = CreateDashboardRequest.newBuilder()
+   *     .setParent(parent)
+   *     .setDashboard(dashboard)
+   *     .build();
+   *   ApiFuture<Dashboard> future = dashboardsServiceClient.createDashboardCallable().futureCall(request);
+   *   // Do something
+   *   Dashboard response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createDashboardCallable() { + return stub.createDashboardCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the existing dashboards. + * + *

This method requires the `monitoring.dashboards.list` permission on the specified project. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String parent = "";
+   *   ListDashboardsRequest request = ListDashboardsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   for (Dashboard element : dashboardsServiceClient.listDashboards(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 ListDashboardsPagedResponse listDashboards(ListDashboardsRequest request) { + return listDashboardsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the existing dashboards. + * + *

This method requires the `monitoring.dashboards.list` permission on the specified project. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String parent = "";
+   *   ListDashboardsRequest request = ListDashboardsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   ApiFuture<ListDashboardsPagedResponse> future = dashboardsServiceClient.listDashboardsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Dashboard element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDashboardsPagedCallable() { + return stub.listDashboardsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the existing dashboards. + * + *

This method requires the `monitoring.dashboards.list` permission on the specified project. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String parent = "";
+   *   ListDashboardsRequest request = ListDashboardsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   while (true) {
+   *     ListDashboardsResponse response = dashboardsServiceClient.listDashboardsCallable().call(request);
+   *     for (Dashboard element : response.getDashboardsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listDashboardsCallable() { + return stub.listDashboardsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Fetches a specific dashboard. + * + *

This method requires the `monitoring.dashboards.get` permission on the specified dashboard. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String name = "";
+   *   GetDashboardRequest request = GetDashboardRequest.newBuilder()
+   *     .setName(name)
+   *     .build();
+   *   Dashboard response = dashboardsServiceClient.getDashboard(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 Dashboard getDashboard(GetDashboardRequest request) { + return getDashboardCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Fetches a specific dashboard. + * + *

This method requires the `monitoring.dashboards.get` permission on the specified dashboard. + * For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String name = "";
+   *   GetDashboardRequest request = GetDashboardRequest.newBuilder()
+   *     .setName(name)
+   *     .build();
+   *   ApiFuture<Dashboard> future = dashboardsServiceClient.getDashboardCallable().futureCall(request);
+   *   // Do something
+   *   Dashboard response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getDashboardCallable() { + return stub.getDashboardCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing custom dashboard. + * + *

This method requires the `monitoring.dashboards.delete` permission on the specified + * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String name = "";
+   *   DeleteDashboardRequest request = DeleteDashboardRequest.newBuilder()
+   *     .setName(name)
+   *     .build();
+   *   dashboardsServiceClient.deleteDashboard(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDashboard(DeleteDashboardRequest request) { + deleteDashboardCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing custom dashboard. + * + *

This method requires the `monitoring.dashboards.delete` permission on the specified + * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   String name = "";
+   *   DeleteDashboardRequest request = DeleteDashboardRequest.newBuilder()
+   *     .setName(name)
+   *     .build();
+   *   ApiFuture<Void> future = dashboardsServiceClient.deleteDashboardCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteDashboardCallable() { + return stub.deleteDashboardCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Replaces an existing custom dashboard with a new definition. + * + *

This method requires the `monitoring.dashboards.update` permission on the specified + * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   Dashboard dashboard = Dashboard.newBuilder().build();
+   *   UpdateDashboardRequest request = UpdateDashboardRequest.newBuilder()
+   *     .setDashboard(dashboard)
+   *     .build();
+   *   Dashboard response = dashboardsServiceClient.updateDashboard(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 Dashboard updateDashboard(UpdateDashboardRequest request) { + return updateDashboardCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Replaces an existing custom dashboard with a new definition. + * + *

This method requires the `monitoring.dashboards.update` permission on the specified + * dashboard. For more information, see [Google Cloud IAM](https://cloud.google.com/iam). + * + *

Sample code: + * + *


+   * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+   *   Dashboard dashboard = Dashboard.newBuilder().build();
+   *   UpdateDashboardRequest request = UpdateDashboardRequest.newBuilder()
+   *     .setDashboard(dashboard)
+   *     .build();
+   *   ApiFuture<Dashboard> future = dashboardsServiceClient.updateDashboardCallable().futureCall(request);
+   *   // Do something
+   *   Dashboard response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateDashboardCallable() { + return stub.updateDashboardCallable(); + } + + @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 ListDashboardsPagedResponse + extends AbstractPagedListResponse< + ListDashboardsRequest, + ListDashboardsResponse, + Dashboard, + ListDashboardsPage, + ListDashboardsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDashboardsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListDashboardsPagedResponse apply(ListDashboardsPage input) { + return new ListDashboardsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListDashboardsPagedResponse(ListDashboardsPage page) { + super(page, ListDashboardsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDashboardsPage + extends AbstractPage< + ListDashboardsRequest, ListDashboardsResponse, Dashboard, ListDashboardsPage> { + + private ListDashboardsPage( + PageContext context, + ListDashboardsResponse response) { + super(context, response); + } + + private static ListDashboardsPage createEmptyPage() { + return new ListDashboardsPage(null, null); + } + + @Override + protected ListDashboardsPage createPage( + PageContext context, + ListDashboardsResponse response) { + return new ListDashboardsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDashboardsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDashboardsRequest, + ListDashboardsResponse, + Dashboard, + ListDashboardsPage, + ListDashboardsFixedSizeCollection> { + + private ListDashboardsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDashboardsFixedSizeCollection createEmptyCollection() { + return new ListDashboardsFixedSizeCollection(null, 0); + } + + @Override + protected ListDashboardsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDashboardsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceSettings.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceSettings.java new file mode 100644 index 00000000..40dcaef9 --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceSettings.java @@ -0,0 +1,230 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1; + +import static com.google.cloud.monitoring.dashboard.v1.DashboardsServiceClient.ListDashboardsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.monitoring.dashboard.v1.stub.DashboardsServiceStubSettings; +import com.google.monitoring.dashboard.v1.CreateDashboardRequest; +import com.google.monitoring.dashboard.v1.Dashboard; +import com.google.monitoring.dashboard.v1.DeleteDashboardRequest; +import com.google.monitoring.dashboard.v1.GetDashboardRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsResponse; +import com.google.monitoring.dashboard.v1.UpdateDashboardRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link DashboardsServiceClient}. + * + *

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

    + *
  • The default service address (monitoring.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 createDashboard to 30 seconds: + * + *

+ * 
+ * DashboardsServiceSettings.Builder dashboardsServiceSettingsBuilder =
+ *     DashboardsServiceSettings.newBuilder();
+ * dashboardsServiceSettingsBuilder.createDashboardSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * DashboardsServiceSettings dashboardsServiceSettings = dashboardsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DashboardsServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createDashboard. */ + public UnaryCallSettings createDashboardSettings() { + return ((DashboardsServiceStubSettings) getStubSettings()).createDashboardSettings(); + } + + /** Returns the object with the settings used for calls to listDashboards. */ + public PagedCallSettings< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + listDashboardsSettings() { + return ((DashboardsServiceStubSettings) getStubSettings()).listDashboardsSettings(); + } + + /** Returns the object with the settings used for calls to getDashboard. */ + public UnaryCallSettings getDashboardSettings() { + return ((DashboardsServiceStubSettings) getStubSettings()).getDashboardSettings(); + } + + /** Returns the object with the settings used for calls to deleteDashboard. */ + public UnaryCallSettings deleteDashboardSettings() { + return ((DashboardsServiceStubSettings) getStubSettings()).deleteDashboardSettings(); + } + + /** Returns the object with the settings used for calls to updateDashboard. */ + public UnaryCallSettings updateDashboardSettings() { + return ((DashboardsServiceStubSettings) getStubSettings()).updateDashboardSettings(); + } + + public static final DashboardsServiceSettings create(DashboardsServiceStubSettings stub) + throws IOException { + return new DashboardsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DashboardsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DashboardsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DashboardsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DashboardsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DashboardsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DashboardsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DashboardsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DashboardsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DashboardsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(DashboardsServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(DashboardsServiceStubSettings.newBuilder()); + } + + protected Builder(DashboardsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DashboardsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public DashboardsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DashboardsServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createDashboard. */ + public UnaryCallSettings.Builder createDashboardSettings() { + return getStubSettingsBuilder().createDashboardSettings(); + } + + /** Returns the builder for the settings used for calls to listDashboards. */ + public PagedCallSettings.Builder< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + listDashboardsSettings() { + return getStubSettingsBuilder().listDashboardsSettings(); + } + + /** Returns the builder for the settings used for calls to getDashboard. */ + public UnaryCallSettings.Builder getDashboardSettings() { + return getStubSettingsBuilder().getDashboardSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDashboard. */ + public UnaryCallSettings.Builder deleteDashboardSettings() { + return getStubSettingsBuilder().deleteDashboardSettings(); + } + + /** Returns the builder for the settings used for calls to updateDashboard. */ + public UnaryCallSettings.Builder updateDashboardSettings() { + return getStubSettingsBuilder().updateDashboardSettings(); + } + + @Override + public DashboardsServiceSettings build() throws IOException { + return new DashboardsServiceSettings(this); + } + } +} diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/package-info.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/package-info.java new file mode 100644 index 00000000..d027a324 --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 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 Stackdriver Monitoring Dashboards API. + * + *

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

======================= DashboardsServiceClient ======================= + * + *

Service Description: Manages Stackdriver dashboards. A dashboard is an arrangement of data + * display widgets in a specific layout. + * + *

Sample for DashboardsServiceClient: + * + *

+ * 
+ * try (DashboardsServiceClient dashboardsServiceClient = DashboardsServiceClient.create()) {
+ *   String parent = "";
+ *   Dashboard dashboard = Dashboard.newBuilder().build();
+ *   CreateDashboardRequest request = CreateDashboardRequest.newBuilder()
+ *     .setParent(parent)
+ *     .setDashboard(dashboard)
+ *     .build();
+ *   Dashboard response = dashboardsServiceClient.createDashboard(request);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.monitoring.dashboard.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStub.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStub.java new file mode 100644 index 00000000..31bba91c --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStub.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1.stub; + +import static com.google.cloud.monitoring.dashboard.v1.DashboardsServiceClient.ListDashboardsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.monitoring.dashboard.v1.CreateDashboardRequest; +import com.google.monitoring.dashboard.v1.Dashboard; +import com.google.monitoring.dashboard.v1.DeleteDashboardRequest; +import com.google.monitoring.dashboard.v1.GetDashboardRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsResponse; +import com.google.monitoring.dashboard.v1.UpdateDashboardRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Stackdriver Monitoring Dashboards API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class DashboardsServiceStub implements BackgroundResource { + + public UnaryCallable createDashboardCallable() { + throw new UnsupportedOperationException("Not implemented: createDashboardCallable()"); + } + + public UnaryCallable + listDashboardsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDashboardsPagedCallable()"); + } + + public UnaryCallable listDashboardsCallable() { + throw new UnsupportedOperationException("Not implemented: listDashboardsCallable()"); + } + + public UnaryCallable getDashboardCallable() { + throw new UnsupportedOperationException("Not implemented: getDashboardCallable()"); + } + + public UnaryCallable deleteDashboardCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDashboardCallable()"); + } + + public UnaryCallable updateDashboardCallable() { + throw new UnsupportedOperationException("Not implemented: updateDashboardCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStubSettings.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStubSettings.java new file mode 100644 index 00000000..2b72d19a --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStubSettings.java @@ -0,0 +1,444 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1.stub; + +import static com.google.cloud.monitoring.dashboard.v1.DashboardsServiceClient.ListDashboardsPagedResponse; + +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.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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.monitoring.dashboard.v1.CreateDashboardRequest; +import com.google.monitoring.dashboard.v1.Dashboard; +import com.google.monitoring.dashboard.v1.DeleteDashboardRequest; +import com.google.monitoring.dashboard.v1.GetDashboardRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsResponse; +import com.google.monitoring.dashboard.v1.UpdateDashboardRequest; +import com.google.protobuf.Empty; +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 DashboardsServiceStub}. + * + *

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

    + *
  • The default service address (monitoring.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 createDashboard to 30 seconds: + * + *

+ * 
+ * DashboardsServiceStubSettings.Builder dashboardsServiceSettingsBuilder =
+ *     DashboardsServiceStubSettings.newBuilder();
+ * dashboardsServiceSettingsBuilder.createDashboardSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * DashboardsServiceStubSettings dashboardsServiceSettings = dashboardsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class DashboardsServiceStubSettings 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") + .add("https://www.googleapis.com/auth/monitoring") + .add("https://www.googleapis.com/auth/monitoring.read") + .add("https://www.googleapis.com/auth/monitoring.write") + .build(); + + private final UnaryCallSettings createDashboardSettings; + private final PagedCallSettings< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + listDashboardsSettings; + private final UnaryCallSettings getDashboardSettings; + private final UnaryCallSettings deleteDashboardSettings; + private final UnaryCallSettings updateDashboardSettings; + + /** Returns the object with the settings used for calls to createDashboard. */ + public UnaryCallSettings createDashboardSettings() { + return createDashboardSettings; + } + + /** Returns the object with the settings used for calls to listDashboards. */ + public PagedCallSettings< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + listDashboardsSettings() { + return listDashboardsSettings; + } + + /** Returns the object with the settings used for calls to getDashboard. */ + public UnaryCallSettings getDashboardSettings() { + return getDashboardSettings; + } + + /** Returns the object with the settings used for calls to deleteDashboard. */ + public UnaryCallSettings deleteDashboardSettings() { + return deleteDashboardSettings; + } + + /** Returns the object with the settings used for calls to updateDashboard. */ + public UnaryCallSettings updateDashboardSettings() { + return updateDashboardSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DashboardsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDashboardsServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** 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 "monitoring.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); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DashboardsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DashboardsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createDashboardSettings = settingsBuilder.createDashboardSettings().build(); + listDashboardsSettings = settingsBuilder.listDashboardsSettings().build(); + getDashboardSettings = settingsBuilder.getDashboardSettings().build(); + deleteDashboardSettings = settingsBuilder.deleteDashboardSettings().build(); + updateDashboardSettings = settingsBuilder.updateDashboardSettings().build(); + } + + private static final PagedListDescriptor + LIST_DASHBOARDS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDashboardsRequest injectToken(ListDashboardsRequest payload, String token) { + return ListDashboardsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDashboardsRequest injectPageSize( + ListDashboardsRequest payload, int pageSize) { + return ListDashboardsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDashboardsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDashboardsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDashboardsResponse payload) { + return payload.getDashboardsList() != null + ? payload.getDashboardsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + LIST_DASHBOARDS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDashboardsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DASHBOARDS_PAGE_STR_DESC, request, context); + return ListDashboardsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for DashboardsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createDashboardSettings; + private final PagedCallSettings.Builder< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + listDashboardsSettings; + private final UnaryCallSettings.Builder getDashboardSettings; + private final UnaryCallSettings.Builder deleteDashboardSettings; + private final UnaryCallSettings.Builder + updateDashboardSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createDashboardSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listDashboardsSettings = PagedCallSettings.newBuilder(LIST_DASHBOARDS_PAGE_STR_FACT); + + getDashboardSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteDashboardSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateDashboardSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDashboardSettings, + listDashboardsSettings, + getDashboardSettings, + deleteDashboardSettings, + updateDashboardSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createDashboardSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listDashboardsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getDashboardSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteDashboardSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateDashboardSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(DashboardsServiceStubSettings settings) { + super(settings); + + createDashboardSettings = settings.createDashboardSettings.toBuilder(); + listDashboardsSettings = settings.listDashboardsSettings.toBuilder(); + getDashboardSettings = settings.getDashboardSettings.toBuilder(); + deleteDashboardSettings = settings.deleteDashboardSettings.toBuilder(); + updateDashboardSettings = settings.updateDashboardSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDashboardSettings, + listDashboardsSettings, + getDashboardSettings, + deleteDashboardSettings, + updateDashboardSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createDashboard. */ + public UnaryCallSettings.Builder createDashboardSettings() { + return createDashboardSettings; + } + + /** Returns the builder for the settings used for calls to listDashboards. */ + public PagedCallSettings.Builder< + ListDashboardsRequest, ListDashboardsResponse, ListDashboardsPagedResponse> + listDashboardsSettings() { + return listDashboardsSettings; + } + + /** Returns the builder for the settings used for calls to getDashboard. */ + public UnaryCallSettings.Builder getDashboardSettings() { + return getDashboardSettings; + } + + /** Returns the builder for the settings used for calls to deleteDashboard. */ + public UnaryCallSettings.Builder deleteDashboardSettings() { + return deleteDashboardSettings; + } + + /** Returns the builder for the settings used for calls to updateDashboard. */ + public UnaryCallSettings.Builder updateDashboardSettings() { + return updateDashboardSettings; + } + + @Override + public DashboardsServiceStubSettings build() throws IOException { + return new DashboardsServiceStubSettings(this); + } + } +} diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceCallableFactory.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceCallableFactory.java new file mode 100644 index 00000000..837f7d11 --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1.stub; + +import com.google.api.core.BetaApi; +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.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Stackdriver Monitoring Dashboards API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcDashboardsServiceCallableFactory 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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceStub.java b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceStub.java new file mode 100644 index 00000000..98f40ce3 --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceStub.java @@ -0,0 +1,294 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1.stub; + +import static com.google.cloud.monitoring.dashboard.v1.DashboardsServiceClient.ListDashboardsPagedResponse; + +import com.google.api.core.BetaApi; +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.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.monitoring.dashboard.v1.CreateDashboardRequest; +import com.google.monitoring.dashboard.v1.Dashboard; +import com.google.monitoring.dashboard.v1.DeleteDashboardRequest; +import com.google.monitoring.dashboard.v1.GetDashboardRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsResponse; +import com.google.monitoring.dashboard.v1.UpdateDashboardRequest; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Stackdriver Monitoring Dashboards API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcDashboardsServiceStub extends DashboardsServiceStub { + + private static final MethodDescriptor + createDashboardMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.dashboard.v1.DashboardsService/CreateDashboard") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDashboardRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dashboard.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listDashboardsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.dashboard.v1.DashboardsService/ListDashboards") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDashboardsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDashboardsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getDashboardMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.dashboard.v1.DashboardsService/GetDashboard") + .setRequestMarshaller(ProtoUtils.marshaller(GetDashboardRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dashboard.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteDashboardMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.dashboard.v1.DashboardsService/DeleteDashboard") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDashboardRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateDashboardMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.monitoring.dashboard.v1.DashboardsService/UpdateDashboard") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDashboardRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dashboard.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createDashboardCallable; + private final UnaryCallable listDashboardsCallable; + private final UnaryCallable + listDashboardsPagedCallable; + private final UnaryCallable getDashboardCallable; + private final UnaryCallable deleteDashboardCallable; + private final UnaryCallable updateDashboardCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDashboardsServiceStub create(DashboardsServiceStubSettings settings) + throws IOException { + return new GrpcDashboardsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDashboardsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDashboardsServiceStub( + DashboardsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDashboardsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDashboardsServiceStub( + DashboardsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDashboardsServiceStub, 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 GrpcDashboardsServiceStub( + DashboardsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcDashboardsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDashboardsServiceStub, 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 GrpcDashboardsServiceStub( + DashboardsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createDashboardTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDashboardMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateDashboardRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listDashboardsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDashboardsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListDashboardsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getDashboardTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDashboardMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetDashboardRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteDashboardTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDashboardMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteDashboardRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateDashboardTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDashboardMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateDashboardRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("dashboard.name", String.valueOf(request.getDashboard().getName())); + return params.build(); + } + }) + .build(); + + this.createDashboardCallable = + callableFactory.createUnaryCallable( + createDashboardTransportSettings, settings.createDashboardSettings(), clientContext); + this.listDashboardsCallable = + callableFactory.createUnaryCallable( + listDashboardsTransportSettings, settings.listDashboardsSettings(), clientContext); + this.listDashboardsPagedCallable = + callableFactory.createPagedCallable( + listDashboardsTransportSettings, settings.listDashboardsSettings(), clientContext); + this.getDashboardCallable = + callableFactory.createUnaryCallable( + getDashboardTransportSettings, settings.getDashboardSettings(), clientContext); + this.deleteDashboardCallable = + callableFactory.createUnaryCallable( + deleteDashboardTransportSettings, settings.deleteDashboardSettings(), clientContext); + this.updateDashboardCallable = + callableFactory.createUnaryCallable( + updateDashboardTransportSettings, settings.updateDashboardSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createDashboardCallable() { + return createDashboardCallable; + } + + public UnaryCallable + listDashboardsPagedCallable() { + return listDashboardsPagedCallable; + } + + public UnaryCallable listDashboardsCallable() { + return listDashboardsCallable; + } + + public UnaryCallable getDashboardCallable() { + return getDashboardCallable; + } + + public UnaryCallable deleteDashboardCallable() { + return deleteDashboardCallable; + } + + public UnaryCallable updateDashboardCallable() { + return updateDashboardCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClientTest.java b/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClientTest.java new file mode 100644 index 00000000..ac61321e --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClientTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +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 java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; + +@javax.annotation.Generated("by GAPIC") +public class DashboardsServiceClientTest { + private static MockDashboardsService mockDashboardsService; + private static MockServiceHelper serviceHelper; + private DashboardsServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockDashboardsService = new MockDashboardsService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockDashboardsService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + DashboardsServiceSettings settings = + DashboardsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DashboardsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } +} diff --git a/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/MockDashboardsService.java b/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/MockDashboardsService.java new file mode 100644 index 00000000..f0687698 --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/MockDashboardsService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.monitoring.dashboard.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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockDashboardsService implements MockGrpcService { + private final MockDashboardsServiceImpl serviceImpl; + + public MockDashboardsService() { + serviceImpl = new MockDashboardsServiceImpl(); + } + + @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/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/MockDashboardsServiceImpl.java b/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/MockDashboardsServiceImpl.java new file mode 100644 index 00000000..feae838f --- /dev/null +++ b/google-cloud-monitoring-dashboard/src/test/java/com/google/cloud/monitoring/dashboard/v1/MockDashboardsServiceImpl.java @@ -0,0 +1,141 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1; + +import com.google.api.core.BetaApi; +import com.google.monitoring.dashboard.v1.CreateDashboardRequest; +import com.google.monitoring.dashboard.v1.Dashboard; +import com.google.monitoring.dashboard.v1.DashboardsServiceGrpc.DashboardsServiceImplBase; +import com.google.monitoring.dashboard.v1.DeleteDashboardRequest; +import com.google.monitoring.dashboard.v1.GetDashboardRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsRequest; +import com.google.monitoring.dashboard.v1.ListDashboardsResponse; +import com.google.monitoring.dashboard.v1.UpdateDashboardRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockDashboardsServiceImpl extends DashboardsServiceImplBase { + private List requests; + private Queue responses; + + public MockDashboardsServiceImpl() { + 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 createDashboard( + CreateDashboardRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Dashboard) { + requests.add(request); + responseObserver.onNext((Dashboard) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listDashboards( + ListDashboardsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListDashboardsResponse) { + requests.add(request); + responseObserver.onNext((ListDashboardsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getDashboard( + GetDashboardRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Dashboard) { + requests.add(request); + responseObserver.onNext((Dashboard) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteDashboard( + DeleteDashboardRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateDashboard( + UpdateDashboardRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Dashboard) { + requests.add(request); + responseObserver.onNext((Dashboard) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-monitoring-dashboard-v1/pom.xml b/grpc-google-cloud-monitoring-dashboard-v1/pom.xml new file mode 100644 index 00000000..f6ad7942 --- /dev/null +++ b/grpc-google-cloud-monitoring-dashboard-v1/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-monitoring-dashboard-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-monitoring-dashboard-v1 + GRPC library for grpc-google-cloud-monitoring-dashboard-v1 + + com.google.cloud + google-cloud-monitoring-dashboard-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-cloud-monitoring-dashboard-v1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-common-protos + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceGrpc.java b/grpc-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceGrpc.java new file mode 100644 index 00000000..5b095a87 --- /dev/null +++ b/grpc-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceGrpc.java @@ -0,0 +1,884 @@ +/* + * Copyright 2019 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.monitoring.dashboard.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Manages Stackdriver dashboards. A dashboard is an arrangement of data display
+ * widgets in a specific layout.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/monitoring/dashboard/v1/dashboards_service.proto") +public final class DashboardsServiceGrpc { + + private DashboardsServiceGrpc() {} + + public static final String SERVICE_NAME = "google.monitoring.dashboard.v1.DashboardsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.CreateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getCreateDashboardMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDashboard", + requestType = com.google.monitoring.dashboard.v1.CreateDashboardRequest.class, + responseType = com.google.monitoring.dashboard.v1.Dashboard.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.CreateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getCreateDashboardMethod() { + io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.CreateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getCreateDashboardMethod; + if ((getCreateDashboardMethod = DashboardsServiceGrpc.getCreateDashboardMethod) == null) { + synchronized (DashboardsServiceGrpc.class) { + if ((getCreateDashboardMethod = DashboardsServiceGrpc.getCreateDashboardMethod) == null) { + DashboardsServiceGrpc.getCreateDashboardMethod = + getCreateDashboardMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDashboard")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.CreateDashboardRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance())) + .setSchemaDescriptor( + new DashboardsServiceMethodDescriptorSupplier("CreateDashboard")) + .build(); + } + } + } + return getCreateDashboardMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.ListDashboardsRequest, + com.google.monitoring.dashboard.v1.ListDashboardsResponse> + getListDashboardsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDashboards", + requestType = com.google.monitoring.dashboard.v1.ListDashboardsRequest.class, + responseType = com.google.monitoring.dashboard.v1.ListDashboardsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.ListDashboardsRequest, + com.google.monitoring.dashboard.v1.ListDashboardsResponse> + getListDashboardsMethod() { + io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.ListDashboardsRequest, + com.google.monitoring.dashboard.v1.ListDashboardsResponse> + getListDashboardsMethod; + if ((getListDashboardsMethod = DashboardsServiceGrpc.getListDashboardsMethod) == null) { + synchronized (DashboardsServiceGrpc.class) { + if ((getListDashboardsMethod = DashboardsServiceGrpc.getListDashboardsMethod) == null) { + DashboardsServiceGrpc.getListDashboardsMethod = + getListDashboardsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDashboards")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.ListDashboardsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.ListDashboardsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DashboardsServiceMethodDescriptorSupplier("ListDashboards")) + .build(); + } + } + } + return getListDashboardsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.GetDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getGetDashboardMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDashboard", + requestType = com.google.monitoring.dashboard.v1.GetDashboardRequest.class, + responseType = com.google.monitoring.dashboard.v1.Dashboard.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.GetDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getGetDashboardMethod() { + io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.GetDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getGetDashboardMethod; + if ((getGetDashboardMethod = DashboardsServiceGrpc.getGetDashboardMethod) == null) { + synchronized (DashboardsServiceGrpc.class) { + if ((getGetDashboardMethod = DashboardsServiceGrpc.getGetDashboardMethod) == null) { + DashboardsServiceGrpc.getGetDashboardMethod = + getGetDashboardMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDashboard")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.GetDashboardRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance())) + .setSchemaDescriptor( + new DashboardsServiceMethodDescriptorSupplier("GetDashboard")) + .build(); + } + } + } + return getGetDashboardMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.DeleteDashboardRequest, com.google.protobuf.Empty> + getDeleteDashboardMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDashboard", + requestType = com.google.monitoring.dashboard.v1.DeleteDashboardRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.DeleteDashboardRequest, com.google.protobuf.Empty> + getDeleteDashboardMethod() { + io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.DeleteDashboardRequest, com.google.protobuf.Empty> + getDeleteDashboardMethod; + if ((getDeleteDashboardMethod = DashboardsServiceGrpc.getDeleteDashboardMethod) == null) { + synchronized (DashboardsServiceGrpc.class) { + if ((getDeleteDashboardMethod = DashboardsServiceGrpc.getDeleteDashboardMethod) == null) { + DashboardsServiceGrpc.getDeleteDashboardMethod = + getDeleteDashboardMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDashboard")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.DeleteDashboardRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DashboardsServiceMethodDescriptorSupplier("DeleteDashboard")) + .build(); + } + } + } + return getDeleteDashboardMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.UpdateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getUpdateDashboardMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDashboard", + requestType = com.google.monitoring.dashboard.v1.UpdateDashboardRequest.class, + responseType = com.google.monitoring.dashboard.v1.Dashboard.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.UpdateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getUpdateDashboardMethod() { + io.grpc.MethodDescriptor< + com.google.monitoring.dashboard.v1.UpdateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard> + getUpdateDashboardMethod; + if ((getUpdateDashboardMethod = DashboardsServiceGrpc.getUpdateDashboardMethod) == null) { + synchronized (DashboardsServiceGrpc.class) { + if ((getUpdateDashboardMethod = DashboardsServiceGrpc.getUpdateDashboardMethod) == null) { + DashboardsServiceGrpc.getUpdateDashboardMethod = + getUpdateDashboardMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDashboard")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.UpdateDashboardRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance())) + .setSchemaDescriptor( + new DashboardsServiceMethodDescriptorSupplier("UpdateDashboard")) + .build(); + } + } + } + return getUpdateDashboardMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DashboardsServiceStub newStub(io.grpc.Channel channel) { + return new DashboardsServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DashboardsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new DashboardsServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DashboardsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new DashboardsServiceFutureStub(channel); + } + + /** + * + * + *
+   * Manages Stackdriver dashboards. A dashboard is an arrangement of data display
+   * widgets in a specific layout.
+   * 
+ */ + public abstract static class DashboardsServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a new custom dashboard.
+     * This method requires the `monitoring.dashboards.create` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void createDashboard( + com.google.monitoring.dashboard.v1.CreateDashboardRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateDashboardMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the existing dashboards.
+     * This method requires the `monitoring.dashboards.list` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void listDashboards( + com.google.monitoring.dashboard.v1.ListDashboardsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListDashboardsMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches a specific dashboard.
+     * This method requires the `monitoring.dashboards.get` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void getDashboard( + com.google.monitoring.dashboard.v1.GetDashboardRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetDashboardMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an existing custom dashboard.
+     * This method requires the `monitoring.dashboards.delete` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void deleteDashboard( + com.google.monitoring.dashboard.v1.DeleteDashboardRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteDashboardMethod(), responseObserver); + } + + /** + * + * + *
+     * Replaces an existing custom dashboard with a new definition.
+     * This method requires the `monitoring.dashboards.update` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void updateDashboard( + com.google.monitoring.dashboard.v1.UpdateDashboardRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateDashboardMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateDashboardMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.dashboard.v1.CreateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard>( + this, METHODID_CREATE_DASHBOARD))) + .addMethod( + getListDashboardsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.dashboard.v1.ListDashboardsRequest, + com.google.monitoring.dashboard.v1.ListDashboardsResponse>( + this, METHODID_LIST_DASHBOARDS))) + .addMethod( + getGetDashboardMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.dashboard.v1.GetDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard>(this, METHODID_GET_DASHBOARD))) + .addMethod( + getDeleteDashboardMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.dashboard.v1.DeleteDashboardRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DASHBOARD))) + .addMethod( + getUpdateDashboardMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.monitoring.dashboard.v1.UpdateDashboardRequest, + com.google.monitoring.dashboard.v1.Dashboard>( + this, METHODID_UPDATE_DASHBOARD))) + .build(); + } + } + + /** + * + * + *
+   * Manages Stackdriver dashboards. A dashboard is an arrangement of data display
+   * widgets in a specific layout.
+   * 
+ */ + public static final class DashboardsServiceStub + extends io.grpc.stub.AbstractStub { + private DashboardsServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private DashboardsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DashboardsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DashboardsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new custom dashboard.
+     * This method requires the `monitoring.dashboards.create` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void createDashboard( + com.google.monitoring.dashboard.v1.CreateDashboardRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateDashboardMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the existing dashboards.
+     * This method requires the `monitoring.dashboards.list` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void listDashboards( + com.google.monitoring.dashboard.v1.ListDashboardsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListDashboardsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches a specific dashboard.
+     * This method requires the `monitoring.dashboards.get` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void getDashboard( + com.google.monitoring.dashboard.v1.GetDashboardRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetDashboardMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an existing custom dashboard.
+     * This method requires the `monitoring.dashboards.delete` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void deleteDashboard( + com.google.monitoring.dashboard.v1.DeleteDashboardRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteDashboardMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Replaces an existing custom dashboard with a new definition.
+     * This method requires the `monitoring.dashboards.update` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public void updateDashboard( + com.google.monitoring.dashboard.v1.UpdateDashboardRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateDashboardMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages Stackdriver dashboards. A dashboard is an arrangement of data display
+   * widgets in a specific layout.
+   * 
+ */ + public static final class DashboardsServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private DashboardsServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private DashboardsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DashboardsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DashboardsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new custom dashboard.
+     * This method requires the `monitoring.dashboards.create` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.monitoring.dashboard.v1.Dashboard createDashboard( + com.google.monitoring.dashboard.v1.CreateDashboardRequest request) { + return blockingUnaryCall(getChannel(), getCreateDashboardMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the existing dashboards.
+     * This method requires the `monitoring.dashboards.list` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.monitoring.dashboard.v1.ListDashboardsResponse listDashboards( + com.google.monitoring.dashboard.v1.ListDashboardsRequest request) { + return blockingUnaryCall(getChannel(), getListDashboardsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches a specific dashboard.
+     * This method requires the `monitoring.dashboards.get` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboard( + com.google.monitoring.dashboard.v1.GetDashboardRequest request) { + return blockingUnaryCall(getChannel(), getGetDashboardMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an existing custom dashboard.
+     * This method requires the `monitoring.dashboards.delete` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.protobuf.Empty deleteDashboard( + com.google.monitoring.dashboard.v1.DeleteDashboardRequest request) { + return blockingUnaryCall(getChannel(), getDeleteDashboardMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Replaces an existing custom dashboard with a new definition.
+     * This method requires the `monitoring.dashboards.update` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.monitoring.dashboard.v1.Dashboard updateDashboard( + com.google.monitoring.dashboard.v1.UpdateDashboardRequest request) { + return blockingUnaryCall(getChannel(), getUpdateDashboardMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages Stackdriver dashboards. A dashboard is an arrangement of data display
+   * widgets in a specific layout.
+   * 
+ */ + public static final class DashboardsServiceFutureStub + extends io.grpc.stub.AbstractStub { + private DashboardsServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private DashboardsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DashboardsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DashboardsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new custom dashboard.
+     * This method requires the `monitoring.dashboards.create` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.dashboard.v1.Dashboard> + createDashboard(com.google.monitoring.dashboard.v1.CreateDashboardRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateDashboardMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the existing dashboards.
+     * This method requires the `monitoring.dashboards.list` permission
+     * on the specified project. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.dashboard.v1.ListDashboardsResponse> + listDashboards(com.google.monitoring.dashboard.v1.ListDashboardsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListDashboardsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fetches a specific dashboard.
+     * This method requires the `monitoring.dashboards.get` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.dashboard.v1.Dashboard> + getDashboard(com.google.monitoring.dashboard.v1.GetDashboardRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetDashboardMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an existing custom dashboard.
+     * This method requires the `monitoring.dashboards.delete` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDashboard(com.google.monitoring.dashboard.v1.DeleteDashboardRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteDashboardMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Replaces an existing custom dashboard with a new definition.
+     * This method requires the `monitoring.dashboards.update` permission
+     * on the specified dashboard. For more information, see
+     * [Google Cloud IAM](https://cloud.google.com/iam).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.monitoring.dashboard.v1.Dashboard> + updateDashboard(com.google.monitoring.dashboard.v1.UpdateDashboardRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateDashboardMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_DASHBOARD = 0; + private static final int METHODID_LIST_DASHBOARDS = 1; + private static final int METHODID_GET_DASHBOARD = 2; + private static final int METHODID_DELETE_DASHBOARD = 3; + private static final int METHODID_UPDATE_DASHBOARD = 4; + + 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 DashboardsServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DashboardsServiceImplBase 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_CREATE_DASHBOARD: + serviceImpl.createDashboard( + (com.google.monitoring.dashboard.v1.CreateDashboardRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_DASHBOARDS: + serviceImpl.listDashboards( + (com.google.monitoring.dashboard.v1.ListDashboardsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.monitoring.dashboard.v1.ListDashboardsResponse>) + responseObserver); + break; + case METHODID_GET_DASHBOARD: + serviceImpl.getDashboard( + (com.google.monitoring.dashboard.v1.GetDashboardRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DASHBOARD: + serviceImpl.deleteDashboard( + (com.google.monitoring.dashboard.v1.DeleteDashboardRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_DASHBOARD: + serviceImpl.updateDashboard( + (com.google.monitoring.dashboard.v1.UpdateDashboardRequest) 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(); + } + } + } + + private abstract static class DashboardsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DashboardsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DashboardsService"); + } + } + + private static final class DashboardsServiceFileDescriptorSupplier + extends DashboardsServiceBaseDescriptorSupplier { + DashboardsServiceFileDescriptorSupplier() {} + } + + private static final class DashboardsServiceMethodDescriptorSupplier + extends DashboardsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DashboardsServiceMethodDescriptorSupplier(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 (DashboardsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DashboardsServiceFileDescriptorSupplier()) + .addMethod(getCreateDashboardMethod()) + .addMethod(getListDashboardsMethod()) + .addMethod(getGetDashboardMethod()) + .addMethod(getDeleteDashboardMethod()) + .addMethod(getUpdateDashboardMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* 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\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..48894dc9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,256 @@ + + + 4.0.0 + com.google.cloud + google-cloud-monitoring-dashboard-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Monitoring dashboard Parent + https://github.com/googleapis/java-monitoring-dashboard + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.3.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-monitoring-dashboard.git + scm:git:git@github.com:googleapis/java-monitoring-dashboard.git + https://github.com/googleapis/java-monitoring-dashboard + HEAD + + + https://github.com/googleapis/java-monitoring-dashboard/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-monitoring-dashboard-parent + 1.92.0 + 1.8.1 + 1.17.0 + 1.52.0 + 1.26.0 + 3.11.1 + 4.12 + 28.1-android + 1.4.0 + 1.3.2 + 1.18 + + + + + + com.google.api.grpc + proto-google-cloud-monitoring-dashboard-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-monitoring-dashboard-v1 + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-monitoring-dashboard + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + com.google.api + gax-bom + ${gax.version} + pom + import + + + com.google.guava + guava-bom + ${guava.version} + pom + import + + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.api + api-common + ${google.api-common.version} + + + com.google.api.grpc + proto-google-common-protos + ${google.common-protos.version} + + + org.threeten + threetenbp + ${threeten.version} + + + javax.annotation + javax.annotation-api + ${javax.annotations.version} + + + org.codehaus.mojo + animal-sniffer-annotations + ${animal-sniffer.version} + + + + junit + junit + ${junit.version} + test + + + com.google.api + gax-grpc + ${gax.version} + testlib + test + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + proto-google-cloud-monitoring-dashboard-v1 + grpc-google-cloud-monitoring-dashboard-v1 + google-cloud-monitoring-dashboard + google-cloud-monitoring-dashboard-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-monitoring-dashboard-v1/pom.xml b/proto-google-cloud-monitoring-dashboard-v1/pom.xml new file mode 100644 index 00000000..e65b4dd6 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-monitoring-dashboard-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-monitoring-dashboard-v1 + PROTO library for proto-google-cloud-monitoring-dashboard-v1 + + com.google.cloud + google-cloud-monitoring-dashboard-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.guava + guava + + + com.google.api + api-common + + + \ No newline at end of file diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Aggregation.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Aggregation.java new file mode 100644 index 00000000..38c0767e --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Aggregation.java @@ -0,0 +1,2864 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * Describes how to combine multiple time series to provide different views of
+ * the data.  Aggregation consists of an alignment step on individual time
+ * series (`alignment_period` and `per_series_aligner`) followed by an optional
+ * reduction step of the data across the aligned time series
+ * (`cross_series_reducer` and `group_by_fields`).  For more details, see
+ * [Aggregation](/monitoring/api/learn_more#aggregation).
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Aggregation} + */ +public final class Aggregation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Aggregation) + AggregationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Aggregation.newBuilder() to construct. + private Aggregation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Aggregation() { + perSeriesAligner_ = 0; + crossSeriesReducer_ = 0; + groupByFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Aggregation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Aggregation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (alignmentPeriod_ != null) { + subBuilder = alignmentPeriod_.toBuilder(); + } + alignmentPeriod_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(alignmentPeriod_); + alignmentPeriod_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + perSeriesAligner_ = rawValue; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + crossSeriesReducer_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + groupByFields_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + groupByFields_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + groupByFields_ = groupByFields_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_Aggregation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_Aggregation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Aggregation.class, + com.google.monitoring.dashboard.v1.Aggregation.Builder.class); + } + + /** + * + * + *
+   * The Aligner describes how to bring the data points in a single
+   * time series into temporal alignment.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.Aggregation.Aligner} + */ + public enum Aligner implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No alignment. Raw data is returned. Not valid if cross-time
+     * series reduction is requested. The value type of the result is
+     * the same as the value type of the input.
+     * 
+ * + * ALIGN_NONE = 0; + */ + ALIGN_NONE(0), + /** + * + * + *
+     * Align and convert to delta metric type. This alignment is valid
+     * for cumulative metrics and delta metrics. Aligning an existing
+     * delta metric to a delta metric requires that the alignment
+     * period be increased. The value type of the result is the same
+     * as the value type of the input.
+     * One can think of this aligner as a rate but without time units; that
+     * is, the output is conceptually (second_point - first_point).
+     * 
+ * + * ALIGN_DELTA = 1; + */ + ALIGN_DELTA(1), + /** + * + * + *
+     * Align and convert to a rate. This alignment is valid for
+     * cumulative metrics and delta metrics with numeric values. The output is a
+     * gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * One can think of this aligner as conceptually providing the slope of
+     * the line that passes through the value at the start and end of the
+     * window. In other words, this is conceptually ((y1 - y0)/(t1 - t0)),
+     * and the output unit is one that has a "/time" dimension.
+     * If, by rate, you are looking for percentage change, see the
+     * `ALIGN_PERCENT_CHANGE` aligner option.
+     * 
+ * + * ALIGN_RATE = 2; + */ + ALIGN_RATE(2), + /** + * + * + *
+     * Align by interpolating between adjacent points around the
+     * period boundary. This alignment is valid for gauge
+     * metrics with numeric values. The value type of the result is the same
+     * as the value type of the input.
+     * 
+ * + * ALIGN_INTERPOLATE = 3; + */ + ALIGN_INTERPOLATE(3), + /** + * + * + *
+     * Align by shifting the oldest data point before the period
+     * boundary to the boundary. This alignment is valid for gauge
+     * metrics. The value type of the result is the same as the
+     * value type of the input.
+     * 
+ * + * ALIGN_NEXT_OLDER = 4; + */ + ALIGN_NEXT_OLDER(4), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the minimum of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * values. The value type of the result is the same as the value
+     * type of the input.
+     * 
+ * + * ALIGN_MIN = 10; + */ + ALIGN_MIN(10), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the maximum of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * values. The value type of the result is the same as the value
+     * type of the input.
+     * 
+ * + * ALIGN_MAX = 11; + */ + ALIGN_MAX(11), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the average or arithmetic mean of all
+     * data points in the period. This alignment is valid for gauge and delta
+     * metrics with numeric values. The value type of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_MEAN = 12; + */ + ALIGN_MEAN(12), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the count of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * or Boolean values. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * ALIGN_COUNT = 13; + */ + ALIGN_COUNT(13), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the sum of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * and distribution values. The value type of the output is the
+     * same as the value type of the input.
+     * 
+ * + * ALIGN_SUM = 14; + */ + ALIGN_SUM(14), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the standard deviation of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with numeric values. The value type of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_STDDEV = 15; + */ + ALIGN_STDDEV(15), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the count of True-valued data points in the
+     * period. This alignment is valid for gauge metrics with
+     * Boolean values. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * ALIGN_COUNT_TRUE = 16; + */ + ALIGN_COUNT_TRUE(16), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the count of False-valued data points in the
+     * period. This alignment is valid for gauge metrics with
+     * Boolean values. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * ALIGN_COUNT_FALSE = 24; + */ + ALIGN_COUNT_FALSE(24), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the fraction of True-valued data points in the
+     * period. This alignment is valid for gauge metrics with Boolean values.
+     * The output value is in the range [0, 1] and has value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_FRACTION_TRUE = 17; + */ + ALIGN_FRACTION_TRUE(17), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 99th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_99 = 18; + */ + ALIGN_PERCENTILE_99(18), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 95th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_95 = 19; + */ + ALIGN_PERCENTILE_95(19), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 50th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_50 = 20; + */ + ALIGN_PERCENTILE_50(20), + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 5th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_05 = 21; + */ + ALIGN_PERCENTILE_05(21), + /** + * + * + *
+     * Align and convert to a percentage change. This alignment is valid for
+     * gauge and delta metrics with numeric values. This alignment conceptually
+     * computes the equivalent of "((current - previous)/previous)*100"
+     * where previous value is determined based on the alignmentPeriod.
+     * In the event that previous is 0 the calculated value is infinity with the
+     * exception that if both (current - previous) and previous are 0 the
+     * calculated value is 0.
+     * A 10 minute moving mean is computed at each point of the time window
+     * prior to the above calculation to smooth the metric and prevent false
+     * positives from very short lived spikes.
+     * Only applicable for data that is >= 0. Any values < 0 are treated as
+     * no data. While delta metrics are accepted by this alignment special care
+     * should be taken that the values for the metric will always be positive.
+     * The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENT_CHANGE = 23; + */ + ALIGN_PERCENT_CHANGE(23), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No alignment. Raw data is returned. Not valid if cross-time
+     * series reduction is requested. The value type of the result is
+     * the same as the value type of the input.
+     * 
+ * + * ALIGN_NONE = 0; + */ + public static final int ALIGN_NONE_VALUE = 0; + /** + * + * + *
+     * Align and convert to delta metric type. This alignment is valid
+     * for cumulative metrics and delta metrics. Aligning an existing
+     * delta metric to a delta metric requires that the alignment
+     * period be increased. The value type of the result is the same
+     * as the value type of the input.
+     * One can think of this aligner as a rate but without time units; that
+     * is, the output is conceptually (second_point - first_point).
+     * 
+ * + * ALIGN_DELTA = 1; + */ + public static final int ALIGN_DELTA_VALUE = 1; + /** + * + * + *
+     * Align and convert to a rate. This alignment is valid for
+     * cumulative metrics and delta metrics with numeric values. The output is a
+     * gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * One can think of this aligner as conceptually providing the slope of
+     * the line that passes through the value at the start and end of the
+     * window. In other words, this is conceptually ((y1 - y0)/(t1 - t0)),
+     * and the output unit is one that has a "/time" dimension.
+     * If, by rate, you are looking for percentage change, see the
+     * `ALIGN_PERCENT_CHANGE` aligner option.
+     * 
+ * + * ALIGN_RATE = 2; + */ + public static final int ALIGN_RATE_VALUE = 2; + /** + * + * + *
+     * Align by interpolating between adjacent points around the
+     * period boundary. This alignment is valid for gauge
+     * metrics with numeric values. The value type of the result is the same
+     * as the value type of the input.
+     * 
+ * + * ALIGN_INTERPOLATE = 3; + */ + public static final int ALIGN_INTERPOLATE_VALUE = 3; + /** + * + * + *
+     * Align by shifting the oldest data point before the period
+     * boundary to the boundary. This alignment is valid for gauge
+     * metrics. The value type of the result is the same as the
+     * value type of the input.
+     * 
+ * + * ALIGN_NEXT_OLDER = 4; + */ + public static final int ALIGN_NEXT_OLDER_VALUE = 4; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the minimum of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * values. The value type of the result is the same as the value
+     * type of the input.
+     * 
+ * + * ALIGN_MIN = 10; + */ + public static final int ALIGN_MIN_VALUE = 10; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the maximum of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * values. The value type of the result is the same as the value
+     * type of the input.
+     * 
+ * + * ALIGN_MAX = 11; + */ + public static final int ALIGN_MAX_VALUE = 11; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the average or arithmetic mean of all
+     * data points in the period. This alignment is valid for gauge and delta
+     * metrics with numeric values. The value type of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_MEAN = 12; + */ + public static final int ALIGN_MEAN_VALUE = 12; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the count of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * or Boolean values. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * ALIGN_COUNT = 13; + */ + public static final int ALIGN_COUNT_VALUE = 13; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the sum of all data points in the
+     * period. This alignment is valid for gauge and delta metrics with numeric
+     * and distribution values. The value type of the output is the
+     * same as the value type of the input.
+     * 
+ * + * ALIGN_SUM = 14; + */ + public static final int ALIGN_SUM_VALUE = 14; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the standard deviation of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with numeric values. The value type of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_STDDEV = 15; + */ + public static final int ALIGN_STDDEV_VALUE = 15; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the count of True-valued data points in the
+     * period. This alignment is valid for gauge metrics with
+     * Boolean values. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * ALIGN_COUNT_TRUE = 16; + */ + public static final int ALIGN_COUNT_TRUE_VALUE = 16; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the count of False-valued data points in the
+     * period. This alignment is valid for gauge metrics with
+     * Boolean values. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * ALIGN_COUNT_FALSE = 24; + */ + public static final int ALIGN_COUNT_FALSE_VALUE = 24; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the fraction of True-valued data points in the
+     * period. This alignment is valid for gauge metrics with Boolean values.
+     * The output value is in the range [0, 1] and has value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_FRACTION_TRUE = 17; + */ + public static final int ALIGN_FRACTION_TRUE_VALUE = 17; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 99th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_99 = 18; + */ + public static final int ALIGN_PERCENTILE_99_VALUE = 18; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 95th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_95 = 19; + */ + public static final int ALIGN_PERCENTILE_95_VALUE = 19; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 50th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_50 = 20; + */ + public static final int ALIGN_PERCENTILE_50_VALUE = 20; + /** + * + * + *
+     * Align time series via aggregation. The resulting data point in
+     * the alignment period is the 5th percentile of all data
+     * points in the period. This alignment is valid for gauge and delta metrics
+     * with distribution values. The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENTILE_05 = 21; + */ + public static final int ALIGN_PERCENTILE_05_VALUE = 21; + /** + * + * + *
+     * Align and convert to a percentage change. This alignment is valid for
+     * gauge and delta metrics with numeric values. This alignment conceptually
+     * computes the equivalent of "((current - previous)/previous)*100"
+     * where previous value is determined based on the alignmentPeriod.
+     * In the event that previous is 0 the calculated value is infinity with the
+     * exception that if both (current - previous) and previous are 0 the
+     * calculated value is 0.
+     * A 10 minute moving mean is computed at each point of the time window
+     * prior to the above calculation to smooth the metric and prevent false
+     * positives from very short lived spikes.
+     * Only applicable for data that is >= 0. Any values < 0 are treated as
+     * no data. While delta metrics are accepted by this alignment special care
+     * should be taken that the values for the metric will always be positive.
+     * The output is a gauge metric with value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * ALIGN_PERCENT_CHANGE = 23; + */ + public static final int ALIGN_PERCENT_CHANGE_VALUE = 23; + + 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 Aligner 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 Aligner forNumber(int value) { + switch (value) { + case 0: + return ALIGN_NONE; + case 1: + return ALIGN_DELTA; + case 2: + return ALIGN_RATE; + case 3: + return ALIGN_INTERPOLATE; + case 4: + return ALIGN_NEXT_OLDER; + case 10: + return ALIGN_MIN; + case 11: + return ALIGN_MAX; + case 12: + return ALIGN_MEAN; + case 13: + return ALIGN_COUNT; + case 14: + return ALIGN_SUM; + case 15: + return ALIGN_STDDEV; + case 16: + return ALIGN_COUNT_TRUE; + case 24: + return ALIGN_COUNT_FALSE; + case 17: + return ALIGN_FRACTION_TRUE; + case 18: + return ALIGN_PERCENTILE_99; + case 19: + return ALIGN_PERCENTILE_95; + case 20: + return ALIGN_PERCENTILE_50; + case 21: + return ALIGN_PERCENTILE_05; + case 23: + return ALIGN_PERCENT_CHANGE; + 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 Aligner findValueByNumber(int number) { + return Aligner.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.Aggregation.getDescriptor().getEnumTypes().get(0); + } + + private static final Aligner[] VALUES = values(); + + public static Aligner 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 Aligner(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.Aggregation.Aligner) + } + + /** + * + * + *
+   * A Reducer describes how to aggregate data points from multiple
+   * time series into a single time series.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.Aggregation.Reducer} + */ + public enum Reducer implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No cross-time series reduction. The output of the aligner is
+     * returned.
+     * 
+ * + * REDUCE_NONE = 0; + */ + REDUCE_NONE(0), + /** + * + * + *
+     * Reduce by computing the mean across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric or distribution values. The value type of the
+     * output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * REDUCE_MEAN = 1; + */ + REDUCE_MEAN(1), + /** + * + * + *
+     * Reduce by computing the minimum across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric values. The value type of the output
+     * is the same as the value type of the input.
+     * 
+ * + * REDUCE_MIN = 2; + */ + REDUCE_MIN(2), + /** + * + * + *
+     * Reduce by computing the maximum across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric values. The value type of the output
+     * is the same as the value type of the input.
+     * 
+ * + * REDUCE_MAX = 3; + */ + REDUCE_MAX(3), + /** + * + * + *
+     * Reduce by computing the sum across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric and distribution values. The value type of
+     * the output is the same as the value type of the input.
+     * 
+ * + * REDUCE_SUM = 4; + */ + REDUCE_SUM(4), + /** + * + * + *
+     * Reduce by computing the standard deviation across time series
+     * for each alignment period. This reducer is valid for delta
+     * and gauge metrics with numeric or distribution values. The value type of
+     * the output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * REDUCE_STDDEV = 5; + */ + REDUCE_STDDEV(5), + /** + * + * + *
+     * Reduce by computing the count of data points across time series
+     * for each alignment period. This reducer is valid for delta
+     * and gauge metrics of numeric, Boolean, distribution, and string value
+     * type. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * REDUCE_COUNT = 6; + */ + REDUCE_COUNT(6), + /** + * + * + *
+     * Reduce by computing the count of True-valued data points across time
+     * series for each alignment period. This reducer is valid for delta
+     * and gauge metrics of Boolean value type. The value type of
+     * the output is [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * REDUCE_COUNT_TRUE = 7; + */ + REDUCE_COUNT_TRUE(7), + /** + * + * + *
+     * Reduce by computing the count of False-valued data points across time
+     * series for each alignment period. This reducer is valid for delta
+     * and gauge metrics of Boolean value type. The value type of
+     * the output is [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * REDUCE_COUNT_FALSE = 15; + */ + REDUCE_COUNT_FALSE(15), + /** + * + * + *
+     * Reduce by computing the fraction of True-valued data points across time
+     * series for each alignment period. This reducer is valid for delta
+     * and gauge metrics of Boolean value type. The output value is in the
+     * range [0, 1] and has value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * REDUCE_FRACTION_TRUE = 8; + */ + REDUCE_FRACTION_TRUE(8), + /** + * + * + *
+     * Reduce by computing 99th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_99 = 9; + */ + REDUCE_PERCENTILE_99(9), + /** + * + * + *
+     * Reduce by computing 95th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_95 = 10; + */ + REDUCE_PERCENTILE_95(10), + /** + * + * + *
+     * Reduce by computing 50th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_50 = 11; + */ + REDUCE_PERCENTILE_50(11), + /** + * + * + *
+     * Reduce by computing 5th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_05 = 12; + */ + REDUCE_PERCENTILE_05(12), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No cross-time series reduction. The output of the aligner is
+     * returned.
+     * 
+ * + * REDUCE_NONE = 0; + */ + public static final int REDUCE_NONE_VALUE = 0; + /** + * + * + *
+     * Reduce by computing the mean across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric or distribution values. The value type of the
+     * output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * REDUCE_MEAN = 1; + */ + public static final int REDUCE_MEAN_VALUE = 1; + /** + * + * + *
+     * Reduce by computing the minimum across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric values. The value type of the output
+     * is the same as the value type of the input.
+     * 
+ * + * REDUCE_MIN = 2; + */ + public static final int REDUCE_MIN_VALUE = 2; + /** + * + * + *
+     * Reduce by computing the maximum across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric values. The value type of the output
+     * is the same as the value type of the input.
+     * 
+ * + * REDUCE_MAX = 3; + */ + public static final int REDUCE_MAX_VALUE = 3; + /** + * + * + *
+     * Reduce by computing the sum across time series for each
+     * alignment period. This reducer is valid for delta and
+     * gauge metrics with numeric and distribution values. The value type of
+     * the output is the same as the value type of the input.
+     * 
+ * + * REDUCE_SUM = 4; + */ + public static final int REDUCE_SUM_VALUE = 4; + /** + * + * + *
+     * Reduce by computing the standard deviation across time series
+     * for each alignment period. This reducer is valid for delta
+     * and gauge metrics with numeric or distribution values. The value type of
+     * the output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * REDUCE_STDDEV = 5; + */ + public static final int REDUCE_STDDEV_VALUE = 5; + /** + * + * + *
+     * Reduce by computing the count of data points across time series
+     * for each alignment period. This reducer is valid for delta
+     * and gauge metrics of numeric, Boolean, distribution, and string value
+     * type. The value type of the output is
+     * [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * REDUCE_COUNT = 6; + */ + public static final int REDUCE_COUNT_VALUE = 6; + /** + * + * + *
+     * Reduce by computing the count of True-valued data points across time
+     * series for each alignment period. This reducer is valid for delta
+     * and gauge metrics of Boolean value type. The value type of
+     * the output is [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * REDUCE_COUNT_TRUE = 7; + */ + public static final int REDUCE_COUNT_TRUE_VALUE = 7; + /** + * + * + *
+     * Reduce by computing the count of False-valued data points across time
+     * series for each alignment period. This reducer is valid for delta
+     * and gauge metrics of Boolean value type. The value type of
+     * the output is [INT64][google.api.MetricDescriptor.ValueType.INT64].
+     * 
+ * + * REDUCE_COUNT_FALSE = 15; + */ + public static final int REDUCE_COUNT_FALSE_VALUE = 15; + /** + * + * + *
+     * Reduce by computing the fraction of True-valued data points across time
+     * series for each alignment period. This reducer is valid for delta
+     * and gauge metrics of Boolean value type. The output value is in the
+     * range [0, 1] and has value type
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
+     * 
+ * + * REDUCE_FRACTION_TRUE = 8; + */ + public static final int REDUCE_FRACTION_TRUE_VALUE = 8; + /** + * + * + *
+     * Reduce by computing 99th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_99 = 9; + */ + public static final int REDUCE_PERCENTILE_99_VALUE = 9; + /** + * + * + *
+     * Reduce by computing 95th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_95 = 10; + */ + public static final int REDUCE_PERCENTILE_95_VALUE = 10; + /** + * + * + *
+     * Reduce by computing 50th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_50 = 11; + */ + public static final int REDUCE_PERCENTILE_50_VALUE = 11; + /** + * + * + *
+     * Reduce by computing 5th percentile of data points across time series
+     * for each alignment period. This reducer is valid for gauge and delta
+     * metrics of numeric and distribution type. The value of the output is
+     * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]
+     * 
+ * + * REDUCE_PERCENTILE_05 = 12; + */ + public static final int REDUCE_PERCENTILE_05_VALUE = 12; + + 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 Reducer 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 Reducer forNumber(int value) { + switch (value) { + case 0: + return REDUCE_NONE; + case 1: + return REDUCE_MEAN; + case 2: + return REDUCE_MIN; + case 3: + return REDUCE_MAX; + case 4: + return REDUCE_SUM; + case 5: + return REDUCE_STDDEV; + case 6: + return REDUCE_COUNT; + case 7: + return REDUCE_COUNT_TRUE; + case 15: + return REDUCE_COUNT_FALSE; + case 8: + return REDUCE_FRACTION_TRUE; + case 9: + return REDUCE_PERCENTILE_99; + case 10: + return REDUCE_PERCENTILE_95; + case 11: + return REDUCE_PERCENTILE_50; + case 12: + return REDUCE_PERCENTILE_05; + 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 Reducer findValueByNumber(int number) { + return Reducer.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.Aggregation.getDescriptor().getEnumTypes().get(1); + } + + private static final Reducer[] VALUES = values(); + + public static Reducer 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 Reducer(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.Aggregation.Reducer) + } + + public static final int ALIGNMENT_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration alignmentPeriod_; + /** + * + * + *
+   * The alignment period for per-[time series][TimeSeries]
+   * alignment. If present, `alignmentPeriod` must be at least 60
+   * seconds.  After per-time series alignment, each time series will
+   * contain data points only on the period boundaries. If
+   * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+   * this field is ignored. If `perSeriesAligner` is specified and
+   * does not equal `ALIGN_NONE`, then this field must be defined;
+   * otherwise an error is returned.
+   * 
+ * + * .google.protobuf.Duration alignment_period = 1; + * + * @return Whether the alignmentPeriod field is set. + */ + public boolean hasAlignmentPeriod() { + return alignmentPeriod_ != null; + } + /** + * + * + *
+   * The alignment period for per-[time series][TimeSeries]
+   * alignment. If present, `alignmentPeriod` must be at least 60
+   * seconds.  After per-time series alignment, each time series will
+   * contain data points only on the period boundaries. If
+   * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+   * this field is ignored. If `perSeriesAligner` is specified and
+   * does not equal `ALIGN_NONE`, then this field must be defined;
+   * otherwise an error is returned.
+   * 
+ * + * .google.protobuf.Duration alignment_period = 1; + * + * @return The alignmentPeriod. + */ + public com.google.protobuf.Duration getAlignmentPeriod() { + return alignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : alignmentPeriod_; + } + /** + * + * + *
+   * The alignment period for per-[time series][TimeSeries]
+   * alignment. If present, `alignmentPeriod` must be at least 60
+   * seconds.  After per-time series alignment, each time series will
+   * contain data points only on the period boundaries. If
+   * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+   * this field is ignored. If `perSeriesAligner` is specified and
+   * does not equal `ALIGN_NONE`, then this field must be defined;
+   * otherwise an error is returned.
+   * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public com.google.protobuf.DurationOrBuilder getAlignmentPeriodOrBuilder() { + return getAlignmentPeriod(); + } + + public static final int PER_SERIES_ALIGNER_FIELD_NUMBER = 2; + private int perSeriesAligner_; + /** + * + * + *
+   * The approach to be used to align individual time series. Not all
+   * alignment functions may be applied to all time series, depending
+   * on the metric type and value type of the original time
+   * series. Alignment may change the metric type or the value type of
+   * the time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return The enum numeric value on the wire for perSeriesAligner. + */ + public int getPerSeriesAlignerValue() { + return perSeriesAligner_; + } + /** + * + * + *
+   * The approach to be used to align individual time series. Not all
+   * alignment functions may be applied to all time series, depending
+   * on the metric type and value type of the original time
+   * series. Alignment may change the metric type or the value type of
+   * the time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return The perSeriesAligner. + */ + public com.google.monitoring.dashboard.v1.Aggregation.Aligner getPerSeriesAligner() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Aggregation.Aligner result = + com.google.monitoring.dashboard.v1.Aggregation.Aligner.valueOf(perSeriesAligner_); + return result == null + ? com.google.monitoring.dashboard.v1.Aggregation.Aligner.UNRECOGNIZED + : result; + } + + public static final int CROSS_SERIES_REDUCER_FIELD_NUMBER = 4; + private int crossSeriesReducer_; + /** + * + * + *
+   * The approach to be used to combine time series. Not all reducer
+   * functions may be applied to all time series, depending on the
+   * metric type and the value type of the original time
+   * series. Reduction may change the metric type of value type of the
+   * time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return The enum numeric value on the wire for crossSeriesReducer. + */ + public int getCrossSeriesReducerValue() { + return crossSeriesReducer_; + } + /** + * + * + *
+   * The approach to be used to combine time series. Not all reducer
+   * functions may be applied to all time series, depending on the
+   * metric type and the value type of the original time
+   * series. Reduction may change the metric type of value type of the
+   * time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return The crossSeriesReducer. + */ + public com.google.monitoring.dashboard.v1.Aggregation.Reducer getCrossSeriesReducer() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Aggregation.Reducer result = + com.google.monitoring.dashboard.v1.Aggregation.Reducer.valueOf(crossSeriesReducer_); + return result == null + ? com.google.monitoring.dashboard.v1.Aggregation.Reducer.UNRECOGNIZED + : result; + } + + public static final int GROUP_BY_FIELDS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList groupByFields_; + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @return A list containing the groupByFields. + */ + public com.google.protobuf.ProtocolStringList getGroupByFieldsList() { + return groupByFields_; + } + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @return The count of groupByFields. + */ + public int getGroupByFieldsCount() { + return groupByFields_.size(); + } + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @param index The index of the element to return. + * @return The groupByFields at the given index. + */ + public java.lang.String getGroupByFields(int index) { + return groupByFields_.get(index); + } + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @param index The index of the value to return. + * @return The bytes of the groupByFields at the given index. + */ + public com.google.protobuf.ByteString getGroupByFieldsBytes(int index) { + return groupByFields_.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 { + if (alignmentPeriod_ != null) { + output.writeMessage(1, getAlignmentPeriod()); + } + if (perSeriesAligner_ + != com.google.monitoring.dashboard.v1.Aggregation.Aligner.ALIGN_NONE.getNumber()) { + output.writeEnum(2, perSeriesAligner_); + } + if (crossSeriesReducer_ + != com.google.monitoring.dashboard.v1.Aggregation.Reducer.REDUCE_NONE.getNumber()) { + output.writeEnum(4, crossSeriesReducer_); + } + for (int i = 0; i < groupByFields_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, groupByFields_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (alignmentPeriod_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAlignmentPeriod()); + } + if (perSeriesAligner_ + != com.google.monitoring.dashboard.v1.Aggregation.Aligner.ALIGN_NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, perSeriesAligner_); + } + if (crossSeriesReducer_ + != com.google.monitoring.dashboard.v1.Aggregation.Reducer.REDUCE_NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, crossSeriesReducer_); + } + { + int dataSize = 0; + for (int i = 0; i < groupByFields_.size(); i++) { + dataSize += computeStringSizeNoTag(groupByFields_.getRaw(i)); + } + size += dataSize; + size += 1 * getGroupByFieldsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Aggregation)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Aggregation other = + (com.google.monitoring.dashboard.v1.Aggregation) obj; + + if (hasAlignmentPeriod() != other.hasAlignmentPeriod()) return false; + if (hasAlignmentPeriod()) { + if (!getAlignmentPeriod().equals(other.getAlignmentPeriod())) return false; + } + if (perSeriesAligner_ != other.perSeriesAligner_) return false; + if (crossSeriesReducer_ != other.crossSeriesReducer_) return false; + if (!getGroupByFieldsList().equals(other.getGroupByFieldsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAlignmentPeriod()) { + hash = (37 * hash) + ALIGNMENT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getAlignmentPeriod().hashCode(); + } + hash = (37 * hash) + PER_SERIES_ALIGNER_FIELD_NUMBER; + hash = (53 * hash) + perSeriesAligner_; + hash = (37 * hash) + CROSS_SERIES_REDUCER_FIELD_NUMBER; + hash = (53 * hash) + crossSeriesReducer_; + if (getGroupByFieldsCount() > 0) { + hash = (37 * hash) + GROUP_BY_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getGroupByFieldsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Aggregation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Aggregation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Aggregation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Aggregation 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.monitoring.dashboard.v1.Aggregation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Aggregation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Aggregation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Aggregation 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.monitoring.dashboard.v1.Aggregation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Aggregation 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.monitoring.dashboard.v1.Aggregation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Aggregation 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.monitoring.dashboard.v1.Aggregation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes how to combine multiple time series to provide different views of
+   * the data.  Aggregation consists of an alignment step on individual time
+   * series (`alignment_period` and `per_series_aligner`) followed by an optional
+   * reduction step of the data across the aligned time series
+   * (`cross_series_reducer` and `group_by_fields`).  For more details, see
+   * [Aggregation](/monitoring/api/learn_more#aggregation).
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Aggregation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Aggregation) + com.google.monitoring.dashboard.v1.AggregationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_Aggregation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_Aggregation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Aggregation.class, + com.google.monitoring.dashboard.v1.Aggregation.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Aggregation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (alignmentPeriodBuilder_ == null) { + alignmentPeriod_ = null; + } else { + alignmentPeriod_ = null; + alignmentPeriodBuilder_ = null; + } + perSeriesAligner_ = 0; + + crossSeriesReducer_ = 0; + + groupByFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_Aggregation_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Aggregation getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Aggregation build() { + com.google.monitoring.dashboard.v1.Aggregation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Aggregation buildPartial() { + com.google.monitoring.dashboard.v1.Aggregation result = + new com.google.monitoring.dashboard.v1.Aggregation(this); + int from_bitField0_ = bitField0_; + if (alignmentPeriodBuilder_ == null) { + result.alignmentPeriod_ = alignmentPeriod_; + } else { + result.alignmentPeriod_ = alignmentPeriodBuilder_.build(); + } + result.perSeriesAligner_ = perSeriesAligner_; + result.crossSeriesReducer_ = crossSeriesReducer_; + if (((bitField0_ & 0x00000001) != 0)) { + groupByFields_ = groupByFields_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groupByFields_ = groupByFields_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Aggregation) { + return mergeFrom((com.google.monitoring.dashboard.v1.Aggregation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Aggregation other) { + if (other == com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance()) return this; + if (other.hasAlignmentPeriod()) { + mergeAlignmentPeriod(other.getAlignmentPeriod()); + } + if (other.perSeriesAligner_ != 0) { + setPerSeriesAlignerValue(other.getPerSeriesAlignerValue()); + } + if (other.crossSeriesReducer_ != 0) { + setCrossSeriesReducerValue(other.getCrossSeriesReducerValue()); + } + if (!other.groupByFields_.isEmpty()) { + if (groupByFields_.isEmpty()) { + groupByFields_ = other.groupByFields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupByFieldsIsMutable(); + groupByFields_.addAll(other.groupByFields_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Aggregation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.Aggregation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration alignmentPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + alignmentPeriodBuilder_; + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + * + * @return Whether the alignmentPeriod field is set. + */ + public boolean hasAlignmentPeriod() { + return alignmentPeriodBuilder_ != null || alignmentPeriod_ != null; + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + * + * @return The alignmentPeriod. + */ + public com.google.protobuf.Duration getAlignmentPeriod() { + if (alignmentPeriodBuilder_ == null) { + return alignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : alignmentPeriod_; + } else { + return alignmentPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public Builder setAlignmentPeriod(com.google.protobuf.Duration value) { + if (alignmentPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + alignmentPeriod_ = value; + onChanged(); + } else { + alignmentPeriodBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public Builder setAlignmentPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (alignmentPeriodBuilder_ == null) { + alignmentPeriod_ = builderForValue.build(); + onChanged(); + } else { + alignmentPeriodBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public Builder mergeAlignmentPeriod(com.google.protobuf.Duration value) { + if (alignmentPeriodBuilder_ == null) { + if (alignmentPeriod_ != null) { + alignmentPeriod_ = + com.google.protobuf.Duration.newBuilder(alignmentPeriod_) + .mergeFrom(value) + .buildPartial(); + } else { + alignmentPeriod_ = value; + } + onChanged(); + } else { + alignmentPeriodBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public Builder clearAlignmentPeriod() { + if (alignmentPeriodBuilder_ == null) { + alignmentPeriod_ = null; + onChanged(); + } else { + alignmentPeriod_ = null; + alignmentPeriodBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public com.google.protobuf.Duration.Builder getAlignmentPeriodBuilder() { + + onChanged(); + return getAlignmentPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + public com.google.protobuf.DurationOrBuilder getAlignmentPeriodOrBuilder() { + if (alignmentPeriodBuilder_ != null) { + return alignmentPeriodBuilder_.getMessageOrBuilder(); + } else { + return alignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : alignmentPeriod_; + } + } + /** + * + * + *
+     * The alignment period for per-[time series][TimeSeries]
+     * alignment. If present, `alignmentPeriod` must be at least 60
+     * seconds.  After per-time series alignment, each time series will
+     * contain data points only on the period boundaries. If
+     * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+     * this field is ignored. If `perSeriesAligner` is specified and
+     * does not equal `ALIGN_NONE`, then this field must be defined;
+     * otherwise an error is returned.
+     * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAlignmentPeriodFieldBuilder() { + if (alignmentPeriodBuilder_ == null) { + alignmentPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAlignmentPeriod(), getParentForChildren(), isClean()); + alignmentPeriod_ = null; + } + return alignmentPeriodBuilder_; + } + + private int perSeriesAligner_ = 0; + /** + * + * + *
+     * The approach to be used to align individual time series. Not all
+     * alignment functions may be applied to all time series, depending
+     * on the metric type and value type of the original time
+     * series. Alignment may change the metric type or the value type of
+     * the time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return The enum numeric value on the wire for perSeriesAligner. + */ + public int getPerSeriesAlignerValue() { + return perSeriesAligner_; + } + /** + * + * + *
+     * The approach to be used to align individual time series. Not all
+     * alignment functions may be applied to all time series, depending
+     * on the metric type and value type of the original time
+     * series. Alignment may change the metric type or the value type of
+     * the time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @param value The enum numeric value on the wire for perSeriesAligner to set. + * @return This builder for chaining. + */ + public Builder setPerSeriesAlignerValue(int value) { + perSeriesAligner_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The approach to be used to align individual time series. Not all
+     * alignment functions may be applied to all time series, depending
+     * on the metric type and value type of the original time
+     * series. Alignment may change the metric type or the value type of
+     * the time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return The perSeriesAligner. + */ + public com.google.monitoring.dashboard.v1.Aggregation.Aligner getPerSeriesAligner() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Aggregation.Aligner result = + com.google.monitoring.dashboard.v1.Aggregation.Aligner.valueOf(perSeriesAligner_); + return result == null + ? com.google.monitoring.dashboard.v1.Aggregation.Aligner.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The approach to be used to align individual time series. Not all
+     * alignment functions may be applied to all time series, depending
+     * on the metric type and value type of the original time
+     * series. Alignment may change the metric type or the value type of
+     * the time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @param value The perSeriesAligner to set. + * @return This builder for chaining. + */ + public Builder setPerSeriesAligner( + com.google.monitoring.dashboard.v1.Aggregation.Aligner value) { + if (value == null) { + throw new NullPointerException(); + } + + perSeriesAligner_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The approach to be used to align individual time series. Not all
+     * alignment functions may be applied to all time series, depending
+     * on the metric type and value type of the original time
+     * series. Alignment may change the metric type or the value type of
+     * the time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return This builder for chaining. + */ + public Builder clearPerSeriesAligner() { + + perSeriesAligner_ = 0; + onChanged(); + return this; + } + + private int crossSeriesReducer_ = 0; + /** + * + * + *
+     * The approach to be used to combine time series. Not all reducer
+     * functions may be applied to all time series, depending on the
+     * metric type and the value type of the original time
+     * series. Reduction may change the metric type of value type of the
+     * time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return The enum numeric value on the wire for crossSeriesReducer. + */ + public int getCrossSeriesReducerValue() { + return crossSeriesReducer_; + } + /** + * + * + *
+     * The approach to be used to combine time series. Not all reducer
+     * functions may be applied to all time series, depending on the
+     * metric type and the value type of the original time
+     * series. Reduction may change the metric type of value type of the
+     * time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @param value The enum numeric value on the wire for crossSeriesReducer to set. + * @return This builder for chaining. + */ + public Builder setCrossSeriesReducerValue(int value) { + crossSeriesReducer_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The approach to be used to combine time series. Not all reducer
+     * functions may be applied to all time series, depending on the
+     * metric type and the value type of the original time
+     * series. Reduction may change the metric type of value type of the
+     * time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return The crossSeriesReducer. + */ + public com.google.monitoring.dashboard.v1.Aggregation.Reducer getCrossSeriesReducer() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Aggregation.Reducer result = + com.google.monitoring.dashboard.v1.Aggregation.Reducer.valueOf(crossSeriesReducer_); + return result == null + ? com.google.monitoring.dashboard.v1.Aggregation.Reducer.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The approach to be used to combine time series. Not all reducer
+     * functions may be applied to all time series, depending on the
+     * metric type and the value type of the original time
+     * series. Reduction may change the metric type of value type of the
+     * time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @param value The crossSeriesReducer to set. + * @return This builder for chaining. + */ + public Builder setCrossSeriesReducer( + com.google.monitoring.dashboard.v1.Aggregation.Reducer value) { + if (value == null) { + throw new NullPointerException(); + } + + crossSeriesReducer_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The approach to be used to combine time series. Not all reducer
+     * functions may be applied to all time series, depending on the
+     * metric type and the value type of the original time
+     * series. Reduction may change the metric type of value type of the
+     * time series.
+     * Time series data must be aligned in order to perform cross-time
+     * series reduction. If `crossSeriesReducer` is specified, then
+     * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+     * and `alignmentPeriod` must be specified; otherwise, an error is
+     * returned.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return This builder for chaining. + */ + public Builder clearCrossSeriesReducer() { + + crossSeriesReducer_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList groupByFields_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureGroupByFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + groupByFields_ = new com.google.protobuf.LazyStringArrayList(groupByFields_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @return A list containing the groupByFields. + */ + public com.google.protobuf.ProtocolStringList getGroupByFieldsList() { + return groupByFields_.getUnmodifiableView(); + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @return The count of groupByFields. + */ + public int getGroupByFieldsCount() { + return groupByFields_.size(); + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @param index The index of the element to return. + * @return The groupByFields at the given index. + */ + public java.lang.String getGroupByFields(int index) { + return groupByFields_.get(index); + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @param value The bytes of the groupByFields to add. + */ + public com.google.protobuf.ByteString getGroupByFieldsBytes(int index) { + return groupByFields_.getByteString(index); + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @param index The index to set the value at. + * @param value The groupByFields to set. + * @return This builder for chaining. + */ + public Builder setGroupByFields(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByFieldsIsMutable(); + groupByFields_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @param value The groupByFields to add. + * @return This builder for chaining. + */ + public Builder addGroupByFields(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByFieldsIsMutable(); + groupByFields_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @param values The groupByFields to add. + * @return This builder for chaining. + */ + public Builder addAllGroupByFields(java.lang.Iterable values) { + ensureGroupByFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupByFields_); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @return This builder for chaining. + */ + public Builder clearGroupByFields() { + groupByFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of fields to preserve when `crossSeriesReducer` is
+     * specified. The `groupByFields` determine how the time series are
+     * partitioned into subsets prior to applying the aggregation
+     * function. Each subset contains time series that have the same
+     * value for each of the grouping fields. Each individual time
+     * series is a member of exactly one subset. The
+     * `crossSeriesReducer` is applied to each subset of time series.
+     * It is not possible to reduce across different resource types, so
+     * this field implicitly contains `resource.type`.  Fields not
+     * specified in `groupByFields` are aggregated away.  If
+     * `groupByFields` is not specified and all the time series have
+     * the same resource type, then the time series are aggregated into
+     * a single output time series. If `crossSeriesReducer` is not
+     * defined, this field is ignored.
+     * 
+ * + * repeated string group_by_fields = 5; + * + * @param value The bytes of the groupByFields to add. + * @return This builder for chaining. + */ + public Builder addGroupByFieldsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGroupByFieldsIsMutable(); + groupByFields_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.dashboard.v1.Aggregation) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Aggregation) + private static final com.google.monitoring.dashboard.v1.Aggregation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Aggregation(); + } + + public static com.google.monitoring.dashboard.v1.Aggregation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Aggregation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Aggregation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Aggregation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/AggregationOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/AggregationOrBuilder.java new file mode 100644 index 00000000..0c402ef9 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/AggregationOrBuilder.java @@ -0,0 +1,270 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +public interface AggregationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Aggregation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The alignment period for per-[time series][TimeSeries]
+   * alignment. If present, `alignmentPeriod` must be at least 60
+   * seconds.  After per-time series alignment, each time series will
+   * contain data points only on the period boundaries. If
+   * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+   * this field is ignored. If `perSeriesAligner` is specified and
+   * does not equal `ALIGN_NONE`, then this field must be defined;
+   * otherwise an error is returned.
+   * 
+ * + * .google.protobuf.Duration alignment_period = 1; + * + * @return Whether the alignmentPeriod field is set. + */ + boolean hasAlignmentPeriod(); + /** + * + * + *
+   * The alignment period for per-[time series][TimeSeries]
+   * alignment. If present, `alignmentPeriod` must be at least 60
+   * seconds.  After per-time series alignment, each time series will
+   * contain data points only on the period boundaries. If
+   * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+   * this field is ignored. If `perSeriesAligner` is specified and
+   * does not equal `ALIGN_NONE`, then this field must be defined;
+   * otherwise an error is returned.
+   * 
+ * + * .google.protobuf.Duration alignment_period = 1; + * + * @return The alignmentPeriod. + */ + com.google.protobuf.Duration getAlignmentPeriod(); + /** + * + * + *
+   * The alignment period for per-[time series][TimeSeries]
+   * alignment. If present, `alignmentPeriod` must be at least 60
+   * seconds.  After per-time series alignment, each time series will
+   * contain data points only on the period boundaries. If
+   * `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
+   * this field is ignored. If `perSeriesAligner` is specified and
+   * does not equal `ALIGN_NONE`, then this field must be defined;
+   * otherwise an error is returned.
+   * 
+ * + * .google.protobuf.Duration alignment_period = 1; + */ + com.google.protobuf.DurationOrBuilder getAlignmentPeriodOrBuilder(); + + /** + * + * + *
+   * The approach to be used to align individual time series. Not all
+   * alignment functions may be applied to all time series, depending
+   * on the metric type and value type of the original time
+   * series. Alignment may change the metric type or the value type of
+   * the time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return The enum numeric value on the wire for perSeriesAligner. + */ + int getPerSeriesAlignerValue(); + /** + * + * + *
+   * The approach to be used to align individual time series. Not all
+   * alignment functions may be applied to all time series, depending
+   * on the metric type and value type of the original time
+   * series. Alignment may change the metric type or the value type of
+   * the time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Aligner per_series_aligner = 2; + * + * @return The perSeriesAligner. + */ + com.google.monitoring.dashboard.v1.Aggregation.Aligner getPerSeriesAligner(); + + /** + * + * + *
+   * The approach to be used to combine time series. Not all reducer
+   * functions may be applied to all time series, depending on the
+   * metric type and the value type of the original time
+   * series. Reduction may change the metric type of value type of the
+   * time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return The enum numeric value on the wire for crossSeriesReducer. + */ + int getCrossSeriesReducerValue(); + /** + * + * + *
+   * The approach to be used to combine time series. Not all reducer
+   * functions may be applied to all time series, depending on the
+   * metric type and the value type of the original time
+   * series. Reduction may change the metric type of value type of the
+   * time series.
+   * Time series data must be aligned in order to perform cross-time
+   * series reduction. If `crossSeriesReducer` is specified, then
+   * `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
+   * and `alignmentPeriod` must be specified; otherwise, an error is
+   * returned.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation.Reducer cross_series_reducer = 4; + * + * @return The crossSeriesReducer. + */ + com.google.monitoring.dashboard.v1.Aggregation.Reducer getCrossSeriesReducer(); + + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @return A list containing the groupByFields. + */ + java.util.List getGroupByFieldsList(); + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @return The count of groupByFields. + */ + int getGroupByFieldsCount(); + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @param index The index of the element to return. + * @return The groupByFields at the given index. + */ + java.lang.String getGroupByFields(int index); + /** + * + * + *
+   * The set of fields to preserve when `crossSeriesReducer` is
+   * specified. The `groupByFields` determine how the time series are
+   * partitioned into subsets prior to applying the aggregation
+   * function. Each subset contains time series that have the same
+   * value for each of the grouping fields. Each individual time
+   * series is a member of exactly one subset. The
+   * `crossSeriesReducer` is applied to each subset of time series.
+   * It is not possible to reduce across different resource types, so
+   * this field implicitly contains `resource.type`.  Fields not
+   * specified in `groupByFields` are aggregated away.  If
+   * `groupByFields` is not specified and all the time series have
+   * the same resource type, then the time series are aggregated into
+   * a single output time series. If `crossSeriesReducer` is not
+   * defined, this field is ignored.
+   * 
+ * + * repeated string group_by_fields = 5; + * + * @param index The index of the value to return. + * @return The bytes of the groupByFields at the given index. + */ + com.google.protobuf.ByteString getGroupByFieldsBytes(int index); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptions.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptions.java new file mode 100644 index 00000000..66395759 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptions.java @@ -0,0 +1,788 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/xychart.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * Options to control visual rendering of a chart.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ChartOptions} + */ +public final class ChartOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.ChartOptions) + ChartOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ChartOptions.newBuilder() to construct. + private ChartOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChartOptions() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ChartOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ChartOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + mode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_ChartOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_ChartOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ChartOptions.class, + com.google.monitoring.dashboard.v1.ChartOptions.Builder.class); + } + + /** + * + * + *
+   * Chart mode options.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.ChartOptions.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Mode is unspecified. The view will default to `COLOR`.
+     * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+     * The chart distinguishes data series using different color. Line
+     * colors may get reused when there are many lines in the chart.
+     * 
+ * + * COLOR = 1; + */ + COLOR(1), + /** + * + * + *
+     * The chart uses the Stackdriver x-ray mode, in which each
+     * data set is plotted using the same semi-transparent color.
+     * 
+ * + * X_RAY = 2; + */ + X_RAY(2), + /** + * + * + *
+     * The chart displays statistics such as average, median, 95th percentile,
+     * and more.
+     * 
+ * + * STATS = 3; + */ + STATS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Mode is unspecified. The view will default to `COLOR`.
+     * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The chart distinguishes data series using different color. Line
+     * colors may get reused when there are many lines in the chart.
+     * 
+ * + * COLOR = 1; + */ + public static final int COLOR_VALUE = 1; + /** + * + * + *
+     * The chart uses the Stackdriver x-ray mode, in which each
+     * data set is plotted using the same semi-transparent color.
+     * 
+ * + * X_RAY = 2; + */ + public static final int X_RAY_VALUE = 2; + /** + * + * + *
+     * The chart displays statistics such as average, median, 95th percentile,
+     * and more.
+     * 
+ * + * STATS = 3; + */ + public static final int STATS_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return COLOR; + case 2: + return X_RAY; + case 3: + return STATS; + 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 Mode findValueByNumber(int number) { + return Mode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ChartOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.ChartOptions.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_; + /** + * + * + *
+   * The chart mode.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * The chart mode.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return The mode. + */ + public com.google.monitoring.dashboard.v1.ChartOptions.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.ChartOptions.Mode result = + com.google.monitoring.dashboard.v1.ChartOptions.Mode.valueOf(mode_); + return result == null + ? com.google.monitoring.dashboard.v1.ChartOptions.Mode.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 (mode_ + != com.google.monitoring.dashboard.v1.ChartOptions.Mode.MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, mode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.monitoring.dashboard.v1.ChartOptions.Mode.MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.ChartOptions)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.ChartOptions other = + (com.google.monitoring.dashboard.v1.ChartOptions) obj; + + if (mode_ != other.mode_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.ChartOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions 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.monitoring.dashboard.v1.ChartOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions 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.monitoring.dashboard.v1.ChartOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions 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.monitoring.dashboard.v1.ChartOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions 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.monitoring.dashboard.v1.ChartOptions 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; + } + /** + * + * + *
+   * Options to control visual rendering of a chart.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ChartOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.ChartOptions) + com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_ChartOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_ChartOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ChartOptions.class, + com.google.monitoring.dashboard.v1.ChartOptions.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.ChartOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_ChartOptions_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ChartOptions getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.ChartOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ChartOptions build() { + com.google.monitoring.dashboard.v1.ChartOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ChartOptions buildPartial() { + com.google.monitoring.dashboard.v1.ChartOptions result = + new com.google.monitoring.dashboard.v1.ChartOptions(this); + result.mode_ = mode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.ChartOptions) { + return mergeFrom((com.google.monitoring.dashboard.v1.ChartOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.ChartOptions other) { + if (other == com.google.monitoring.dashboard.v1.ChartOptions.getDefaultInstance()) + return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.ChartOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.ChartOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int mode_ = 0; + /** + * + * + *
+     * The chart mode.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * The chart mode.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The chart mode.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return The mode. + */ + public com.google.monitoring.dashboard.v1.ChartOptions.Mode getMode() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.ChartOptions.Mode result = + com.google.monitoring.dashboard.v1.ChartOptions.Mode.valueOf(mode_); + return result == null + ? com.google.monitoring.dashboard.v1.ChartOptions.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The chart mode.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.monitoring.dashboard.v1.ChartOptions.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The chart mode.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + + mode_ = 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.monitoring.dashboard.v1.ChartOptions) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.ChartOptions) + private static final com.google.monitoring.dashboard.v1.ChartOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.ChartOptions(); + } + + public static com.google.monitoring.dashboard.v1.ChartOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChartOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ChartOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ChartOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptionsOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptionsOrBuilder.java new file mode 100644 index 00000000..36060520 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptionsOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/xychart.proto + +package com.google.monitoring.dashboard.v1; + +public interface ChartOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.ChartOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The chart mode.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * The chart mode.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions.Mode mode = 1; + * + * @return The mode. + */ + com.google.monitoring.dashboard.v1.ChartOptions.Mode getMode(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayout.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayout.java new file mode 100644 index 00000000..77f8dd75 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayout.java @@ -0,0 +1,2063 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A simplified layout that divides the available space into vertical columns
+ * and arranges a set of widgets vertically in each column.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ColumnLayout} + */ +public final class ColumnLayout extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.ColumnLayout) + ColumnLayoutOrBuilder { + private static final long serialVersionUID = 0L; + // Use ColumnLayout.newBuilder() to construct. + private ColumnLayout(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ColumnLayout() { + columns_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ColumnLayout(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ColumnLayout( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + columns_ = + new java.util.ArrayList< + com.google.monitoring.dashboard.v1.ColumnLayout.Column>(); + mutable_bitField0_ |= 0x00000001; + } + columns_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.ColumnLayout.Column.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ColumnLayout.class, + com.google.monitoring.dashboard.v1.ColumnLayout.Builder.class); + } + + public interface ColumnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.ColumnLayout.Column) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The relative weight of this column. The column weight is used to adjust
+     * the width of columns on the screen (relative to peers).
+     * Greater the weight, greater the width of the column on the screen.
+     * If omitted, a value of 1 is used while rendering.
+     * 
+ * + * int64 weight = 1; + * + * @return The weight. + */ + long getWeight(); + + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + java.util.List getWidgetsList(); + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + com.google.monitoring.dashboard.v1.Widget getWidgets(int index); + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + int getWidgetsCount(); + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + java.util.List + getWidgetsOrBuilderList(); + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index); + } + /** + * + * + *
+   * Defines the layout properties and content for a column.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ColumnLayout.Column} + */ + public static final class Column extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.ColumnLayout.Column) + ColumnOrBuilder { + private static final long serialVersionUID = 0L; + // Use Column.newBuilder() to construct. + private Column(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Column() { + widgets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Column(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Column( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + weight_ = input.readInt64(); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + widgets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + widgets_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.Widget.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + widgets_ = java.util.Collections.unmodifiableList(widgets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ColumnLayout.Column.class, + com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder.class); + } + + public static final int WEIGHT_FIELD_NUMBER = 1; + private long weight_; + /** + * + * + *
+     * The relative weight of this column. The column weight is used to adjust
+     * the width of columns on the screen (relative to peers).
+     * Greater the weight, greater the width of the column on the screen.
+     * If omitted, a value of 1 is used while rendering.
+     * 
+ * + * int64 weight = 1; + * + * @return The weight. + */ + public long getWeight() { + return weight_; + } + + public static final int WIDGETS_FIELD_NUMBER = 2; + private java.util.List widgets_; + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List getWidgetsList() { + return widgets_; + } + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsOrBuilderList() { + return widgets_; + } + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public int getWidgetsCount() { + return widgets_.size(); + } + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget getWidgets(int index) { + return widgets_.get(index); + } + /** + * + * + *
+     * The display widgets arranged vertically in this column.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) { + return widgets_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (weight_ != 0L) { + output.writeInt64(1, weight_); + } + for (int i = 0; i < widgets_.size(); i++) { + output.writeMessage(2, widgets_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (weight_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, weight_); + } + for (int i = 0; i < widgets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, widgets_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.ColumnLayout.Column)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.ColumnLayout.Column other = + (com.google.monitoring.dashboard.v1.ColumnLayout.Column) obj; + + if (getWeight() != other.getWeight()) return false; + if (!getWidgetsList().equals(other.getWidgetsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + WEIGHT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getWeight()); + if (getWidgetsCount() > 0) { + hash = (37 * hash) + WIDGETS_FIELD_NUMBER; + hash = (53 * hash) + getWidgetsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column 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.monitoring.dashboard.v1.ColumnLayout.Column parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column 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.monitoring.dashboard.v1.ColumnLayout.Column parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column 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.monitoring.dashboard.v1.ColumnLayout.Column parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column 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.monitoring.dashboard.v1.ColumnLayout.Column 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; + } + /** + * + * + *
+     * Defines the layout properties and content for a column.
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ColumnLayout.Column} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.ColumnLayout.Column) + com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ColumnLayout.Column.class, + com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.ColumnLayout.Column.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWidgetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + weight_ = 0L; + + if (widgetsBuilder_ == null) { + widgets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + widgetsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout.Column getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.ColumnLayout.Column.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout.Column build() { + com.google.monitoring.dashboard.v1.ColumnLayout.Column result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout.Column buildPartial() { + com.google.monitoring.dashboard.v1.ColumnLayout.Column result = + new com.google.monitoring.dashboard.v1.ColumnLayout.Column(this); + int from_bitField0_ = bitField0_; + result.weight_ = weight_; + if (widgetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + widgets_ = java.util.Collections.unmodifiableList(widgets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.widgets_ = widgets_; + } else { + result.widgets_ = widgetsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.ColumnLayout.Column) { + return mergeFrom((com.google.monitoring.dashboard.v1.ColumnLayout.Column) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.ColumnLayout.Column other) { + if (other == com.google.monitoring.dashboard.v1.ColumnLayout.Column.getDefaultInstance()) + return this; + if (other.getWeight() != 0L) { + setWeight(other.getWeight()); + } + if (widgetsBuilder_ == null) { + if (!other.widgets_.isEmpty()) { + if (widgets_.isEmpty()) { + widgets_ = other.widgets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWidgetsIsMutable(); + widgets_.addAll(other.widgets_); + } + onChanged(); + } + } else { + if (!other.widgets_.isEmpty()) { + if (widgetsBuilder_.isEmpty()) { + widgetsBuilder_.dispose(); + widgetsBuilder_ = null; + widgets_ = other.widgets_; + bitField0_ = (bitField0_ & ~0x00000001); + widgetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWidgetsFieldBuilder() + : null; + } else { + widgetsBuilder_.addAllMessages(other.widgets_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.ColumnLayout.Column parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.ColumnLayout.Column) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long weight_; + /** + * + * + *
+       * The relative weight of this column. The column weight is used to adjust
+       * the width of columns on the screen (relative to peers).
+       * Greater the weight, greater the width of the column on the screen.
+       * If omitted, a value of 1 is used while rendering.
+       * 
+ * + * int64 weight = 1; + * + * @return The weight. + */ + public long getWeight() { + return weight_; + } + /** + * + * + *
+       * The relative weight of this column. The column weight is used to adjust
+       * the width of columns on the screen (relative to peers).
+       * Greater the weight, greater the width of the column on the screen.
+       * If omitted, a value of 1 is used while rendering.
+       * 
+ * + * int64 weight = 1; + * + * @param value The weight to set. + * @return This builder for chaining. + */ + public Builder setWeight(long value) { + + weight_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The relative weight of this column. The column weight is used to adjust
+       * the width of columns on the screen (relative to peers).
+       * Greater the weight, greater the width of the column on the screen.
+       * If omitted, a value of 1 is used while rendering.
+       * 
+ * + * int64 weight = 1; + * + * @return This builder for chaining. + */ + public Builder clearWeight() { + + weight_ = 0L; + onChanged(); + return this; + } + + private java.util.List widgets_ = + java.util.Collections.emptyList(); + + private void ensureWidgetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + widgets_ = new java.util.ArrayList(widgets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder> + widgetsBuilder_; + + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List getWidgetsList() { + if (widgetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(widgets_); + } else { + return widgetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public int getWidgetsCount() { + if (widgetsBuilder_ == null) { + return widgets_.size(); + } else { + return widgetsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget getWidgets(int index) { + if (widgetsBuilder_ == null) { + return widgets_.get(index); + } else { + return widgetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder setWidgets(int index, com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.set(index, value); + onChanged(); + } else { + widgetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder setWidgets( + int index, com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.set(index, builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.add(value); + onChanged(); + } else { + widgetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(int index, com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.add(index, value); + onChanged(); + } else { + widgetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.add(builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets( + int index, com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.add(index, builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addAllWidgets( + java.lang.Iterable values) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, widgets_); + onChanged(); + } else { + widgetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder clearWidgets() { + if (widgetsBuilder_ == null) { + widgets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + widgetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder removeWidgets(int index) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.remove(index); + onChanged(); + } else { + widgetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder getWidgetsBuilder(int index) { + return getWidgetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) { + if (widgetsBuilder_ == null) { + return widgets_.get(index); + } else { + return widgetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsOrBuilderList() { + if (widgetsBuilder_ != null) { + return widgetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(widgets_); + } + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder addWidgetsBuilder() { + return getWidgetsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()); + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder addWidgetsBuilder(int index) { + return getWidgetsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()); + } + /** + * + * + *
+       * The display widgets arranged vertically in this column.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsBuilderList() { + return getWidgetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder> + getWidgetsFieldBuilder() { + if (widgetsBuilder_ == null) { + widgetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder>( + widgets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + widgets_ = null; + } + return widgetsBuilder_; + } + + @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.monitoring.dashboard.v1.ColumnLayout.Column) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.ColumnLayout.Column) + private static final com.google.monitoring.dashboard.v1.ColumnLayout.Column DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.ColumnLayout.Column(); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout.Column getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Column parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Column(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout.Column getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int COLUMNS_FIELD_NUMBER = 1; + private java.util.List columns_; + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public java.util.List getColumnsList() { + return columns_; + } + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public int getColumnsCount() { + return columns_.size(); + } + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.Column getColumns(int index) { + return columns_.get(index); + } + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder getColumnsOrBuilder( + int index) { + return columns_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < columns_.size(); i++) { + output.writeMessage(1, columns_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, columns_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.ColumnLayout)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.ColumnLayout other = + (com.google.monitoring.dashboard.v1.ColumnLayout) obj; + + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout 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.monitoring.dashboard.v1.ColumnLayout parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout 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.monitoring.dashboard.v1.ColumnLayout parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout 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.monitoring.dashboard.v1.ColumnLayout parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout 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.monitoring.dashboard.v1.ColumnLayout 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; + } + /** + * + * + *
+   * A simplified layout that divides the available space into vertical columns
+   * and arranges a set of widgets vertically in each column.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ColumnLayout} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.ColumnLayout) + com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ColumnLayout.class, + com.google.monitoring.dashboard.v1.ColumnLayout.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.ColumnLayout.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getColumnsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + columnsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout build() { + com.google.monitoring.dashboard.v1.ColumnLayout result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout buildPartial() { + com.google.monitoring.dashboard.v1.ColumnLayout result = + new com.google.monitoring.dashboard.v1.ColumnLayout(this); + int from_bitField0_ = bitField0_; + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.ColumnLayout) { + return mergeFrom((com.google.monitoring.dashboard.v1.ColumnLayout) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.ColumnLayout other) { + if (other == com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance()) + return this; + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + columnsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.ColumnLayout parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.ColumnLayout) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + columns_ = + new java.util.ArrayList( + columns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.ColumnLayout.Column, + com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder, + com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.Column getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder setColumns( + int index, com.google.monitoring.dashboard.v1.ColumnLayout.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder setColumns( + int index, com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder addColumns(com.google.monitoring.dashboard.v1.ColumnLayout.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder addColumns( + int index, com.google.monitoring.dashboard.v1.ColumnLayout.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder addColumns( + com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder addColumns( + int index, com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder addAllColumns( + java.lang.Iterable + values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder getColumnsBuilder( + int index) { + return getColumnsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder getColumnsOrBuilder( + int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder addColumnsBuilder() { + return getColumnsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.ColumnLayout.Column.getDefaultInstance()); + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder addColumnsBuilder( + int index) { + return getColumnsFieldBuilder() + .addBuilder( + index, com.google.monitoring.dashboard.v1.ColumnLayout.Column.getDefaultInstance()); + } + /** + * + * + *
+     * The columns of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + public java.util.List + getColumnsBuilderList() { + return getColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.ColumnLayout.Column, + com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder, + com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder> + getColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.ColumnLayout.Column, + com.google.monitoring.dashboard.v1.ColumnLayout.Column.Builder, + com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder>( + columns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + @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.monitoring.dashboard.v1.ColumnLayout) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.ColumnLayout) + private static final com.google.monitoring.dashboard.v1.ColumnLayout DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.ColumnLayout(); + } + + public static com.google.monitoring.dashboard.v1.ColumnLayout getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ColumnLayout parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ColumnLayout(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ColumnLayout getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayoutOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayoutOrBuilder.java new file mode 100644 index 00000000..350f7d3d --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayoutOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +public interface ColumnLayoutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.ColumnLayout) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + java.util.List getColumnsList(); + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + com.google.monitoring.dashboard.v1.ColumnLayout.Column getColumns(int index); + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + int getColumnsCount(); + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + java.util.List + getColumnsOrBuilderList(); + /** + * + * + *
+   * The columns of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.ColumnLayout.Column columns = 1; + */ + com.google.monitoring.dashboard.v1.ColumnLayout.ColumnOrBuilder getColumnsOrBuilder(int index); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CommonProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CommonProto.java new file mode 100644 index 00000000..628d9600 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CommonProto.java @@ -0,0 +1,132 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +public final class CommonProto { + private CommonProto() {} + + 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_monitoring_dashboard_v1_Aggregation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Aggregation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/monitoring/dashboard/v1/common." + + "proto\022\036google.monitoring.dashboard.v1\032\036g" + + "oogle/protobuf/duration.proto\"\301\007\n\013Aggreg" + + "ation\0223\n\020alignment_period\030\001 \001(\0132\031.google" + + ".protobuf.Duration\022O\n\022per_series_aligner" + + "\030\002 \001(\01623.google.monitoring.dashboard.v1." + + "Aggregation.Aligner\022Q\n\024cross_series_redu" + + "cer\030\004 \001(\01623.google.monitoring.dashboard." + + "v1.Aggregation.Reducer\022\027\n\017group_by_field" + + "s\030\005 \003(\t\"\213\003\n\007Aligner\022\016\n\nALIGN_NONE\020\000\022\017\n\013A" + + "LIGN_DELTA\020\001\022\016\n\nALIGN_RATE\020\002\022\025\n\021ALIGN_IN" + + "TERPOLATE\020\003\022\024\n\020ALIGN_NEXT_OLDER\020\004\022\r\n\tALI" + + "GN_MIN\020\n\022\r\n\tALIGN_MAX\020\013\022\016\n\nALIGN_MEAN\020\014\022" + + "\017\n\013ALIGN_COUNT\020\r\022\r\n\tALIGN_SUM\020\016\022\020\n\014ALIGN" + + "_STDDEV\020\017\022\024\n\020ALIGN_COUNT_TRUE\020\020\022\025\n\021ALIGN" + + "_COUNT_FALSE\020\030\022\027\n\023ALIGN_FRACTION_TRUE\020\021\022" + + "\027\n\023ALIGN_PERCENTILE_99\020\022\022\027\n\023ALIGN_PERCEN" + + "TILE_95\020\023\022\027\n\023ALIGN_PERCENTILE_50\020\024\022\027\n\023AL" + + "IGN_PERCENTILE_05\020\025\022\030\n\024ALIGN_PERCENT_CHA" + + "NGE\020\027\"\261\002\n\007Reducer\022\017\n\013REDUCE_NONE\020\000\022\017\n\013RE" + + "DUCE_MEAN\020\001\022\016\n\nREDUCE_MIN\020\002\022\016\n\nREDUCE_MA" + + "X\020\003\022\016\n\nREDUCE_SUM\020\004\022\021\n\rREDUCE_STDDEV\020\005\022\020" + + "\n\014REDUCE_COUNT\020\006\022\025\n\021REDUCE_COUNT_TRUE\020\007\022" + + "\026\n\022REDUCE_COUNT_FALSE\020\017\022\030\n\024REDUCE_FRACTI" + + "ON_TRUE\020\010\022\030\n\024REDUCE_PERCENTILE_99\020\t\022\030\n\024R" + + "EDUCE_PERCENTILE_95\020\n\022\030\n\024REDUCE_PERCENTI" + + "LE_50\020\013\022\030\n\024REDUCE_PERCENTILE_05\020\014\"\212\003\n\024Pi" + + "ckTimeSeriesFilter\022S\n\016ranking_method\030\001 \001" + + "(\0162;.google.monitoring.dashboard.v1.Pick" + + "TimeSeriesFilter.Method\022\027\n\017num_time_seri" + + "es\030\002 \001(\005\022Q\n\tdirection\030\003 \001(\0162>.google.mon" + + "itoring.dashboard.v1.PickTimeSeriesFilte" + + "r.Direction\"t\n\006Method\022\026\n\022METHOD_UNSPECIF" + + "IED\020\000\022\017\n\013METHOD_MEAN\020\001\022\016\n\nMETHOD_MAX\020\002\022\016" + + "\n\nMETHOD_MIN\020\003\022\016\n\nMETHOD_SUM\020\004\022\021\n\rMETHOD" + + "_LATEST\020\005\";\n\tDirection\022\031\n\025DIRECTION_UNSP" + + "ECIFIED\020\000\022\007\n\003TOP\020\001\022\n\n\006BOTTOM\020\002\"\320\001\n\033Stati" + + "sticalTimeSeriesFilter\022Z\n\016ranking_method" + + "\030\001 \001(\0162B.google.monitoring.dashboard.v1." + + "StatisticalTimeSeriesFilter.Method\022\027\n\017nu" + + "m_time_series\030\002 \001(\005\"<\n\006Method\022\026\n\022METHOD_" + + "UNSPECIFIED\020\000\022\032\n\026METHOD_CLUSTER_OUTLIER\020" + + "\001B|\n\"com.google.monitoring.dashboard.v1B" + + "\013CommonProtoP\001ZGgoogle.golang.org/genpro" + + "to/googleapis/monitoring/dashboard/v1;da" + + "shboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_Aggregation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_Aggregation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Aggregation_descriptor, + new java.lang.String[] { + "AlignmentPeriod", "PerSeriesAligner", "CrossSeriesReducer", "GroupByFields", + }); + internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_descriptor, + new java.lang.String[] { + "RankingMethod", "NumTimeSeries", "Direction", + }); + internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_descriptor, + new java.lang.String[] { + "RankingMethod", "NumTimeSeries", + }); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequest.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequest.java new file mode 100644 index 00000000..559fb180 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequest.java @@ -0,0 +1,948 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * The `CreateDashboard` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.CreateDashboardRequest} + */ +public final class CreateDashboardRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.CreateDashboardRequest) + CreateDashboardRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDashboardRequest.newBuilder() to construct. + private CreateDashboardRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDashboardRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDashboardRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateDashboardRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.monitoring.dashboard.v1.Dashboard.Builder subBuilder = null; + if (dashboard_ != null) { + subBuilder = dashboard_.toBuilder(); + } + dashboard_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Dashboard.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dashboard_); + dashboard_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.CreateDashboardRequest.class, + com.google.monitoring.dashboard.v1.CreateDashboardRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project on which to execute the request. The format is
+   * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+   * the dashboard resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project on which to execute the request. The format is
+   * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+   * the dashboard resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DASHBOARD_FIELD_NUMBER = 2; + private com.google.monitoring.dashboard.v1.Dashboard dashboard_; + /** + * + * + *
+   * Required. The initial dashboard specification.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dashboard field is set. + */ + public boolean hasDashboard() { + return dashboard_ != null; + } + /** + * + * + *
+   * Required. The initial dashboard specification.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dashboard. + */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboard() { + return dashboard_ == null + ? com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance() + : dashboard_; + } + /** + * + * + *
+   * Required. The initial dashboard specification.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardOrBuilder() { + return getDashboard(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (dashboard_ != null) { + output.writeMessage(2, getDashboard()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (dashboard_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDashboard()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.CreateDashboardRequest)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.CreateDashboardRequest other = + (com.google.monitoring.dashboard.v1.CreateDashboardRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDashboard() != other.hasDashboard()) return false; + if (hasDashboard()) { + if (!getDashboard().equals(other.getDashboard())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasDashboard()) { + hash = (37 * hash) + DASHBOARD_FIELD_NUMBER; + hash = (53 * hash) + getDashboard().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest 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.monitoring.dashboard.v1.CreateDashboardRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest 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.monitoring.dashboard.v1.CreateDashboardRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest 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.monitoring.dashboard.v1.CreateDashboardRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest 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.monitoring.dashboard.v1.CreateDashboardRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `CreateDashboard` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.CreateDashboardRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.CreateDashboardRequest) + com.google.monitoring.dashboard.v1.CreateDashboardRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.CreateDashboardRequest.class, + com.google.monitoring.dashboard.v1.CreateDashboardRequest.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.CreateDashboardRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (dashboardBuilder_ == null) { + dashboard_ = null; + } else { + dashboard_ = null; + dashboardBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.CreateDashboardRequest getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.CreateDashboardRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.CreateDashboardRequest build() { + com.google.monitoring.dashboard.v1.CreateDashboardRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.CreateDashboardRequest buildPartial() { + com.google.monitoring.dashboard.v1.CreateDashboardRequest result = + new com.google.monitoring.dashboard.v1.CreateDashboardRequest(this); + result.parent_ = parent_; + if (dashboardBuilder_ == null) { + result.dashboard_ = dashboard_; + } else { + result.dashboard_ = dashboardBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.CreateDashboardRequest) { + return mergeFrom((com.google.monitoring.dashboard.v1.CreateDashboardRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.CreateDashboardRequest other) { + if (other == com.google.monitoring.dashboard.v1.CreateDashboardRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasDashboard()) { + mergeDashboard(other.getDashboard()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.CreateDashboardRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.CreateDashboardRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project on which to execute the request. The format is
+     * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+     * the dashboard resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project on which to execute the request. The format is
+     * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+     * the dashboard resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project on which to execute the request. The format is
+     * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+     * the dashboard resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project on which to execute the request. The format is
+     * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+     * the dashboard resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project on which to execute the request. The format is
+     * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+     * the dashboard resource name.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.monitoring.dashboard.v1.Dashboard dashboard_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder> + dashboardBuilder_; + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dashboard field is set. + */ + public boolean hasDashboard() { + return dashboardBuilder_ != null || dashboard_ != null; + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dashboard. + */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboard() { + if (dashboardBuilder_ == null) { + return dashboard_ == null + ? com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance() + : dashboard_; + } else { + return dashboardBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDashboard(com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dashboard_ = value; + onChanged(); + } else { + dashboardBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDashboard( + com.google.monitoring.dashboard.v1.Dashboard.Builder builderForValue) { + if (dashboardBuilder_ == null) { + dashboard_ = builderForValue.build(); + onChanged(); + } else { + dashboardBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDashboard(com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardBuilder_ == null) { + if (dashboard_ != null) { + dashboard_ = + com.google.monitoring.dashboard.v1.Dashboard.newBuilder(dashboard_) + .mergeFrom(value) + .buildPartial(); + } else { + dashboard_ = value; + } + onChanged(); + } else { + dashboardBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDashboard() { + if (dashboardBuilder_ == null) { + dashboard_ = null; + onChanged(); + } else { + dashboard_ = null; + dashboardBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.monitoring.dashboard.v1.Dashboard.Builder getDashboardBuilder() { + + onChanged(); + return getDashboardFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardOrBuilder() { + if (dashboardBuilder_ != null) { + return dashboardBuilder_.getMessageOrBuilder(); + } else { + return dashboard_ == null + ? com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance() + : dashboard_; + } + } + /** + * + * + *
+     * Required. The initial dashboard specification.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder> + getDashboardFieldBuilder() { + if (dashboardBuilder_ == null) { + dashboardBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder>( + getDashboard(), getParentForChildren(), isClean()); + dashboard_ = null; + } + return dashboardBuilder_; + } + + @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.monitoring.dashboard.v1.CreateDashboardRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.CreateDashboardRequest) + private static final com.google.monitoring.dashboard.v1.CreateDashboardRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.CreateDashboardRequest(); + } + + public static com.google.monitoring.dashboard.v1.CreateDashboardRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDashboardRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateDashboardRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.CreateDashboardRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequestOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequestOrBuilder.java new file mode 100644 index 00000000..d1f7eedf --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public interface CreateDashboardRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.CreateDashboardRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project on which to execute the request. The format is
+   * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+   * the dashboard resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project on which to execute the request. The format is
+   * `"projects/{project_id_or_number}"`. The {project_id_or_number} must match
+   * the dashboard resource name.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The initial dashboard specification.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dashboard field is set. + */ + boolean hasDashboard(); + /** + * + * + *
+   * Required. The initial dashboard specification.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dashboard. + */ + com.google.monitoring.dashboard.v1.Dashboard getDashboard(); + /** + * + * + *
+   * Required. The initial dashboard specification.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Dashboard.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Dashboard.java new file mode 100644 index 00000000..29384c06 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Dashboard.java @@ -0,0 +1,2037 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboard.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A Google Stackdriver dashboard. Dashboards define the content and layout
+ * of pages in the Stackdriver web application.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Dashboard} + */ +public final class Dashboard extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Dashboard) + DashboardOrBuilder { + private static final long serialVersionUID = 0L; + // Use Dashboard.newBuilder() to construct. + private Dashboard(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Dashboard() { + name_ = ""; + displayName_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Dashboard(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Dashboard( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 42: + { + com.google.monitoring.dashboard.v1.GridLayout.Builder subBuilder = null; + if (layoutCase_ == 5) { + subBuilder = ((com.google.monitoring.dashboard.v1.GridLayout) layout_).toBuilder(); + } + layout_ = + input.readMessage( + com.google.monitoring.dashboard.v1.GridLayout.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.GridLayout) layout_); + layout_ = subBuilder.buildPartial(); + } + layoutCase_ = 5; + break; + } + case 66: + { + com.google.monitoring.dashboard.v1.RowLayout.Builder subBuilder = null; + if (layoutCase_ == 8) { + subBuilder = ((com.google.monitoring.dashboard.v1.RowLayout) layout_).toBuilder(); + } + layout_ = + input.readMessage( + com.google.monitoring.dashboard.v1.RowLayout.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.RowLayout) layout_); + layout_ = subBuilder.buildPartial(); + } + layoutCase_ = 8; + break; + } + case 74: + { + com.google.monitoring.dashboard.v1.ColumnLayout.Builder subBuilder = null; + if (layoutCase_ == 9) { + subBuilder = + ((com.google.monitoring.dashboard.v1.ColumnLayout) layout_).toBuilder(); + } + layout_ = + input.readMessage( + com.google.monitoring.dashboard.v1.ColumnLayout.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.ColumnLayout) layout_); + layout_ = subBuilder.buildPartial(); + } + layoutCase_ = 9; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsProto + .internal_static_google_monitoring_dashboard_v1_Dashboard_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsProto + .internal_static_google_monitoring_dashboard_v1_Dashboard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Dashboard.class, + com.google.monitoring.dashboard.v1.Dashboard.Builder.class); + } + + private int layoutCase_ = 0; + private java.lang.Object layout_; + + public enum LayoutCase implements com.google.protobuf.Internal.EnumLite { + GRID_LAYOUT(5), + ROW_LAYOUT(8), + COLUMN_LAYOUT(9), + LAYOUT_NOT_SET(0); + private final int value; + + private LayoutCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LayoutCase valueOf(int value) { + return forNumber(value); + } + + public static LayoutCase forNumber(int value) { + switch (value) { + case 5: + return GRID_LAYOUT; + case 8: + return ROW_LAYOUT; + case 9: + return COLUMN_LAYOUT; + case 0: + return LAYOUT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LayoutCase getLayoutCase() { + return LayoutCase.forNumber(layoutCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the dashboard.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the dashboard.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The mutable, human-readable name.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The mutable, human-readable name.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 4; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * `etag` is used for optimistic concurrency control as a way to help
+   * prevent simultaneous updates of a policy from overwriting each other.
+   * An `etag` is returned in the response to `GetDashboard`, and
+   * users are expected to put that etag in the request to `UpdateDashboard` to
+   * ensure that their change will be applied to the same version of the
+   * Dashboard configuration. The field should not be passed during
+   * dashboard creation.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * `etag` is used for optimistic concurrency control as a way to help
+   * prevent simultaneous updates of a policy from overwriting each other.
+   * An `etag` is returned in the response to `GetDashboard`, and
+   * users are expected to put that etag in the request to `UpdateDashboard` to
+   * ensure that their change will be applied to the same version of the
+   * Dashboard configuration. The field should not be passed during
+   * dashboard creation.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRID_LAYOUT_FIELD_NUMBER = 5; + /** + * + * + *
+   * Content is arranged with a basic layout that re-flows a simple list of
+   * informational elements like widgets or tiles.
+   * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + * + * @return Whether the gridLayout field is set. + */ + public boolean hasGridLayout() { + return layoutCase_ == 5; + } + /** + * + * + *
+   * Content is arranged with a basic layout that re-flows a simple list of
+   * informational elements like widgets or tiles.
+   * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + * + * @return The gridLayout. + */ + public com.google.monitoring.dashboard.v1.GridLayout getGridLayout() { + if (layoutCase_ == 5) { + return (com.google.monitoring.dashboard.v1.GridLayout) layout_; + } + return com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } + /** + * + * + *
+   * Content is arranged with a basic layout that re-flows a simple list of
+   * informational elements like widgets or tiles.
+   * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public com.google.monitoring.dashboard.v1.GridLayoutOrBuilder getGridLayoutOrBuilder() { + if (layoutCase_ == 5) { + return (com.google.monitoring.dashboard.v1.GridLayout) layout_; + } + return com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } + + public static final int ROW_LAYOUT_FIELD_NUMBER = 8; + /** + * + * + *
+   * The content is divided into equally spaced rows and the widgets are
+   * arranged horizontally.
+   * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + * + * @return Whether the rowLayout field is set. + */ + public boolean hasRowLayout() { + return layoutCase_ == 8; + } + /** + * + * + *
+   * The content is divided into equally spaced rows and the widgets are
+   * arranged horizontally.
+   * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + * + * @return The rowLayout. + */ + public com.google.monitoring.dashboard.v1.RowLayout getRowLayout() { + if (layoutCase_ == 8) { + return (com.google.monitoring.dashboard.v1.RowLayout) layout_; + } + return com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } + /** + * + * + *
+   * The content is divided into equally spaced rows and the widgets are
+   * arranged horizontally.
+   * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public com.google.monitoring.dashboard.v1.RowLayoutOrBuilder getRowLayoutOrBuilder() { + if (layoutCase_ == 8) { + return (com.google.monitoring.dashboard.v1.RowLayout) layout_; + } + return com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } + + public static final int COLUMN_LAYOUT_FIELD_NUMBER = 9; + /** + * + * + *
+   * The content is divided into equally spaced columns and the widgets are
+   * arranged vertically.
+   * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + * + * @return Whether the columnLayout field is set. + */ + public boolean hasColumnLayout() { + return layoutCase_ == 9; + } + /** + * + * + *
+   * The content is divided into equally spaced columns and the widgets are
+   * arranged vertically.
+   * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + * + * @return The columnLayout. + */ + public com.google.monitoring.dashboard.v1.ColumnLayout getColumnLayout() { + if (layoutCase_ == 9) { + return (com.google.monitoring.dashboard.v1.ColumnLayout) layout_; + } + return com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } + /** + * + * + *
+   * The content is divided into equally spaced columns and the widgets are
+   * arranged vertically.
+   * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder getColumnLayoutOrBuilder() { + if (layoutCase_ == 9) { + return (com.google.monitoring.dashboard.v1.ColumnLayout) layout_; + } + return com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + if (layoutCase_ == 5) { + output.writeMessage(5, (com.google.monitoring.dashboard.v1.GridLayout) layout_); + } + if (layoutCase_ == 8) { + output.writeMessage(8, (com.google.monitoring.dashboard.v1.RowLayout) layout_); + } + if (layoutCase_ == 9) { + output.writeMessage(9, (com.google.monitoring.dashboard.v1.ColumnLayout) layout_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + if (layoutCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.monitoring.dashboard.v1.GridLayout) layout_); + } + if (layoutCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.monitoring.dashboard.v1.RowLayout) layout_); + } + if (layoutCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.monitoring.dashboard.v1.ColumnLayout) layout_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Dashboard)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Dashboard other = + (com.google.monitoring.dashboard.v1.Dashboard) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getLayoutCase().equals(other.getLayoutCase())) return false; + switch (layoutCase_) { + case 5: + if (!getGridLayout().equals(other.getGridLayout())) return false; + break; + case 8: + if (!getRowLayout().equals(other.getRowLayout())) return false; + break; + case 9: + if (!getColumnLayout().equals(other.getColumnLayout())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + switch (layoutCase_) { + case 5: + hash = (37 * hash) + GRID_LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getGridLayout().hashCode(); + break; + case 8: + hash = (37 * hash) + ROW_LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getRowLayout().hashCode(); + break; + case 9: + hash = (37 * hash) + COLUMN_LAYOUT_FIELD_NUMBER; + hash = (53 * hash) + getColumnLayout().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Dashboard parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Dashboard parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Dashboard parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Dashboard 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.monitoring.dashboard.v1.Dashboard parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Dashboard parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Dashboard parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Dashboard 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.monitoring.dashboard.v1.Dashboard parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Dashboard 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.monitoring.dashboard.v1.Dashboard parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Dashboard 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.monitoring.dashboard.v1.Dashboard 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; + } + /** + * + * + *
+   * A Google Stackdriver dashboard. Dashboards define the content and layout
+   * of pages in the Stackdriver web application.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Dashboard} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Dashboard) + com.google.monitoring.dashboard.v1.DashboardOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsProto + .internal_static_google_monitoring_dashboard_v1_Dashboard_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsProto + .internal_static_google_monitoring_dashboard_v1_Dashboard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Dashboard.class, + com.google.monitoring.dashboard.v1.Dashboard.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Dashboard.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + etag_ = ""; + + layoutCase_ = 0; + layout_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsProto + .internal_static_google_monitoring_dashboard_v1_Dashboard_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Dashboard getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Dashboard build() { + com.google.monitoring.dashboard.v1.Dashboard result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Dashboard buildPartial() { + com.google.monitoring.dashboard.v1.Dashboard result = + new com.google.monitoring.dashboard.v1.Dashboard(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.etag_ = etag_; + if (layoutCase_ == 5) { + if (gridLayoutBuilder_ == null) { + result.layout_ = layout_; + } else { + result.layout_ = gridLayoutBuilder_.build(); + } + } + if (layoutCase_ == 8) { + if (rowLayoutBuilder_ == null) { + result.layout_ = layout_; + } else { + result.layout_ = rowLayoutBuilder_.build(); + } + } + if (layoutCase_ == 9) { + if (columnLayoutBuilder_ == null) { + result.layout_ = layout_; + } else { + result.layout_ = columnLayoutBuilder_.build(); + } + } + result.layoutCase_ = layoutCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Dashboard) { + return mergeFrom((com.google.monitoring.dashboard.v1.Dashboard) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Dashboard other) { + if (other == com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + switch (other.getLayoutCase()) { + case GRID_LAYOUT: + { + mergeGridLayout(other.getGridLayout()); + break; + } + case ROW_LAYOUT: + { + mergeRowLayout(other.getRowLayout()); + break; + } + case COLUMN_LAYOUT: + { + mergeColumnLayout(other.getColumnLayout()); + break; + } + case LAYOUT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Dashboard parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.Dashboard) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int layoutCase_ = 0; + private java.lang.Object layout_; + + public LayoutCase getLayoutCase() { + return LayoutCase.forNumber(layoutCase_); + } + + public Builder clearLayout() { + layoutCase_ = 0; + layout_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the dashboard.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the dashboard.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the dashboard.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the dashboard.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the dashboard.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The mutable, human-readable name.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The mutable, human-readable name.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The mutable, human-readable name.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The mutable, human-readable name.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mutable, human-readable name.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * `etag` is used for optimistic concurrency control as a way to help
+     * prevent simultaneous updates of a policy from overwriting each other.
+     * An `etag` is returned in the response to `GetDashboard`, and
+     * users are expected to put that etag in the request to `UpdateDashboard` to
+     * ensure that their change will be applied to the same version of the
+     * Dashboard configuration. The field should not be passed during
+     * dashboard creation.
+     * 
+ * + * string etag = 4; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * `etag` is used for optimistic concurrency control as a way to help
+     * prevent simultaneous updates of a policy from overwriting each other.
+     * An `etag` is returned in the response to `GetDashboard`, and
+     * users are expected to put that etag in the request to `UpdateDashboard` to
+     * ensure that their change will be applied to the same version of the
+     * Dashboard configuration. The field should not be passed during
+     * dashboard creation.
+     * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * `etag` is used for optimistic concurrency control as a way to help
+     * prevent simultaneous updates of a policy from overwriting each other.
+     * An `etag` is returned in the response to `GetDashboard`, and
+     * users are expected to put that etag in the request to `UpdateDashboard` to
+     * ensure that their change will be applied to the same version of the
+     * Dashboard configuration. The field should not be passed during
+     * dashboard creation.
+     * 
+ * + * string etag = 4; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `etag` is used for optimistic concurrency control as a way to help
+     * prevent simultaneous updates of a policy from overwriting each other.
+     * An `etag` is returned in the response to `GetDashboard`, and
+     * users are expected to put that etag in the request to `UpdateDashboard` to
+     * ensure that their change will be applied to the same version of the
+     * Dashboard configuration. The field should not be passed during
+     * dashboard creation.
+     * 
+ * + * string etag = 4; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * `etag` is used for optimistic concurrency control as a way to help
+     * prevent simultaneous updates of a policy from overwriting each other.
+     * An `etag` is returned in the response to `GetDashboard`, and
+     * users are expected to put that etag in the request to `UpdateDashboard` to
+     * ensure that their change will be applied to the same version of the
+     * Dashboard configuration. The field should not be passed during
+     * dashboard creation.
+     * 
+ * + * string etag = 4; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.GridLayout, + com.google.monitoring.dashboard.v1.GridLayout.Builder, + com.google.monitoring.dashboard.v1.GridLayoutOrBuilder> + gridLayoutBuilder_; + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + * + * @return Whether the gridLayout field is set. + */ + public boolean hasGridLayout() { + return layoutCase_ == 5; + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + * + * @return The gridLayout. + */ + public com.google.monitoring.dashboard.v1.GridLayout getGridLayout() { + if (gridLayoutBuilder_ == null) { + if (layoutCase_ == 5) { + return (com.google.monitoring.dashboard.v1.GridLayout) layout_; + } + return com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } else { + if (layoutCase_ == 5) { + return gridLayoutBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public Builder setGridLayout(com.google.monitoring.dashboard.v1.GridLayout value) { + if (gridLayoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + layout_ = value; + onChanged(); + } else { + gridLayoutBuilder_.setMessage(value); + } + layoutCase_ = 5; + return this; + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public Builder setGridLayout( + com.google.monitoring.dashboard.v1.GridLayout.Builder builderForValue) { + if (gridLayoutBuilder_ == null) { + layout_ = builderForValue.build(); + onChanged(); + } else { + gridLayoutBuilder_.setMessage(builderForValue.build()); + } + layoutCase_ = 5; + return this; + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public Builder mergeGridLayout(com.google.monitoring.dashboard.v1.GridLayout value) { + if (gridLayoutBuilder_ == null) { + if (layoutCase_ == 5 + && layout_ != com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance()) { + layout_ = + com.google.monitoring.dashboard.v1.GridLayout.newBuilder( + (com.google.monitoring.dashboard.v1.GridLayout) layout_) + .mergeFrom(value) + .buildPartial(); + } else { + layout_ = value; + } + onChanged(); + } else { + if (layoutCase_ == 5) { + gridLayoutBuilder_.mergeFrom(value); + } + gridLayoutBuilder_.setMessage(value); + } + layoutCase_ = 5; + return this; + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public Builder clearGridLayout() { + if (gridLayoutBuilder_ == null) { + if (layoutCase_ == 5) { + layoutCase_ = 0; + layout_ = null; + onChanged(); + } + } else { + if (layoutCase_ == 5) { + layoutCase_ = 0; + layout_ = null; + } + gridLayoutBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public com.google.monitoring.dashboard.v1.GridLayout.Builder getGridLayoutBuilder() { + return getGridLayoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + public com.google.monitoring.dashboard.v1.GridLayoutOrBuilder getGridLayoutOrBuilder() { + if ((layoutCase_ == 5) && (gridLayoutBuilder_ != null)) { + return gridLayoutBuilder_.getMessageOrBuilder(); + } else { + if (layoutCase_ == 5) { + return (com.google.monitoring.dashboard.v1.GridLayout) layout_; + } + return com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } + } + /** + * + * + *
+     * Content is arranged with a basic layout that re-flows a simple list of
+     * informational elements like widgets or tiles.
+     * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.GridLayout, + com.google.monitoring.dashboard.v1.GridLayout.Builder, + com.google.monitoring.dashboard.v1.GridLayoutOrBuilder> + getGridLayoutFieldBuilder() { + if (gridLayoutBuilder_ == null) { + if (!(layoutCase_ == 5)) { + layout_ = com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } + gridLayoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.GridLayout, + com.google.monitoring.dashboard.v1.GridLayout.Builder, + com.google.monitoring.dashboard.v1.GridLayoutOrBuilder>( + (com.google.monitoring.dashboard.v1.GridLayout) layout_, + getParentForChildren(), + isClean()); + layout_ = null; + } + layoutCase_ = 5; + onChanged(); + ; + return gridLayoutBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.RowLayout, + com.google.monitoring.dashboard.v1.RowLayout.Builder, + com.google.monitoring.dashboard.v1.RowLayoutOrBuilder> + rowLayoutBuilder_; + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + * + * @return Whether the rowLayout field is set. + */ + public boolean hasRowLayout() { + return layoutCase_ == 8; + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + * + * @return The rowLayout. + */ + public com.google.monitoring.dashboard.v1.RowLayout getRowLayout() { + if (rowLayoutBuilder_ == null) { + if (layoutCase_ == 8) { + return (com.google.monitoring.dashboard.v1.RowLayout) layout_; + } + return com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } else { + if (layoutCase_ == 8) { + return rowLayoutBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public Builder setRowLayout(com.google.monitoring.dashboard.v1.RowLayout value) { + if (rowLayoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + layout_ = value; + onChanged(); + } else { + rowLayoutBuilder_.setMessage(value); + } + layoutCase_ = 8; + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public Builder setRowLayout( + com.google.monitoring.dashboard.v1.RowLayout.Builder builderForValue) { + if (rowLayoutBuilder_ == null) { + layout_ = builderForValue.build(); + onChanged(); + } else { + rowLayoutBuilder_.setMessage(builderForValue.build()); + } + layoutCase_ = 8; + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public Builder mergeRowLayout(com.google.monitoring.dashboard.v1.RowLayout value) { + if (rowLayoutBuilder_ == null) { + if (layoutCase_ == 8 + && layout_ != com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance()) { + layout_ = + com.google.monitoring.dashboard.v1.RowLayout.newBuilder( + (com.google.monitoring.dashboard.v1.RowLayout) layout_) + .mergeFrom(value) + .buildPartial(); + } else { + layout_ = value; + } + onChanged(); + } else { + if (layoutCase_ == 8) { + rowLayoutBuilder_.mergeFrom(value); + } + rowLayoutBuilder_.setMessage(value); + } + layoutCase_ = 8; + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public Builder clearRowLayout() { + if (rowLayoutBuilder_ == null) { + if (layoutCase_ == 8) { + layoutCase_ = 0; + layout_ = null; + onChanged(); + } + } else { + if (layoutCase_ == 8) { + layoutCase_ = 0; + layout_ = null; + } + rowLayoutBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public com.google.monitoring.dashboard.v1.RowLayout.Builder getRowLayoutBuilder() { + return getRowLayoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + public com.google.monitoring.dashboard.v1.RowLayoutOrBuilder getRowLayoutOrBuilder() { + if ((layoutCase_ == 8) && (rowLayoutBuilder_ != null)) { + return rowLayoutBuilder_.getMessageOrBuilder(); + } else { + if (layoutCase_ == 8) { + return (com.google.monitoring.dashboard.v1.RowLayout) layout_; + } + return com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } + } + /** + * + * + *
+     * The content is divided into equally spaced rows and the widgets are
+     * arranged horizontally.
+     * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.RowLayout, + com.google.monitoring.dashboard.v1.RowLayout.Builder, + com.google.monitoring.dashboard.v1.RowLayoutOrBuilder> + getRowLayoutFieldBuilder() { + if (rowLayoutBuilder_ == null) { + if (!(layoutCase_ == 8)) { + layout_ = com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } + rowLayoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.RowLayout, + com.google.monitoring.dashboard.v1.RowLayout.Builder, + com.google.monitoring.dashboard.v1.RowLayoutOrBuilder>( + (com.google.monitoring.dashboard.v1.RowLayout) layout_, + getParentForChildren(), + isClean()); + layout_ = null; + } + layoutCase_ = 8; + onChanged(); + ; + return rowLayoutBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.ColumnLayout, + com.google.monitoring.dashboard.v1.ColumnLayout.Builder, + com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder> + columnLayoutBuilder_; + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + * + * @return Whether the columnLayout field is set. + */ + public boolean hasColumnLayout() { + return layoutCase_ == 9; + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + * + * @return The columnLayout. + */ + public com.google.monitoring.dashboard.v1.ColumnLayout getColumnLayout() { + if (columnLayoutBuilder_ == null) { + if (layoutCase_ == 9) { + return (com.google.monitoring.dashboard.v1.ColumnLayout) layout_; + } + return com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } else { + if (layoutCase_ == 9) { + return columnLayoutBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public Builder setColumnLayout(com.google.monitoring.dashboard.v1.ColumnLayout value) { + if (columnLayoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + layout_ = value; + onChanged(); + } else { + columnLayoutBuilder_.setMessage(value); + } + layoutCase_ = 9; + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public Builder setColumnLayout( + com.google.monitoring.dashboard.v1.ColumnLayout.Builder builderForValue) { + if (columnLayoutBuilder_ == null) { + layout_ = builderForValue.build(); + onChanged(); + } else { + columnLayoutBuilder_.setMessage(builderForValue.build()); + } + layoutCase_ = 9; + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public Builder mergeColumnLayout(com.google.monitoring.dashboard.v1.ColumnLayout value) { + if (columnLayoutBuilder_ == null) { + if (layoutCase_ == 9 + && layout_ != com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance()) { + layout_ = + com.google.monitoring.dashboard.v1.ColumnLayout.newBuilder( + (com.google.monitoring.dashboard.v1.ColumnLayout) layout_) + .mergeFrom(value) + .buildPartial(); + } else { + layout_ = value; + } + onChanged(); + } else { + if (layoutCase_ == 9) { + columnLayoutBuilder_.mergeFrom(value); + } + columnLayoutBuilder_.setMessage(value); + } + layoutCase_ = 9; + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public Builder clearColumnLayout() { + if (columnLayoutBuilder_ == null) { + if (layoutCase_ == 9) { + layoutCase_ = 0; + layout_ = null; + onChanged(); + } + } else { + if (layoutCase_ == 9) { + layoutCase_ = 0; + layout_ = null; + } + columnLayoutBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public com.google.monitoring.dashboard.v1.ColumnLayout.Builder getColumnLayoutBuilder() { + return getColumnLayoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + public com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder getColumnLayoutOrBuilder() { + if ((layoutCase_ == 9) && (columnLayoutBuilder_ != null)) { + return columnLayoutBuilder_.getMessageOrBuilder(); + } else { + if (layoutCase_ == 9) { + return (com.google.monitoring.dashboard.v1.ColumnLayout) layout_; + } + return com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } + } + /** + * + * + *
+     * The content is divided into equally spaced columns and the widgets are
+     * arranged vertically.
+     * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.ColumnLayout, + com.google.monitoring.dashboard.v1.ColumnLayout.Builder, + com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder> + getColumnLayoutFieldBuilder() { + if (columnLayoutBuilder_ == null) { + if (!(layoutCase_ == 9)) { + layout_ = com.google.monitoring.dashboard.v1.ColumnLayout.getDefaultInstance(); + } + columnLayoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.ColumnLayout, + com.google.monitoring.dashboard.v1.ColumnLayout.Builder, + com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder>( + (com.google.monitoring.dashboard.v1.ColumnLayout) layout_, + getParentForChildren(), + isClean()); + layout_ = null; + } + layoutCase_ = 9; + onChanged(); + ; + return columnLayoutBuilder_; + } + + @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.monitoring.dashboard.v1.Dashboard) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Dashboard) + private static final com.google.monitoring.dashboard.v1.Dashboard DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Dashboard(); + } + + public static com.google.monitoring.dashboard.v1.Dashboard getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Dashboard parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Dashboard(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Dashboard getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardOrBuilder.java new file mode 100644 index 00000000..45803987 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardOrBuilder.java @@ -0,0 +1,228 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboard.proto + +package com.google.monitoring.dashboard.v1; + +public interface DashboardOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Dashboard) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the dashboard.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the dashboard.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The mutable, human-readable name.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The mutable, human-readable name.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * `etag` is used for optimistic concurrency control as a way to help
+   * prevent simultaneous updates of a policy from overwriting each other.
+   * An `etag` is returned in the response to `GetDashboard`, and
+   * users are expected to put that etag in the request to `UpdateDashboard` to
+   * ensure that their change will be applied to the same version of the
+   * Dashboard configuration. The field should not be passed during
+   * dashboard creation.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * `etag` is used for optimistic concurrency control as a way to help
+   * prevent simultaneous updates of a policy from overwriting each other.
+   * An `etag` is returned in the response to `GetDashboard`, and
+   * users are expected to put that etag in the request to `UpdateDashboard` to
+   * ensure that their change will be applied to the same version of the
+   * Dashboard configuration. The field should not be passed during
+   * dashboard creation.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Content is arranged with a basic layout that re-flows a simple list of
+   * informational elements like widgets or tiles.
+   * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + * + * @return Whether the gridLayout field is set. + */ + boolean hasGridLayout(); + /** + * + * + *
+   * Content is arranged with a basic layout that re-flows a simple list of
+   * informational elements like widgets or tiles.
+   * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + * + * @return The gridLayout. + */ + com.google.monitoring.dashboard.v1.GridLayout getGridLayout(); + /** + * + * + *
+   * Content is arranged with a basic layout that re-flows a simple list of
+   * informational elements like widgets or tiles.
+   * 
+ * + * .google.monitoring.dashboard.v1.GridLayout grid_layout = 5; + */ + com.google.monitoring.dashboard.v1.GridLayoutOrBuilder getGridLayoutOrBuilder(); + + /** + * + * + *
+   * The content is divided into equally spaced rows and the widgets are
+   * arranged horizontally.
+   * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + * + * @return Whether the rowLayout field is set. + */ + boolean hasRowLayout(); + /** + * + * + *
+   * The content is divided into equally spaced rows and the widgets are
+   * arranged horizontally.
+   * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + * + * @return The rowLayout. + */ + com.google.monitoring.dashboard.v1.RowLayout getRowLayout(); + /** + * + * + *
+   * The content is divided into equally spaced rows and the widgets are
+   * arranged horizontally.
+   * 
+ * + * .google.monitoring.dashboard.v1.RowLayout row_layout = 8; + */ + com.google.monitoring.dashboard.v1.RowLayoutOrBuilder getRowLayoutOrBuilder(); + + /** + * + * + *
+   * The content is divided into equally spaced columns and the widgets are
+   * arranged vertically.
+   * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + * + * @return Whether the columnLayout field is set. + */ + boolean hasColumnLayout(); + /** + * + * + *
+   * The content is divided into equally spaced columns and the widgets are
+   * arranged vertically.
+   * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + * + * @return The columnLayout. + */ + com.google.monitoring.dashboard.v1.ColumnLayout getColumnLayout(); + /** + * + * + *
+   * The content is divided into equally spaced columns and the widgets are
+   * arranged vertically.
+   * 
+ * + * .google.monitoring.dashboard.v1.ColumnLayout column_layout = 9; + */ + com.google.monitoring.dashboard.v1.ColumnLayoutOrBuilder getColumnLayoutOrBuilder(); + + public com.google.monitoring.dashboard.v1.Dashboard.LayoutCase getLayoutCase(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsProto.java new file mode 100644 index 00000000..9d369bc1 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsProto.java @@ -0,0 +1,76 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboard.proto + +package com.google.monitoring.dashboard.v1; + +public final class DashboardsProto { + private DashboardsProto() {} + + 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_monitoring_dashboard_v1_Dashboard_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Dashboard_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/monitoring/dashboard/v1/dashboa" + + "rd.proto\022\036google.monitoring.dashboard.v1" + + "\032,google/monitoring/dashboard/v1/layouts" + + ".proto\"\222\002\n\tDashboard\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + + "splay_name\030\002 \001(\t\022\014\n\004etag\030\004 \001(\t\022A\n\013grid_l" + + "ayout\030\005 \001(\0132*.google.monitoring.dashboar" + + "d.v1.GridLayoutH\000\022?\n\nrow_layout\030\010 \001(\0132)." + + "google.monitoring.dashboard.v1.RowLayout" + + "H\000\022E\n\rcolumn_layout\030\t \001(\0132,.google.monit" + + "oring.dashboard.v1.ColumnLayoutH\000B\010\n\006lay" + + "outB\200\001\n\"com.google.monitoring.dashboard." + + "v1B\017DashboardsProtoP\001ZGgoogle.golang.org" + + "/genproto/googleapis/monitoring/dashboar" + + "d/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.monitoring.dashboard.v1.LayoutsProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_Dashboard_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_Dashboard_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Dashboard_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Etag", "GridLayout", "RowLayout", "ColumnLayout", "Layout", + }); + com.google.monitoring.dashboard.v1.LayoutsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceProto.java new file mode 100644 index 00000000..780e0035 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceProto.java @@ -0,0 +1,191 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public final class DashboardsServiceProto { + private DashboardsServiceProto() {} + + 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_monitoring_dashboard_v1_CreateDashboardRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/monitoring/dashboard/v1/dashboa" + + "rds_service.proto\022\036google.monitoring.das" + + "hboard.v1\032\034google/api/annotations.proto\032" + + "\037google/api/field_behavior.proto\032.google" + + "/monitoring/dashboard/v1/dashboard.proto" + + "\032\033google/protobuf/empty.proto\032 google/pr" + + "otobuf/field_mask.proto\032\027google/api/clie" + + "nt.proto\"p\n\026CreateDashboardRequest\022\023\n\006pa" + + "rent\030\001 \001(\tB\003\340A\002\022A\n\tdashboard\030\002 \001(\0132).goo" + + "gle.monitoring.dashboard.v1.DashboardB\003\340" + + "A\002\"S\n\025ListDashboardsRequest\022\023\n\006parent\030\001 " + + "\001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" + + "n\030\003 \001(\t\"p\n\026ListDashboardsResponse\022=\n\ndas" + + "hboards\030\001 \003(\0132).google.monitoring.dashbo" + + "ard.v1.Dashboard\022\027\n\017next_page_token\030\002 \001(" + + "\t\"(\n\023GetDashboardRequest\022\021\n\004name\030\001 \001(\tB\003" + + "\340A\002\"+\n\026DeleteDashboardRequest\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\002\"[\n\026UpdateDashboardRequest\022A\n\tda" + + "shboard\030\001 \001(\0132).google.monitoring.dashbo" + + "ard.v1.DashboardB\003\340A\0022\261\010\n\021DashboardsServ" + + "ice\022\253\001\n\017CreateDashboard\0226.google.monitor" + + "ing.dashboard.v1.CreateDashboardRequest\032" + + ").google.monitoring.dashboard.v1.Dashboa" + + "rd\"5\202\323\344\223\002/\"\"/v1/{parent=projects/*}/dash" + + "boards:\tdashboard\022\253\001\n\016ListDashboards\0225.g" + + "oogle.monitoring.dashboard.v1.ListDashbo" + + "ardsRequest\0326.google.monitoring.dashboar" + + "d.v1.ListDashboardsResponse\"*\202\323\344\223\002$\022\"/v1" + + "/{parent=projects/*}/dashboards\022\232\001\n\014GetD" + + "ashboard\0223.google.monitoring.dashboard.v" + + "1.GetDashboardRequest\032).google.monitorin" + + "g.dashboard.v1.Dashboard\"*\202\323\344\223\002$\022\"/v1/{n" + + "ame=projects/*/dashboards/*}\022\215\001\n\017DeleteD" + + "ashboard\0226.google.monitoring.dashboard.v" + + "1.DeleteDashboardRequest\032\026.google.protob" + + "uf.Empty\"*\202\323\344\223\002$*\"/v1/{name=projects/*/d" + + "ashboards/*}\022\265\001\n\017UpdateDashboard\0226.googl" + + "e.monitoring.dashboard.v1.UpdateDashboar" + + "dRequest\032).google.monitoring.dashboard.v" + + "1.Dashboard\"?\202\323\344\223\00292,/v1/{dashboard.name" + + "=projects/*/dashboards/*}:\tdashboard\032\332\001\312" + + "A\031monitoring.googleapis.com\322A\272\001https://w" + + "ww.googleapis.com/auth/cloud-platform,ht" + + "tps://www.googleapis.com/auth/monitoring" + + ",https://www.googleapis.com/auth/monitor" + + "ing.read,https://www.googleapis.com/auth" + + "/monitoring.writeB\207\001\n\"com.google.monitor" + + "ing.dashboard.v1B\026DashboardsServiceProto" + + "P\001ZGgoogle.golang.org/genproto/googleapi" + + "s/monitoring/dashboard/v1;dashboardb\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.monitoring.dashboard.v1.DashboardsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_CreateDashboardRequest_descriptor, + new java.lang.String[] { + "Parent", "Dashboard", + }); + internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_descriptor, + new java.lang.String[] { + "Dashboards", "NextPageToken", + }); + internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_descriptor, + new java.lang.String[] { + "Dashboard", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.monitoring.dashboard.v1.DashboardsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequest.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequest.java new file mode 100644 index 00000000..2f60dfed --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequest.java @@ -0,0 +1,642 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * The `DeleteDashboard` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.DeleteDashboardRequest} + */ +public final class DeleteDashboardRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.DeleteDashboardRequest) + DeleteDashboardRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDashboardRequest.newBuilder() to construct. + private DeleteDashboardRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDashboardRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDashboardRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteDashboardRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.DeleteDashboardRequest.class, + com.google.monitoring.dashboard.v1.DeleteDashboardRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.DeleteDashboardRequest)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.DeleteDashboardRequest other = + (com.google.monitoring.dashboard.v1.DeleteDashboardRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest 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.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest 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.monitoring.dashboard.v1.DeleteDashboardRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest 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.monitoring.dashboard.v1.DeleteDashboardRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest 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.monitoring.dashboard.v1.DeleteDashboardRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `DeleteDashboard` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.DeleteDashboardRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.DeleteDashboardRequest) + com.google.monitoring.dashboard.v1.DeleteDashboardRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.DeleteDashboardRequest.class, + com.google.monitoring.dashboard.v1.DeleteDashboardRequest.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.DeleteDashboardRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_DeleteDashboardRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.DeleteDashboardRequest getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.DeleteDashboardRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.DeleteDashboardRequest build() { + com.google.monitoring.dashboard.v1.DeleteDashboardRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.DeleteDashboardRequest buildPartial() { + com.google.monitoring.dashboard.v1.DeleteDashboardRequest result = + new com.google.monitoring.dashboard.v1.DeleteDashboardRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.DeleteDashboardRequest) { + return mergeFrom((com.google.monitoring.dashboard.v1.DeleteDashboardRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.DeleteDashboardRequest other) { + if (other == com.google.monitoring.dashboard.v1.DeleteDashboardRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.DeleteDashboardRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.DeleteDashboardRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.dashboard.v1.DeleteDashboardRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.DeleteDashboardRequest) + private static final com.google.monitoring.dashboard.v1.DeleteDashboardRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.DeleteDashboardRequest(); + } + + public static com.google.monitoring.dashboard.v1.DeleteDashboardRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDashboardRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteDashboardRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.DeleteDashboardRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequestOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequestOrBuilder.java new file mode 100644 index 00000000..401b667d --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public interface DeleteDashboardRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.DeleteDashboardRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java new file mode 100644 index 00000000..8bd37d08 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/drilldowns.proto + +package com.google.monitoring.dashboard.v1; + +public final class DrilldownsProto { + private DrilldownsProto() {} + + 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 = { + "\n/google/monitoring/dashboard/v1/drilldo" + + "wns.proto\022\036google.monitoring.dashboard.v" + + "1B\200\001\n\"com.google.monitoring.dashboard.v1" + + "B\017DrilldownsProtoP\001ZGgoogle.golang.org/g" + + "enproto/googleapis/monitoring/dashboard/" + + "v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequest.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequest.java new file mode 100644 index 00000000..fce86f63 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequest.java @@ -0,0 +1,656 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * The `GetDashboard` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.GetDashboardRequest} + */ +public final class GetDashboardRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.GetDashboardRequest) + GetDashboardRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDashboardRequest.newBuilder() to construct. + private GetDashboardRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDashboardRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDashboardRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetDashboardRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.GetDashboardRequest.class, + com.google.monitoring.dashboard.v1.GetDashboardRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is one of
+   * `"dashboards/{dashboard_id}"` (for system dashboards) or
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+   * (for custom dashboards).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is one of
+   * `"dashboards/{dashboard_id}"` (for system dashboards) or
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+   * (for custom dashboards).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.GetDashboardRequest)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.GetDashboardRequest other = + (com.google.monitoring.dashboard.v1.GetDashboardRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest 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.monitoring.dashboard.v1.GetDashboardRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest 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.monitoring.dashboard.v1.GetDashboardRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest 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.monitoring.dashboard.v1.GetDashboardRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest 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.monitoring.dashboard.v1.GetDashboardRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `GetDashboard` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.GetDashboardRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.GetDashboardRequest) + com.google.monitoring.dashboard.v1.GetDashboardRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.GetDashboardRequest.class, + com.google.monitoring.dashboard.v1.GetDashboardRequest.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.GetDashboardRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_GetDashboardRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GetDashboardRequest getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.GetDashboardRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GetDashboardRequest build() { + com.google.monitoring.dashboard.v1.GetDashboardRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GetDashboardRequest buildPartial() { + com.google.monitoring.dashboard.v1.GetDashboardRequest result = + new com.google.monitoring.dashboard.v1.GetDashboardRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.GetDashboardRequest) { + return mergeFrom((com.google.monitoring.dashboard.v1.GetDashboardRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.GetDashboardRequest other) { + if (other == com.google.monitoring.dashboard.v1.GetDashboardRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.GetDashboardRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.GetDashboardRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is one of
+     * `"dashboards/{dashboard_id}"` (for system dashboards) or
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+     * (for custom dashboards).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is one of
+     * `"dashboards/{dashboard_id}"` (for system dashboards) or
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+     * (for custom dashboards).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is one of
+     * `"dashboards/{dashboard_id}"` (for system dashboards) or
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+     * (for custom dashboards).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is one of
+     * `"dashboards/{dashboard_id}"` (for system dashboards) or
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+     * (for custom dashboards).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Dashboard. The format is one of
+     * `"dashboards/{dashboard_id}"` (for system dashboards) or
+     * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+     * (for custom dashboards).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.dashboard.v1.GetDashboardRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.GetDashboardRequest) + private static final com.google.monitoring.dashboard.v1.GetDashboardRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.GetDashboardRequest(); + } + + public static com.google.monitoring.dashboard.v1.GetDashboardRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDashboardRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetDashboardRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GetDashboardRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequestOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequestOrBuilder.java new file mode 100644 index 00000000..2c07efed --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public interface GetDashboardRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.GetDashboardRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is one of
+   * `"dashboards/{dashboard_id}"` (for system dashboards) or
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+   * (for custom dashboards).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Dashboard. The format is one of
+   * `"dashboards/{dashboard_id}"` (for system dashboards) or
+   * `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`
+   * (for custom dashboards).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayout.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayout.java new file mode 100644 index 00000000..f0b92139 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayout.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A basic layout divides the available space into vertical columns of equal
+ * width and arranges a list of widgets using a row-first strategy.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.GridLayout} + */ +public final class GridLayout extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.GridLayout) + GridLayoutOrBuilder { + private static final long serialVersionUID = 0L; + // Use GridLayout.newBuilder() to construct. + private GridLayout(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GridLayout() { + widgets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GridLayout(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GridLayout( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + columns_ = input.readInt64(); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + widgets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + widgets_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.Widget.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + widgets_ = java.util.Collections.unmodifiableList(widgets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_GridLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_GridLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.GridLayout.class, + com.google.monitoring.dashboard.v1.GridLayout.Builder.class); + } + + public static final int COLUMNS_FIELD_NUMBER = 1; + private long columns_; + /** + * + * + *
+   * The number of columns into which the view's width is divided. If omitted
+   * or set to zero, a system default will be used while rendering.
+   * 
+ * + * int64 columns = 1; + * + * @return The columns. + */ + public long getColumns() { + return columns_; + } + + public static final int WIDGETS_FIELD_NUMBER = 2; + private java.util.List widgets_; + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List getWidgetsList() { + return widgets_; + } + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsOrBuilderList() { + return widgets_; + } + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public int getWidgetsCount() { + return widgets_.size(); + } + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget getWidgets(int index) { + return widgets_.get(index); + } + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) { + return widgets_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (columns_ != 0L) { + output.writeInt64(1, columns_); + } + for (int i = 0; i < widgets_.size(); i++) { + output.writeMessage(2, widgets_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (columns_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, columns_); + } + for (int i = 0; i < widgets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, widgets_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.GridLayout)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.GridLayout other = + (com.google.monitoring.dashboard.v1.GridLayout) obj; + + if (getColumns() != other.getColumns()) return false; + if (!getWidgetsList().equals(other.getWidgetsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getColumns()); + if (getWidgetsCount() > 0) { + hash = (37 * hash) + WIDGETS_FIELD_NUMBER; + hash = (53 * hash) + getWidgetsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.GridLayout parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.GridLayout parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.GridLayout parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.GridLayout 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.monitoring.dashboard.v1.GridLayout parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.GridLayout parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.GridLayout parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.GridLayout 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.monitoring.dashboard.v1.GridLayout parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.GridLayout 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.monitoring.dashboard.v1.GridLayout parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.GridLayout 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.monitoring.dashboard.v1.GridLayout 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; + } + /** + * + * + *
+   * A basic layout divides the available space into vertical columns of equal
+   * width and arranges a list of widgets using a row-first strategy.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.GridLayout} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.GridLayout) + com.google.monitoring.dashboard.v1.GridLayoutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_GridLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_GridLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.GridLayout.class, + com.google.monitoring.dashboard.v1.GridLayout.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.GridLayout.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWidgetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + columns_ = 0L; + + if (widgetsBuilder_ == null) { + widgets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + widgetsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_GridLayout_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GridLayout getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GridLayout build() { + com.google.monitoring.dashboard.v1.GridLayout result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GridLayout buildPartial() { + com.google.monitoring.dashboard.v1.GridLayout result = + new com.google.monitoring.dashboard.v1.GridLayout(this); + int from_bitField0_ = bitField0_; + result.columns_ = columns_; + if (widgetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + widgets_ = java.util.Collections.unmodifiableList(widgets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.widgets_ = widgets_; + } else { + result.widgets_ = widgetsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.GridLayout) { + return mergeFrom((com.google.monitoring.dashboard.v1.GridLayout) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.GridLayout other) { + if (other == com.google.monitoring.dashboard.v1.GridLayout.getDefaultInstance()) return this; + if (other.getColumns() != 0L) { + setColumns(other.getColumns()); + } + if (widgetsBuilder_ == null) { + if (!other.widgets_.isEmpty()) { + if (widgets_.isEmpty()) { + widgets_ = other.widgets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWidgetsIsMutable(); + widgets_.addAll(other.widgets_); + } + onChanged(); + } + } else { + if (!other.widgets_.isEmpty()) { + if (widgetsBuilder_.isEmpty()) { + widgetsBuilder_.dispose(); + widgetsBuilder_ = null; + widgets_ = other.widgets_; + bitField0_ = (bitField0_ & ~0x00000001); + widgetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWidgetsFieldBuilder() + : null; + } else { + widgetsBuilder_.addAllMessages(other.widgets_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.GridLayout parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.GridLayout) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long columns_; + /** + * + * + *
+     * The number of columns into which the view's width is divided. If omitted
+     * or set to zero, a system default will be used while rendering.
+     * 
+ * + * int64 columns = 1; + * + * @return The columns. + */ + public long getColumns() { + return columns_; + } + /** + * + * + *
+     * The number of columns into which the view's width is divided. If omitted
+     * or set to zero, a system default will be used while rendering.
+     * 
+ * + * int64 columns = 1; + * + * @param value The columns to set. + * @return This builder for chaining. + */ + public Builder setColumns(long value) { + + columns_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of columns into which the view's width is divided. If omitted
+     * or set to zero, a system default will be used while rendering.
+     * 
+ * + * int64 columns = 1; + * + * @return This builder for chaining. + */ + public Builder clearColumns() { + + columns_ = 0L; + onChanged(); + return this; + } + + private java.util.List widgets_ = + java.util.Collections.emptyList(); + + private void ensureWidgetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + widgets_ = new java.util.ArrayList(widgets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder> + widgetsBuilder_; + + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List getWidgetsList() { + if (widgetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(widgets_); + } else { + return widgetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public int getWidgetsCount() { + if (widgetsBuilder_ == null) { + return widgets_.size(); + } else { + return widgetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget getWidgets(int index) { + if (widgetsBuilder_ == null) { + return widgets_.get(index); + } else { + return widgetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder setWidgets(int index, com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.set(index, value); + onChanged(); + } else { + widgetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder setWidgets( + int index, com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.set(index, builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.add(value); + onChanged(); + } else { + widgetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(int index, com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.add(index, value); + onChanged(); + } else { + widgetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.add(builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets( + int index, com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.add(index, builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addAllWidgets( + java.lang.Iterable values) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, widgets_); + onChanged(); + } else { + widgetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder clearWidgets() { + if (widgetsBuilder_ == null) { + widgets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + widgetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder removeWidgets(int index) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.remove(index); + onChanged(); + } else { + widgetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder getWidgetsBuilder(int index) { + return getWidgetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) { + if (widgetsBuilder_ == null) { + return widgets_.get(index); + } else { + return widgetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsOrBuilderList() { + if (widgetsBuilder_ != null) { + return widgetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(widgets_); + } + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder addWidgetsBuilder() { + return getWidgetsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()); + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder addWidgetsBuilder(int index) { + return getWidgetsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()); + } + /** + * + * + *
+     * The informational elements that are arranged into the columns row-first.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsBuilderList() { + return getWidgetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder> + getWidgetsFieldBuilder() { + if (widgetsBuilder_ == null) { + widgetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder>( + widgets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + widgets_ = null; + } + return widgetsBuilder_; + } + + @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.monitoring.dashboard.v1.GridLayout) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.GridLayout) + private static final com.google.monitoring.dashboard.v1.GridLayout DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.GridLayout(); + } + + public static com.google.monitoring.dashboard.v1.GridLayout getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GridLayout parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GridLayout(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.GridLayout getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayoutOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayoutOrBuilder.java new file mode 100644 index 00000000..87203457 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayoutOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +public interface GridLayoutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.GridLayout) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The number of columns into which the view's width is divided. If omitted
+   * or set to zero, a system default will be used while rendering.
+   * 
+ * + * int64 columns = 1; + * + * @return The columns. + */ + long getColumns(); + + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + java.util.List getWidgetsList(); + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + com.google.monitoring.dashboard.v1.Widget getWidgets(int index); + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + int getWidgetsCount(); + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + java.util.List + getWidgetsOrBuilderList(); + /** + * + * + *
+   * The informational elements that are arranged into the columns row-first.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/LayoutsProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/LayoutsProto.java new file mode 100644 index 00000000..cdfe36de --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/LayoutsProto.java @@ -0,0 +1,129 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +public final class LayoutsProto { + private LayoutsProto() {} + + 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_monitoring_dashboard_v1_GridLayout_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_GridLayout_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_RowLayout_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_RowLayout_Row_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_RowLayout_Row_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_ColumnLayout_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/monitoring/dashboard/v1/layouts" + + ".proto\022\036google.monitoring.dashboard.v1\032+" + + "google/monitoring/dashboard/v1/widget.pr" + + "oto\"V\n\nGridLayout\022\017\n\007columns\030\001 \001(\003\0227\n\007wi" + + "dgets\030\002 \003(\0132&.google.monitoring.dashboar" + + "d.v1.Widget\"\230\001\n\tRowLayout\022;\n\004rows\030\001 \003(\0132" + + "-.google.monitoring.dashboard.v1.RowLayo" + + "ut.Row\032N\n\003Row\022\016\n\006weight\030\001 \001(\003\0227\n\007widgets" + + "\030\002 \003(\0132&.google.monitoring.dashboard.v1." + + "Widget\"\247\001\n\014ColumnLayout\022D\n\007columns\030\001 \003(\013" + + "23.google.monitoring.dashboard.v1.Column" + + "Layout.Column\032Q\n\006Column\022\016\n\006weight\030\001 \001(\003\022" + + "7\n\007widgets\030\002 \003(\0132&.google.monitoring.das" + + "hboard.v1.WidgetB}\n\"com.google.monitorin" + + "g.dashboard.v1B\014LayoutsProtoP\001ZGgoogle.g" + + "olang.org/genproto/googleapis/monitoring" + + "/dashboard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.monitoring.dashboard.v1.WidgetProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_GridLayout_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_GridLayout_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_GridLayout_descriptor, + new java.lang.String[] { + "Columns", "Widgets", + }); + internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_dashboard_v1_RowLayout_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor, + new java.lang.String[] { + "Rows", + }); + internal_static_google_monitoring_dashboard_v1_RowLayout_Row_descriptor = + internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_dashboard_v1_RowLayout_Row_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_RowLayout_Row_descriptor, + new java.lang.String[] { + "Weight", "Widgets", + }); + internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_monitoring_dashboard_v1_ColumnLayout_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor, + new java.lang.String[] { + "Columns", + }); + internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_descriptor = + internal_static_google_monitoring_dashboard_v1_ColumnLayout_descriptor + .getNestedTypes() + .get(0); + internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_ColumnLayout_Column_descriptor, + new java.lang.String[] { + "Weight", "Widgets", + }); + com.google.monitoring.dashboard.v1.WidgetProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequest.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequest.java new file mode 100644 index 00000000..9eb5820f --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * The `ListDashboards` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ListDashboardsRequest} + */ +public final class ListDashboardsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.ListDashboardsRequest) + ListDashboardsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDashboardsRequest.newBuilder() to construct. + private ListDashboardsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDashboardsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDashboardsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDashboardsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ListDashboardsRequest.class, + com.google.monitoring.dashboard.v1.ListDashboardsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The scope of the dashboards to list. A project scope must be
+   * specified in the form of `"projects/{project_id_or_number}"`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The scope of the dashboards to list. A project scope must be
+   * specified in the form of `"projects/{project_id_or_number}"`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * A positive number that is the maximum number of results to return.
+   * If unspecified, a default of 1000 is used.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.ListDashboardsRequest)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.ListDashboardsRequest other = + (com.google.monitoring.dashboard.v1.ListDashboardsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest 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.monitoring.dashboard.v1.ListDashboardsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest 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.monitoring.dashboard.v1.ListDashboardsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest 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.monitoring.dashboard.v1.ListDashboardsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest 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.monitoring.dashboard.v1.ListDashboardsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `ListDashboards` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ListDashboardsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.ListDashboardsRequest) + com.google.monitoring.dashboard.v1.ListDashboardsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ListDashboardsRequest.class, + com.google.monitoring.dashboard.v1.ListDashboardsRequest.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.ListDashboardsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsRequest getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.ListDashboardsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsRequest build() { + com.google.monitoring.dashboard.v1.ListDashboardsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsRequest buildPartial() { + com.google.monitoring.dashboard.v1.ListDashboardsRequest result = + new com.google.monitoring.dashboard.v1.ListDashboardsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.ListDashboardsRequest) { + return mergeFrom((com.google.monitoring.dashboard.v1.ListDashboardsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.ListDashboardsRequest other) { + if (other == com.google.monitoring.dashboard.v1.ListDashboardsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.ListDashboardsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.ListDashboardsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The scope of the dashboards to list. A project scope must be
+     * specified in the form of `"projects/{project_id_or_number}"`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The scope of the dashboards to list. A project scope must be
+     * specified in the form of `"projects/{project_id_or_number}"`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The scope of the dashboards to list. A project scope must be
+     * specified in the form of `"projects/{project_id_or_number}"`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The scope of the dashboards to list. A project scope must be
+     * specified in the form of `"projects/{project_id_or_number}"`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The scope of the dashboards to list. A project scope must be
+     * specified in the form of `"projects/{project_id_or_number}"`.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * A positive number that is the maximum number of results to return.
+     * If unspecified, a default of 1000 is used.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * A positive number that is the maximum number of results to return.
+     * If unspecified, a default of 1000 is used.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A positive number that is the maximum number of results to return.
+     * If unspecified, a default of 1000 is used.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If this field is not empty then it must contain the `nextPageToken` value
+     * returned by a previous call to this method.  Using this field causes the
+     * method to return additional results from the previous method call.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @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.monitoring.dashboard.v1.ListDashboardsRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.ListDashboardsRequest) + private static final com.google.monitoring.dashboard.v1.ListDashboardsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.ListDashboardsRequest(); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDashboardsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDashboardsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequestOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequestOrBuilder.java new file mode 100644 index 00000000..953089f8 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public interface ListDashboardsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.ListDashboardsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The scope of the dashboards to list. A project scope must be
+   * specified in the form of `"projects/{project_id_or_number}"`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The scope of the dashboards to list. A project scope must be
+   * specified in the form of `"projects/{project_id_or_number}"`.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A positive number that is the maximum number of results to return.
+   * If unspecified, a default of 1000 is used.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * If this field is not empty then it must contain the `nextPageToken` value
+   * returned by a previous call to this method.  Using this field causes the
+   * method to return additional results from the previous method call.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponse.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponse.java new file mode 100644 index 00000000..c9b60e58 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponse.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * The `ListDashboards` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ListDashboardsResponse} + */ +public final class ListDashboardsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.ListDashboardsResponse) + ListDashboardsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDashboardsResponse.newBuilder() to construct. + private ListDashboardsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDashboardsResponse() { + dashboards_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDashboardsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDashboardsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + dashboards_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + dashboards_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.Dashboard.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + dashboards_ = java.util.Collections.unmodifiableList(dashboards_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ListDashboardsResponse.class, + com.google.monitoring.dashboard.v1.ListDashboardsResponse.Builder.class); + } + + public static final int DASHBOARDS_FIELD_NUMBER = 1; + private java.util.List dashboards_; + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public java.util.List getDashboardsList() { + return dashboards_; + } + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public java.util.List + getDashboardsOrBuilderList() { + return dashboards_; + } + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public int getDashboardsCount() { + return dashboards_.size(); + } + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboards(int index) { + return dashboards_.get(index); + } + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardsOrBuilder(int index) { + return dashboards_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < dashboards_.size(); i++) { + output.writeMessage(1, dashboards_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dashboards_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dashboards_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.ListDashboardsResponse)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.ListDashboardsResponse other = + (com.google.monitoring.dashboard.v1.ListDashboardsResponse) obj; + + if (!getDashboardsList().equals(other.getDashboardsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDashboardsCount() > 0) { + hash = (37 * hash) + DASHBOARDS_FIELD_NUMBER; + hash = (53 * hash) + getDashboardsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse 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.monitoring.dashboard.v1.ListDashboardsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse 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.monitoring.dashboard.v1.ListDashboardsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse 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.monitoring.dashboard.v1.ListDashboardsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse 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.monitoring.dashboard.v1.ListDashboardsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `ListDashboards` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.ListDashboardsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.ListDashboardsResponse) + com.google.monitoring.dashboard.v1.ListDashboardsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.ListDashboardsResponse.class, + com.google.monitoring.dashboard.v1.ListDashboardsResponse.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.ListDashboardsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDashboardsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dashboardsBuilder_ == null) { + dashboards_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + dashboardsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_ListDashboardsResponse_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsResponse getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.ListDashboardsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsResponse build() { + com.google.monitoring.dashboard.v1.ListDashboardsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsResponse buildPartial() { + com.google.monitoring.dashboard.v1.ListDashboardsResponse result = + new com.google.monitoring.dashboard.v1.ListDashboardsResponse(this); + int from_bitField0_ = bitField0_; + if (dashboardsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dashboards_ = java.util.Collections.unmodifiableList(dashboards_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dashboards_ = dashboards_; + } else { + result.dashboards_ = dashboardsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.ListDashboardsResponse) { + return mergeFrom((com.google.monitoring.dashboard.v1.ListDashboardsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.ListDashboardsResponse other) { + if (other == com.google.monitoring.dashboard.v1.ListDashboardsResponse.getDefaultInstance()) + return this; + if (dashboardsBuilder_ == null) { + if (!other.dashboards_.isEmpty()) { + if (dashboards_.isEmpty()) { + dashboards_ = other.dashboards_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDashboardsIsMutable(); + dashboards_.addAll(other.dashboards_); + } + onChanged(); + } + } else { + if (!other.dashboards_.isEmpty()) { + if (dashboardsBuilder_.isEmpty()) { + dashboardsBuilder_.dispose(); + dashboardsBuilder_ = null; + dashboards_ = other.dashboards_; + bitField0_ = (bitField0_ & ~0x00000001); + dashboardsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDashboardsFieldBuilder() + : null; + } else { + dashboardsBuilder_.addAllMessages(other.dashboards_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.ListDashboardsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.ListDashboardsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List dashboards_ = + java.util.Collections.emptyList(); + + private void ensureDashboardsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dashboards_ = + new java.util.ArrayList(dashboards_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder> + dashboardsBuilder_; + + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public java.util.List getDashboardsList() { + if (dashboardsBuilder_ == null) { + return java.util.Collections.unmodifiableList(dashboards_); + } else { + return dashboardsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public int getDashboardsCount() { + if (dashboardsBuilder_ == null) { + return dashboards_.size(); + } else { + return dashboardsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboards(int index) { + if (dashboardsBuilder_ == null) { + return dashboards_.get(index); + } else { + return dashboardsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder setDashboards(int index, com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDashboardsIsMutable(); + dashboards_.set(index, value); + onChanged(); + } else { + dashboardsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder setDashboards( + int index, com.google.monitoring.dashboard.v1.Dashboard.Builder builderForValue) { + if (dashboardsBuilder_ == null) { + ensureDashboardsIsMutable(); + dashboards_.set(index, builderForValue.build()); + onChanged(); + } else { + dashboardsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder addDashboards(com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDashboardsIsMutable(); + dashboards_.add(value); + onChanged(); + } else { + dashboardsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder addDashboards(int index, com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDashboardsIsMutable(); + dashboards_.add(index, value); + onChanged(); + } else { + dashboardsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder addDashboards( + com.google.monitoring.dashboard.v1.Dashboard.Builder builderForValue) { + if (dashboardsBuilder_ == null) { + ensureDashboardsIsMutable(); + dashboards_.add(builderForValue.build()); + onChanged(); + } else { + dashboardsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder addDashboards( + int index, com.google.monitoring.dashboard.v1.Dashboard.Builder builderForValue) { + if (dashboardsBuilder_ == null) { + ensureDashboardsIsMutable(); + dashboards_.add(index, builderForValue.build()); + onChanged(); + } else { + dashboardsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder addAllDashboards( + java.lang.Iterable values) { + if (dashboardsBuilder_ == null) { + ensureDashboardsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dashboards_); + onChanged(); + } else { + dashboardsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder clearDashboards() { + if (dashboardsBuilder_ == null) { + dashboards_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dashboardsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public Builder removeDashboards(int index) { + if (dashboardsBuilder_ == null) { + ensureDashboardsIsMutable(); + dashboards_.remove(index); + onChanged(); + } else { + dashboardsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.Dashboard.Builder getDashboardsBuilder(int index) { + return getDashboardsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardsOrBuilder(int index) { + if (dashboardsBuilder_ == null) { + return dashboards_.get(index); + } else { + return dashboardsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public java.util.List + getDashboardsOrBuilderList() { + if (dashboardsBuilder_ != null) { + return dashboardsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dashboards_); + } + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.Dashboard.Builder addDashboardsBuilder() { + return getDashboardsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance()); + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public com.google.monitoring.dashboard.v1.Dashboard.Builder addDashboardsBuilder(int index) { + return getDashboardsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance()); + } + /** + * + * + *
+     * The list of requested dashboards.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + public java.util.List + getDashboardsBuilderList() { + return getDashboardsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder> + getDashboardsFieldBuilder() { + if (dashboardsBuilder_ == null) { + dashboardsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder>( + dashboards_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + dashboards_ = null; + } + return dashboardsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there are more results than have been returned, then this field is set
+     * to a non-empty value.  To see the additional results,
+     * use that value as `pageToken` in the next call to this method.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.dashboard.v1.ListDashboardsResponse) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.ListDashboardsResponse) + private static final com.google.monitoring.dashboard.v1.ListDashboardsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.ListDashboardsResponse(); + } + + public static com.google.monitoring.dashboard.v1.ListDashboardsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDashboardsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDashboardsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.ListDashboardsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponseOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponseOrBuilder.java new file mode 100644 index 00000000..e5ad3588 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponseOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public interface ListDashboardsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.ListDashboardsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + java.util.List getDashboardsList(); + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + com.google.monitoring.dashboard.v1.Dashboard getDashboards(int index); + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + int getDashboardsCount(); + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + java.util.List + getDashboardsOrBuilderList(); + /** + * + * + *
+   * The list of requested dashboards.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Dashboard dashboards = 1; + */ + com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardsOrBuilder(int index); + + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there are more results than have been returned, then this field is set
+   * to a non-empty value.  To see the additional results,
+   * use that value as `pageToken` in the next call to this method.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/MetricsProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/MetricsProto.java new file mode 100644 index 00000000..080a0f0e --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/MetricsProto.java @@ -0,0 +1,173 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +public final class MetricsProto { + private MetricsProto() {} + + 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_monitoring_dashboard_v1_TimeSeriesQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_Threshold_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Threshold_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/monitoring/dashboard/v1/metrics" + + ".proto\022\036google.monitoring.dashboard.v1\032\037" + + "google/api/field_behavior.proto\032+google/" + + "monitoring/dashboard/v1/common.proto\"\335\001\n" + + "\017TimeSeriesQuery\022N\n\022time_series_filter\030\001" + + " \001(\01320.google.monitoring.dashboard.v1.Ti" + + "meSeriesFilterH\000\022Y\n\030time_series_filter_r" + + "atio\030\002 \001(\01325.google.monitoring.dashboard" + + ".v1.TimeSeriesFilterRatioH\000\022\025\n\runit_over" + + "ride\030\005 \001(\tB\010\n\006source\"\272\002\n\020TimeSeriesFilte" + + "r\022\023\n\006filter\030\001 \001(\tB\003\340A\002\022@\n\013aggregation\030\002 " + + "\001(\0132+.google.monitoring.dashboard.v1.Agg" + + "regation\022W\n\027pick_time_series_filter\030\004 \001(" + + "\01324.google.monitoring.dashboard.v1.PickT" + + "imeSeriesFilterH\000\022e\n\036statistical_time_se" + + "ries_filter\030\005 \001(\0132;.google.monitoring.da" + + "shboard.v1.StatisticalTimeSeriesFilterH\000" + + "B\017\n\routput_filter\"\302\004\n\025TimeSeriesFilterRa" + + "tio\022R\n\tnumerator\030\001 \001(\0132?.google.monitori" + + "ng.dashboard.v1.TimeSeriesFilterRatio.Ra" + + "tioPart\022T\n\013denominator\030\002 \001(\0132?.google.mo" + + "nitoring.dashboard.v1.TimeSeriesFilterRa" + + "tio.RatioPart\022J\n\025secondary_aggregation\030\003" + + " \001(\0132+.google.monitoring.dashboard.v1.Ag" + + "gregation\022W\n\027pick_time_series_filter\030\004 \001" + + "(\01324.google.monitoring.dashboard.v1.Pick" + + "TimeSeriesFilterH\000\022e\n\036statistical_time_s" + + "eries_filter\030\005 \001(\0132;.google.monitoring.d" + + "ashboard.v1.StatisticalTimeSeriesFilterH" + + "\000\032b\n\tRatioPart\022\023\n\006filter\030\001 \001(\tB\003\340A\002\022@\n\013a" + + "ggregation\030\002 \001(\0132+.google.monitoring.das" + + "hboard.v1.AggregationB\017\n\routput_filter\"\244" + + "\002\n\tThreshold\022\r\n\005label\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\001\022>\n\005color\030\003 \001(\0162/.google.monitoring.da" + + "shboard.v1.Threshold.Color\022F\n\tdirection\030" + + "\004 \001(\01623.google.monitoring.dashboard.v1.T" + + "hreshold.Direction\"3\n\005Color\022\025\n\021COLOR_UNS" + + "PECIFIED\020\000\022\n\n\006YELLOW\020\004\022\007\n\003RED\020\006\"<\n\tDirec" + + "tion\022\031\n\025DIRECTION_UNSPECIFIED\020\000\022\t\n\005ABOVE" + + "\020\001\022\t\n\005BELOW\020\002*Q\n\016SparkChartType\022 \n\034SPARK" + + "_CHART_TYPE_UNSPECIFIED\020\000\022\016\n\nSPARK_LINE\020" + + "\001\022\r\n\tSPARK_BAR\020\002B}\n\"com.google.monitorin" + + "g.dashboard.v1B\014MetricsProtoP\001ZGgoogle.g" + + "olang.org/genproto/googleapis/monitoring" + + "/dashboard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.monitoring.dashboard.v1.CommonProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_descriptor, + new java.lang.String[] { + "TimeSeriesFilter", "TimeSeriesFilterRatio", "UnitOverride", "Source", + }); + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_descriptor, + new java.lang.String[] { + "Filter", + "Aggregation", + "PickTimeSeriesFilter", + "StatisticalTimeSeriesFilter", + "OutputFilter", + }); + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor, + new java.lang.String[] { + "Numerator", + "Denominator", + "SecondaryAggregation", + "PickTimeSeriesFilter", + "StatisticalTimeSeriesFilter", + "OutputFilter", + }); + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_descriptor = + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor + .getNestedTypes() + .get(0); + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_descriptor, + new java.lang.String[] { + "Filter", "Aggregation", + }); + internal_static_google_monitoring_dashboard_v1_Threshold_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_monitoring_dashboard_v1_Threshold_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Threshold_descriptor, + new java.lang.String[] { + "Label", "Value", "Color", "Direction", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.monitoring.dashboard.v1.CommonProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilter.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilter.java new file mode 100644 index 00000000..c7056192 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilter.java @@ -0,0 +1,1241 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * Describes a ranking-based time series filter. Each input time series is
+ * ranked with an aligner. The filter lets through up to `num_time_series` time
+ * series, selecting them based on the relative ranking.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.PickTimeSeriesFilter} + */ +public final class PickTimeSeriesFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.PickTimeSeriesFilter) + PickTimeSeriesFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use PickTimeSeriesFilter.newBuilder() to construct. + private PickTimeSeriesFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PickTimeSeriesFilter() { + rankingMethod_ = 0; + direction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PickTimeSeriesFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PickTimeSeriesFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + rankingMethod_ = rawValue; + break; + } + case 16: + { + numTimeSeries_ = input.readInt32(); + break; + } + case 24: + { + int rawValue = input.readEnum(); + + direction_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.class, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder.class); + } + + /** + * + * + *
+   * The value reducers that can be applied to a PickTimeSeriesFilter.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method} + */ + public enum Method implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + METHOD_UNSPECIFIED(0), + /** + * + * + *
+     * Select the mean of all values.
+     * 
+ * + * METHOD_MEAN = 1; + */ + METHOD_MEAN(1), + /** + * + * + *
+     * Select the maximum value.
+     * 
+ * + * METHOD_MAX = 2; + */ + METHOD_MAX(2), + /** + * + * + *
+     * Select the minimum value.
+     * 
+ * + * METHOD_MIN = 3; + */ + METHOD_MIN(3), + /** + * + * + *
+     * Compute the sum of all values.
+     * 
+ * + * METHOD_SUM = 4; + */ + METHOD_SUM(4), + /** + * + * + *
+     * Select the most recent value.
+     * 
+ * + * METHOD_LATEST = 5; + */ + METHOD_LATEST(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + public static final int METHOD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Select the mean of all values.
+     * 
+ * + * METHOD_MEAN = 1; + */ + public static final int METHOD_MEAN_VALUE = 1; + /** + * + * + *
+     * Select the maximum value.
+     * 
+ * + * METHOD_MAX = 2; + */ + public static final int METHOD_MAX_VALUE = 2; + /** + * + * + *
+     * Select the minimum value.
+     * 
+ * + * METHOD_MIN = 3; + */ + public static final int METHOD_MIN_VALUE = 3; + /** + * + * + *
+     * Compute the sum of all values.
+     * 
+ * + * METHOD_SUM = 4; + */ + public static final int METHOD_SUM_VALUE = 4; + /** + * + * + *
+     * Select the most recent value.
+     * 
+ * + * METHOD_LATEST = 5; + */ + public static final int METHOD_LATEST_VALUE = 5; + + 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 Method 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 Method forNumber(int value) { + switch (value) { + case 0: + return METHOD_UNSPECIFIED; + case 1: + return METHOD_MEAN; + case 2: + return METHOD_MAX; + case 3: + return METHOD_MIN; + case 4: + return METHOD_SUM; + case 5: + return METHOD_LATEST; + 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 Method findValueByNumber(int number) { + return Method.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Method[] VALUES = values(); + + public static Method 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 Method(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method) + } + + /** + * + * + *
+   * Describes the ranking directions.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction} + */ + public enum Direction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + DIRECTION_UNSPECIFIED(0), + /** + * + * + *
+     * Pass the highest ranking inputs.
+     * 
+ * + * TOP = 1; + */ + TOP(1), + /** + * + * + *
+     * Pass the lowest ranking inputs.
+     * 
+ * + * BOTTOM = 2; + */ + BOTTOM(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + public static final int DIRECTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Pass the highest ranking inputs.
+     * 
+ * + * TOP = 1; + */ + public static final int TOP_VALUE = 1; + /** + * + * + *
+     * Pass the lowest ranking inputs.
+     * 
+ * + * BOTTOM = 2; + */ + public static final int BOTTOM_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 Direction 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 Direction forNumber(int value) { + switch (value) { + case 0: + return DIRECTION_UNSPECIFIED; + case 1: + return TOP; + case 2: + return BOTTOM; + 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 Direction findValueByNumber(int number) { + return Direction.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final Direction[] VALUES = values(); + + public static Direction 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 Direction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction) + } + + public static final int RANKING_METHOD_FIELD_NUMBER = 1; + private int rankingMethod_; + /** + * + * + *
+   * `rankingMethod` is applied to each time series independently to produce the
+   * value which will be used to compare the time series to other time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return The enum numeric value on the wire for rankingMethod. + */ + public int getRankingMethodValue() { + return rankingMethod_; + } + /** + * + * + *
+   * `rankingMethod` is applied to each time series independently to produce the
+   * value which will be used to compare the time series to other time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return The rankingMethod. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method getRankingMethod() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method result = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method.valueOf(rankingMethod_); + return result == null + ? com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method.UNRECOGNIZED + : result; + } + + public static final int NUM_TIME_SERIES_FIELD_NUMBER = 2; + private int numTimeSeries_; + /** + * + * + *
+   * How many time series to return.
+   * 
+ * + * int32 num_time_series = 2; + * + * @return The numTimeSeries. + */ + public int getNumTimeSeries() { + return numTimeSeries_; + } + + public static final int DIRECTION_FIELD_NUMBER = 3; + private int direction_; + /** + * + * + *
+   * How to use the ranking to select time series that pass through the filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return The enum numeric value on the wire for direction. + */ + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+   * How to use the ranking to select time series that pass through the filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return The direction. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction result = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction.valueOf(direction_); + return result == null + ? com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction.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 (rankingMethod_ + != com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method.METHOD_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, rankingMethod_); + } + if (numTimeSeries_ != 0) { + output.writeInt32(2, numTimeSeries_); + } + if (direction_ + != com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction.DIRECTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, direction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rankingMethod_ + != com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method.METHOD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, rankingMethod_); + } + if (numTimeSeries_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numTimeSeries_); + } + if (direction_ + != com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction.DIRECTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, direction_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.PickTimeSeriesFilter)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter other = + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) obj; + + if (rankingMethod_ != other.rankingMethod_) return false; + if (getNumTimeSeries() != other.getNumTimeSeries()) return false; + if (direction_ != other.direction_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RANKING_METHOD_FIELD_NUMBER; + hash = (53 * hash) + rankingMethod_; + hash = (37 * hash) + NUM_TIME_SERIES_FIELD_NUMBER; + hash = (53 * hash) + getNumTimeSeries(); + hash = (37 * hash) + DIRECTION_FIELD_NUMBER; + hash = (53 * hash) + direction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter 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.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter 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.monitoring.dashboard.v1.PickTimeSeriesFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter 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.monitoring.dashboard.v1.PickTimeSeriesFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter 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.monitoring.dashboard.v1.PickTimeSeriesFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes a ranking-based time series filter. Each input time series is
+   * ranked with an aligner. The filter lets through up to `num_time_series` time
+   * series, selecting them based on the relative ranking.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.PickTimeSeriesFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.PickTimeSeriesFilter) + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.class, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + rankingMethod_ = 0; + + numTimeSeries_ = 0; + + direction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_PickTimeSeriesFilter_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter build() { + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter buildPartial() { + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter result = + new com.google.monitoring.dashboard.v1.PickTimeSeriesFilter(this); + result.rankingMethod_ = rankingMethod_; + result.numTimeSeries_ = numTimeSeries_; + result.direction_ = direction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) { + return mergeFrom((com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.PickTimeSeriesFilter other) { + if (other == com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance()) + return this; + if (other.rankingMethod_ != 0) { + setRankingMethodValue(other.getRankingMethodValue()); + } + if (other.getNumTimeSeries() != 0) { + setNumTimeSeries(other.getNumTimeSeries()); + } + if (other.direction_ != 0) { + setDirectionValue(other.getDirectionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int rankingMethod_ = 0; + /** + * + * + *
+     * `rankingMethod` is applied to each time series independently to produce the
+     * value which will be used to compare the time series to other time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return The enum numeric value on the wire for rankingMethod. + */ + public int getRankingMethodValue() { + return rankingMethod_; + } + /** + * + * + *
+     * `rankingMethod` is applied to each time series independently to produce the
+     * value which will be used to compare the time series to other time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @param value The enum numeric value on the wire for rankingMethod to set. + * @return This builder for chaining. + */ + public Builder setRankingMethodValue(int value) { + rankingMethod_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `rankingMethod` is applied to each time series independently to produce the
+     * value which will be used to compare the time series to other time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return The rankingMethod. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method getRankingMethod() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method result = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method.valueOf(rankingMethod_); + return result == null + ? com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * `rankingMethod` is applied to each time series independently to produce the
+     * value which will be used to compare the time series to other time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @param value The rankingMethod to set. + * @return This builder for chaining. + */ + public Builder setRankingMethod( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method value) { + if (value == null) { + throw new NullPointerException(); + } + + rankingMethod_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * `rankingMethod` is applied to each time series independently to produce the
+     * value which will be used to compare the time series to other time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return This builder for chaining. + */ + public Builder clearRankingMethod() { + + rankingMethod_ = 0; + onChanged(); + return this; + } + + private int numTimeSeries_; + /** + * + * + *
+     * How many time series to return.
+     * 
+ * + * int32 num_time_series = 2; + * + * @return The numTimeSeries. + */ + public int getNumTimeSeries() { + return numTimeSeries_; + } + /** + * + * + *
+     * How many time series to return.
+     * 
+ * + * int32 num_time_series = 2; + * + * @param value The numTimeSeries to set. + * @return This builder for chaining. + */ + public Builder setNumTimeSeries(int value) { + + numTimeSeries_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How many time series to return.
+     * 
+ * + * int32 num_time_series = 2; + * + * @return This builder for chaining. + */ + public Builder clearNumTimeSeries() { + + numTimeSeries_ = 0; + onChanged(); + return this; + } + + private int direction_ = 0; + /** + * + * + *
+     * How to use the ranking to select time series that pass through the filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return The enum numeric value on the wire for direction. + */ + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+     * How to use the ranking to select time series that pass through the filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @param value The enum numeric value on the wire for direction to set. + * @return This builder for chaining. + */ + public Builder setDirectionValue(int value) { + direction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How to use the ranking to select time series that pass through the filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return The direction. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction result = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction.valueOf(direction_); + return result == null + ? com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * How to use the ranking to select time series that pass through the filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @param value The direction to set. + * @return This builder for chaining. + */ + public Builder setDirection( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction value) { + if (value == null) { + throw new NullPointerException(); + } + + direction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * How to use the ranking to select time series that pass through the filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return This builder for chaining. + */ + public Builder clearDirection() { + + direction_ = 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.monitoring.dashboard.v1.PickTimeSeriesFilter) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.PickTimeSeriesFilter) + private static final com.google.monitoring.dashboard.v1.PickTimeSeriesFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.PickTimeSeriesFilter(); + } + + public static com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PickTimeSeriesFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PickTimeSeriesFilter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilterOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilterOrBuilder.java new file mode 100644 index 00000000..e17fd6d0 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilterOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +public interface PickTimeSeriesFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.PickTimeSeriesFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * `rankingMethod` is applied to each time series independently to produce the
+   * value which will be used to compare the time series to other time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return The enum numeric value on the wire for rankingMethod. + */ + int getRankingMethodValue(); + /** + * + * + *
+   * `rankingMethod` is applied to each time series independently to produce the
+   * value which will be used to compare the time series to other time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method ranking_method = 1; + * + * @return The rankingMethod. + */ + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method getRankingMethod(); + + /** + * + * + *
+   * How many time series to return.
+   * 
+ * + * int32 num_time_series = 2; + * + * @return The numTimeSeries. + */ + int getNumTimeSeries(); + + /** + * + * + *
+   * How to use the ranking to select time series that pass through the filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return The enum numeric value on the wire for direction. + */ + int getDirectionValue(); + /** + * + * + *
+   * How to use the ranking to select time series that pass through the filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction direction = 3; + * + * @return The direction. + */ + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction getDirection(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayout.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayout.java new file mode 100644 index 00000000..c4d02c76 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayout.java @@ -0,0 +1,2049 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A simplified layout that divides the available space into rows
+ * and arranges a set of widgets horizontally in each row.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.RowLayout} + */ +public final class RowLayout extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.RowLayout) + RowLayoutOrBuilder { + private static final long serialVersionUID = 0L; + // Use RowLayout.newBuilder() to construct. + private RowLayout(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RowLayout() { + rows_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RowLayout(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RowLayout( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + rows_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rows_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.RowLayout.Row.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rows_ = java.util.Collections.unmodifiableList(rows_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.RowLayout.class, + com.google.monitoring.dashboard.v1.RowLayout.Builder.class); + } + + public interface RowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.RowLayout.Row) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The relative weight of this row. The row weight is used to adjust the
+     * height of rows on the screen (relative to peers). Greater the weight,
+     * greater the height of the row on the screen. If omitted, a value
+     * of 1 is used while rendering.
+     * 
+ * + * int64 weight = 1; + * + * @return The weight. + */ + long getWeight(); + + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + java.util.List getWidgetsList(); + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + com.google.monitoring.dashboard.v1.Widget getWidgets(int index); + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + int getWidgetsCount(); + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + java.util.List + getWidgetsOrBuilderList(); + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index); + } + /** + * + * + *
+   * Defines the layout properties and content for a row.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.RowLayout.Row} + */ + public static final class Row extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.RowLayout.Row) + RowOrBuilder { + private static final long serialVersionUID = 0L; + // Use Row.newBuilder() to construct. + private Row(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Row() { + widgets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Row(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Row( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + weight_ = input.readInt64(); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + widgets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + widgets_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.Widget.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + widgets_ = java.util.Collections.unmodifiableList(widgets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.RowLayout.Row.class, + com.google.monitoring.dashboard.v1.RowLayout.Row.Builder.class); + } + + public static final int WEIGHT_FIELD_NUMBER = 1; + private long weight_; + /** + * + * + *
+     * The relative weight of this row. The row weight is used to adjust the
+     * height of rows on the screen (relative to peers). Greater the weight,
+     * greater the height of the row on the screen. If omitted, a value
+     * of 1 is used while rendering.
+     * 
+ * + * int64 weight = 1; + * + * @return The weight. + */ + public long getWeight() { + return weight_; + } + + public static final int WIDGETS_FIELD_NUMBER = 2; + private java.util.List widgets_; + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List getWidgetsList() { + return widgets_; + } + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsOrBuilderList() { + return widgets_; + } + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public int getWidgetsCount() { + return widgets_.size(); + } + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget getWidgets(int index) { + return widgets_.get(index); + } + /** + * + * + *
+     * The display widgets arranged horizontally in this row.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) { + return widgets_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (weight_ != 0L) { + output.writeInt64(1, weight_); + } + for (int i = 0; i < widgets_.size(); i++) { + output.writeMessage(2, widgets_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (weight_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, weight_); + } + for (int i = 0; i < widgets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, widgets_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.RowLayout.Row)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.RowLayout.Row other = + (com.google.monitoring.dashboard.v1.RowLayout.Row) obj; + + if (getWeight() != other.getWeight()) return false; + if (!getWidgetsList().equals(other.getWidgetsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + WEIGHT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getWeight()); + if (getWidgetsCount() > 0) { + hash = (37 * hash) + WIDGETS_FIELD_NUMBER; + hash = (53 * hash) + getWidgetsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row 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.monitoring.dashboard.v1.RowLayout.Row parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row 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.monitoring.dashboard.v1.RowLayout.Row parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row 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.monitoring.dashboard.v1.RowLayout.Row parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row 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.monitoring.dashboard.v1.RowLayout.Row 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; + } + /** + * + * + *
+     * Defines the layout properties and content for a row.
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.RowLayout.Row} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.RowLayout.Row) + com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_Row_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_Row_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.RowLayout.Row.class, + com.google.monitoring.dashboard.v1.RowLayout.Row.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.RowLayout.Row.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWidgetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + weight_ = 0L; + + if (widgetsBuilder_ == null) { + widgets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + widgetsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_Row_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout.Row getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.RowLayout.Row.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout.Row build() { + com.google.monitoring.dashboard.v1.RowLayout.Row result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout.Row buildPartial() { + com.google.monitoring.dashboard.v1.RowLayout.Row result = + new com.google.monitoring.dashboard.v1.RowLayout.Row(this); + int from_bitField0_ = bitField0_; + result.weight_ = weight_; + if (widgetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + widgets_ = java.util.Collections.unmodifiableList(widgets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.widgets_ = widgets_; + } else { + result.widgets_ = widgetsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.RowLayout.Row) { + return mergeFrom((com.google.monitoring.dashboard.v1.RowLayout.Row) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.RowLayout.Row other) { + if (other == com.google.monitoring.dashboard.v1.RowLayout.Row.getDefaultInstance()) + return this; + if (other.getWeight() != 0L) { + setWeight(other.getWeight()); + } + if (widgetsBuilder_ == null) { + if (!other.widgets_.isEmpty()) { + if (widgets_.isEmpty()) { + widgets_ = other.widgets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWidgetsIsMutable(); + widgets_.addAll(other.widgets_); + } + onChanged(); + } + } else { + if (!other.widgets_.isEmpty()) { + if (widgetsBuilder_.isEmpty()) { + widgetsBuilder_.dispose(); + widgetsBuilder_ = null; + widgets_ = other.widgets_; + bitField0_ = (bitField0_ & ~0x00000001); + widgetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWidgetsFieldBuilder() + : null; + } else { + widgetsBuilder_.addAllMessages(other.widgets_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.RowLayout.Row parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.RowLayout.Row) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private long weight_; + /** + * + * + *
+       * The relative weight of this row. The row weight is used to adjust the
+       * height of rows on the screen (relative to peers). Greater the weight,
+       * greater the height of the row on the screen. If omitted, a value
+       * of 1 is used while rendering.
+       * 
+ * + * int64 weight = 1; + * + * @return The weight. + */ + public long getWeight() { + return weight_; + } + /** + * + * + *
+       * The relative weight of this row. The row weight is used to adjust the
+       * height of rows on the screen (relative to peers). Greater the weight,
+       * greater the height of the row on the screen. If omitted, a value
+       * of 1 is used while rendering.
+       * 
+ * + * int64 weight = 1; + * + * @param value The weight to set. + * @return This builder for chaining. + */ + public Builder setWeight(long value) { + + weight_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The relative weight of this row. The row weight is used to adjust the
+       * height of rows on the screen (relative to peers). Greater the weight,
+       * greater the height of the row on the screen. If omitted, a value
+       * of 1 is used while rendering.
+       * 
+ * + * int64 weight = 1; + * + * @return This builder for chaining. + */ + public Builder clearWeight() { + + weight_ = 0L; + onChanged(); + return this; + } + + private java.util.List widgets_ = + java.util.Collections.emptyList(); + + private void ensureWidgetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + widgets_ = new java.util.ArrayList(widgets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder> + widgetsBuilder_; + + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List getWidgetsList() { + if (widgetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(widgets_); + } else { + return widgetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public int getWidgetsCount() { + if (widgetsBuilder_ == null) { + return widgets_.size(); + } else { + return widgetsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget getWidgets(int index) { + if (widgetsBuilder_ == null) { + return widgets_.get(index); + } else { + return widgetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder setWidgets(int index, com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.set(index, value); + onChanged(); + } else { + widgetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder setWidgets( + int index, com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.set(index, builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.add(value); + onChanged(); + } else { + widgetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(int index, com.google.monitoring.dashboard.v1.Widget value) { + if (widgetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWidgetsIsMutable(); + widgets_.add(index, value); + onChanged(); + } else { + widgetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets(com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.add(builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addWidgets( + int index, com.google.monitoring.dashboard.v1.Widget.Builder builderForValue) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.add(index, builderForValue.build()); + onChanged(); + } else { + widgetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder addAllWidgets( + java.lang.Iterable values) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, widgets_); + onChanged(); + } else { + widgetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder clearWidgets() { + if (widgetsBuilder_ == null) { + widgets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + widgetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public Builder removeWidgets(int index) { + if (widgetsBuilder_ == null) { + ensureWidgetsIsMutable(); + widgets_.remove(index); + onChanged(); + } else { + widgetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder getWidgetsBuilder(int index) { + return getWidgetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.WidgetOrBuilder getWidgetsOrBuilder(int index) { + if (widgetsBuilder_ == null) { + return widgets_.get(index); + } else { + return widgetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsOrBuilderList() { + if (widgetsBuilder_ != null) { + return widgetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(widgets_); + } + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder addWidgetsBuilder() { + return getWidgetsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()); + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public com.google.monitoring.dashboard.v1.Widget.Builder addWidgetsBuilder(int index) { + return getWidgetsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()); + } + /** + * + * + *
+       * The display widgets arranged horizontally in this row.
+       * 
+ * + * repeated .google.monitoring.dashboard.v1.Widget widgets = 2; + */ + public java.util.List + getWidgetsBuilderList() { + return getWidgetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder> + getWidgetsFieldBuilder() { + if (widgetsBuilder_ == null) { + widgetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Widget, + com.google.monitoring.dashboard.v1.Widget.Builder, + com.google.monitoring.dashboard.v1.WidgetOrBuilder>( + widgets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + widgets_ = null; + } + return widgetsBuilder_; + } + + @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.monitoring.dashboard.v1.RowLayout.Row) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.RowLayout.Row) + private static final com.google.monitoring.dashboard.v1.RowLayout.Row DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.RowLayout.Row(); + } + + public static com.google.monitoring.dashboard.v1.RowLayout.Row getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Row parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Row(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout.Row getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ROWS_FIELD_NUMBER = 1; + private java.util.List rows_; + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public java.util.List getRowsList() { + return rows_; + } + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public java.util.List + getRowsOrBuilderList() { + return rows_; + } + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public int getRowsCount() { + return rows_.size(); + } + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.Row getRows(int index) { + return rows_.get(index); + } + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder getRowsOrBuilder(int index) { + return rows_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < rows_.size(); i++) { + output.writeMessage(1, rows_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rows_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.RowLayout)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.RowLayout other = + (com.google.monitoring.dashboard.v1.RowLayout) obj; + + if (!getRowsList().equals(other.getRowsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRowsCount() > 0) { + hash = (37 * hash) + ROWS_FIELD_NUMBER; + hash = (53 * hash) + getRowsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.RowLayout parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.RowLayout parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.RowLayout parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.RowLayout 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.monitoring.dashboard.v1.RowLayout parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.RowLayout parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.RowLayout parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.RowLayout 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.monitoring.dashboard.v1.RowLayout parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.RowLayout 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.monitoring.dashboard.v1.RowLayout parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.RowLayout 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.monitoring.dashboard.v1.RowLayout 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; + } + /** + * + * + *
+   * A simplified layout that divides the available space into rows
+   * and arranges a set of widgets horizontally in each row.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.RowLayout} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.RowLayout) + com.google.monitoring.dashboard.v1.RowLayoutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.RowLayout.class, + com.google.monitoring.dashboard.v1.RowLayout.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.RowLayout.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRowsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + rowsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.LayoutsProto + .internal_static_google_monitoring_dashboard_v1_RowLayout_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout build() { + com.google.monitoring.dashboard.v1.RowLayout result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout buildPartial() { + com.google.monitoring.dashboard.v1.RowLayout result = + new com.google.monitoring.dashboard.v1.RowLayout(this); + int from_bitField0_ = bitField0_; + if (rowsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rows_ = java.util.Collections.unmodifiableList(rows_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rows_ = rows_; + } else { + result.rows_ = rowsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.RowLayout) { + return mergeFrom((com.google.monitoring.dashboard.v1.RowLayout) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.RowLayout other) { + if (other == com.google.monitoring.dashboard.v1.RowLayout.getDefaultInstance()) return this; + if (rowsBuilder_ == null) { + if (!other.rows_.isEmpty()) { + if (rows_.isEmpty()) { + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRowsIsMutable(); + rows_.addAll(other.rows_); + } + onChanged(); + } + } else { + if (!other.rows_.isEmpty()) { + if (rowsBuilder_.isEmpty()) { + rowsBuilder_.dispose(); + rowsBuilder_ = null; + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000001); + rowsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRowsFieldBuilder() + : null; + } else { + rowsBuilder_.addAllMessages(other.rows_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.RowLayout parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.RowLayout) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List rows_ = + java.util.Collections.emptyList(); + + private void ensureRowsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rows_ = new java.util.ArrayList(rows_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.RowLayout.Row, + com.google.monitoring.dashboard.v1.RowLayout.Row.Builder, + com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder> + rowsBuilder_; + + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public java.util.List getRowsList() { + if (rowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rows_); + } else { + return rowsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public int getRowsCount() { + if (rowsBuilder_ == null) { + return rows_.size(); + } else { + return rowsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.Row getRows(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder setRows(int index, com.google.monitoring.dashboard.v1.RowLayout.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.set(index, value); + onChanged(); + } else { + rowsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder setRows( + int index, com.google.monitoring.dashboard.v1.RowLayout.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.set(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder addRows(com.google.monitoring.dashboard.v1.RowLayout.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(value); + onChanged(); + } else { + rowsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder addRows(int index, com.google.monitoring.dashboard.v1.RowLayout.Row value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(index, value); + onChanged(); + } else { + rowsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder addRows( + com.google.monitoring.dashboard.v1.RowLayout.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder addRows( + int index, com.google.monitoring.dashboard.v1.RowLayout.Row.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder addAllRows( + java.lang.Iterable values) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rows_); + onChanged(); + } else { + rowsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder clearRows() { + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public Builder removeRows(int index) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.remove(index); + onChanged(); + } else { + rowsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.Row.Builder getRowsBuilder(int index) { + return getRowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder getRowsOrBuilder(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public java.util.List + getRowsOrBuilderList() { + if (rowsBuilder_ != null) { + return rowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rows_); + } + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.Row.Builder addRowsBuilder() { + return getRowsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.RowLayout.Row.getDefaultInstance()); + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public com.google.monitoring.dashboard.v1.RowLayout.Row.Builder addRowsBuilder(int index) { + return getRowsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.RowLayout.Row.getDefaultInstance()); + } + /** + * + * + *
+     * The rows of content to display.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + public java.util.List + getRowsBuilderList() { + return getRowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.RowLayout.Row, + com.google.monitoring.dashboard.v1.RowLayout.Row.Builder, + com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder> + getRowsFieldBuilder() { + if (rowsBuilder_ == null) { + rowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.RowLayout.Row, + com.google.monitoring.dashboard.v1.RowLayout.Row.Builder, + com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder>( + rows_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rows_ = null; + } + return rowsBuilder_; + } + + @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.monitoring.dashboard.v1.RowLayout) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.RowLayout) + private static final com.google.monitoring.dashboard.v1.RowLayout DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.RowLayout(); + } + + public static com.google.monitoring.dashboard.v1.RowLayout getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RowLayout parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RowLayout(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.RowLayout getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayoutOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayoutOrBuilder.java new file mode 100644 index 00000000..a980c3a6 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayoutOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/layouts.proto + +package com.google.monitoring.dashboard.v1; + +public interface RowLayoutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.RowLayout) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + java.util.List getRowsList(); + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + com.google.monitoring.dashboard.v1.RowLayout.Row getRows(int index); + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + int getRowsCount(); + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + java.util.List + getRowsOrBuilderList(); + /** + * + * + *
+   * The rows of content to display.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.RowLayout.Row rows = 1; + */ + com.google.monitoring.dashboard.v1.RowLayout.RowOrBuilder getRowsOrBuilder(int index); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Scorecard.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Scorecard.java new file mode 100644 index 00000000..195c0956 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Scorecard.java @@ -0,0 +1,4338 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/scorecard.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A widget showing the latest value of a metric, and how this value relates to
+ * one or more thresholds.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Scorecard} + */ +public final class Scorecard extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Scorecard) + ScorecardOrBuilder { + private static final long serialVersionUID = 0L; + // Use Scorecard.newBuilder() to construct. + private Scorecard(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Scorecard() { + thresholds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Scorecard(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Scorecard( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder subBuilder = null; + if (timeSeriesQuery_ != null) { + subBuilder = timeSeriesQuery_.toBuilder(); + } + timeSeriesQuery_ = + input.readMessage( + com.google.monitoring.dashboard.v1.TimeSeriesQuery.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeSeriesQuery_); + timeSeriesQuery_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder subBuilder = null; + if (dataViewCase_ == 4) { + subBuilder = + ((com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_) + .toBuilder(); + } + dataView_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_); + dataView_ = subBuilder.buildPartial(); + } + dataViewCase_ = 4; + break; + } + case 42: + { + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder subBuilder = null; + if (dataViewCase_ == 5) { + subBuilder = + ((com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_) + .toBuilder(); + } + dataView_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_); + dataView_ = subBuilder.buildPartial(); + } + dataViewCase_ = 5; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + thresholds_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + thresholds_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.Threshold.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + thresholds_ = java.util.Collections.unmodifiableList(thresholds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Scorecard.class, + com.google.monitoring.dashboard.v1.Scorecard.Builder.class); + } + + public interface GaugeViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Scorecard.GaugeView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The lower bound for this gauge chart. The value of the chart should
+     * always be greater than or equal to this.
+     * 
+ * + * double lower_bound = 1; + * + * @return The lowerBound. + */ + double getLowerBound(); + + /** + * + * + *
+     * The upper bound for this gauge chart. The value of the chart should
+     * always be less than or equal to this.
+     * 
+ * + * double upper_bound = 2; + * + * @return The upperBound. + */ + double getUpperBound(); + } + /** + * + * + *
+   * A gauge chart shows where the current value sits within a pre-defined
+   * range. The upper and lower bounds should define the possible range of
+   * values for the scorecard's query (inclusive).
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Scorecard.GaugeView} + */ + public static final class GaugeView extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Scorecard.GaugeView) + GaugeViewOrBuilder { + private static final long serialVersionUID = 0L; + // Use GaugeView.newBuilder() to construct. + private GaugeView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GaugeView() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GaugeView(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GaugeView( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + lowerBound_ = input.readDouble(); + break; + } + case 17: + { + upperBound_ = input.readDouble(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.class, + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder.class); + } + + public static final int LOWER_BOUND_FIELD_NUMBER = 1; + private double lowerBound_; + /** + * + * + *
+     * The lower bound for this gauge chart. The value of the chart should
+     * always be greater than or equal to this.
+     * 
+ * + * double lower_bound = 1; + * + * @return The lowerBound. + */ + public double getLowerBound() { + return lowerBound_; + } + + public static final int UPPER_BOUND_FIELD_NUMBER = 2; + private double upperBound_; + /** + * + * + *
+     * The upper bound for this gauge chart. The value of the chart should
+     * always be less than or equal to this.
+     * 
+ * + * double upper_bound = 2; + * + * @return The upperBound. + */ + public double getUpperBound() { + return upperBound_; + } + + 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 (lowerBound_ != 0D) { + output.writeDouble(1, lowerBound_); + } + if (upperBound_ != 0D) { + output.writeDouble(2, upperBound_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (lowerBound_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, lowerBound_); + } + if (upperBound_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, upperBound_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Scorecard.GaugeView)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Scorecard.GaugeView other = + (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) obj; + + if (java.lang.Double.doubleToLongBits(getLowerBound()) + != java.lang.Double.doubleToLongBits(other.getLowerBound())) return false; + if (java.lang.Double.doubleToLongBits(getUpperBound()) + != java.lang.Double.doubleToLongBits(other.getUpperBound())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOWER_BOUND_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getLowerBound())); + hash = (37 * hash) + UPPER_BOUND_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getUpperBound())); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView 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.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView 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.monitoring.dashboard.v1.Scorecard.GaugeView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView 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.monitoring.dashboard.v1.Scorecard.GaugeView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView 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.monitoring.dashboard.v1.Scorecard.GaugeView 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; + } + /** + * + * + *
+     * A gauge chart shows where the current value sits within a pre-defined
+     * range. The upper and lower bounds should define the possible range of
+     * values for the scorecard's query (inclusive).
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Scorecard.GaugeView} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Scorecard.GaugeView) + com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.class, + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Scorecard.GaugeView.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + lowerBound_ = 0D; + + upperBound_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView build() { + com.google.monitoring.dashboard.v1.Scorecard.GaugeView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView buildPartial() { + com.google.monitoring.dashboard.v1.Scorecard.GaugeView result = + new com.google.monitoring.dashboard.v1.Scorecard.GaugeView(this); + result.lowerBound_ = lowerBound_; + result.upperBound_ = upperBound_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Scorecard.GaugeView) { + return mergeFrom((com.google.monitoring.dashboard.v1.Scorecard.GaugeView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Scorecard.GaugeView other) { + if (other == com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance()) + return this; + if (other.getLowerBound() != 0D) { + setLowerBound(other.getLowerBound()); + } + if (other.getUpperBound() != 0D) { + setUpperBound(other.getUpperBound()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Scorecard.GaugeView parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private double lowerBound_; + /** + * + * + *
+       * The lower bound for this gauge chart. The value of the chart should
+       * always be greater than or equal to this.
+       * 
+ * + * double lower_bound = 1; + * + * @return The lowerBound. + */ + public double getLowerBound() { + return lowerBound_; + } + /** + * + * + *
+       * The lower bound for this gauge chart. The value of the chart should
+       * always be greater than or equal to this.
+       * 
+ * + * double lower_bound = 1; + * + * @param value The lowerBound to set. + * @return This builder for chaining. + */ + public Builder setLowerBound(double value) { + + lowerBound_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The lower bound for this gauge chart. The value of the chart should
+       * always be greater than or equal to this.
+       * 
+ * + * double lower_bound = 1; + * + * @return This builder for chaining. + */ + public Builder clearLowerBound() { + + lowerBound_ = 0D; + onChanged(); + return this; + } + + private double upperBound_; + /** + * + * + *
+       * The upper bound for this gauge chart. The value of the chart should
+       * always be less than or equal to this.
+       * 
+ * + * double upper_bound = 2; + * + * @return The upperBound. + */ + public double getUpperBound() { + return upperBound_; + } + /** + * + * + *
+       * The upper bound for this gauge chart. The value of the chart should
+       * always be less than or equal to this.
+       * 
+ * + * double upper_bound = 2; + * + * @param value The upperBound to set. + * @return This builder for chaining. + */ + public Builder setUpperBound(double value) { + + upperBound_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The upper bound for this gauge chart. The value of the chart should
+       * always be less than or equal to this.
+       * 
+ * + * double upper_bound = 2; + * + * @return This builder for chaining. + */ + public Builder clearUpperBound() { + + upperBound_ = 0D; + 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.monitoring.dashboard.v1.Scorecard.GaugeView) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Scorecard.GaugeView) + private static final com.google.monitoring.dashboard.v1.Scorecard.GaugeView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Scorecard.GaugeView(); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.GaugeView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GaugeView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GaugeView(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SparkChartViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Scorecard.SparkChartView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of sparkchart to show in this chartView.
+     * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return The enum numeric value on the wire for sparkChartType. + */ + int getSparkChartTypeValue(); + /** + * + * + *
+     * The type of sparkchart to show in this chartView.
+     * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return The sparkChartType. + */ + com.google.monitoring.dashboard.v1.SparkChartType getSparkChartType(); + + /** + * + * + *
+     * The lower bound on data point frequency in the chart implemented by
+     * specifying the minimum alignment period to use in a time series query.
+     * For example, if the data is published once every 10 minutes it would not
+     * make sense to fetch and align data at one minute intervals. This field is
+     * optional and exists only as a hint.
+     * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + * + * @return Whether the minAlignmentPeriod field is set. + */ + boolean hasMinAlignmentPeriod(); + /** + * + * + *
+     * The lower bound on data point frequency in the chart implemented by
+     * specifying the minimum alignment period to use in a time series query.
+     * For example, if the data is published once every 10 minutes it would not
+     * make sense to fetch and align data at one minute intervals. This field is
+     * optional and exists only as a hint.
+     * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + * + * @return The minAlignmentPeriod. + */ + com.google.protobuf.Duration getMinAlignmentPeriod(); + /** + * + * + *
+     * The lower bound on data point frequency in the chart implemented by
+     * specifying the minimum alignment period to use in a time series query.
+     * For example, if the data is published once every 10 minutes it would not
+     * make sense to fetch and align data at one minute intervals. This field is
+     * optional and exists only as a hint.
+     * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + com.google.protobuf.DurationOrBuilder getMinAlignmentPeriodOrBuilder(); + } + /** + * + * + *
+   * A sparkChart is a small chart suitable for inclusion in a table-cell or
+   * inline in text. This message contains the configuration for a sparkChart
+   * to show up on a Scorecard, showing recent trends of the scorecard's
+   * timeseries.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Scorecard.SparkChartView} + */ + public static final class SparkChartView extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Scorecard.SparkChartView) + SparkChartViewOrBuilder { + private static final long serialVersionUID = 0L; + // Use SparkChartView.newBuilder() to construct. + private SparkChartView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SparkChartView() { + sparkChartType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SparkChartView(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SparkChartView( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + sparkChartType_ = rawValue; + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (minAlignmentPeriod_ != null) { + subBuilder = minAlignmentPeriod_.toBuilder(); + } + minAlignmentPeriod_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(minAlignmentPeriod_); + minAlignmentPeriod_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.class, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder.class); + } + + public static final int SPARK_CHART_TYPE_FIELD_NUMBER = 1; + private int sparkChartType_; + /** + * + * + *
+     * The type of sparkchart to show in this chartView.
+     * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return The enum numeric value on the wire for sparkChartType. + */ + public int getSparkChartTypeValue() { + return sparkChartType_; + } + /** + * + * + *
+     * The type of sparkchart to show in this chartView.
+     * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return The sparkChartType. + */ + public com.google.monitoring.dashboard.v1.SparkChartType getSparkChartType() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.SparkChartType result = + com.google.monitoring.dashboard.v1.SparkChartType.valueOf(sparkChartType_); + return result == null + ? com.google.monitoring.dashboard.v1.SparkChartType.UNRECOGNIZED + : result; + } + + public static final int MIN_ALIGNMENT_PERIOD_FIELD_NUMBER = 2; + private com.google.protobuf.Duration minAlignmentPeriod_; + /** + * + * + *
+     * The lower bound on data point frequency in the chart implemented by
+     * specifying the minimum alignment period to use in a time series query.
+     * For example, if the data is published once every 10 minutes it would not
+     * make sense to fetch and align data at one minute intervals. This field is
+     * optional and exists only as a hint.
+     * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + * + * @return Whether the minAlignmentPeriod field is set. + */ + public boolean hasMinAlignmentPeriod() { + return minAlignmentPeriod_ != null; + } + /** + * + * + *
+     * The lower bound on data point frequency in the chart implemented by
+     * specifying the minimum alignment period to use in a time series query.
+     * For example, if the data is published once every 10 minutes it would not
+     * make sense to fetch and align data at one minute intervals. This field is
+     * optional and exists only as a hint.
+     * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + * + * @return The minAlignmentPeriod. + */ + public com.google.protobuf.Duration getMinAlignmentPeriod() { + return minAlignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minAlignmentPeriod_; + } + /** + * + * + *
+     * The lower bound on data point frequency in the chart implemented by
+     * specifying the minimum alignment period to use in a time series query.
+     * For example, if the data is published once every 10 minutes it would not
+     * make sense to fetch and align data at one minute intervals. This field is
+     * optional and exists only as a hint.
+     * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public com.google.protobuf.DurationOrBuilder getMinAlignmentPeriodOrBuilder() { + return getMinAlignmentPeriod(); + } + + 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 (sparkChartType_ + != com.google.monitoring.dashboard.v1.SparkChartType.SPARK_CHART_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, sparkChartType_); + } + if (minAlignmentPeriod_ != null) { + output.writeMessage(2, getMinAlignmentPeriod()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sparkChartType_ + != com.google.monitoring.dashboard.v1.SparkChartType.SPARK_CHART_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, sparkChartType_); + } + if (minAlignmentPeriod_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMinAlignmentPeriod()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Scorecard.SparkChartView)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView other = + (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) obj; + + if (sparkChartType_ != other.sparkChartType_) return false; + if (hasMinAlignmentPeriod() != other.hasMinAlignmentPeriod()) return false; + if (hasMinAlignmentPeriod()) { + if (!getMinAlignmentPeriod().equals(other.getMinAlignmentPeriod())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SPARK_CHART_TYPE_FIELD_NUMBER; + hash = (53 * hash) + sparkChartType_; + if (hasMinAlignmentPeriod()) { + hash = (37 * hash) + MIN_ALIGNMENT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getMinAlignmentPeriod().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView 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.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView 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.monitoring.dashboard.v1.Scorecard.SparkChartView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView 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.monitoring.dashboard.v1.Scorecard.SparkChartView parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView 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.monitoring.dashboard.v1.Scorecard.SparkChartView 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; + } + /** + * + * + *
+     * A sparkChart is a small chart suitable for inclusion in a table-cell or
+     * inline in text. This message contains the configuration for a sparkChart
+     * to show up on a Scorecard, showing recent trends of the scorecard's
+     * timeseries.
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Scorecard.SparkChartView} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Scorecard.SparkChartView) + com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.class, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sparkChartType_ = 0; + + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriod_ = null; + } else { + minAlignmentPeriod_ = null; + minAlignmentPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView + getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView build() { + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView buildPartial() { + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView result = + new com.google.monitoring.dashboard.v1.Scorecard.SparkChartView(this); + result.sparkChartType_ = sparkChartType_; + if (minAlignmentPeriodBuilder_ == null) { + result.minAlignmentPeriod_ = minAlignmentPeriod_; + } else { + result.minAlignmentPeriod_ = minAlignmentPeriodBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) { + return mergeFrom((com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Scorecard.SparkChartView other) { + if (other + == com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance()) + return this; + if (other.sparkChartType_ != 0) { + setSparkChartTypeValue(other.getSparkChartTypeValue()); + } + if (other.hasMinAlignmentPeriod()) { + mergeMinAlignmentPeriod(other.getMinAlignmentPeriod()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sparkChartType_ = 0; + /** + * + * + *
+       * The type of sparkchart to show in this chartView.
+       * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return The enum numeric value on the wire for sparkChartType. + */ + public int getSparkChartTypeValue() { + return sparkChartType_; + } + /** + * + * + *
+       * The type of sparkchart to show in this chartView.
+       * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @param value The enum numeric value on the wire for sparkChartType to set. + * @return This builder for chaining. + */ + public Builder setSparkChartTypeValue(int value) { + sparkChartType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of sparkchart to show in this chartView.
+       * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return The sparkChartType. + */ + public com.google.monitoring.dashboard.v1.SparkChartType getSparkChartType() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.SparkChartType result = + com.google.monitoring.dashboard.v1.SparkChartType.valueOf(sparkChartType_); + return result == null + ? com.google.monitoring.dashboard.v1.SparkChartType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The type of sparkchart to show in this chartView.
+       * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @param value The sparkChartType to set. + * @return This builder for chaining. + */ + public Builder setSparkChartType(com.google.monitoring.dashboard.v1.SparkChartType value) { + if (value == null) { + throw new NullPointerException(); + } + + sparkChartType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of sparkchart to show in this chartView.
+       * 
+ * + * .google.monitoring.dashboard.v1.SparkChartType spark_chart_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearSparkChartType() { + + sparkChartType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration minAlignmentPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + minAlignmentPeriodBuilder_; + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + * + * @return Whether the minAlignmentPeriod field is set. + */ + public boolean hasMinAlignmentPeriod() { + return minAlignmentPeriodBuilder_ != null || minAlignmentPeriod_ != null; + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + * + * @return The minAlignmentPeriod. + */ + public com.google.protobuf.Duration getMinAlignmentPeriod() { + if (minAlignmentPeriodBuilder_ == null) { + return minAlignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minAlignmentPeriod_; + } else { + return minAlignmentPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public Builder setMinAlignmentPeriod(com.google.protobuf.Duration value) { + if (minAlignmentPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minAlignmentPeriod_ = value; + onChanged(); + } else { + minAlignmentPeriodBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public Builder setMinAlignmentPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriod_ = builderForValue.build(); + onChanged(); + } else { + minAlignmentPeriodBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public Builder mergeMinAlignmentPeriod(com.google.protobuf.Duration value) { + if (minAlignmentPeriodBuilder_ == null) { + if (minAlignmentPeriod_ != null) { + minAlignmentPeriod_ = + com.google.protobuf.Duration.newBuilder(minAlignmentPeriod_) + .mergeFrom(value) + .buildPartial(); + } else { + minAlignmentPeriod_ = value; + } + onChanged(); + } else { + minAlignmentPeriodBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public Builder clearMinAlignmentPeriod() { + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriod_ = null; + onChanged(); + } else { + minAlignmentPeriod_ = null; + minAlignmentPeriodBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public com.google.protobuf.Duration.Builder getMinAlignmentPeriodBuilder() { + + onChanged(); + return getMinAlignmentPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + public com.google.protobuf.DurationOrBuilder getMinAlignmentPeriodOrBuilder() { + if (minAlignmentPeriodBuilder_ != null) { + return minAlignmentPeriodBuilder_.getMessageOrBuilder(); + } else { + return minAlignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minAlignmentPeriod_; + } + } + /** + * + * + *
+       * The lower bound on data point frequency in the chart implemented by
+       * specifying the minimum alignment period to use in a time series query.
+       * For example, if the data is published once every 10 minutes it would not
+       * make sense to fetch and align data at one minute intervals. This field is
+       * optional and exists only as a hint.
+       * 
+ * + * .google.protobuf.Duration min_alignment_period = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMinAlignmentPeriodFieldBuilder() { + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMinAlignmentPeriod(), getParentForChildren(), isClean()); + minAlignmentPeriod_ = null; + } + return minAlignmentPeriodBuilder_; + } + + @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.monitoring.dashboard.v1.Scorecard.SparkChartView) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Scorecard.SparkChartView) + private static final com.google.monitoring.dashboard.v1.Scorecard.SparkChartView + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Scorecard.SparkChartView(); + } + + public static com.google.monitoring.dashboard.v1.Scorecard.SparkChartView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SparkChartView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SparkChartView(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int dataViewCase_ = 0; + private java.lang.Object dataView_; + + public enum DataViewCase implements com.google.protobuf.Internal.EnumLite { + GAUGE_VIEW(4), + SPARK_CHART_VIEW(5), + DATAVIEW_NOT_SET(0); + private final int value; + + private DataViewCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataViewCase valueOf(int value) { + return forNumber(value); + } + + public static DataViewCase forNumber(int value) { + switch (value) { + case 4: + return GAUGE_VIEW; + case 5: + return SPARK_CHART_VIEW; + case 0: + return DATAVIEW_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataViewCase getDataViewCase() { + return DataViewCase.forNumber(dataViewCase_); + } + + public static final int TIME_SERIES_QUERY_FIELD_NUMBER = 1; + private com.google.monitoring.dashboard.v1.TimeSeriesQuery timeSeriesQuery_; + /** + * + * + *
+   * Fields for querying time series data from the
+   * Stackdriver metrics API.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return Whether the timeSeriesQuery field is set. + */ + public boolean hasTimeSeriesQuery() { + return timeSeriesQuery_ != null; + } + /** + * + * + *
+   * Fields for querying time series data from the
+   * Stackdriver metrics API.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return The timeSeriesQuery. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQuery getTimeSeriesQuery() { + return timeSeriesQuery_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance() + : timeSeriesQuery_; + } + /** + * + * + *
+   * Fields for querying time series data from the
+   * Stackdriver metrics API.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder getTimeSeriesQueryOrBuilder() { + return getTimeSeriesQuery(); + } + + public static final int GAUGE_VIEW_FIELD_NUMBER = 4; + /** + * + * + *
+   * Will cause the scorecard to show a gauge chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + * + * @return Whether the gaugeView field is set. + */ + public boolean hasGaugeView() { + return dataViewCase_ == 4; + } + /** + * + * + *
+   * Will cause the scorecard to show a gauge chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + * + * @return The gaugeView. + */ + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView getGaugeView() { + if (dataViewCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } + /** + * + * + *
+   * Will cause the scorecard to show a gauge chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder getGaugeViewOrBuilder() { + if (dataViewCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } + + public static final int SPARK_CHART_VIEW_FIELD_NUMBER = 5; + /** + * + * + *
+   * Will cause the scorecard to show a spark chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + * + * @return Whether the sparkChartView field is set. + */ + public boolean hasSparkChartView() { + return dataViewCase_ == 5; + } + /** + * + * + *
+   * Will cause the scorecard to show a spark chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + * + * @return The sparkChartView. + */ + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView getSparkChartView() { + if (dataViewCase_ == 5) { + return (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } + /** + * + * + *
+   * Will cause the scorecard to show a spark chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder + getSparkChartViewOrBuilder() { + if (dataViewCase_ == 5) { + return (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } + + public static final int THRESHOLDS_FIELD_NUMBER = 6; + private java.util.List thresholds_; + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public java.util.List getThresholdsList() { + return thresholds_; + } + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public java.util.List + getThresholdsOrBuilderList() { + return thresholds_; + } + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public int getThresholdsCount() { + return thresholds_.size(); + } + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.Threshold getThresholds(int index) { + return thresholds_.get(index); + } + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.ThresholdOrBuilder getThresholdsOrBuilder(int index) { + return thresholds_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (timeSeriesQuery_ != null) { + output.writeMessage(1, getTimeSeriesQuery()); + } + if (dataViewCase_ == 4) { + output.writeMessage(4, (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_); + } + if (dataViewCase_ == 5) { + output.writeMessage( + 5, (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_); + } + for (int i = 0; i < thresholds_.size(); i++) { + output.writeMessage(6, thresholds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timeSeriesQuery_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTimeSeriesQuery()); + } + if (dataViewCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_); + } + if (dataViewCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_); + } + for (int i = 0; i < thresholds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, thresholds_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Scorecard)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Scorecard other = + (com.google.monitoring.dashboard.v1.Scorecard) obj; + + if (hasTimeSeriesQuery() != other.hasTimeSeriesQuery()) return false; + if (hasTimeSeriesQuery()) { + if (!getTimeSeriesQuery().equals(other.getTimeSeriesQuery())) return false; + } + if (!getThresholdsList().equals(other.getThresholdsList())) return false; + if (!getDataViewCase().equals(other.getDataViewCase())) return false; + switch (dataViewCase_) { + case 4: + if (!getGaugeView().equals(other.getGaugeView())) return false; + break; + case 5: + if (!getSparkChartView().equals(other.getSparkChartView())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTimeSeriesQuery()) { + hash = (37 * hash) + TIME_SERIES_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getTimeSeriesQuery().hashCode(); + } + if (getThresholdsCount() > 0) { + hash = (37 * hash) + THRESHOLDS_FIELD_NUMBER; + hash = (53 * hash) + getThresholdsList().hashCode(); + } + switch (dataViewCase_) { + case 4: + hash = (37 * hash) + GAUGE_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getGaugeView().hashCode(); + break; + case 5: + hash = (37 * hash) + SPARK_CHART_VIEW_FIELD_NUMBER; + hash = (53 * hash) + getSparkChartView().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Scorecard parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Scorecard parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard 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.monitoring.dashboard.v1.Scorecard parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Scorecard parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Scorecard parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard 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.monitoring.dashboard.v1.Scorecard parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard 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.monitoring.dashboard.v1.Scorecard parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Scorecard 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.monitoring.dashboard.v1.Scorecard 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; + } + /** + * + * + *
+   * A widget showing the latest value of a metric, and how this value relates to
+   * one or more thresholds.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Scorecard} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Scorecard) + com.google.monitoring.dashboard.v1.ScorecardOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Scorecard.class, + com.google.monitoring.dashboard.v1.Scorecard.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Scorecard.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getThresholdsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQuery_ = null; + } else { + timeSeriesQuery_ = null; + timeSeriesQueryBuilder_ = null; + } + if (thresholdsBuilder_ == null) { + thresholds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + thresholdsBuilder_.clear(); + } + dataViewCase_ = 0; + dataView_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.ScorecardProto + .internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard build() { + com.google.monitoring.dashboard.v1.Scorecard result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard buildPartial() { + com.google.monitoring.dashboard.v1.Scorecard result = + new com.google.monitoring.dashboard.v1.Scorecard(this); + int from_bitField0_ = bitField0_; + if (timeSeriesQueryBuilder_ == null) { + result.timeSeriesQuery_ = timeSeriesQuery_; + } else { + result.timeSeriesQuery_ = timeSeriesQueryBuilder_.build(); + } + if (dataViewCase_ == 4) { + if (gaugeViewBuilder_ == null) { + result.dataView_ = dataView_; + } else { + result.dataView_ = gaugeViewBuilder_.build(); + } + } + if (dataViewCase_ == 5) { + if (sparkChartViewBuilder_ == null) { + result.dataView_ = dataView_; + } else { + result.dataView_ = sparkChartViewBuilder_.build(); + } + } + if (thresholdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + thresholds_ = java.util.Collections.unmodifiableList(thresholds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.thresholds_ = thresholds_; + } else { + result.thresholds_ = thresholdsBuilder_.build(); + } + result.dataViewCase_ = dataViewCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Scorecard) { + return mergeFrom((com.google.monitoring.dashboard.v1.Scorecard) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Scorecard other) { + if (other == com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance()) return this; + if (other.hasTimeSeriesQuery()) { + mergeTimeSeriesQuery(other.getTimeSeriesQuery()); + } + if (thresholdsBuilder_ == null) { + if (!other.thresholds_.isEmpty()) { + if (thresholds_.isEmpty()) { + thresholds_ = other.thresholds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureThresholdsIsMutable(); + thresholds_.addAll(other.thresholds_); + } + onChanged(); + } + } else { + if (!other.thresholds_.isEmpty()) { + if (thresholdsBuilder_.isEmpty()) { + thresholdsBuilder_.dispose(); + thresholdsBuilder_ = null; + thresholds_ = other.thresholds_; + bitField0_ = (bitField0_ & ~0x00000001); + thresholdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getThresholdsFieldBuilder() + : null; + } else { + thresholdsBuilder_.addAllMessages(other.thresholds_); + } + } + } + switch (other.getDataViewCase()) { + case GAUGE_VIEW: + { + mergeGaugeView(other.getGaugeView()); + break; + } + case SPARK_CHART_VIEW: + { + mergeSparkChartView(other.getSparkChartView()); + break; + } + case DATAVIEW_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Scorecard parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.Scorecard) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dataViewCase_ = 0; + private java.lang.Object dataView_; + + public DataViewCase getDataViewCase() { + return DataViewCase.forNumber(dataViewCase_); + } + + public Builder clearDataView() { + dataViewCase_ = 0; + dataView_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.monitoring.dashboard.v1.TimeSeriesQuery timeSeriesQuery_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesQuery, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder> + timeSeriesQueryBuilder_; + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return Whether the timeSeriesQuery field is set. + */ + public boolean hasTimeSeriesQuery() { + return timeSeriesQueryBuilder_ != null || timeSeriesQuery_ != null; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return The timeSeriesQuery. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQuery getTimeSeriesQuery() { + if (timeSeriesQueryBuilder_ == null) { + return timeSeriesQuery_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance() + : timeSeriesQuery_; + } else { + return timeSeriesQueryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder setTimeSeriesQuery(com.google.monitoring.dashboard.v1.TimeSeriesQuery value) { + if (timeSeriesQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeSeriesQuery_ = value; + onChanged(); + } else { + timeSeriesQueryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder setTimeSeriesQuery( + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder builderForValue) { + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQuery_ = builderForValue.build(); + onChanged(); + } else { + timeSeriesQueryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder mergeTimeSeriesQuery(com.google.monitoring.dashboard.v1.TimeSeriesQuery value) { + if (timeSeriesQueryBuilder_ == null) { + if (timeSeriesQuery_ != null) { + timeSeriesQuery_ = + com.google.monitoring.dashboard.v1.TimeSeriesQuery.newBuilder(timeSeriesQuery_) + .mergeFrom(value) + .buildPartial(); + } else { + timeSeriesQuery_ = value; + } + onChanged(); + } else { + timeSeriesQueryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder clearTimeSeriesQuery() { + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQuery_ = null; + onChanged(); + } else { + timeSeriesQuery_ = null; + timeSeriesQueryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder getTimeSeriesQueryBuilder() { + + onChanged(); + return getTimeSeriesQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder + getTimeSeriesQueryOrBuilder() { + if (timeSeriesQueryBuilder_ != null) { + return timeSeriesQueryBuilder_.getMessageOrBuilder(); + } else { + return timeSeriesQuery_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance() + : timeSeriesQuery_; + } + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesQuery, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder> + getTimeSeriesQueryFieldBuilder() { + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesQuery, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder>( + getTimeSeriesQuery(), getParentForChildren(), isClean()); + timeSeriesQuery_ = null; + } + return timeSeriesQueryBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard.GaugeView, + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder, + com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder> + gaugeViewBuilder_; + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + * + * @return Whether the gaugeView field is set. + */ + public boolean hasGaugeView() { + return dataViewCase_ == 4; + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + * + * @return The gaugeView. + */ + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView getGaugeView() { + if (gaugeViewBuilder_ == null) { + if (dataViewCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } else { + if (dataViewCase_ == 4) { + return gaugeViewBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public Builder setGaugeView(com.google.monitoring.dashboard.v1.Scorecard.GaugeView value) { + if (gaugeViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataView_ = value; + onChanged(); + } else { + gaugeViewBuilder_.setMessage(value); + } + dataViewCase_ = 4; + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public Builder setGaugeView( + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder builderForValue) { + if (gaugeViewBuilder_ == null) { + dataView_ = builderForValue.build(); + onChanged(); + } else { + gaugeViewBuilder_.setMessage(builderForValue.build()); + } + dataViewCase_ = 4; + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public Builder mergeGaugeView(com.google.monitoring.dashboard.v1.Scorecard.GaugeView value) { + if (gaugeViewBuilder_ == null) { + if (dataViewCase_ == 4 + && dataView_ + != com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance()) { + dataView_ = + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.newBuilder( + (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_) + .mergeFrom(value) + .buildPartial(); + } else { + dataView_ = value; + } + onChanged(); + } else { + if (dataViewCase_ == 4) { + gaugeViewBuilder_.mergeFrom(value); + } + gaugeViewBuilder_.setMessage(value); + } + dataViewCase_ = 4; + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public Builder clearGaugeView() { + if (gaugeViewBuilder_ == null) { + if (dataViewCase_ == 4) { + dataViewCase_ = 0; + dataView_ = null; + onChanged(); + } + } else { + if (dataViewCase_ == 4) { + dataViewCase_ = 0; + dataView_ = null; + } + gaugeViewBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder getGaugeViewBuilder() { + return getGaugeViewFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + public com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder getGaugeViewOrBuilder() { + if ((dataViewCase_ == 4) && (gaugeViewBuilder_ != null)) { + return gaugeViewBuilder_.getMessageOrBuilder(); + } else { + if (dataViewCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } + } + /** + * + * + *
+     * Will cause the scorecard to show a gauge chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard.GaugeView, + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder, + com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder> + getGaugeViewFieldBuilder() { + if (gaugeViewBuilder_ == null) { + if (!(dataViewCase_ == 4)) { + dataView_ = com.google.monitoring.dashboard.v1.Scorecard.GaugeView.getDefaultInstance(); + } + gaugeViewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard.GaugeView, + com.google.monitoring.dashboard.v1.Scorecard.GaugeView.Builder, + com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder>( + (com.google.monitoring.dashboard.v1.Scorecard.GaugeView) dataView_, + getParentForChildren(), + isClean()); + dataView_ = null; + } + dataViewCase_ = 4; + onChanged(); + ; + return gaugeViewBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder> + sparkChartViewBuilder_; + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + * + * @return Whether the sparkChartView field is set. + */ + public boolean hasSparkChartView() { + return dataViewCase_ == 5; + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + * + * @return The sparkChartView. + */ + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView getSparkChartView() { + if (sparkChartViewBuilder_ == null) { + if (dataViewCase_ == 5) { + return (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } else { + if (dataViewCase_ == 5) { + return sparkChartViewBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public Builder setSparkChartView( + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView value) { + if (sparkChartViewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataView_ = value; + onChanged(); + } else { + sparkChartViewBuilder_.setMessage(value); + } + dataViewCase_ = 5; + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public Builder setSparkChartView( + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder builderForValue) { + if (sparkChartViewBuilder_ == null) { + dataView_ = builderForValue.build(); + onChanged(); + } else { + sparkChartViewBuilder_.setMessage(builderForValue.build()); + } + dataViewCase_ = 5; + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public Builder mergeSparkChartView( + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView value) { + if (sparkChartViewBuilder_ == null) { + if (dataViewCase_ == 5 + && dataView_ + != com.google.monitoring.dashboard.v1.Scorecard.SparkChartView + .getDefaultInstance()) { + dataView_ = + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.newBuilder( + (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_) + .mergeFrom(value) + .buildPartial(); + } else { + dataView_ = value; + } + onChanged(); + } else { + if (dataViewCase_ == 5) { + sparkChartViewBuilder_.mergeFrom(value); + } + sparkChartViewBuilder_.setMessage(value); + } + dataViewCase_ = 5; + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public Builder clearSparkChartView() { + if (sparkChartViewBuilder_ == null) { + if (dataViewCase_ == 5) { + dataViewCase_ = 0; + dataView_ = null; + onChanged(); + } + } else { + if (dataViewCase_ == 5) { + dataViewCase_ = 0; + dataView_ = null; + } + sparkChartViewBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder + getSparkChartViewBuilder() { + return getSparkChartViewFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + public com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder + getSparkChartViewOrBuilder() { + if ((dataViewCase_ == 5) && (sparkChartViewBuilder_ != null)) { + return sparkChartViewBuilder_.getMessageOrBuilder(); + } else { + if (dataViewCase_ == 5) { + return (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_; + } + return com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } + } + /** + * + * + *
+     * Will cause the scorecard to show a spark chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder> + getSparkChartViewFieldBuilder() { + if (sparkChartViewBuilder_ == null) { + if (!(dataViewCase_ == 5)) { + dataView_ = + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.getDefaultInstance(); + } + sparkChartViewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView.Builder, + com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder>( + (com.google.monitoring.dashboard.v1.Scorecard.SparkChartView) dataView_, + getParentForChildren(), + isClean()); + dataView_ = null; + } + dataViewCase_ = 5; + onChanged(); + ; + return sparkChartViewBuilder_; + } + + private java.util.List thresholds_ = + java.util.Collections.emptyList(); + + private void ensureThresholdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + thresholds_ = + new java.util.ArrayList(thresholds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Threshold, + com.google.monitoring.dashboard.v1.Threshold.Builder, + com.google.monitoring.dashboard.v1.ThresholdOrBuilder> + thresholdsBuilder_; + + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public java.util.List getThresholdsList() { + if (thresholdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(thresholds_); + } else { + return thresholdsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public int getThresholdsCount() { + if (thresholdsBuilder_ == null) { + return thresholds_.size(); + } else { + return thresholdsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.Threshold getThresholds(int index) { + if (thresholdsBuilder_ == null) { + return thresholds_.get(index); + } else { + return thresholdsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder setThresholds(int index, com.google.monitoring.dashboard.v1.Threshold value) { + if (thresholdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureThresholdsIsMutable(); + thresholds_.set(index, value); + onChanged(); + } else { + thresholdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder setThresholds( + int index, com.google.monitoring.dashboard.v1.Threshold.Builder builderForValue) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.set(index, builderForValue.build()); + onChanged(); + } else { + thresholdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder addThresholds(com.google.monitoring.dashboard.v1.Threshold value) { + if (thresholdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureThresholdsIsMutable(); + thresholds_.add(value); + onChanged(); + } else { + thresholdsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder addThresholds(int index, com.google.monitoring.dashboard.v1.Threshold value) { + if (thresholdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureThresholdsIsMutable(); + thresholds_.add(index, value); + onChanged(); + } else { + thresholdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder addThresholds( + com.google.monitoring.dashboard.v1.Threshold.Builder builderForValue) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.add(builderForValue.build()); + onChanged(); + } else { + thresholdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder addThresholds( + int index, com.google.monitoring.dashboard.v1.Threshold.Builder builderForValue) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.add(index, builderForValue.build()); + onChanged(); + } else { + thresholdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder addAllThresholds( + java.lang.Iterable values) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, thresholds_); + onChanged(); + } else { + thresholdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder clearThresholds() { + if (thresholdsBuilder_ == null) { + thresholds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + thresholdsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public Builder removeThresholds(int index) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.remove(index); + onChanged(); + } else { + thresholdsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.Threshold.Builder getThresholdsBuilder(int index) { + return getThresholdsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.ThresholdOrBuilder getThresholdsOrBuilder(int index) { + if (thresholdsBuilder_ == null) { + return thresholds_.get(index); + } else { + return thresholdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public java.util.List + getThresholdsOrBuilderList() { + if (thresholdsBuilder_ != null) { + return thresholdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(thresholds_); + } + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.Threshold.Builder addThresholdsBuilder() { + return getThresholdsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.Threshold.getDefaultInstance()); + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public com.google.monitoring.dashboard.v1.Threshold.Builder addThresholdsBuilder(int index) { + return getThresholdsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.Threshold.getDefaultInstance()); + } + /** + * + * + *
+     * The thresholds used to determine the state of the scorecard given the
+     * time series' current value. For an actual value x, the scorecard is in a
+     * danger state if x is less than or equal to a danger threshold that triggers
+     * below, or greater than or equal to a danger threshold that triggers above.
+     * Similarly, if x is above/below a warning threshold that triggers
+     * above/below, then the scorecard is in a warning state - unless x also puts
+     * it in a danger state. (Danger trumps warning.)
+     * As an example, consider a scorecard with the following four thresholds:
+     * {
+     *   value: 90,
+     *   category: 'DANGER',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 70,
+     *   category: 'WARNING',
+     *   trigger: 'ABOVE',
+     * },
+     * {
+     *   value: 10,
+     *   category: 'DANGER',
+     *   trigger: 'BELOW',
+     * },
+     * {
+     *   value: 20,
+     *   category: 'WARNING',
+     *   trigger: 'BELOW',
+     * }
+     * Then: values less than or equal to 10 would put the scorecard in a DANGER
+     * state, values greater than 10 but less than or equal to 20 a WARNING state,
+     * values strictly between 20 and 70 an OK state, values greater than or equal
+     * to 70 but less than 90 a WARNING state, and values greater than or equal to
+     * 90 a DANGER state.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + public java.util.List + getThresholdsBuilderList() { + return getThresholdsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Threshold, + com.google.monitoring.dashboard.v1.Threshold.Builder, + com.google.monitoring.dashboard.v1.ThresholdOrBuilder> + getThresholdsFieldBuilder() { + if (thresholdsBuilder_ == null) { + thresholdsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Threshold, + com.google.monitoring.dashboard.v1.Threshold.Builder, + com.google.monitoring.dashboard.v1.ThresholdOrBuilder>( + thresholds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + thresholds_ = null; + } + return thresholdsBuilder_; + } + + @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.monitoring.dashboard.v1.Scorecard) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Scorecard) + private static final com.google.monitoring.dashboard.v1.Scorecard DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Scorecard(); + } + + public static com.google.monitoring.dashboard.v1.Scorecard getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Scorecard parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Scorecard(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Scorecard getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardOrBuilder.java new file mode 100644 index 00000000..8361c22e --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardOrBuilder.java @@ -0,0 +1,347 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/scorecard.proto + +package com.google.monitoring.dashboard.v1; + +public interface ScorecardOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Scorecard) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Fields for querying time series data from the
+   * Stackdriver metrics API.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return Whether the timeSeriesQuery field is set. + */ + boolean hasTimeSeriesQuery(); + /** + * + * + *
+   * Fields for querying time series data from the
+   * Stackdriver metrics API.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return The timeSeriesQuery. + */ + com.google.monitoring.dashboard.v1.TimeSeriesQuery getTimeSeriesQuery(); + /** + * + * + *
+   * Fields for querying time series data from the
+   * Stackdriver metrics API.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder getTimeSeriesQueryOrBuilder(); + + /** + * + * + *
+   * Will cause the scorecard to show a gauge chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + * + * @return Whether the gaugeView field is set. + */ + boolean hasGaugeView(); + /** + * + * + *
+   * Will cause the scorecard to show a gauge chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + * + * @return The gaugeView. + */ + com.google.monitoring.dashboard.v1.Scorecard.GaugeView getGaugeView(); + /** + * + * + *
+   * Will cause the scorecard to show a gauge chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.GaugeView gauge_view = 4; + */ + com.google.monitoring.dashboard.v1.Scorecard.GaugeViewOrBuilder getGaugeViewOrBuilder(); + + /** + * + * + *
+   * Will cause the scorecard to show a spark chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + * + * @return Whether the sparkChartView field is set. + */ + boolean hasSparkChartView(); + /** + * + * + *
+   * Will cause the scorecard to show a spark chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + * + * @return The sparkChartView. + */ + com.google.monitoring.dashboard.v1.Scorecard.SparkChartView getSparkChartView(); + /** + * + * + *
+   * Will cause the scorecard to show a spark chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard.SparkChartView spark_chart_view = 5; + */ + com.google.monitoring.dashboard.v1.Scorecard.SparkChartViewOrBuilder getSparkChartViewOrBuilder(); + + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + java.util.List getThresholdsList(); + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + com.google.monitoring.dashboard.v1.Threshold getThresholds(int index); + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + int getThresholdsCount(); + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + java.util.List + getThresholdsOrBuilderList(); + /** + * + * + *
+   * The thresholds used to determine the state of the scorecard given the
+   * time series' current value. For an actual value x, the scorecard is in a
+   * danger state if x is less than or equal to a danger threshold that triggers
+   * below, or greater than or equal to a danger threshold that triggers above.
+   * Similarly, if x is above/below a warning threshold that triggers
+   * above/below, then the scorecard is in a warning state - unless x also puts
+   * it in a danger state. (Danger trumps warning.)
+   * As an example, consider a scorecard with the following four thresholds:
+   * {
+   *   value: 90,
+   *   category: 'DANGER',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 70,
+   *   category: 'WARNING',
+   *   trigger: 'ABOVE',
+   * },
+   * {
+   *   value: 10,
+   *   category: 'DANGER',
+   *   trigger: 'BELOW',
+   * },
+   * {
+   *   value: 20,
+   *   category: 'WARNING',
+   *   trigger: 'BELOW',
+   * }
+   * Then: values less than or equal to 10 would put the scorecard in a DANGER
+   * state, values greater than 10 but less than or equal to 20 a WARNING state,
+   * values strictly between 20 and 70 an OK state, values greater than or equal
+   * to 70 but less than 90 a WARNING state, and values greater than or equal to
+   * 90 a DANGER state.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 6; + */ + com.google.monitoring.dashboard.v1.ThresholdOrBuilder getThresholdsOrBuilder(int index); + + public com.google.monitoring.dashboard.v1.Scorecard.DataViewCase getDataViewCase(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardProto.java new file mode 100644 index 00000000..ca0d5ac3 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardProto.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/scorecard.proto + +package com.google.monitoring.dashboard.v1; + +public final class ScorecardProto { + private ScorecardProto() {} + + 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_monitoring_dashboard_v1_Scorecard_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Scorecard_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/monitoring/dashboard/v1/scoreca" + + "rd.proto\022\036google.monitoring.dashboard.v1" + + "\032,google/monitoring/dashboard/v1/metrics" + + ".proto\032\036google/protobuf/duration.proto\"\221" + + "\004\n\tScorecard\022J\n\021time_series_query\030\001 \001(\0132" + + "/.google.monitoring.dashboard.v1.TimeSer" + + "iesQuery\022I\n\ngauge_view\030\004 \001(\01323.google.mo" + + "nitoring.dashboard.v1.Scorecard.GaugeVie" + + "wH\000\022T\n\020spark_chart_view\030\005 \001(\01328.google.m" + + "onitoring.dashboard.v1.Scorecard.SparkCh" + + "artViewH\000\022=\n\nthresholds\030\006 \003(\0132).google.m" + + "onitoring.dashboard.v1.Threshold\0325\n\tGaug" + + "eView\022\023\n\013lower_bound\030\001 \001(\001\022\023\n\013upper_boun" + + "d\030\002 \001(\001\032\223\001\n\016SparkChartView\022H\n\020spark_char" + + "t_type\030\001 \001(\0162..google.monitoring.dashboa" + + "rd.v1.SparkChartType\0227\n\024min_alignment_pe" + + "riod\030\002 \001(\0132\031.google.protobuf.DurationB\013\n" + + "\tdata_viewB\177\n\"com.google.monitoring.dash" + + "board.v1B\016ScorecardProtoP\001ZGgoogle.golan" + + "g.org/genproto/googleapis/monitoring/das" + + "hboard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.monitoring.dashboard.v1.MetricsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_Scorecard_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor, + new java.lang.String[] { + "TimeSeriesQuery", "GaugeView", "SparkChartView", "Thresholds", "DataView", + }); + internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_descriptor = + internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Scorecard_GaugeView_descriptor, + new java.lang.String[] { + "LowerBound", "UpperBound", + }); + internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_descriptor = + internal_static_google_monitoring_dashboard_v1_Scorecard_descriptor.getNestedTypes().get(1); + internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Scorecard_SparkChartView_descriptor, + new java.lang.String[] { + "SparkChartType", "MinAlignmentPeriod", + }); + com.google.monitoring.dashboard.v1.MetricsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java new file mode 100644 index 00000000..2562197b --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/service.proto + +package com.google.monitoring.dashboard.v1; + +public final class ServiceMonitoringProto { + private ServiceMonitoringProto() {} + + 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 = { + "\n,google/monitoring/dashboard/v1/service" + + ".proto\022\036google.monitoring.dashboard.v1B\207" + + "\001\n\"com.google.monitoring.dashboard.v1B\026S" + + "erviceMonitoringProtoP\001ZGgoogle.golang.o" + + "rg/genproto/googleapis/monitoring/dashbo" + + "ard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/SparkChartType.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/SparkChartType.java new file mode 100644 index 00000000..88e16b81 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/SparkChartType.java @@ -0,0 +1,172 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * Defines the possible types of spark chart supported by the `Scorecard`.
+ * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.SparkChartType} + */ +public enum SparkChartType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not allowed in well-formed requests.
+   * 
+ * + * SPARK_CHART_TYPE_UNSPECIFIED = 0; + */ + SPARK_CHART_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * The sparkline will be rendered as a small line chart.
+   * 
+ * + * SPARK_LINE = 1; + */ + SPARK_LINE(1), + /** + * + * + *
+   * The sparkbar will be rendered as a small bar chart.
+   * 
+ * + * SPARK_BAR = 2; + */ + SPARK_BAR(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not allowed in well-formed requests.
+   * 
+ * + * SPARK_CHART_TYPE_UNSPECIFIED = 0; + */ + public static final int SPARK_CHART_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The sparkline will be rendered as a small line chart.
+   * 
+ * + * SPARK_LINE = 1; + */ + public static final int SPARK_LINE_VALUE = 1; + /** + * + * + *
+   * The sparkbar will be rendered as a small bar chart.
+   * 
+ * + * SPARK_BAR = 2; + */ + public static final int SPARK_BAR_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 SparkChartType 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 SparkChartType forNumber(int value) { + switch (value) { + case 0: + return SPARK_CHART_TYPE_UNSPECIFIED; + case 1: + return SPARK_LINE; + case 2: + return SPARK_BAR; + 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 SparkChartType findValueByNumber(int number) { + return SparkChartType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SparkChartType[] VALUES = values(); + + public static SparkChartType 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 SparkChartType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.SparkChartType) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilter.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilter.java new file mode 100644 index 00000000..63bc26cb --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilter.java @@ -0,0 +1,879 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A filter that ranks streams based on their statistical relation to other
+ * streams in a request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} + */ +public final class StatisticalTimeSeriesFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + StatisticalTimeSeriesFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use StatisticalTimeSeriesFilter.newBuilder() to construct. + private StatisticalTimeSeriesFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StatisticalTimeSeriesFilter() { + rankingMethod_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StatisticalTimeSeriesFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StatisticalTimeSeriesFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + rankingMethod_ = rawValue; + break; + } + case 16: + { + numTimeSeries_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.class, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder.class); + } + + /** + * + * + *
+   * The filter methods that can be applied to a stream.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method} + */ + public enum Method implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + METHOD_UNSPECIFIED(0), + /** + * + * + *
+     * Compute the outlier score of each stream.
+     * 
+ * + * METHOD_CLUSTER_OUTLIER = 1; + */ + METHOD_CLUSTER_OUTLIER(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * METHOD_UNSPECIFIED = 0; + */ + public static final int METHOD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Compute the outlier score of each stream.
+     * 
+ * + * METHOD_CLUSTER_OUTLIER = 1; + */ + public static final int METHOD_CLUSTER_OUTLIER_VALUE = 1; + + 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 Method 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 Method forNumber(int value) { + switch (value) { + case 0: + return METHOD_UNSPECIFIED; + case 1: + return METHOD_CLUSTER_OUTLIER; + 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 Method findValueByNumber(int number) { + return Method.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Method[] VALUES = values(); + + public static Method 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 Method(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method) + } + + public static final int RANKING_METHOD_FIELD_NUMBER = 1; + private int rankingMethod_; + /** + * + * + *
+   * `rankingMethod` is applied to a set of time series, and then the produced
+   * value for each individual time series is used to compare a given time
+   * series to others.
+   * These are methods that cannot be applied stream-by-stream, but rather
+   * require the full context of a request to evaluate time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return The enum numeric value on the wire for rankingMethod. + */ + public int getRankingMethodValue() { + return rankingMethod_; + } + /** + * + * + *
+   * `rankingMethod` is applied to a set of time series, and then the produced
+   * value for each individual time series is used to compare a given time
+   * series to others.
+   * These are methods that cannot be applied stream-by-stream, but rather
+   * require the full context of a request to evaluate time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return The rankingMethod. + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method getRankingMethod() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method result = + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method.valueOf( + rankingMethod_); + return result == null + ? com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method.UNRECOGNIZED + : result; + } + + public static final int NUM_TIME_SERIES_FIELD_NUMBER = 2; + private int numTimeSeries_; + /** + * + * + *
+   * How many time series to output.
+   * 
+ * + * int32 num_time_series = 2; + * + * @return The numTimeSeries. + */ + public int getNumTimeSeries() { + return numTimeSeries_; + } + + 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 (rankingMethod_ + != com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method.METHOD_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, rankingMethod_); + } + if (numTimeSeries_ != 0) { + output.writeInt32(2, numTimeSeries_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rankingMethod_ + != com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method.METHOD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, rankingMethod_); + } + if (numTimeSeries_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numTimeSeries_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter other = + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) obj; + + if (rankingMethod_ != other.rankingMethod_) return false; + if (getNumTimeSeries() != other.getNumTimeSeries()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RANKING_METHOD_FIELD_NUMBER; + hash = (53 * hash) + rankingMethod_; + hash = (37 * hash) + NUM_TIME_SERIES_FIELD_NUMBER; + hash = (53 * hash) + getNumTimeSeries(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter 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.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter 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.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter 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.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter 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.monitoring.dashboard.v1.StatisticalTimeSeriesFilter 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; + } + /** + * + * + *
+   * A filter that ranks streams based on their statistical relation to other
+   * streams in a request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.class, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + rankingMethod_ = 0; + + numTimeSeries_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.CommonProto + .internal_static_google_monitoring_dashboard_v1_StatisticalTimeSeriesFilter_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter build() { + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter buildPartial() { + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter result = + new com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter(this); + result.rankingMethod_ = rankingMethod_; + result.numTimeSeries_ = numTimeSeries_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) { + return mergeFrom((com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter other) { + if (other + == com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance()) + return this; + if (other.rankingMethod_ != 0) { + setRankingMethodValue(other.getRankingMethodValue()); + } + if (other.getNumTimeSeries() != 0) { + setNumTimeSeries(other.getNumTimeSeries()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int rankingMethod_ = 0; + /** + * + * + *
+     * `rankingMethod` is applied to a set of time series, and then the produced
+     * value for each individual time series is used to compare a given time
+     * series to others.
+     * These are methods that cannot be applied stream-by-stream, but rather
+     * require the full context of a request to evaluate time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return The enum numeric value on the wire for rankingMethod. + */ + public int getRankingMethodValue() { + return rankingMethod_; + } + /** + * + * + *
+     * `rankingMethod` is applied to a set of time series, and then the produced
+     * value for each individual time series is used to compare a given time
+     * series to others.
+     * These are methods that cannot be applied stream-by-stream, but rather
+     * require the full context of a request to evaluate time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @param value The enum numeric value on the wire for rankingMethod to set. + * @return This builder for chaining. + */ + public Builder setRankingMethodValue(int value) { + rankingMethod_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * `rankingMethod` is applied to a set of time series, and then the produced
+     * value for each individual time series is used to compare a given time
+     * series to others.
+     * These are methods that cannot be applied stream-by-stream, but rather
+     * require the full context of a request to evaluate time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return The rankingMethod. + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method + getRankingMethod() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method result = + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method.valueOf( + rankingMethod_); + return result == null + ? com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * `rankingMethod` is applied to a set of time series, and then the produced
+     * value for each individual time series is used to compare a given time
+     * series to others.
+     * These are methods that cannot be applied stream-by-stream, but rather
+     * require the full context of a request to evaluate time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @param value The rankingMethod to set. + * @return This builder for chaining. + */ + public Builder setRankingMethod( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method value) { + if (value == null) { + throw new NullPointerException(); + } + + rankingMethod_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * `rankingMethod` is applied to a set of time series, and then the produced
+     * value for each individual time series is used to compare a given time
+     * series to others.
+     * These are methods that cannot be applied stream-by-stream, but rather
+     * require the full context of a request to evaluate time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearRankingMethod() { + + rankingMethod_ = 0; + onChanged(); + return this; + } + + private int numTimeSeries_; + /** + * + * + *
+     * How many time series to output.
+     * 
+ * + * int32 num_time_series = 2; + * + * @return The numTimeSeries. + */ + public int getNumTimeSeries() { + return numTimeSeries_; + } + /** + * + * + *
+     * How many time series to output.
+     * 
+ * + * int32 num_time_series = 2; + * + * @param value The numTimeSeries to set. + * @return This builder for chaining. + */ + public Builder setNumTimeSeries(int value) { + + numTimeSeries_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How many time series to output.
+     * 
+ * + * int32 num_time_series = 2; + * + * @return This builder for chaining. + */ + public Builder clearNumTimeSeries() { + + numTimeSeries_ = 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.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + private static final com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter(); + } + + public static com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StatisticalTimeSeriesFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StatisticalTimeSeriesFilter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilterOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilterOrBuilder.java new file mode 100644 index 00000000..faf9e16b --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilterOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/common.proto + +package com.google.monitoring.dashboard.v1; + +public interface StatisticalTimeSeriesFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * `rankingMethod` is applied to a set of time series, and then the produced
+   * value for each individual time series is used to compare a given time
+   * series to others.
+   * These are methods that cannot be applied stream-by-stream, but rather
+   * require the full context of a request to evaluate time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return The enum numeric value on the wire for rankingMethod. + */ + int getRankingMethodValue(); + /** + * + * + *
+   * `rankingMethod` is applied to a set of time series, and then the produced
+   * value for each individual time series is used to compare a given time
+   * series to others.
+   * These are methods that cannot be applied stream-by-stream, but rather
+   * require the full context of a request to evaluate time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method ranking_method = 1; + * + * + * @return The rankingMethod. + */ + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method getRankingMethod(); + + /** + * + * + *
+   * How many time series to output.
+   * 
+ * + * int32 num_time_series = 2; + * + * @return The numTimeSeries. + */ + int getNumTimeSeries(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Text.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Text.java new file mode 100644 index 00000000..1ca42a55 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Text.java @@ -0,0 +1,929 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/text.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A widget that displays textual content.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Text} + */ +public final class Text extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Text) + TextOrBuilder { + private static final long serialVersionUID = 0L; + // Use Text.newBuilder() to construct. + private Text(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Text() { + content_ = ""; + format_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Text(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Text( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + format_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.TextProto + .internal_static_google_monitoring_dashboard_v1_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.TextProto + .internal_static_google_monitoring_dashboard_v1_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Text.class, + com.google.monitoring.dashboard.v1.Text.Builder.class); + } + + /** + * + * + *
+   * The format type of the text content.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.Text.Format} + */ + public enum Format implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Format is unspecified. Defaults to MARKDOWN.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + FORMAT_UNSPECIFIED(0), + /** + * + * + *
+     * The text contains Markdown formatting.
+     * 
+ * + * MARKDOWN = 1; + */ + MARKDOWN(1), + /** + * + * + *
+     * The text contains no special formatting.
+     * 
+ * + * RAW = 2; + */ + RAW(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Format is unspecified. Defaults to MARKDOWN.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + public static final int FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The text contains Markdown formatting.
+     * 
+ * + * MARKDOWN = 1; + */ + public static final int MARKDOWN_VALUE = 1; + /** + * + * + *
+     * The text contains no special formatting.
+     * 
+ * + * RAW = 2; + */ + public static final int RAW_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 Format 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 Format forNumber(int value) { + switch (value) { + case 0: + return FORMAT_UNSPECIFIED; + case 1: + return MARKDOWN; + case 2: + return RAW; + 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 Format findValueByNumber(int number) { + return Format.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.Text.getDescriptor().getEnumTypes().get(0); + } + + private static final Format[] VALUES = values(); + + public static Format 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 Format(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.Text.Format) + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + /** + * + * + *
+   * The text content to be displayed.
+   * 
+ * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + * + * + *
+   * The text content to be displayed.
+   * 
+ * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 2; + private int format_; + /** + * + * + *
+   * How the text content is formatted.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return The enum numeric value on the wire for format. + */ + public int getFormatValue() { + return format_; + } + /** + * + * + *
+   * How the text content is formatted.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return The format. + */ + public com.google.monitoring.dashboard.v1.Text.Format getFormat() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Text.Format result = + com.google.monitoring.dashboard.v1.Text.Format.valueOf(format_); + return result == null ? com.google.monitoring.dashboard.v1.Text.Format.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 (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (format_ != com.google.monitoring.dashboard.v1.Text.Format.FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, format_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (format_ != com.google.monitoring.dashboard.v1.Text.Format.FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, format_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Text)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Text other = (com.google.monitoring.dashboard.v1.Text) obj; + + if (!getContent().equals(other.getContent())) return false; + if (format_ != other.format_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Text parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Text parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Text parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Text 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.monitoring.dashboard.v1.Text parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Text parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Text parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Text 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.monitoring.dashboard.v1.Text parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Text 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.monitoring.dashboard.v1.Text parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Text 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.monitoring.dashboard.v1.Text 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; + } + /** + * + * + *
+   * A widget that displays textual content.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Text} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Text) + com.google.monitoring.dashboard.v1.TextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.TextProto + .internal_static_google_monitoring_dashboard_v1_Text_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.TextProto + .internal_static_google_monitoring_dashboard_v1_Text_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Text.class, + com.google.monitoring.dashboard.v1.Text.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Text.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + format_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.TextProto + .internal_static_google_monitoring_dashboard_v1_Text_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Text getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Text build() { + com.google.monitoring.dashboard.v1.Text result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Text buildPartial() { + com.google.monitoring.dashboard.v1.Text result = + new com.google.monitoring.dashboard.v1.Text(this); + result.content_ = content_; + result.format_ = format_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Text) { + return mergeFrom((com.google.monitoring.dashboard.v1.Text) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Text other) { + if (other == com.google.monitoring.dashboard.v1.Text.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Text parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.Text) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + /** + * + * + *
+     * The text content to be displayed.
+     * 
+ * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The text content to be displayed.
+     * 
+ * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The text content to be displayed.
+     * 
+ * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The text content to be displayed.
+     * 
+ * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The text content to be displayed.
+     * 
+ * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int format_ = 0; + /** + * + * + *
+     * How the text content is formatted.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return The enum numeric value on the wire for format. + */ + public int getFormatValue() { + return format_; + } + /** + * + * + *
+     * How the text content is formatted.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @param value The enum numeric value on the wire for format to set. + * @return This builder for chaining. + */ + public Builder setFormatValue(int value) { + format_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * How the text content is formatted.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return The format. + */ + public com.google.monitoring.dashboard.v1.Text.Format getFormat() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Text.Format result = + com.google.monitoring.dashboard.v1.Text.Format.valueOf(format_); + return result == null ? com.google.monitoring.dashboard.v1.Text.Format.UNRECOGNIZED : result; + } + /** + * + * + *
+     * How the text content is formatted.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(com.google.monitoring.dashboard.v1.Text.Format value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * How the text content is formatted.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + + format_ = 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.monitoring.dashboard.v1.Text) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Text) + private static final com.google.monitoring.dashboard.v1.Text DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Text(); + } + + public static com.google.monitoring.dashboard.v1.Text getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Text parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Text(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Text getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextOrBuilder.java new file mode 100644 index 00000000..cae6dc0c --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/text.proto + +package com.google.monitoring.dashboard.v1; + +public interface TextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Text) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The text content to be displayed.
+   * 
+ * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + /** + * + * + *
+   * The text content to be displayed.
+   * 
+ * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
+   * How the text content is formatted.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return The enum numeric value on the wire for format. + */ + int getFormatValue(); + /** + * + * + *
+   * How the text content is formatted.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text.Format format = 2; + * + * @return The format. + */ + com.google.monitoring.dashboard.v1.Text.Format getFormat(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextProto.java new file mode 100644 index 00000000..ec7ee917 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextProto.java @@ -0,0 +1,67 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/text.proto + +package com.google.monitoring.dashboard.v1; + +public final class TextProto { + private TextProto() {} + + 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_monitoring_dashboard_v1_Text_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Text_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/monitoring/dashboard/v1/text.pr" + + "oto\022\036google.monitoring.dashboard.v1\"\215\001\n\004" + + "Text\022\017\n\007content\030\001 \001(\t\022;\n\006format\030\002 \001(\0162+." + + "google.monitoring.dashboard.v1.Text.Form" + + "at\"7\n\006Format\022\026\n\022FORMAT_UNSPECIFIED\020\000\022\014\n\010" + + "MARKDOWN\020\001\022\007\n\003RAW\020\002Bz\n\"com.google.monito" + + "ring.dashboard.v1B\tTextProtoP\001ZGgoogle.g" + + "olang.org/genproto/googleapis/monitoring" + + "/dashboard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_monitoring_dashboard_v1_Text_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_Text_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Text_descriptor, + new java.lang.String[] { + "Content", "Format", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Threshold.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Threshold.java new file mode 100644 index 00000000..b4a2be20 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Threshold.java @@ -0,0 +1,1351 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * Defines a threshold for categorizing time series values.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Threshold} + */ +public final class Threshold extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Threshold) + ThresholdOrBuilder { + private static final long serialVersionUID = 0L; + // Use Threshold.newBuilder() to construct. + private Threshold(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Threshold() { + label_ = ""; + color_ = 0; + direction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Threshold(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Threshold( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 17: + { + value_ = input.readDouble(); + break; + } + case 24: + { + int rawValue = input.readEnum(); + + color_ = rawValue; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + direction_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_Threshold_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_Threshold_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Threshold.class, + com.google.monitoring.dashboard.v1.Threshold.Builder.class); + } + + /** + * + * + *
+   * The color suggests an interpretation to the viewer when actual values cross
+   * the threshold. Comments on each color provide UX guidance on how users can
+   * be expected to interpret a given state color.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.Threshold.Color} + */ + public enum Color implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Color is unspecified. Not allowed in well-formed requests.
+     * 
+ * + * COLOR_UNSPECIFIED = 0; + */ + COLOR_UNSPECIFIED(0), + /** + * + * + *
+     * Crossing the threshold is "concerning" behavior.
+     * 
+ * + * YELLOW = 4; + */ + YELLOW(4), + /** + * + * + *
+     * Crossing the threshold is "emergency" behavior.
+     * 
+ * + * RED = 6; + */ + RED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Color is unspecified. Not allowed in well-formed requests.
+     * 
+ * + * COLOR_UNSPECIFIED = 0; + */ + public static final int COLOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Crossing the threshold is "concerning" behavior.
+     * 
+ * + * YELLOW = 4; + */ + public static final int YELLOW_VALUE = 4; + /** + * + * + *
+     * Crossing the threshold is "emergency" behavior.
+     * 
+ * + * RED = 6; + */ + public static final int RED_VALUE = 6; + + 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 Color 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 Color forNumber(int value) { + switch (value) { + case 0: + return COLOR_UNSPECIFIED; + case 4: + return YELLOW; + case 6: + return RED; + 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 Color findValueByNumber(int number) { + return Color.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.Threshold.getDescriptor().getEnumTypes().get(0); + } + + private static final Color[] VALUES = values(); + + public static Color 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 Color(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.Threshold.Color) + } + + /** + * + * + *
+   * Whether the threshold is considered crossed by an actual value above or
+   * below its threshold value.
+   * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.Threshold.Direction} + */ + public enum Direction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + DIRECTION_UNSPECIFIED(0), + /** + * + * + *
+     * The threshold will be considered crossed if the actual value is above
+     * the threshold value.
+     * 
+ * + * ABOVE = 1; + */ + ABOVE(1), + /** + * + * + *
+     * The threshold will be considered crossed if the actual value is below
+     * the threshold value.
+     * 
+ * + * BELOW = 2; + */ + BELOW(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not allowed in well-formed requests.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + public static final int DIRECTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The threshold will be considered crossed if the actual value is above
+     * the threshold value.
+     * 
+ * + * ABOVE = 1; + */ + public static final int ABOVE_VALUE = 1; + /** + * + * + *
+     * The threshold will be considered crossed if the actual value is below
+     * the threshold value.
+     * 
+ * + * BELOW = 2; + */ + public static final int BELOW_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 Direction 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 Direction forNumber(int value) { + switch (value) { + case 0: + return DIRECTION_UNSPECIFIED; + case 1: + return ABOVE; + case 2: + return BELOW; + 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 Direction findValueByNumber(int number) { + return Direction.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.Threshold.getDescriptor().getEnumTypes().get(1); + } + + private static final Direction[] VALUES = values(); + + public static Direction 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 Direction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.Threshold.Direction) + } + + public static final int LABEL_FIELD_NUMBER = 1; + private volatile java.lang.Object label_; + /** + * + * + *
+   * A label for the threshold.
+   * 
+ * + * string label = 1; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + * + * + *
+   * A label for the threshold.
+   * 
+ * + * string label = 1; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private double value_; + /** + * + * + *
+   * The value of the threshold. The value should be defined in the native scale
+   * of the metric.
+   * 
+ * + * double value = 2; + * + * @return The value. + */ + public double getValue() { + return value_; + } + + public static final int COLOR_FIELD_NUMBER = 3; + private int color_; + /** + * + * + *
+   * The state color for this threshold. Color is not allowed in a XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return The enum numeric value on the wire for color. + */ + public int getColorValue() { + return color_; + } + /** + * + * + *
+   * The state color for this threshold. Color is not allowed in a XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return The color. + */ + public com.google.monitoring.dashboard.v1.Threshold.Color getColor() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Threshold.Color result = + com.google.monitoring.dashboard.v1.Threshold.Color.valueOf(color_); + return result == null + ? com.google.monitoring.dashboard.v1.Threshold.Color.UNRECOGNIZED + : result; + } + + public static final int DIRECTION_FIELD_NUMBER = 4; + private int direction_; + /** + * + * + *
+   * The direction for the current threshold. Direction is not allowed in a
+   * XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return The enum numeric value on the wire for direction. + */ + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+   * The direction for the current threshold. Direction is not allowed in a
+   * XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return The direction. + */ + public com.google.monitoring.dashboard.v1.Threshold.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Threshold.Direction result = + com.google.monitoring.dashboard.v1.Threshold.Direction.valueOf(direction_); + return result == null + ? com.google.monitoring.dashboard.v1.Threshold.Direction.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 (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, label_); + } + if (value_ != 0D) { + output.writeDouble(2, value_); + } + if (color_ + != com.google.monitoring.dashboard.v1.Threshold.Color.COLOR_UNSPECIFIED.getNumber()) { + output.writeEnum(3, color_); + } + if (direction_ + != com.google.monitoring.dashboard.v1.Threshold.Direction.DIRECTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, direction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, label_); + } + if (value_ != 0D) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, value_); + } + if (color_ + != com.google.monitoring.dashboard.v1.Threshold.Color.COLOR_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, color_); + } + if (direction_ + != com.google.monitoring.dashboard.v1.Threshold.Direction.DIRECTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, direction_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Threshold)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Threshold other = + (com.google.monitoring.dashboard.v1.Threshold) obj; + + if (!getLabel().equals(other.getLabel())) return false; + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits(other.getValue())) return false; + if (color_ != other.color_) return false; + if (direction_ != other.direction_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getValue())); + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + color_; + hash = (37 * hash) + DIRECTION_FIELD_NUMBER; + hash = (53 * hash) + direction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Threshold parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Threshold parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Threshold parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Threshold 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.monitoring.dashboard.v1.Threshold parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Threshold parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Threshold parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Threshold 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.monitoring.dashboard.v1.Threshold parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Threshold 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.monitoring.dashboard.v1.Threshold parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Threshold 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.monitoring.dashboard.v1.Threshold 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; + } + /** + * + * + *
+   * Defines a threshold for categorizing time series values.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Threshold} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Threshold) + com.google.monitoring.dashboard.v1.ThresholdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_Threshold_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_Threshold_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Threshold.class, + com.google.monitoring.dashboard.v1.Threshold.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Threshold.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + label_ = ""; + + value_ = 0D; + + color_ = 0; + + direction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_Threshold_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Threshold getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Threshold.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Threshold build() { + com.google.monitoring.dashboard.v1.Threshold result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Threshold buildPartial() { + com.google.monitoring.dashboard.v1.Threshold result = + new com.google.monitoring.dashboard.v1.Threshold(this); + result.label_ = label_; + result.value_ = value_; + result.color_ = color_; + result.direction_ = direction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Threshold) { + return mergeFrom((com.google.monitoring.dashboard.v1.Threshold) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Threshold other) { + if (other == com.google.monitoring.dashboard.v1.Threshold.getDefaultInstance()) return this; + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (other.color_ != 0) { + setColorValue(other.getColorValue()); + } + if (other.direction_ != 0) { + setDirectionValue(other.getDirectionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Threshold parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.Threshold) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+     * A label for the threshold.
+     * 
+ * + * string label = 1; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A label for the threshold.
+     * 
+ * + * string label = 1; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A label for the threshold.
+     * 
+ * + * string label = 1; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A label for the threshold.
+     * 
+ * + * string label = 1; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + * + * + *
+     * A label for the threshold.
+     * 
+ * + * string label = 1; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private double value_; + /** + * + * + *
+     * The value of the threshold. The value should be defined in the native scale
+     * of the metric.
+     * 
+ * + * double value = 2; + * + * @return The value. + */ + public double getValue() { + return value_; + } + /** + * + * + *
+     * The value of the threshold. The value should be defined in the native scale
+     * of the metric.
+     * 
+ * + * double value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the threshold. The value should be defined in the native scale
+     * of the metric.
+     * 
+ * + * double value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = 0D; + onChanged(); + return this; + } + + private int color_ = 0; + /** + * + * + *
+     * The state color for this threshold. Color is not allowed in a XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return The enum numeric value on the wire for color. + */ + public int getColorValue() { + return color_; + } + /** + * + * + *
+     * The state color for this threshold. Color is not allowed in a XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @param value The enum numeric value on the wire for color to set. + * @return This builder for chaining. + */ + public Builder setColorValue(int value) { + color_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state color for this threshold. Color is not allowed in a XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return The color. + */ + public com.google.monitoring.dashboard.v1.Threshold.Color getColor() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Threshold.Color result = + com.google.monitoring.dashboard.v1.Threshold.Color.valueOf(color_); + return result == null + ? com.google.monitoring.dashboard.v1.Threshold.Color.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state color for this threshold. Color is not allowed in a XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @param value The color to set. + * @return This builder for chaining. + */ + public Builder setColor(com.google.monitoring.dashboard.v1.Threshold.Color value) { + if (value == null) { + throw new NullPointerException(); + } + + color_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state color for this threshold. Color is not allowed in a XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return This builder for chaining. + */ + public Builder clearColor() { + + color_ = 0; + onChanged(); + return this; + } + + private int direction_ = 0; + /** + * + * + *
+     * The direction for the current threshold. Direction is not allowed in a
+     * XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return The enum numeric value on the wire for direction. + */ + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+     * The direction for the current threshold. Direction is not allowed in a
+     * XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @param value The enum numeric value on the wire for direction to set. + * @return This builder for chaining. + */ + public Builder setDirectionValue(int value) { + direction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The direction for the current threshold. Direction is not allowed in a
+     * XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return The direction. + */ + public com.google.monitoring.dashboard.v1.Threshold.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.Threshold.Direction result = + com.google.monitoring.dashboard.v1.Threshold.Direction.valueOf(direction_); + return result == null + ? com.google.monitoring.dashboard.v1.Threshold.Direction.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The direction for the current threshold. Direction is not allowed in a
+     * XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @param value The direction to set. + * @return This builder for chaining. + */ + public Builder setDirection(com.google.monitoring.dashboard.v1.Threshold.Direction value) { + if (value == null) { + throw new NullPointerException(); + } + + direction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The direction for the current threshold. Direction is not allowed in a
+     * XyChart.
+     * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return This builder for chaining. + */ + public Builder clearDirection() { + + direction_ = 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.monitoring.dashboard.v1.Threshold) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Threshold) + private static final com.google.monitoring.dashboard.v1.Threshold DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Threshold(); + } + + public static com.google.monitoring.dashboard.v1.Threshold getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Threshold parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Threshold(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Threshold getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ThresholdOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ThresholdOrBuilder.java new file mode 100644 index 00000000..ef2999a5 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ThresholdOrBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +public interface ThresholdOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Threshold) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A label for the threshold.
+   * 
+ * + * string label = 1; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+   * A label for the threshold.
+   * 
+ * + * string label = 1; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); + + /** + * + * + *
+   * The value of the threshold. The value should be defined in the native scale
+   * of the metric.
+   * 
+ * + * double value = 2; + * + * @return The value. + */ + double getValue(); + + /** + * + * + *
+   * The state color for this threshold. Color is not allowed in a XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return The enum numeric value on the wire for color. + */ + int getColorValue(); + /** + * + * + *
+   * The state color for this threshold. Color is not allowed in a XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Color color = 3; + * + * @return The color. + */ + com.google.monitoring.dashboard.v1.Threshold.Color getColor(); + + /** + * + * + *
+   * The direction for the current threshold. Direction is not allowed in a
+   * XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return The enum numeric value on the wire for direction. + */ + int getDirectionValue(); + /** + * + * + *
+   * The direction for the current threshold. Direction is not allowed in a
+   * XyChart.
+   * 
+ * + * .google.monitoring.dashboard.v1.Threshold.Direction direction = 4; + * + * @return The direction. + */ + com.google.monitoring.dashboard.v1.Threshold.Direction getDirection(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilter.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilter.java new file mode 100644 index 00000000..a09b1860 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilter.java @@ -0,0 +1,1679 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A filter that defines a subset of time series data that is displayed in a
+ * widget. Time series data is fetched using the
+ * [`ListTimeSeries`](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+ * method.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesFilter} + */ +public final class TimeSeriesFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.TimeSeriesFilter) + TimeSeriesFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeSeriesFilter.newBuilder() to construct. + private TimeSeriesFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeSeriesFilter() { + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeSeriesFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TimeSeriesFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 18: + { + com.google.monitoring.dashboard.v1.Aggregation.Builder subBuilder = null; + if (aggregation_ != null) { + subBuilder = aggregation_.toBuilder(); + } + aggregation_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Aggregation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(aggregation_); + aggregation_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder subBuilder = null; + if (outputFilterCase_ == 4) { + subBuilder = + ((com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_) + .toBuilder(); + } + outputFilter_ = + input.readMessage( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_); + outputFilter_ = subBuilder.buildPartial(); + } + outputFilterCase_ = 4; + break; + } + case 42: + { + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder subBuilder = + null; + if (outputFilterCase_ == 5) { + subBuilder = + ((com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_) + .toBuilder(); + } + outputFilter_ = + input.readMessage( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_); + outputFilter_ = subBuilder.buildPartial(); + } + outputFilterCase_ = 5; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesFilter.class, + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder.class); + } + + private int outputFilterCase_ = 0; + private java.lang.Object outputFilter_; + + public enum OutputFilterCase implements com.google.protobuf.Internal.EnumLite { + PICK_TIME_SERIES_FILTER(4), + STATISTICAL_TIME_SERIES_FILTER(5), + OUTPUTFILTER_NOT_SET(0); + private final int value; + + private OutputFilterCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OutputFilterCase valueOf(int value) { + return forNumber(value); + } + + public static OutputFilterCase forNumber(int value) { + switch (value) { + case 4: + return PICK_TIME_SERIES_FILTER; + case 5: + return STATISTICAL_TIME_SERIES_FILTER; + case 0: + return OUTPUTFILTER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OutputFilterCase getOutputFilterCase() { + return OutputFilterCase.forNumber(outputFilterCase_); + } + + public static final int FILTER_FIELD_NUMBER = 1; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+   * metric types, resources, and projects to query.
+   * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + 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; + } + } + /** + * + * + *
+   * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+   * metric types, resources, and projects to query.
+   * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + 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 AGGREGATION_FIELD_NUMBER = 2; + private com.google.monitoring.dashboard.v1.Aggregation aggregation_; + /** + * + * + *
+   * By default, the raw time series data is returned.
+   * Use this field to combine multiple time series for different views of the
+   * data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return Whether the aggregation field is set. + */ + public boolean hasAggregation() { + return aggregation_ != null; + } + /** + * + * + *
+   * By default, the raw time series data is returned.
+   * Use this field to combine multiple time series for different views of the
+   * data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return The aggregation. + */ + public com.google.monitoring.dashboard.v1.Aggregation getAggregation() { + return aggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : aggregation_; + } + /** + * + * + *
+   * By default, the raw time series data is returned.
+   * Use this field to combine multiple time series for different views of the
+   * data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public com.google.monitoring.dashboard.v1.AggregationOrBuilder getAggregationOrBuilder() { + return getAggregation(); + } + + public static final int PICK_TIME_SERIES_FILTER_FIELD_NUMBER = 4; + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return Whether the pickTimeSeriesFilter field is set. + */ + public boolean hasPickTimeSeriesFilter() { + return outputFilterCase_ == 4; + } + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return The pickTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getPickTimeSeriesFilter() { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder + getPickTimeSeriesFilterOrBuilder() { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + + public static final int STATISTICAL_TIME_SERIES_FILTER_FIELD_NUMBER = 5; + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return Whether the statisticalTimeSeriesFilter field is set. + */ + public boolean hasStatisticalTimeSeriesFilter() { + return outputFilterCase_ == 5; + } + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return The statisticalTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getStatisticalTimeSeriesFilter() { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder + getStatisticalTimeSeriesFilterOrBuilder() { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + + 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 (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + } + if (aggregation_ != null) { + output.writeMessage(2, getAggregation()); + } + if (outputFilterCase_ == 4) { + output.writeMessage( + 4, (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_); + } + if (outputFilterCase_ == 5) { + output.writeMessage( + 5, (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + } + if (aggregation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAggregation()); + } + if (outputFilterCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_); + } + if (outputFilterCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.TimeSeriesFilter)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.TimeSeriesFilter other = + (com.google.monitoring.dashboard.v1.TimeSeriesFilter) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (hasAggregation() != other.hasAggregation()) return false; + if (hasAggregation()) { + if (!getAggregation().equals(other.getAggregation())) return false; + } + if (!getOutputFilterCase().equals(other.getOutputFilterCase())) return false; + switch (outputFilterCase_) { + case 4: + if (!getPickTimeSeriesFilter().equals(other.getPickTimeSeriesFilter())) return false; + break; + case 5: + if (!getStatisticalTimeSeriesFilter().equals(other.getStatisticalTimeSeriesFilter())) + return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasAggregation()) { + hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; + hash = (53 * hash) + getAggregation().hashCode(); + } + switch (outputFilterCase_) { + case 4: + hash = (37 * hash) + PICK_TIME_SERIES_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getPickTimeSeriesFilter().hashCode(); + break; + case 5: + hash = (37 * hash) + STATISTICAL_TIME_SERIES_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getStatisticalTimeSeriesFilter().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter 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.monitoring.dashboard.v1.TimeSeriesFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter 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.monitoring.dashboard.v1.TimeSeriesFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter 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.monitoring.dashboard.v1.TimeSeriesFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter 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.monitoring.dashboard.v1.TimeSeriesFilter 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; + } + /** + * + * + *
+   * A filter that defines a subset of time series data that is displayed in a
+   * widget. Time series data is fetched using the
+   * [`ListTimeSeries`](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
+   * method.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.TimeSeriesFilter) + com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesFilter.class, + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.TimeSeriesFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + filter_ = ""; + + if (aggregationBuilder_ == null) { + aggregation_ = null; + } else { + aggregation_ = null; + aggregationBuilder_ = null; + } + outputFilterCase_ = 0; + outputFilter_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilter_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilter getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilter build() { + com.google.monitoring.dashboard.v1.TimeSeriesFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilter buildPartial() { + com.google.monitoring.dashboard.v1.TimeSeriesFilter result = + new com.google.monitoring.dashboard.v1.TimeSeriesFilter(this); + result.filter_ = filter_; + if (aggregationBuilder_ == null) { + result.aggregation_ = aggregation_; + } else { + result.aggregation_ = aggregationBuilder_.build(); + } + if (outputFilterCase_ == 4) { + if (pickTimeSeriesFilterBuilder_ == null) { + result.outputFilter_ = outputFilter_; + } else { + result.outputFilter_ = pickTimeSeriesFilterBuilder_.build(); + } + } + if (outputFilterCase_ == 5) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + result.outputFilter_ = outputFilter_; + } else { + result.outputFilter_ = statisticalTimeSeriesFilterBuilder_.build(); + } + } + result.outputFilterCase_ = outputFilterCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.TimeSeriesFilter) { + return mergeFrom((com.google.monitoring.dashboard.v1.TimeSeriesFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.TimeSeriesFilter other) { + if (other == com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance()) + return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.hasAggregation()) { + mergeAggregation(other.getAggregation()); + } + switch (other.getOutputFilterCase()) { + case PICK_TIME_SERIES_FILTER: + { + mergePickTimeSeriesFilter(other.getPickTimeSeriesFilter()); + break; + } + case STATISTICAL_TIME_SERIES_FILTER: + { + mergeStatisticalTimeSeriesFilter(other.getStatisticalTimeSeriesFilter()); + break; + } + case OUTPUTFILTER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.TimeSeriesFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.TimeSeriesFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int outputFilterCase_ = 0; + private java.lang.Object outputFilter_; + + public OutputFilterCase getOutputFilterCase() { + return OutputFilterCase.forNumber(outputFilterCase_); + } + + public Builder clearOutputFilter() { + outputFilterCase_ = 0; + outputFilter_ = null; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + + private com.google.monitoring.dashboard.v1.Aggregation aggregation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder> + aggregationBuilder_; + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return Whether the aggregation field is set. + */ + public boolean hasAggregation() { + return aggregationBuilder_ != null || aggregation_ != null; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return The aggregation. + */ + public com.google.monitoring.dashboard.v1.Aggregation getAggregation() { + if (aggregationBuilder_ == null) { + return aggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : aggregation_; + } else { + return aggregationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder setAggregation(com.google.monitoring.dashboard.v1.Aggregation value) { + if (aggregationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregation_ = value; + onChanged(); + } else { + aggregationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder setAggregation( + com.google.monitoring.dashboard.v1.Aggregation.Builder builderForValue) { + if (aggregationBuilder_ == null) { + aggregation_ = builderForValue.build(); + onChanged(); + } else { + aggregationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder mergeAggregation(com.google.monitoring.dashboard.v1.Aggregation value) { + if (aggregationBuilder_ == null) { + if (aggregation_ != null) { + aggregation_ = + com.google.monitoring.dashboard.v1.Aggregation.newBuilder(aggregation_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregation_ = value; + } + onChanged(); + } else { + aggregationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder clearAggregation() { + if (aggregationBuilder_ == null) { + aggregation_ = null; + onChanged(); + } else { + aggregation_ = null; + aggregationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public com.google.monitoring.dashboard.v1.Aggregation.Builder getAggregationBuilder() { + + onChanged(); + return getAggregationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public com.google.monitoring.dashboard.v1.AggregationOrBuilder getAggregationOrBuilder() { + if (aggregationBuilder_ != null) { + return aggregationBuilder_.getMessageOrBuilder(); + } else { + return aggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : aggregation_; + } + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder> + getAggregationFieldBuilder() { + if (aggregationBuilder_ == null) { + aggregationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder>( + getAggregation(), getParentForChildren(), isClean()); + aggregation_ = null; + } + return aggregationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder> + pickTimeSeriesFilterBuilder_; + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * + * @return Whether the pickTimeSeriesFilter field is set. + */ + public boolean hasPickTimeSeriesFilter() { + return outputFilterCase_ == 4; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * + * @return The pickTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getPickTimeSeriesFilter() { + if (pickTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } else { + if (outputFilterCase_ == 4) { + return pickTimeSeriesFilterBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder setPickTimeSeriesFilter( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter value) { + if (pickTimeSeriesFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputFilter_ = value; + onChanged(); + } else { + pickTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 4; + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder setPickTimeSeriesFilter( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder builderForValue) { + if (pickTimeSeriesFilterBuilder_ == null) { + outputFilter_ = builderForValue.build(); + onChanged(); + } else { + pickTimeSeriesFilterBuilder_.setMessage(builderForValue.build()); + } + outputFilterCase_ = 4; + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder mergePickTimeSeriesFilter( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter value) { + if (pickTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 4 + && outputFilter_ + != com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance()) { + outputFilter_ = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.newBuilder( + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + outputFilter_ = value; + } + onChanged(); + } else { + if (outputFilterCase_ == 4) { + pickTimeSeriesFilterBuilder_.mergeFrom(value); + } + pickTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 4; + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder clearPickTimeSeriesFilter() { + if (pickTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 4) { + outputFilterCase_ = 0; + outputFilter_ = null; + onChanged(); + } + } else { + if (outputFilterCase_ == 4) { + outputFilterCase_ = 0; + outputFilter_ = null; + } + pickTimeSeriesFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder + getPickTimeSeriesFilterBuilder() { + return getPickTimeSeriesFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder + getPickTimeSeriesFilterOrBuilder() { + if ((outputFilterCase_ == 4) && (pickTimeSeriesFilterBuilder_ != null)) { + return pickTimeSeriesFilterBuilder_.getMessageOrBuilder(); + } else { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder> + getPickTimeSeriesFilterFieldBuilder() { + if (pickTimeSeriesFilterBuilder_ == null) { + if (!(outputFilterCase_ == 4)) { + outputFilter_ = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + pickTimeSeriesFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder>( + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_, + getParentForChildren(), + isClean()); + outputFilter_ = null; + } + outputFilterCase_ = 4; + onChanged(); + ; + return pickTimeSeriesFilterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder> + statisticalTimeSeriesFilterBuilder_; + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return Whether the statisticalTimeSeriesFilter field is set. + */ + public boolean hasStatisticalTimeSeriesFilter() { + return outputFilterCase_ == 5; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return The statisticalTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getStatisticalTimeSeriesFilter() { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } else { + if (outputFilterCase_ == 5) { + return statisticalTimeSeriesFilterBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder setStatisticalTimeSeriesFilter( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter value) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputFilter_ = value; + onChanged(); + } else { + statisticalTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 5; + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder setStatisticalTimeSeriesFilter( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder builderForValue) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + outputFilter_ = builderForValue.build(); + onChanged(); + } else { + statisticalTimeSeriesFilterBuilder_.setMessage(builderForValue.build()); + } + outputFilterCase_ = 5; + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder mergeStatisticalTimeSeriesFilter( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter value) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 5 + && outputFilter_ + != com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + .getDefaultInstance()) { + outputFilter_ = + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.newBuilder( + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + outputFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + outputFilter_ = value; + } + onChanged(); + } else { + if (outputFilterCase_ == 5) { + statisticalTimeSeriesFilterBuilder_.mergeFrom(value); + } + statisticalTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 5; + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder clearStatisticalTimeSeriesFilter() { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 5) { + outputFilterCase_ = 0; + outputFilter_ = null; + onChanged(); + } + } else { + if (outputFilterCase_ == 5) { + outputFilterCase_ = 0; + outputFilter_ = null; + } + statisticalTimeSeriesFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder + getStatisticalTimeSeriesFilterBuilder() { + return getStatisticalTimeSeriesFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder + getStatisticalTimeSeriesFilterOrBuilder() { + if ((outputFilterCase_ == 5) && (statisticalTimeSeriesFilterBuilder_ != null)) { + return statisticalTimeSeriesFilterBuilder_.getMessageOrBuilder(); + } else { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder> + getStatisticalTimeSeriesFilterFieldBuilder() { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (!(outputFilterCase_ == 5)) { + outputFilter_ = + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + statisticalTimeSeriesFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder>( + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_, + getParentForChildren(), + isClean()); + outputFilter_ = null; + } + outputFilterCase_ = 5; + onChanged(); + ; + return statisticalTimeSeriesFilterBuilder_; + } + + @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.monitoring.dashboard.v1.TimeSeriesFilter) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.TimeSeriesFilter) + private static final com.google.monitoring.dashboard.v1.TimeSeriesFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.TimeSeriesFilter(); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeSeriesFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TimeSeriesFilter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterOrBuilder.java new file mode 100644 index 00000000..67fb8035 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +public interface TimeSeriesFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.TimeSeriesFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+   * metric types, resources, and projects to query.
+   * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+   * metric types, resources, and projects to query.
+   * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * By default, the raw time series data is returned.
+   * Use this field to combine multiple time series for different views of the
+   * data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return Whether the aggregation field is set. + */ + boolean hasAggregation(); + /** + * + * + *
+   * By default, the raw time series data is returned.
+   * Use this field to combine multiple time series for different views of the
+   * data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return The aggregation. + */ + com.google.monitoring.dashboard.v1.Aggregation getAggregation(); + /** + * + * + *
+   * By default, the raw time series data is returned.
+   * Use this field to combine multiple time series for different views of the
+   * data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + com.google.monitoring.dashboard.v1.AggregationOrBuilder getAggregationOrBuilder(); + + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return Whether the pickTimeSeriesFilter field is set. + */ + boolean hasPickTimeSeriesFilter(); + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return The pickTimeSeriesFilter. + */ + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getPickTimeSeriesFilter(); + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + */ + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder + getPickTimeSeriesFilterOrBuilder(); + + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return Whether the statisticalTimeSeriesFilter field is set. + */ + boolean hasStatisticalTimeSeriesFilter(); + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return The statisticalTimeSeriesFilter. + */ + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter getStatisticalTimeSeriesFilter(); + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder + getStatisticalTimeSeriesFilterOrBuilder(); + + public com.google.monitoring.dashboard.v1.TimeSeriesFilter.OutputFilterCase getOutputFilterCase(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatio.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatio.java new file mode 100644 index 00000000..0a5b65bb --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatio.java @@ -0,0 +1,3057 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A pair of time series filters that define a ratio computation. The output
+ * time series is the pair-wise division of each aligned element from the
+ * numerator and denominator time series.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesFilterRatio} + */ +public final class TimeSeriesFilterRatio extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.TimeSeriesFilterRatio) + TimeSeriesFilterRatioOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeSeriesFilterRatio.newBuilder() to construct. + private TimeSeriesFilterRatio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeSeriesFilterRatio() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeSeriesFilterRatio(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TimeSeriesFilterRatio( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder + subBuilder = null; + if (numerator_ != null) { + subBuilder = numerator_.toBuilder(); + } + numerator_ = + input.readMessage( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(numerator_); + numerator_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder + subBuilder = null; + if (denominator_ != null) { + subBuilder = denominator_.toBuilder(); + } + denominator_ = + input.readMessage( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(denominator_); + denominator_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.monitoring.dashboard.v1.Aggregation.Builder subBuilder = null; + if (secondaryAggregation_ != null) { + subBuilder = secondaryAggregation_.toBuilder(); + } + secondaryAggregation_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Aggregation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(secondaryAggregation_); + secondaryAggregation_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder subBuilder = null; + if (outputFilterCase_ == 4) { + subBuilder = + ((com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_) + .toBuilder(); + } + outputFilter_ = + input.readMessage( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_); + outputFilter_ = subBuilder.buildPartial(); + } + outputFilterCase_ = 4; + break; + } + case 42: + { + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder subBuilder = + null; + if (outputFilterCase_ == 5) { + subBuilder = + ((com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_) + .toBuilder(); + } + outputFilter_ = + input.readMessage( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_); + outputFilter_ = subBuilder.buildPartial(); + } + outputFilterCase_ = 5; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.class, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder.class); + } + + public interface RatioPartOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return Whether the aggregation field is set. + */ + boolean hasAggregation(); + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return The aggregation. + */ + com.google.monitoring.dashboard.v1.Aggregation getAggregation(); + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + com.google.monitoring.dashboard.v1.AggregationOrBuilder getAggregationOrBuilder(); + } + /** + * + * + *
+   * Describes a query to build the numerator or denominator of a
+   * TimeSeriesFilterRatio.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} + */ + public static final class RatioPart extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + RatioPartOrBuilder { + private static final long serialVersionUID = 0L; + // Use RatioPart.newBuilder() to construct. + private RatioPart(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RatioPart() { + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RatioPart(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RatioPart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 18: + { + com.google.monitoring.dashboard.v1.Aggregation.Builder subBuilder = null; + if (aggregation_ != null) { + subBuilder = aggregation_.toBuilder(); + } + aggregation_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Aggregation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(aggregation_); + aggregation_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.class, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder.class); + } + + public static final int FILTER_FIELD_NUMBER = 1; + private volatile java.lang.Object filter_; + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + 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; + } + } + /** + * + * + *
+     * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+     * metric types, resources, and projects to query.
+     * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + 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 AGGREGATION_FIELD_NUMBER = 2; + private com.google.monitoring.dashboard.v1.Aggregation aggregation_; + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return Whether the aggregation field is set. + */ + public boolean hasAggregation() { + return aggregation_ != null; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return The aggregation. + */ + public com.google.monitoring.dashboard.v1.Aggregation getAggregation() { + return aggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : aggregation_; + } + /** + * + * + *
+     * By default, the raw time series data is returned.
+     * Use this field to combine multiple time series for different views of the
+     * data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public com.google.monitoring.dashboard.v1.AggregationOrBuilder getAggregationOrBuilder() { + return getAggregation(); + } + + 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 (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filter_); + } + if (aggregation_ != null) { + output.writeMessage(2, getAggregation()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + } + if (aggregation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAggregation()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart other = + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) obj; + + if (!getFilter().equals(other.getFilter())) return false; + if (hasAggregation() != other.hasAggregation()) return false; + if (hasAggregation()) { + if (!getAggregation().equals(other.getAggregation())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasAggregation()) { + hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; + hash = (53 * hash) + getAggregation().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart 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.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart 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.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + 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.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart 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.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes a query to build the numerator or denominator of a
+     * TimeSeriesFilterRatio.
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.class, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder.class); + } + + // Construct using + // com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + filter_ = ""; + + if (aggregationBuilder_ == null) { + aggregation_ = null; + } else { + aggregation_ = null; + aggregationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_RatioPart_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart build() { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart buildPartial() { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart result = + new com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart(this); + result.filter_ = filter_; + if (aggregationBuilder_ == null) { + result.aggregation_ = aggregation_; + } else { + result.aggregation_ = aggregationBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) { + return mergeFrom( + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart other) { + if (other + == com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + .getDefaultInstance()) return this; + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.hasAggregation()) { + mergeAggregation(other.getAggregation()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+       * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+       * metric types, resources, and projects to query.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+       * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+       * metric types, resources, and projects to query.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+       * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+       * metric types, resources, and projects to query.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+       * metric types, resources, and projects to query.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the
+       * metric types, resources, and projects to query.
+       * 
+ * + * string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + + private com.google.monitoring.dashboard.v1.Aggregation aggregation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder> + aggregationBuilder_; + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return Whether the aggregation field is set. + */ + public boolean hasAggregation() { + return aggregationBuilder_ != null || aggregation_ != null; + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + * + * @return The aggregation. + */ + public com.google.monitoring.dashboard.v1.Aggregation getAggregation() { + if (aggregationBuilder_ == null) { + return aggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : aggregation_; + } else { + return aggregationBuilder_.getMessage(); + } + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder setAggregation(com.google.monitoring.dashboard.v1.Aggregation value) { + if (aggregationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aggregation_ = value; + onChanged(); + } else { + aggregationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder setAggregation( + com.google.monitoring.dashboard.v1.Aggregation.Builder builderForValue) { + if (aggregationBuilder_ == null) { + aggregation_ = builderForValue.build(); + onChanged(); + } else { + aggregationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder mergeAggregation(com.google.monitoring.dashboard.v1.Aggregation value) { + if (aggregationBuilder_ == null) { + if (aggregation_ != null) { + aggregation_ = + com.google.monitoring.dashboard.v1.Aggregation.newBuilder(aggregation_) + .mergeFrom(value) + .buildPartial(); + } else { + aggregation_ = value; + } + onChanged(); + } else { + aggregationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public Builder clearAggregation() { + if (aggregationBuilder_ == null) { + aggregation_ = null; + onChanged(); + } else { + aggregation_ = null; + aggregationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public com.google.monitoring.dashboard.v1.Aggregation.Builder getAggregationBuilder() { + + onChanged(); + return getAggregationFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + public com.google.monitoring.dashboard.v1.AggregationOrBuilder getAggregationOrBuilder() { + if (aggregationBuilder_ != null) { + return aggregationBuilder_.getMessageOrBuilder(); + } else { + return aggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : aggregation_; + } + } + /** + * + * + *
+       * By default, the raw time series data is returned.
+       * Use this field to combine multiple time series for different views of the
+       * data.
+       * 
+ * + * .google.monitoring.dashboard.v1.Aggregation aggregation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder> + getAggregationFieldBuilder() { + if (aggregationBuilder_ == null) { + aggregationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder>( + getAggregation(), getParentForChildren(), isClean()); + aggregation_ = null; + } + return aggregationBuilder_; + } + + @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.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + private static final com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart(); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RatioPart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RatioPart(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int outputFilterCase_ = 0; + private java.lang.Object outputFilter_; + + public enum OutputFilterCase implements com.google.protobuf.Internal.EnumLite { + PICK_TIME_SERIES_FILTER(4), + STATISTICAL_TIME_SERIES_FILTER(5), + OUTPUTFILTER_NOT_SET(0); + private final int value; + + private OutputFilterCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OutputFilterCase valueOf(int value) { + return forNumber(value); + } + + public static OutputFilterCase forNumber(int value) { + switch (value) { + case 4: + return PICK_TIME_SERIES_FILTER; + case 5: + return STATISTICAL_TIME_SERIES_FILTER; + case 0: + return OUTPUTFILTER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OutputFilterCase getOutputFilterCase() { + return OutputFilterCase.forNumber(outputFilterCase_); + } + + public static final int NUMERATOR_FIELD_NUMBER = 1; + private com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator_; + /** + * + * + *
+   * The numerator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + * + * @return Whether the numerator field is set. + */ + public boolean hasNumerator() { + return numerator_ != null; + } + /** + * + * + *
+   * The numerator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + * + * @return The numerator. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart getNumerator() { + return numerator_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.getDefaultInstance() + : numerator_; + } + /** + * + * + *
+   * The numerator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder + getNumeratorOrBuilder() { + return getNumerator(); + } + + public static final int DENOMINATOR_FIELD_NUMBER = 2; + private com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator_; + /** + * + * + *
+   * The denominator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + * + * @return Whether the denominator field is set. + */ + public boolean hasDenominator() { + return denominator_ != null; + } + /** + * + * + *
+   * The denominator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + * + * @return The denominator. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart getDenominator() { + return denominator_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.getDefaultInstance() + : denominator_; + } + /** + * + * + *
+   * The denominator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder + getDenominatorOrBuilder() { + return getDenominator(); + } + + public static final int SECONDARY_AGGREGATION_FIELD_NUMBER = 3; + private com.google.monitoring.dashboard.v1.Aggregation secondaryAggregation_; + /** + * + * + *
+   * Apply a second aggregation after the ratio is computed.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + * + * @return Whether the secondaryAggregation field is set. + */ + public boolean hasSecondaryAggregation() { + return secondaryAggregation_ != null; + } + /** + * + * + *
+   * Apply a second aggregation after the ratio is computed.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + * + * @return The secondaryAggregation. + */ + public com.google.monitoring.dashboard.v1.Aggregation getSecondaryAggregation() { + return secondaryAggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : secondaryAggregation_; + } + /** + * + * + *
+   * Apply a second aggregation after the ratio is computed.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public com.google.monitoring.dashboard.v1.AggregationOrBuilder + getSecondaryAggregationOrBuilder() { + return getSecondaryAggregation(); + } + + public static final int PICK_TIME_SERIES_FILTER_FIELD_NUMBER = 4; + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return Whether the pickTimeSeriesFilter field is set. + */ + public boolean hasPickTimeSeriesFilter() { + return outputFilterCase_ == 4; + } + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return The pickTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getPickTimeSeriesFilter() { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder + getPickTimeSeriesFilterOrBuilder() { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + + public static final int STATISTICAL_TIME_SERIES_FILTER_FIELD_NUMBER = 5; + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return Whether the statisticalTimeSeriesFilter field is set. + */ + public boolean hasStatisticalTimeSeriesFilter() { + return outputFilterCase_ == 5; + } + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return The statisticalTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getStatisticalTimeSeriesFilter() { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder + getStatisticalTimeSeriesFilterOrBuilder() { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + + 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 (numerator_ != null) { + output.writeMessage(1, getNumerator()); + } + if (denominator_ != null) { + output.writeMessage(2, getDenominator()); + } + if (secondaryAggregation_ != null) { + output.writeMessage(3, getSecondaryAggregation()); + } + if (outputFilterCase_ == 4) { + output.writeMessage( + 4, (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_); + } + if (outputFilterCase_ == 5) { + output.writeMessage( + 5, (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numerator_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getNumerator()); + } + if (denominator_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDenominator()); + } + if (secondaryAggregation_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSecondaryAggregation()); + } + if (outputFilterCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_); + } + if (outputFilterCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio other = + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) obj; + + if (hasNumerator() != other.hasNumerator()) return false; + if (hasNumerator()) { + if (!getNumerator().equals(other.getNumerator())) return false; + } + if (hasDenominator() != other.hasDenominator()) return false; + if (hasDenominator()) { + if (!getDenominator().equals(other.getDenominator())) return false; + } + if (hasSecondaryAggregation() != other.hasSecondaryAggregation()) return false; + if (hasSecondaryAggregation()) { + if (!getSecondaryAggregation().equals(other.getSecondaryAggregation())) return false; + } + if (!getOutputFilterCase().equals(other.getOutputFilterCase())) return false; + switch (outputFilterCase_) { + case 4: + if (!getPickTimeSeriesFilter().equals(other.getPickTimeSeriesFilter())) return false; + break; + case 5: + if (!getStatisticalTimeSeriesFilter().equals(other.getStatisticalTimeSeriesFilter())) + return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNumerator()) { + hash = (37 * hash) + NUMERATOR_FIELD_NUMBER; + hash = (53 * hash) + getNumerator().hashCode(); + } + if (hasDenominator()) { + hash = (37 * hash) + DENOMINATOR_FIELD_NUMBER; + hash = (53 * hash) + getDenominator().hashCode(); + } + if (hasSecondaryAggregation()) { + hash = (37 * hash) + SECONDARY_AGGREGATION_FIELD_NUMBER; + hash = (53 * hash) + getSecondaryAggregation().hashCode(); + } + switch (outputFilterCase_) { + case 4: + hash = (37 * hash) + PICK_TIME_SERIES_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getPickTimeSeriesFilter().hashCode(); + break; + case 5: + hash = (37 * hash) + STATISTICAL_TIME_SERIES_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getStatisticalTimeSeriesFilter().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio 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.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio 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.monitoring.dashboard.v1.TimeSeriesFilterRatio parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio 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.monitoring.dashboard.v1.TimeSeriesFilterRatio parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio 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.monitoring.dashboard.v1.TimeSeriesFilterRatio 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; + } + /** + * + * + *
+   * A pair of time series filters that define a ratio computation. The output
+   * time series is the pair-wise division of each aligned element from the
+   * numerator and denominator time series.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesFilterRatio} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.TimeSeriesFilterRatio) + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.class, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (numeratorBuilder_ == null) { + numerator_ = null; + } else { + numerator_ = null; + numeratorBuilder_ = null; + } + if (denominatorBuilder_ == null) { + denominator_ = null; + } else { + denominator_ = null; + denominatorBuilder_ = null; + } + if (secondaryAggregationBuilder_ == null) { + secondaryAggregation_ = null; + } else { + secondaryAggregation_ = null; + secondaryAggregationBuilder_ = null; + } + outputFilterCase_ = 0; + outputFilter_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesFilterRatio_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio build() { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio buildPartial() { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio result = + new com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio(this); + if (numeratorBuilder_ == null) { + result.numerator_ = numerator_; + } else { + result.numerator_ = numeratorBuilder_.build(); + } + if (denominatorBuilder_ == null) { + result.denominator_ = denominator_; + } else { + result.denominator_ = denominatorBuilder_.build(); + } + if (secondaryAggregationBuilder_ == null) { + result.secondaryAggregation_ = secondaryAggregation_; + } else { + result.secondaryAggregation_ = secondaryAggregationBuilder_.build(); + } + if (outputFilterCase_ == 4) { + if (pickTimeSeriesFilterBuilder_ == null) { + result.outputFilter_ = outputFilter_; + } else { + result.outputFilter_ = pickTimeSeriesFilterBuilder_.build(); + } + } + if (outputFilterCase_ == 5) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + result.outputFilter_ = outputFilter_; + } else { + result.outputFilter_ = statisticalTimeSeriesFilterBuilder_.build(); + } + } + result.outputFilterCase_ = outputFilterCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) { + return mergeFrom((com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio other) { + if (other == com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance()) + return this; + if (other.hasNumerator()) { + mergeNumerator(other.getNumerator()); + } + if (other.hasDenominator()) { + mergeDenominator(other.getDenominator()); + } + if (other.hasSecondaryAggregation()) { + mergeSecondaryAggregation(other.getSecondaryAggregation()); + } + switch (other.getOutputFilterCase()) { + case PICK_TIME_SERIES_FILTER: + { + mergePickTimeSeriesFilter(other.getPickTimeSeriesFilter()); + break; + } + case STATISTICAL_TIME_SERIES_FILTER: + { + mergeStatisticalTimeSeriesFilter(other.getStatisticalTimeSeriesFilter()); + break; + } + case OUTPUTFILTER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int outputFilterCase_ = 0; + private java.lang.Object outputFilter_; + + public OutputFilterCase getOutputFilterCase() { + return OutputFilterCase.forNumber(outputFilterCase_); + } + + public Builder clearOutputFilter() { + outputFilterCase_ = 0; + outputFilter_ = null; + onChanged(); + return this; + } + + private com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder> + numeratorBuilder_; + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + * + * @return Whether the numerator field is set. + */ + public boolean hasNumerator() { + return numeratorBuilder_ != null || numerator_ != null; + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + * + * @return The numerator. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart getNumerator() { + if (numeratorBuilder_ == null) { + return numerator_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + .getDefaultInstance() + : numerator_; + } else { + return numeratorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public Builder setNumerator( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart value) { + if (numeratorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + numerator_ = value; + onChanged(); + } else { + numeratorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public Builder setNumerator( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder + builderForValue) { + if (numeratorBuilder_ == null) { + numerator_ = builderForValue.build(); + onChanged(); + } else { + numeratorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public Builder mergeNumerator( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart value) { + if (numeratorBuilder_ == null) { + if (numerator_ != null) { + numerator_ = + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.newBuilder( + numerator_) + .mergeFrom(value) + .buildPartial(); + } else { + numerator_ = value; + } + onChanged(); + } else { + numeratorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public Builder clearNumerator() { + if (numeratorBuilder_ == null) { + numerator_ = null; + onChanged(); + } else { + numerator_ = null; + numeratorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder + getNumeratorBuilder() { + + onChanged(); + return getNumeratorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder + getNumeratorOrBuilder() { + if (numeratorBuilder_ != null) { + return numeratorBuilder_.getMessageOrBuilder(); + } else { + return numerator_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + .getDefaultInstance() + : numerator_; + } + } + /** + * + * + *
+     * The numerator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder> + getNumeratorFieldBuilder() { + if (numeratorBuilder_ == null) { + numeratorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder>( + getNumerator(), getParentForChildren(), isClean()); + numerator_ = null; + } + return numeratorBuilder_; + } + + private com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder> + denominatorBuilder_; + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + * + * @return Whether the denominator field is set. + */ + public boolean hasDenominator() { + return denominatorBuilder_ != null || denominator_ != null; + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + * + * @return The denominator. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart getDenominator() { + if (denominatorBuilder_ == null) { + return denominator_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + .getDefaultInstance() + : denominator_; + } else { + return denominatorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public Builder setDenominator( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart value) { + if (denominatorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + denominator_ = value; + onChanged(); + } else { + denominatorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public Builder setDenominator( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder + builderForValue) { + if (denominatorBuilder_ == null) { + denominator_ = builderForValue.build(); + onChanged(); + } else { + denominatorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public Builder mergeDenominator( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart value) { + if (denominatorBuilder_ == null) { + if (denominator_ != null) { + denominator_ = + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.newBuilder( + denominator_) + .mergeFrom(value) + .buildPartial(); + } else { + denominator_ = value; + } + onChanged(); + } else { + denominatorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public Builder clearDenominator() { + if (denominatorBuilder_ == null) { + denominator_ = null; + onChanged(); + } else { + denominator_ = null; + denominatorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder + getDenominatorBuilder() { + + onChanged(); + return getDenominatorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder + getDenominatorOrBuilder() { + if (denominatorBuilder_ != null) { + return denominatorBuilder_.getMessageOrBuilder(); + } else { + return denominator_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + .getDefaultInstance() + : denominator_; + } + } + /** + * + * + *
+     * The denominator of the ratio.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder> + getDenominatorFieldBuilder() { + if (denominatorBuilder_ == null) { + denominatorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder>( + getDenominator(), getParentForChildren(), isClean()); + denominator_ = null; + } + return denominatorBuilder_; + } + + private com.google.monitoring.dashboard.v1.Aggregation secondaryAggregation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder> + secondaryAggregationBuilder_; + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + * + * @return Whether the secondaryAggregation field is set. + */ + public boolean hasSecondaryAggregation() { + return secondaryAggregationBuilder_ != null || secondaryAggregation_ != null; + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + * + * @return The secondaryAggregation. + */ + public com.google.monitoring.dashboard.v1.Aggregation getSecondaryAggregation() { + if (secondaryAggregationBuilder_ == null) { + return secondaryAggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : secondaryAggregation_; + } else { + return secondaryAggregationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public Builder setSecondaryAggregation(com.google.monitoring.dashboard.v1.Aggregation value) { + if (secondaryAggregationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + secondaryAggregation_ = value; + onChanged(); + } else { + secondaryAggregationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public Builder setSecondaryAggregation( + com.google.monitoring.dashboard.v1.Aggregation.Builder builderForValue) { + if (secondaryAggregationBuilder_ == null) { + secondaryAggregation_ = builderForValue.build(); + onChanged(); + } else { + secondaryAggregationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public Builder mergeSecondaryAggregation(com.google.monitoring.dashboard.v1.Aggregation value) { + if (secondaryAggregationBuilder_ == null) { + if (secondaryAggregation_ != null) { + secondaryAggregation_ = + com.google.monitoring.dashboard.v1.Aggregation.newBuilder(secondaryAggregation_) + .mergeFrom(value) + .buildPartial(); + } else { + secondaryAggregation_ = value; + } + onChanged(); + } else { + secondaryAggregationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public Builder clearSecondaryAggregation() { + if (secondaryAggregationBuilder_ == null) { + secondaryAggregation_ = null; + onChanged(); + } else { + secondaryAggregation_ = null; + secondaryAggregationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public com.google.monitoring.dashboard.v1.Aggregation.Builder getSecondaryAggregationBuilder() { + + onChanged(); + return getSecondaryAggregationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + public com.google.monitoring.dashboard.v1.AggregationOrBuilder + getSecondaryAggregationOrBuilder() { + if (secondaryAggregationBuilder_ != null) { + return secondaryAggregationBuilder_.getMessageOrBuilder(); + } else { + return secondaryAggregation_ == null + ? com.google.monitoring.dashboard.v1.Aggregation.getDefaultInstance() + : secondaryAggregation_; + } + } + /** + * + * + *
+     * Apply a second aggregation after the ratio is computed.
+     * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder> + getSecondaryAggregationFieldBuilder() { + if (secondaryAggregationBuilder_ == null) { + secondaryAggregationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Aggregation, + com.google.monitoring.dashboard.v1.Aggregation.Builder, + com.google.monitoring.dashboard.v1.AggregationOrBuilder>( + getSecondaryAggregation(), getParentForChildren(), isClean()); + secondaryAggregation_ = null; + } + return secondaryAggregationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder> + pickTimeSeriesFilterBuilder_; + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * + * @return Whether the pickTimeSeriesFilter field is set. + */ + public boolean hasPickTimeSeriesFilter() { + return outputFilterCase_ == 4; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * + * @return The pickTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getPickTimeSeriesFilter() { + if (pickTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } else { + if (outputFilterCase_ == 4) { + return pickTimeSeriesFilterBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder setPickTimeSeriesFilter( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter value) { + if (pickTimeSeriesFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputFilter_ = value; + onChanged(); + } else { + pickTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 4; + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder setPickTimeSeriesFilter( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder builderForValue) { + if (pickTimeSeriesFilterBuilder_ == null) { + outputFilter_ = builderForValue.build(); + onChanged(); + } else { + pickTimeSeriesFilterBuilder_.setMessage(builderForValue.build()); + } + outputFilterCase_ = 4; + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder mergePickTimeSeriesFilter( + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter value) { + if (pickTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 4 + && outputFilter_ + != com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance()) { + outputFilter_ = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.newBuilder( + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + outputFilter_ = value; + } + onChanged(); + } else { + if (outputFilterCase_ == 4) { + pickTimeSeriesFilterBuilder_.mergeFrom(value); + } + pickTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 4; + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public Builder clearPickTimeSeriesFilter() { + if (pickTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 4) { + outputFilterCase_ = 0; + outputFilter_ = null; + onChanged(); + } + } else { + if (outputFilterCase_ == 4) { + outputFilterCase_ = 0; + outputFilter_ = null; + } + pickTimeSeriesFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder + getPickTimeSeriesFilterBuilder() { + return getPickTimeSeriesFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + public com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder + getPickTimeSeriesFilterOrBuilder() { + if ((outputFilterCase_ == 4) && (pickTimeSeriesFilterBuilder_ != null)) { + return pickTimeSeriesFilterBuilder_.getMessageOrBuilder(); + } else { + if (outputFilterCase_ == 4) { + return (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ranking based time series filter.
+     * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder> + getPickTimeSeriesFilterFieldBuilder() { + if (pickTimeSeriesFilterBuilder_ == null) { + if (!(outputFilterCase_ == 4)) { + outputFilter_ = + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.getDefaultInstance(); + } + pickTimeSeriesFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder>( + (com.google.monitoring.dashboard.v1.PickTimeSeriesFilter) outputFilter_, + getParentForChildren(), + isClean()); + outputFilter_ = null; + } + outputFilterCase_ = 4; + onChanged(); + ; + return pickTimeSeriesFilterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder> + statisticalTimeSeriesFilterBuilder_; + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return Whether the statisticalTimeSeriesFilter field is set. + */ + public boolean hasStatisticalTimeSeriesFilter() { + return outputFilterCase_ == 5; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return The statisticalTimeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + getStatisticalTimeSeriesFilter() { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } else { + if (outputFilterCase_ == 5) { + return statisticalTimeSeriesFilterBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder setStatisticalTimeSeriesFilter( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter value) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputFilter_ = value; + onChanged(); + } else { + statisticalTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 5; + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder setStatisticalTimeSeriesFilter( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder builderForValue) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + outputFilter_ = builderForValue.build(); + onChanged(); + } else { + statisticalTimeSeriesFilterBuilder_.setMessage(builderForValue.build()); + } + outputFilterCase_ = 5; + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder mergeStatisticalTimeSeriesFilter( + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter value) { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 5 + && outputFilter_ + != com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + .getDefaultInstance()) { + outputFilter_ = + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.newBuilder( + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + outputFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + outputFilter_ = value; + } + onChanged(); + } else { + if (outputFilterCase_ == 5) { + statisticalTimeSeriesFilterBuilder_.mergeFrom(value); + } + statisticalTimeSeriesFilterBuilder_.setMessage(value); + } + outputFilterCase_ = 5; + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public Builder clearStatisticalTimeSeriesFilter() { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (outputFilterCase_ == 5) { + outputFilterCase_ = 0; + outputFilter_ = null; + onChanged(); + } + } else { + if (outputFilterCase_ == 5) { + outputFilterCase_ = 0; + outputFilter_ = null; + } + statisticalTimeSeriesFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder + getStatisticalTimeSeriesFilterBuilder() { + return getStatisticalTimeSeriesFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + public com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder + getStatisticalTimeSeriesFilterOrBuilder() { + if ((outputFilterCase_ == 5) && (statisticalTimeSeriesFilterBuilder_ != null)) { + return statisticalTimeSeriesFilterBuilder_.getMessageOrBuilder(); + } else { + if (outputFilterCase_ == 5) { + return (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_; + } + return com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Statistics based time series filter.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder> + getStatisticalTimeSeriesFilterFieldBuilder() { + if (statisticalTimeSeriesFilterBuilder_ == null) { + if (!(outputFilterCase_ == 5)) { + outputFilter_ = + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.getDefaultInstance(); + } + statisticalTimeSeriesFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder>( + (com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) outputFilter_, + getParentForChildren(), + isClean()); + outputFilter_ = null; + } + outputFilterCase_ = 5; + onChanged(); + ; + return statisticalTimeSeriesFilterBuilder_; + } + + @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.monitoring.dashboard.v1.TimeSeriesFilterRatio) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.TimeSeriesFilterRatio) + private static final com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio(); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeSeriesFilterRatio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TimeSeriesFilterRatio(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatioOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatioOrBuilder.java new file mode 100644 index 00000000..8036ef73 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatioOrBuilder.java @@ -0,0 +1,213 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +public interface TimeSeriesFilterRatioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.TimeSeriesFilterRatio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The numerator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + * + * @return Whether the numerator field is set. + */ + boolean hasNumerator(); + /** + * + * + *
+   * The numerator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + * + * @return The numerator. + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart getNumerator(); + /** + * + * + *
+   * The numerator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart numerator = 1; + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder + getNumeratorOrBuilder(); + + /** + * + * + *
+   * The denominator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + * + * @return Whether the denominator field is set. + */ + boolean hasDenominator(); + /** + * + * + *
+   * The denominator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + * + * @return The denominator. + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart getDenominator(); + /** + * + * + *
+   * The denominator of the ratio.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart denominator = 2; + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPartOrBuilder + getDenominatorOrBuilder(); + + /** + * + * + *
+   * Apply a second aggregation after the ratio is computed.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + * + * @return Whether the secondaryAggregation field is set. + */ + boolean hasSecondaryAggregation(); + /** + * + * + *
+   * Apply a second aggregation after the ratio is computed.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + * + * @return The secondaryAggregation. + */ + com.google.monitoring.dashboard.v1.Aggregation getSecondaryAggregation(); + /** + * + * + *
+   * Apply a second aggregation after the ratio is computed.
+   * 
+ * + * .google.monitoring.dashboard.v1.Aggregation secondary_aggregation = 3; + */ + com.google.monitoring.dashboard.v1.AggregationOrBuilder getSecondaryAggregationOrBuilder(); + + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return Whether the pickTimeSeriesFilter field is set. + */ + boolean hasPickTimeSeriesFilter(); + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + * + * @return The pickTimeSeriesFilter. + */ + com.google.monitoring.dashboard.v1.PickTimeSeriesFilter getPickTimeSeriesFilter(); + /** + * + * + *
+   * Ranking based time series filter.
+   * 
+ * + * .google.monitoring.dashboard.v1.PickTimeSeriesFilter pick_time_series_filter = 4; + */ + com.google.monitoring.dashboard.v1.PickTimeSeriesFilterOrBuilder + getPickTimeSeriesFilterOrBuilder(); + + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return Whether the statisticalTimeSeriesFilter field is set. + */ + boolean hasStatisticalTimeSeriesFilter(); + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + * + * @return The statisticalTimeSeriesFilter. + */ + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter getStatisticalTimeSeriesFilter(); + /** + * + * + *
+   * Statistics based time series filter.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + * + */ + com.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilterOrBuilder + getStatisticalTimeSeriesFilterOrBuilder(); + + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.OutputFilterCase + getOutputFilterCase(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQuery.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQuery.java new file mode 100644 index 00000000..c9359031 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQuery.java @@ -0,0 +1,1363 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * TimeSeriesQuery collects the set of supported methods for querying time
+ * series data from the Stackdriver metrics API.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesQuery} + */ +public final class TimeSeriesQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.TimeSeriesQuery) + TimeSeriesQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeSeriesQuery.newBuilder() to construct. + private TimeSeriesQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeSeriesQuery() { + unitOverride_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeSeriesQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TimeSeriesQuery( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.monitoring.dashboard.v1.TimeSeriesFilter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = + ((com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_) + .toBuilder(); + } + source_ = + input.readMessage( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + unitOverride_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesQuery.class, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase implements com.google.protobuf.Internal.EnumLite { + TIME_SERIES_FILTER(1), + TIME_SERIES_FILTER_RATIO(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return TIME_SERIES_FILTER; + case 2: + return TIME_SERIES_FILTER_RATIO; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int TIME_SERIES_FILTER_FIELD_NUMBER = 1; + /** + * + * + *
+   * Filter parameters to fetch time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + * + * @return Whether the timeSeriesFilter field is set. + */ + public boolean hasTimeSeriesFilter() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * Filter parameters to fetch time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + * + * @return The timeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilter getTimeSeriesFilter() { + if (sourceCase_ == 1) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } + /** + * + * + *
+   * Filter parameters to fetch time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder + getTimeSeriesFilterOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } + + public static final int TIME_SERIES_FILTER_RATIO_FIELD_NUMBER = 2; + /** + * + * + *
+   * Parameters to fetch a ratio between two time series filters.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + * + * @return Whether the timeSeriesFilterRatio field is set. + */ + public boolean hasTimeSeriesFilterRatio() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * Parameters to fetch a ratio between two time series filters.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + * + * @return The timeSeriesFilterRatio. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio getTimeSeriesFilterRatio() { + if (sourceCase_ == 2) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } + /** + * + * + *
+   * Parameters to fetch a ratio between two time series filters.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder + getTimeSeriesFilterRatioOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } + + public static final int UNIT_OVERRIDE_FIELD_NUMBER = 5; + private volatile java.lang.Object unitOverride_; + /** + * + * + *
+   * The unit of data contained in fetched time series. If non-empty, this
+   * unit will override any unit that accompanies fetched data. The format is
+   * the same as the
+   * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+   * field in `MetricDescriptor`.
+   * 
+ * + * string unit_override = 5; + * + * @return The unitOverride. + */ + public java.lang.String getUnitOverride() { + java.lang.Object ref = unitOverride_; + 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(); + unitOverride_ = s; + return s; + } + } + /** + * + * + *
+   * The unit of data contained in fetched time series. If non-empty, this
+   * unit will override any unit that accompanies fetched data. The format is
+   * the same as the
+   * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+   * field in `MetricDescriptor`.
+   * 
+ * + * string unit_override = 5; + * + * @return The bytes for unitOverride. + */ + public com.google.protobuf.ByteString getUnitOverrideBytes() { + java.lang.Object ref = unitOverride_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unitOverride_ = 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 (sourceCase_ == 1) { + output.writeMessage(1, (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_); + } + if (!getUnitOverrideBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unitOverride_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_); + } + if (!getUnitOverrideBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unitOverride_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.TimeSeriesQuery)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.TimeSeriesQuery other = + (com.google.monitoring.dashboard.v1.TimeSeriesQuery) obj; + + if (!getUnitOverride().equals(other.getUnitOverride())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getTimeSeriesFilter().equals(other.getTimeSeriesFilter())) return false; + break; + case 2: + if (!getTimeSeriesFilterRatio().equals(other.getTimeSeriesFilterRatio())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UNIT_OVERRIDE_FIELD_NUMBER; + hash = (53 * hash) + getUnitOverride().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + TIME_SERIES_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getTimeSeriesFilter().hashCode(); + break; + case 2: + hash = (37 * hash) + TIME_SERIES_FILTER_RATIO_FIELD_NUMBER; + hash = (53 * hash) + getTimeSeriesFilterRatio().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery 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.monitoring.dashboard.v1.TimeSeriesQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery 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.monitoring.dashboard.v1.TimeSeriesQuery parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery 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.monitoring.dashboard.v1.TimeSeriesQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery 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.monitoring.dashboard.v1.TimeSeriesQuery 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; + } + /** + * + * + *
+   * TimeSeriesQuery collects the set of supported methods for querying time
+   * series data from the Stackdriver metrics API.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.TimeSeriesQuery} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.TimeSeriesQuery) + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.TimeSeriesQuery.class, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.TimeSeriesQuery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + unitOverride_ = ""; + + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.MetricsProto + .internal_static_google_monitoring_dashboard_v1_TimeSeriesQuery_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesQuery getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesQuery build() { + com.google.monitoring.dashboard.v1.TimeSeriesQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesQuery buildPartial() { + com.google.monitoring.dashboard.v1.TimeSeriesQuery result = + new com.google.monitoring.dashboard.v1.TimeSeriesQuery(this); + if (sourceCase_ == 1) { + if (timeSeriesFilterBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = timeSeriesFilterBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (timeSeriesFilterRatioBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = timeSeriesFilterRatioBuilder_.build(); + } + } + result.unitOverride_ = unitOverride_; + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.TimeSeriesQuery) { + return mergeFrom((com.google.monitoring.dashboard.v1.TimeSeriesQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.TimeSeriesQuery other) { + if (other == com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance()) + return this; + if (!other.getUnitOverride().isEmpty()) { + unitOverride_ = other.unitOverride_; + onChanged(); + } + switch (other.getSourceCase()) { + case TIME_SERIES_FILTER: + { + mergeTimeSeriesFilter(other.getTimeSeriesFilter()); + break; + } + case TIME_SERIES_FILTER_RATIO: + { + mergeTimeSeriesFilterRatio(other.getTimeSeriesFilterRatio()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.TimeSeriesQuery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.TimeSeriesQuery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilter, + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder> + timeSeriesFilterBuilder_; + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + * + * @return Whether the timeSeriesFilter field is set. + */ + public boolean hasTimeSeriesFilter() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + * + * @return The timeSeriesFilter. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilter getTimeSeriesFilter() { + if (timeSeriesFilterBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return timeSeriesFilterBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public Builder setTimeSeriesFilter(com.google.monitoring.dashboard.v1.TimeSeriesFilter value) { + if (timeSeriesFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + timeSeriesFilterBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public Builder setTimeSeriesFilter( + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder builderForValue) { + if (timeSeriesFilterBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + timeSeriesFilterBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public Builder mergeTimeSeriesFilter( + com.google.monitoring.dashboard.v1.TimeSeriesFilter value) { + if (timeSeriesFilterBuilder_ == null) { + if (sourceCase_ == 1 + && source_ + != com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance()) { + source_ = + com.google.monitoring.dashboard.v1.TimeSeriesFilter.newBuilder( + (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + timeSeriesFilterBuilder_.mergeFrom(value); + } + timeSeriesFilterBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public Builder clearTimeSeriesFilter() { + if (timeSeriesFilterBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + timeSeriesFilterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder + getTimeSeriesFilterBuilder() { + return getTimeSeriesFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder + getTimeSeriesFilterOrBuilder() { + if ((sourceCase_ == 1) && (timeSeriesFilterBuilder_ != null)) { + return timeSeriesFilterBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Filter parameters to fetch time series.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilter, + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder> + getTimeSeriesFilterFieldBuilder() { + if (timeSeriesFilterBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.monitoring.dashboard.v1.TimeSeriesFilter.getDefaultInstance(); + } + timeSeriesFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilter, + com.google.monitoring.dashboard.v1.TimeSeriesFilter.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder>( + (com.google.monitoring.dashboard.v1.TimeSeriesFilter) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return timeSeriesFilterBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder> + timeSeriesFilterRatioBuilder_; + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + * + * @return Whether the timeSeriesFilterRatio field is set. + */ + public boolean hasTimeSeriesFilterRatio() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + * + * @return The timeSeriesFilterRatio. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio getTimeSeriesFilterRatio() { + if (timeSeriesFilterRatioBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return timeSeriesFilterRatioBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public Builder setTimeSeriesFilterRatio( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio value) { + if (timeSeriesFilterRatioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + timeSeriesFilterRatioBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public Builder setTimeSeriesFilterRatio( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder builderForValue) { + if (timeSeriesFilterRatioBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + timeSeriesFilterRatioBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public Builder mergeTimeSeriesFilterRatio( + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio value) { + if (timeSeriesFilterRatioBuilder_ == null) { + if (sourceCase_ == 2 + && source_ + != com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance()) { + source_ = + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.newBuilder( + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + timeSeriesFilterRatioBuilder_.mergeFrom(value); + } + timeSeriesFilterRatioBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public Builder clearTimeSeriesFilterRatio() { + if (timeSeriesFilterRatioBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + timeSeriesFilterRatioBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder + getTimeSeriesFilterRatioBuilder() { + return getTimeSeriesFilterRatioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + public com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder + getTimeSeriesFilterRatioOrBuilder() { + if ((sourceCase_ == 2) && (timeSeriesFilterRatioBuilder_ != null)) { + return timeSeriesFilterRatioBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_; + } + return com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } + } + /** + * + * + *
+     * Parameters to fetch a ratio between two time series filters.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder> + getTimeSeriesFilterRatioFieldBuilder() { + if (timeSeriesFilterRatioBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.getDefaultInstance(); + } + timeSeriesFilterRatioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder>( + (com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return timeSeriesFilterRatioBuilder_; + } + + private java.lang.Object unitOverride_ = ""; + /** + * + * + *
+     * The unit of data contained in fetched time series. If non-empty, this
+     * unit will override any unit that accompanies fetched data. The format is
+     * the same as the
+     * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+     * field in `MetricDescriptor`.
+     * 
+ * + * string unit_override = 5; + * + * @return The unitOverride. + */ + public java.lang.String getUnitOverride() { + java.lang.Object ref = unitOverride_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unitOverride_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unit of data contained in fetched time series. If non-empty, this
+     * unit will override any unit that accompanies fetched data. The format is
+     * the same as the
+     * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+     * field in `MetricDescriptor`.
+     * 
+ * + * string unit_override = 5; + * + * @return The bytes for unitOverride. + */ + public com.google.protobuf.ByteString getUnitOverrideBytes() { + java.lang.Object ref = unitOverride_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unitOverride_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unit of data contained in fetched time series. If non-empty, this
+     * unit will override any unit that accompanies fetched data. The format is
+     * the same as the
+     * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+     * field in `MetricDescriptor`.
+     * 
+ * + * string unit_override = 5; + * + * @param value The unitOverride to set. + * @return This builder for chaining. + */ + public Builder setUnitOverride(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + unitOverride_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unit of data contained in fetched time series. If non-empty, this
+     * unit will override any unit that accompanies fetched data. The format is
+     * the same as the
+     * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+     * field in `MetricDescriptor`.
+     * 
+ * + * string unit_override = 5; + * + * @return This builder for chaining. + */ + public Builder clearUnitOverride() { + + unitOverride_ = getDefaultInstance().getUnitOverride(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unit of data contained in fetched time series. If non-empty, this
+     * unit will override any unit that accompanies fetched data. The format is
+     * the same as the
+     * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+     * field in `MetricDescriptor`.
+     * 
+ * + * string unit_override = 5; + * + * @param value The bytes for unitOverride to set. + * @return This builder for chaining. + */ + public Builder setUnitOverrideBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + unitOverride_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.dashboard.v1.TimeSeriesQuery) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.TimeSeriesQuery) + private static final com.google.monitoring.dashboard.v1.TimeSeriesQuery DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.TimeSeriesQuery(); + } + + public static com.google.monitoring.dashboard.v1.TimeSeriesQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeSeriesQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TimeSeriesQuery(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.TimeSeriesQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQueryOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQueryOrBuilder.java new file mode 100644 index 00000000..36ddddff --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQueryOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/metrics.proto + +package com.google.monitoring.dashboard.v1; + +public interface TimeSeriesQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.TimeSeriesQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Filter parameters to fetch time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + * + * @return Whether the timeSeriesFilter field is set. + */ + boolean hasTimeSeriesFilter(); + /** + * + * + *
+   * Filter parameters to fetch time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + * + * @return The timeSeriesFilter. + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilter getTimeSeriesFilter(); + /** + * + * + *
+   * Filter parameters to fetch time series.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilter time_series_filter = 1; + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterOrBuilder getTimeSeriesFilterOrBuilder(); + + /** + * + * + *
+   * Parameters to fetch a ratio between two time series filters.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + * + * @return Whether the timeSeriesFilterRatio field is set. + */ + boolean hasTimeSeriesFilterRatio(); + /** + * + * + *
+   * Parameters to fetch a ratio between two time series filters.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + * + * @return The timeSeriesFilterRatio. + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatio getTimeSeriesFilterRatio(); + /** + * + * + *
+   * Parameters to fetch a ratio between two time series filters.
+   * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesFilterRatio time_series_filter_ratio = 2; + * + */ + com.google.monitoring.dashboard.v1.TimeSeriesFilterRatioOrBuilder + getTimeSeriesFilterRatioOrBuilder(); + + /** + * + * + *
+   * The unit of data contained in fetched time series. If non-empty, this
+   * unit will override any unit that accompanies fetched data. The format is
+   * the same as the
+   * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+   * field in `MetricDescriptor`.
+   * 
+ * + * string unit_override = 5; + * + * @return The unitOverride. + */ + java.lang.String getUnitOverride(); + /** + * + * + *
+   * The unit of data contained in fetched time series. If non-empty, this
+   * unit will override any unit that accompanies fetched data. The format is
+   * the same as the
+   * [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
+   * field in `MetricDescriptor`.
+   * 
+ * + * string unit_override = 5; + * + * @return The bytes for unitOverride. + */ + com.google.protobuf.ByteString getUnitOverrideBytes(); + + public com.google.monitoring.dashboard.v1.TimeSeriesQuery.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequest.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequest.java new file mode 100644 index 00000000..116167df --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequest.java @@ -0,0 +1,756 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * The `UpdateDashboard` request.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.UpdateDashboardRequest} + */ +public final class UpdateDashboardRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.UpdateDashboardRequest) + UpdateDashboardRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDashboardRequest.newBuilder() to construct. + private UpdateDashboardRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDashboardRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDashboardRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateDashboardRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.monitoring.dashboard.v1.Dashboard.Builder subBuilder = null; + if (dashboard_ != null) { + subBuilder = dashboard_.toBuilder(); + } + dashboard_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Dashboard.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(dashboard_); + dashboard_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.UpdateDashboardRequest.class, + com.google.monitoring.dashboard.v1.UpdateDashboardRequest.Builder.class); + } + + public static final int DASHBOARD_FIELD_NUMBER = 1; + private com.google.monitoring.dashboard.v1.Dashboard dashboard_; + /** + * + * + *
+   * Required. The dashboard that will replace the existing dashboard.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dashboard field is set. + */ + public boolean hasDashboard() { + return dashboard_ != null; + } + /** + * + * + *
+   * Required. The dashboard that will replace the existing dashboard.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dashboard. + */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboard() { + return dashboard_ == null + ? com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance() + : dashboard_; + } + /** + * + * + *
+   * Required. The dashboard that will replace the existing dashboard.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardOrBuilder() { + return getDashboard(); + } + + 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 (dashboard_ != null) { + output.writeMessage(1, getDashboard()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dashboard_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDashboard()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.UpdateDashboardRequest)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.UpdateDashboardRequest other = + (com.google.monitoring.dashboard.v1.UpdateDashboardRequest) obj; + + if (hasDashboard() != other.hasDashboard()) return false; + if (hasDashboard()) { + if (!getDashboard().equals(other.getDashboard())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDashboard()) { + hash = (37 * hash) + DASHBOARD_FIELD_NUMBER; + hash = (53 * hash) + getDashboard().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest 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.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest 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.monitoring.dashboard.v1.UpdateDashboardRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest 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.monitoring.dashboard.v1.UpdateDashboardRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest 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.monitoring.dashboard.v1.UpdateDashboardRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The `UpdateDashboard` request.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.UpdateDashboardRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.UpdateDashboardRequest) + com.google.monitoring.dashboard.v1.UpdateDashboardRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.UpdateDashboardRequest.class, + com.google.monitoring.dashboard.v1.UpdateDashboardRequest.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.UpdateDashboardRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dashboardBuilder_ == null) { + dashboard_ = null; + } else { + dashboard_ = null; + dashboardBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.DashboardsServiceProto + .internal_static_google_monitoring_dashboard_v1_UpdateDashboardRequest_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.UpdateDashboardRequest getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.UpdateDashboardRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.UpdateDashboardRequest build() { + com.google.monitoring.dashboard.v1.UpdateDashboardRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.UpdateDashboardRequest buildPartial() { + com.google.monitoring.dashboard.v1.UpdateDashboardRequest result = + new com.google.monitoring.dashboard.v1.UpdateDashboardRequest(this); + if (dashboardBuilder_ == null) { + result.dashboard_ = dashboard_; + } else { + result.dashboard_ = dashboardBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.UpdateDashboardRequest) { + return mergeFrom((com.google.monitoring.dashboard.v1.UpdateDashboardRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.UpdateDashboardRequest other) { + if (other == com.google.monitoring.dashboard.v1.UpdateDashboardRequest.getDefaultInstance()) + return this; + if (other.hasDashboard()) { + mergeDashboard(other.getDashboard()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.UpdateDashboardRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.UpdateDashboardRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.monitoring.dashboard.v1.Dashboard dashboard_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder> + dashboardBuilder_; + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dashboard field is set. + */ + public boolean hasDashboard() { + return dashboardBuilder_ != null || dashboard_ != null; + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dashboard. + */ + public com.google.monitoring.dashboard.v1.Dashboard getDashboard() { + if (dashboardBuilder_ == null) { + return dashboard_ == null + ? com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance() + : dashboard_; + } else { + return dashboardBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDashboard(com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dashboard_ = value; + onChanged(); + } else { + dashboardBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDashboard( + com.google.monitoring.dashboard.v1.Dashboard.Builder builderForValue) { + if (dashboardBuilder_ == null) { + dashboard_ = builderForValue.build(); + onChanged(); + } else { + dashboardBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDashboard(com.google.monitoring.dashboard.v1.Dashboard value) { + if (dashboardBuilder_ == null) { + if (dashboard_ != null) { + dashboard_ = + com.google.monitoring.dashboard.v1.Dashboard.newBuilder(dashboard_) + .mergeFrom(value) + .buildPartial(); + } else { + dashboard_ = value; + } + onChanged(); + } else { + dashboardBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDashboard() { + if (dashboardBuilder_ == null) { + dashboard_ = null; + onChanged(); + } else { + dashboard_ = null; + dashboardBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.monitoring.dashboard.v1.Dashboard.Builder getDashboardBuilder() { + + onChanged(); + return getDashboardFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardOrBuilder() { + if (dashboardBuilder_ != null) { + return dashboardBuilder_.getMessageOrBuilder(); + } else { + return dashboard_ == null + ? com.google.monitoring.dashboard.v1.Dashboard.getDefaultInstance() + : dashboard_; + } + } + /** + * + * + *
+     * Required. The dashboard that will replace the existing dashboard.
+     * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder> + getDashboardFieldBuilder() { + if (dashboardBuilder_ == null) { + dashboardBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Dashboard, + com.google.monitoring.dashboard.v1.Dashboard.Builder, + com.google.monitoring.dashboard.v1.DashboardOrBuilder>( + getDashboard(), getParentForChildren(), isClean()); + dashboard_ = null; + } + return dashboardBuilder_; + } + + @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.monitoring.dashboard.v1.UpdateDashboardRequest) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.UpdateDashboardRequest) + private static final com.google.monitoring.dashboard.v1.UpdateDashboardRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.UpdateDashboardRequest(); + } + + public static com.google.monitoring.dashboard.v1.UpdateDashboardRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDashboardRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateDashboardRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.UpdateDashboardRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequestOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequestOrBuilder.java new file mode 100644 index 00000000..b875b85c --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/dashboards_service.proto + +package com.google.monitoring.dashboard.v1; + +public interface UpdateDashboardRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.UpdateDashboardRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The dashboard that will replace the existing dashboard.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dashboard field is set. + */ + boolean hasDashboard(); + /** + * + * + *
+   * Required. The dashboard that will replace the existing dashboard.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dashboard. + */ + com.google.monitoring.dashboard.v1.Dashboard getDashboard(); + /** + * + * + *
+   * Required. The dashboard that will replace the existing dashboard.
+   * 
+ * + * + * .google.monitoring.dashboard.v1.Dashboard dashboard = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.monitoring.dashboard.v1.DashboardOrBuilder getDashboardOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Widget.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Widget.java new file mode 100644 index 00000000..6c81236c --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Widget.java @@ -0,0 +1,1895 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/widget.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * Widget contains a single dashboard component and configuration of how to
+ * present the component in the dashboard.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Widget} + */ +public final class Widget extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.Widget) + WidgetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Widget.newBuilder() to construct. + private Widget(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Widget() { + title_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Widget(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Widget( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 18: + { + com.google.monitoring.dashboard.v1.XyChart.Builder subBuilder = null; + if (contentCase_ == 2) { + subBuilder = ((com.google.monitoring.dashboard.v1.XyChart) content_).toBuilder(); + } + content_ = + input.readMessage( + com.google.monitoring.dashboard.v1.XyChart.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.XyChart) content_); + content_ = subBuilder.buildPartial(); + } + contentCase_ = 2; + break; + } + case 26: + { + com.google.monitoring.dashboard.v1.Scorecard.Builder subBuilder = null; + if (contentCase_ == 3) { + subBuilder = ((com.google.monitoring.dashboard.v1.Scorecard) content_).toBuilder(); + } + content_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Scorecard.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.Scorecard) content_); + content_ = subBuilder.buildPartial(); + } + contentCase_ = 3; + break; + } + case 34: + { + com.google.monitoring.dashboard.v1.Text.Builder subBuilder = null; + if (contentCase_ == 4) { + subBuilder = ((com.google.monitoring.dashboard.v1.Text) content_).toBuilder(); + } + content_ = + input.readMessage( + com.google.monitoring.dashboard.v1.Text.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.monitoring.dashboard.v1.Text) content_); + content_ = subBuilder.buildPartial(); + } + contentCase_ = 4; + break; + } + case 42: + { + com.google.protobuf.Empty.Builder subBuilder = null; + if (contentCase_ == 5) { + subBuilder = ((com.google.protobuf.Empty) content_).toBuilder(); + } + content_ = input.readMessage(com.google.protobuf.Empty.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Empty) content_); + content_ = subBuilder.buildPartial(); + } + contentCase_ = 5; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.WidgetProto + .internal_static_google_monitoring_dashboard_v1_Widget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.WidgetProto + .internal_static_google_monitoring_dashboard_v1_Widget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Widget.class, + com.google.monitoring.dashboard.v1.Widget.Builder.class); + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public enum ContentCase implements com.google.protobuf.Internal.EnumLite { + XY_CHART(2), + SCORECARD(3), + TEXT(4), + BLANK(5), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 2: + return XY_CHART; + case 3: + return SCORECARD; + case 4: + return TEXT; + case 5: + return BLANK; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public static final int TITLE_FIELD_NUMBER = 1; + private volatile java.lang.Object title_; + /** + * + * + *
+   * Optional. The title of the widget.
+   * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The title. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The title of the widget.
+   * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for title. + */ + 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 XY_CHART_FIELD_NUMBER = 2; + /** + * + * + *
+   * A chart of time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + * + * @return Whether the xyChart field is set. + */ + public boolean hasXyChart() { + return contentCase_ == 2; + } + /** + * + * + *
+   * A chart of time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + * + * @return The xyChart. + */ + public com.google.monitoring.dashboard.v1.XyChart getXyChart() { + if (contentCase_ == 2) { + return (com.google.monitoring.dashboard.v1.XyChart) content_; + } + return com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } + /** + * + * + *
+   * A chart of time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public com.google.monitoring.dashboard.v1.XyChartOrBuilder getXyChartOrBuilder() { + if (contentCase_ == 2) { + return (com.google.monitoring.dashboard.v1.XyChart) content_; + } + return com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } + + public static final int SCORECARD_FIELD_NUMBER = 3; + /** + * + * + *
+   * A scorecard summarizing time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + * + * @return Whether the scorecard field is set. + */ + public boolean hasScorecard() { + return contentCase_ == 3; + } + /** + * + * + *
+   * A scorecard summarizing time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + * + * @return The scorecard. + */ + public com.google.monitoring.dashboard.v1.Scorecard getScorecard() { + if (contentCase_ == 3) { + return (com.google.monitoring.dashboard.v1.Scorecard) content_; + } + return com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } + /** + * + * + *
+   * A scorecard summarizing time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public com.google.monitoring.dashboard.v1.ScorecardOrBuilder getScorecardOrBuilder() { + if (contentCase_ == 3) { + return (com.google.monitoring.dashboard.v1.Scorecard) content_; + } + return com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } + + public static final int TEXT_FIELD_NUMBER = 4; + /** + * + * + *
+   * A raw string or markdown displaying textual content.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return contentCase_ == 4; + } + /** + * + * + *
+   * A raw string or markdown displaying textual content.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + * + * @return The text. + */ + public com.google.monitoring.dashboard.v1.Text getText() { + if (contentCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Text) content_; + } + return com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } + /** + * + * + *
+   * A raw string or markdown displaying textual content.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public com.google.monitoring.dashboard.v1.TextOrBuilder getTextOrBuilder() { + if (contentCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Text) content_; + } + return com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } + + public static final int BLANK_FIELD_NUMBER = 5; + /** + * + * + *
+   * A blank space.
+   * 
+ * + * .google.protobuf.Empty blank = 5; + * + * @return Whether the blank field is set. + */ + public boolean hasBlank() { + return contentCase_ == 5; + } + /** + * + * + *
+   * A blank space.
+   * 
+ * + * .google.protobuf.Empty blank = 5; + * + * @return The blank. + */ + public com.google.protobuf.Empty getBlank() { + if (contentCase_ == 5) { + return (com.google.protobuf.Empty) content_; + } + return com.google.protobuf.Empty.getDefaultInstance(); + } + /** + * + * + *
+   * A blank space.
+   * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public com.google.protobuf.EmptyOrBuilder getBlankOrBuilder() { + if (contentCase_ == 5) { + return (com.google.protobuf.Empty) content_; + } + return com.google.protobuf.Empty.getDefaultInstance(); + } + + 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 (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_); + } + if (contentCase_ == 2) { + output.writeMessage(2, (com.google.monitoring.dashboard.v1.XyChart) content_); + } + if (contentCase_ == 3) { + output.writeMessage(3, (com.google.monitoring.dashboard.v1.Scorecard) content_); + } + if (contentCase_ == 4) { + output.writeMessage(4, (com.google.monitoring.dashboard.v1.Text) content_); + } + if (contentCase_ == 5) { + output.writeMessage(5, (com.google.protobuf.Empty) content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_); + } + if (contentCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.monitoring.dashboard.v1.XyChart) content_); + } + if (contentCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.monitoring.dashboard.v1.Scorecard) content_); + } + if (contentCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.monitoring.dashboard.v1.Text) content_); + } + if (contentCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.protobuf.Empty) content_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.Widget)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.Widget other = + (com.google.monitoring.dashboard.v1.Widget) obj; + + if (!getTitle().equals(other.getTitle())) return false; + if (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 2: + if (!getXyChart().equals(other.getXyChart())) return false; + break; + case 3: + if (!getScorecard().equals(other.getScorecard())) return false; + break; + case 4: + if (!getText().equals(other.getText())) return false; + break; + case 5: + if (!getBlank().equals(other.getBlank())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + switch (contentCase_) { + case 2: + hash = (37 * hash) + XY_CHART_FIELD_NUMBER; + hash = (53 * hash) + getXyChart().hashCode(); + break; + case 3: + hash = (37 * hash) + SCORECARD_FIELD_NUMBER; + hash = (53 * hash) + getScorecard().hashCode(); + break; + case 4: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 5: + hash = (37 * hash) + BLANK_FIELD_NUMBER; + hash = (53 * hash) + getBlank().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.Widget parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Widget parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Widget parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Widget 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.monitoring.dashboard.v1.Widget parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.Widget parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.Widget parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Widget 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.monitoring.dashboard.v1.Widget parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Widget 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.monitoring.dashboard.v1.Widget parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.Widget 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.monitoring.dashboard.v1.Widget 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; + } + /** + * + * + *
+   * Widget contains a single dashboard component and configuration of how to
+   * present the component in the dashboard.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.Widget} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.Widget) + com.google.monitoring.dashboard.v1.WidgetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.WidgetProto + .internal_static_google_monitoring_dashboard_v1_Widget_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.WidgetProto + .internal_static_google_monitoring_dashboard_v1_Widget_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.Widget.class, + com.google.monitoring.dashboard.v1.Widget.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.Widget.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + title_ = ""; + + contentCase_ = 0; + content_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.WidgetProto + .internal_static_google_monitoring_dashboard_v1_Widget_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Widget getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.Widget.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Widget build() { + com.google.monitoring.dashboard.v1.Widget result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Widget buildPartial() { + com.google.monitoring.dashboard.v1.Widget result = + new com.google.monitoring.dashboard.v1.Widget(this); + result.title_ = title_; + if (contentCase_ == 2) { + if (xyChartBuilder_ == null) { + result.content_ = content_; + } else { + result.content_ = xyChartBuilder_.build(); + } + } + if (contentCase_ == 3) { + if (scorecardBuilder_ == null) { + result.content_ = content_; + } else { + result.content_ = scorecardBuilder_.build(); + } + } + if (contentCase_ == 4) { + if (textBuilder_ == null) { + result.content_ = content_; + } else { + result.content_ = textBuilder_.build(); + } + } + if (contentCase_ == 5) { + if (blankBuilder_ == null) { + result.content_ = content_; + } else { + result.content_ = blankBuilder_.build(); + } + } + result.contentCase_ = contentCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.Widget) { + return mergeFrom((com.google.monitoring.dashboard.v1.Widget) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.Widget other) { + if (other == com.google.monitoring.dashboard.v1.Widget.getDefaultInstance()) return this; + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + switch (other.getContentCase()) { + case XY_CHART: + { + mergeXyChart(other.getXyChart()); + break; + } + case SCORECARD: + { + mergeScorecard(other.getScorecard()); + break; + } + case TEXT: + { + mergeText(other.getText()); + break; + } + case BLANK: + { + mergeBlank(other.getBlank()); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.Widget parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.Widget) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Optional. The title of the widget.
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The title of the widget.
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The title of the widget.
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The title of the widget.
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The title of the widget.
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart, + com.google.monitoring.dashboard.v1.XyChart.Builder, + com.google.monitoring.dashboard.v1.XyChartOrBuilder> + xyChartBuilder_; + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + * + * @return Whether the xyChart field is set. + */ + public boolean hasXyChart() { + return contentCase_ == 2; + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + * + * @return The xyChart. + */ + public com.google.monitoring.dashboard.v1.XyChart getXyChart() { + if (xyChartBuilder_ == null) { + if (contentCase_ == 2) { + return (com.google.monitoring.dashboard.v1.XyChart) content_; + } + return com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } else { + if (contentCase_ == 2) { + return xyChartBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public Builder setXyChart(com.google.monitoring.dashboard.v1.XyChart value) { + if (xyChartBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + onChanged(); + } else { + xyChartBuilder_.setMessage(value); + } + contentCase_ = 2; + return this; + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public Builder setXyChart(com.google.monitoring.dashboard.v1.XyChart.Builder builderForValue) { + if (xyChartBuilder_ == null) { + content_ = builderForValue.build(); + onChanged(); + } else { + xyChartBuilder_.setMessage(builderForValue.build()); + } + contentCase_ = 2; + return this; + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public Builder mergeXyChart(com.google.monitoring.dashboard.v1.XyChart value) { + if (xyChartBuilder_ == null) { + if (contentCase_ == 2 + && content_ != com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance()) { + content_ = + com.google.monitoring.dashboard.v1.XyChart.newBuilder( + (com.google.monitoring.dashboard.v1.XyChart) content_) + .mergeFrom(value) + .buildPartial(); + } else { + content_ = value; + } + onChanged(); + } else { + if (contentCase_ == 2) { + xyChartBuilder_.mergeFrom(value); + } + xyChartBuilder_.setMessage(value); + } + contentCase_ = 2; + return this; + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public Builder clearXyChart() { + if (xyChartBuilder_ == null) { + if (contentCase_ == 2) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + } else { + if (contentCase_ == 2) { + contentCase_ = 0; + content_ = null; + } + xyChartBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public com.google.monitoring.dashboard.v1.XyChart.Builder getXyChartBuilder() { + return getXyChartFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + public com.google.monitoring.dashboard.v1.XyChartOrBuilder getXyChartOrBuilder() { + if ((contentCase_ == 2) && (xyChartBuilder_ != null)) { + return xyChartBuilder_.getMessageOrBuilder(); + } else { + if (contentCase_ == 2) { + return (com.google.monitoring.dashboard.v1.XyChart) content_; + } + return com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } + } + /** + * + * + *
+     * A chart of time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart, + com.google.monitoring.dashboard.v1.XyChart.Builder, + com.google.monitoring.dashboard.v1.XyChartOrBuilder> + getXyChartFieldBuilder() { + if (xyChartBuilder_ == null) { + if (!(contentCase_ == 2)) { + content_ = com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } + xyChartBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart, + com.google.monitoring.dashboard.v1.XyChart.Builder, + com.google.monitoring.dashboard.v1.XyChartOrBuilder>( + (com.google.monitoring.dashboard.v1.XyChart) content_, + getParentForChildren(), + isClean()); + content_ = null; + } + contentCase_ = 2; + onChanged(); + ; + return xyChartBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard, + com.google.monitoring.dashboard.v1.Scorecard.Builder, + com.google.monitoring.dashboard.v1.ScorecardOrBuilder> + scorecardBuilder_; + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + * + * @return Whether the scorecard field is set. + */ + public boolean hasScorecard() { + return contentCase_ == 3; + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + * + * @return The scorecard. + */ + public com.google.monitoring.dashboard.v1.Scorecard getScorecard() { + if (scorecardBuilder_ == null) { + if (contentCase_ == 3) { + return (com.google.monitoring.dashboard.v1.Scorecard) content_; + } + return com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } else { + if (contentCase_ == 3) { + return scorecardBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public Builder setScorecard(com.google.monitoring.dashboard.v1.Scorecard value) { + if (scorecardBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + onChanged(); + } else { + scorecardBuilder_.setMessage(value); + } + contentCase_ = 3; + return this; + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public Builder setScorecard( + com.google.monitoring.dashboard.v1.Scorecard.Builder builderForValue) { + if (scorecardBuilder_ == null) { + content_ = builderForValue.build(); + onChanged(); + } else { + scorecardBuilder_.setMessage(builderForValue.build()); + } + contentCase_ = 3; + return this; + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public Builder mergeScorecard(com.google.monitoring.dashboard.v1.Scorecard value) { + if (scorecardBuilder_ == null) { + if (contentCase_ == 3 + && content_ != com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance()) { + content_ = + com.google.monitoring.dashboard.v1.Scorecard.newBuilder( + (com.google.monitoring.dashboard.v1.Scorecard) content_) + .mergeFrom(value) + .buildPartial(); + } else { + content_ = value; + } + onChanged(); + } else { + if (contentCase_ == 3) { + scorecardBuilder_.mergeFrom(value); + } + scorecardBuilder_.setMessage(value); + } + contentCase_ = 3; + return this; + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public Builder clearScorecard() { + if (scorecardBuilder_ == null) { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + } else { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + } + scorecardBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public com.google.monitoring.dashboard.v1.Scorecard.Builder getScorecardBuilder() { + return getScorecardFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + public com.google.monitoring.dashboard.v1.ScorecardOrBuilder getScorecardOrBuilder() { + if ((contentCase_ == 3) && (scorecardBuilder_ != null)) { + return scorecardBuilder_.getMessageOrBuilder(); + } else { + if (contentCase_ == 3) { + return (com.google.monitoring.dashboard.v1.Scorecard) content_; + } + return com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } + } + /** + * + * + *
+     * A scorecard summarizing time series data.
+     * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard, + com.google.monitoring.dashboard.v1.Scorecard.Builder, + com.google.monitoring.dashboard.v1.ScorecardOrBuilder> + getScorecardFieldBuilder() { + if (scorecardBuilder_ == null) { + if (!(contentCase_ == 3)) { + content_ = com.google.monitoring.dashboard.v1.Scorecard.getDefaultInstance(); + } + scorecardBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Scorecard, + com.google.monitoring.dashboard.v1.Scorecard.Builder, + com.google.monitoring.dashboard.v1.ScorecardOrBuilder>( + (com.google.monitoring.dashboard.v1.Scorecard) content_, + getParentForChildren(), + isClean()); + content_ = null; + } + contentCase_ = 3; + onChanged(); + ; + return scorecardBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Text, + com.google.monitoring.dashboard.v1.Text.Builder, + com.google.monitoring.dashboard.v1.TextOrBuilder> + textBuilder_; + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return contentCase_ == 4; + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + * + * @return The text. + */ + public com.google.monitoring.dashboard.v1.Text getText() { + if (textBuilder_ == null) { + if (contentCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Text) content_; + } + return com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } else { + if (contentCase_ == 4) { + return textBuilder_.getMessage(); + } + return com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public Builder setText(com.google.monitoring.dashboard.v1.Text value) { + if (textBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + onChanged(); + } else { + textBuilder_.setMessage(value); + } + contentCase_ = 4; + return this; + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public Builder setText(com.google.monitoring.dashboard.v1.Text.Builder builderForValue) { + if (textBuilder_ == null) { + content_ = builderForValue.build(); + onChanged(); + } else { + textBuilder_.setMessage(builderForValue.build()); + } + contentCase_ = 4; + return this; + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public Builder mergeText(com.google.monitoring.dashboard.v1.Text value) { + if (textBuilder_ == null) { + if (contentCase_ == 4 + && content_ != com.google.monitoring.dashboard.v1.Text.getDefaultInstance()) { + content_ = + com.google.monitoring.dashboard.v1.Text.newBuilder( + (com.google.monitoring.dashboard.v1.Text) content_) + .mergeFrom(value) + .buildPartial(); + } else { + content_ = value; + } + onChanged(); + } else { + if (contentCase_ == 4) { + textBuilder_.mergeFrom(value); + } + textBuilder_.setMessage(value); + } + contentCase_ = 4; + return this; + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public Builder clearText() { + if (textBuilder_ == null) { + if (contentCase_ == 4) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + } else { + if (contentCase_ == 4) { + contentCase_ = 0; + content_ = null; + } + textBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public com.google.monitoring.dashboard.v1.Text.Builder getTextBuilder() { + return getTextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + public com.google.monitoring.dashboard.v1.TextOrBuilder getTextOrBuilder() { + if ((contentCase_ == 4) && (textBuilder_ != null)) { + return textBuilder_.getMessageOrBuilder(); + } else { + if (contentCase_ == 4) { + return (com.google.monitoring.dashboard.v1.Text) content_; + } + return com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } + } + /** + * + * + *
+     * A raw string or markdown displaying textual content.
+     * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Text, + com.google.monitoring.dashboard.v1.Text.Builder, + com.google.monitoring.dashboard.v1.TextOrBuilder> + getTextFieldBuilder() { + if (textBuilder_ == null) { + if (!(contentCase_ == 4)) { + content_ = com.google.monitoring.dashboard.v1.Text.getDefaultInstance(); + } + textBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.Text, + com.google.monitoring.dashboard.v1.Text.Builder, + com.google.monitoring.dashboard.v1.TextOrBuilder>( + (com.google.monitoring.dashboard.v1.Text) content_, + getParentForChildren(), + isClean()); + content_ = null; + } + contentCase_ = 4; + onChanged(); + ; + return textBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Empty, + com.google.protobuf.Empty.Builder, + com.google.protobuf.EmptyOrBuilder> + blankBuilder_; + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + * + * @return Whether the blank field is set. + */ + public boolean hasBlank() { + return contentCase_ == 5; + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + * + * @return The blank. + */ + public com.google.protobuf.Empty getBlank() { + if (blankBuilder_ == null) { + if (contentCase_ == 5) { + return (com.google.protobuf.Empty) content_; + } + return com.google.protobuf.Empty.getDefaultInstance(); + } else { + if (contentCase_ == 5) { + return blankBuilder_.getMessage(); + } + return com.google.protobuf.Empty.getDefaultInstance(); + } + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public Builder setBlank(com.google.protobuf.Empty value) { + if (blankBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + onChanged(); + } else { + blankBuilder_.setMessage(value); + } + contentCase_ = 5; + return this; + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public Builder setBlank(com.google.protobuf.Empty.Builder builderForValue) { + if (blankBuilder_ == null) { + content_ = builderForValue.build(); + onChanged(); + } else { + blankBuilder_.setMessage(builderForValue.build()); + } + contentCase_ = 5; + return this; + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public Builder mergeBlank(com.google.protobuf.Empty value) { + if (blankBuilder_ == null) { + if (contentCase_ == 5 && content_ != com.google.protobuf.Empty.getDefaultInstance()) { + content_ = + com.google.protobuf.Empty.newBuilder((com.google.protobuf.Empty) content_) + .mergeFrom(value) + .buildPartial(); + } else { + content_ = value; + } + onChanged(); + } else { + if (contentCase_ == 5) { + blankBuilder_.mergeFrom(value); + } + blankBuilder_.setMessage(value); + } + contentCase_ = 5; + return this; + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public Builder clearBlank() { + if (blankBuilder_ == null) { + if (contentCase_ == 5) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + } else { + if (contentCase_ == 5) { + contentCase_ = 0; + content_ = null; + } + blankBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public com.google.protobuf.Empty.Builder getBlankBuilder() { + return getBlankFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + public com.google.protobuf.EmptyOrBuilder getBlankOrBuilder() { + if ((contentCase_ == 5) && (blankBuilder_ != null)) { + return blankBuilder_.getMessageOrBuilder(); + } else { + if (contentCase_ == 5) { + return (com.google.protobuf.Empty) content_; + } + return com.google.protobuf.Empty.getDefaultInstance(); + } + } + /** + * + * + *
+     * A blank space.
+     * 
+ * + * .google.protobuf.Empty blank = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Empty, + com.google.protobuf.Empty.Builder, + com.google.protobuf.EmptyOrBuilder> + getBlankFieldBuilder() { + if (blankBuilder_ == null) { + if (!(contentCase_ == 5)) { + content_ = com.google.protobuf.Empty.getDefaultInstance(); + } + blankBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Empty, + com.google.protobuf.Empty.Builder, + com.google.protobuf.EmptyOrBuilder>( + (com.google.protobuf.Empty) content_, getParentForChildren(), isClean()); + content_ = null; + } + contentCase_ = 5; + onChanged(); + ; + return blankBuilder_; + } + + @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.monitoring.dashboard.v1.Widget) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.Widget) + private static final com.google.monitoring.dashboard.v1.Widget DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.Widget(); + } + + public static com.google.monitoring.dashboard.v1.Widget getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Widget parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Widget(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.Widget getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetOrBuilder.java new file mode 100644 index 00000000..00c4de70 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetOrBuilder.java @@ -0,0 +1,192 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/widget.proto + +package com.google.monitoring.dashboard.v1; + +public interface WidgetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.Widget) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The title of the widget.
+   * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Optional. The title of the widget.
+   * 
+ * + * string title = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * A chart of time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + * + * @return Whether the xyChart field is set. + */ + boolean hasXyChart(); + /** + * + * + *
+   * A chart of time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + * + * @return The xyChart. + */ + com.google.monitoring.dashboard.v1.XyChart getXyChart(); + /** + * + * + *
+   * A chart of time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart xy_chart = 2; + */ + com.google.monitoring.dashboard.v1.XyChartOrBuilder getXyChartOrBuilder(); + + /** + * + * + *
+   * A scorecard summarizing time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + * + * @return Whether the scorecard field is set. + */ + boolean hasScorecard(); + /** + * + * + *
+   * A scorecard summarizing time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + * + * @return The scorecard. + */ + com.google.monitoring.dashboard.v1.Scorecard getScorecard(); + /** + * + * + *
+   * A scorecard summarizing time series data.
+   * 
+ * + * .google.monitoring.dashboard.v1.Scorecard scorecard = 3; + */ + com.google.monitoring.dashboard.v1.ScorecardOrBuilder getScorecardOrBuilder(); + + /** + * + * + *
+   * A raw string or markdown displaying textual content.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + * + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * + * + *
+   * A raw string or markdown displaying textual content.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + * + * @return The text. + */ + com.google.monitoring.dashboard.v1.Text getText(); + /** + * + * + *
+   * A raw string or markdown displaying textual content.
+   * 
+ * + * .google.monitoring.dashboard.v1.Text text = 4; + */ + com.google.monitoring.dashboard.v1.TextOrBuilder getTextOrBuilder(); + + /** + * + * + *
+   * A blank space.
+   * 
+ * + * .google.protobuf.Empty blank = 5; + * + * @return Whether the blank field is set. + */ + boolean hasBlank(); + /** + * + * + *
+   * A blank space.
+   * 
+ * + * .google.protobuf.Empty blank = 5; + * + * @return The blank. + */ + com.google.protobuf.Empty getBlank(); + /** + * + * + *
+   * A blank space.
+   * 
+ * + * .google.protobuf.Empty blank = 5; + */ + com.google.protobuf.EmptyOrBuilder getBlankOrBuilder(); + + public com.google.monitoring.dashboard.v1.Widget.ContentCase getContentCase(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetProto.java new file mode 100644 index 00000000..19ec91ef --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetProto.java @@ -0,0 +1,92 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/widget.proto + +package com.google.monitoring.dashboard.v1; + +public final class WidgetProto { + private WidgetProto() {} + + 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_monitoring_dashboard_v1_Widget_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_Widget_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/monitoring/dashboard/v1/widget." + + "proto\022\036google.monitoring.dashboard.v1\032\037g" + + "oogle/api/field_behavior.proto\032.google/m" + + "onitoring/dashboard/v1/scorecard.proto\032)" + + "google/monitoring/dashboard/v1/text.prot" + + "o\032,google/monitoring/dashboard/v1/xychar" + + "t.proto\032\033google/protobuf/empty.proto\"\203\002\n" + + "\006Widget\022\022\n\005title\030\001 \001(\tB\003\340A\001\022;\n\010xy_chart\030" + + "\002 \001(\0132\'.google.monitoring.dashboard.v1.X" + + "yChartH\000\022>\n\tscorecard\030\003 \001(\0132).google.mon" + + "itoring.dashboard.v1.ScorecardH\000\0224\n\004text" + + "\030\004 \001(\0132$.google.monitoring.dashboard.v1." + + "TextH\000\022\'\n\005blank\030\005 \001(\0132\026.google.protobuf." + + "EmptyH\000B\t\n\007contentB|\n\"com.google.monitor" + + "ing.dashboard.v1B\013WidgetProtoP\001ZGgoogle." + + "golang.org/genproto/googleapis/monitorin" + + "g/dashboard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.monitoring.dashboard.v1.ScorecardProto.getDescriptor(), + com.google.monitoring.dashboard.v1.TextProto.getDescriptor(), + com.google.monitoring.dashboard.v1.XyChartProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_Widget_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_Widget_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_Widget_descriptor, + new java.lang.String[] { + "Title", "XyChart", "Scorecard", "Text", "Blank", "Content", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.monitoring.dashboard.v1.ScorecardProto.getDescriptor(); + com.google.monitoring.dashboard.v1.TextProto.getDescriptor(); + com.google.monitoring.dashboard.v1.XyChartProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChart.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChart.java new file mode 100644 index 00000000..38f9ae04 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChart.java @@ -0,0 +1,5358 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/xychart.proto + +package com.google.monitoring.dashboard.v1; + +/** + * + * + *
+ * A chart that displays data on a 2D (X and Y axes) plane.
+ * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.XyChart} + */ +public final class XyChart extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.XyChart) + XyChartOrBuilder { + private static final long serialVersionUID = 0L; + // Use XyChart.newBuilder() to construct. + private XyChart(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private XyChart() { + dataSets_ = java.util.Collections.emptyList(); + thresholds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new XyChart(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private XyChart( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + dataSets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + dataSets_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.XyChart.DataSet.parser(), + extensionRegistry)); + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeshiftDuration_ != null) { + subBuilder = timeshiftDuration_.toBuilder(); + } + timeshiftDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeshiftDuration_); + timeshiftDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + thresholds_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + thresholds_.add( + input.readMessage( + com.google.monitoring.dashboard.v1.Threshold.parser(), extensionRegistry)); + break; + } + case 50: + { + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder subBuilder = null; + if (xAxis_ != null) { + subBuilder = xAxis_.toBuilder(); + } + xAxis_ = + input.readMessage( + com.google.monitoring.dashboard.v1.XyChart.Axis.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(xAxis_); + xAxis_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder subBuilder = null; + if (yAxis_ != null) { + subBuilder = yAxis_.toBuilder(); + } + yAxis_ = + input.readMessage( + com.google.monitoring.dashboard.v1.XyChart.Axis.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(yAxis_); + yAxis_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.monitoring.dashboard.v1.ChartOptions.Builder subBuilder = null; + if (chartOptions_ != null) { + subBuilder = chartOptions_.toBuilder(); + } + chartOptions_ = + input.readMessage( + com.google.monitoring.dashboard.v1.ChartOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(chartOptions_); + chartOptions_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + dataSets_ = java.util.Collections.unmodifiableList(dataSets_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + thresholds_ = java.util.Collections.unmodifiableList(thresholds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.XyChart.class, + com.google.monitoring.dashboard.v1.XyChart.Builder.class); + } + + public interface DataSetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.XyChart.DataSet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return Whether the timeSeriesQuery field is set. + */ + boolean hasTimeSeriesQuery(); + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return The timeSeriesQuery. + */ + com.google.monitoring.dashboard.v1.TimeSeriesQuery getTimeSeriesQuery(); + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder getTimeSeriesQueryOrBuilder(); + + /** + * + * + *
+     * How this data should be plotted on the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return The enum numeric value on the wire for plotType. + */ + int getPlotTypeValue(); + /** + * + * + *
+     * How this data should be plotted on the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return The plotType. + */ + com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType getPlotType(); + + /** + * + * + *
+     * A template string for naming `TimeSeries` in the resulting data set.
+     * This should be a string with interpolations of the form ${label_name},
+     * which will resolve to the label's value.
+     * 
+ * + * string legend_template = 3; + * + * @return The legendTemplate. + */ + java.lang.String getLegendTemplate(); + /** + * + * + *
+     * A template string for naming `TimeSeries` in the resulting data set.
+     * This should be a string with interpolations of the form ${label_name},
+     * which will resolve to the label's value.
+     * 
+ * + * string legend_template = 3; + * + * @return The bytes for legendTemplate. + */ + com.google.protobuf.ByteString getLegendTemplateBytes(); + + /** + * + * + *
+     * Optional. The lower bound on data point frequency for this data set, implemented by
+     * specifying the minimum alignment period to use in a time series query
+     * For example, if the data is published once every 10 minutes, the
+     * `min_alignment_period` should be at least 10 minutes. It would not
+     * make sense to fetch and align data at one minute intervals.
+     * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the minAlignmentPeriod field is set. + */ + boolean hasMinAlignmentPeriod(); + /** + * + * + *
+     * Optional. The lower bound on data point frequency for this data set, implemented by
+     * specifying the minimum alignment period to use in a time series query
+     * For example, if the data is published once every 10 minutes, the
+     * `min_alignment_period` should be at least 10 minutes. It would not
+     * make sense to fetch and align data at one minute intervals.
+     * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The minAlignmentPeriod. + */ + com.google.protobuf.Duration getMinAlignmentPeriod(); + /** + * + * + *
+     * Optional. The lower bound on data point frequency for this data set, implemented by
+     * specifying the minimum alignment period to use in a time series query
+     * For example, if the data is published once every 10 minutes, the
+     * `min_alignment_period` should be at least 10 minutes. It would not
+     * make sense to fetch and align data at one minute intervals.
+     * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getMinAlignmentPeriodOrBuilder(); + } + /** + * + * + *
+   * Groups a time series query definition with charting options.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.XyChart.DataSet} + */ + public static final class DataSet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.XyChart.DataSet) + DataSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataSet.newBuilder() to construct. + private DataSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataSet() { + plotType_ = 0; + legendTemplate_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DataSet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder subBuilder = null; + if (timeSeriesQuery_ != null) { + subBuilder = timeSeriesQuery_.toBuilder(); + } + timeSeriesQuery_ = + input.readMessage( + com.google.monitoring.dashboard.v1.TimeSeriesQuery.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeSeriesQuery_); + timeSeriesQuery_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + plotType_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + legendTemplate_ = s; + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (minAlignmentPeriod_ != null) { + subBuilder = minAlignmentPeriod_.toBuilder(); + } + minAlignmentPeriod_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(minAlignmentPeriod_); + minAlignmentPeriod_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.XyChart.DataSet.class, + com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder.class); + } + + /** + * + * + *
+     * The types of plotting strategies for data sets.
+     * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.XyChart.DataSet.PlotType} + */ + public enum PlotType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Plot type is unspecified. The view will default to `LINE`.
+       * 
+ * + * PLOT_TYPE_UNSPECIFIED = 0; + */ + PLOT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * The data is plotted as a set of lines (one line per series).
+       * 
+ * + * LINE = 1; + */ + LINE(1), + /** + * + * + *
+       * The data is plotted as a set of filled areas (one area per series),
+       * with the areas stacked vertically (the base of each area is the top of
+       * its predecessor, and the base of the first area is the X axis). Since
+       * the areas do not overlap, each is filled with a different opaque color.
+       * 
+ * + * STACKED_AREA = 2; + */ + STACKED_AREA(2), + /** + * + * + *
+       * The data is plotted as a set of rectangular boxes (one box per series),
+       * with the boxes stacked vertically (the base of each box is the top of
+       * its predecessor, and the base of the first box is the X axis). Since
+       * the boxes do not overlap, each is filled with a different opaque color.
+       * 
+ * + * STACKED_BAR = 3; + */ + STACKED_BAR(3), + /** + * + * + *
+       * The data is plotted as a heatmap. The series being plotted must have a
+       * `DISTRIBUTION` value type. The value of each bucket in the distribution
+       * is displayed as a color. This type is not currently available in the
+       * Stackdriver Monitoring application.
+       * 
+ * + * HEATMAP = 4; + */ + HEATMAP(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Plot type is unspecified. The view will default to `LINE`.
+       * 
+ * + * PLOT_TYPE_UNSPECIFIED = 0; + */ + public static final int PLOT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The data is plotted as a set of lines (one line per series).
+       * 
+ * + * LINE = 1; + */ + public static final int LINE_VALUE = 1; + /** + * + * + *
+       * The data is plotted as a set of filled areas (one area per series),
+       * with the areas stacked vertically (the base of each area is the top of
+       * its predecessor, and the base of the first area is the X axis). Since
+       * the areas do not overlap, each is filled with a different opaque color.
+       * 
+ * + * STACKED_AREA = 2; + */ + public static final int STACKED_AREA_VALUE = 2; + /** + * + * + *
+       * The data is plotted as a set of rectangular boxes (one box per series),
+       * with the boxes stacked vertically (the base of each box is the top of
+       * its predecessor, and the base of the first box is the X axis). Since
+       * the boxes do not overlap, each is filled with a different opaque color.
+       * 
+ * + * STACKED_BAR = 3; + */ + public static final int STACKED_BAR_VALUE = 3; + /** + * + * + *
+       * The data is plotted as a heatmap. The series being plotted must have a
+       * `DISTRIBUTION` value type. The value of each bucket in the distribution
+       * is displayed as a color. This type is not currently available in the
+       * Stackdriver Monitoring application.
+       * 
+ * + * HEATMAP = 4; + */ + public static final int HEATMAP_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PlotType 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 PlotType forNumber(int value) { + switch (value) { + case 0: + return PLOT_TYPE_UNSPECIFIED; + case 1: + return LINE; + case 2: + return STACKED_AREA; + case 3: + return STACKED_BAR; + case 4: + return HEATMAP; + 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 PlotType findValueByNumber(int number) { + return PlotType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChart.DataSet.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final PlotType[] VALUES = values(); + + public static PlotType 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 PlotType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.XyChart.DataSet.PlotType) + } + + public static final int TIME_SERIES_QUERY_FIELD_NUMBER = 1; + private com.google.monitoring.dashboard.v1.TimeSeriesQuery timeSeriesQuery_; + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return Whether the timeSeriesQuery field is set. + */ + public boolean hasTimeSeriesQuery() { + return timeSeriesQuery_ != null; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return The timeSeriesQuery. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQuery getTimeSeriesQuery() { + return timeSeriesQuery_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance() + : timeSeriesQuery_; + } + /** + * + * + *
+     * Fields for querying time series data from the
+     * Stackdriver metrics API.
+     * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder + getTimeSeriesQueryOrBuilder() { + return getTimeSeriesQuery(); + } + + public static final int PLOT_TYPE_FIELD_NUMBER = 2; + private int plotType_; + /** + * + * + *
+     * How this data should be plotted on the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return The enum numeric value on the wire for plotType. + */ + public int getPlotTypeValue() { + return plotType_; + } + /** + * + * + *
+     * How this data should be plotted on the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return The plotType. + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType getPlotType() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType result = + com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType.valueOf(plotType_); + return result == null + ? com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType.UNRECOGNIZED + : result; + } + + public static final int LEGEND_TEMPLATE_FIELD_NUMBER = 3; + private volatile java.lang.Object legendTemplate_; + /** + * + * + *
+     * A template string for naming `TimeSeries` in the resulting data set.
+     * This should be a string with interpolations of the form ${label_name},
+     * which will resolve to the label's value.
+     * 
+ * + * string legend_template = 3; + * + * @return The legendTemplate. + */ + public java.lang.String getLegendTemplate() { + java.lang.Object ref = legendTemplate_; + 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(); + legendTemplate_ = s; + return s; + } + } + /** + * + * + *
+     * A template string for naming `TimeSeries` in the resulting data set.
+     * This should be a string with interpolations of the form ${label_name},
+     * which will resolve to the label's value.
+     * 
+ * + * string legend_template = 3; + * + * @return The bytes for legendTemplate. + */ + public com.google.protobuf.ByteString getLegendTemplateBytes() { + java.lang.Object ref = legendTemplate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + legendTemplate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MIN_ALIGNMENT_PERIOD_FIELD_NUMBER = 4; + private com.google.protobuf.Duration minAlignmentPeriod_; + /** + * + * + *
+     * Optional. The lower bound on data point frequency for this data set, implemented by
+     * specifying the minimum alignment period to use in a time series query
+     * For example, if the data is published once every 10 minutes, the
+     * `min_alignment_period` should be at least 10 minutes. It would not
+     * make sense to fetch and align data at one minute intervals.
+     * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the minAlignmentPeriod field is set. + */ + public boolean hasMinAlignmentPeriod() { + return minAlignmentPeriod_ != null; + } + /** + * + * + *
+     * Optional. The lower bound on data point frequency for this data set, implemented by
+     * specifying the minimum alignment period to use in a time series query
+     * For example, if the data is published once every 10 minutes, the
+     * `min_alignment_period` should be at least 10 minutes. It would not
+     * make sense to fetch and align data at one minute intervals.
+     * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The minAlignmentPeriod. + */ + public com.google.protobuf.Duration getMinAlignmentPeriod() { + return minAlignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minAlignmentPeriod_; + } + /** + * + * + *
+     * Optional. The lower bound on data point frequency for this data set, implemented by
+     * specifying the minimum alignment period to use in a time series query
+     * For example, if the data is published once every 10 minutes, the
+     * `min_alignment_period` should be at least 10 minutes. It would not
+     * make sense to fetch and align data at one minute intervals.
+     * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getMinAlignmentPeriodOrBuilder() { + return getMinAlignmentPeriod(); + } + + 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 (timeSeriesQuery_ != null) { + output.writeMessage(1, getTimeSeriesQuery()); + } + if (plotType_ + != com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType.PLOT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, plotType_); + } + if (!getLegendTemplateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, legendTemplate_); + } + if (minAlignmentPeriod_ != null) { + output.writeMessage(4, getMinAlignmentPeriod()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timeSeriesQuery_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTimeSeriesQuery()); + } + if (plotType_ + != com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType.PLOT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, plotType_); + } + if (!getLegendTemplateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, legendTemplate_); + } + if (minAlignmentPeriod_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMinAlignmentPeriod()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.XyChart.DataSet)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.XyChart.DataSet other = + (com.google.monitoring.dashboard.v1.XyChart.DataSet) obj; + + if (hasTimeSeriesQuery() != other.hasTimeSeriesQuery()) return false; + if (hasTimeSeriesQuery()) { + if (!getTimeSeriesQuery().equals(other.getTimeSeriesQuery())) return false; + } + if (plotType_ != other.plotType_) return false; + if (!getLegendTemplate().equals(other.getLegendTemplate())) return false; + if (hasMinAlignmentPeriod() != other.hasMinAlignmentPeriod()) return false; + if (hasMinAlignmentPeriod()) { + if (!getMinAlignmentPeriod().equals(other.getMinAlignmentPeriod())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTimeSeriesQuery()) { + hash = (37 * hash) + TIME_SERIES_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getTimeSeriesQuery().hashCode(); + } + hash = (37 * hash) + PLOT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + plotType_; + hash = (37 * hash) + LEGEND_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getLegendTemplate().hashCode(); + if (hasMinAlignmentPeriod()) { + hash = (37 * hash) + MIN_ALIGNMENT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getMinAlignmentPeriod().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet 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.monitoring.dashboard.v1.XyChart.DataSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet 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.monitoring.dashboard.v1.XyChart.DataSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet 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.monitoring.dashboard.v1.XyChart.DataSet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet 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.monitoring.dashboard.v1.XyChart.DataSet 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; + } + /** + * + * + *
+     * Groups a time series query definition with charting options.
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.XyChart.DataSet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.XyChart.DataSet) + com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.XyChart.DataSet.class, + com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.XyChart.DataSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQuery_ = null; + } else { + timeSeriesQuery_ = null; + timeSeriesQueryBuilder_ = null; + } + plotType_ = 0; + + legendTemplate_ = ""; + + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriod_ = null; + } else { + minAlignmentPeriod_ = null; + minAlignmentPeriodBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.DataSet getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.XyChart.DataSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.DataSet build() { + com.google.monitoring.dashboard.v1.XyChart.DataSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.DataSet buildPartial() { + com.google.monitoring.dashboard.v1.XyChart.DataSet result = + new com.google.monitoring.dashboard.v1.XyChart.DataSet(this); + if (timeSeriesQueryBuilder_ == null) { + result.timeSeriesQuery_ = timeSeriesQuery_; + } else { + result.timeSeriesQuery_ = timeSeriesQueryBuilder_.build(); + } + result.plotType_ = plotType_; + result.legendTemplate_ = legendTemplate_; + if (minAlignmentPeriodBuilder_ == null) { + result.minAlignmentPeriod_ = minAlignmentPeriod_; + } else { + result.minAlignmentPeriod_ = minAlignmentPeriodBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.XyChart.DataSet) { + return mergeFrom((com.google.monitoring.dashboard.v1.XyChart.DataSet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.XyChart.DataSet other) { + if (other == com.google.monitoring.dashboard.v1.XyChart.DataSet.getDefaultInstance()) + return this; + if (other.hasTimeSeriesQuery()) { + mergeTimeSeriesQuery(other.getTimeSeriesQuery()); + } + if (other.plotType_ != 0) { + setPlotTypeValue(other.getPlotTypeValue()); + } + if (!other.getLegendTemplate().isEmpty()) { + legendTemplate_ = other.legendTemplate_; + onChanged(); + } + if (other.hasMinAlignmentPeriod()) { + mergeMinAlignmentPeriod(other.getMinAlignmentPeriod()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.XyChart.DataSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.XyChart.DataSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.monitoring.dashboard.v1.TimeSeriesQuery timeSeriesQuery_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesQuery, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder> + timeSeriesQueryBuilder_; + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return Whether the timeSeriesQuery field is set. + */ + public boolean hasTimeSeriesQuery() { + return timeSeriesQueryBuilder_ != null || timeSeriesQuery_ != null; + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + * + * @return The timeSeriesQuery. + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQuery getTimeSeriesQuery() { + if (timeSeriesQueryBuilder_ == null) { + return timeSeriesQuery_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance() + : timeSeriesQuery_; + } else { + return timeSeriesQueryBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder setTimeSeriesQuery(com.google.monitoring.dashboard.v1.TimeSeriesQuery value) { + if (timeSeriesQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeSeriesQuery_ = value; + onChanged(); + } else { + timeSeriesQueryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder setTimeSeriesQuery( + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder builderForValue) { + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQuery_ = builderForValue.build(); + onChanged(); + } else { + timeSeriesQueryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder mergeTimeSeriesQuery( + com.google.monitoring.dashboard.v1.TimeSeriesQuery value) { + if (timeSeriesQueryBuilder_ == null) { + if (timeSeriesQuery_ != null) { + timeSeriesQuery_ = + com.google.monitoring.dashboard.v1.TimeSeriesQuery.newBuilder(timeSeriesQuery_) + .mergeFrom(value) + .buildPartial(); + } else { + timeSeriesQuery_ = value; + } + onChanged(); + } else { + timeSeriesQueryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public Builder clearTimeSeriesQuery() { + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQuery_ = null; + onChanged(); + } else { + timeSeriesQuery_ = null; + timeSeriesQueryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder + getTimeSeriesQueryBuilder() { + + onChanged(); + return getTimeSeriesQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + public com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder + getTimeSeriesQueryOrBuilder() { + if (timeSeriesQueryBuilder_ != null) { + return timeSeriesQueryBuilder_.getMessageOrBuilder(); + } else { + return timeSeriesQuery_ == null + ? com.google.monitoring.dashboard.v1.TimeSeriesQuery.getDefaultInstance() + : timeSeriesQuery_; + } + } + /** + * + * + *
+       * Fields for querying time series data from the
+       * Stackdriver metrics API.
+       * 
+ * + * .google.monitoring.dashboard.v1.TimeSeriesQuery time_series_query = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesQuery, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder> + getTimeSeriesQueryFieldBuilder() { + if (timeSeriesQueryBuilder_ == null) { + timeSeriesQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.TimeSeriesQuery, + com.google.monitoring.dashboard.v1.TimeSeriesQuery.Builder, + com.google.monitoring.dashboard.v1.TimeSeriesQueryOrBuilder>( + getTimeSeriesQuery(), getParentForChildren(), isClean()); + timeSeriesQuery_ = null; + } + return timeSeriesQueryBuilder_; + } + + private int plotType_ = 0; + /** + * + * + *
+       * How this data should be plotted on the chart.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return The enum numeric value on the wire for plotType. + */ + public int getPlotTypeValue() { + return plotType_; + } + /** + * + * + *
+       * How this data should be plotted on the chart.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @param value The enum numeric value on the wire for plotType to set. + * @return This builder for chaining. + */ + public Builder setPlotTypeValue(int value) { + plotType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * How this data should be plotted on the chart.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return The plotType. + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType getPlotType() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType result = + com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType.valueOf(plotType_); + return result == null + ? com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * How this data should be plotted on the chart.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @param value The plotType to set. + * @return This builder for chaining. + */ + public Builder setPlotType( + com.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType value) { + if (value == null) { + throw new NullPointerException(); + } + + plotType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * How this data should be plotted on the chart.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.DataSet.PlotType plot_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearPlotType() { + + plotType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object legendTemplate_ = ""; + /** + * + * + *
+       * A template string for naming `TimeSeries` in the resulting data set.
+       * This should be a string with interpolations of the form ${label_name},
+       * which will resolve to the label's value.
+       * 
+ * + * string legend_template = 3; + * + * @return The legendTemplate. + */ + public java.lang.String getLegendTemplate() { + java.lang.Object ref = legendTemplate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + legendTemplate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A template string for naming `TimeSeries` in the resulting data set.
+       * This should be a string with interpolations of the form ${label_name},
+       * which will resolve to the label's value.
+       * 
+ * + * string legend_template = 3; + * + * @return The bytes for legendTemplate. + */ + public com.google.protobuf.ByteString getLegendTemplateBytes() { + java.lang.Object ref = legendTemplate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + legendTemplate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A template string for naming `TimeSeries` in the resulting data set.
+       * This should be a string with interpolations of the form ${label_name},
+       * which will resolve to the label's value.
+       * 
+ * + * string legend_template = 3; + * + * @param value The legendTemplate to set. + * @return This builder for chaining. + */ + public Builder setLegendTemplate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + legendTemplate_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * A template string for naming `TimeSeries` in the resulting data set.
+       * This should be a string with interpolations of the form ${label_name},
+       * which will resolve to the label's value.
+       * 
+ * + * string legend_template = 3; + * + * @return This builder for chaining. + */ + public Builder clearLegendTemplate() { + + legendTemplate_ = getDefaultInstance().getLegendTemplate(); + onChanged(); + return this; + } + /** + * + * + *
+       * A template string for naming `TimeSeries` in the resulting data set.
+       * This should be a string with interpolations of the form ${label_name},
+       * which will resolve to the label's value.
+       * 
+ * + * string legend_template = 3; + * + * @param value The bytes for legendTemplate to set. + * @return This builder for chaining. + */ + public Builder setLegendTemplateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + legendTemplate_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Duration minAlignmentPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + minAlignmentPeriodBuilder_; + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the minAlignmentPeriod field is set. + */ + public boolean hasMinAlignmentPeriod() { + return minAlignmentPeriodBuilder_ != null || minAlignmentPeriod_ != null; + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The minAlignmentPeriod. + */ + public com.google.protobuf.Duration getMinAlignmentPeriod() { + if (minAlignmentPeriodBuilder_ == null) { + return minAlignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minAlignmentPeriod_; + } else { + return minAlignmentPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMinAlignmentPeriod(com.google.protobuf.Duration value) { + if (minAlignmentPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minAlignmentPeriod_ = value; + onChanged(); + } else { + minAlignmentPeriodBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMinAlignmentPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriod_ = builderForValue.build(); + onChanged(); + } else { + minAlignmentPeriodBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMinAlignmentPeriod(com.google.protobuf.Duration value) { + if (minAlignmentPeriodBuilder_ == null) { + if (minAlignmentPeriod_ != null) { + minAlignmentPeriod_ = + com.google.protobuf.Duration.newBuilder(minAlignmentPeriod_) + .mergeFrom(value) + .buildPartial(); + } else { + minAlignmentPeriod_ = value; + } + onChanged(); + } else { + minAlignmentPeriodBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMinAlignmentPeriod() { + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriod_ = null; + onChanged(); + } else { + minAlignmentPeriod_ = null; + minAlignmentPeriodBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getMinAlignmentPeriodBuilder() { + + onChanged(); + return getMinAlignmentPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getMinAlignmentPeriodOrBuilder() { + if (minAlignmentPeriodBuilder_ != null) { + return minAlignmentPeriodBuilder_.getMessageOrBuilder(); + } else { + return minAlignmentPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minAlignmentPeriod_; + } + } + /** + * + * + *
+       * Optional. The lower bound on data point frequency for this data set, implemented by
+       * specifying the minimum alignment period to use in a time series query
+       * For example, if the data is published once every 10 minutes, the
+       * `min_alignment_period` should be at least 10 minutes. It would not
+       * make sense to fetch and align data at one minute intervals.
+       * 
+ * + * + * .google.protobuf.Duration min_alignment_period = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMinAlignmentPeriodFieldBuilder() { + if (minAlignmentPeriodBuilder_ == null) { + minAlignmentPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMinAlignmentPeriod(), getParentForChildren(), isClean()); + minAlignmentPeriod_ = null; + } + return minAlignmentPeriodBuilder_; + } + + @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.monitoring.dashboard.v1.XyChart.DataSet) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.XyChart.DataSet) + private static final com.google.monitoring.dashboard.v1.XyChart.DataSet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.XyChart.DataSet(); + } + + public static com.google.monitoring.dashboard.v1.XyChart.DataSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DataSet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.DataSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AxisOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.XyChart.Axis) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The label of the axis.
+     * 
+ * + * string label = 1; + * + * @return The label. + */ + java.lang.String getLabel(); + /** + * + * + *
+     * The label of the axis.
+     * 
+ * + * string label = 1; + * + * @return The bytes for label. + */ + com.google.protobuf.ByteString getLabelBytes(); + + /** + * + * + *
+     * The axis scale. By default, a linear scale is used.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return The enum numeric value on the wire for scale. + */ + int getScaleValue(); + /** + * + * + *
+     * The axis scale. By default, a linear scale is used.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return The scale. + */ + com.google.monitoring.dashboard.v1.XyChart.Axis.Scale getScale(); + } + /** + * + * + *
+   * A chart axis.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.XyChart.Axis} + */ + public static final class Axis extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.dashboard.v1.XyChart.Axis) + AxisOrBuilder { + private static final long serialVersionUID = 0L; + // Use Axis.newBuilder() to construct. + private Axis(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Axis() { + label_ = ""; + scale_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Axis(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Axis( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + scale_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_Axis_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_Axis_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.XyChart.Axis.class, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder.class); + } + + /** + * + * + *
+     * Types of scales used in axes.
+     * 
+ * + * Protobuf enum {@code google.monitoring.dashboard.v1.XyChart.Axis.Scale} + */ + public enum Scale implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Scale is unspecified. The view will default to `LINEAR`.
+       * 
+ * + * SCALE_UNSPECIFIED = 0; + */ + SCALE_UNSPECIFIED(0), + /** + * + * + *
+       * Linear scale.
+       * 
+ * + * LINEAR = 1; + */ + LINEAR(1), + /** + * + * + *
+       * Logarithmic scale (base 10).
+       * 
+ * + * LOG10 = 2; + */ + LOG10(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Scale is unspecified. The view will default to `LINEAR`.
+       * 
+ * + * SCALE_UNSPECIFIED = 0; + */ + public static final int SCALE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Linear scale.
+       * 
+ * + * LINEAR = 1; + */ + public static final int LINEAR_VALUE = 1; + /** + * + * + *
+       * Logarithmic scale (base 10).
+       * 
+ * + * LOG10 = 2; + */ + public static final int LOG10_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 Scale 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 Scale forNumber(int value) { + switch (value) { + case 0: + return SCALE_UNSPECIFIED; + case 1: + return LINEAR; + case 2: + return LOG10; + 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 Scale findValueByNumber(int number) { + return Scale.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChart.Axis.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Scale[] VALUES = values(); + + public static Scale 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 Scale(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.dashboard.v1.XyChart.Axis.Scale) + } + + public static final int LABEL_FIELD_NUMBER = 1; + private volatile java.lang.Object label_; + /** + * + * + *
+     * The label of the axis.
+     * 
+ * + * string label = 1; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + * + * + *
+     * The label of the axis.
+     * 
+ * + * string label = 1; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCALE_FIELD_NUMBER = 2; + private int scale_; + /** + * + * + *
+     * The axis scale. By default, a linear scale is used.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return The enum numeric value on the wire for scale. + */ + public int getScaleValue() { + return scale_; + } + /** + * + * + *
+     * The axis scale. By default, a linear scale is used.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return The scale. + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis.Scale getScale() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.XyChart.Axis.Scale result = + com.google.monitoring.dashboard.v1.XyChart.Axis.Scale.valueOf(scale_); + return result == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.Scale.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 (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, label_); + } + if (scale_ + != com.google.monitoring.dashboard.v1.XyChart.Axis.Scale.SCALE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, scale_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, label_); + } + if (scale_ + != com.google.monitoring.dashboard.v1.XyChart.Axis.Scale.SCALE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, scale_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.XyChart.Axis)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.XyChart.Axis other = + (com.google.monitoring.dashboard.v1.XyChart.Axis) obj; + + if (!getLabel().equals(other.getLabel())) return false; + if (scale_ != other.scale_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + SCALE_FIELD_NUMBER; + hash = (53 * hash) + scale_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis 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.monitoring.dashboard.v1.XyChart.Axis parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis 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.monitoring.dashboard.v1.XyChart.Axis parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis 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.monitoring.dashboard.v1.XyChart.Axis parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis 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.monitoring.dashboard.v1.XyChart.Axis 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; + } + /** + * + * + *
+     * A chart axis.
+     * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.XyChart.Axis} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.XyChart.Axis) + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_Axis_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_Axis_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.XyChart.Axis.class, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.XyChart.Axis.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + label_ = ""; + + scale_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_Axis_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.Axis getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.Axis build() { + com.google.monitoring.dashboard.v1.XyChart.Axis result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.Axis buildPartial() { + com.google.monitoring.dashboard.v1.XyChart.Axis result = + new com.google.monitoring.dashboard.v1.XyChart.Axis(this); + result.label_ = label_; + result.scale_ = scale_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.XyChart.Axis) { + return mergeFrom((com.google.monitoring.dashboard.v1.XyChart.Axis) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.XyChart.Axis other) { + if (other == com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance()) + return this; + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (other.scale_ != 0) { + setScaleValue(other.getScaleValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.XyChart.Axis parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.monitoring.dashboard.v1.XyChart.Axis) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object label_ = ""; + /** + * + * + *
+       * The label of the axis.
+       * 
+ * + * string label = 1; + * + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The label of the axis.
+       * 
+ * + * string label = 1; + * + * @return The bytes for label. + */ + public com.google.protobuf.ByteString getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The label of the axis.
+       * 
+ * + * string label = 1; + * + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The label of the axis.
+       * 
+ * + * string label = 1; + * + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + * + * + *
+       * The label of the axis.
+       * 
+ * + * string label = 1; + * + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private int scale_ = 0; + /** + * + * + *
+       * The axis scale. By default, a linear scale is used.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return The enum numeric value on the wire for scale. + */ + public int getScaleValue() { + return scale_; + } + /** + * + * + *
+       * The axis scale. By default, a linear scale is used.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @param value The enum numeric value on the wire for scale to set. + * @return This builder for chaining. + */ + public Builder setScaleValue(int value) { + scale_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The axis scale. By default, a linear scale is used.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return The scale. + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis.Scale getScale() { + @SuppressWarnings("deprecation") + com.google.monitoring.dashboard.v1.XyChart.Axis.Scale result = + com.google.monitoring.dashboard.v1.XyChart.Axis.Scale.valueOf(scale_); + return result == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.Scale.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The axis scale. By default, a linear scale is used.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @param value The scale to set. + * @return This builder for chaining. + */ + public Builder setScale(com.google.monitoring.dashboard.v1.XyChart.Axis.Scale value) { + if (value == null) { + throw new NullPointerException(); + } + + scale_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The axis scale. By default, a linear scale is used.
+       * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis.Scale scale = 2; + * + * @return This builder for chaining. + */ + public Builder clearScale() { + + scale_ = 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.monitoring.dashboard.v1.XyChart.Axis) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.XyChart.Axis) + private static final com.google.monitoring.dashboard.v1.XyChart.Axis DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.XyChart.Axis(); + } + + public static com.google.monitoring.dashboard.v1.XyChart.Axis getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Axis parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Axis(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart.Axis getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DATA_SETS_FIELD_NUMBER = 1; + private java.util.List dataSets_; + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public java.util.List getDataSetsList() { + return dataSets_; + } + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public java.util.List + getDataSetsOrBuilderList() { + return dataSets_; + } + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public int getDataSetsCount() { + return dataSets_.size(); + } + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet getDataSets(int index) { + return dataSets_.get(index); + } + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder getDataSetsOrBuilder( + int index) { + return dataSets_.get(index); + } + + public static final int TIMESHIFT_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration timeshiftDuration_; + /** + * + * + *
+   * The duration used to display a comparison chart. A comparison chart
+   * simultaneously shows values from two similar-length time periods
+   * (e.g., week-over-week metrics).
+   * The duration must be positive, and it can only be applied to charts with
+   * data sets of LINE plot type.
+   * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + * + * @return Whether the timeshiftDuration field is set. + */ + public boolean hasTimeshiftDuration() { + return timeshiftDuration_ != null; + } + /** + * + * + *
+   * The duration used to display a comparison chart. A comparison chart
+   * simultaneously shows values from two similar-length time periods
+   * (e.g., week-over-week metrics).
+   * The duration must be positive, and it can only be applied to charts with
+   * data sets of LINE plot type.
+   * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + * + * @return The timeshiftDuration. + */ + public com.google.protobuf.Duration getTimeshiftDuration() { + return timeshiftDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : timeshiftDuration_; + } + /** + * + * + *
+   * The duration used to display a comparison chart. A comparison chart
+   * simultaneously shows values from two similar-length time periods
+   * (e.g., week-over-week metrics).
+   * The duration must be positive, and it can only be applied to charts with
+   * data sets of LINE plot type.
+   * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getTimeshiftDurationOrBuilder() { + return getTimeshiftDuration(); + } + + public static final int THRESHOLDS_FIELD_NUMBER = 5; + private java.util.List thresholds_; + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public java.util.List getThresholdsList() { + return thresholds_; + } + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public java.util.List + getThresholdsOrBuilderList() { + return thresholds_; + } + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public int getThresholdsCount() { + return thresholds_.size(); + } + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.Threshold getThresholds(int index) { + return thresholds_.get(index); + } + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.ThresholdOrBuilder getThresholdsOrBuilder(int index) { + return thresholds_.get(index); + } + + public static final int X_AXIS_FIELD_NUMBER = 6; + private com.google.monitoring.dashboard.v1.XyChart.Axis xAxis_; + /** + * + * + *
+   * The properties applied to the X axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + * + * @return Whether the xAxis field is set. + */ + public boolean hasXAxis() { + return xAxis_ != null; + } + /** + * + * + *
+   * The properties applied to the X axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + * + * @return The xAxis. + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis getXAxis() { + return xAxis_ == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance() + : xAxis_; + } + /** + * + * + *
+   * The properties applied to the X axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder getXAxisOrBuilder() { + return getXAxis(); + } + + public static final int Y_AXIS_FIELD_NUMBER = 7; + private com.google.monitoring.dashboard.v1.XyChart.Axis yAxis_; + /** + * + * + *
+   * The properties applied to the Y axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + * + * @return Whether the yAxis field is set. + */ + public boolean hasYAxis() { + return yAxis_ != null; + } + /** + * + * + *
+   * The properties applied to the Y axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + * + * @return The yAxis. + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis getYAxis() { + return yAxis_ == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance() + : yAxis_; + } + /** + * + * + *
+   * The properties applied to the Y axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder getYAxisOrBuilder() { + return getYAxis(); + } + + public static final int CHART_OPTIONS_FIELD_NUMBER = 8; + private com.google.monitoring.dashboard.v1.ChartOptions chartOptions_; + /** + * + * + *
+   * Display options for the chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + * + * @return Whether the chartOptions field is set. + */ + public boolean hasChartOptions() { + return chartOptions_ != null; + } + /** + * + * + *
+   * Display options for the chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + * + * @return The chartOptions. + */ + public com.google.monitoring.dashboard.v1.ChartOptions getChartOptions() { + return chartOptions_ == null + ? com.google.monitoring.dashboard.v1.ChartOptions.getDefaultInstance() + : chartOptions_; + } + /** + * + * + *
+   * Display options for the chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder getChartOptionsOrBuilder() { + return getChartOptions(); + } + + 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 < dataSets_.size(); i++) { + output.writeMessage(1, dataSets_.get(i)); + } + if (timeshiftDuration_ != null) { + output.writeMessage(4, getTimeshiftDuration()); + } + for (int i = 0; i < thresholds_.size(); i++) { + output.writeMessage(5, thresholds_.get(i)); + } + if (xAxis_ != null) { + output.writeMessage(6, getXAxis()); + } + if (yAxis_ != null) { + output.writeMessage(7, getYAxis()); + } + if (chartOptions_ != null) { + output.writeMessage(8, getChartOptions()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dataSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dataSets_.get(i)); + } + if (timeshiftDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTimeshiftDuration()); + } + for (int i = 0; i < thresholds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, thresholds_.get(i)); + } + if (xAxis_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getXAxis()); + } + if (yAxis_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getYAxis()); + } + if (chartOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getChartOptions()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.dashboard.v1.XyChart)) { + return super.equals(obj); + } + com.google.monitoring.dashboard.v1.XyChart other = + (com.google.monitoring.dashboard.v1.XyChart) obj; + + if (!getDataSetsList().equals(other.getDataSetsList())) return false; + if (hasTimeshiftDuration() != other.hasTimeshiftDuration()) return false; + if (hasTimeshiftDuration()) { + if (!getTimeshiftDuration().equals(other.getTimeshiftDuration())) return false; + } + if (!getThresholdsList().equals(other.getThresholdsList())) return false; + if (hasXAxis() != other.hasXAxis()) return false; + if (hasXAxis()) { + if (!getXAxis().equals(other.getXAxis())) return false; + } + if (hasYAxis() != other.hasYAxis()) return false; + if (hasYAxis()) { + if (!getYAxis().equals(other.getYAxis())) return false; + } + if (hasChartOptions() != other.hasChartOptions()) return false; + if (hasChartOptions()) { + if (!getChartOptions().equals(other.getChartOptions())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDataSetsCount() > 0) { + hash = (37 * hash) + DATA_SETS_FIELD_NUMBER; + hash = (53 * hash) + getDataSetsList().hashCode(); + } + if (hasTimeshiftDuration()) { + hash = (37 * hash) + TIMESHIFT_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getTimeshiftDuration().hashCode(); + } + if (getThresholdsCount() > 0) { + hash = (37 * hash) + THRESHOLDS_FIELD_NUMBER; + hash = (53 * hash) + getThresholdsList().hashCode(); + } + if (hasXAxis()) { + hash = (37 * hash) + X_AXIS_FIELD_NUMBER; + hash = (53 * hash) + getXAxis().hashCode(); + } + if (hasYAxis()) { + hash = (37 * hash) + Y_AXIS_FIELD_NUMBER; + hash = (53 * hash) + getYAxis().hashCode(); + } + if (hasChartOptions()) { + hash = (37 * hash) + CHART_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getChartOptions().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.dashboard.v1.XyChart parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.XyChart parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart 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.monitoring.dashboard.v1.XyChart parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.dashboard.v1.XyChart parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.dashboard.v1.XyChart parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart 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.monitoring.dashboard.v1.XyChart parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart 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.monitoring.dashboard.v1.XyChart parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.dashboard.v1.XyChart 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.monitoring.dashboard.v1.XyChart 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; + } + /** + * + * + *
+   * A chart that displays data on a 2D (X and Y axes) plane.
+   * 
+ * + * Protobuf type {@code google.monitoring.dashboard.v1.XyChart} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.dashboard.v1.XyChart) + com.google.monitoring.dashboard.v1.XyChartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.dashboard.v1.XyChart.class, + com.google.monitoring.dashboard.v1.XyChart.Builder.class); + } + + // Construct using com.google.monitoring.dashboard.v1.XyChart.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDataSetsFieldBuilder(); + getThresholdsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dataSetsBuilder_ == null) { + dataSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + dataSetsBuilder_.clear(); + } + if (timeshiftDurationBuilder_ == null) { + timeshiftDuration_ = null; + } else { + timeshiftDuration_ = null; + timeshiftDurationBuilder_ = null; + } + if (thresholdsBuilder_ == null) { + thresholds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + thresholdsBuilder_.clear(); + } + if (xAxisBuilder_ == null) { + xAxis_ = null; + } else { + xAxis_ = null; + xAxisBuilder_ = null; + } + if (yAxisBuilder_ == null) { + yAxis_ = null; + } else { + yAxis_ = null; + yAxisBuilder_ = null; + } + if (chartOptionsBuilder_ == null) { + chartOptions_ = null; + } else { + chartOptions_ = null; + chartOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.dashboard.v1.XyChartProto + .internal_static_google_monitoring_dashboard_v1_XyChart_descriptor; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart getDefaultInstanceForType() { + return com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart build() { + com.google.monitoring.dashboard.v1.XyChart result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart buildPartial() { + com.google.monitoring.dashboard.v1.XyChart result = + new com.google.monitoring.dashboard.v1.XyChart(this); + int from_bitField0_ = bitField0_; + if (dataSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dataSets_ = java.util.Collections.unmodifiableList(dataSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dataSets_ = dataSets_; + } else { + result.dataSets_ = dataSetsBuilder_.build(); + } + if (timeshiftDurationBuilder_ == null) { + result.timeshiftDuration_ = timeshiftDuration_; + } else { + result.timeshiftDuration_ = timeshiftDurationBuilder_.build(); + } + if (thresholdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + thresholds_ = java.util.Collections.unmodifiableList(thresholds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.thresholds_ = thresholds_; + } else { + result.thresholds_ = thresholdsBuilder_.build(); + } + if (xAxisBuilder_ == null) { + result.xAxis_ = xAxis_; + } else { + result.xAxis_ = xAxisBuilder_.build(); + } + if (yAxisBuilder_ == null) { + result.yAxis_ = yAxis_; + } else { + result.yAxis_ = yAxisBuilder_.build(); + } + if (chartOptionsBuilder_ == null) { + result.chartOptions_ = chartOptions_; + } else { + result.chartOptions_ = chartOptionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.dashboard.v1.XyChart) { + return mergeFrom((com.google.monitoring.dashboard.v1.XyChart) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.dashboard.v1.XyChart other) { + if (other == com.google.monitoring.dashboard.v1.XyChart.getDefaultInstance()) return this; + if (dataSetsBuilder_ == null) { + if (!other.dataSets_.isEmpty()) { + if (dataSets_.isEmpty()) { + dataSets_ = other.dataSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDataSetsIsMutable(); + dataSets_.addAll(other.dataSets_); + } + onChanged(); + } + } else { + if (!other.dataSets_.isEmpty()) { + if (dataSetsBuilder_.isEmpty()) { + dataSetsBuilder_.dispose(); + dataSetsBuilder_ = null; + dataSets_ = other.dataSets_; + bitField0_ = (bitField0_ & ~0x00000001); + dataSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDataSetsFieldBuilder() + : null; + } else { + dataSetsBuilder_.addAllMessages(other.dataSets_); + } + } + } + if (other.hasTimeshiftDuration()) { + mergeTimeshiftDuration(other.getTimeshiftDuration()); + } + if (thresholdsBuilder_ == null) { + if (!other.thresholds_.isEmpty()) { + if (thresholds_.isEmpty()) { + thresholds_ = other.thresholds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureThresholdsIsMutable(); + thresholds_.addAll(other.thresholds_); + } + onChanged(); + } + } else { + if (!other.thresholds_.isEmpty()) { + if (thresholdsBuilder_.isEmpty()) { + thresholdsBuilder_.dispose(); + thresholdsBuilder_ = null; + thresholds_ = other.thresholds_; + bitField0_ = (bitField0_ & ~0x00000002); + thresholdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getThresholdsFieldBuilder() + : null; + } else { + thresholdsBuilder_.addAllMessages(other.thresholds_); + } + } + } + if (other.hasXAxis()) { + mergeXAxis(other.getXAxis()); + } + if (other.hasYAxis()) { + mergeYAxis(other.getYAxis()); + } + if (other.hasChartOptions()) { + mergeChartOptions(other.getChartOptions()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.dashboard.v1.XyChart parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.dashboard.v1.XyChart) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List dataSets_ = + java.util.Collections.emptyList(); + + private void ensureDataSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dataSets_ = + new java.util.ArrayList(dataSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.DataSet, + com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder, + com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder> + dataSetsBuilder_; + + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public java.util.List getDataSetsList() { + if (dataSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(dataSets_); + } else { + return dataSetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public int getDataSetsCount() { + if (dataSetsBuilder_ == null) { + return dataSets_.size(); + } else { + return dataSetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet getDataSets(int index) { + if (dataSetsBuilder_ == null) { + return dataSets_.get(index); + } else { + return dataSetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder setDataSets( + int index, com.google.monitoring.dashboard.v1.XyChart.DataSet value) { + if (dataSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataSetsIsMutable(); + dataSets_.set(index, value); + onChanged(); + } else { + dataSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder setDataSets( + int index, com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder builderForValue) { + if (dataSetsBuilder_ == null) { + ensureDataSetsIsMutable(); + dataSets_.set(index, builderForValue.build()); + onChanged(); + } else { + dataSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder addDataSets(com.google.monitoring.dashboard.v1.XyChart.DataSet value) { + if (dataSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataSetsIsMutable(); + dataSets_.add(value); + onChanged(); + } else { + dataSetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder addDataSets( + int index, com.google.monitoring.dashboard.v1.XyChart.DataSet value) { + if (dataSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataSetsIsMutable(); + dataSets_.add(index, value); + onChanged(); + } else { + dataSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder addDataSets( + com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder builderForValue) { + if (dataSetsBuilder_ == null) { + ensureDataSetsIsMutable(); + dataSets_.add(builderForValue.build()); + onChanged(); + } else { + dataSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder addDataSets( + int index, com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder builderForValue) { + if (dataSetsBuilder_ == null) { + ensureDataSetsIsMutable(); + dataSets_.add(index, builderForValue.build()); + onChanged(); + } else { + dataSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder addAllDataSets( + java.lang.Iterable values) { + if (dataSetsBuilder_ == null) { + ensureDataSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataSets_); + onChanged(); + } else { + dataSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder clearDataSets() { + if (dataSetsBuilder_ == null) { + dataSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dataSetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public Builder removeDataSets(int index) { + if (dataSetsBuilder_ == null) { + ensureDataSetsIsMutable(); + dataSets_.remove(index); + onChanged(); + } else { + dataSetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder getDataSetsBuilder( + int index) { + return getDataSetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder getDataSetsOrBuilder( + int index) { + if (dataSetsBuilder_ == null) { + return dataSets_.get(index); + } else { + return dataSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public java.util.List + getDataSetsOrBuilderList() { + if (dataSetsBuilder_ != null) { + return dataSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dataSets_); + } + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder addDataSetsBuilder() { + return getDataSetsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.XyChart.DataSet.getDefaultInstance()); + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder addDataSetsBuilder( + int index) { + return getDataSetsFieldBuilder() + .addBuilder( + index, com.google.monitoring.dashboard.v1.XyChart.DataSet.getDefaultInstance()); + } + /** + * + * + *
+     * The data displayed in this chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + public java.util.List + getDataSetsBuilderList() { + return getDataSetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.DataSet, + com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder, + com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder> + getDataSetsFieldBuilder() { + if (dataSetsBuilder_ == null) { + dataSetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.DataSet, + com.google.monitoring.dashboard.v1.XyChart.DataSet.Builder, + com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder>( + dataSets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + dataSets_ = null; + } + return dataSetsBuilder_; + } + + private com.google.protobuf.Duration timeshiftDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + timeshiftDurationBuilder_; + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + * + * @return Whether the timeshiftDuration field is set. + */ + public boolean hasTimeshiftDuration() { + return timeshiftDurationBuilder_ != null || timeshiftDuration_ != null; + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + * + * @return The timeshiftDuration. + */ + public com.google.protobuf.Duration getTimeshiftDuration() { + if (timeshiftDurationBuilder_ == null) { + return timeshiftDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : timeshiftDuration_; + } else { + return timeshiftDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public Builder setTimeshiftDuration(com.google.protobuf.Duration value) { + if (timeshiftDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeshiftDuration_ = value; + onChanged(); + } else { + timeshiftDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public Builder setTimeshiftDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (timeshiftDurationBuilder_ == null) { + timeshiftDuration_ = builderForValue.build(); + onChanged(); + } else { + timeshiftDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public Builder mergeTimeshiftDuration(com.google.protobuf.Duration value) { + if (timeshiftDurationBuilder_ == null) { + if (timeshiftDuration_ != null) { + timeshiftDuration_ = + com.google.protobuf.Duration.newBuilder(timeshiftDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + timeshiftDuration_ = value; + } + onChanged(); + } else { + timeshiftDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public Builder clearTimeshiftDuration() { + if (timeshiftDurationBuilder_ == null) { + timeshiftDuration_ = null; + onChanged(); + } else { + timeshiftDuration_ = null; + timeshiftDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public com.google.protobuf.Duration.Builder getTimeshiftDurationBuilder() { + + onChanged(); + return getTimeshiftDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getTimeshiftDurationOrBuilder() { + if (timeshiftDurationBuilder_ != null) { + return timeshiftDurationBuilder_.getMessageOrBuilder(); + } else { + return timeshiftDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : timeshiftDuration_; + } + } + /** + * + * + *
+     * The duration used to display a comparison chart. A comparison chart
+     * simultaneously shows values from two similar-length time periods
+     * (e.g., week-over-week metrics).
+     * The duration must be positive, and it can only be applied to charts with
+     * data sets of LINE plot type.
+     * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTimeshiftDurationFieldBuilder() { + if (timeshiftDurationBuilder_ == null) { + timeshiftDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTimeshiftDuration(), getParentForChildren(), isClean()); + timeshiftDuration_ = null; + } + return timeshiftDurationBuilder_; + } + + private java.util.List thresholds_ = + java.util.Collections.emptyList(); + + private void ensureThresholdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + thresholds_ = + new java.util.ArrayList(thresholds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Threshold, + com.google.monitoring.dashboard.v1.Threshold.Builder, + com.google.monitoring.dashboard.v1.ThresholdOrBuilder> + thresholdsBuilder_; + + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public java.util.List getThresholdsList() { + if (thresholdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(thresholds_); + } else { + return thresholdsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public int getThresholdsCount() { + if (thresholdsBuilder_ == null) { + return thresholds_.size(); + } else { + return thresholdsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.Threshold getThresholds(int index) { + if (thresholdsBuilder_ == null) { + return thresholds_.get(index); + } else { + return thresholdsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder setThresholds(int index, com.google.monitoring.dashboard.v1.Threshold value) { + if (thresholdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureThresholdsIsMutable(); + thresholds_.set(index, value); + onChanged(); + } else { + thresholdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder setThresholds( + int index, com.google.monitoring.dashboard.v1.Threshold.Builder builderForValue) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.set(index, builderForValue.build()); + onChanged(); + } else { + thresholdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder addThresholds(com.google.monitoring.dashboard.v1.Threshold value) { + if (thresholdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureThresholdsIsMutable(); + thresholds_.add(value); + onChanged(); + } else { + thresholdsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder addThresholds(int index, com.google.monitoring.dashboard.v1.Threshold value) { + if (thresholdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureThresholdsIsMutable(); + thresholds_.add(index, value); + onChanged(); + } else { + thresholdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder addThresholds( + com.google.monitoring.dashboard.v1.Threshold.Builder builderForValue) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.add(builderForValue.build()); + onChanged(); + } else { + thresholdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder addThresholds( + int index, com.google.monitoring.dashboard.v1.Threshold.Builder builderForValue) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.add(index, builderForValue.build()); + onChanged(); + } else { + thresholdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder addAllThresholds( + java.lang.Iterable values) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, thresholds_); + onChanged(); + } else { + thresholdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder clearThresholds() { + if (thresholdsBuilder_ == null) { + thresholds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + thresholdsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public Builder removeThresholds(int index) { + if (thresholdsBuilder_ == null) { + ensureThresholdsIsMutable(); + thresholds_.remove(index); + onChanged(); + } else { + thresholdsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.Threshold.Builder getThresholdsBuilder(int index) { + return getThresholdsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.ThresholdOrBuilder getThresholdsOrBuilder(int index) { + if (thresholdsBuilder_ == null) { + return thresholds_.get(index); + } else { + return thresholdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public java.util.List + getThresholdsOrBuilderList() { + if (thresholdsBuilder_ != null) { + return thresholdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(thresholds_); + } + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.Threshold.Builder addThresholdsBuilder() { + return getThresholdsFieldBuilder() + .addBuilder(com.google.monitoring.dashboard.v1.Threshold.getDefaultInstance()); + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public com.google.monitoring.dashboard.v1.Threshold.Builder addThresholdsBuilder(int index) { + return getThresholdsFieldBuilder() + .addBuilder(index, com.google.monitoring.dashboard.v1.Threshold.getDefaultInstance()); + } + /** + * + * + *
+     * Threshold lines drawn horizontally across the chart.
+     * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + public java.util.List + getThresholdsBuilderList() { + return getThresholdsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Threshold, + com.google.monitoring.dashboard.v1.Threshold.Builder, + com.google.monitoring.dashboard.v1.ThresholdOrBuilder> + getThresholdsFieldBuilder() { + if (thresholdsBuilder_ == null) { + thresholdsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.monitoring.dashboard.v1.Threshold, + com.google.monitoring.dashboard.v1.Threshold.Builder, + com.google.monitoring.dashboard.v1.ThresholdOrBuilder>( + thresholds_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + thresholds_ = null; + } + return thresholdsBuilder_; + } + + private com.google.monitoring.dashboard.v1.XyChart.Axis xAxis_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.Axis, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder, + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder> + xAxisBuilder_; + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + * + * @return Whether the xAxis field is set. + */ + public boolean hasXAxis() { + return xAxisBuilder_ != null || xAxis_ != null; + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + * + * @return The xAxis. + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis getXAxis() { + if (xAxisBuilder_ == null) { + return xAxis_ == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance() + : xAxis_; + } else { + return xAxisBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public Builder setXAxis(com.google.monitoring.dashboard.v1.XyChart.Axis value) { + if (xAxisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + xAxis_ = value; + onChanged(); + } else { + xAxisBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public Builder setXAxis( + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder builderForValue) { + if (xAxisBuilder_ == null) { + xAxis_ = builderForValue.build(); + onChanged(); + } else { + xAxisBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public Builder mergeXAxis(com.google.monitoring.dashboard.v1.XyChart.Axis value) { + if (xAxisBuilder_ == null) { + if (xAxis_ != null) { + xAxis_ = + com.google.monitoring.dashboard.v1.XyChart.Axis.newBuilder(xAxis_) + .mergeFrom(value) + .buildPartial(); + } else { + xAxis_ = value; + } + onChanged(); + } else { + xAxisBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public Builder clearXAxis() { + if (xAxisBuilder_ == null) { + xAxis_ = null; + onChanged(); + } else { + xAxis_ = null; + xAxisBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis.Builder getXAxisBuilder() { + + onChanged(); + return getXAxisFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + public com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder getXAxisOrBuilder() { + if (xAxisBuilder_ != null) { + return xAxisBuilder_.getMessageOrBuilder(); + } else { + return xAxis_ == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance() + : xAxis_; + } + } + /** + * + * + *
+     * The properties applied to the X axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.Axis, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder, + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder> + getXAxisFieldBuilder() { + if (xAxisBuilder_ == null) { + xAxisBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.Axis, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder, + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder>( + getXAxis(), getParentForChildren(), isClean()); + xAxis_ = null; + } + return xAxisBuilder_; + } + + private com.google.monitoring.dashboard.v1.XyChart.Axis yAxis_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.Axis, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder, + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder> + yAxisBuilder_; + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + * + * @return Whether the yAxis field is set. + */ + public boolean hasYAxis() { + return yAxisBuilder_ != null || yAxis_ != null; + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + * + * @return The yAxis. + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis getYAxis() { + if (yAxisBuilder_ == null) { + return yAxis_ == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance() + : yAxis_; + } else { + return yAxisBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public Builder setYAxis(com.google.monitoring.dashboard.v1.XyChart.Axis value) { + if (yAxisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + yAxis_ = value; + onChanged(); + } else { + yAxisBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public Builder setYAxis( + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder builderForValue) { + if (yAxisBuilder_ == null) { + yAxis_ = builderForValue.build(); + onChanged(); + } else { + yAxisBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public Builder mergeYAxis(com.google.monitoring.dashboard.v1.XyChart.Axis value) { + if (yAxisBuilder_ == null) { + if (yAxis_ != null) { + yAxis_ = + com.google.monitoring.dashboard.v1.XyChart.Axis.newBuilder(yAxis_) + .mergeFrom(value) + .buildPartial(); + } else { + yAxis_ = value; + } + onChanged(); + } else { + yAxisBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public Builder clearYAxis() { + if (yAxisBuilder_ == null) { + yAxis_ = null; + onChanged(); + } else { + yAxis_ = null; + yAxisBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public com.google.monitoring.dashboard.v1.XyChart.Axis.Builder getYAxisBuilder() { + + onChanged(); + return getYAxisFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + public com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder getYAxisOrBuilder() { + if (yAxisBuilder_ != null) { + return yAxisBuilder_.getMessageOrBuilder(); + } else { + return yAxis_ == null + ? com.google.monitoring.dashboard.v1.XyChart.Axis.getDefaultInstance() + : yAxis_; + } + } + /** + * + * + *
+     * The properties applied to the Y axis.
+     * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.Axis, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder, + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder> + getYAxisFieldBuilder() { + if (yAxisBuilder_ == null) { + yAxisBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.XyChart.Axis, + com.google.monitoring.dashboard.v1.XyChart.Axis.Builder, + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder>( + getYAxis(), getParentForChildren(), isClean()); + yAxis_ = null; + } + return yAxisBuilder_; + } + + private com.google.monitoring.dashboard.v1.ChartOptions chartOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.ChartOptions, + com.google.monitoring.dashboard.v1.ChartOptions.Builder, + com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder> + chartOptionsBuilder_; + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + * + * @return Whether the chartOptions field is set. + */ + public boolean hasChartOptions() { + return chartOptionsBuilder_ != null || chartOptions_ != null; + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + * + * @return The chartOptions. + */ + public com.google.monitoring.dashboard.v1.ChartOptions getChartOptions() { + if (chartOptionsBuilder_ == null) { + return chartOptions_ == null + ? com.google.monitoring.dashboard.v1.ChartOptions.getDefaultInstance() + : chartOptions_; + } else { + return chartOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public Builder setChartOptions(com.google.monitoring.dashboard.v1.ChartOptions value) { + if (chartOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + chartOptions_ = value; + onChanged(); + } else { + chartOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public Builder setChartOptions( + com.google.monitoring.dashboard.v1.ChartOptions.Builder builderForValue) { + if (chartOptionsBuilder_ == null) { + chartOptions_ = builderForValue.build(); + onChanged(); + } else { + chartOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public Builder mergeChartOptions(com.google.monitoring.dashboard.v1.ChartOptions value) { + if (chartOptionsBuilder_ == null) { + if (chartOptions_ != null) { + chartOptions_ = + com.google.monitoring.dashboard.v1.ChartOptions.newBuilder(chartOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + chartOptions_ = value; + } + onChanged(); + } else { + chartOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public Builder clearChartOptions() { + if (chartOptionsBuilder_ == null) { + chartOptions_ = null; + onChanged(); + } else { + chartOptions_ = null; + chartOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public com.google.monitoring.dashboard.v1.ChartOptions.Builder getChartOptionsBuilder() { + + onChanged(); + return getChartOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + public com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder getChartOptionsOrBuilder() { + if (chartOptionsBuilder_ != null) { + return chartOptionsBuilder_.getMessageOrBuilder(); + } else { + return chartOptions_ == null + ? com.google.monitoring.dashboard.v1.ChartOptions.getDefaultInstance() + : chartOptions_; + } + } + /** + * + * + *
+     * Display options for the chart.
+     * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.ChartOptions, + com.google.monitoring.dashboard.v1.ChartOptions.Builder, + com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder> + getChartOptionsFieldBuilder() { + if (chartOptionsBuilder_ == null) { + chartOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.monitoring.dashboard.v1.ChartOptions, + com.google.monitoring.dashboard.v1.ChartOptions.Builder, + com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder>( + getChartOptions(), getParentForChildren(), isClean()); + chartOptions_ = null; + } + return chartOptionsBuilder_; + } + + @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.monitoring.dashboard.v1.XyChart) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.dashboard.v1.XyChart) + private static final com.google.monitoring.dashboard.v1.XyChart DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.dashboard.v1.XyChart(); + } + + public static com.google.monitoring.dashboard.v1.XyChart getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XyChart parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new XyChart(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.dashboard.v1.XyChart getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartOrBuilder.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartOrBuilder.java new file mode 100644 index 00000000..54e72af3 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartOrBuilder.java @@ -0,0 +1,281 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/xychart.proto + +package com.google.monitoring.dashboard.v1; + +public interface XyChartOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.dashboard.v1.XyChart) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + java.util.List getDataSetsList(); + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + com.google.monitoring.dashboard.v1.XyChart.DataSet getDataSets(int index); + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + int getDataSetsCount(); + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + java.util.List + getDataSetsOrBuilderList(); + /** + * + * + *
+   * The data displayed in this chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.XyChart.DataSet data_sets = 1; + */ + com.google.monitoring.dashboard.v1.XyChart.DataSetOrBuilder getDataSetsOrBuilder(int index); + + /** + * + * + *
+   * The duration used to display a comparison chart. A comparison chart
+   * simultaneously shows values from two similar-length time periods
+   * (e.g., week-over-week metrics).
+   * The duration must be positive, and it can only be applied to charts with
+   * data sets of LINE plot type.
+   * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + * + * @return Whether the timeshiftDuration field is set. + */ + boolean hasTimeshiftDuration(); + /** + * + * + *
+   * The duration used to display a comparison chart. A comparison chart
+   * simultaneously shows values from two similar-length time periods
+   * (e.g., week-over-week metrics).
+   * The duration must be positive, and it can only be applied to charts with
+   * data sets of LINE plot type.
+   * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + * + * @return The timeshiftDuration. + */ + com.google.protobuf.Duration getTimeshiftDuration(); + /** + * + * + *
+   * The duration used to display a comparison chart. A comparison chart
+   * simultaneously shows values from two similar-length time periods
+   * (e.g., week-over-week metrics).
+   * The duration must be positive, and it can only be applied to charts with
+   * data sets of LINE plot type.
+   * 
+ * + * .google.protobuf.Duration timeshift_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getTimeshiftDurationOrBuilder(); + + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + java.util.List getThresholdsList(); + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + com.google.monitoring.dashboard.v1.Threshold getThresholds(int index); + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + int getThresholdsCount(); + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + java.util.List + getThresholdsOrBuilderList(); + /** + * + * + *
+   * Threshold lines drawn horizontally across the chart.
+   * 
+ * + * repeated .google.monitoring.dashboard.v1.Threshold thresholds = 5; + */ + com.google.monitoring.dashboard.v1.ThresholdOrBuilder getThresholdsOrBuilder(int index); + + /** + * + * + *
+   * The properties applied to the X axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + * + * @return Whether the xAxis field is set. + */ + boolean hasXAxis(); + /** + * + * + *
+   * The properties applied to the X axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + * + * @return The xAxis. + */ + com.google.monitoring.dashboard.v1.XyChart.Axis getXAxis(); + /** + * + * + *
+   * The properties applied to the X axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis x_axis = 6; + */ + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder getXAxisOrBuilder(); + + /** + * + * + *
+   * The properties applied to the Y axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + * + * @return Whether the yAxis field is set. + */ + boolean hasYAxis(); + /** + * + * + *
+   * The properties applied to the Y axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + * + * @return The yAxis. + */ + com.google.monitoring.dashboard.v1.XyChart.Axis getYAxis(); + /** + * + * + *
+   * The properties applied to the Y axis.
+   * 
+ * + * .google.monitoring.dashboard.v1.XyChart.Axis y_axis = 7; + */ + com.google.monitoring.dashboard.v1.XyChart.AxisOrBuilder getYAxisOrBuilder(); + + /** + * + * + *
+   * Display options for the chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + * + * @return Whether the chartOptions field is set. + */ + boolean hasChartOptions(); + /** + * + * + *
+   * Display options for the chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + * + * @return The chartOptions. + */ + com.google.monitoring.dashboard.v1.ChartOptions getChartOptions(); + /** + * + * + *
+   * Display options for the chart.
+   * 
+ * + * .google.monitoring.dashboard.v1.ChartOptions chart_options = 8; + */ + com.google.monitoring.dashboard.v1.ChartOptionsOrBuilder getChartOptionsOrBuilder(); +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartProto.java b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartProto.java new file mode 100644 index 00000000..c4c95331 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartProto.java @@ -0,0 +1,141 @@ +/* + * Copyright 2019 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/monitoring/dashboard/v1/xychart.proto + +package com.google.monitoring.dashboard.v1; + +public final class XyChartProto { + private XyChartProto() {} + + 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_monitoring_dashboard_v1_XyChart_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_XyChart_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_XyChart_Axis_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_XyChart_Axis_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_dashboard_v1_ChartOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_dashboard_v1_ChartOptions_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/monitoring/dashboard/v1/xychart" + + ".proto\022\036google.monitoring.dashboard.v1\032\037" + + "google/api/field_behavior.proto\032,google/" + + "monitoring/dashboard/v1/metrics.proto\032\036g" + + "oogle/protobuf/duration.proto\"\363\006\n\007XyChar" + + "t\022B\n\tdata_sets\030\001 \003(\0132/.google.monitoring" + + ".dashboard.v1.XyChart.DataSet\0225\n\022timeshi" + + "ft_duration\030\004 \001(\0132\031.google.protobuf.Dura" + + "tion\022=\n\nthresholds\030\005 \003(\0132).google.monito" + + "ring.dashboard.v1.Threshold\022<\n\006x_axis\030\006 " + + "\001(\0132,.google.monitoring.dashboard.v1.XyC" + + "hart.Axis\022<\n\006y_axis\030\007 \001(\0132,.google.monit" + + "oring.dashboard.v1.XyChart.Axis\022C\n\rchart" + + "_options\030\010 \001(\0132,.google.monitoring.dashb" + + "oard.v1.ChartOptions\032\332\002\n\007DataSet\022J\n\021time" + + "_series_query\030\001 \001(\0132/.google.monitoring." + + "dashboard.v1.TimeSeriesQuery\022K\n\tplot_typ" + + "e\030\002 \001(\01628.google.monitoring.dashboard.v1" + + ".XyChart.DataSet.PlotType\022\027\n\017legend_temp" + + "late\030\003 \001(\t\022<\n\024min_alignment_period\030\004 \001(\013" + + "2\031.google.protobuf.DurationB\003\340A\001\"_\n\010Plot" + + "Type\022\031\n\025PLOT_TYPE_UNSPECIFIED\020\000\022\010\n\004LINE\020" + + "\001\022\020\n\014STACKED_AREA\020\002\022\017\n\013STACKED_BAR\020\003\022\013\n\007" + + "HEATMAP\020\004\032\217\001\n\004Axis\022\r\n\005label\030\001 \001(\t\022A\n\005sca" + + "le\030\002 \001(\01622.google.monitoring.dashboard.v" + + "1.XyChart.Axis.Scale\"5\n\005Scale\022\025\n\021SCALE_U" + + "NSPECIFIED\020\000\022\n\n\006LINEAR\020\001\022\t\n\005LOG10\020\002\"\216\001\n\014" + + "ChartOptions\022?\n\004mode\030\001 \001(\01621.google.moni" + + "toring.dashboard.v1.ChartOptions.Mode\"=\n" + + "\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\t\n\005COLOR\020\001\022\t" + + "\n\005X_RAY\020\002\022\t\n\005STATS\020\003B}\n\"com.google.monit" + + "oring.dashboard.v1B\014XyChartProtoP\001ZGgoog" + + "le.golang.org/genproto/googleapis/monito" + + "ring/dashboard/v1;dashboardb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.monitoring.dashboard.v1.MetricsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_monitoring_dashboard_v1_XyChart_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_dashboard_v1_XyChart_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_XyChart_descriptor, + new java.lang.String[] { + "DataSets", "TimeshiftDuration", "Thresholds", "XAxis", "YAxis", "ChartOptions", + }); + internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_descriptor = + internal_static_google_monitoring_dashboard_v1_XyChart_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_XyChart_DataSet_descriptor, + new java.lang.String[] { + "TimeSeriesQuery", "PlotType", "LegendTemplate", "MinAlignmentPeriod", + }); + internal_static_google_monitoring_dashboard_v1_XyChart_Axis_descriptor = + internal_static_google_monitoring_dashboard_v1_XyChart_descriptor.getNestedTypes().get(1); + internal_static_google_monitoring_dashboard_v1_XyChart_Axis_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_XyChart_Axis_descriptor, + new java.lang.String[] { + "Label", "Scale", + }); + internal_static_google_monitoring_dashboard_v1_ChartOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_monitoring_dashboard_v1_ChartOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_dashboard_v1_ChartOptions_descriptor, + new java.lang.String[] { + "Mode", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.monitoring.dashboard.v1.MetricsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/common.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/common.proto new file mode 100644 index 00000000..f1c5b987 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/common.proto @@ -0,0 +1,397 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// Describes how to combine multiple time series to provide different views of +// the data. Aggregation consists of an alignment step on individual time +// series (`alignment_period` and `per_series_aligner`) followed by an optional +// reduction step of the data across the aligned time series +// (`cross_series_reducer` and `group_by_fields`). For more details, see +// [Aggregation](/monitoring/api/learn_more#aggregation). +message Aggregation { + // The Aligner describes how to bring the data points in a single + // time series into temporal alignment. + enum Aligner { + // No alignment. Raw data is returned. Not valid if cross-time + // series reduction is requested. The value type of the result is + // the same as the value type of the input. + ALIGN_NONE = 0; + + // Align and convert to delta metric type. This alignment is valid + // for cumulative metrics and delta metrics. Aligning an existing + // delta metric to a delta metric requires that the alignment + // period be increased. The value type of the result is the same + // as the value type of the input. + // + // One can think of this aligner as a rate but without time units; that + // is, the output is conceptually (second_point - first_point). + ALIGN_DELTA = 1; + + // Align and convert to a rate. This alignment is valid for + // cumulative metrics and delta metrics with numeric values. The output is a + // gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + // + // One can think of this aligner as conceptually providing the slope of + // the line that passes through the value at the start and end of the + // window. In other words, this is conceptually ((y1 - y0)/(t1 - t0)), + // and the output unit is one that has a "/time" dimension. + // + // If, by rate, you are looking for percentage change, see the + // `ALIGN_PERCENT_CHANGE` aligner option. + ALIGN_RATE = 2; + + // Align by interpolating between adjacent points around the + // period boundary. This alignment is valid for gauge + // metrics with numeric values. The value type of the result is the same + // as the value type of the input. + ALIGN_INTERPOLATE = 3; + + // Align by shifting the oldest data point before the period + // boundary to the boundary. This alignment is valid for gauge + // metrics. The value type of the result is the same as the + // value type of the input. + ALIGN_NEXT_OLDER = 4; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the minimum of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // values. The value type of the result is the same as the value + // type of the input. + ALIGN_MIN = 10; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the maximum of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // values. The value type of the result is the same as the value + // type of the input. + ALIGN_MAX = 11; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the average or arithmetic mean of all + // data points in the period. This alignment is valid for gauge and delta + // metrics with numeric values. The value type of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_MEAN = 12; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the count of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // or Boolean values. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + ALIGN_COUNT = 13; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the sum of all data points in the + // period. This alignment is valid for gauge and delta metrics with numeric + // and distribution values. The value type of the output is the + // same as the value type of the input. + ALIGN_SUM = 14; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the standard deviation of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with numeric values. The value type of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_STDDEV = 15; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the count of True-valued data points in the + // period. This alignment is valid for gauge metrics with + // Boolean values. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + ALIGN_COUNT_TRUE = 16; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the count of False-valued data points in the + // period. This alignment is valid for gauge metrics with + // Boolean values. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + ALIGN_COUNT_FALSE = 24; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the fraction of True-valued data points in the + // period. This alignment is valid for gauge metrics with Boolean values. + // The output value is in the range [0, 1] and has value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_FRACTION_TRUE = 17; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the 99th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_PERCENTILE_99 = 18; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the 95th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_PERCENTILE_95 = 19; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the 50th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_PERCENTILE_50 = 20; + + // Align time series via aggregation. The resulting data point in + // the alignment period is the 5th percentile of all data + // points in the period. This alignment is valid for gauge and delta metrics + // with distribution values. The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_PERCENTILE_05 = 21; + + // Align and convert to a percentage change. This alignment is valid for + // gauge and delta metrics with numeric values. This alignment conceptually + // computes the equivalent of "((current - previous)/previous)*100" + // where previous value is determined based on the alignmentPeriod. + // In the event that previous is 0 the calculated value is infinity with the + // exception that if both (current - previous) and previous are 0 the + // calculated value is 0. + // A 10 minute moving mean is computed at each point of the time window + // prior to the above calculation to smooth the metric and prevent false + // positives from very short lived spikes. + // Only applicable for data that is >= 0. Any values < 0 are treated as + // no data. While delta metrics are accepted by this alignment special care + // should be taken that the values for the metric will always be positive. + // The output is a gauge metric with value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + ALIGN_PERCENT_CHANGE = 23; + } + + // A Reducer describes how to aggregate data points from multiple + // time series into a single time series. + enum Reducer { + // No cross-time series reduction. The output of the aligner is + // returned. + REDUCE_NONE = 0; + + // Reduce by computing the mean across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric or distribution values. The value type of the + // output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + REDUCE_MEAN = 1; + + // Reduce by computing the minimum across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric values. The value type of the output + // is the same as the value type of the input. + REDUCE_MIN = 2; + + // Reduce by computing the maximum across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric values. The value type of the output + // is the same as the value type of the input. + REDUCE_MAX = 3; + + // Reduce by computing the sum across time series for each + // alignment period. This reducer is valid for delta and + // gauge metrics with numeric and distribution values. The value type of + // the output is the same as the value type of the input. + REDUCE_SUM = 4; + + // Reduce by computing the standard deviation across time series + // for each alignment period. This reducer is valid for delta + // and gauge metrics with numeric or distribution values. The value type of + // the output is [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + REDUCE_STDDEV = 5; + + // Reduce by computing the count of data points across time series + // for each alignment period. This reducer is valid for delta + // and gauge metrics of numeric, Boolean, distribution, and string value + // type. The value type of the output is + // [INT64][google.api.MetricDescriptor.ValueType.INT64]. + REDUCE_COUNT = 6; + + // Reduce by computing the count of True-valued data points across time + // series for each alignment period. This reducer is valid for delta + // and gauge metrics of Boolean value type. The value type of + // the output is [INT64][google.api.MetricDescriptor.ValueType.INT64]. + REDUCE_COUNT_TRUE = 7; + + // Reduce by computing the count of False-valued data points across time + // series for each alignment period. This reducer is valid for delta + // and gauge metrics of Boolean value type. The value type of + // the output is [INT64][google.api.MetricDescriptor.ValueType.INT64]. + REDUCE_COUNT_FALSE = 15; + + // Reduce by computing the fraction of True-valued data points across time + // series for each alignment period. This reducer is valid for delta + // and gauge metrics of Boolean value type. The output value is in the + // range [0, 1] and has value type + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + REDUCE_FRACTION_TRUE = 8; + + // Reduce by computing 99th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + REDUCE_PERCENTILE_99 = 9; + + // Reduce by computing 95th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + REDUCE_PERCENTILE_95 = 10; + + // Reduce by computing 50th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + REDUCE_PERCENTILE_50 = 11; + + // Reduce by computing 5th percentile of data points across time series + // for each alignment period. This reducer is valid for gauge and delta + // metrics of numeric and distribution type. The value of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE] + REDUCE_PERCENTILE_05 = 12; + } + + // The alignment period for per-[time series][TimeSeries] + // alignment. If present, `alignmentPeriod` must be at least 60 + // seconds. After per-time series alignment, each time series will + // contain data points only on the period boundaries. If + // `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then + // this field is ignored. If `perSeriesAligner` is specified and + // does not equal `ALIGN_NONE`, then this field must be defined; + // otherwise an error is returned. + google.protobuf.Duration alignment_period = 1; + + // The approach to be used to align individual time series. Not all + // alignment functions may be applied to all time series, depending + // on the metric type and value type of the original time + // series. Alignment may change the metric type or the value type of + // the time series. + // + // Time series data must be aligned in order to perform cross-time + // series reduction. If `crossSeriesReducer` is specified, then + // `perSeriesAligner` must be specified and not equal `ALIGN_NONE` + // and `alignmentPeriod` must be specified; otherwise, an error is + // returned. + Aligner per_series_aligner = 2; + + // The approach to be used to combine time series. Not all reducer + // functions may be applied to all time series, depending on the + // metric type and the value type of the original time + // series. Reduction may change the metric type of value type of the + // time series. + // + // Time series data must be aligned in order to perform cross-time + // series reduction. If `crossSeriesReducer` is specified, then + // `perSeriesAligner` must be specified and not equal `ALIGN_NONE` + // and `alignmentPeriod` must be specified; otherwise, an error is + // returned. + Reducer cross_series_reducer = 4; + + // The set of fields to preserve when `crossSeriesReducer` is + // specified. The `groupByFields` determine how the time series are + // partitioned into subsets prior to applying the aggregation + // function. Each subset contains time series that have the same + // value for each of the grouping fields. Each individual time + // series is a member of exactly one subset. The + // `crossSeriesReducer` is applied to each subset of time series. + // It is not possible to reduce across different resource types, so + // this field implicitly contains `resource.type`. Fields not + // specified in `groupByFields` are aggregated away. If + // `groupByFields` is not specified and all the time series have + // the same resource type, then the time series are aggregated into + // a single output time series. If `crossSeriesReducer` is not + // defined, this field is ignored. + repeated string group_by_fields = 5; +} + +// Describes a ranking-based time series filter. Each input time series is +// ranked with an aligner. The filter lets through up to `num_time_series` time +// series, selecting them based on the relative ranking. +message PickTimeSeriesFilter { + // The value reducers that can be applied to a PickTimeSeriesFilter. + enum Method { + // Not allowed in well-formed requests. + METHOD_UNSPECIFIED = 0; + + // Select the mean of all values. + METHOD_MEAN = 1; + + // Select the maximum value. + METHOD_MAX = 2; + + // Select the minimum value. + METHOD_MIN = 3; + + // Compute the sum of all values. + METHOD_SUM = 4; + + // Select the most recent value. + METHOD_LATEST = 5; + } + + // Describes the ranking directions. + enum Direction { + // Not allowed in well-formed requests. + DIRECTION_UNSPECIFIED = 0; + + // Pass the highest ranking inputs. + TOP = 1; + + // Pass the lowest ranking inputs. + BOTTOM = 2; + } + + // `rankingMethod` is applied to each time series independently to produce the + // value which will be used to compare the time series to other time series. + Method ranking_method = 1; + + // How many time series to return. + int32 num_time_series = 2; + + // How to use the ranking to select time series that pass through the filter. + Direction direction = 3; +} + +// A filter that ranks streams based on their statistical relation to other +// streams in a request. +message StatisticalTimeSeriesFilter { + // The filter methods that can be applied to a stream. + enum Method { + // Not allowed in well-formed requests. + METHOD_UNSPECIFIED = 0; + + // Compute the outlier score of each stream. + METHOD_CLUSTER_OUTLIER = 1; + } + + // `rankingMethod` is applied to a set of time series, and then the produced + // value for each individual time series is used to compare a given time + // series to others. + // These are methods that cannot be applied stream-by-stream, but rather + // require the full context of a request to evaluate time series. + Method ranking_method = 1; + + // How many time series to output. + int32 num_time_series = 2; +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/dashboard.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/dashboard.proto new file mode 100644 index 00000000..20ddccfc --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/dashboard.proto @@ -0,0 +1,59 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/monitoring/dashboard/v1/layouts.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DashboardsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// A Google Stackdriver dashboard. Dashboards define the content and layout +// of pages in the Stackdriver web application. +message Dashboard { + // The resource name of the dashboard. + string name = 1; + + // The mutable, human-readable name. + string display_name = 2; + + // `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a policy from overwriting each other. + // An `etag` is returned in the response to `GetDashboard`, and + // users are expected to put that etag in the request to `UpdateDashboard` to + // ensure that their change will be applied to the same version of the + // Dashboard configuration. The field should not be passed during + // dashboard creation. + string etag = 4; + + // A dashboard's root container element that defines the layout style. + oneof layout { + // Content is arranged with a basic layout that re-flows a simple list of + // informational elements like widgets or tiles. + GridLayout grid_layout = 5; + + // The content is divided into equally spaced rows and the widgets are + // arranged horizontally. + RowLayout row_layout = 8; + + // The content is divided into equally spaced columns and the widgets are + // arranged vertically. + ColumnLayout column_layout = 9; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/dashboards_service.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/dashboards_service.proto new file mode 100644 index 00000000..9b7c0152 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/dashboards_service.proto @@ -0,0 +1,158 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/dashboard.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DashboardsServiceProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// Manages Stackdriver dashboards. A dashboard is an arrangement of data display +// widgets in a specific layout. +service DashboardsService { + option (google.api.default_host) = "monitoring.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/monitoring," + "https://www.googleapis.com/auth/monitoring.read," + "https://www.googleapis.com/auth/monitoring.write"; + + // Creates a new custom dashboard. + // + // This method requires the `monitoring.dashboards.create` permission + // on the specified project. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/dashboards" + body: "dashboard" + }; + } + + // Lists the existing dashboards. + // + // This method requires the `monitoring.dashboards.list` permission + // on the specified project. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + rpc ListDashboards(ListDashboardsRequest) returns (ListDashboardsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/dashboards" + }; + } + + // Fetches a specific dashboard. + // + // This method requires the `monitoring.dashboards.get` permission + // on the specified dashboard. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + rpc GetDashboard(GetDashboardRequest) returns (Dashboard) { + option (google.api.http) = { + get: "/v1/{name=projects/*/dashboards/*}" + }; + } + + // Deletes an existing custom dashboard. + // + // This method requires the `monitoring.dashboards.delete` permission + // on the specified dashboard. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + rpc DeleteDashboard(DeleteDashboardRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/dashboards/*}" + }; + } + + // Replaces an existing custom dashboard with a new definition. + // + // This method requires the `monitoring.dashboards.update` permission + // on the specified dashboard. For more information, see + // [Google Cloud IAM](https://cloud.google.com/iam). + rpc UpdateDashboard(UpdateDashboardRequest) returns (Dashboard) { + option (google.api.http) = { + patch: "/v1/{dashboard.name=projects/*/dashboards/*}" + body: "dashboard" + }; + } +} + +// The `CreateDashboard` request. +message CreateDashboardRequest { + // Required. The project on which to execute the request. The format is + // `"projects/{project_id_or_number}"`. The {project_id_or_number} must match + // the dashboard resource name. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The initial dashboard specification. + Dashboard dashboard = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The `ListDashboards` request. +message ListDashboardsRequest { + // Required. The scope of the dashboards to list. A project scope must be + // specified in the form of `"projects/{project_id_or_number}"`. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // A positive number that is the maximum number of results to return. + // If unspecified, a default of 1000 is used. + int32 page_size = 2; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 3; +} + +// The `ListDashboards` request. +message ListDashboardsResponse { + // The list of requested dashboards. + repeated Dashboard dashboards = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `pageToken` in the next call to this method. + string next_page_token = 2; +} + +// The `GetDashboard` request. +message GetDashboardRequest { + // Required. The resource name of the Dashboard. The format is one of + // `"dashboards/{dashboard_id}"` (for system dashboards) or + // `"projects/{project_id_or_number}/dashboards/{dashboard_id}"` + // (for custom dashboards). + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The `DeleteDashboard` request. +message DeleteDashboardRequest { + // Required. The resource name of the Dashboard. The format is + // `"projects/{project_id_or_number}/dashboards/{dashboard_id}"`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The `UpdateDashboard` request. +message UpdateDashboardRequest { + // Required. The dashboard that will replace the existing dashboard. + Dashboard dashboard = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/drilldowns.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/drilldowns.proto new file mode 100644 index 00000000..cb9fefe3 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/drilldowns.proto @@ -0,0 +1,23 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DrilldownsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/layouts.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/layouts.proto new file mode 100644 index 00000000..23cb8423 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/layouts.proto @@ -0,0 +1,74 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/monitoring/dashboard/v1/widget.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "LayoutsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// A basic layout divides the available space into vertical columns of equal +// width and arranges a list of widgets using a row-first strategy. +message GridLayout { + // The number of columns into which the view's width is divided. If omitted + // or set to zero, a system default will be used while rendering. + int64 columns = 1; + + // The informational elements that are arranged into the columns row-first. + repeated Widget widgets = 2; +} + +// A simplified layout that divides the available space into rows +// and arranges a set of widgets horizontally in each row. +message RowLayout { + // Defines the layout properties and content for a row. + message Row { + // The relative weight of this row. The row weight is used to adjust the + // height of rows on the screen (relative to peers). Greater the weight, + // greater the height of the row on the screen. If omitted, a value + // of 1 is used while rendering. + int64 weight = 1; + + // The display widgets arranged horizontally in this row. + repeated Widget widgets = 2; + } + + // The rows of content to display. + repeated Row rows = 1; +} + +// A simplified layout that divides the available space into vertical columns +// and arranges a set of widgets vertically in each column. +message ColumnLayout { + // Defines the layout properties and content for a column. + message Column { + // The relative weight of this column. The column weight is used to adjust + // the width of columns on the screen (relative to peers). + // Greater the weight, greater the width of the column on the screen. + // If omitted, a value of 1 is used while rendering. + int64 weight = 1; + + // The display widgets arranged vertically in this column. + repeated Widget widgets = 2; + } + + // The columns of content to display. + repeated Column columns = 1; +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/metrics.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/metrics.proto new file mode 100644 index 00000000..1b051aa1 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/metrics.proto @@ -0,0 +1,165 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/common.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "MetricsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// TimeSeriesQuery collects the set of supported methods for querying time +// series data from the Stackdriver metrics API. +message TimeSeriesQuery { + // Parameters needed to obtain data for the chart. + oneof source { + // Filter parameters to fetch time series. + TimeSeriesFilter time_series_filter = 1; + + // Parameters to fetch a ratio between two time series filters. + TimeSeriesFilterRatio time_series_filter_ratio = 2; + } + + // The unit of data contained in fetched time series. If non-empty, this + // unit will override any unit that accompanies fetched data. The format is + // the same as the + // [`unit`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors) + // field in `MetricDescriptor`. + string unit_override = 5; +} + +// A filter that defines a subset of time series data that is displayed in a +// widget. Time series data is fetched using the +// [`ListTimeSeries`](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) +// method. +message TimeSeriesFilter { + // Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the + // metric types, resources, and projects to query. + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // By default, the raw time series data is returned. + // Use this field to combine multiple time series for different views of the + // data. + Aggregation aggregation = 2; + + // Selects an optional time series filter. + oneof output_filter { + // Ranking based time series filter. + PickTimeSeriesFilter pick_time_series_filter = 4; + + // Statistics based time series filter. + StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + } +} + +// A pair of time series filters that define a ratio computation. The output +// time series is the pair-wise division of each aligned element from the +// numerator and denominator time series. +message TimeSeriesFilterRatio { + // Describes a query to build the numerator or denominator of a + // TimeSeriesFilterRatio. + message RatioPart { + // Required. The [monitoring filter](/monitoring/api/v3/filters) that identifies the + // metric types, resources, and projects to query. + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // By default, the raw time series data is returned. + // Use this field to combine multiple time series for different views of the + // data. + Aggregation aggregation = 2; + } + + // The numerator of the ratio. + RatioPart numerator = 1; + + // The denominator of the ratio. + RatioPart denominator = 2; + + // Apply a second aggregation after the ratio is computed. + Aggregation secondary_aggregation = 3; + + // Selects an optional filter that is applied to the time series after + // computing the ratio. + oneof output_filter { + // Ranking based time series filter. + PickTimeSeriesFilter pick_time_series_filter = 4; + + // Statistics based time series filter. + StatisticalTimeSeriesFilter statistical_time_series_filter = 5; + } +} + +// Defines a threshold for categorizing time series values. +message Threshold { + // The color suggests an interpretation to the viewer when actual values cross + // the threshold. Comments on each color provide UX guidance on how users can + // be expected to interpret a given state color. + enum Color { + // Color is unspecified. Not allowed in well-formed requests. + COLOR_UNSPECIFIED = 0; + + // Crossing the threshold is "concerning" behavior. + YELLOW = 4; + + // Crossing the threshold is "emergency" behavior. + RED = 6; + } + + // Whether the threshold is considered crossed by an actual value above or + // below its threshold value. + enum Direction { + // Not allowed in well-formed requests. + DIRECTION_UNSPECIFIED = 0; + + // The threshold will be considered crossed if the actual value is above + // the threshold value. + ABOVE = 1; + + // The threshold will be considered crossed if the actual value is below + // the threshold value. + BELOW = 2; + } + + // A label for the threshold. + string label = 1; + + // The value of the threshold. The value should be defined in the native scale + // of the metric. + double value = 2; + + // The state color for this threshold. Color is not allowed in a XyChart. + Color color = 3; + + // The direction for the current threshold. Direction is not allowed in a + // XyChart. + Direction direction = 4; +} + +// Defines the possible types of spark chart supported by the `Scorecard`. +enum SparkChartType { + // Not allowed in well-formed requests. + SPARK_CHART_TYPE_UNSPECIFIED = 0; + + // The sparkline will be rendered as a small line chart. + SPARK_LINE = 1; + + // The sparkbar will be rendered as a small bar chart. + SPARK_BAR = 2; +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/scorecard.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/scorecard.proto new file mode 100644 index 00000000..0af0af40 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/scorecard.proto @@ -0,0 +1,110 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/monitoring/dashboard/v1/metrics.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "ScorecardProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// A widget showing the latest value of a metric, and how this value relates to +// one or more thresholds. +message Scorecard { + // A gauge chart shows where the current value sits within a pre-defined + // range. The upper and lower bounds should define the possible range of + // values for the scorecard's query (inclusive). + message GaugeView { + // The lower bound for this gauge chart. The value of the chart should + // always be greater than or equal to this. + double lower_bound = 1; + + // The upper bound for this gauge chart. The value of the chart should + // always be less than or equal to this. + double upper_bound = 2; + } + + // A sparkChart is a small chart suitable for inclusion in a table-cell or + // inline in text. This message contains the configuration for a sparkChart + // to show up on a Scorecard, showing recent trends of the scorecard's + // timeseries. + message SparkChartView { + // The type of sparkchart to show in this chartView. + SparkChartType spark_chart_type = 1; + + // The lower bound on data point frequency in the chart implemented by + // specifying the minimum alignment period to use in a time series query. + // For example, if the data is published once every 10 minutes it would not + // make sense to fetch and align data at one minute intervals. This field is + // optional and exists only as a hint. + google.protobuf.Duration min_alignment_period = 2; + } + + // Fields for querying time series data from the + // Stackdriver metrics API. + TimeSeriesQuery time_series_query = 1; + + // Defines the optional additional chart shown on the scorecard. If + // neither is included - then a default scorecard is shown. + oneof data_view { + // Will cause the scorecard to show a gauge chart. + GaugeView gauge_view = 4; + + // Will cause the scorecard to show a spark chart. + SparkChartView spark_chart_view = 5; + } + + // The thresholds used to determine the state of the scorecard given the + // time series' current value. For an actual value x, the scorecard is in a + // danger state if x is less than or equal to a danger threshold that triggers + // below, or greater than or equal to a danger threshold that triggers above. + // Similarly, if x is above/below a warning threshold that triggers + // above/below, then the scorecard is in a warning state - unless x also puts + // it in a danger state. (Danger trumps warning.) + // + // As an example, consider a scorecard with the following four thresholds: + // { + // value: 90, + // category: 'DANGER', + // trigger: 'ABOVE', + // }, + // { + // value: 70, + // category: 'WARNING', + // trigger: 'ABOVE', + // }, + // { + // value: 10, + // category: 'DANGER', + // trigger: 'BELOW', + // }, + // { + // value: 20, + // category: 'WARNING', + // trigger: 'BELOW', + // } + // + // Then: values less than or equal to 10 would put the scorecard in a DANGER + // state, values greater than 10 but less than or equal to 20 a WARNING state, + // values strictly between 20 and 70 an OK state, values greater than or equal + // to 70 but less than 90 a WARNING state, and values greater than or equal to + // 90 a DANGER state. + repeated Threshold thresholds = 6; +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/service.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/service.proto new file mode 100644 index 00000000..74290edd --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/service.proto @@ -0,0 +1,23 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "ServiceMonitoringProto"; +option java_package = "com.google.monitoring.dashboard.v1"; diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/text.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/text.proto new file mode 100644 index 00000000..2b223671 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/text.proto @@ -0,0 +1,44 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// A widget that displays textual content. +message Text { + // The format type of the text content. + enum Format { + // Format is unspecified. Defaults to MARKDOWN. + FORMAT_UNSPECIFIED = 0; + + // The text contains Markdown formatting. + MARKDOWN = 1; + + // The text contains no special formatting. + RAW = 2; + } + + // The text content to be displayed. + string content = 1; + + // How the text content is formatted. + Format format = 2; +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/widget.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/widget.proto new file mode 100644 index 00000000..4316aa99 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/widget.proto @@ -0,0 +1,51 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/scorecard.proto"; +import "google/monitoring/dashboard/v1/text.proto"; +import "google/monitoring/dashboard/v1/xychart.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "WidgetProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// Widget contains a single dashboard component and configuration of how to +// present the component in the dashboard. +message Widget { + // Optional. The title of the widget. + string title = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Content defines the component used to populate the widget. + oneof content { + // A chart of time series data. + XyChart xy_chart = 2; + + // A scorecard summarizing time series data. + Scorecard scorecard = 3; + + // A raw string or markdown displaying textual content. + Text text = 4; + + // A blank space. + google.protobuf.Empty blank = 5; + } +} diff --git a/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/xychart.proto b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/xychart.proto new file mode 100644 index 00000000..8fe3d660 --- /dev/null +++ b/proto-google-cloud-monitoring-dashboard-v1/src/main/proto/google/monitoring/dashboard/v1/xychart.proto @@ -0,0 +1,146 @@ +// Copyright 2019 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/metrics.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "XyChartProto"; +option java_package = "com.google.monitoring.dashboard.v1"; + +// A chart that displays data on a 2D (X and Y axes) plane. +message XyChart { + // Groups a time series query definition with charting options. + message DataSet { + // The types of plotting strategies for data sets. + enum PlotType { + // Plot type is unspecified. The view will default to `LINE`. + PLOT_TYPE_UNSPECIFIED = 0; + + // The data is plotted as a set of lines (one line per series). + LINE = 1; + + // The data is plotted as a set of filled areas (one area per series), + // with the areas stacked vertically (the base of each area is the top of + // its predecessor, and the base of the first area is the X axis). Since + // the areas do not overlap, each is filled with a different opaque color. + STACKED_AREA = 2; + + // The data is plotted as a set of rectangular boxes (one box per series), + // with the boxes stacked vertically (the base of each box is the top of + // its predecessor, and the base of the first box is the X axis). Since + // the boxes do not overlap, each is filled with a different opaque color. + STACKED_BAR = 3; + + // The data is plotted as a heatmap. The series being plotted must have a + // `DISTRIBUTION` value type. The value of each bucket in the distribution + // is displayed as a color. This type is not currently available in the + // Stackdriver Monitoring application. + HEATMAP = 4; + } + + // Fields for querying time series data from the + // Stackdriver metrics API. + TimeSeriesQuery time_series_query = 1; + + // How this data should be plotted on the chart. + PlotType plot_type = 2; + + // A template string for naming `TimeSeries` in the resulting data set. + // This should be a string with interpolations of the form ${label_name}, + // which will resolve to the label's value. + string legend_template = 3; + + // Optional. The lower bound on data point frequency for this data set, implemented by + // specifying the minimum alignment period to use in a time series query + // For example, if the data is published once every 10 minutes, the + // `min_alignment_period` should be at least 10 minutes. It would not + // make sense to fetch and align data at one minute intervals. + google.protobuf.Duration min_alignment_period = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // A chart axis. + message Axis { + // Types of scales used in axes. + enum Scale { + // Scale is unspecified. The view will default to `LINEAR`. + SCALE_UNSPECIFIED = 0; + + // Linear scale. + LINEAR = 1; + + // Logarithmic scale (base 10). + LOG10 = 2; + } + + // The label of the axis. + string label = 1; + + // The axis scale. By default, a linear scale is used. + Scale scale = 2; + } + + // The data displayed in this chart. + repeated DataSet data_sets = 1; + + // The duration used to display a comparison chart. A comparison chart + // simultaneously shows values from two similar-length time periods + // (e.g., week-over-week metrics). + // The duration must be positive, and it can only be applied to charts with + // data sets of LINE plot type. + google.protobuf.Duration timeshift_duration = 4; + + // Threshold lines drawn horizontally across the chart. + repeated Threshold thresholds = 5; + + // The properties applied to the X axis. + Axis x_axis = 6; + + // The properties applied to the Y axis. + Axis y_axis = 7; + + // Display options for the chart. + ChartOptions chart_options = 8; +} + +// Options to control visual rendering of a chart. +message ChartOptions { + // Chart mode options. + enum Mode { + // Mode is unspecified. The view will default to `COLOR`. + MODE_UNSPECIFIED = 0; + + // The chart distinguishes data series using different color. Line + // colors may get reused when there are many lines in the chart. + COLOR = 1; + + // The chart uses the Stackdriver x-ray mode, in which each + // data set is plotted using the same semi-transparent color. + X_RAY = 2; + + // The chart displays statistics such as average, median, 95th percentile, + // and more. + STATS = 3; + } + + // The chart mode. + Mode mode = 1; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..02757c63 --- /dev/null +++ b/renovate.json @@ -0,0 +1,50 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + } + ], + "semanticCommits": true +} diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..bb68586f --- /dev/null +++ b/synth.metadata @@ -0,0 +1,405 @@ +{ + "updateTime": "2019-12-30T18:57:15.976425Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "a202fb3b91cd0e4231be878b0348afd17067cbe2", + "internalRef": "287379998" + } + }, + { + "template": { + "name": "java_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "monitoring-dashboard", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } + } + ], + "newFiles": [ + { + "path": "codecov.yaml" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "license-checks.xml" + }, + { + "path": "java.header" + }, + { + "path": "LICENSE" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "renovate.json" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequestOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayout.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatio.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayoutOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequest.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayout.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/WidgetOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilterOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilter.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Scorecard.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GridLayout.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TextOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQuery.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequestOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/MetricsProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Text.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ThresholdOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptions.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ScorecardProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequestOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequest.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/StatisticalTimeSeriesFilter.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponseOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CommonProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsRequest.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DeleteDashboardRequestOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/LayoutsProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Aggregation.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChart.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/SparkChartType.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ListDashboardsResponse.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/RowLayoutOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ColumnLayoutOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Threshold.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Widget.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ChartOptionsOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/UpdateDashboardRequest.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/Dashboard.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/CreateDashboardRequestOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesQueryOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/TimeSeriesFilterRatioOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/GetDashboardRequest.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartProto.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilterOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/XyChartOrBuilder.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/PickTimeSeriesFilter.java" + }, + { + "path": "proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/AggregationOrBuilder.java" + }, + { + "path": ".kokoro/dependencies.sh" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".kokoro/linkage-monitor.sh" + }, + { + "path": ".kokoro/build.sh" + }, + { + "path": ".kokoro/coerce_logs.sh" + }, + { + "path": ".kokoro/build.bat" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/presubmit/dependencies.cfg" + }, + { + "path": ".kokoro/presubmit/linkage-monitor.cfg" + }, + { + "path": ".kokoro/presubmit/java7.cfg" + }, + { + "path": ".kokoro/presubmit/integration.cfg" + }, + { + "path": ".kokoro/presubmit/clirr.cfg" + }, + { + "path": ".kokoro/presubmit/java11.cfg" + }, + { + "path": ".kokoro/presubmit/java8.cfg" + }, + { + "path": ".kokoro/presubmit/lint.cfg" + }, + { + "path": ".kokoro/presubmit/java8-win.cfg" + }, + { + "path": ".kokoro/presubmit/java8-osx.cfg" + }, + { + "path": ".kokoro/presubmit/common.cfg" + }, + { + "path": ".kokoro/continuous/propose_release.sh" + }, + { + "path": ".kokoro/continuous/propose_release.cfg" + }, + { + "path": ".kokoro/continuous/dependencies.cfg" + }, + { + "path": ".kokoro/continuous/java7.cfg" + }, + { + "path": ".kokoro/continuous/integration.cfg" + }, + { + "path": ".kokoro/continuous/java11.cfg" + }, + { + "path": ".kokoro/continuous/java8.cfg" + }, + { + "path": ".kokoro/continuous/lint.cfg" + }, + { + "path": ".kokoro/continuous/java8-win.cfg" + }, + { + "path": ".kokoro/continuous/java8-osx.cfg" + }, + { + "path": ".kokoro/continuous/common.cfg" + }, + { + "path": ".kokoro/nightly/dependencies.cfg" + }, + { + "path": ".kokoro/nightly/java7.cfg" + }, + { + "path": ".kokoro/nightly/integration.cfg" + }, + { + "path": ".kokoro/nightly/java11.cfg" + }, + { + "path": ".kokoro/nightly/java8.cfg" + }, + { + "path": ".kokoro/nightly/lint.cfg" + }, + { + "path": ".kokoro/nightly/java8-win.cfg" + }, + { + "path": ".kokoro/nightly/java8-osx.cfg" + }, + { + "path": ".kokoro/nightly/common.cfg" + }, + { + "path": ".kokoro/release/bump_snapshot.cfg" + }, + { + "path": ".kokoro/release/stage.sh" + }, + { + "path": ".kokoro/release/promote.sh" + }, + { + "path": ".kokoro/release/snapshot.sh" + }, + { + "path": ".kokoro/release/drop.cfg" + }, + { + "path": ".kokoro/release/snapshot.cfg" + }, + { + "path": ".kokoro/release/publish_javadoc.cfg" + }, + { + "path": ".kokoro/release/publish_javadoc.sh" + }, + { + "path": ".kokoro/release/bump_snapshot.sh" + }, + { + "path": ".kokoro/release/drop.sh" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": ".kokoro/release/common.sh" + }, + { + "path": ".kokoro/release/stage.cfg" + }, + { + "path": ".kokoro/release/promote.cfg" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": "grpc-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DashboardsServiceGrpc.java" + }, + { + "path": "__pycache__/synth.cpython-36.pyc" + }, + { + "path": "google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/DashboardsServiceClient.java" + }, + { + "path": "google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/GrpcDashboardsServiceCallableFactory.java" + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..7b15b427 --- /dev/null +++ b/synth.py @@ -0,0 +1,40 @@ +# Copyright 2018 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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +gapic = gcp.GAPICBazel() + +service = 'monitoring-dashboard' +versions = ['v1'] + +for version in versions: + library = java.bazel_library( + service=service, + version=version, + package_pattern='com.google.monitoring.dashboard.{version}', + gapic=gapic, + proto_path=f'google/monitoring/dashboard/{version}', + bazel_target=f'//google/monitoring/dashboard/{version}:google-cloud-monitoring-dashboard-{version}-java', + ) + +common_templates = gcp.CommonTemplates() +templates = common_templates.java_library() +s.copy(templates, excludes=[ + 'README.md', +]) \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..cfe0ff3f --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +proto-google-cloud-monitoring-dashboard-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-monitoring-dashboard-v1:0.0.0:0.0.1-SNAPSHOT +google-cloud-monitoring-dashboard:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file