system_parameter.proto 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // Copyright 2016 Google Inc.
  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. option java_multiple_files = true;
  17. option java_outer_classname = "SystemParameterProto";
  18. option java_package = "com.google.api";
  19. option objc_class_prefix = "GAPI";
  20. // ### System parameter configuration
  21. //
  22. // A system parameter is a special kind of parameter defined by the API
  23. // system, not by an individual API. It is typically mapped to an HTTP header
  24. // and/or a URL query parameter. This configuration specifies which methods
  25. // change the names of the system parameters.
  26. message SystemParameters {
  27. // Define system parameters.
  28. //
  29. // The parameters defined here will override the default parameters
  30. // implemented by the system. If this field is missing from the service
  31. // config, default system parameters will be used. Default system parameters
  32. // and names is implementation-dependent.
  33. //
  34. // Example: define api key and alt name for all methods
  35. //
  36. // system_parameters
  37. // rules:
  38. // - selector: "*"
  39. // parameters:
  40. // - name: api_key
  41. // url_query_parameter: api_key
  42. // - name: alt
  43. // http_header: Response-Content-Type
  44. //
  45. // Example: define 2 api key names for a specific method.
  46. //
  47. // system_parameters
  48. // rules:
  49. // - selector: "/ListShelves"
  50. // parameters:
  51. // - name: api_key
  52. // http_header: Api-Key1
  53. // - name: api_key
  54. // http_header: Api-Key2
  55. //
  56. // **NOTE:** All service configuration rules follow "last one wins" order.
  57. repeated SystemParameterRule rules = 1;
  58. }
  59. // Define a system parameter rule mapping system parameter definitions to
  60. // methods.
  61. message SystemParameterRule {
  62. // Selects the methods to which this rule applies. Use '*' to indicate all
  63. // methods in all APIs.
  64. //
  65. // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
  66. string selector = 1;
  67. // Define parameters. Multiple names may be defined for a parameter.
  68. // For a given method call, only one of them should be used. If multiple
  69. // names are used the behavior is implementation-dependent.
  70. // If none of the specified names are present the behavior is
  71. // parameter-dependent.
  72. repeated SystemParameter parameters = 2;
  73. }
  74. // Define a parameter's name and location. The parameter may be passed as either
  75. // an HTTP header or a URL query parameter, and if both are passed the behavior
  76. // is implementation-dependent.
  77. message SystemParameter {
  78. // Define the name of the parameter, such as "api_key", "alt", "callback",
  79. // and etc. It is case sensitive.
  80. string name = 1;
  81. // Define the HTTP header name to use for the parameter. It is case
  82. // insensitive.
  83. string http_header = 2;
  84. // Define the URL query parameter name to use for the parameter. It is case
  85. // sensitive.
  86. string url_query_parameter = 3;
  87. }