upfluence-thrift 2.4.4 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/thrift/definition.rb +29 -8
  3. data/lib/thrift/processor.rb +96 -0
  4. data/lib/thrift/types/annotation/deprecation/deprecation_constants.rb +17 -0
  5. data/lib/thrift/types/annotation/deprecation/deprecation_types.rb +44 -0
  6. data/lib/thrift/types/annotation/naming/naming.rb +23 -0
  7. data/lib/thrift/types/annotation/naming/naming_constants.rb +17 -0
  8. data/lib/thrift/types/annotation/naming/naming_types.rb +59 -0
  9. data/lib/thrift/types/known/{any.rb → any/any.rb} +1 -1
  10. data/lib/thrift/types/known/{any_constants.rb → any/any_constants.rb} +2 -2
  11. data/lib/thrift/types/known/{any_types.rb → any/any_types.rb} +21 -3
  12. data/lib/thrift/types/known/{duration.rb → duration/duration.rb} +1 -1
  13. data/lib/thrift/types/known/{duration_constants.rb → duration/duration_constants.rb} +2 -2
  14. data/lib/thrift/types/known/{duration_types.rb → duration/duration_types.rb} +21 -3
  15. data/lib/thrift/types/known/{timestamp.rb → timestamp/timestamp.rb} +1 -1
  16. data/lib/thrift/types/known/{timestamp_constants.rb → timestamp/timestamp_constants.rb} +2 -2
  17. data/lib/thrift/types/known/{timestamp_types.rb → timestamp/timestamp_types.rb} +21 -3
  18. data/lib/thrift/types/{value.rb → value/value.rb} +1 -1
  19. data/lib/thrift/types/{value_constants.rb → value/value_constants.rb} +2 -2
  20. data/lib/thrift/types/{value_types.rb → value/value_types.rb} +135 -15
  21. data/lib/thrift.rb +5 -0
  22. data/spec/spec_helper.rb +17 -17
  23. metadata +45 -93
  24. data/benchmark/gen-rb/benchmark_constants.rb +0 -11
  25. data/benchmark/gen-rb/benchmark_service.rb +0 -106
  26. data/benchmark/gen-rb/benchmark_types.rb +0 -10
  27. data/spec/gen-rb/base/base_service.rb +0 -106
  28. data/spec/gen-rb/base/base_service_constants.rb +0 -11
  29. data/spec/gen-rb/base/base_service_types.rb +0 -33
  30. data/spec/gen-rb/extended/extended_service.rb +0 -103
  31. data/spec/gen-rb/extended/extended_service_constants.rb +0 -11
  32. data/spec/gen-rb/extended/extended_service_types.rb +0 -12
  33. data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +0 -343
  34. data/spec/gen-rb/flat/referenced_constants.rb +0 -11
  35. data/spec/gen-rb/flat/referenced_types.rb +0 -17
  36. data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +0 -11
  37. data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +0 -35
  38. data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +0 -343
  39. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +0 -11
  40. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +0 -35
  41. data/spec/gen-rb/nonblocking_service.rb +0 -343
  42. data/spec/gen-rb/other_namespace/referenced_constants.rb +0 -11
  43. data/spec/gen-rb/other_namespace/referenced_types.rb +0 -17
  44. data/spec/gen-rb/thrift_spec_constants.rb +0 -11
  45. data/spec/gen-rb/thrift_spec_types.rb +0 -699
  46. data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +0 -274
  47. data/test/debug_proto/gen-rb/debug_proto_test_types.rb +0 -936
  48. data/test/debug_proto/gen-rb/empty_service.rb +0 -39
  49. data/test/debug_proto/gen-rb/inherited.rb +0 -105
  50. data/test/debug_proto/gen-rb/reverse_order_service.rb +0 -107
  51. data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +0 -106
  52. data/test/debug_proto/gen-rb/srv.rb +0 -410
@@ -1,410 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (2.4.0-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'debug_proto_test_types'
9
-
10
- module Srv
11
- SERVICE = 'Srv'.freeze
12
- NAMESPACE = ''.freeze
13
-
14
- class Client
15
- def initialize(client)
16
- @client = ::Thrift.build_client(client)
17
- end
18
-
19
- def self.from_provider(provider)
20
- Client.new(provider.build(NAMESPACE, SERVICE))
21
- end
22
-
23
- def Janky(arg)
24
- result = @client.call_binary(
25
- 'Janky',
26
- Janky_args.new(arg: arg),
27
- Janky_result
28
- )
29
-
30
- return result.success unless result.success.nil?
31
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'Janky failed: unknown result')
32
- result
33
- end
34
-
35
- def voidMethod()
36
- result = @client.call_binary(
37
- 'voidMethod',
38
- VoidMethod_args.new(),
39
- VoidMethod_result
40
- )
41
-
42
- nil
43
- end
44
-
45
- def primitiveMethod()
46
- result = @client.call_binary(
47
- 'primitiveMethod',
48
- PrimitiveMethod_args.new(),
49
- PrimitiveMethod_result
50
- )
51
-
52
- return result.success unless result.success.nil?
53
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'primitiveMethod failed: unknown result')
54
- result
55
- end
56
-
57
- def structMethod()
58
- result = @client.call_binary(
59
- 'structMethod',
60
- StructMethod_args.new(),
61
- StructMethod_result
62
- )
63
-
64
- return result.success unless result.success.nil?
65
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'structMethod failed: unknown result')
66
- result
67
- end
68
-
69
- def methodWithDefaultArgs(something)
70
- result = @client.call_binary(
71
- 'methodWithDefaultArgs',
72
- MethodWithDefaultArgs_args.new(something: something),
73
- MethodWithDefaultArgs_result
74
- )
75
-
76
- nil
77
- end
78
-
79
- def onewayMethod()
80
- @client.call_unary(
81
- 'onewayMethod',
82
- OnewayMethod_args.new()
83
- )
84
- end
85
-
86
- end
87
-
88
- class Processor
89
- include ::Thrift::Processor
90
-
91
- def self.from_provider(handler, provider)
92
- provider.build(NAMESPACE, SERVICE, Processor, handler)
93
- end
94
-
95
- def process_Janky(seqid, iprot, oprot)
96
- args = read_args(iprot, Janky_args)
97
- result = @middleware.handle_binary('Janky', args) do |args|
98
- result = Janky_result.new()
99
- result.success = @handler.Janky(args.arg)
100
- result
101
- end
102
-
103
- write_result(result, oprot, 'Janky', seqid)
104
- end
105
-
106
- def process_voidMethod(seqid, iprot, oprot)
107
- args = read_args(iprot, VoidMethod_args)
108
- result = @middleware.handle_binary('voidMethod', args) do |args|
109
- result = VoidMethod_result.new()
110
- @handler.voidMethod()
111
- result
112
- end
113
-
114
- write_result(result, oprot, 'voidMethod', seqid)
115
- end
116
-
117
- def process_primitiveMethod(seqid, iprot, oprot)
118
- args = read_args(iprot, PrimitiveMethod_args)
119
- result = @middleware.handle_binary('primitiveMethod', args) do |args|
120
- result = PrimitiveMethod_result.new()
121
- result.success = @handler.primitiveMethod()
122
- result
123
- end
124
-
125
- write_result(result, oprot, 'primitiveMethod', seqid)
126
- end
127
-
128
- def process_structMethod(seqid, iprot, oprot)
129
- args = read_args(iprot, StructMethod_args)
130
- result = @middleware.handle_binary('structMethod', args) do |args|
131
- result = StructMethod_result.new()
132
- result.success = @handler.structMethod()
133
- result
134
- end
135
-
136
- write_result(result, oprot, 'structMethod', seqid)
137
- end
138
-
139
- def process_methodWithDefaultArgs(seqid, iprot, oprot)
140
- args = read_args(iprot, MethodWithDefaultArgs_args)
141
- result = @middleware.handle_binary('methodWithDefaultArgs', args) do |args|
142
- result = MethodWithDefaultArgs_result.new()
143
- @handler.methodWithDefaultArgs(args.something)
144
- result
145
- end
146
-
147
- write_result(result, oprot, 'methodWithDefaultArgs', seqid)
148
- end
149
-
150
- def process_onewayMethod(seqid, iprot, oprot)
151
- args = read_args(iprot, OnewayMethod_args)
152
- @middleware.handle_unary('onewayMethod', args) do |args|
153
- @handler.onewayMethod()
154
- nil
155
- end
156
- end
157
-
158
- end
159
-
160
- # HELPER FUNCTIONS AND STRUCTURES
161
-
162
- class Janky_args
163
- include ::Thrift::Struct, ::Thrift::Struct_Union
164
-
165
- NAME = 'Janky_args'.freeze
166
- NAMESPACE = ''.freeze
167
-
168
- THRIFT_FIELD_INDEX_ARG = 1
169
-
170
- FIELDS = {
171
- THRIFT_FIELD_INDEX_ARG => {type: ::Thrift::Types::I32, name: 'arg'}
172
- }
173
-
174
- def struct_fields; FIELDS; end
175
-
176
- def validate
177
- end
178
-
179
- ::Thrift::Struct.generate_accessors self
180
- ::Thrift.register_struct_type self
181
- end
182
-
183
- class Janky_result
184
- include ::Thrift::Struct, ::Thrift::Struct_Union
185
-
186
- NAME = 'Janky_result'.freeze
187
- NAMESPACE = ''.freeze
188
-
189
- THRIFT_FIELD_INDEX_SUCCESS = 0
190
-
191
- FIELDS = {
192
- THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'}
193
- }
194
-
195
- def struct_fields; FIELDS; end
196
-
197
- def validate
198
- end
199
-
200
- ::Thrift::Struct.generate_accessors self
201
- ::Thrift.register_struct_type self
202
- end
203
-
204
- class VoidMethod_args
205
- include ::Thrift::Struct, ::Thrift::Struct_Union
206
-
207
- NAME = 'voidMethod_args'.freeze
208
- NAMESPACE = ''.freeze
209
-
210
-
211
- FIELDS = {
212
-
213
- }
214
-
215
- def struct_fields; FIELDS; end
216
-
217
- def validate
218
- end
219
-
220
- ::Thrift::Struct.generate_accessors self
221
- ::Thrift.register_struct_type self
222
- end
223
-
224
- class VoidMethod_result
225
- include ::Thrift::Struct, ::Thrift::Struct_Union
226
-
227
- NAME = 'voidMethod_result'.freeze
228
- NAMESPACE = ''.freeze
229
-
230
-
231
- FIELDS = {
232
-
233
- }
234
-
235
- def struct_fields; FIELDS; end
236
-
237
- def validate
238
- end
239
-
240
- ::Thrift::Struct.generate_accessors self
241
- ::Thrift.register_struct_type self
242
- end
243
-
244
- class PrimitiveMethod_args
245
- include ::Thrift::Struct, ::Thrift::Struct_Union
246
-
247
- NAME = 'primitiveMethod_args'.freeze
248
- NAMESPACE = ''.freeze
249
-
250
-
251
- FIELDS = {
252
-
253
- }
254
-
255
- def struct_fields; FIELDS; end
256
-
257
- def validate
258
- end
259
-
260
- ::Thrift::Struct.generate_accessors self
261
- ::Thrift.register_struct_type self
262
- end
263
-
264
- class PrimitiveMethod_result
265
- include ::Thrift::Struct, ::Thrift::Struct_Union
266
-
267
- NAME = 'primitiveMethod_result'.freeze
268
- NAMESPACE = ''.freeze
269
-
270
- THRIFT_FIELD_INDEX_SUCCESS = 0
271
-
272
- FIELDS = {
273
- THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'}
274
- }
275
-
276
- def struct_fields; FIELDS; end
277
-
278
- def validate
279
- end
280
-
281
- ::Thrift::Struct.generate_accessors self
282
- ::Thrift.register_struct_type self
283
- end
284
-
285
- class StructMethod_args
286
- include ::Thrift::Struct, ::Thrift::Struct_Union
287
-
288
- NAME = 'structMethod_args'.freeze
289
- NAMESPACE = ''.freeze
290
-
291
-
292
- FIELDS = {
293
-
294
- }
295
-
296
- def struct_fields; FIELDS; end
297
-
298
- def validate
299
- end
300
-
301
- ::Thrift::Struct.generate_accessors self
302
- ::Thrift.register_struct_type self
303
- end
304
-
305
- class StructMethod_result
306
- include ::Thrift::Struct, ::Thrift::Struct_Union
307
-
308
- NAME = 'structMethod_result'.freeze
309
- NAMESPACE = ''.freeze
310
-
311
- THRIFT_FIELD_INDEX_SUCCESS = 0
312
-
313
- FIELDS = {
314
- THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::STRUCT, name: 'success', class: ::CompactProtoTestStruct}
315
- }
316
-
317
- def struct_fields; FIELDS; end
318
-
319
- def validate
320
- end
321
-
322
- ::Thrift::Struct.generate_accessors self
323
- ::Thrift.register_struct_type self
324
- end
325
-
326
- class MethodWithDefaultArgs_args
327
- include ::Thrift::Struct, ::Thrift::Struct_Union
328
-
329
- NAME = 'methodWithDefaultArgs_args'.freeze
330
- NAMESPACE = ''.freeze
331
-
332
- THRIFT_FIELD_INDEX_SOMETHING = 1
333
-
334
- FIELDS = {
335
- THRIFT_FIELD_INDEX_SOMETHING => {type: ::Thrift::Types::I32, name: 'something', default: 2}
336
- }
337
-
338
- def struct_fields; FIELDS; end
339
-
340
- def validate
341
- end
342
-
343
- ::Thrift::Struct.generate_accessors self
344
- ::Thrift.register_struct_type self
345
- end
346
-
347
- class MethodWithDefaultArgs_result
348
- include ::Thrift::Struct, ::Thrift::Struct_Union
349
-
350
- NAME = 'methodWithDefaultArgs_result'.freeze
351
- NAMESPACE = ''.freeze
352
-
353
-
354
- FIELDS = {
355
-
356
- }
357
-
358
- def struct_fields; FIELDS; end
359
-
360
- def validate
361
- end
362
-
363
- ::Thrift::Struct.generate_accessors self
364
- ::Thrift.register_struct_type self
365
- end
366
-
367
- class OnewayMethod_args
368
- include ::Thrift::Struct, ::Thrift::Struct_Union
369
-
370
- NAME = 'onewayMethod_args'.freeze
371
- NAMESPACE = ''.freeze
372
-
373
-
374
- FIELDS = {
375
-
376
- }
377
-
378
- def struct_fields; FIELDS; end
379
-
380
- def validate
381
- end
382
-
383
- ::Thrift::Struct.generate_accessors self
384
- ::Thrift.register_struct_type self
385
- end
386
-
387
- class OnewayMethod_result
388
- include ::Thrift::Struct, ::Thrift::Struct_Union
389
-
390
- NAME = 'onewayMethod_result'.freeze
391
- NAMESPACE = ''.freeze
392
-
393
-
394
- FIELDS = {
395
-
396
- }
397
-
398
- def struct_fields; FIELDS; end
399
-
400
- def validate
401
- end
402
-
403
- ::Thrift::Struct.generate_accessors self
404
- ::Thrift.register_struct_type self
405
- end
406
-
407
- ::Thrift.register_service_type(self)
408
-
409
- end
410
-