// 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 // // https://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 nearby.sharing.proto; option optimize_for = LITE_RUNTIME; // LINT.IfChange(TaggedUnion) // Tag and Data define a "variant" type, aka tagged union. // https://en.wikipedia.org/wiki/Tagged_union enum Tag { TAG_NULL = 0; TAG_BOOL = 1; TAG_INT64 = 2; TAG_STRING = 3; TAG_STRING_ARRAY = 4; } message Data { Tag tag = 1; // Not using `oneof` because `repeated` is not allowed in `oneof` optional bool as_bool = 2; optional int64 as_int64 = 3; optional string as_string = 4; repeated string as_string_array = 5; } // LINT.ThenChange( // //depot/google3/third_party/nearby/sharing/nearby_sharing_settings.h:TaggedUnion // )