From 70a872e3cdf3141d745028f4774574019c2eb7df Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 May 2021 14:24:18 -0700 Subject: [PATCH] feat: Publish visibility.proto (#148) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * feat: Publish visibility.proto; refresh other google/api/ files. Committer: @lukesneeringer PiperOrigin-RevId: 370757345 Source-Author: Google APIs Source-Date: Tue Apr 27 13:59:23 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 7cde5d0df08801e00fc45df1546942aa2692d5c3 Source-Link: https://github.com/googleapis/googleapis/commit/7cde5d0df08801e00fc45df1546942aa2692d5c3 --- .../java/com/google/api/Authentication.java | 16 +- .../main/java/com/google/api/Endpoint.java | 13 + .../com/google/api/EndpointOrBuilder.java | 4 + .../src/main/java/com/google/api/Logging.java | 12 +- .../src/main/java/com/google/api/Service.java | 85 +- .../java/com/google/api/ServiceOrBuilder.java | 21 +- .../java/com/google/api/ServiceProto.java | 12 +- .../main/java/com/google/api/Visibility.java | 985 ++++++++++++++++++ .../com/google/api/VisibilityOrBuilder.java | 81 ++ .../java/com/google/api/VisibilityProto.java | 209 ++++ .../java/com/google/api/VisibilityRule.java | 884 ++++++++++++++++ .../google/api/VisibilityRuleOrBuilder.java | 97 ++ synth.metadata | 11 +- 13 files changed, 2379 insertions(+), 51 deletions(-) create mode 100644 proto-google-common-protos/src/main/java/com/google/api/Visibility.java create mode 100644 proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java create mode 100644 proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java create mode 100644 proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java create mode 100644 proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java diff --git a/proto-google-common-protos/src/main/java/com/google/api/Authentication.java b/proto-google-common-protos/src/main/java/com/google/api/Authentication.java index 4abbcedd..6fb27454 100644 --- a/proto-google-common-protos/src/main/java/com/google/api/Authentication.java +++ b/proto-google-common-protos/src/main/java/com/google/api/Authentication.java @@ -22,8 +22,9 @@ * * *
- * `Authentication` defines the authentication configuration for an API.
- * Example for an API targeted for external use:
+ * `Authentication` defines the authentication configuration for API methods
+ * provided by an API service.
+ * Example:
  *     name: calendar.googleapis.com
  *     authentication:
  *       providers:
@@ -34,6 +35,9 @@
  *       - selector: "*"
  *         requirements:
  *           provider_id: google_calendar_auth
+ *       - selector: google.calendar.Delegate
+ *         oauth:
+ *           canonical_scopes: https://www.googleapis.com/auth/calendar.read
  * 
* * Protobuf type {@code google.api.Authentication} @@ -457,8 +461,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * `Authentication` defines the authentication configuration for an API.
-   * Example for an API targeted for external use:
+   * `Authentication` defines the authentication configuration for API methods
+   * provided by an API service.
+   * Example:
    *     name: calendar.googleapis.com
    *     authentication:
    *       providers:
@@ -469,6 +474,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
    *       - selector: "*"
    *         requirements:
    *           provider_id: google_calendar_auth
+   *       - selector: google.calendar.Delegate
+   *         oauth:
+   *           canonical_scopes: https://www.googleapis.com/auth/calendar.read
    * 
* * Protobuf type {@code google.api.Authentication} diff --git a/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java b/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java index 8378a618..e74fd93f 100644 --- a/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java +++ b/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java @@ -204,6 +204,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -222,6 +223,7 @@ public com.google.protobuf.ProtocolStringList getAliasesList() {
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -240,6 +242,7 @@ public int getAliasesCount() {
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -259,6 +262,7 @@ public java.lang.String getAliases(int index) {
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -863,6 +867,7 @@ private void ensureAliasesIsMutable() {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -881,6 +886,7 @@ public com.google.protobuf.ProtocolStringList getAliasesList() {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -899,6 +905,7 @@ public int getAliasesCount() {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -918,6 +925,7 @@ public java.lang.String getAliases(int index) {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -937,6 +945,7 @@ public com.google.protobuf.ByteString getAliasesBytes(int index) {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -963,6 +972,7 @@ public Builder setAliases(int index, java.lang.String value) {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -988,6 +998,7 @@ public Builder addAliases(java.lang.String value) {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -1010,6 +1021,7 @@ public Builder addAllAliases(java.lang.Iterable values) {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
@@ -1031,6 +1043,7 @@ public Builder clearAliases() {
      *
      *
      * 
+     * Unimplemented. Dot not use.
      * DEPRECATED: This field is no longer supported. Instead of using aliases,
      * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
      * aliases.
diff --git a/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java
index a67566bd..8ca3e63a 100644
--- a/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java
+++ b/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java
@@ -52,6 +52,7 @@ public interface EndpointOrBuilder
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -68,6 +69,7 @@ public interface EndpointOrBuilder
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -84,6 +86,7 @@ public interface EndpointOrBuilder
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
@@ -101,6 +104,7 @@ public interface EndpointOrBuilder
    *
    *
    * 
+   * Unimplemented. Dot not use.
    * DEPRECATED: This field is no longer supported. Instead of using aliases,
    * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended
    * aliases.
diff --git a/proto-google-common-protos/src/main/java/com/google/api/Logging.java b/proto-google-common-protos/src/main/java/com/google/api/Logging.java
index a5b47123..28057a13 100644
--- a/proto-google-common-protos/src/main/java/com/google/api/Logging.java
+++ b/proto-google-common-protos/src/main/java/com/google/api/Logging.java
@@ -30,14 +30,14 @@
  *     monitored_resources:
  *     - type: library.googleapis.com/branch
  *       labels:
- *       - key: city
+ *       - key: /city
  *         description: The city where the library branch is located in.
- *       - key: name
+ *       - key: /name
  *         description: The name of the branch.
  *     logs:
  *     - name: activity_history
  *       labels:
- *       - key: customer_id
+ *       - key: /customer_id
  *     - name: purchase_history
  *     logging:
  *       producer_destinations:
@@ -1556,14 +1556,14 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
    *     monitored_resources:
    *     - type: library.googleapis.com/branch
    *       labels:
-   *       - key: city
+   *       - key: /city
    *         description: The city where the library branch is located in.
-   *       - key: name
+   *       - key: /name
    *         description: The name of the branch.
    *     logs:
    *     - name: activity_history
    *       labels:
-   *       - key: customer_id
+   *       - key: /customer_id
    *     - name: purchase_history
    *     logging:
    *       producer_destinations:
diff --git a/proto-google-common-protos/src/main/java/com/google/api/Service.java b/proto-google-common-protos/src/main/java/com/google/api/Service.java
index 9c3d2ad2..c81c8194 100644
--- a/proto-google-common-protos/src/main/java/com/google/api/Service.java
+++ b/proto-google-common-protos/src/main/java/com/google/api/Service.java
@@ -29,7 +29,6 @@
  * specific aspect, such as auth. See each proto message definition for details.
  * Example:
  *     type: google.api.Service
- *     config_version: 3
  *     name: calendar.googleapis.com
  *     title: Google Calendar API
  *     apis:
@@ -1839,14 +1838,17 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() {
    *
    *
    * 
-   * Deprecated. The service config compiler always sets this field to `3`.
+   * Obsolete. Do not use.
+   * This field has no semantic meaning. The service config compiler always
+   * sets this field to `3`.
    * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; * * @return Whether the configVersion field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasConfigVersion() { return configVersion_ != null; } @@ -1854,14 +1856,17 @@ public boolean hasConfigVersion() { * * *
-   * Deprecated. The service config compiler always sets this field to `3`.
+   * Obsolete. Do not use.
+   * This field has no semantic meaning. The service config compiler always
+   * sets this field to `3`.
    * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; * * @return The configVersion. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.UInt32Value getConfigVersion() { return configVersion_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() @@ -1871,12 +1876,15 @@ public com.google.protobuf.UInt32Value getConfigVersion() { * * *
-   * Deprecated. The service config compiler always sets this field to `3`.
+   * Obsolete. Do not use.
+   * This field has no semantic meaning. The service config compiler always
+   * sets this field to `3`.
    * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder() { return getConfigVersion(); } @@ -2350,7 +2358,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * specific aspect, such as auth. See each proto message definition for details. * Example: * type: google.api.Service - * config_version: 3 * name: calendar.googleapis.com * title: Google Calendar API * apis: @@ -8530,13 +8537,16 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; * * @return Whether the configVersion field is set. */ + @java.lang.Deprecated public boolean hasConfigVersion() { return configVersionBuilder_ != null || configVersion_ != null; } @@ -8544,13 +8554,16 @@ public boolean hasConfigVersion() { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; * * @return The configVersion. */ + @java.lang.Deprecated public com.google.protobuf.UInt32Value getConfigVersion() { if (configVersionBuilder_ == null) { return configVersion_ == null @@ -8564,11 +8577,14 @@ public com.google.protobuf.UInt32Value getConfigVersion() { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated public Builder setConfigVersion(com.google.protobuf.UInt32Value value) { if (configVersionBuilder_ == null) { if (value == null) { @@ -8586,11 +8602,14 @@ public Builder setConfigVersion(com.google.protobuf.UInt32Value value) { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated public Builder setConfigVersion(com.google.protobuf.UInt32Value.Builder builderForValue) { if (configVersionBuilder_ == null) { configVersion_ = builderForValue.build(); @@ -8605,11 +8624,14 @@ public Builder setConfigVersion(com.google.protobuf.UInt32Value.Builder builderF * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated public Builder mergeConfigVersion(com.google.protobuf.UInt32Value value) { if (configVersionBuilder_ == null) { if (configVersion_ != null) { @@ -8631,11 +8653,14 @@ public Builder mergeConfigVersion(com.google.protobuf.UInt32Value value) { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated public Builder clearConfigVersion() { if (configVersionBuilder_ == null) { configVersion_ = null; @@ -8651,11 +8676,14 @@ public Builder clearConfigVersion() { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated public com.google.protobuf.UInt32Value.Builder getConfigVersionBuilder() { onChanged(); @@ -8665,11 +8693,14 @@ public com.google.protobuf.UInt32Value.Builder getConfigVersionBuilder() { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated public com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder() { if (configVersionBuilder_ != null) { return configVersionBuilder_.getMessageOrBuilder(); @@ -8683,10 +8714,12 @@ public com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder() { * * *
-     * Deprecated. The service config compiler always sets this field to `3`.
+     * Obsolete. Do not use.
+     * This field has no semantic meaning. The service config compiler always
+     * sets this field to `3`.
      * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.UInt32Value, diff --git a/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java index 47a650a7..4f511a1c 100644 --- a/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java +++ b/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java @@ -1042,34 +1042,43 @@ public interface ServiceOrBuilder * * *
-   * Deprecated. The service config compiler always sets this field to `3`.
+   * Obsolete. Do not use.
+   * This field has no semantic meaning. The service config compiler always
+   * sets this field to `3`.
    * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; * * @return Whether the configVersion field is set. */ + @java.lang.Deprecated boolean hasConfigVersion(); /** * * *
-   * Deprecated. The service config compiler always sets this field to `3`.
+   * Obsolete. Do not use.
+   * This field has no semantic meaning. The service config compiler always
+   * sets this field to `3`.
    * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; * * @return The configVersion. */ + @java.lang.Deprecated com.google.protobuf.UInt32Value getConfigVersion(); /** * * *
-   * Deprecated. The service config compiler always sets this field to `3`.
+   * Obsolete. Do not use.
+   * This field has no semantic meaning. The service config compiler always
+   * sets this field to `3`.
    * 
* - * .google.protobuf.UInt32Value config_version = 20; + * .google.protobuf.UInt32Value config_version = 20 [deprecated = true]; */ + @java.lang.Deprecated com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder(); } diff --git a/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java b/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java index 37a27213..df7f50f6 100644 --- a/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java +++ b/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java @@ -56,7 +56,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + ".proto\032\026google/api/usage.proto\032\031google/p" + "rotobuf/any.proto\032\031google/protobuf/api.p" + "roto\032\032google/protobuf/type.proto\032\036google" - + "/protobuf/wrappers.proto\"\326\007\n\007Service\022\014\n\004" + + "/protobuf/wrappers.proto\"\332\007\n\007Service\022\014\n\004" + "name\030\001 \001(\t\022\r\n\005title\030\002 \001(\t\022\033\n\023producer_pr" + "oject_id\030\026 \001(\t\022\n\n\002id\030! \001(\t\022\"\n\004apis\030\003 \003(\013" + "2\024.google.protobuf.Api\022$\n\005types\030\004 \003(\0132\025." @@ -79,12 +79,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "i.Logging\022*\n\nmonitoring\030\034 \001(\0132\026.google.a" + "pi.Monitoring\0227\n\021system_parameters\030\035 \001(\013" + "2\034.google.api.SystemParameters\022+\n\013source" - + "_info\030% \001(\0132\026.google.api.SourceInfo\0224\n\016c" + + "_info\030% \001(\0132\026.google.api.SourceInfo\0228\n\016c" + "onfig_version\030\024 \001(\0132\034.google.protobuf.UI" - + "nt32ValueBn\n\016com.google.apiB\014ServiceProt" - + "oP\001ZEgoogle.golang.org/genproto/googleap" - + "is/api/serviceconfig;serviceconfig\242\002\004GAP" - + "Ib\006proto3" + + "nt32ValueB\002\030\001Bn\n\016com.google.apiB\014Service" + + "ProtoP\001ZEgoogle.golang.org/genproto/goog" + + "leapis/api/serviceconfig;serviceconfig\242\002" + + "\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-common-protos/src/main/java/com/google/api/Visibility.java b/proto-google-common-protos/src/main/java/com/google/api/Visibility.java new file mode 100644 index 00000000..9946e038 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/Visibility.java @@ -0,0 +1,985 @@ +/* + * 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/visibility.proto + +package com.google.api; + +/** + * + * + *
+ * `Visibility` defines restrictions for the visibility of service
+ * elements.  Restrictions are specified using visibility labels
+ * (e.g., PREVIEW) that are elsewhere linked to users and projects.
+ * Users and projects can have access to more than one visibility label. The
+ * effective visibility for multiple labels is the union of each label's
+ * elements, plus any unrestricted elements.
+ * If an element and its parents have no restrictions, visibility is
+ * unconditionally granted.
+ * Example:
+ *     visibility:
+ *       rules:
+ *       - selector: google.calendar.Calendar.EnhancedSearch
+ *         restriction: PREVIEW
+ *       - selector: google.calendar.Calendar.Delegate
+ *         restriction: INTERNAL
+ * Here, all methods are publicly visible except for the restricted methods
+ * EnhancedSearch and Delegate.
+ * 
+ * + * Protobuf type {@code google.api.Visibility} + */ +public final class Visibility extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.Visibility) + VisibilityOrBuilder { + private static final long serialVersionUID = 0L; + // Use Visibility.newBuilder() to construct. + private Visibility(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Visibility() { + rules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Visibility(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Visibility( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + rules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rules_.add( + input.readMessage(com.google.api.VisibilityRule.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.VisibilityProto.internal_static_google_api_Visibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.Visibility.class, com.google.api.Visibility.Builder.class); + } + + public static final int RULES_FIELD_NUMBER = 1; + private java.util.List rules_; + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + @java.lang.Override + public java.util.List getRulesOrBuilderList() { + return rules_; + } + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + @java.lang.Override + public com.google.api.VisibilityRule getRules(int index) { + return rules_.get(index); + } + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + @java.lang.Override + public com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < rules_.size(); i++) { + output.writeMessage(1, rules_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.Visibility)) { + return super.equals(obj); + } + com.google.api.Visibility other = (com.google.api.Visibility) obj; + + if (!getRulesList().equals(other.getRulesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.Visibility parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.Visibility parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.Visibility parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.Visibility 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.api.Visibility parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.Visibility parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.Visibility parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.Visibility 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.api.Visibility parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.Visibility 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.api.Visibility parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.Visibility 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.api.Visibility 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; + } + /** + * + * + *
+   * `Visibility` defines restrictions for the visibility of service
+   * elements.  Restrictions are specified using visibility labels
+   * (e.g., PREVIEW) that are elsewhere linked to users and projects.
+   * Users and projects can have access to more than one visibility label. The
+   * effective visibility for multiple labels is the union of each label's
+   * elements, plus any unrestricted elements.
+   * If an element and its parents have no restrictions, visibility is
+   * unconditionally granted.
+   * Example:
+   *     visibility:
+   *       rules:
+   *       - selector: google.calendar.Calendar.EnhancedSearch
+   *         restriction: PREVIEW
+   *       - selector: google.calendar.Calendar.Delegate
+   *         restriction: INTERNAL
+   * Here, all methods are publicly visible except for the restricted methods
+   * EnhancedSearch and Delegate.
+   * 
+ * + * Protobuf type {@code google.api.Visibility} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.Visibility) + com.google.api.VisibilityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.VisibilityProto.internal_static_google_api_Visibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.Visibility.class, com.google.api.Visibility.Builder.class); + } + + // Construct using com.google.api.Visibility.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRulesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + rulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor; + } + + @java.lang.Override + public com.google.api.Visibility getDefaultInstanceForType() { + return com.google.api.Visibility.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.Visibility build() { + com.google.api.Visibility result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.Visibility buildPartial() { + com.google.api.Visibility result = new com.google.api.Visibility(this); + int from_bitField0_ = bitField0_; + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.Visibility) { + return mergeFrom((com.google.api.Visibility) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.Visibility other) { + if (other == com.google.api.Visibility.getDefaultInstance()) return this; + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + 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.api.Visibility parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.Visibility) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.VisibilityRule, + com.google.api.VisibilityRule.Builder, + com.google.api.VisibilityRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public com.google.api.VisibilityRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder setRules(int index, com.google.api.VisibilityRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder setRules(int index, com.google.api.VisibilityRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder addRules(com.google.api.VisibilityRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder addRules(int index, com.google.api.VisibilityRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder addRules(com.google.api.VisibilityRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder addRules(int index, com.google.api.VisibilityRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder addAllRules(java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public com.google.api.VisibilityRule.Builder getRulesBuilder(int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public com.google.api.VisibilityRule.Builder addRulesBuilder() { + return getRulesFieldBuilder().addBuilder(com.google.api.VisibilityRule.getDefaultInstance()); + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public com.google.api.VisibilityRule.Builder addRulesBuilder(int index) { + return getRulesFieldBuilder() + .addBuilder(index, com.google.api.VisibilityRule.getDefaultInstance()); + } + /** + * + * + *
+     * A list of visibility rules that apply to individual API elements.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + public java.util.List getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.VisibilityRule, + com.google.api.VisibilityRule.Builder, + com.google.api.VisibilityRuleOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.VisibilityRule, + com.google.api.VisibilityRule.Builder, + com.google.api.VisibilityRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + @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.api.Visibility) + } + + // @@protoc_insertion_point(class_scope:google.api.Visibility) + private static final com.google.api.Visibility DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.Visibility(); + } + + public static com.google.api.Visibility getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Visibility parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Visibility(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.api.Visibility getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java new file mode 100644 index 00000000..40544aa4 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java @@ -0,0 +1,81 @@ +/* + * 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/visibility.proto + +package com.google.api; + +public interface VisibilityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.Visibility) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + java.util.List getRulesList(); + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + com.google.api.VisibilityRule getRules(int index); + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + int getRulesCount(); + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + java.util.List getRulesOrBuilderList(); + /** + * + * + *
+   * A list of visibility rules that apply to individual API elements.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.VisibilityRule rules = 1; + */ + com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(int index); +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java b/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java new file mode 100644 index 00000000..aaa371cf --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java @@ -0,0 +1,209 @@ +/* + * 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/visibility.proto + +package com.google.api; + +public final class VisibilityProto { + private VisibilityProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.api.VisibilityProto.enumVisibility); + registry.add(com.google.api.VisibilityProto.valueVisibility); + registry.add(com.google.api.VisibilityProto.fieldVisibility); + registry.add(com.google.api.VisibilityProto.messageVisibility); + registry.add(com.google.api.VisibilityProto.methodVisibility); + registry.add(com.google.api.VisibilityProto.apiVisibility); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int ENUM_VISIBILITY_FIELD_NUMBER = 72295727; + /** + * + * + *
+   * See `VisibilityRule`.
+   * 
+ * + * extend .google.protobuf.EnumOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, com.google.api.VisibilityRule> + enumVisibility = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.VisibilityRule.class, + com.google.api.VisibilityRule.getDefaultInstance()); + + public static final int VALUE_VISIBILITY_FIELD_NUMBER = 72295727; + /** + * + * + *
+   * See `VisibilityRule`.
+   * 
+ * + * extend .google.protobuf.EnumValueOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumValueOptions, com.google.api.VisibilityRule> + valueVisibility = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.VisibilityRule.class, + com.google.api.VisibilityRule.getDefaultInstance()); + + public static final int FIELD_VISIBILITY_FIELD_NUMBER = 72295727; + /** + * + * + *
+   * See `VisibilityRule`.
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, com.google.api.VisibilityRule> + fieldVisibility = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.VisibilityRule.class, + com.google.api.VisibilityRule.getDefaultInstance()); + + public static final int MESSAGE_VISIBILITY_FIELD_NUMBER = 72295727; + /** + * + * + *
+   * See `VisibilityRule`.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, com.google.api.VisibilityRule> + messageVisibility = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.VisibilityRule.class, + com.google.api.VisibilityRule.getDefaultInstance()); + + public static final int METHOD_VISIBILITY_FIELD_NUMBER = 72295727; + /** + * + * + *
+   * See `VisibilityRule`.
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, com.google.api.VisibilityRule> + methodVisibility = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.VisibilityRule.class, + com.google.api.VisibilityRule.getDefaultInstance()); + + public static final int API_VISIBILITY_FIELD_NUMBER = 72295727; + /** + * + * + *
+   * See `VisibilityRule`.
+   * 
+ * + * extend .google.protobuf.ServiceOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.ServiceOptions, com.google.api.VisibilityRule> + apiVisibility = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.VisibilityRule.class, + com.google.api.VisibilityRule.getDefaultInstance()); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_Visibility_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_Visibility_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_VisibilityRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_VisibilityRule_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\033google/api/visibility.proto\022\ngoogle.ap" + + "i\032 google/protobuf/descriptor.proto\"7\n\nV" + + "isibility\022)\n\005rules\030\001 \003(\0132\032.google.api.Vi" + + "sibilityRule\"7\n\016VisibilityRule\022\020\n\010select" + + "or\030\001 \001(\t\022\023\n\013restriction\030\002 \001(\t:T\n\017enum_vi" + + "sibility\022\034.google.protobuf.EnumOptions\030\257" + + "\312\274\" \001(\0132\032.google.api.VisibilityRule:Z\n\020v" + + "alue_visibility\022!.google.protobuf.EnumVa" + + "lueOptions\030\257\312\274\" \001(\0132\032.google.api.Visibil" + + "ityRule:V\n\020field_visibility\022\035.google.pro" + + "tobuf.FieldOptions\030\257\312\274\" \001(\0132\032.google.api" + + ".VisibilityRule:Z\n\022message_visibility\022\037." + + "google.protobuf.MessageOptions\030\257\312\274\" \001(\0132" + + "\032.google.api.VisibilityRule:X\n\021method_vi" + + "sibility\022\036.google.protobuf.MethodOptions" + + "\030\257\312\274\" \001(\0132\032.google.api.VisibilityRule:V\n" + + "\016api_visibility\022\037.google.protobuf.Servic" + + "eOptions\030\257\312\274\" \001(\0132\032.google.api.Visibilit" + + "yRuleBn\n\016com.google.apiB\017VisibilityProto" + + "P\001Z?google.golang.org/genproto/googleapi" + + "s/api/visibility;visibility\370\001\001\242\002\004GAPIb\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + internal_static_google_api_Visibility_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Visibility_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_Visibility_descriptor, + new java.lang.String[] { + "Rules", + }); + internal_static_google_api_VisibilityRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_VisibilityRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_VisibilityRule_descriptor, + new java.lang.String[] { + "Selector", "Restriction", + }); + enumVisibility.internalInit(descriptor.getExtensions().get(0)); + valueVisibility.internalInit(descriptor.getExtensions().get(1)); + fieldVisibility.internalInit(descriptor.getExtensions().get(2)); + messageVisibility.internalInit(descriptor.getExtensions().get(3)); + methodVisibility.internalInit(descriptor.getExtensions().get(4)); + apiVisibility.internalInit(descriptor.getExtensions().get(5)); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java b/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java new file mode 100644 index 00000000..fb955b6e --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java @@ -0,0 +1,884 @@ +/* + * 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/visibility.proto + +package com.google.api; + +/** + * + * + *
+ * A visibility rule provides visibility configuration for an individual API
+ * element.
+ * 
+ * + * Protobuf type {@code google.api.VisibilityRule} + */ +public final class VisibilityRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.VisibilityRule) + VisibilityRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use VisibilityRule.newBuilder() to construct. + private VisibilityRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VisibilityRule() { + selector_ = ""; + restriction_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VisibilityRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VisibilityRule( + 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(); + + selector_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + restriction_ = 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.api.VisibilityProto.internal_static_google_api_VisibilityRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.VisibilityProto + .internal_static_google_api_VisibilityRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.VisibilityRule.class, com.google.api.VisibilityRule.Builder.class); + } + + public static final int SELECTOR_FIELD_NUMBER = 1; + private volatile java.lang.Object selector_; + /** + * + * + *
+   * Selects methods, messages, fields, enums, etc. to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * + * @return The selector. + */ + @java.lang.Override + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + 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(); + selector_ = s; + return s; + } + } + /** + * + * + *
+   * Selects methods, messages, fields, enums, etc. to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * + * @return The bytes for selector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESTRICTION_FIELD_NUMBER = 2; + private volatile java.lang.Object restriction_; + /** + * + * + *
+   * A comma-separated list of visibility labels that apply to the `selector`.
+   * Any of the listed labels can be used to grant the visibility.
+   * If a rule has multiple labels, removing one of the labels but not all of
+   * them can break clients.
+   * Example:
+   *     visibility:
+   *       rules:
+   *       - selector: google.calendar.Calendar.EnhancedSearch
+   *         restriction: INTERNAL, PREVIEW
+   * Removing INTERNAL from this restriction will break clients that rely on
+   * this method and only had access to it through INTERNAL.
+   * 
+ * + * string restriction = 2; + * + * @return The restriction. + */ + @java.lang.Override + public java.lang.String getRestriction() { + java.lang.Object ref = restriction_; + 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(); + restriction_ = s; + return s; + } + } + /** + * + * + *
+   * A comma-separated list of visibility labels that apply to the `selector`.
+   * Any of the listed labels can be used to grant the visibility.
+   * If a rule has multiple labels, removing one of the labels but not all of
+   * them can break clients.
+   * Example:
+   *     visibility:
+   *       rules:
+   *       - selector: google.calendar.Calendar.EnhancedSearch
+   *         restriction: INTERNAL, PREVIEW
+   * Removing INTERNAL from this restriction will break clients that rely on
+   * this method and only had access to it through INTERNAL.
+   * 
+ * + * string restriction = 2; + * + * @return The bytes for restriction. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRestrictionBytes() { + java.lang.Object ref = restriction_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + restriction_ = 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 (!getSelectorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + } + if (!getRestrictionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, restriction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSelectorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + } + if (!getRestrictionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, restriction_); + } + 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.api.VisibilityRule)) { + return super.equals(obj); + } + com.google.api.VisibilityRule other = (com.google.api.VisibilityRule) obj; + + if (!getSelector().equals(other.getSelector())) return false; + if (!getRestriction().equals(other.getRestriction())) 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) + SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getSelector().hashCode(); + hash = (37 * hash) + RESTRICTION_FIELD_NUMBER; + hash = (53 * hash) + getRestriction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.VisibilityRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.VisibilityRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.VisibilityRule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.VisibilityRule 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.api.VisibilityRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.VisibilityRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.VisibilityRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.VisibilityRule 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.api.VisibilityRule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.VisibilityRule 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.api.VisibilityRule parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.VisibilityRule 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.api.VisibilityRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A visibility rule provides visibility configuration for an individual API
+   * element.
+   * 
+ * + * Protobuf type {@code google.api.VisibilityRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.VisibilityRule) + com.google.api.VisibilityRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.VisibilityProto.internal_static_google_api_VisibilityRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.VisibilityProto + .internal_static_google_api_VisibilityRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.VisibilityRule.class, com.google.api.VisibilityRule.Builder.class); + } + + // Construct using com.google.api.VisibilityRule.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(); + selector_ = ""; + + restriction_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.VisibilityProto.internal_static_google_api_VisibilityRule_descriptor; + } + + @java.lang.Override + public com.google.api.VisibilityRule getDefaultInstanceForType() { + return com.google.api.VisibilityRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.VisibilityRule build() { + com.google.api.VisibilityRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.VisibilityRule buildPartial() { + com.google.api.VisibilityRule result = new com.google.api.VisibilityRule(this); + result.selector_ = selector_; + result.restriction_ = restriction_; + 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.api.VisibilityRule) { + return mergeFrom((com.google.api.VisibilityRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.VisibilityRule other) { + if (other == com.google.api.VisibilityRule.getDefaultInstance()) return this; + if (!other.getSelector().isEmpty()) { + selector_ = other.selector_; + onChanged(); + } + if (!other.getRestriction().isEmpty()) { + restriction_ = other.restriction_; + 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.api.VisibilityRule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.VisibilityRule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object selector_ = ""; + /** + * + * + *
+     * Selects methods, messages, fields, enums, etc. to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * + * @return The selector. + */ + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Selects methods, messages, fields, enums, etc. to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * + * @return The bytes for selector. + */ + public com.google.protobuf.ByteString getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Selects methods, messages, fields, enums, etc. to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * + * @param value The selector to set. + * @return This builder for chaining. + */ + public Builder setSelector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + selector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Selects methods, messages, fields, enums, etc. to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelector() { + + selector_ = getDefaultInstance().getSelector(); + onChanged(); + return this; + } + /** + * + * + *
+     * Selects methods, messages, fields, enums, etc. to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * + * @param value The bytes for selector to set. + * @return This builder for chaining. + */ + public Builder setSelectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + selector_ = value; + onChanged(); + return this; + } + + private java.lang.Object restriction_ = ""; + /** + * + * + *
+     * A comma-separated list of visibility labels that apply to the `selector`.
+     * Any of the listed labels can be used to grant the visibility.
+     * If a rule has multiple labels, removing one of the labels but not all of
+     * them can break clients.
+     * Example:
+     *     visibility:
+     *       rules:
+     *       - selector: google.calendar.Calendar.EnhancedSearch
+     *         restriction: INTERNAL, PREVIEW
+     * Removing INTERNAL from this restriction will break clients that rely on
+     * this method and only had access to it through INTERNAL.
+     * 
+ * + * string restriction = 2; + * + * @return The restriction. + */ + public java.lang.String getRestriction() { + java.lang.Object ref = restriction_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + restriction_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A comma-separated list of visibility labels that apply to the `selector`.
+     * Any of the listed labels can be used to grant the visibility.
+     * If a rule has multiple labels, removing one of the labels but not all of
+     * them can break clients.
+     * Example:
+     *     visibility:
+     *       rules:
+     *       - selector: google.calendar.Calendar.EnhancedSearch
+     *         restriction: INTERNAL, PREVIEW
+     * Removing INTERNAL from this restriction will break clients that rely on
+     * this method and only had access to it through INTERNAL.
+     * 
+ * + * string restriction = 2; + * + * @return The bytes for restriction. + */ + public com.google.protobuf.ByteString getRestrictionBytes() { + java.lang.Object ref = restriction_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + restriction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A comma-separated list of visibility labels that apply to the `selector`.
+     * Any of the listed labels can be used to grant the visibility.
+     * If a rule has multiple labels, removing one of the labels but not all of
+     * them can break clients.
+     * Example:
+     *     visibility:
+     *       rules:
+     *       - selector: google.calendar.Calendar.EnhancedSearch
+     *         restriction: INTERNAL, PREVIEW
+     * Removing INTERNAL from this restriction will break clients that rely on
+     * this method and only had access to it through INTERNAL.
+     * 
+ * + * string restriction = 2; + * + * @param value The restriction to set. + * @return This builder for chaining. + */ + public Builder setRestriction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + restriction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A comma-separated list of visibility labels that apply to the `selector`.
+     * Any of the listed labels can be used to grant the visibility.
+     * If a rule has multiple labels, removing one of the labels but not all of
+     * them can break clients.
+     * Example:
+     *     visibility:
+     *       rules:
+     *       - selector: google.calendar.Calendar.EnhancedSearch
+     *         restriction: INTERNAL, PREVIEW
+     * Removing INTERNAL from this restriction will break clients that rely on
+     * this method and only had access to it through INTERNAL.
+     * 
+ * + * string restriction = 2; + * + * @return This builder for chaining. + */ + public Builder clearRestriction() { + + restriction_ = getDefaultInstance().getRestriction(); + onChanged(); + return this; + } + /** + * + * + *
+     * A comma-separated list of visibility labels that apply to the `selector`.
+     * Any of the listed labels can be used to grant the visibility.
+     * If a rule has multiple labels, removing one of the labels but not all of
+     * them can break clients.
+     * Example:
+     *     visibility:
+     *       rules:
+     *       - selector: google.calendar.Calendar.EnhancedSearch
+     *         restriction: INTERNAL, PREVIEW
+     * Removing INTERNAL from this restriction will break clients that rely on
+     * this method and only had access to it through INTERNAL.
+     * 
+ * + * string restriction = 2; + * + * @param value The bytes for restriction to set. + * @return This builder for chaining. + */ + public Builder setRestrictionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + restriction_ = 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.api.VisibilityRule) + } + + // @@protoc_insertion_point(class_scope:google.api.VisibilityRule) + private static final com.google.api.VisibilityRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.VisibilityRule(); + } + + public static com.google.api.VisibilityRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VisibilityRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VisibilityRule(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.api.VisibilityRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java new file mode 100644 index 00000000..0df4b587 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java @@ -0,0 +1,97 @@ +/* + * 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/visibility.proto + +package com.google.api; + +public interface VisibilityRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.VisibilityRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Selects methods, messages, fields, enums, etc. to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * + * @return The selector. + */ + java.lang.String getSelector(); + /** + * + * + *
+   * Selects methods, messages, fields, enums, etc. to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * + * @return The bytes for selector. + */ + com.google.protobuf.ByteString getSelectorBytes(); + + /** + * + * + *
+   * A comma-separated list of visibility labels that apply to the `selector`.
+   * Any of the listed labels can be used to grant the visibility.
+   * If a rule has multiple labels, removing one of the labels but not all of
+   * them can break clients.
+   * Example:
+   *     visibility:
+   *       rules:
+   *       - selector: google.calendar.Calendar.EnhancedSearch
+   *         restriction: INTERNAL, PREVIEW
+   * Removing INTERNAL from this restriction will break clients that rely on
+   * this method and only had access to it through INTERNAL.
+   * 
+ * + * string restriction = 2; + * + * @return The restriction. + */ + java.lang.String getRestriction(); + /** + * + * + *
+   * A comma-separated list of visibility labels that apply to the `selector`.
+   * Any of the listed labels can be used to grant the visibility.
+   * If a rule has multiple labels, removing one of the labels but not all of
+   * them can break clients.
+   * Example:
+   *     visibility:
+   *       rules:
+   *       - selector: google.calendar.Calendar.EnhancedSearch
+   *         restriction: INTERNAL, PREVIEW
+   * Removing INTERNAL from this restriction will break clients that rely on
+   * this method and only had access to it through INTERNAL.
+   * 
+ * + * string restriction = 2; + * + * @return The bytes for restriction. + */ + com.google.protobuf.ByteString getRestrictionBytes(); +} diff --git a/synth.metadata b/synth.metadata index 5c22f1db..6eaca290 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-common-protos.git", - "sha": "eac28b018e4642539d9097e38a8b231aa4ce752c" + "sha": "347d858fef7f7182683a35e0c1f2a3cee75abfaf" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "15c5e21948ff6fbe41f91bdf04f6252f91a12d59", - "internalRef": "364894175" + "sha": "7cde5d0df08801e00fc45df1546942aa2692d5c3", + "internalRef": "370757345" } }, { @@ -216,6 +216,11 @@ "proto-google-common-protos/src/main/java/com/google/api/UsageProto.java", "proto-google-common-protos/src/main/java/com/google/api/UsageRule.java", "proto-google-common-protos/src/main/java/com/google/api/UsageRuleOrBuilder.java", + "proto-google-common-protos/src/main/java/com/google/api/Visibility.java", + "proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java", + "proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java", + "proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java", + "proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java", "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java", "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java", "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java",