system_parameter.proto 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // Copyright 2015 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 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" . It is case sensitive.
  79. string name = 1;
  80. // Define the HTTP header name to use for the parameter. It is case
  81. // insensitive.
  82. string http_header = 2;
  83. // Define the URL query parameter name to use for the parameter. It is case
  84. // sensitive.
  85. string url_query_parameter = 3;
  86. }