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// Naming testcases, sepcifically for these tickets (but not limited to them)
21// THRIFT-2508 Uncompileable C# code due to language keywords in IDL
22// THRIFT-2557 error CS0542 member names cannot be the same as their enclosing type
23
24
25struct using {
26    1: double single
27    2: double integer
28}
29
30struct delegate {
31    1: string partial
32    2: delegate delegate
33}
34
35struct get {
36    1: bool sbyte
37}
38
39struct partial {
40    1: using using
41    2: bool read
42    3: bool write
43}
44
45enum Maybe {
46  JUST = 1,
47  TRUE = 2,
48  FALSE = 3
49}
50
51enum Either {
52  LEFT = 1,
53  RIGHT = 2
54}
55
56struct foldr {
57  1: string id
58}
59
60struct of {
61  1: string let
62  2: string where
63}
64
65struct ofOf {
66  1: of Of
67}
68
69
70struct ClassAndProp {
71  1: bool ClassAndProp
72  2: bool ClassAndProp_
73  3: bool ClassAndProp__
74  4: bool ClassAndProper
75}
76
77struct second_chance {
78  1: bool SECOND_CHANCE
79  2: bool SECOND_CHANCE_
80  3: bool SECOND_CHANCE__
81  4: bool SECOND_CHANCES
82}
83
84struct NOW_EAT_THIS {
85  1: bool now_eat_this
86  2: bool now_eat_this_
87  3: bool now_eat_this__
88  4: bool now_eat_this_and_this
89}
90
91struct TheEdgeCase {
92  1: bool theEdgeCase
93  2: bool theEdgeCase_
94  3: bool theEdgeCase__
95  4: bool TheEdgeCase
96  5: bool TheEdgeCase_
97  6: bool TheEdgeCase__
98}
99
100struct Tricky_ {
101  1: bool tricky
102  2: bool Tricky
103}
104
105struct Nested {
106  1: ClassAndProp ClassAndProp
107  2: second_chance second_chance
108  3: NOW_EAT_THIS NOW_EAT_THIS
109  4: TheEdgeCase TheEdgeCase
110  5: Tricky_ Tricky_
111  6: Nested Nested
112}
113
114exception Problem_ {
115  1: bool problem
116  2: bool Problem
117}
118
119struct Thrift5626 {
120   1: i8       i8
121   2: i16      i16
122   3: i32      i32
123   4: i64      i64
124   5: uuid     uuid
125   6: string   string
126   7: binary   binary
127   8: bool     bool
128   9: byte     byte
129  10: list<string>        list
130  11: set<string>         set
131  12: map<string,string>  map
132}
133
134service extern {
135    delegate event(1: partial get)
136    void Foo(1: Nested Foo_args) throws (1: Problem_ Foo_result)
137}
138
139service qualified {
140    Maybe maybe(1: Maybe foldr)
141    Either either(1: foldr of)
142}
143// eof
144