system_parameter.proto 3.4 KB

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