| // Copyright 2026 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. |
| // |
| |
| edition = "2024"; |
| |
| package credentio_testing; |
| |
| message Message { |
| message NestedMessage { |
| message NestedNestedMessage { |
| string name = 1; |
| uint64 version = 2; |
| } |
| |
| string required_name = 1; |
| |
| uint64 version = 2; |
| NestedNestedMessage nested_nested_message = 3; |
| } |
| |
| NestedMessage required_nested_message = 1; |
| |
| uint64 required_uint64 = 2; |
| |
| repeated NestedMessage repeated_nested_message = 3; |
| |
| repeated NestedMessage required_repeated_nested_message = 4; |
| |
| repeated NestedMessage required_non_empty_repeated_nested_message = 5; |
| } |
| |
| message MessageContainingMessage { |
| Message msg = 1; |
| } |
| |
| message Message2 { |
| message NestedMessage2 { |
| string name = 1; |
| uint64 version = 2; |
| } |
| |
| NestedMessage2 nested_message = 1; |
| } |
| |
| message MessageWithWriteOnlyField { |
| string name = 1; |
| uint64 version = 2; |
| bytes pad = 3; |
| } |
| |
| message MessageOfBools { |
| bool required_bool = 1; |
| |
| bool optional_bool = 2; |
| |
| repeated bool repeated_bools = 3; |
| |
| repeated bool required_repeated_bools = 4; |
| |
| repeated bool required_non_empty_repeated_bools = 5; |
| } |
| |
| message MessageOfFloats { |
| float required_float = 1; |
| |
| float optional_float = 2; |
| |
| repeated float repeated_floats = 3; |
| |
| repeated float required_repeated_floats = 4; |
| |
| repeated float required_non_empty_repeated_floats = 5; |
| } |
| |
| message MessageOfDoubles { |
| double required_double = 1; |
| |
| double optional_double = 2; |
| |
| repeated double repeated_doubles = 3; |
| |
| repeated double required_repeated_doubles = 4; |
| |
| repeated double required_non_empty_repeated_doubles = 5; |
| } |
| |
| message MessageOfInt64s { |
| int64 required_int64 = 1; |
| |
| int64 optional_int64 = 2; |
| |
| repeated int64 repeated_int64s = 3; |
| |
| repeated int64 required_repeated_int64s = 4; |
| |
| repeated int64 required_non_empty_repeated_int64s = 5; |
| } |
| |
| message MessageOfStrings { |
| string required_string = 1; |
| |
| string optional_string = 2; |
| |
| repeated string repeated_strings = 3; |
| |
| repeated string required_repeated_strings = 5; |
| |
| repeated string required_non_empty_repeated_strings = 6; |
| } |
| |
| message MessageOfUint64s { |
| uint64 required_uint64 = 1; |
| |
| uint64 optional_uint64 = 2; |
| |
| repeated uint64 repeated_uint64s = 3; |
| |
| repeated uint64 required_repeated_uint64s = 4; |
| |
| repeated uint64 required_non_empty_repeated_uint64s = 5; |
| } |
| |
| message MessageOfByteStrings { |
| bytes required_byte_string = 1; |
| |
| bytes optional_byte_string = 2; |
| |
| repeated bytes repeated_byte_strings = 3; |
| |
| repeated bytes required_repeated_byte_strings = 4; |
| |
| repeated bytes required_non_empty_repeated_byte_strings = 5; |
| } |
| |
| // Meant to fail conversion to CBOR. |
| message MessageOfInt32 { |
| int32 required_int32 = 1; |
| } |
| |
| // Meant to fail conversion to CBOR. |
| message MessageOfRepeatedInt32 { |
| repeated int32 repeated_int32s = 1; |
| } |