-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
google/api/field_info.proto
(#181)
* chore: [autoapprove] bump cryptography from 41.0.3 to 41.0.4 Source-Link: googleapis/synthtool@dede53f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:fac304457974bb530cc5396abd4ab25d26a469cd3bc97cbfb18c8d4324c584eb * remove testing system tests from archived repository python-texttospeech --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
- Loading branch information
1 parent
78138cc
commit 2d39f37
Showing
7 changed files
with
189 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.api; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "FieldInfoProto"; | ||
option java_package = "com.google.api"; | ||
option objc_class_prefix = "GAPI"; | ||
|
||
extend google.protobuf.FieldOptions { | ||
// Rich semantic descriptor of an API field beyond the basic typing. | ||
// | ||
// Examples: | ||
// | ||
// string request_id = 1 [(google.api.field_info).format = UUID4]; | ||
// string old_ip_address = 2 [(google.api.field_info).format = IPV4]; | ||
// string new_ip_address = 3 [(google.api.field_info).format = IPV6]; | ||
// string actual_ip_address = 4 [ | ||
// (google.api.field_info).format = IPV4_OR_IPV6 | ||
// ]; | ||
google.api.FieldInfo field_info = 291403980; | ||
} | ||
|
||
// Rich semantic information of an API field beyond basic typing. | ||
message FieldInfo { | ||
// The standard format of a field value. The supported formats are all backed | ||
// by either an RFC defined by the IETF or a Google-defined AIP. | ||
enum Format { | ||
// Default, unspecified value. | ||
FORMAT_UNSPECIFIED = 0; | ||
|
||
// Universally Unique Identifier, version 4, value as defined by | ||
// https://datatracker.ietf.org/doc/html/rfc4122. The value may be | ||
// normalized to entirely lowercase letters. For example, the value | ||
// `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to | ||
// `f47ac10b-58cc-0372-8567-0e02b2c3d479`. | ||
UUID4 = 1; | ||
|
||
// Internet Protocol v4 value as defined by [RFC | ||
// 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be | ||
// condensed, with leading zeros in each octet stripped. For example, | ||
// `001.022.233.040` would be condensed to `1.22.233.40`. | ||
IPV4 = 2; | ||
|
||
// Internet Protocol v6 value as defined by [RFC | ||
// 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be | ||
// normalized to entirely lowercase letters, and zero-padded partial and | ||
// empty octets. For example, the value `2001:DB8::` would be normalized to | ||
// `2001:0db8:0:0`. | ||
IPV6 = 3; | ||
|
||
// An IP address in either v4 or v6 format as described by the individual | ||
// values defined herein. See the comments on the IPV4 and IPV6 types for | ||
// allowed normalizations of each. | ||
IPV4_OR_IPV6 = 4; | ||
} | ||
|
||
// The standard format of a field value. This does not explicitly configure | ||
// any API consumer, just documents the API's format for the field it is | ||
// applied to. | ||
Format format = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Generated by the protocol buffer compiler. DO NOT EDIT! | ||
# source: google/api/field_info.proto | ||
"""Generated protocol buffer code.""" | ||
from google.protobuf import descriptor as _descriptor | ||
from google.protobuf import descriptor_pool as _descriptor_pool | ||
from google.protobuf import message as _message | ||
from google.protobuf import reflection as _reflection | ||
from google.protobuf import symbol_database as _symbol_database | ||
|
||
# @@protoc_insertion_point(imports) | ||
|
||
_sym_db = _symbol_database.Default() | ||
|
||
|
||
from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 | ||
|
||
|
||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( | ||
b'\n\x1bgoogle/api/field_info.proto\x12\ngoogle.api\x1a google/protobuf/descriptor.proto"\x8c\x01\n\tFieldInfo\x12,\n\x06\x66ormat\x18\x01 \x01(\x0e\x32\x1c.google.api.FieldInfo.Format"Q\n\x06\x46ormat\x12\x16\n\x12\x46ORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05UUID4\x10\x01\x12\x08\n\x04IPV4\x10\x02\x12\x08\n\x04IPV6\x10\x03\x12\x10\n\x0cIPV4_OR_IPV6\x10\x04:L\n\nfield_info\x12\x1d.google.protobuf.FieldOptions\x18\xcc\xf1\xf9\x8a\x01 \x01(\x0b\x32\x15.google.api.FieldInfoBl\n\x0e\x63om.google.apiB\x0e\x46ieldInfoProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3' | ||
) | ||
|
||
|
||
FIELD_INFO_FIELD_NUMBER = 291403980 | ||
field_info = DESCRIPTOR.extensions_by_name["field_info"] | ||
|
||
_FIELDINFO = DESCRIPTOR.message_types_by_name["FieldInfo"] | ||
_FIELDINFO_FORMAT = _FIELDINFO.enum_types_by_name["Format"] | ||
FieldInfo = _reflection.GeneratedProtocolMessageType( | ||
"FieldInfo", | ||
(_message.Message,), | ||
{ | ||
"DESCRIPTOR": _FIELDINFO, | ||
"__module__": "google.api.field_info_pb2" | ||
# @@protoc_insertion_point(class_scope:google.api.FieldInfo) | ||
}, | ||
) | ||
_sym_db.RegisterMessage(FieldInfo) | ||
|
||
if _descriptor._USE_C_DESCRIPTORS == False: | ||
google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(field_info) | ||
|
||
DESCRIPTOR._options = None | ||
DESCRIPTOR._serialized_options = b"\n\016com.google.apiB\016FieldInfoProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI" | ||
_FIELDINFO._serialized_start = 78 | ||
_FIELDINFO._serialized_end = 218 | ||
_FIELDINFO_FORMAT._serialized_start = 137 | ||
_FIELDINFO_FORMAT._serialized_end = 218 | ||
# @@protoc_insertion_point(module_scope) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters