consumer.proto 2.6 KB

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