consumer.proto 2.7 KB

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