go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/common/proto/googleapis/google/api/client.proto (about)

     1  // Copyright 2023 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package google.api;
    18  
    19  import "google/api/launch_stage.proto";
    20  import "google/protobuf/descriptor.proto";
    21  import "google/protobuf/duration.proto";
    22  
    23  option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
    24  option java_multiple_files = true;
    25  option java_outer_classname = "ClientProto";
    26  option java_package = "com.google.api";
    27  option objc_class_prefix = "GAPI";
    28  
    29  extend google.protobuf.MethodOptions {
    30    // A definition of a client library method signature.
    31    //
    32    // In client libraries, each proto RPC corresponds to one or more methods
    33    // which the end user is able to call, and calls the underlying RPC.
    34    // Normally, this method receives a single argument (a struct or instance
    35    // corresponding to the RPC request object). Defining this field will
    36    // add one or more overloads providing flattened or simpler method signatures
    37    // in some languages.
    38    //
    39    // The fields on the method signature are provided as a comma-separated
    40    // string.
    41    //
    42    // For example, the proto RPC and annotation:
    43    //
    44    //   rpc CreateSubscription(CreateSubscriptionRequest)
    45    //       returns (Subscription) {
    46    //     option (google.api.method_signature) = "name,topic";
    47    //   }
    48    //
    49    // Would add the following Java overload (in addition to the method accepting
    50    // the request object):
    51    //
    52    //   public final Subscription createSubscription(String name, String topic)
    53    //
    54    // The following backwards-compatibility guidelines apply:
    55    //
    56    //   * Adding this annotation to an unannotated method is backwards
    57    //     compatible.
    58    //   * Adding this annotation to a method which already has existing
    59    //     method signature annotations is backwards compatible if and only if
    60    //     the new method signature annotation is last in the sequence.
    61    //   * Modifying or removing an existing method signature annotation is
    62    //     a breaking change.
    63    //   * Re-ordering existing method signature annotations is a breaking
    64    //     change.
    65    repeated string method_signature = 1051;
    66  }
    67  
    68  extend google.protobuf.ServiceOptions {
    69    // The hostname for this service.
    70    // This should be specified with no prefix or protocol.
    71    //
    72    // Example:
    73    //
    74    //   service Foo {
    75    //     option (google.api.default_host) = "foo.googleapi.com";
    76    //     ...
    77    //   }
    78    string default_host = 1049;
    79  
    80    // OAuth scopes needed for the client.
    81    //
    82    // Example:
    83    //
    84    //   service Foo {
    85    //     option (google.api.oauth_scopes) = \
    86    //       "https://www.googleapis.com/auth/cloud-platform";
    87    //     ...
    88    //   }
    89    //
    90    // If there is more than one scope, use a comma-separated string:
    91    //
    92    // Example:
    93    //
    94    //   service Foo {
    95    //     option (google.api.oauth_scopes) = \
    96    //       "https://www.googleapis.com/auth/cloud-platform,"
    97    //       "https://www.googleapis.com/auth/monitoring";
    98    //     ...
    99    //   }
   100    string oauth_scopes = 1050;
   101  }
   102  
   103  // Required information for every language.
   104  message CommonLanguageSettings {
   105    // Link to automatically generated reference documentation.  Example:
   106    // https://cloud.google.com/nodejs/docs/reference/asset/latest
   107    string reference_docs_uri = 1 [deprecated = true];
   108  
   109    // The destination where API teams want this client library to be published.
   110    repeated ClientLibraryDestination destinations = 2;
   111  }
   112  
   113  // Details about how and where to publish client libraries.
   114  message ClientLibrarySettings {
   115    // Version of the API to apply these settings to. This is the full protobuf
   116    // package for the API, ending in the version element.
   117    // Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
   118    string version = 1;
   119  
   120    // Launch stage of this version of the API.
   121    LaunchStage launch_stage = 2;
   122  
   123    // When using transport=rest, the client request will encode enums as
   124    // numbers rather than strings.
   125    bool rest_numeric_enums = 3;
   126  
   127    // Settings for legacy Java features, supported in the Service YAML.
   128    JavaSettings java_settings = 21;
   129  
   130    // Settings for C++ client libraries.
   131    CppSettings cpp_settings = 22;
   132  
   133    // Settings for PHP client libraries.
   134    PhpSettings php_settings = 23;
   135  
   136    // Settings for Python client libraries.
   137    PythonSettings python_settings = 24;
   138  
   139    // Settings for Node client libraries.
   140    NodeSettings node_settings = 25;
   141  
   142    // Settings for .NET client libraries.
   143    DotnetSettings dotnet_settings = 26;
   144  
   145    // Settings for Ruby client libraries.
   146    RubySettings ruby_settings = 27;
   147  
   148    // Settings for Go client libraries.
   149    GoSettings go_settings = 28;
   150  }
   151  
   152  // This message configures the settings for publishing [Google Cloud Client
   153  // libraries](https://cloud.google.com/apis/docs/cloud-client-libraries)
   154  // generated from the service config.
   155  message Publishing {
   156    // A list of API method settings, e.g. the behavior for methods that use the
   157    // long-running operation pattern.
   158    repeated MethodSettings method_settings = 2;
   159  
   160    // Link to a *public* URI where users can report issues.  Example:
   161    // https://issuetracker.google.com/issues/new?component=190865&template=1161103
   162    string new_issue_uri = 101;
   163  
   164    // Link to product home page.  Example:
   165    // https://cloud.google.com/asset-inventory/docs/overview
   166    string documentation_uri = 102;
   167  
   168    // Used as a tracking tag when collecting data about the APIs developer
   169    // relations artifacts like docs, packages delivered to package managers,
   170    // etc.  Example: "speech".
   171    string api_short_name = 103;
   172  
   173    // GitHub label to apply to issues and pull requests opened for this API.
   174    string github_label = 104;
   175  
   176    // GitHub teams to be added to CODEOWNERS in the directory in GitHub
   177    // containing source code for the client libraries for this API.
   178    repeated string codeowner_github_teams = 105;
   179  
   180    // A prefix used in sample code when demarking regions to be included in
   181    // documentation.
   182    string doc_tag_prefix = 106;
   183  
   184    // For whom the client library is being published.
   185    ClientLibraryOrganization organization = 107;
   186  
   187    // Client library settings.  If the same version string appears multiple
   188    // times in this list, then the last one wins.  Settings from earlier
   189    // settings with the same version string are discarded.
   190    repeated ClientLibrarySettings library_settings = 109;
   191  
   192    // Optional link to proto reference documentation.  Example:
   193    // https://cloud.google.com/pubsub/lite/docs/reference/rpc
   194    string proto_reference_documentation_uri = 110;
   195  }
   196  
   197  // Settings for Java client libraries.
   198  message JavaSettings {
   199    // The package name to use in Java. Clobbers the java_package option
   200    // set in the protobuf. This should be used **only** by APIs
   201    // who have already set the language_settings.java.package_name" field
   202    // in gapic.yaml. API teams should use the protobuf java_package option
   203    // where possible.
   204    //
   205    // Example of a YAML configuration::
   206    //
   207    //  publishing:
   208    //    java_settings:
   209    //      library_package: com.google.cloud.pubsub.v1
   210    string library_package = 1;
   211  
   212    // Configure the Java class name to use instead of the service's for its
   213    // corresponding generated GAPIC client. Keys are fully-qualified
   214    // service names as they appear in the protobuf (including the full
   215    // the language_settings.java.interface_names" field in gapic.yaml. API
   216    // teams should otherwise use the service name as it appears in the
   217    // protobuf.
   218    //
   219    // Example of a YAML configuration::
   220    //
   221    //  publishing:
   222    //    java_settings:
   223    //      service_class_names:
   224    //        - google.pubsub.v1.Publisher: TopicAdmin
   225    //        - google.pubsub.v1.Subscriber: SubscriptionAdmin
   226    map<string, string> service_class_names = 2;
   227  
   228    // Some settings.
   229    CommonLanguageSettings common = 3;
   230  }
   231  
   232  // Settings for C++ client libraries.
   233  message CppSettings {
   234    // Some settings.
   235    CommonLanguageSettings common = 1;
   236  }
   237  
   238  // Settings for Php client libraries.
   239  message PhpSettings {
   240    // Some settings.
   241    CommonLanguageSettings common = 1;
   242  }
   243  
   244  // Settings for Python client libraries.
   245  message PythonSettings {
   246    // Some settings.
   247    CommonLanguageSettings common = 1;
   248  }
   249  
   250  // Settings for Node client libraries.
   251  message NodeSettings {
   252    // Some settings.
   253    CommonLanguageSettings common = 1;
   254  }
   255  
   256  // Settings for Dotnet client libraries.
   257  message DotnetSettings {
   258    // Some settings.
   259    CommonLanguageSettings common = 1;
   260  
   261    // Map from original service names to renamed versions.
   262    // This is used when the default generated types
   263    // would cause a naming conflict. (Neither name is
   264    // fully-qualified.)
   265    // Example: Subscriber to SubscriberServiceApi.
   266    map<string, string> renamed_services = 2;
   267  
   268    // Map from full resource types to the effective short name
   269    // for the resource. This is used when otherwise resource
   270    // named from different services would cause naming collisions.
   271    // Example entry:
   272    // "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
   273    map<string, string> renamed_resources = 3;
   274  
   275    // List of full resource types to ignore during generation.
   276    // This is typically used for API-specific Location resources,
   277    // which should be handled by the generator as if they were actually
   278    // the common Location resources.
   279    // Example entry: "documentai.googleapis.com/Location"
   280    repeated string ignored_resources = 4;
   281  
   282    // Namespaces which must be aliased in snippets due to
   283    // a known (but non-generator-predictable) naming collision
   284    repeated string forced_namespace_aliases = 5;
   285  
   286    // Method signatures (in the form "service.method(signature)")
   287    // which are provided separately, so shouldn't be generated.
   288    // Snippets *calling* these methods are still generated, however.
   289    repeated string handwritten_signatures = 6;
   290  }
   291  
   292  // Settings for Ruby client libraries.
   293  message RubySettings {
   294    // Some settings.
   295    CommonLanguageSettings common = 1;
   296  }
   297  
   298  // Settings for Go client libraries.
   299  message GoSettings {
   300    // Some settings.
   301    CommonLanguageSettings common = 1;
   302  }
   303  
   304  // Describes the generator configuration for a method.
   305  message MethodSettings {
   306    // Describes settings to use when generating API methods that use the
   307    // long-running operation pattern.
   308    // All default values below are from those used in the client library
   309    // generators (e.g.
   310    // [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)).
   311    message LongRunning {
   312      // Initial delay after which the first poll request will be made.
   313      // Default value: 5 seconds.
   314      google.protobuf.Duration initial_poll_delay = 1;
   315  
   316      // Multiplier to gradually increase delay between subsequent polls until it
   317      // reaches max_poll_delay.
   318      // Default value: 1.5.
   319      float poll_delay_multiplier = 2;
   320  
   321      // Maximum time between two subsequent poll requests.
   322      // Default value: 45 seconds.
   323      google.protobuf.Duration max_poll_delay = 3;
   324  
   325      // Total polling timeout.
   326      // Default value: 5 minutes.
   327      google.protobuf.Duration total_poll_timeout = 4;
   328    }
   329  
   330    // The fully qualified name of the method, for which the options below apply.
   331    // This is used to find the method to apply the options.
   332    string selector = 1;
   333  
   334    // Describes settings to use for long-running operations when generating
   335    // API methods for RPCs. Complements RPCs that use the annotations in
   336    // google/longrunning/operations.proto.
   337    //
   338    // Example of a YAML configuration::
   339    //
   340    //  publishing:
   341    //    method_settings:
   342    //      - selector: google.cloud.speech.v2.Speech.BatchRecognize
   343    //        long_running:
   344    //          initial_poll_delay:
   345    //            seconds: 60 # 1 minute
   346    //          poll_delay_multiplier: 1.5
   347    //          max_poll_delay:
   348    //            seconds: 360 # 6 minutes
   349    //          total_poll_timeout:
   350    //             seconds: 54000 # 90 minutes
   351    LongRunning long_running = 2;
   352  
   353    // List of top-level fields of the request message, that should be
   354    // automatically populated by the client libraries based on their
   355    // (google.api.field_info).format. Currently supported format: UUID4.
   356    //
   357    // Example of a YAML configuration:
   358    //
   359    //  publishing:
   360    //    method_settings:
   361    //      - selector: google.example.v1.ExampleService.CreateExample
   362    //        auto_populated_fields:
   363    //        - request_id
   364    repeated string auto_populated_fields = 3;
   365  }
   366  
   367  // The organization for which the client libraries are being published.
   368  // Affects the url where generated docs are published, etc.
   369  enum ClientLibraryOrganization {
   370    // Not useful.
   371    CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0;
   372  
   373    // Google Cloud Platform Org.
   374    CLOUD = 1;
   375  
   376    // Ads (Advertising) Org.
   377    ADS = 2;
   378  
   379    // Photos Org.
   380    PHOTOS = 3;
   381  
   382    // Street View Org.
   383    STREET_VIEW = 4;
   384  
   385    // Shopping Org.
   386    SHOPPING = 5;
   387  
   388    // Geo Org.
   389    GEO = 6;
   390  
   391    // Generative AI - https://developers.generativeai.google
   392    GENERATIVE_AI = 7;
   393  }
   394  
   395  // To where should client libraries be published?
   396  enum ClientLibraryDestination {
   397    // Client libraries will neither be generated nor published to package
   398    // managers.
   399    CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0;
   400  
   401    // Generate the client library in a repo under github.com/googleapis,
   402    // but don't publish it to package managers.
   403    GITHUB = 10;
   404  
   405    // Publish the library to package managers like nuget.org and npmjs.com.
   406    PACKAGE_MANAGER = 20;
   407  }