diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 00000000..d4ca9418 --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0195b32f..d510359d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [7, 8, 11] + java: [8, 11] steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 @@ -42,19 +42,6 @@ jobs: java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh - linkage-monitor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - name: Install artifacts to local Maven repository - run: .kokoro/build.sh - shell: bash - - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) - uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/.kokoro/build.sh b/.kokoro/build.sh index c1c9a337..75da3504 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -115,7 +115,7 @@ fi # fix output location of logs bash .kokoro/coerce_logs.sh -if [[ "${ENABLE_BUILD_COP}" == "true" ]] +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] then chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-common-protos diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index 0048c8ec..e51c7b4c 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -22,7 +22,7 @@ env_vars: { } env_vars: { - key: "ENABLE_BUILD_COP" + key: "ENABLE_FLAKYBOT" value: "true" } diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index f2542931..9761fd86 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -33,6 +33,6 @@ env_vars: { } env_vars: { - key: "ENABLE_BUILD_COP" + key: "ENABLE_FLAKYBOT" value: "true" } diff --git a/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java b/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java new file mode 100644 index 00000000..64f38c1c --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java @@ -0,0 +1,1071 @@ +/* + * Copyright 2020 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/api/error_reason.proto + +package com.google.api; + +/** + * + * + *
+ * Defines the supported values for `google.rpc.ErrorInfo.reason` for the
+ * `googleapis.com` error domain. This error domain is reserved for [Service
+ * Infrastructure](https://cloud.google.com/service-infrastructure/docs/overview).
+ * For each error info of this domain, the metadata key "service" refers to the
+ * logical identifier of an API service, such as "pubsub.googleapis.com". The
+ * "consumer" refers to the entity that consumes an API Service. It typically is
+ * a Google project that owns the client application or the server resource,
+ * such as "projects/123". Other metadata keys are specific to each error
+ * reason. For more information, see the definition of the specific error
+ * reason.
+ * 
+ * + * Protobuf enum {@code google.api.ErrorReason} + */ +public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Do not use this default value.
+   * 
+ * + * ERROR_REASON_UNSPECIFIED = 0; + */ + ERROR_REASON_UNSPECIFIED(0), + /** + * + * + *
+   * The request is calling a disabled service for a consumer.
+   * Example of an ErrorInfo when the consumer "projects/123" contacting
+   * "pubsub.googleapis.com" service which is disabled:
+   *     { "reason": "SERVICE_DISABLED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "pubsub.googleapis.com"
+   *       }
+   *     }
+   * This response indicates the "pubsub.googleapis.com" has been disabled in
+   * "projects/123".
+   * 
+ * + * SERVICE_DISABLED = 1; + */ + SERVICE_DISABLED(1), + /** + * + * + *
+   * The request whose associated billing account is disabled.
+   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
+   * "pubsub.googleapis.com" service because the associated billing account is
+   * disabled:
+   *     { "reason": "BILLING_DISABLED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "pubsub.googleapis.com"
+   *       }
+   *     }
+   * This response indicates the billing account associated has been disabled.
+   * 
+ * + * BILLING_DISABLED = 2; + */ + BILLING_DISABLED(2), + /** + * + * + *
+   * The request is denied because the provided [API
+   * key](https://cloud.google.com/docs/authentication/api-keys) is invalid. It
+   * may be in a bad format, cannot be found, or has been expired).
+   * Example of an ErrorInfo when the request is contacting
+   * "storage.googleapis.com" service with an invalid API key:
+   *     { "reason": "API_KEY_INVALID",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *       }
+   *     }
+   * 
+ * + * API_KEY_INVALID = 3; + */ + API_KEY_INVALID(3), + /** + * + * + *
+   * The request is denied because it violates [API key API
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_api_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call the
+   * "storage.googleapis.com" service because this service is restricted in the
+   * API key:
+   *     { "reason": "API_KEY_SERVICE_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * API_KEY_SERVICE_BLOCKED = 4; + */ + API_KEY_SERVICE_BLOCKED(4), + /** + * + * + *
+   * The request is denied because it violates [API key HTTP
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_http_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the http referrer of the request
+   * violates API key HTTP restrictions:
+   *     { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com",
+   *       }
+   *     }
+   * 
+ * + * API_KEY_HTTP_REFERRER_BLOCKED = 7; + */ + API_KEY_HTTP_REFERRER_BLOCKED(7), + /** + * + * + *
+   * The request is denied because it violates [API key IP address
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the caller IP of the request
+   * violates API key IP address restrictions:
+   *     { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com",
+   *       }
+   *     }
+   * 
+ * + * API_KEY_IP_ADDRESS_BLOCKED = 8; + */ + API_KEY_IP_ADDRESS_BLOCKED(8), + /** + * + * + *
+   * The request is denied because it violates [API key Android application
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the request from the Android apps
+   * violates the API key Android application restrictions:
+   *     { "reason": "API_KEY_ANDROID_APP_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * API_KEY_ANDROID_APP_BLOCKED = 9; + */ + API_KEY_ANDROID_APP_BLOCKED(9), + /** + * + * + *
+   * The request is denied because it violates [API key iOS application
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the request from the iOS apps
+   * violates the API key iOS application restrictions:
+   *     { "reason": "API_KEY_IOS_APP_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * API_KEY_IOS_APP_BLOCKED = 13; + */ + API_KEY_IOS_APP_BLOCKED(13), + /** + * + * + *
+   * The request is denied because there is not enough rate quota for the
+   * consumer.
+   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
+   * "pubsub.googleapis.com" service because consumer's rate quota usage has
+   * reached the maximum value set for the quota limit
+   * "ReadsPerMinutePerProject" on the quota metric
+   * "pubsub.googleapis.com/read_requests":
+   *     { "reason": "RATE_LIMIT_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "pubsub.googleapis.com",
+   *         "quota_metric": "pubsub.googleapis.com/read_requests",
+   *         "quota_limit": "ReadsPerMinutePerProject"
+   *       }
+   *     }
+   * Example of an ErrorInfo when the consumer "projects/123" checks quota on
+   * the service "dataflow.googleapis.com" and hits the organization quota
+   * limit "DefaultRequestsPerMinutePerOrganization" on the metric
+   * "dataflow.googleapis.com/default_requests".
+   *     { "reason": "RATE_LIMIT_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "dataflow.googleapis.com",
+   *         "quota_metric": "dataflow.googleapis.com/default_requests",
+   *         "quota_limit": "DefaultRequestsPerMinutePerOrganization"
+   *       }
+   *     }
+   * 
+ * + * RATE_LIMIT_EXCEEDED = 5; + */ + RATE_LIMIT_EXCEEDED(5), + /** + * + * + *
+   * The request is denied because there is not enough resource quota for the
+   * consumer.
+   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
+   * "compute.googleapis.com" service because consumer's resource quota usage
+   * has reached the maximum value set for the quota limit "VMsPerProject"
+   * on the quota metric "compute.googleapis.com/vms":
+   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "compute.googleapis.com",
+   *         "quota_metric": "compute.googleapis.com/vms",
+   *         "quota_limit": "VMsPerProject"
+   *       }
+   *     }
+   * Example of an ErrorInfo when the consumer "projects/123" checks resource
+   * quota on the service "dataflow.googleapis.com" and hits the organization
+   * quota limit "jobs-per-organization" on the metric
+   * "dataflow.googleapis.com/job_count".
+   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "dataflow.googleapis.com",
+   *         "quota_metric": "dataflow.googleapis.com/job_count",
+   *         "quota_limit": "jobs-per-organization"
+   *       }
+   *     }
+   * 
+ * + * RESOURCE_QUOTA_EXCEEDED = 6; + */ + RESOURCE_QUOTA_EXCEEDED(6), + /** + * + * + *
+   * The request whose associated billing account address is in a tax restricted
+   * location, violates the local tax restrictions when creating resources in
+   * the restricted region.
+   * Example of an ErrorInfo when creating the Cloud Storage Bucket in the
+   * container "projects/123" under a tax restricted region
+   * "locations/asia-northeast3":
+   *     { "reason": "LOCATION_TAX_POLICY_VIOLATED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com",
+   *         "location": "locations/asia-northeast3"
+   *       }
+   *     }
+   * This response indicates creating the Cloud Storage Bucket in
+   * "locations/asia-northeast3" violates the location tax restriction.
+   * 
+ * + * LOCATION_TAX_POLICY_VIOLATED = 10; + */ + LOCATION_TAX_POLICY_VIOLATED(10), + /** + * + * + *
+   * The request is denied because the caller does not have required permission
+   * on the user project "projects/123" or the user project is invalid. For more
+   * information, check the [userProject System
+   * Parameters](https://cloud.google.com/apis/docs/system-parameters).
+   * Example of an ErrorInfo when the caller is calling Cloud Storage service
+   * with insufficient permissions on the user project:
+   *     { "reason": "USER_PROJECT_DENIED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * USER_PROJECT_DENIED = 11; + */ + USER_PROJECT_DENIED(11), + /** + * + * + *
+   * The request is denied because the consumer "projects/123" is suspended due
+   * to Terms of Service(Tos) violations. Check [Project suspension
+   * guidelines](https://cloud.google.com/resource-manager/docs/project-suspension-guidelines)
+   * for more information.
+   * Example of an ErrorInfo when calling Cloud Storage service with the
+   * suspended consumer "projects/123":
+   *     { "reason": "CONSUMER_SUSPENDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * CONSUMER_SUSPENDED = 12; + */ + CONSUMER_SUSPENDED(12), + /** + * + * + *
+   * The request is denied because the associated consumer is invalid. It may be
+   * in a bad format, cannot be found, or have been deleted.
+   * Example of an ErrorInfo when calling Cloud Storage service with the
+   * invalid consumer "projects/123":
+   *     { "reason": "CONSUMER_INVALID",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * CONSUMER_INVALID = 14; + */ + CONSUMER_INVALID(14), + /** + * + * + *
+   * The request is denied because it violates [VPC Service
+   * Controls](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * The 'uid' field is a random generated identifier that customer can use it
+   * to search the audit log for a request rejected by VPC Service Controls. For
+   * more information, please refer [VPC Service Controls
+   * Troubleshooting](https://cloud.google.com/vpc-service-controls/docs/troubleshooting#unique-id)
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * Cloud Storage service because the request is prohibited by the VPC Service
+   * Controls.
+   *     { "reason": "SECURITY_POLICY_VIOLATED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "uid": "123456789abcde",
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * SECURITY_POLICY_VIOLATED = 15; + */ + SECURITY_POLICY_VIOLATED(15), + /** + * + * + *
+   * The request is denied because the provided access token has expired.
+   * Example of an ErrorInfo when the request is calling Cloud Storage service
+   * with an expired access token:
+   *     { "reason": "ACCESS_TOKEN_EXPIRED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject"
+   *       }
+   *     }
+   * 
+ * + * ACCESS_TOKEN_EXPIRED = 16; + */ + ACCESS_TOKEN_EXPIRED(16), + /** + * + * + *
+   * The request is denied because the provided access token doesn't have at
+   * least one of the acceptable scopes required for the API. Please check
+   * [OAuth 2.0 Scopes for Google
+   * APIs](https://developers.google.com/identity/protocols/oauth2/scopes) for
+   * the list of the OAuth 2.0 scopes that you might need to request to access
+   * the API.
+   * Example of an ErrorInfo when the request is calling Cloud Storage service
+   * with an access token that is missing required scopes:
+   *     { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject"
+   *       }
+   *     }
+   * 
+ * + * ACCESS_TOKEN_SCOPE_INSUFFICIENT = 17; + */ + ACCESS_TOKEN_SCOPE_INSUFFICIENT(17), + /** + * + * + *
+   * The request is denied because the account associated with the provided
+   * access token is in an invalid state, such as disabled or deleted.
+   * For more information, see https://cloud.google.com/docs/authentication.
+   * Warning: For privacy reasons, the server may not be able to disclose the
+   * email address for some accounts. The client MUST NOT depend on the
+   * availability of the `email` attribute.
+   * Example of an ErrorInfo when the request is to the Cloud Storage API with
+   * an access token that is associated with a disabled or deleted [service
+   * account](http://cloud/iam/docs/service-accounts):
+   *     { "reason": "ACCOUNT_STATE_INVALID",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject",
+   *         "email": "user@123.iam.gserviceaccount.com"
+   *       }
+   *     }
+   * 
+ * + * ACCOUNT_STATE_INVALID = 18; + */ + ACCOUNT_STATE_INVALID(18), + /** + * + * + *
+   * The request is denied because the type of the provided access token is not
+   * supported by the API being called.
+   * Example of an ErrorInfo when the request is to the Cloud Storage API with
+   * an unsupported token type.
+   *     { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject"
+   *       }
+   *     }
+   * 
+ * + * ACCESS_TOKEN_TYPE_UNSUPPORTED = 19; + */ + ACCESS_TOKEN_TYPE_UNSUPPORTED(19), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Do not use this default value.
+   * 
+ * + * ERROR_REASON_UNSPECIFIED = 0; + */ + public static final int ERROR_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The request is calling a disabled service for a consumer.
+   * Example of an ErrorInfo when the consumer "projects/123" contacting
+   * "pubsub.googleapis.com" service which is disabled:
+   *     { "reason": "SERVICE_DISABLED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "pubsub.googleapis.com"
+   *       }
+   *     }
+   * This response indicates the "pubsub.googleapis.com" has been disabled in
+   * "projects/123".
+   * 
+ * + * SERVICE_DISABLED = 1; + */ + public static final int SERVICE_DISABLED_VALUE = 1; + /** + * + * + *
+   * The request whose associated billing account is disabled.
+   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
+   * "pubsub.googleapis.com" service because the associated billing account is
+   * disabled:
+   *     { "reason": "BILLING_DISABLED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "pubsub.googleapis.com"
+   *       }
+   *     }
+   * This response indicates the billing account associated has been disabled.
+   * 
+ * + * BILLING_DISABLED = 2; + */ + public static final int BILLING_DISABLED_VALUE = 2; + /** + * + * + *
+   * The request is denied because the provided [API
+   * key](https://cloud.google.com/docs/authentication/api-keys) is invalid. It
+   * may be in a bad format, cannot be found, or has been expired).
+   * Example of an ErrorInfo when the request is contacting
+   * "storage.googleapis.com" service with an invalid API key:
+   *     { "reason": "API_KEY_INVALID",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *       }
+   *     }
+   * 
+ * + * API_KEY_INVALID = 3; + */ + public static final int API_KEY_INVALID_VALUE = 3; + /** + * + * + *
+   * The request is denied because it violates [API key API
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_api_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call the
+   * "storage.googleapis.com" service because this service is restricted in the
+   * API key:
+   *     { "reason": "API_KEY_SERVICE_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * API_KEY_SERVICE_BLOCKED = 4; + */ + public static final int API_KEY_SERVICE_BLOCKED_VALUE = 4; + /** + * + * + *
+   * The request is denied because it violates [API key HTTP
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_http_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the http referrer of the request
+   * violates API key HTTP restrictions:
+   *     { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com",
+   *       }
+   *     }
+   * 
+ * + * API_KEY_HTTP_REFERRER_BLOCKED = 7; + */ + public static final int API_KEY_HTTP_REFERRER_BLOCKED_VALUE = 7; + /** + * + * + *
+   * The request is denied because it violates [API key IP address
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the caller IP of the request
+   * violates API key IP address restrictions:
+   *     { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com",
+   *       }
+   *     }
+   * 
+ * + * API_KEY_IP_ADDRESS_BLOCKED = 8; + */ + public static final int API_KEY_IP_ADDRESS_BLOCKED_VALUE = 8; + /** + * + * + *
+   * The request is denied because it violates [API key Android application
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the request from the Android apps
+   * violates the API key Android application restrictions:
+   *     { "reason": "API_KEY_ANDROID_APP_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * API_KEY_ANDROID_APP_BLOCKED = 9; + */ + public static final int API_KEY_ANDROID_APP_BLOCKED_VALUE = 9; + /** + * + * + *
+   * The request is denied because it violates [API key iOS application
+   * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * "storage.googleapis.com" service because the request from the iOS apps
+   * violates the API key iOS application restrictions:
+   *     { "reason": "API_KEY_IOS_APP_BLOCKED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * API_KEY_IOS_APP_BLOCKED = 13; + */ + public static final int API_KEY_IOS_APP_BLOCKED_VALUE = 13; + /** + * + * + *
+   * The request is denied because there is not enough rate quota for the
+   * consumer.
+   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
+   * "pubsub.googleapis.com" service because consumer's rate quota usage has
+   * reached the maximum value set for the quota limit
+   * "ReadsPerMinutePerProject" on the quota metric
+   * "pubsub.googleapis.com/read_requests":
+   *     { "reason": "RATE_LIMIT_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "pubsub.googleapis.com",
+   *         "quota_metric": "pubsub.googleapis.com/read_requests",
+   *         "quota_limit": "ReadsPerMinutePerProject"
+   *       }
+   *     }
+   * Example of an ErrorInfo when the consumer "projects/123" checks quota on
+   * the service "dataflow.googleapis.com" and hits the organization quota
+   * limit "DefaultRequestsPerMinutePerOrganization" on the metric
+   * "dataflow.googleapis.com/default_requests".
+   *     { "reason": "RATE_LIMIT_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "dataflow.googleapis.com",
+   *         "quota_metric": "dataflow.googleapis.com/default_requests",
+   *         "quota_limit": "DefaultRequestsPerMinutePerOrganization"
+   *       }
+   *     }
+   * 
+ * + * RATE_LIMIT_EXCEEDED = 5; + */ + public static final int RATE_LIMIT_EXCEEDED_VALUE = 5; + /** + * + * + *
+   * The request is denied because there is not enough resource quota for the
+   * consumer.
+   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
+   * "compute.googleapis.com" service because consumer's resource quota usage
+   * has reached the maximum value set for the quota limit "VMsPerProject"
+   * on the quota metric "compute.googleapis.com/vms":
+   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "compute.googleapis.com",
+   *         "quota_metric": "compute.googleapis.com/vms",
+   *         "quota_limit": "VMsPerProject"
+   *       }
+   *     }
+   * Example of an ErrorInfo when the consumer "projects/123" checks resource
+   * quota on the service "dataflow.googleapis.com" and hits the organization
+   * quota limit "jobs-per-organization" on the metric
+   * "dataflow.googleapis.com/job_count".
+   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "dataflow.googleapis.com",
+   *         "quota_metric": "dataflow.googleapis.com/job_count",
+   *         "quota_limit": "jobs-per-organization"
+   *       }
+   *     }
+   * 
+ * + * RESOURCE_QUOTA_EXCEEDED = 6; + */ + public static final int RESOURCE_QUOTA_EXCEEDED_VALUE = 6; + /** + * + * + *
+   * The request whose associated billing account address is in a tax restricted
+   * location, violates the local tax restrictions when creating resources in
+   * the restricted region.
+   * Example of an ErrorInfo when creating the Cloud Storage Bucket in the
+   * container "projects/123" under a tax restricted region
+   * "locations/asia-northeast3":
+   *     { "reason": "LOCATION_TAX_POLICY_VIOLATED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com",
+   *         "location": "locations/asia-northeast3"
+   *       }
+   *     }
+   * This response indicates creating the Cloud Storage Bucket in
+   * "locations/asia-northeast3" violates the location tax restriction.
+   * 
+ * + * LOCATION_TAX_POLICY_VIOLATED = 10; + */ + public static final int LOCATION_TAX_POLICY_VIOLATED_VALUE = 10; + /** + * + * + *
+   * The request is denied because the caller does not have required permission
+   * on the user project "projects/123" or the user project is invalid. For more
+   * information, check the [userProject System
+   * Parameters](https://cloud.google.com/apis/docs/system-parameters).
+   * Example of an ErrorInfo when the caller is calling Cloud Storage service
+   * with insufficient permissions on the user project:
+   *     { "reason": "USER_PROJECT_DENIED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * USER_PROJECT_DENIED = 11; + */ + public static final int USER_PROJECT_DENIED_VALUE = 11; + /** + * + * + *
+   * The request is denied because the consumer "projects/123" is suspended due
+   * to Terms of Service(Tos) violations. Check [Project suspension
+   * guidelines](https://cloud.google.com/resource-manager/docs/project-suspension-guidelines)
+   * for more information.
+   * Example of an ErrorInfo when calling Cloud Storage service with the
+   * suspended consumer "projects/123":
+   *     { "reason": "CONSUMER_SUSPENDED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * CONSUMER_SUSPENDED = 12; + */ + public static final int CONSUMER_SUSPENDED_VALUE = 12; + /** + * + * + *
+   * The request is denied because the associated consumer is invalid. It may be
+   * in a bad format, cannot be found, or have been deleted.
+   * Example of an ErrorInfo when calling Cloud Storage service with the
+   * invalid consumer "projects/123":
+   *     { "reason": "CONSUMER_INVALID",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * CONSUMER_INVALID = 14; + */ + public static final int CONSUMER_INVALID_VALUE = 14; + /** + * + * + *
+   * The request is denied because it violates [VPC Service
+   * Controls](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * The 'uid' field is a random generated identifier that customer can use it
+   * to search the audit log for a request rejected by VPC Service Controls. For
+   * more information, please refer [VPC Service Controls
+   * Troubleshooting](https://cloud.google.com/vpc-service-controls/docs/troubleshooting#unique-id)
+   * Example of an ErrorInfo when the consumer "projects/123" fails to call
+   * Cloud Storage service because the request is prohibited by the VPC Service
+   * Controls.
+   *     { "reason": "SECURITY_POLICY_VIOLATED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "uid": "123456789abcde",
+   *         "consumer": "projects/123",
+   *         "service": "storage.googleapis.com"
+   *       }
+   *     }
+   * 
+ * + * SECURITY_POLICY_VIOLATED = 15; + */ + public static final int SECURITY_POLICY_VIOLATED_VALUE = 15; + /** + * + * + *
+   * The request is denied because the provided access token has expired.
+   * Example of an ErrorInfo when the request is calling Cloud Storage service
+   * with an expired access token:
+   *     { "reason": "ACCESS_TOKEN_EXPIRED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject"
+   *       }
+   *     }
+   * 
+ * + * ACCESS_TOKEN_EXPIRED = 16; + */ + public static final int ACCESS_TOKEN_EXPIRED_VALUE = 16; + /** + * + * + *
+   * The request is denied because the provided access token doesn't have at
+   * least one of the acceptable scopes required for the API. Please check
+   * [OAuth 2.0 Scopes for Google
+   * APIs](https://developers.google.com/identity/protocols/oauth2/scopes) for
+   * the list of the OAuth 2.0 scopes that you might need to request to access
+   * the API.
+   * Example of an ErrorInfo when the request is calling Cloud Storage service
+   * with an access token that is missing required scopes:
+   *     { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject"
+   *       }
+   *     }
+   * 
+ * + * ACCESS_TOKEN_SCOPE_INSUFFICIENT = 17; + */ + public static final int ACCESS_TOKEN_SCOPE_INSUFFICIENT_VALUE = 17; + /** + * + * + *
+   * The request is denied because the account associated with the provided
+   * access token is in an invalid state, such as disabled or deleted.
+   * For more information, see https://cloud.google.com/docs/authentication.
+   * Warning: For privacy reasons, the server may not be able to disclose the
+   * email address for some accounts. The client MUST NOT depend on the
+   * availability of the `email` attribute.
+   * Example of an ErrorInfo when the request is to the Cloud Storage API with
+   * an access token that is associated with a disabled or deleted [service
+   * account](http://cloud/iam/docs/service-accounts):
+   *     { "reason": "ACCOUNT_STATE_INVALID",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject",
+   *         "email": "user@123.iam.gserviceaccount.com"
+   *       }
+   *     }
+   * 
+ * + * ACCOUNT_STATE_INVALID = 18; + */ + public static final int ACCOUNT_STATE_INVALID_VALUE = 18; + /** + * + * + *
+   * The request is denied because the type of the provided access token is not
+   * supported by the API being called.
+   * Example of an ErrorInfo when the request is to the Cloud Storage API with
+   * an unsupported token type.
+   *     { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
+   *       "domain": "googleapis.com",
+   *       "metadata": {
+   *         "service": "storage.googleapis.com",
+   *         "method": "google.storage.v1.Storage.GetObject"
+   *       }
+   *     }
+   * 
+ * + * ACCESS_TOKEN_TYPE_UNSUPPORTED = 19; + */ + public static final int ACCESS_TOKEN_TYPE_UNSUPPORTED_VALUE = 19; + + 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 ErrorReason 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 ErrorReason forNumber(int value) { + switch (value) { + case 0: + return ERROR_REASON_UNSPECIFIED; + case 1: + return SERVICE_DISABLED; + case 2: + return BILLING_DISABLED; + case 3: + return API_KEY_INVALID; + case 4: + return API_KEY_SERVICE_BLOCKED; + case 7: + return API_KEY_HTTP_REFERRER_BLOCKED; + case 8: + return API_KEY_IP_ADDRESS_BLOCKED; + case 9: + return API_KEY_ANDROID_APP_BLOCKED; + case 13: + return API_KEY_IOS_APP_BLOCKED; + case 5: + return RATE_LIMIT_EXCEEDED; + case 6: + return RESOURCE_QUOTA_EXCEEDED; + case 10: + return LOCATION_TAX_POLICY_VIOLATED; + case 11: + return USER_PROJECT_DENIED; + case 12: + return CONSUMER_SUSPENDED; + case 14: + return CONSUMER_INVALID; + case 15: + return SECURITY_POLICY_VIOLATED; + case 16: + return ACCESS_TOKEN_EXPIRED; + case 17: + return ACCESS_TOKEN_SCOPE_INSUFFICIENT; + case 18: + return ACCOUNT_STATE_INVALID; + case 19: + return ACCESS_TOKEN_TYPE_UNSUPPORTED; + 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 ErrorReason findValueByNumber(int number) { + return ErrorReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.ErrorReasonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ErrorReason[] VALUES = values(); + + public static ErrorReason 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 ErrorReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.ErrorReason) +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java b/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java new file mode 100644 index 00000000..9bdb05a4 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java @@ -0,0 +1,64 @@ +/* + * Copyright 2020 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/api/error_reason.proto + +package com.google.api; + +public final class ErrorReasonProto { + private ErrorReasonProto() {} + + 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\035google/api/error_reason.proto\022\ngoogle." + + "api*\304\004\n\013ErrorReason\022\034\n\030ERROR_REASON_UNSP" + + "ECIFIED\020\000\022\024\n\020SERVICE_DISABLED\020\001\022\024\n\020BILLI" + + "NG_DISABLED\020\002\022\023\n\017API_KEY_INVALID\020\003\022\033\n\027AP" + + "I_KEY_SERVICE_BLOCKED\020\004\022!\n\035API_KEY_HTTP_" + + "REFERRER_BLOCKED\020\007\022\036\n\032API_KEY_IP_ADDRESS" + + "_BLOCKED\020\010\022\037\n\033API_KEY_ANDROID_APP_BLOCKE" + + "D\020\t\022\033\n\027API_KEY_IOS_APP_BLOCKED\020\r\022\027\n\023RATE" + + "_LIMIT_EXCEEDED\020\005\022\033\n\027RESOURCE_QUOTA_EXCE" + + "EDED\020\006\022 \n\034LOCATION_TAX_POLICY_VIOLATED\020\n" + + "\022\027\n\023USER_PROJECT_DENIED\020\013\022\026\n\022CONSUMER_SU" + + "SPENDED\020\014\022\024\n\020CONSUMER_INVALID\020\016\022\034\n\030SECUR" + + "ITY_POLICY_VIOLATED\020\017\022\030\n\024ACCESS_TOKEN_EX" + + "PIRED\020\020\022#\n\037ACCESS_TOKEN_SCOPE_INSUFFICIE" + + "NT\020\021\022\031\n\025ACCOUNT_STATE_INVALID\020\022\022!\n\035ACCES" + + "S_TOKEN_TYPE_UNSUPPORTED\020\023Bp\n\016com.google" + + ".apiB\020ErrorReasonProtoP\001ZCgoogle.golang." + + "org/genproto/googleapis/api/error_reason" + + ";error_reason\242\002\004GAPIb\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-common-protos/src/main/java/com/google/cloud/ExtendedOperationsProto.java b/proto-google-common-protos/src/main/java/com/google/cloud/ExtendedOperationsProto.java new file mode 100644 index 00000000..e5215cdc --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/ExtendedOperationsProto.java @@ -0,0 +1,181 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/extended_operations.proto + +package com.google.cloud; + +public final class ExtendedOperationsProto { + private ExtendedOperationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.cloud.ExtendedOperationsProto.operationField); + registry.add(com.google.cloud.ExtendedOperationsProto.operationRequestField); + registry.add(com.google.cloud.ExtendedOperationsProto.operationResponseField); + registry.add(com.google.cloud.ExtendedOperationsProto.operationService); + registry.add(com.google.cloud.ExtendedOperationsProto.operationPollingMethod); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int OPERATION_FIELD_FIELD_NUMBER = 1149; + /** + * + * + *
+   * A field annotation that maps fields in an API-specific Operation object to
+   * their standard counterparts in google.longrunning.Operation. See
+   * OperationResponseMapping enum definition.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + com.google.cloud.OperationResponseMapping> + operationField = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.cloud.OperationResponseMapping.class, null); + + public static final int OPERATION_REQUEST_FIELD_FIELD_NUMBER = 1150; + /** + * + * + *
+   * A field annotation that maps fields in the initial request message
+   * (the one which started the LRO) to their counterparts in the polling
+   * request message. For non-standard LRO, the polling response may be missing
+   * some of the information needed to make a subsequent polling request. The
+   * missing information (for example, project or region ID) is contained in the
+   * fields of the initial request message that this annotation must be applied
+   * to. The string value of the annotation corresponds to the name of the
+   * counterpart field in the polling request message that the annotated field's
+   * value will be copied to.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, java.lang.String> + operationRequestField = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + java.lang.String.class, null); + + public static final int OPERATION_RESPONSE_FIELD_FIELD_NUMBER = 1151; + /** + * + * + *
+   * A field annotation that maps fields in the polling request message to their
+   * counterparts in the initial and/or polling response message. The initial
+   * and the polling methods return an API-specific Operation object. Some of
+   * the fields from that response object must be reused in the subsequent
+   * request (like operation name/ID) to fully identify the polled operation.
+   * This annotation must be applied to the fields in the polling request
+   * message, the string value of the annotation must correspond to the name of
+   * the counterpart field in the Operation response object whose value will be
+   * copied to the annotated field.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, java.lang.String> + operationResponseField = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + java.lang.String.class, null); + + public static final int OPERATION_SERVICE_FIELD_NUMBER = 1249; + /** + * + * + *
+   * A method annotation that maps an LRO method (the one which starts an LRO)
+   * to the service, which will be used to poll for the operation status. The
+   * annotation must be applied to the method which starts an LRO, the string
+   * value of the annotation must correspond to the name of the service used to
+   * poll for the operation status.
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, java.lang.String> + operationService = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + java.lang.String.class, null); + + public static final int OPERATION_POLLING_METHOD_FIELD_NUMBER = 1250; + /** + * + * + *
+   * A method annotation that marks methods that can be used for polling
+   * operation status (e.g. the MyPollingService.Get(MyPollingRequest) method).
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, java.lang.Boolean> + operationPollingMethod = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + java.lang.Boolean.class, null); + + 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/cloud/extended_operations.proto" + + "\022\014google.cloud\032 google/protobuf/descript" + + "or.proto*b\n\030OperationResponseMapping\022\r\n\t" + + "UNDEFINED\020\000\022\010\n\004NAME\020\001\022\n\n\006STATUS\020\002\022\016\n\nERR" + + "OR_CODE\020\003\022\021\n\rERROR_MESSAGE\020\004:_\n\017operatio" + + "n_field\022\035.google.protobuf.FieldOptions\030\375" + + "\010 \001(\0162&.google.cloud.OperationResponseMa" + + "pping:?\n\027operation_request_field\022\035.googl" + + "e.protobuf.FieldOptions\030\376\010 \001(\t:@\n\030operat" + + "ion_response_field\022\035.google.protobuf.Fie" + + "ldOptions\030\377\010 \001(\t::\n\021operation_service\022\036." + + "google.protobuf.MethodOptions\030\341\t \001(\t:A\n\030" + + "operation_polling_method\022\036.google.protob" + + "uf.MethodOptions\030\342\t \001(\010By\n\020com.google.cl" + + "oudB\027ExtendedOperationsProtoP\001ZCgoogle.g" + + "olang.org/genproto/googleapis/cloud/exte" + + "ndedops;extendedops\242\002\004GAPIb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + operationField.internalInit(descriptor.getExtensions().get(0)); + operationRequestField.internalInit(descriptor.getExtensions().get(1)); + operationResponseField.internalInit(descriptor.getExtensions().get(2)); + operationService.internalInit(descriptor.getExtensions().get(3)); + operationPollingMethod.internalInit(descriptor.getExtensions().get(4)); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-common-protos/src/main/java/com/google/cloud/OperationResponseMapping.java b/proto-google-common-protos/src/main/java/com/google/cloud/OperationResponseMapping.java new file mode 100644 index 00000000..212af822 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/cloud/OperationResponseMapping.java @@ -0,0 +1,242 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/extended_operations.proto + +package com.google.cloud; + +/** + * + * + *
+ * An enum to be used to mark the essential (for polling) fields in an
+ * API-specific Operation object. A custom Operation object may contain many
+ * different fields, but only few of them are essential to conduct a successful
+ * polling process.
+ * 
+ * + * Protobuf enum {@code google.cloud.OperationResponseMapping} + */ +public enum OperationResponseMapping implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Do not use.
+   * 
+ * + * UNDEFINED = 0; + */ + UNDEFINED(0), + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.name.
+   * 
+ * + * NAME = 1; + */ + NAME(1), + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.done. If the annotated field is of
+   * an enum type, `annotated_field_name == EnumType.DONE` semantics should be
+   * equivalent to `Operation.done == true`. If the annotated field is of type
+   * boolean, then it should follow the same semantics as Operation.done.
+   * Otherwise, a non-empty value should be treated as `Operation.done == true`.
+   * 
+ * + * STATUS = 2; + */ + STATUS(2), + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.error.code.
+   * 
+ * + * ERROR_CODE = 3; + */ + ERROR_CODE(3), + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.error.message.
+   * 
+ * + * ERROR_MESSAGE = 4; + */ + ERROR_MESSAGE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Do not use.
+   * 
+ * + * UNDEFINED = 0; + */ + public static final int UNDEFINED_VALUE = 0; + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.name.
+   * 
+ * + * NAME = 1; + */ + public static final int NAME_VALUE = 1; + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.done. If the annotated field is of
+   * an enum type, `annotated_field_name == EnumType.DONE` semantics should be
+   * equivalent to `Operation.done == true`. If the annotated field is of type
+   * boolean, then it should follow the same semantics as Operation.done.
+   * Otherwise, a non-empty value should be treated as `Operation.done == true`.
+   * 
+ * + * STATUS = 2; + */ + public static final int STATUS_VALUE = 2; + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.error.code.
+   * 
+ * + * ERROR_CODE = 3; + */ + public static final int ERROR_CODE_VALUE = 3; + /** + * + * + *
+   * A field in an API-specific (custom) Operation object which carries the same
+   * meaning as google.longrunning.Operation.error.message.
+   * 
+ * + * ERROR_MESSAGE = 4; + */ + public static final int ERROR_MESSAGE_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 OperationResponseMapping 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 OperationResponseMapping forNumber(int value) { + switch (value) { + case 0: + return UNDEFINED; + case 1: + return NAME; + case 2: + return STATUS; + case 3: + return ERROR_CODE; + case 4: + return ERROR_MESSAGE; + 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 OperationResponseMapping findValueByNumber(int number) { + return OperationResponseMapping.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.ExtendedOperationsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final OperationResponseMapping[] VALUES = values(); + + public static OperationResponseMapping 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 OperationResponseMapping(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.OperationResponseMapping) +} diff --git a/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java b/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java new file mode 100644 index 00000000..87998f0f --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java @@ -0,0 +1,821 @@ +/* + * Copyright 2020 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/type/localized_text.proto + +package com.google.type; + +/** + * + * + *
+ * Localized variant of a text in a particular language.
+ * 
+ * + * Protobuf type {@code google.type.LocalizedText} + */ +public final class LocalizedText extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.type.LocalizedText) + LocalizedTextOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocalizedText.newBuilder() to construct. + private LocalizedText(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocalizedText() { + text_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocalizedText(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LocalizedText( + 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(); + + text_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = 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.type.LocalizedTextProto.internal_static_google_type_LocalizedText_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.type.LocalizedTextProto + .internal_static_google_type_LocalizedText_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.type.LocalizedText.class, com.google.type.LocalizedText.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + private volatile java.lang.Object text_; + /** + * + * + *
+   * Localized string in the language corresponding to `language_code' below.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * + * + *
+   * Localized string in the language corresponding to `language_code' below.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+   * For more information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + * + * + *
+   * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+   * For more information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = 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 (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + } + 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.type.LocalizedText)) { + return super.equals(obj); + } + com.google.type.LocalizedText other = (com.google.type.LocalizedText) obj; + + if (!getText().equals(other.getText())) return false; + if (!getLanguageCode().equals(other.getLanguageCode())) 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) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.type.LocalizedText parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.type.LocalizedText parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.type.LocalizedText parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.type.LocalizedText 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.type.LocalizedText parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.type.LocalizedText parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.type.LocalizedText parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.type.LocalizedText 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.type.LocalizedText parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.type.LocalizedText 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.type.LocalizedText parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.type.LocalizedText 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.type.LocalizedText 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; + } + /** + * + * + *
+   * Localized variant of a text in a particular language.
+   * 
+ * + * Protobuf type {@code google.type.LocalizedText} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.type.LocalizedText) + com.google.type.LocalizedTextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.type.LocalizedTextProto + .internal_static_google_type_LocalizedText_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.type.LocalizedTextProto + .internal_static_google_type_LocalizedText_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.type.LocalizedText.class, com.google.type.LocalizedText.Builder.class); + } + + // Construct using com.google.type.LocalizedText.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(); + text_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.type.LocalizedTextProto + .internal_static_google_type_LocalizedText_descriptor; + } + + @java.lang.Override + public com.google.type.LocalizedText getDefaultInstanceForType() { + return com.google.type.LocalizedText.getDefaultInstance(); + } + + @java.lang.Override + public com.google.type.LocalizedText build() { + com.google.type.LocalizedText result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.type.LocalizedText buildPartial() { + com.google.type.LocalizedText result = new com.google.type.LocalizedText(this); + result.text_ = text_; + result.languageCode_ = languageCode_; + 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.type.LocalizedText) { + return mergeFrom((com.google.type.LocalizedText) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.type.LocalizedText other) { + if (other == com.google.type.LocalizedText.getDefaultInstance()) return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + 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.type.LocalizedText parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.type.LocalizedText) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object text_ = ""; + /** + * + * + *
+     * Localized string in the language corresponding to `language_code' below.
+     * 
+ * + * string text = 1; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Localized string in the language corresponding to `language_code' below.
+     * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Localized string in the language corresponding to `language_code' below.
+     * 
+ * + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Localized string in the language corresponding to `language_code' below.
+     * 
+ * + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + * + * + *
+     * Localized string in the language corresponding to `language_code' below.
+     * 
+ * + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + * + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+     * For more information, see
+     * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+     * 
+ * + * string language_code = 2; + * + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = 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.type.LocalizedText) + } + + // @@protoc_insertion_point(class_scope:google.type.LocalizedText) + private static final com.google.type.LocalizedText DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.type.LocalizedText(); + } + + public static com.google.type.LocalizedText getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalizedText parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocalizedText(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.type.LocalizedText getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java new file mode 100644 index 00000000..c1038869 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 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/type/localized_text.proto + +package com.google.type; + +public interface LocalizedTextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.type.LocalizedText) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Localized string in the language corresponding to `language_code' below.
+   * 
+ * + * string text = 1; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * Localized string in the language corresponding to `language_code' below.
+   * 
+ * + * string text = 1; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+   * For more information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
+   * For more information, see
+   * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
+   * 
+ * + * string language_code = 2; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java b/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java new file mode 100644 index 00000000..4d1559b6 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 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/type/localized_text.proto + +package com.google.type; + +public final class LocalizedTextProto { + private LocalizedTextProto() {} + + 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_type_LocalizedText_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_type_LocalizedText_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/type/localized_text.proto\022\013goog" + + "le.type\"4\n\rLocalizedText\022\014\n\004text\030\001 \001(\t\022\025" + + "\n\rlanguage_code\030\002 \001(\tBz\n\017com.google.type" + + "B\022LocalizedTextProtoP\001ZHgoogle.golang.or" + + "g/genproto/googleapis/type/localized_tex" + + "t;localized_text\370\001\001\242\002\003GTPb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_type_LocalizedText_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_LocalizedText_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_type_LocalizedText_descriptor, + new java.lang.String[] { + "Text", "LanguageCode", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto b/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto deleted file mode 100644 index f3a87ac5..00000000 --- a/proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto +++ /dev/null @@ -1,1184 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.audit; - -import "google/iam/v1/policy.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Audit"; -option go_package = "google.golang.org/genproto/googleapis/cloud/audit;audit"; -option java_multiple_files = true; -option java_outer_classname = "BigQueryAuditMetadataProto"; -option java_package = "com.google.cloud.audit"; -option objc_class_prefix = "GCA"; -option php_namespace = "Google\\Cloud\\Audit"; - -// Audit log format for BigQuery cloud audit logs metadata. -// -message BigQueryAuditMetadata { - // Job insertion event. - message JobInsertion { - // Describes how the job was inserted. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Job was inserted using the jobs.insert API. - JOB_INSERT_REQUEST = 1; - - // Job was inserted using the jobs.query RPC. - QUERY_REQUEST = 2; - } - - // Job metadata. - Job job = 1; - - // Describes how the job was inserted. - Reason reason = 2; - } - - // Job state change event. - message JobChange { - // Job state before the job state change. - JobState before = 1; - - // Job state after the job state change. - JobState after = 2; - - // Job metadata. - Job job = 3; - } - - // Dataset creation event. - message DatasetCreation { - // Describes how the dataset was created. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Dataset was created using the datasets.create API. - CREATE = 1; - - // Dataset was created using a query job, e.g., CREATE SCHEMA statement. - QUERY = 2; - } - - // Dataset metadata. - Dataset dataset = 1; - - // Describes how the dataset was created. - Reason reason = 2; - - // The URI of the job that created the dataset. - // Present if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 3; - } - - // Dataset change event. - message DatasetChange { - // Describes how the dataset was changed. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Dataset was changed using the datasets.update or datasets.patch API. - UPDATE = 1; - - // Dataset was changed using the SetIamPolicy API. - SET_IAM_POLICY = 2; - - // Dataset was changed using a query job, e.g., ALTER SCHEMA statement. - QUERY = 3; - } - - // Dataset metadata after the change. - Dataset dataset = 1; - - // Describes how the dataset was changed. - Reason reason = 2; - - // The URI of the job that updated the dataset. - // Present if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 3; - } - - // Dataset deletion event. - message DatasetDeletion { - // Describes how the dataset was deleted. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Dataset was deleted using the datasets.delete API. - DELETE = 1; - - // Dataset was deleted using a query job, e.g., DROP SCHEMA statement. - QUERY = 2; - } - - // Describes how the dataset was deleted. - Reason reason = 1; - - // The URI of the job that deleted the dataset. - // Present if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 2; - } - - // Table creation event. - message TableCreation { - // Describes how the table was created. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Table was created as a destination table during a query, load or copy - // job. - JOB = 1; - - // Table was created using a DDL query. - QUERY = 2; - - // Table was created using the tables.create API. - TABLE_INSERT_REQUEST = 3; - } - - // Table metadata. - Table table = 1; - - // Describes how the table was created. - Reason reason = 3; - - // The URI of the job that created a table. - // Present if the reason is JOB or QUERY. - // - // Format: `projects//jobs/`. - string job_name = 4; - } - - // Model creation event. - message ModelCreation { - // Describes how the model was created. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Model was created using a DDL query. - QUERY = 2; - } - - // Model metadata. - Model model = 1; - - // Describes how the model was created. - Reason reason = 3; - - // The URI of the job that created the model. - // - // Format: `projects//jobs/`. - string job_name = 4; - } - - // Routine creation event. - message RoutineCreation { - // Describes how the routine was created. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Routine was created using a DDL query. - QUERY = 1; - - // Routine was created using the routines.create API. - ROUTINE_INSERT_REQUEST = 2; - } - - // Created routine. - Routine routine = 1; - - // Describes how the routine was created. - Reason reason = 3; - - // The URI of the job that created the routine. - // - // Format: `projects//jobs/`. - string job_name = 4; - } - - // Table data read event. - message TableDataRead { - // Describes how the table data was read. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Table was used as a source table during a BigQuery job. - JOB = 1; - - // Table data was accessed using the tabledata.list API. - TABLEDATA_LIST_REQUEST = 2; - - // Table data was accessed using the jobs.getQueryResults API. - GET_QUERY_RESULTS_REQUEST = 3; - - // Table data was accessed using the jobs.query RPC. - QUERY_REQUEST = 4; - - // Table data was accessed using storage.CreateReadSession API. - CREATE_READ_SESSION = 5; - - // Table data was accessed during a materialized view refresh. - MATERIALIZED_VIEW_REFRESH = 6; - } - - // List of the accessed fields. Entire list is truncated if the record size - // exceeds 100K. - repeated string fields = 2; - - // True if the fields list was truncated. - bool fields_truncated = 8; - - // List of the referenced policy tags. That is, policy tags attached to the - // accessed fields or their ancestors. - // Policy tag resource name is a string of the format: - // `projects//locations//taxonomies//policyTags/` - repeated string policy_tags = 9; - - // True if the policy tag list was truncated. At most 100 policy tags can be - // saved. - bool policy_tags_truncated = 10; - - // Describes how the table data was read. - Reason reason = 3; - - // The URI of the job that read a table. - // Present if the reason is JOB but can be redacted for privacy reasons. - // - // Format: `projects//jobs/`. - string job_name = 4; - - // The URI of the read session that read a table. - // Present if the reason is CREATE_READ_SESSION. - // - // Format: - // `projects//locations//sessions/`. - string session_name = 5; - } - - // Table metadata change event. - message TableChange { - // Describes how the table metadata was changed. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Table metadata was updated using the tables.update or tables.patch API. - TABLE_UPDATE_REQUEST = 1; - - // Table was used as a job destination table. - JOB = 2; - - // Table metadata was updated using a DML or DDL query. - QUERY = 3; - } - - // Updated table metadata. - Table table = 1; - - // True if the table was truncated. - bool truncated = 4; - - // Describes how the table metadata was changed. - Reason reason = 5; - - // The URI of the job that changed a table. - // Present if the reason is JOB or QUERY. - // - // Format: `projects//jobs/`. - string job_name = 6; - } - - // Model metadata change event. - message ModelMetadataChange { - // Describes how the model metadata was changed. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Model metadata was updated using the models.patch API. - MODEL_PATCH_REQUEST = 1; - - // Model metadata was updated using a DDL query. - QUERY = 2; - } - - // Updated model. - Model model = 1; - - // Describes how the model metadata was changed. - Reason reason = 2; - - // The URI of the job that changed the model metadata. - // Present if and only if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 3; - } - - // Routine change event. - message RoutineChange { - // Describes how the routine was updated. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Routine was updated using a DDL query. - QUERY = 1; - - // Routine was updated using the routines.update or routines.patch API. - ROUTINE_UPDATE_REQUEST = 2; - } - - // Updated routine. - Routine routine = 1; - - // Describes how the routine was updated. - Reason reason = 3; - - // The URI of the job that updated the routine. - // - // Format: `projects//jobs/`. - string job_name = 4; - } - - // Table data change event. - message TableDataChange { - // Describes how the table data was changed. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Table was used as a job destination table. - JOB = 1; - - // Table data was updated using a DML or DDL query. - QUERY = 2; - - // Table data was updated during a materialized view refresh. - MATERIALIZED_VIEW_REFRESH = 3; - - // Table data was added using the Write API. - WRITE_API = 4; - } - - // Number of deleted rows. - int64 deleted_rows_count = 1; - - // Number of inserted rows. - int64 inserted_rows_count = 2; - - // True if the table was truncated. - bool truncated = 3; - - // Describes how the table data was changed. - Reason reason = 4; - - // The URI of the job that changed a table. - // - // Format: `projects//jobs/`. - string job_name = 5; - - // If written from WRITE_API, the name of the stream. - // - // Format: - // `projects//datasets//tables//streams/` - string stream_name = 6; - } - - // Model data change event. - message ModelDataChange { - // Describes how the model data was changed. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Model data was changed using a DDL query. - QUERY = 1; - } - - // Describes how the model data was changed. - Reason reason = 1; - - // The URI of the job that changed the model data. - // - // Format: `projects//jobs/`. - string job_name = 2; - } - - // Model data read event. - message ModelDataRead { - // Describes how the model data was read. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Model was used as a source model during a BigQuery job. - JOB = 1; - } - - // Describes how the model data was read. - Reason reason = 1; - - // The URI of the job that read the model data. - // - // Format: `projects//jobs/`. - string job_name = 2; - } - - // BigQuery dataset. - message Dataset { - // Dataset URI. - // - // Format: `projects//datasets/`. - string dataset_name = 1; - - // Dataset creation time. - google.protobuf.Timestamp create_time = 3; - - // Dataset metadata last update time. - google.protobuf.Timestamp update_time = 4; - - // The access control list for the dataset. - BigQueryAcl acl = 5; - - // Default expiration time for tables in the dataset. - google.protobuf.Duration default_table_expire_duration = 6; - - // User-provided metadata for the dataset. - EntityInfo dataset_info = 7; - - // Default encryption for tables in the dataset. - EncryptionInfo default_encryption = 8; - } - - // Table deletion event. - message TableDeletion { - // Describes how the table was deleted. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Table was deleted using the tables.delete API. - TABLE_DELETE_REQUEST = 2; - - // Table expired. - EXPIRED = 3; - - // Table deleted using a DDL query. - QUERY = 4; - } - - // Describes how the table was deleted. - Reason reason = 1; - - // The URI of the job that deleted a table. - // Present if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 2; - } - - // Model deletion event. - message ModelDeletion { - // Describes how the model was deleted. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Model was deleted using the models.delete API. - MODEL_DELETE_REQUEST = 1; - - // Model expired. - EXPIRED = 2; - - // Model was deleted using DDL query. - QUERY = 3; - } - - // Describes how the model was deleted. - Reason reason = 1; - - // The URI of the job that deleted a model. - // Present if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 2; - } - - // Trained BigQuery ML model. - message Model { - // Model URI. - // - // Format: `projects//datasets//models/`. - string model_name = 1; - - // User-provided metadata for the model. - EntityInfo model_info = 2; - - // Model expiration time. - google.protobuf.Timestamp expire_time = 5; - - // Model creation time. - google.protobuf.Timestamp create_time = 6; - - // Model last update time. - google.protobuf.Timestamp update_time = 7; - - // Model encryption information. Set when non-default encryption is used. - EncryptionInfo encryption = 8; - } - - // Routine deletion event. - message RoutineDeletion { - // Describes how the routine was deleted. - enum Reason { - // Unknown. - REASON_UNSPECIFIED = 0; - - // Routine was deleted using DDL query. - QUERY = 1; - - // Routine was deleted using the API. - ROUTINE_DELETE_REQUEST = 2; - } - - // Deleted routine. - Routine routine = 1; - - // Describes how the routine was deleted. - Reason reason = 3; - - // The URI of the job that deleted the routine. - // Present if the reason is QUERY. - // - // Format: `projects//jobs/`. - string job_name = 4; - } - - // BigQuery job. - message Job { - // Job URI. - // - // Format: `projects//jobs/`. - string job_name = 1; - - // Job configuration. - JobConfig job_config = 2; - - // Job status. - JobStatus job_status = 3; - - // Job statistics. - JobStats job_stats = 4; - } - - // Job configuration. - // See the [Jobs](https://cloud.google.com/bigquery/docs/reference/v2/jobs) - // API resource for more details on individual fields. - message JobConfig { - // Query job configuration. - message Query { - // Priority given to the query. - enum Priority { - // Unknown. - PRIORITY_UNSPECIFIED = 0; - - // Interactive query. - QUERY_INTERACTIVE = 1; - - // Batch query. - QUERY_BATCH = 2; - } - - // The SQL query to run. Truncated if exceeds 50K. - string query = 1; - - // True if the query field was truncated. - bool query_truncated = 10; - - // The destination table for the query results. - string destination_table = 2; - - // Destination table create disposition. - CreateDisposition create_disposition = 3; - - // Destination table write disposition. - WriteDisposition write_disposition = 4; - - // Default dataset for the query. - string default_dataset = 5; - - // External data sources used in the query. - repeated TableDefinition table_definitions = 6; - - // Priority given to the query. - Priority priority = 7; - - // Result table encryption information. Set when non-default encryption is - // used. - EncryptionInfo destination_table_encryption = 8; - - // Type of the query. - QueryStatementType statement_type = 9; - } - - // Load job configuration. - message Load { - // URIs for the data to be imported. Entire list is truncated if exceeds - // 40K. - repeated string source_uris = 1; - - // True if the source_URIs field was truncated. - bool source_uris_truncated = 7; - - // The table schema in JSON format. Entire field is truncated if exceeds - // 40K. - string schema_json = 2; - - // True if the schema_json field was truncated. - bool schema_json_truncated = 8; - - // The destination table for the import. - string destination_table = 3; - - // Destination table create disposition. - CreateDisposition create_disposition = 4; - - // Destination table write disposition. - WriteDisposition write_disposition = 5; - - // Result table encryption information. Set when non-default encryption is - // used. - EncryptionInfo destination_table_encryption = 6; - } - - // Extract job configuration. - message Extract { - // URIs where extracted data should be written. Entire list is truncated - // if exceeds 50K. - repeated string destination_uris = 1; - - // True if the destination_URIs field was truncated. - bool destination_uris_truncated = 3; - - oneof source { - // The source table. - string source_table = 2; - - // The source model. - string source_model = 4; - } - } - - // Table copy job configuration. - message TableCopy { - // Source tables. Entire list is truncated if exceeds 50K. - repeated string source_tables = 1; - - // True if the source_tables field was truncated. - bool source_tables_truncated = 6; - - // Destination table. - string destination_table = 2; - - // Destination table create disposition. - CreateDisposition create_disposition = 3; - - // Destination table write disposition. - WriteDisposition write_disposition = 4; - - // Result table encryption information. Set when non-default encryption is - // used. - EncryptionInfo destination_table_encryption = 5; - - // Supported operation types in the table copy job. - OperationType operation_type = 7; - - // Expiration time set on the destination table. Expired tables will be - // deleted and their storage reclaimed. - google.protobuf.Timestamp destination_expiration_time = 8; - } - - // Job type. - enum Type { - // Unknown. - TYPE_UNSPECIFIED = 0; - - // Query job. - QUERY = 1; - - // Table copy job. - COPY = 2; - - // Export (extract) job. - EXPORT = 3; - - // Import (load) job. - IMPORT = 4; - } - - // Job type. - Type type = 1; - - // Job configuration information. - oneof config { - // Query job information. - Query query_config = 2; - - // Load job information. - Load load_config = 3; - - // Extract job information. - Extract extract_config = 4; - - // TableCopy job information. - TableCopy table_copy_config = 5; - } - - // Labels provided for the job. - map labels = 6; - } - - // Definition of an external data source used in a query. - message TableDefinition { - // Name of the table, used in queries. - string name = 1; - - // URIs for the data. - repeated string source_uris = 2; - } - - // Status of a job. - message JobStatus { - // State of the job. - JobState job_state = 1; - - // Job error, if the job failed. - google.rpc.Status error_result = 2; - - // Errors encountered during the running of the job. Does not necessarily - // mean that the job has completed or was unsuccessful. - repeated google.rpc.Status errors = 3; - } - - // Job statistics. - message JobStats { - // Query job statistics. - message Query { - // Total bytes processed by the query job. - int64 total_processed_bytes = 1; - - // Total bytes billed by the query job. - int64 total_billed_bytes = 2; - - // The tier assigned by the CPU-based billing. - int32 billing_tier = 3; - - // Tables accessed by the query job. - repeated string referenced_tables = 6; - - // Views accessed by the query job. - repeated string referenced_views = 7; - - // Routines accessed by the query job. - repeated string referenced_routines = 10; - - // Number of output rows produced by the query job. - int64 output_row_count = 8; - - // True if the query job results were read from the query cache. - bool cache_hit = 9; - } - - // Load job statistics. - message Load { - // Total bytes loaded by the import job. - int64 total_output_bytes = 1; - } - - // Extract job statistics. - message Extract { - // Total bytes exported by the extract job. - int64 total_input_bytes = 1; - } - - // Job resource usage breakdown by reservation. - message ReservationResourceUsage { - // Reservation name or "unreserved" for on-demand resources usage. - string name = 1; - - // Total slot milliseconds used by the reservation for a particular job. - int64 slot_ms = 2; - } - - // Job creation time. - google.protobuf.Timestamp create_time = 1; - - // Job execution start time. - google.protobuf.Timestamp start_time = 2; - - // Job completion time. - google.protobuf.Timestamp end_time = 3; - - // Statistics specific to the job type. - oneof extended { - // Query job statistics. - Query query_stats = 8; - - // Load job statistics. - Load load_stats = 9; - - // Extract job statistics. - Extract extract_stats = 13; - } - - // The total number of slot-ms consumed by the query job. - int64 total_slot_ms = 10; - - // Reservation usage attributed from each tier of a reservation hierarchy. - repeated ReservationResourceUsage reservation_usage = 11; - - // Parent job name. Only present for child jobs. - string parent_job_name = 12; - } - - // Describes whether a job should overwrite or append the existing destination - // table if it already exists. - enum WriteDisposition { - // Unknown. - WRITE_DISPOSITION_UNSPECIFIED = 0; - - // This job should only be writing to empty tables. - WRITE_EMPTY = 1; - - // This job will truncate the existing table data. - WRITE_TRUNCATE = 2; - - // This job will append to the table. - WRITE_APPEND = 3; - } - - // BigQuery table. - message Table { - // Table URI. - // - // Format: `projects//datasets//tables/`. - string table_name = 1; - - // A JSON representation of the table's schema. Entire field is truncated - // if exceeds 40K. - string schema_json = 3; - - // True if the schema_json field was truncated. - bool schema_json_truncated = 11; - - // View metadata. Only present for views. - TableViewDefinition view = 4; - - // Table expiration time. - google.protobuf.Timestamp expire_time = 5; - - // The table creation time. - google.protobuf.Timestamp create_time = 6; - - // The last time metadata update time. - google.protobuf.Timestamp update_time = 7; - - // The last table truncation time. - google.protobuf.Timestamp truncate_time = 8; - - // Table encryption information. Set when non-default encryption is used. - EncryptionInfo encryption = 9; - - // User-provided metadata for the table. - EntityInfo table_info = 10; - } - - // User Defined Function (UDF) or Stored Procedure. - message Routine { - // Routine URI. - // - // Format: - // `projects//datasets//routines/`. - string routine_name = 1; - - // Routine creation time. - google.protobuf.Timestamp create_time = 5; - - // Routine last update time. - google.protobuf.Timestamp update_time = 6; - } - - // Table copy job operation type. - enum OperationType { - // Unspecified operation type. - OPERATION_TYPE_UNSPECIFIED = 0; - - // The source and the destination table have the same table type. - COPY = 1; - - // The source table type is TABLE and - // the destination table type is SNAPSHOT. - SNAPSHOT = 2; - - // The source table type is SNAPSHOT and - // the destination table type is TABLE. - RESTORE = 3; - } - - // User-provided metadata for an entity, for e.g. dataset, table or model. - message EntityInfo { - // A short name for the entity. - string friendly_name = 1; - - // A long description for the entity. - string description = 2; - - // Labels provided for the entity. - map labels = 3; - } - - // View definition. - message TableViewDefinition { - // SQL query defining the view. Truncated if exceeds 40K. - string query = 1; - - // True if the schema_json field was truncated. - bool query_truncated = 2; - } - - // An access control list. - message BigQueryAcl { - // IAM policy for the resource. - google.iam.v1.Policy policy = 1; - - // List of authorized views for a dataset. - // - // Format: `projects//datasets//tables/`. - repeated string authorized_views = 2; - } - - // Encryption properties for a table or a job - message EncryptionInfo { - // Cloud kms key identifier. - // - // Format: - // `projects//locations//keyRings//cryptoKeys/` - string kms_key_name = 1; - } - - // Describes whether a job should create a destination table if it doesn't - // exist. - enum CreateDisposition { - // Unknown. - CREATE_DISPOSITION_UNSPECIFIED = 0; - - // This job should never create tables. - CREATE_NEVER = 1; - - // This job should create a table if it doesn't already exist. - CREATE_IF_NEEDED = 2; - } - - // State of a job. - enum JobState { - // State unknown. - JOB_STATE_UNSPECIFIED = 0; - - // Job is waiting for the resources. - PENDING = 1; - - // Job is running. - RUNNING = 2; - - // Job is done. - DONE = 3; - } - - // Type of the statement (e.g. SELECT, INSERT, CREATE_TABLE, CREATE_MODEL..) - enum QueryStatementType { - // Unknown. - QUERY_STATEMENT_TYPE_UNSPECIFIED = 0; - - // SELECT ... FROM <Table list> ... - SELECT = 1; - - // ASSERT <condition> AS 'description' - ASSERT = 23; - - // INSERT INTO <Table> .... - INSERT = 2; - - // UPDATE <Table> SET ... - UPDATE = 3; - - // DELETE <Table> ... - DELETE = 4; - - // MERGE INTO <Table> .... - MERGE = 5; - - // CREATE TABLE <Table> <column list> - CREATE_TABLE = 6; - - // CREATE TABLE <Table> AS SELECT - CREATE_TABLE_AS_SELECT = 7; - - // CREATE VIEW <View> - CREATE_VIEW = 8; - - // CREATE MODEL <Model> AS <Query> - CREATE_MODEL = 9; - - // CREATE MATERIALIZED VIEW <View> AS ... - CREATE_MATERIALIZED_VIEW = 13; - - // CREATE FUNCTION <Function>(<Signature>) AS ... - CREATE_FUNCTION = 14; - - // CREATE PROCEDURE <Procedure> - CREATE_PROCEDURE = 20; - - // CREATE SCHEMA <Schema> - CREATE_SCHEMA = 53; - - // DROP TABLE <Table> - DROP_TABLE = 10; - - // DROP EXTERNAL TABLE <Table> - DROP_EXTERNAL_TABLE = 33; - - // DROP VIEW <View> - DROP_VIEW = 11; - - // DROP MODEL <Model> - DROP_MODEL = 12; - - // DROP MATERIALIZED VIEW <View> - DROP_MATERIALIZED_VIEW = 15; - - // DROP FUNCTION <Function> - DROP_FUNCTION = 16; - - // DROP PROCEDURE <Procedure> - DROP_PROCEDURE = 21; - - // DROP SCHEMA <Schema> - DROP_SCHEMA = 54; - - // ALTER TABLE <Table> - ALTER_TABLE = 17; - - // ALTER VIEW <View> - ALTER_VIEW = 18; - - // ALTER MATERIALIZED_VIEW <view> - ALTER_MATERIALIZED_VIEW = 22; - - // ALTER SCHEMA <Schema> - ALTER_SCHEMA = 55; - - // Script - SCRIPT = 19; - - // TRUNCATE TABLE <Table> - TRUNCATE_TABLE = 26; - - // CREATE EXTERNAL TABLE <TABLE> - CREATE_EXTERNAL_TABLE = 27; - - // EXPORT DATA; - EXPORT_DATA = 28; - - // CALL <stored procedure> - CALL = 29; - } - - // BigQuery event information. - oneof event { - // Job insertion event. - JobInsertion job_insertion = 1; - - // Job state change event. - JobChange job_change = 2; - - // Dataset creation event. - DatasetCreation dataset_creation = 3; - - // Dataset change event. - DatasetChange dataset_change = 4; - - // Dataset deletion event. - DatasetDeletion dataset_deletion = 5; - - // Table creation event. - TableCreation table_creation = 6; - - // Table metadata change event. - TableChange table_change = 8; - - // Table deletion event. - TableDeletion table_deletion = 9; - - // Table data read event. - TableDataRead table_data_read = 10; - - // Table data change event. - TableDataChange table_data_change = 11; - - // Model deletion event. - ModelDeletion model_deletion = 12; - - // Model creation event. - ModelCreation model_creation = 13; - - // Model metadata change event. - ModelMetadataChange model_metadata_change = 14; - - // Model data change event. - ModelDataChange model_data_change = 15; - - // Model data read event. - ModelDataRead model_data_read = 19; - - // Routine creation event. - RoutineCreation routine_creation = 16; - - // Routine change event. - RoutineChange routine_change = 17; - - // Routine deletion event. - RoutineDeletion routine_deletion = 18; - } -} diff --git a/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto b/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto new file mode 100644 index 00000000..56c9f800 --- /dev/null +++ b/proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto @@ -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 +// +// 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 file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto b/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto new file mode 100644 index 00000000..1477d2d6 --- /dev/null +++ b/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto @@ -0,0 +1,150 @@ +// Copyright 2021 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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 file contains custom annotations that are used by GAPIC generators to +// handle Long Running Operation methods (LRO) that are NOT compliant with +// https://google.aip.dev/151. These annotations are public for technical +// reasons only. Please DO NOT USE them in your protos. +syntax = "proto3"; + +package google.cloud; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/extendedops;extendedops"; +option java_multiple_files = true; +option java_outer_classname = "ExtendedOperationsProto"; +option java_package = "com.google.cloud"; +option objc_class_prefix = "GAPI"; + +// FieldOptions to match corresponding fields in the initial request, +// polling request and operation response messages. +// +// Example: +// +// In an API-specific operation message: +// +// message MyOperation { +// string http_error_message = 1 [(operation_field) = ERROR_MESSAGE]; +// int32 http_error_status_code = 2 [(operation_field) = ERROR_CODE]; +// string id = 3 [(operation_field) = NAME]; +// Status status = 4 [(operation_field) = STATUS]; +// } +// +// In a polling request message (the one which is used to poll for an LRO +// status): +// +// message MyPollingRequest { +// string operation = 1 [(operation_response_field) = "id"]; +// string project = 2; +// string region = 3; +// } +// +// In an initial request message (the one which starts an LRO): +// +// message MyInitialRequest { +// string my_project = 2 [(operation_request_field) = "project"]; +// string my_region = 3 [(operation_request_field) = "region"]; +// } +// +extend google.protobuf.FieldOptions { + // A field annotation that maps fields in an API-specific Operation object to + // their standard counterparts in google.longrunning.Operation. See + // OperationResponseMapping enum definition. + OperationResponseMapping operation_field = 1149; + + // A field annotation that maps fields in the initial request message + // (the one which started the LRO) to their counterparts in the polling + // request message. For non-standard LRO, the polling response may be missing + // some of the information needed to make a subsequent polling request. The + // missing information (for example, project or region ID) is contained in the + // fields of the initial request message that this annotation must be applied + // to. The string value of the annotation corresponds to the name of the + // counterpart field in the polling request message that the annotated field's + // value will be copied to. + string operation_request_field = 1150; + + // A field annotation that maps fields in the polling request message to their + // counterparts in the initial and/or polling response message. The initial + // and the polling methods return an API-specific Operation object. Some of + // the fields from that response object must be reused in the subsequent + // request (like operation name/ID) to fully identify the polled operation. + // This annotation must be applied to the fields in the polling request + // message, the string value of the annotation must correspond to the name of + // the counterpart field in the Operation response object whose value will be + // copied to the annotated field. + string operation_response_field = 1151; +} + +// MethodOptions to identify the actual service and method used for operation +// status polling. +// +// Example: +// +// In a method, which starts an LRO: +// +// service MyService { +// rpc Foo(MyInitialRequest) returns (MyOperation) { +// option (operation_service) = "MyPollingService"; +// } +// } +// +// In a polling method: +// +// service MyPollingService { +// rpc Get(MyPollingRequest) returns (MyOperation) { +// option (operation_polling_method) = true; +// } +// } +extend google.protobuf.MethodOptions { + // A method annotation that maps an LRO method (the one which starts an LRO) + // to the service, which will be used to poll for the operation status. The + // annotation must be applied to the method which starts an LRO, the string + // value of the annotation must correspond to the name of the service used to + // poll for the operation status. + string operation_service = 1249; + + // A method annotation that marks methods that can be used for polling + // operation status (e.g. the MyPollingService.Get(MyPollingRequest) method). + bool operation_polling_method = 1250; +} + +// An enum to be used to mark the essential (for polling) fields in an +// API-specific Operation object. A custom Operation object may contain many +// different fields, but only few of them are essential to conduct a successful +// polling process. +enum OperationResponseMapping { + // Do not use. + UNDEFINED = 0; + + // A field in an API-specific (custom) Operation object which carries the same + // meaning as google.longrunning.Operation.name. + NAME = 1; + + // A field in an API-specific (custom) Operation object which carries the same + // meaning as google.longrunning.Operation.done. If the annotated field is of + // an enum type, `annotated_field_name == EnumType.DONE` semantics should be + // equivalent to `Operation.done == true`. If the annotated field is of type + // boolean, then it should follow the same semantics as Operation.done. + // Otherwise, a non-empty value should be treated as `Operation.done == true`. + STATUS = 2; + + // A field in an API-specific (custom) Operation object which carries the same + // meaning as google.longrunning.Operation.error.code. + ERROR_CODE = 3; + + // A field in an API-specific (custom) Operation object which carries the same + // meaning as google.longrunning.Operation.error.message. + ERROR_MESSAGE = 4; +} \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index 18948cb0..1593b446 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5d3c52f5db664eee9026db76b5bcb466f3a09ca9" + "sha": "31728d872f50e439ded2f67fa8d67955b26a4e35" } } ], diff --git a/synth.py b/synth.py index c5c64dd6..ff68d5d5 100644 --- a/synth.py +++ b/synth.py @@ -89,12 +89,18 @@ def build_grpc(target): build_proto("//google/rpc:rpc_java_proto") build_proto("//google/rpc/context:attribute_context_java_proto") build_proto("//google/type:type_java_proto") +build_proto("//google/cloud:extended_operations_java_proto") build_grpc("//google/longrunning:longrunning_java_grpc") java.format_code("proto-google-common-protos/src") java.format_code("grpc-google-common-protos/src") +os.remove("proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java") +os.remove("proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java") +os.remove("proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java") +os.remove("proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto") + java.common_templates(excludes=[ 'README.md', 'samples/*',