upfluence-thrift 2.4.4 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,39 +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 EmptyService
11
- SERVICE = 'EmptyService'.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
- end
24
-
25
- class Processor
26
- include ::Thrift::Processor
27
-
28
- def self.from_provider(handler, provider)
29
- provider.build(NAMESPACE, SERVICE, Processor, handler)
30
- end
31
-
32
- end
33
-
34
- # HELPER FUNCTIONS AND STRUCTURES
35
-
36
- ::Thrift.register_service_type(self)
37
-
38
- end
39
-
@@ -1,105 +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 'srv'
9
- require 'debug_proto_test_types'
10
-
11
- module Inherited
12
- SERVICE = 'Inherited'.freeze
13
- NAMESPACE = ''.freeze
14
-
15
- class Client < ::Srv::Client
16
- def initialize(client)
17
- @client = ::Thrift.build_client(client)
18
- end
19
-
20
- def self.from_provider(provider)
21
- Client.new(provider.build(NAMESPACE, SERVICE))
22
- end
23
-
24
- def identity(arg)
25
- result = @client.call_binary(
26
- 'identity',
27
- Identity_args.new(arg: arg),
28
- Identity_result
29
- )
30
-
31
- return result.success unless result.success.nil?
32
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result')
33
- result
34
- end
35
-
36
- end
37
-
38
- class Processor < ::Srv::Processor
39
- include ::Thrift::Processor
40
-
41
- def self.from_provider(handler, provider)
42
- provider.build(NAMESPACE, SERVICE, Processor, handler)
43
- end
44
-
45
- def process_identity(seqid, iprot, oprot)
46
- args = read_args(iprot, Identity_args)
47
- result = @middleware.handle_binary('identity', args) do |args|
48
- result = Identity_result.new()
49
- result.success = @handler.identity(args.arg)
50
- result
51
- end
52
-
53
- write_result(result, oprot, 'identity', seqid)
54
- end
55
-
56
- end
57
-
58
- # HELPER FUNCTIONS AND STRUCTURES
59
-
60
- class Identity_args
61
- include ::Thrift::Struct, ::Thrift::Struct_Union
62
-
63
- NAME = 'identity_args'.freeze
64
- NAMESPACE = ''.freeze
65
-
66
- THRIFT_FIELD_INDEX_ARG = 1
67
-
68
- FIELDS = {
69
- THRIFT_FIELD_INDEX_ARG => {type: ::Thrift::Types::I32, name: 'arg'}
70
- }
71
-
72
- def struct_fields; FIELDS; end
73
-
74
- def validate
75
- end
76
-
77
- ::Thrift::Struct.generate_accessors self
78
- ::Thrift.register_struct_type self
79
- end
80
-
81
- class Identity_result
82
- include ::Thrift::Struct, ::Thrift::Struct_Union
83
-
84
- NAME = 'identity_result'.freeze
85
- NAMESPACE = ''.freeze
86
-
87
- THRIFT_FIELD_INDEX_SUCCESS = 0
88
-
89
- FIELDS = {
90
- THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'}
91
- }
92
-
93
- def struct_fields; FIELDS; end
94
-
95
- def validate
96
- end
97
-
98
- ::Thrift::Struct.generate_accessors self
99
- ::Thrift.register_struct_type self
100
- end
101
-
102
- ::Thrift.register_service_type(self)
103
-
104
- end
105
-
@@ -1,107 +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 ReverseOrderService
11
- SERVICE = 'ReverseOrderService'.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 myMethod(first, second, third, fourth)
24
- result = @client.call_binary(
25
- 'myMethod',
26
- MyMethod_args.new(first: first, second: second, third: third, fourth: fourth),
27
- MyMethod_result
28
- )
29
-
30
- nil
31
- end
32
-
33
- end
34
-
35
- class Processor
36
- include ::Thrift::Processor
37
-
38
- def self.from_provider(handler, provider)
39
- provider.build(NAMESPACE, SERVICE, Processor, handler)
40
- end
41
-
42
- def process_myMethod(seqid, iprot, oprot)
43
- args = read_args(iprot, MyMethod_args)
44
- result = @middleware.handle_binary('myMethod', args) do |args|
45
- result = MyMethod_result.new()
46
- @handler.myMethod(args.first, args.second, args.third, args.fourth)
47
- result
48
- end
49
-
50
- write_result(result, oprot, 'myMethod', seqid)
51
- end
52
-
53
- end
54
-
55
- # HELPER FUNCTIONS AND STRUCTURES
56
-
57
- class MyMethod_args
58
- include ::Thrift::Struct, ::Thrift::Struct_Union
59
-
60
- NAME = 'myMethod_args'.freeze
61
- NAMESPACE = ''.freeze
62
-
63
- THRIFT_FIELD_INDEX_FIRST = 4
64
- THRIFT_FIELD_INDEX_SECOND = 3
65
- THRIFT_FIELD_INDEX_THIRD = 2
66
- THRIFT_FIELD_INDEX_FOURTH = 1
67
-
68
- FIELDS = {
69
- THRIFT_FIELD_INDEX_FIRST => {type: ::Thrift::Types::STRING, name: 'first'},
70
- THRIFT_FIELD_INDEX_SECOND => {type: ::Thrift::Types::I16, name: 'second'},
71
- THRIFT_FIELD_INDEX_THIRD => {type: ::Thrift::Types::I32, name: 'third'},
72
- THRIFT_FIELD_INDEX_FOURTH => {type: ::Thrift::Types::I64, name: 'fourth'}
73
- }
74
-
75
- def struct_fields; FIELDS; end
76
-
77
- def validate
78
- end
79
-
80
- ::Thrift::Struct.generate_accessors self
81
- ::Thrift.register_struct_type self
82
- end
83
-
84
- class MyMethod_result
85
- include ::Thrift::Struct, ::Thrift::Struct_Union
86
-
87
- NAME = 'myMethod_result'.freeze
88
- NAMESPACE = ''.freeze
89
-
90
-
91
- FIELDS = {
92
-
93
- }
94
-
95
- def struct_fields; FIELDS; end
96
-
97
- def validate
98
- end
99
-
100
- ::Thrift::Struct.generate_accessors self
101
- ::Thrift.register_struct_type self
102
- end
103
-
104
- ::Thrift.register_service_type(self)
105
-
106
- end
107
-
@@ -1,106 +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 ServiceForExceptionWithAMap
11
- SERVICE = 'ServiceForExceptionWithAMap'.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 methodThatThrowsAnException()
24
- result = @client.call_binary(
25
- 'methodThatThrowsAnException',
26
- MethodThatThrowsAnException_args.new(),
27
- MethodThatThrowsAnException_result
28
- )
29
-
30
- raise result.xwamap unless result.xwamap.nil?
31
- nil
32
- end
33
-
34
- end
35
-
36
- class Processor
37
- include ::Thrift::Processor
38
-
39
- def self.from_provider(handler, provider)
40
- provider.build(NAMESPACE, SERVICE, Processor, handler)
41
- end
42
-
43
- def process_methodThatThrowsAnException(seqid, iprot, oprot)
44
- args = read_args(iprot, MethodThatThrowsAnException_args)
45
- result = @middleware.handle_binary('methodThatThrowsAnException', args) do |args|
46
- result = MethodThatThrowsAnException_result.new()
47
- begin
48
- @handler.methodThatThrowsAnException()
49
- rescue ::ExceptionWithAMap => xwamap
50
- result.xwamap = xwamap
51
- end
52
- result
53
- end
54
-
55
- write_result(result, oprot, 'methodThatThrowsAnException', seqid)
56
- end
57
-
58
- end
59
-
60
- # HELPER FUNCTIONS AND STRUCTURES
61
-
62
- class MethodThatThrowsAnException_args
63
- include ::Thrift::Struct, ::Thrift::Struct_Union
64
-
65
- NAME = 'methodThatThrowsAnException_args'.freeze
66
- NAMESPACE = ''.freeze
67
-
68
-
69
- FIELDS = {
70
-
71
- }
72
-
73
- def struct_fields; FIELDS; end
74
-
75
- def validate
76
- end
77
-
78
- ::Thrift::Struct.generate_accessors self
79
- ::Thrift.register_struct_type self
80
- end
81
-
82
- class MethodThatThrowsAnException_result
83
- include ::Thrift::Struct, ::Thrift::Struct_Union
84
-
85
- NAME = 'methodThatThrowsAnException_result'.freeze
86
- NAMESPACE = ''.freeze
87
-
88
- THRIFT_FIELD_INDEX_XWAMAP = 1
89
-
90
- FIELDS = {
91
- THRIFT_FIELD_INDEX_XWAMAP => {type: ::Thrift::Types::STRUCT, name: 'xwamap', class: ::ExceptionWithAMap}
92
- }
93
-
94
- def struct_fields; FIELDS; end
95
-
96
- def validate
97
- end
98
-
99
- ::Thrift::Struct.generate_accessors self
100
- ::Thrift.register_struct_type self
101
- end
102
-
103
- ::Thrift.register_service_type(self)
104
-
105
- end
106
-