xref: /aosp_15_r20/external/googleapis/google/api/system_parameter.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2023 Google LLC
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.api;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workeroption go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
21*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "SystemParameterProto";
22*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.api";
23*d5c09012SAndroid Build Coastguard Workeroption objc_class_prefix = "GAPI";
24*d5c09012SAndroid Build Coastguard Worker
25*d5c09012SAndroid Build Coastguard Worker// ### System parameter configuration
26*d5c09012SAndroid Build Coastguard Worker//
27*d5c09012SAndroid Build Coastguard Worker// A system parameter is a special kind of parameter defined by the API
28*d5c09012SAndroid Build Coastguard Worker// system, not by an individual API. It is typically mapped to an HTTP header
29*d5c09012SAndroid Build Coastguard Worker// and/or a URL query parameter. This configuration specifies which methods
30*d5c09012SAndroid Build Coastguard Worker// change the names of the system parameters.
31*d5c09012SAndroid Build Coastguard Workermessage SystemParameters {
32*d5c09012SAndroid Build Coastguard Worker  // Define system parameters.
33*d5c09012SAndroid Build Coastguard Worker  //
34*d5c09012SAndroid Build Coastguard Worker  // The parameters defined here will override the default parameters
35*d5c09012SAndroid Build Coastguard Worker  // implemented by the system. If this field is missing from the service
36*d5c09012SAndroid Build Coastguard Worker  // config, default system parameters will be used. Default system parameters
37*d5c09012SAndroid Build Coastguard Worker  // and names is implementation-dependent.
38*d5c09012SAndroid Build Coastguard Worker  //
39*d5c09012SAndroid Build Coastguard Worker  // Example: define api key for all methods
40*d5c09012SAndroid Build Coastguard Worker  //
41*d5c09012SAndroid Build Coastguard Worker  //     system_parameters
42*d5c09012SAndroid Build Coastguard Worker  //       rules:
43*d5c09012SAndroid Build Coastguard Worker  //         - selector: "*"
44*d5c09012SAndroid Build Coastguard Worker  //           parameters:
45*d5c09012SAndroid Build Coastguard Worker  //             - name: api_key
46*d5c09012SAndroid Build Coastguard Worker  //               url_query_parameter: api_key
47*d5c09012SAndroid Build Coastguard Worker  //
48*d5c09012SAndroid Build Coastguard Worker  //
49*d5c09012SAndroid Build Coastguard Worker  // Example: define 2 api key names for a specific method.
50*d5c09012SAndroid Build Coastguard Worker  //
51*d5c09012SAndroid Build Coastguard Worker  //     system_parameters
52*d5c09012SAndroid Build Coastguard Worker  //       rules:
53*d5c09012SAndroid Build Coastguard Worker  //         - selector: "/ListShelves"
54*d5c09012SAndroid Build Coastguard Worker  //           parameters:
55*d5c09012SAndroid Build Coastguard Worker  //             - name: api_key
56*d5c09012SAndroid Build Coastguard Worker  //               http_header: Api-Key1
57*d5c09012SAndroid Build Coastguard Worker  //             - name: api_key
58*d5c09012SAndroid Build Coastguard Worker  //               http_header: Api-Key2
59*d5c09012SAndroid Build Coastguard Worker  //
60*d5c09012SAndroid Build Coastguard Worker  // **NOTE:** All service configuration rules follow "last one wins" order.
61*d5c09012SAndroid Build Coastguard Worker  repeated SystemParameterRule rules = 1;
62*d5c09012SAndroid Build Coastguard Worker}
63*d5c09012SAndroid Build Coastguard Worker
64*d5c09012SAndroid Build Coastguard Worker// Define a system parameter rule mapping system parameter definitions to
65*d5c09012SAndroid Build Coastguard Worker// methods.
66*d5c09012SAndroid Build Coastguard Workermessage SystemParameterRule {
67*d5c09012SAndroid Build Coastguard Worker  // Selects the methods to which this rule applies. Use '*' to indicate all
68*d5c09012SAndroid Build Coastguard Worker  // methods in all APIs.
69*d5c09012SAndroid Build Coastguard Worker  //
70*d5c09012SAndroid Build Coastguard Worker  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
71*d5c09012SAndroid Build Coastguard Worker  // details.
72*d5c09012SAndroid Build Coastguard Worker  string selector = 1;
73*d5c09012SAndroid Build Coastguard Worker
74*d5c09012SAndroid Build Coastguard Worker  // Define parameters. Multiple names may be defined for a parameter.
75*d5c09012SAndroid Build Coastguard Worker  // For a given method call, only one of them should be used. If multiple
76*d5c09012SAndroid Build Coastguard Worker  // names are used the behavior is implementation-dependent.
77*d5c09012SAndroid Build Coastguard Worker  // If none of the specified names are present the behavior is
78*d5c09012SAndroid Build Coastguard Worker  // parameter-dependent.
79*d5c09012SAndroid Build Coastguard Worker  repeated SystemParameter parameters = 2;
80*d5c09012SAndroid Build Coastguard Worker}
81*d5c09012SAndroid Build Coastguard Worker
82*d5c09012SAndroid Build Coastguard Worker// Define a parameter's name and location. The parameter may be passed as either
83*d5c09012SAndroid Build Coastguard Worker// an HTTP header or a URL query parameter, and if both are passed the behavior
84*d5c09012SAndroid Build Coastguard Worker// is implementation-dependent.
85*d5c09012SAndroid Build Coastguard Workermessage SystemParameter {
86*d5c09012SAndroid Build Coastguard Worker  // Define the name of the parameter, such as "api_key" . It is case sensitive.
87*d5c09012SAndroid Build Coastguard Worker  string name = 1;
88*d5c09012SAndroid Build Coastguard Worker
89*d5c09012SAndroid Build Coastguard Worker  // Define the HTTP header name to use for the parameter. It is case
90*d5c09012SAndroid Build Coastguard Worker  // insensitive.
91*d5c09012SAndroid Build Coastguard Worker  string http_header = 2;
92*d5c09012SAndroid Build Coastguard Worker
93*d5c09012SAndroid Build Coastguard Worker  // Define the URL query parameter name to use for the parameter. It is case
94*d5c09012SAndroid Build Coastguard Worker  // sensitive.
95*d5c09012SAndroid Build Coastguard Worker  string url_query_parameter = 3;
96*d5c09012SAndroid Build Coastguard Worker}
97