Jens Geyer | 731975a | 2014-05-02 00:24:24 +0200 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | struct structA { |
| 21 | 1: required i64 sa_i |
| 22 | } |
| 23 | |
| 24 | struct all_optional { |
| 25 | 1: optional string s = "DEFAULT", |
| 26 | 2: optional i64 i = 42, |
| 27 | 3: optional bool b = false, |
| 28 | 4: optional string s2, |
| 29 | 5: optional i64 i2, |
| 30 | 6: optional bool b2, |
| 31 | 7: optional structA aa, |
| 32 | 9: optional list<i64> l, |
| 33 | 10: optional list<i64> l2 = [1, 2], |
| 34 | 11: optional map<i64, i64> m, |
| 35 | 12: optional map<i64, i64> m2 = {1:2, 3:4}, |
| 36 | 13: optional binary bin, |
| 37 | 14: optional binary bin2 = "asdf", |
| 38 | } |
| 39 | |
| 40 | struct structB { |
| 41 | 1: required structA required_struct_thing |
| 42 | 2: optional structA optional_struct_thing |
| 43 | } |
Jens Geyer | 307144a | 2015-01-20 22:21:57 +0100 | [diff] [blame] | 44 | |
| 45 | struct structC { |
| 46 | 1: string s, |
| 47 | 2: required i32 i, |
| 48 | 3: optional bool b, |
| 49 | 4: required string s2, |
| 50 | } |