client.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. // Copyright 2018 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;
  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.
  106. string version = 1;
  107. // Launch stage of this version of the API.
  108. LaunchStage launch_stage = 2;
  109. // When using transport=rest, the client request will encode enums as
  110. // numbers rather than strings.
  111. bool rest_numeric_enums = 3;
  112. // Settings for legacy Java features, supported in the Service YAML.
  113. JavaSettings java_settings = 21;
  114. // Settings for C++ client libraries.
  115. CppSettings cpp_settings = 22;
  116. // Settings for PHP client libraries.
  117. PhpSettings php_settings = 23;
  118. // Settings for Python client libraries.
  119. PythonSettings python_settings = 24;
  120. // Settings for Node client libraries.
  121. NodeSettings node_settings = 25;
  122. // Settings for .NET client libraries.
  123. DotnetSettings dotnet_settings = 26;
  124. // Settings for Ruby client libraries.
  125. RubySettings ruby_settings = 27;
  126. // Settings for Go client libraries.
  127. GoSettings go_settings = 28;
  128. }
  129. // This message configures the settings for publishing [Google Cloud Client
  130. // libraries](https://cloud.google.com/apis/docs/cloud-client-libraries)
  131. // generated from the service config.
  132. message Publishing {
  133. // A list of API method settings, e.g. the behavior for methods that use the
  134. // long-running operation pattern.
  135. repeated MethodSettings method_settings = 2;
  136. // Link to a place that API users can report issues. Example:
  137. // https://issuetracker.google.com/issues/new?component=190865&template=1161103
  138. string new_issue_uri = 101;
  139. // Link to product home page. Example:
  140. // https://cloud.google.com/asset-inventory/docs/overview
  141. string documentation_uri = 102;
  142. // Used as a tracking tag when collecting data about the APIs developer
  143. // relations artifacts like docs, packages delivered to package managers,
  144. // etc. Example: "speech".
  145. string api_short_name = 103;
  146. // GitHub label to apply to issues and pull requests opened for this API.
  147. string github_label = 104;
  148. // GitHub teams to be added to CODEOWNERS in the directory in GitHub
  149. // containing source code for the client libraries for this API.
  150. repeated string codeowner_github_teams = 105;
  151. // A prefix used in sample code when demarking regions to be included in
  152. // documentation.
  153. string doc_tag_prefix = 106;
  154. // For whom the client library is being published.
  155. ClientLibraryOrganization organization = 107;
  156. // Client library settings. If the same version string appears multiple
  157. // times in this list, then the last one wins. Settings from earlier
  158. // settings with the same version string are discarded.
  159. repeated ClientLibrarySettings library_settings = 109;
  160. }
  161. // Settings for Java client libraries.
  162. message JavaSettings {
  163. // The package name to use in Java. Clobbers the java_package option
  164. // set in the protobuf. This should be used **only** by APIs
  165. // who have already set the language_settings.java.package_name" field
  166. // in gapic.yaml. API teams should use the protobuf java_package option
  167. // where possible.
  168. //
  169. // Example of a YAML configuration::
  170. //
  171. // publishing:
  172. // java_settings:
  173. // library_package: com.google.cloud.pubsub.v1
  174. string library_package = 1;
  175. // Configure the Java class name to use instead of the service's for its
  176. // corresponding generated GAPIC client. Keys are fully-qualified
  177. // service names as they appear in the protobuf (including the full
  178. // the language_settings.java.interface_names" field in gapic.yaml. API
  179. // teams should otherwise use the service name as it appears in the
  180. // protobuf.
  181. //
  182. // Example of a YAML configuration::
  183. //
  184. // publishing:
  185. // java_settings:
  186. // service_class_names:
  187. // - google.pubsub.v1.Publisher: TopicAdmin
  188. // - google.pubsub.v1.Subscriber: SubscriptionAdmin
  189. map<string, string> service_class_names = 2;
  190. // Some settings.
  191. CommonLanguageSettings common = 3;
  192. }
  193. // Settings for C++ client libraries.
  194. message CppSettings {
  195. // Some settings.
  196. CommonLanguageSettings common = 1;
  197. }
  198. // Settings for Php client libraries.
  199. message PhpSettings {
  200. // Some settings.
  201. CommonLanguageSettings common = 1;
  202. }
  203. // Settings for Python client libraries.
  204. message PythonSettings {
  205. // Some settings.
  206. CommonLanguageSettings common = 1;
  207. }
  208. // Settings for Node client libraries.
  209. message NodeSettings {
  210. // Some settings.
  211. CommonLanguageSettings common = 1;
  212. }
  213. // Settings for Dotnet client libraries.
  214. message DotnetSettings {
  215. // Some settings.
  216. CommonLanguageSettings common = 1;
  217. }
  218. // Settings for Ruby client libraries.
  219. message RubySettings {
  220. // Some settings.
  221. CommonLanguageSettings common = 1;
  222. }
  223. // Settings for Go client libraries.
  224. message GoSettings {
  225. // Some settings.
  226. CommonLanguageSettings common = 1;
  227. }
  228. // Describes the generator configuration for a method.
  229. message MethodSettings {
  230. // Describes settings to use when generating API methods that use the
  231. // long-running operation pattern.
  232. // All default values below are from those used in the client library
  233. // generators (e.g.
  234. // [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)).
  235. message LongRunning {
  236. // Initial delay after which the first poll request will be made.
  237. // Default value: 5 seconds.
  238. google.protobuf.Duration initial_poll_delay = 1;
  239. // Multiplier to gradually increase delay between subsequent polls until it
  240. // reaches max_poll_delay.
  241. // Default value: 1.5.
  242. float poll_delay_multiplier = 2;
  243. // Maximum time between two subsequent poll requests.
  244. // Default value: 45 seconds.
  245. google.protobuf.Duration max_poll_delay = 3;
  246. // Total polling timeout.
  247. // Default value: 5 minutes.
  248. google.protobuf.Duration total_poll_timeout = 4;
  249. }
  250. // The fully qualified name of the method, for which the options below apply.
  251. // This is used to find the method to apply the options.
  252. string selector = 1;
  253. // Describes settings to use for long-running operations when generating
  254. // API methods for RPCs. Complements RPCs that use the annotations in
  255. // google/longrunning/operations.proto.
  256. //
  257. // Example of a YAML configuration::
  258. //
  259. // publishing:
  260. // method_behavior:
  261. // - selector: CreateAdDomain
  262. // long_running:
  263. // initial_poll_delay:
  264. // seconds: 60 # 1 minute
  265. // poll_delay_multiplier: 1.5
  266. // max_poll_delay:
  267. // seconds: 360 # 6 minutes
  268. // total_poll_timeout:
  269. // seconds: 54000 # 90 minutes
  270. LongRunning long_running = 2;
  271. }
  272. // The organization for which the client libraries are being published.
  273. // Affects the url where generated docs are published, etc.
  274. enum ClientLibraryOrganization {
  275. // Not useful.
  276. CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0;
  277. // Google Cloud Platform Org.
  278. CLOUD = 1;
  279. // Ads (Advertising) Org.
  280. ADS = 2;
  281. // Photos Org.
  282. PHOTOS = 3;
  283. // Street View Org.
  284. STREET_VIEW = 4;
  285. }
  286. // To where should client libraries be published?
  287. enum ClientLibraryDestination {
  288. // Client libraries will neither be generated nor published to package
  289. // managers.
  290. CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0;
  291. // Generate the client library in a repo under github.com/googleapis,
  292. // but don't publish it to package managers.
  293. GITHUB = 10;
  294. // Publish the library to package managers like nuget.org and npmjs.com.
  295. PACKAGE_MANAGER = 20;
  296. }