xref: /aosp_15_r20/external/googleapis/google/api/consumer.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2016 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
15syntax = "proto3";
16
17package google.api;
18
19option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20option java_multiple_files = true;
21option java_outer_classname = "ConsumerProto";
22option java_package = "com.google.api";
23
24// A descriptor for defining project properties for a service. One service may
25// have many consumer projects, and the service may want to behave differently
26// depending on some properties on the project. For example, a project may be
27// associated with a school, or a business, or a government agency, a business
28// type property on the project may affect how a service responds to the client.
29// This descriptor defines which properties are allowed to be set on a project.
30//
31// Example:
32//
33//    project_properties:
34//      properties:
35//      - name: NO_WATERMARK
36//        type: BOOL
37//        description: Allows usage of the API without watermarks.
38//      - name: EXTENDED_TILE_CACHE_PERIOD
39//        type: INT64
40message ProjectProperties {
41  // List of per consumer project-specific properties.
42  repeated Property properties = 1;
43}
44
45// Defines project properties.
46//
47// API services can define properties that can be assigned to consumer projects
48// so that backends can perform response customization without having to make
49// additional calls or maintain additional storage. For example, Maps API
50// defines properties that controls map tile cache period, or whether to embed a
51// watermark in a result.
52//
53// These values can be set via API producer console. Only API providers can
54// define and set these properties.
55message Property {
56  // Supported data type of the property values
57  enum PropertyType {
58    // The type is unspecified, and will result in an error.
59    UNSPECIFIED = 0;
60
61    // The type is `int64`.
62    INT64 = 1;
63
64    // The type is `bool`.
65    BOOL = 2;
66
67    // The type is `string`.
68    STRING = 3;
69
70    // The type is 'double'.
71    DOUBLE = 4;
72  }
73
74  // The name of the property (a.k.a key).
75  string name = 1;
76
77  // The type of this property.
78  PropertyType type = 2;
79
80  // The description of the property
81  string description = 3;
82}
83