field_info.proto 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright 2023 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. import "google/protobuf/descriptor.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "FieldInfoProto";
  20. option java_package = "com.google.api";
  21. option objc_class_prefix = "GAPI";
  22. extend google.protobuf.FieldOptions {
  23. // Rich semantic descriptor of an API field beyond the basic typing.
  24. //
  25. // Examples:
  26. //
  27. // string request_id = 1 [(google.api.field_info).format = UUID4];
  28. // string old_ip_address = 2 [(google.api.field_info).format = IPV4];
  29. // string new_ip_address = 3 [(google.api.field_info).format = IPV6];
  30. // string actual_ip_address = 4 [
  31. // (google.api.field_info).format = IPV4_OR_IPV6
  32. // ];
  33. google.api.FieldInfo field_info = 291403980;
  34. }
  35. // Rich semantic information of an API field beyond basic typing.
  36. message FieldInfo {
  37. // The standard format of a field value. The supported formats are all backed
  38. // by either an RFC defined by the IETF or a Google-defined AIP.
  39. enum Format {
  40. // Default, unspecified value.
  41. FORMAT_UNSPECIFIED = 0;
  42. // Universally Unique Identifier, version 4, value as defined by
  43. // https://datatracker.ietf.org/doc/html/rfc4122. The value may be
  44. // normalized to entirely lowercase letters. For example, the value
  45. // `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
  46. // `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
  47. UUID4 = 1;
  48. // Internet Protocol v4 value as defined by [RFC
  49. // 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
  50. // condensed, with leading zeros in each octet stripped. For example,
  51. // `001.022.233.040` would be condensed to `1.22.233.40`.
  52. IPV4 = 2;
  53. // Internet Protocol v6 value as defined by [RFC
  54. // 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
  55. // normalized to entirely lowercase letters, and zero-padded partial and
  56. // empty octets. For example, the value `2001:DB8::` would be normalized to
  57. // `2001:0db8:0:0`.
  58. IPV6 = 3;
  59. // An IP address in either v4 or v6 format as described by the individual
  60. // values defined herein. See the comments on the IPV4 and IPV6 types for
  61. // allowed normalizations of each.
  62. IPV4_OR_IPV6 = 4;
  63. }
  64. // The standard format of a field value. This does not explicitly configure
  65. // any API consumer, just documents the API's format for the field it is
  66. // applied to.
  67. Format format = 1;
  68. }