system_parameter.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Copyright 2024 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. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "SystemParameterProto";
  19. option java_package = "com.google.api";
  20. option objc_class_prefix = "GAPI";
  21. // ### System parameter configuration
  22. //
  23. // A system parameter is a special kind of parameter defined by the API
  24. // system, not by an individual API. It is typically mapped to an HTTP header
  25. // and/or a URL query parameter. This configuration specifies which methods
  26. // change the names of the system parameters.
  27. message SystemParameters {
  28. // Define system parameters.
  29. //
  30. // The parameters defined here will override the default parameters
  31. // implemented by the system. If this field is missing from the service
  32. // config, default system parameters will be used. Default system parameters
  33. // and names is implementation-dependent.
  34. //
  35. // Example: define api key for all methods
  36. //
  37. // system_parameters
  38. // rules:
  39. // - selector: "*"
  40. // parameters:
  41. // - name: api_key
  42. // url_query_parameter: api_key
  43. //
  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
  66. // 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. }