client.proto 13 KB

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