upfluence-thrift 2.6.8 → 2.7.4
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.
- checksums.yaml +4 -4
- data/benchmark/{gen-rb/benchmark_constants.rb → benchmark_constants.rb} +1 -1
- data/benchmark/{gen-rb/benchmark_service.rb → benchmark_service.rb} +2 -2
- data/benchmark/{gen-rb/benchmark_types.rb → benchmark_types.rb} +1 -1
- data/ext/struct.c +5 -1
- data/lib/thrift/base_stream.rb +85 -0
- data/lib/thrift/bidi_stream.rb +183 -0
- data/lib/thrift/client.rb +84 -17
- data/lib/thrift/inbound_stream.rb +72 -0
- data/lib/thrift/middleware.rb +42 -0
- data/lib/thrift/outbound_stream.rb +52 -0
- data/lib/thrift/processor.rb +287 -47
- data/lib/thrift/protocol/base_protocol.rb +35 -33
- data/lib/thrift/protocol/binary_protocol.rb +8 -1
- data/lib/thrift/protocol/binary_protocol_accelerated.rb +8 -0
- data/lib/thrift/protocol/compact_protocol.rb +8 -0
- data/lib/thrift/protocol/json_protocol.rb +21 -4
- data/lib/thrift/protocol/multiplexed_protocol.rb +5 -1
- data/lib/thrift/server/base_server.rb +8 -2
- data/lib/thrift/server/nonblocking_server.rb +5 -4
- data/lib/thrift/server/simple_server.rb +5 -1
- data/lib/thrift/server/thread_pool_server.rb +5 -1
- data/lib/thrift/server/threaded_server.rb +5 -1
- data/lib/thrift/transport/base_server_transport.rb +1 -1
- data/lib/thrift/transport/base_transport.rb +8 -0
- data/lib/thrift/transport/buffered_transport.rb +9 -1
- data/lib/thrift/transport/framed_transport.rb +9 -1
- data/lib/thrift/transport/http_client_transport.rb +4 -0
- data/lib/thrift/transport/io_stream_transport.rb +4 -1
- data/lib/thrift/transport/memory_buffer_transport.rb +4 -0
- data/lib/thrift/transport/server_socket.rb +5 -0
- data/lib/thrift/transport/socket.rb +21 -17
- data/lib/thrift/transport/ssl_server_socket.rb +41 -0
- data/lib/thrift/transport/ssl_socket.rb +51 -0
- data/lib/thrift/transport/unix_server_socket.rb +5 -1
- data/lib/thrift/transport/unix_socket.rb +5 -1
- data/lib/thrift/types/annotation/deprecation/deprecation_constants.rb +1 -1
- data/lib/thrift/types/annotation/deprecation/deprecation_types.rb +2 -2
- data/lib/thrift/types/annotation/exception/exception_constants.rb +17 -0
- data/lib/thrift/types/annotation/exception/exception_types.rb +44 -0
- data/lib/thrift/types/annotation/naming/naming_constants.rb +1 -1
- data/lib/thrift/types/annotation/naming/naming_types.rb +2 -2
- data/lib/thrift/types/annotation/rpc/rpc_constants.rb +17 -0
- data/lib/thrift/types/annotation/rpc/rpc_types.rb +74 -0
- data/lib/thrift/types/annotation_definition/annotation_definition_constants.rb +15 -0
- data/lib/thrift/types/annotation_definition/annotation_definition_types.rb +116 -0
- data/lib/thrift/types/constant_definition/constant_definition_constants.rb +15 -0
- data/lib/thrift/types/constant_definition/constant_definition_types.rb +292 -0
- data/lib/thrift/types/core/core_constants.rb +15 -0
- data/lib/thrift/types/core/core_types.rb +58 -0
- data/lib/thrift/types/enum_definition/enum_definition_constants.rb +15 -0
- data/lib/thrift/types/enum_definition/enum_definition_types.rb +106 -0
- data/lib/thrift/types/known/any/any_constants.rb +1 -1
- data/lib/thrift/types/known/any/any_types.rb +2 -2
- data/lib/thrift/types/known/duration/duration_constants.rb +1 -1
- data/lib/thrift/types/known/duration/duration_types.rb +2 -2
- data/lib/thrift/types/known/timestamp/timestamp_constants.rb +1 -1
- data/lib/thrift/types/known/timestamp/timestamp_types.rb +2 -2
- data/lib/thrift/types/plugin/plugin.rb +139 -0
- data/lib/thrift/types/plugin/plugin_constants.rb +15 -0
- data/lib/thrift/types/plugin/plugin_types.rb +106 -0
- data/lib/thrift/types/program_definition/program_definition_constants.rb +15 -0
- data/lib/thrift/types/program_definition/program_definition_types.rb +137 -0
- data/lib/thrift/types/service_definition/service_definition_constants.rb +15 -0
- data/lib/thrift/types/service_definition/service_definition_types.rb +160 -0
- data/lib/thrift/types/struct_definition/struct_definition_constants.rb +15 -0
- data/lib/thrift/types/struct_definition/struct_definition_types.rb +157 -0
- data/lib/thrift/types/type_definition/type_definition_constants.rb +15 -0
- data/lib/thrift/types/type_definition/type_definition_types.rb +242 -0
- data/lib/thrift/types/value/value_constants.rb +1 -1
- data/lib/thrift/types/value/value_types.rb +50 -51
- data/lib/thrift/types.rb +11 -3
- data/lib/thrift/union.rb +3 -6
- data/lib/thrift.rb +6 -0
- data/lib/types/annotation/deprecation/deprecation_constants.rb +16 -0
- data/lib/types/annotation/deprecation/deprecation_types.rb +42 -0
- data/lib/types/annotation/naming/naming_constants.rb +16 -0
- data/lib/types/annotation/naming/naming_types.rb +57 -0
- data/lib/types/annotation_definition/annotation_definition_constants.rb +14 -0
- data/lib/types/annotation_definition/annotation_definition_types.rb +114 -0
- data/lib/types/constant_definition/constant_definition_constants.rb +14 -0
- data/lib/types/constant_definition/constant_definition_types.rb +290 -0
- data/lib/types/core/core_constants.rb +14 -0
- data/lib/types/core/core_types.rb +56 -0
- data/lib/types/enum_definition/enum_definition_constants.rb +14 -0
- data/lib/types/enum_definition/enum_definition_types.rb +104 -0
- data/lib/types/known/any/any_constants.rb +16 -0
- data/lib/types/known/any/any_types.rb +59 -0
- data/lib/types/known/duration/duration_constants.rb +16 -0
- data/lib/types/known/duration/duration_types.rb +59 -0
- data/lib/types/known/timestamp/timestamp_constants.rb +16 -0
- data/lib/types/known/timestamp/timestamp_types.rb +59 -0
- data/lib/types/plugin/plugin.rb +137 -0
- data/lib/types/plugin/plugin_constants.rb +14 -0
- data/lib/types/plugin/plugin_types.rb +104 -0
- data/lib/types/program_definition/program_definition_constants.rb +14 -0
- data/lib/types/program_definition/program_definition_types.rb +135 -0
- data/lib/types/service_definition/service_definition_constants.rb +14 -0
- data/lib/types/service_definition/service_definition_types.rb +158 -0
- data/lib/types/struct_definition/struct_definition_constants.rb +14 -0
- data/lib/types/struct_definition/struct_definition_types.rb +155 -0
- data/lib/types/type_definition/type_definition_constants.rb +14 -0
- data/lib/types/type_definition/type_definition_types.rb +240 -0
- data/lib/types/value/value_constants.rb +14 -0
- data/lib/types/value/value_types.rb +330 -0
- data/spec/{gen-rb/base → base}/base_service.rb +2 -2
- data/spec/{gen-rb/base → base}/base_service_constants.rb +1 -1
- data/spec/{gen-rb/base → base}/base_service_types.rb +1 -1
- data/spec/base_protocol_spec.rb +79 -71
- data/spec/base_transport_spec.rb +155 -117
- data/spec/binary_protocol_accelerated_spec.rb +6 -2
- data/spec/binary_protocol_spec.rb +16 -8
- data/spec/binary_protocol_spec_shared.rb +77 -77
- data/spec/bytes_spec.rb +38 -38
- data/spec/client_spec.rb +48 -50
- data/spec/compact_protocol_spec.rb +59 -46
- data/spec/exception_spec.rb +54 -54
- data/spec/{gen-rb/extended → extended}/extended_service.rb +2 -2
- data/spec/{gen-rb/extended → extended}/extended_service_constants.rb +1 -1
- data/spec/{gen-rb/extended → extended}/extended_service_types.rb +1 -1
- data/spec/flat_spec.rb +5 -5
- data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +4 -4
- data/spec/gen-rb/flat/referenced_constants.rb +1 -1
- data/spec/gen-rb/flat/referenced_types.rb +1 -1
- data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +1 -1
- data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +1 -1
- data/spec/http_client_spec.rb +96 -43
- data/spec/json_protocol_spec.rb +170 -131
- data/spec/namespaced_spec.rb +24 -27
- data/spec/{gen-rb/namespaced_spec_namespace → namespaced_spec_namespace}/namespaced_nonblocking_service.rb +4 -4
- data/spec/{gen-rb/namespaced_spec_namespace → namespaced_spec_namespace}/thrift_namespaced_spec_constants.rb +1 -1
- data/spec/{gen-rb/namespaced_spec_namespace → namespaced_spec_namespace}/thrift_namespaced_spec_types.rb +1 -1
- data/spec/nonblocking_server_spec.rb +16 -16
- data/spec/{gen-rb/nonblocking_service.rb → nonblocking_service.rb} +4 -4
- data/spec/{gen-rb/other_namespace → other_namespace}/referenced_constants.rb +1 -1
- data/spec/{gen-rb/other_namespace → other_namespace}/referenced_types.rb +1 -1
- data/spec/processor_spec.rb +42 -31
- data/spec/rack_application_spec.rb +22 -26
- data/spec/serializer_spec.rb +20 -20
- data/spec/server_socket_spec.rb +27 -22
- data/spec/server_spec.rb +91 -51
- data/spec/socket_spec.rb +23 -16
- data/spec/socket_spec_shared.rb +31 -31
- data/spec/spec_helper.rb +1 -1
- data/spec/ssl_server_socket_spec.rb +34 -0
- data/spec/ssl_socket_spec.rb +78 -0
- data/spec/streaming_spec.rb +442 -0
- data/spec/struct_nested_containers_spec.rb +24 -24
- data/spec/struct_spec.rb +120 -120
- data/spec/thin_http_server_spec.rb +71 -28
- data/spec/{gen-rb/thrift_spec_constants.rb → thrift_spec_constants.rb} +1 -1
- data/spec/{gen-rb/thrift_spec_types.rb → thrift_spec_types.rb} +16 -16
- data/spec/types/known/any_spec.rb +2 -2
- data/spec/types/known/duration_spec.rb +1 -1
- data/spec/types/known/timestamp_spec.rb +1 -1
- data/spec/types/value_spec.rb +2 -1
- data/spec/types_spec.rb +56 -53
- data/spec/union_spec.rb +51 -40
- data/spec/unix_socket_spec.rb +43 -34
- data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +267 -260
- data/test/debug_proto/gen-rb/debug_proto_test_types.rb +1481 -1416
- data/test/debug_proto/gen-rb/empty_service.rb +31 -27
- data/test/debug_proto/gen-rb/inherited.rb +102 -98
- data/test/debug_proto/gen-rb/reverse_order_service.rb +112 -108
- data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +99 -95
- data/test/debug_proto/gen-rb/srv.rb +525 -406
- metadata +178 -41
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Autogenerated by Thrift Compiler (2.7.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 'thrift/types/annotation_definition/annotation_definition_types'
|
|
9
|
+
require 'thrift/types/type_definition/type_definition_types'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
module Thrift
|
|
13
|
+
module Types
|
|
14
|
+
module Struct_definition
|
|
15
|
+
module Requiredness
|
|
16
|
+
Unknown = 0
|
|
17
|
+
Optional = 1
|
|
18
|
+
Required = 2
|
|
19
|
+
VALUE_MAP = {0 => "Unknown", 1 => "Optional", 2 => "Required"}
|
|
20
|
+
VALID_VALUES = Set.new([Unknown, Optional, Required]).freeze
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
module StructKind
|
|
24
|
+
Unknown = 0
|
|
25
|
+
Struct = 1
|
|
26
|
+
Exception = 2
|
|
27
|
+
Union = 3
|
|
28
|
+
VALUE_MAP = {0 => "Unknown", 1 => "Struct", 2 => "Exception", 3 => "Union"}
|
|
29
|
+
VALID_VALUES = Set.new([Unknown, Struct, Exception, Union]).freeze
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class FieldDefinition; end
|
|
33
|
+
|
|
34
|
+
class StructDefinition; end
|
|
35
|
+
|
|
36
|
+
class FieldDefinition
|
|
37
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
38
|
+
|
|
39
|
+
NAME = 'FieldDefinition'.freeze
|
|
40
|
+
NAMESPACE = 'types.struct_definition'.freeze
|
|
41
|
+
|
|
42
|
+
LEGACY_ANNOTATIONS = {
|
|
43
|
+
}.freeze
|
|
44
|
+
|
|
45
|
+
STRUCTURED_ANNOTATIONS = [
|
|
46
|
+
].freeze
|
|
47
|
+
|
|
48
|
+
THRIFT_FIELD_INDEX_ANNOTATION = 1
|
|
49
|
+
THRIFT_FIELD_INDEX_ID = 2
|
|
50
|
+
THRIFT_FIELD_INDEX_TYPE = 3
|
|
51
|
+
THRIFT_FIELD_INDEX_REQUIREDNESS = 4
|
|
52
|
+
|
|
53
|
+
THRIFT_FIELD_ANNOTATION_LEGACY_ANNOTATIONS = {
|
|
54
|
+
}.freeze
|
|
55
|
+
|
|
56
|
+
THRIFT_FIELD_ANNOTATION_STRUCTURED_ANNOTATIONS = [
|
|
57
|
+
].freeze
|
|
58
|
+
|
|
59
|
+
THRIFT_FIELD_ID_LEGACY_ANNOTATIONS = {
|
|
60
|
+
}.freeze
|
|
61
|
+
|
|
62
|
+
THRIFT_FIELD_ID_STRUCTURED_ANNOTATIONS = [
|
|
63
|
+
].freeze
|
|
64
|
+
|
|
65
|
+
THRIFT_FIELD_TYPE_LEGACY_ANNOTATIONS = {
|
|
66
|
+
}.freeze
|
|
67
|
+
|
|
68
|
+
THRIFT_FIELD_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
69
|
+
].freeze
|
|
70
|
+
|
|
71
|
+
THRIFT_FIELD_REQUIREDNESS_LEGACY_ANNOTATIONS = {
|
|
72
|
+
}.freeze
|
|
73
|
+
|
|
74
|
+
THRIFT_FIELD_REQUIREDNESS_STRUCTURED_ANNOTATIONS = [
|
|
75
|
+
].freeze
|
|
76
|
+
|
|
77
|
+
FIELDS = {
|
|
78
|
+
THRIFT_FIELD_INDEX_ANNOTATION => {type: ::Thrift::Types::STRUCT, name: 'annotation', class: ::Thrift::Types::Annotation_definition::AnnotationDefinition, legacy_annotations: THRIFT_FIELD_ANNOTATION_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ANNOTATION_STRUCTURED_ANNOTATIONS},
|
|
79
|
+
THRIFT_FIELD_INDEX_ID => {type: ::Thrift::Types::I32, name: 'id', legacy_annotations: THRIFT_FIELD_ID_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ID_STRUCTURED_ANNOTATIONS},
|
|
80
|
+
THRIFT_FIELD_INDEX_TYPE => {type: ::Thrift::Types::STRUCT, name: 'type', class: ::Thrift::Types::Type_definition::TypeDefinition, legacy_annotations: THRIFT_FIELD_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_TYPE_STRUCTURED_ANNOTATIONS},
|
|
81
|
+
THRIFT_FIELD_INDEX_REQUIREDNESS => {type: ::Thrift::Types::I32, name: 'requiredness', enum_class: ::Thrift::Types::Struct_definition::Requiredness, legacy_annotations: THRIFT_FIELD_REQUIREDNESS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_REQUIREDNESS_STRUCTURED_ANNOTATIONS}
|
|
82
|
+
}.freeze
|
|
83
|
+
|
|
84
|
+
def struct_fields; FIELDS; end
|
|
85
|
+
|
|
86
|
+
def validate
|
|
87
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field annotation is unset!') unless @annotation
|
|
88
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field id is unset!') unless @id
|
|
89
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
|
|
90
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field requiredness is unset!') unless @requiredness
|
|
91
|
+
unless @requiredness.nil? || ::Thrift::Types::Struct_definition::Requiredness::VALID_VALUES.include?(@requiredness)
|
|
92
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field requiredness!')
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
::Thrift::Struct.generate_accessors self
|
|
97
|
+
::Thrift.register_struct_type self
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
class StructDefinition
|
|
101
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
102
|
+
|
|
103
|
+
NAME = 'StructDefinition'.freeze
|
|
104
|
+
NAMESPACE = 'types.struct_definition'.freeze
|
|
105
|
+
|
|
106
|
+
LEGACY_ANNOTATIONS = {
|
|
107
|
+
}.freeze
|
|
108
|
+
|
|
109
|
+
STRUCTURED_ANNOTATIONS = [
|
|
110
|
+
].freeze
|
|
111
|
+
|
|
112
|
+
THRIFT_FIELD_INDEX_ANNOTATION = 1
|
|
113
|
+
THRIFT_FIELD_INDEX_KIND = 2
|
|
114
|
+
THRIFT_FIELD_INDEX_FIELDS = 3
|
|
115
|
+
|
|
116
|
+
THRIFT_FIELD_ANNOTATION_LEGACY_ANNOTATIONS = {
|
|
117
|
+
}.freeze
|
|
118
|
+
|
|
119
|
+
THRIFT_FIELD_ANNOTATION_STRUCTURED_ANNOTATIONS = [
|
|
120
|
+
].freeze
|
|
121
|
+
|
|
122
|
+
THRIFT_FIELD_KIND_LEGACY_ANNOTATIONS = {
|
|
123
|
+
}.freeze
|
|
124
|
+
|
|
125
|
+
THRIFT_FIELD_KIND_STRUCTURED_ANNOTATIONS = [
|
|
126
|
+
].freeze
|
|
127
|
+
|
|
128
|
+
THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS = {
|
|
129
|
+
}.freeze
|
|
130
|
+
|
|
131
|
+
THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS = [
|
|
132
|
+
].freeze
|
|
133
|
+
|
|
134
|
+
FIELDS = {
|
|
135
|
+
THRIFT_FIELD_INDEX_ANNOTATION => {type: ::Thrift::Types::STRUCT, name: 'annotation', class: ::Thrift::Types::Annotation_definition::AnnotationDefinition, legacy_annotations: THRIFT_FIELD_ANNOTATION_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ANNOTATION_STRUCTURED_ANNOTATIONS},
|
|
136
|
+
THRIFT_FIELD_INDEX_KIND => {type: ::Thrift::Types::I32, name: 'kind', enum_class: ::Thrift::Types::Struct_definition::StructKind, legacy_annotations: THRIFT_FIELD_KIND_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_KIND_STRUCTURED_ANNOTATIONS},
|
|
137
|
+
THRIFT_FIELD_INDEX_FIELDS => {type: ::Thrift::Types::LIST, name: 'fields', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Struct_definition::FieldDefinition}, legacy_annotations: THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS}
|
|
138
|
+
}.freeze
|
|
139
|
+
|
|
140
|
+
def struct_fields; FIELDS; end
|
|
141
|
+
|
|
142
|
+
def validate
|
|
143
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field annotation is unset!') unless @annotation
|
|
144
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field kind is unset!') unless @kind
|
|
145
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field fields is unset!') unless @fields
|
|
146
|
+
unless @kind.nil? || ::Thrift::Types::Struct_definition::StructKind::VALID_VALUES.include?(@kind)
|
|
147
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field kind!')
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
::Thrift::Struct.generate_accessors self
|
|
152
|
+
::Thrift.register_struct_type self
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Autogenerated by Thrift Compiler (2.7.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 'thrift/types/type_definition/type_definition_types'
|
|
9
|
+
|
|
10
|
+
module Thrift
|
|
11
|
+
module Types
|
|
12
|
+
module Type_definition
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Autogenerated by Thrift Compiler (2.7.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 'thrift/thrift/types/core/core_types'
|
|
9
|
+
require 'thrift/types/annotation_definition/annotation_definition_types'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
module Thrift
|
|
13
|
+
module Types
|
|
14
|
+
module Type_definition
|
|
15
|
+
module ScalarType
|
|
16
|
+
Unknown = 0
|
|
17
|
+
String = 1
|
|
18
|
+
Binary = 2
|
|
19
|
+
Bool = 3
|
|
20
|
+
I16 = 4
|
|
21
|
+
I32 = 5
|
|
22
|
+
I64 = 6
|
|
23
|
+
Double = 7
|
|
24
|
+
I8 = 8
|
|
25
|
+
Void = 9
|
|
26
|
+
VALUE_MAP = {0 => "Unknown", 1 => "String", 2 => "Binary", 3 => "Bool", 4 => "I16", 5 => "I32", 6 => "I64", 7 => "Double", 8 => "I8", 9 => "Void"}
|
|
27
|
+
VALID_VALUES = Set.new([Unknown, String, Binary, Bool, I16, I32, I64, Double, I8, Void]).freeze
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class ListTypeDefinition; end
|
|
31
|
+
|
|
32
|
+
class MapTypeDefinition; end
|
|
33
|
+
|
|
34
|
+
class SetTypeDefinition; end
|
|
35
|
+
|
|
36
|
+
class TypeDefinition < ::Thrift::Union; end
|
|
37
|
+
|
|
38
|
+
class ListTypeDefinition
|
|
39
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
40
|
+
|
|
41
|
+
NAME = 'ListTypeDefinition'.freeze
|
|
42
|
+
NAMESPACE = 'types.type_definition'.freeze
|
|
43
|
+
|
|
44
|
+
LEGACY_ANNOTATIONS = {
|
|
45
|
+
}.freeze
|
|
46
|
+
|
|
47
|
+
STRUCTURED_ANNOTATIONS = [
|
|
48
|
+
].freeze
|
|
49
|
+
|
|
50
|
+
THRIFT_FIELD_INDEX_ELEMENT_TYPE = 1
|
|
51
|
+
|
|
52
|
+
THRIFT_FIELD_ELEMENT_TYPE_LEGACY_ANNOTATIONS = {
|
|
53
|
+
}.freeze
|
|
54
|
+
|
|
55
|
+
THRIFT_FIELD_ELEMENT_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
56
|
+
].freeze
|
|
57
|
+
|
|
58
|
+
FIELDS = {
|
|
59
|
+
THRIFT_FIELD_INDEX_ELEMENT_TYPE => {type: ::Thrift::Types::STRUCT, name: 'element_type', class: ::Thrift::Types::Type_definition::TypeDefinition, legacy_annotations: THRIFT_FIELD_ELEMENT_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ELEMENT_TYPE_STRUCTURED_ANNOTATIONS}
|
|
60
|
+
}.freeze
|
|
61
|
+
|
|
62
|
+
def struct_fields; FIELDS; end
|
|
63
|
+
|
|
64
|
+
def validate
|
|
65
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field element_type is unset!') unless @element_type
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
::Thrift::Struct.generate_accessors self
|
|
69
|
+
::Thrift.register_struct_type self
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
class MapTypeDefinition
|
|
73
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
74
|
+
|
|
75
|
+
NAME = 'MapTypeDefinition'.freeze
|
|
76
|
+
NAMESPACE = 'types.type_definition'.freeze
|
|
77
|
+
|
|
78
|
+
LEGACY_ANNOTATIONS = {
|
|
79
|
+
}.freeze
|
|
80
|
+
|
|
81
|
+
STRUCTURED_ANNOTATIONS = [
|
|
82
|
+
].freeze
|
|
83
|
+
|
|
84
|
+
THRIFT_FIELD_INDEX_KEY_TYPE = 1
|
|
85
|
+
THRIFT_FIELD_INDEX_VALUE_TYPE = 2
|
|
86
|
+
|
|
87
|
+
THRIFT_FIELD_KEY_TYPE_LEGACY_ANNOTATIONS = {
|
|
88
|
+
}.freeze
|
|
89
|
+
|
|
90
|
+
THRIFT_FIELD_KEY_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
91
|
+
].freeze
|
|
92
|
+
|
|
93
|
+
THRIFT_FIELD_VALUE_TYPE_LEGACY_ANNOTATIONS = {
|
|
94
|
+
}.freeze
|
|
95
|
+
|
|
96
|
+
THRIFT_FIELD_VALUE_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
97
|
+
].freeze
|
|
98
|
+
|
|
99
|
+
FIELDS = {
|
|
100
|
+
THRIFT_FIELD_INDEX_KEY_TYPE => {type: ::Thrift::Types::STRUCT, name: 'key_type', class: ::Thrift::Types::Type_definition::TypeDefinition, legacy_annotations: THRIFT_FIELD_KEY_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_KEY_TYPE_STRUCTURED_ANNOTATIONS},
|
|
101
|
+
THRIFT_FIELD_INDEX_VALUE_TYPE => {type: ::Thrift::Types::STRUCT, name: 'value_type', class: ::Thrift::Types::Type_definition::TypeDefinition, legacy_annotations: THRIFT_FIELD_VALUE_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUE_TYPE_STRUCTURED_ANNOTATIONS}
|
|
102
|
+
}.freeze
|
|
103
|
+
|
|
104
|
+
def struct_fields; FIELDS; end
|
|
105
|
+
|
|
106
|
+
def validate
|
|
107
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key_type is unset!') unless @key_type
|
|
108
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value_type is unset!') unless @value_type
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
::Thrift::Struct.generate_accessors self
|
|
112
|
+
::Thrift.register_struct_type self
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
class SetTypeDefinition
|
|
116
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
117
|
+
|
|
118
|
+
NAME = 'SetTypeDefinition'.freeze
|
|
119
|
+
NAMESPACE = 'types.type_definition'.freeze
|
|
120
|
+
|
|
121
|
+
LEGACY_ANNOTATIONS = {
|
|
122
|
+
}.freeze
|
|
123
|
+
|
|
124
|
+
STRUCTURED_ANNOTATIONS = [
|
|
125
|
+
].freeze
|
|
126
|
+
|
|
127
|
+
THRIFT_FIELD_INDEX_ELEMENT_TYPE = 1
|
|
128
|
+
|
|
129
|
+
THRIFT_FIELD_ELEMENT_TYPE_LEGACY_ANNOTATIONS = {
|
|
130
|
+
}.freeze
|
|
131
|
+
|
|
132
|
+
THRIFT_FIELD_ELEMENT_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
133
|
+
].freeze
|
|
134
|
+
|
|
135
|
+
FIELDS = {
|
|
136
|
+
THRIFT_FIELD_INDEX_ELEMENT_TYPE => {type: ::Thrift::Types::STRUCT, name: 'element_type', class: ::Thrift::Types::Type_definition::TypeDefinition, legacy_annotations: THRIFT_FIELD_ELEMENT_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ELEMENT_TYPE_STRUCTURED_ANNOTATIONS}
|
|
137
|
+
}.freeze
|
|
138
|
+
|
|
139
|
+
def struct_fields; FIELDS; end
|
|
140
|
+
|
|
141
|
+
def validate
|
|
142
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field element_type is unset!') unless @element_type
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
::Thrift::Struct.generate_accessors self
|
|
146
|
+
::Thrift.register_struct_type self
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
class TypeDefinition < ::Thrift::Union
|
|
150
|
+
include ::Thrift::Struct_Union
|
|
151
|
+
|
|
152
|
+
NAME = 'TypeDefinition'.freeze
|
|
153
|
+
NAMESPACE = 'types.type_definition'.freeze
|
|
154
|
+
|
|
155
|
+
LEGACY_ANNOTATIONS = {
|
|
156
|
+
}.freeze
|
|
157
|
+
|
|
158
|
+
STRUCTURED_ANNOTATIONS = [
|
|
159
|
+
].freeze
|
|
160
|
+
|
|
161
|
+
class << self
|
|
162
|
+
def scalar_type(val)
|
|
163
|
+
TypeDefinition.new(:scalar_type, val)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def list_type(val)
|
|
167
|
+
TypeDefinition.new(:list_type, val)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def map_type(val)
|
|
171
|
+
TypeDefinition.new(:map_type, val)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def set_type(val)
|
|
175
|
+
TypeDefinition.new(:set_type, val)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def reference_type(val)
|
|
179
|
+
TypeDefinition.new(:reference_type, val)
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
THRIFT_FIELD_INDEX_SCALAR_TYPE = 1
|
|
184
|
+
THRIFT_FIELD_INDEX_LIST_TYPE = 2
|
|
185
|
+
THRIFT_FIELD_INDEX_MAP_TYPE = 3
|
|
186
|
+
THRIFT_FIELD_INDEX_SET_TYPE = 4
|
|
187
|
+
THRIFT_FIELD_INDEX_REFERENCE_TYPE = 8
|
|
188
|
+
|
|
189
|
+
THRIFT_FIELD_SCALAR_TYPE_LEGACY_ANNOTATIONS = {
|
|
190
|
+
}.freeze
|
|
191
|
+
|
|
192
|
+
THRIFT_FIELD_SCALAR_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
193
|
+
].freeze
|
|
194
|
+
|
|
195
|
+
THRIFT_FIELD_LIST_TYPE_LEGACY_ANNOTATIONS = {
|
|
196
|
+
}.freeze
|
|
197
|
+
|
|
198
|
+
THRIFT_FIELD_LIST_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
199
|
+
].freeze
|
|
200
|
+
|
|
201
|
+
THRIFT_FIELD_MAP_TYPE_LEGACY_ANNOTATIONS = {
|
|
202
|
+
}.freeze
|
|
203
|
+
|
|
204
|
+
THRIFT_FIELD_MAP_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
205
|
+
].freeze
|
|
206
|
+
|
|
207
|
+
THRIFT_FIELD_SET_TYPE_LEGACY_ANNOTATIONS = {
|
|
208
|
+
}.freeze
|
|
209
|
+
|
|
210
|
+
THRIFT_FIELD_SET_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
211
|
+
].freeze
|
|
212
|
+
|
|
213
|
+
THRIFT_FIELD_REFERENCE_TYPE_LEGACY_ANNOTATIONS = {
|
|
214
|
+
}.freeze
|
|
215
|
+
|
|
216
|
+
THRIFT_FIELD_REFERENCE_TYPE_STRUCTURED_ANNOTATIONS = [
|
|
217
|
+
].freeze
|
|
218
|
+
|
|
219
|
+
FIELDS = {
|
|
220
|
+
THRIFT_FIELD_INDEX_SCALAR_TYPE => {type: ::Thrift::Types::I32, name: 'scalar_type', optional: true, enum_class: ::Thrift::Types::Type_definition::ScalarType, legacy_annotations: THRIFT_FIELD_SCALAR_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SCALAR_TYPE_STRUCTURED_ANNOTATIONS},
|
|
221
|
+
THRIFT_FIELD_INDEX_LIST_TYPE => {type: ::Thrift::Types::STRUCT, name: 'list_type', class: ::Thrift::Types::Type_definition::ListTypeDefinition, optional: true, legacy_annotations: THRIFT_FIELD_LIST_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_LIST_TYPE_STRUCTURED_ANNOTATIONS},
|
|
222
|
+
THRIFT_FIELD_INDEX_MAP_TYPE => {type: ::Thrift::Types::STRUCT, name: 'map_type', class: ::Thrift::Types::Type_definition::MapTypeDefinition, optional: true, legacy_annotations: THRIFT_FIELD_MAP_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_MAP_TYPE_STRUCTURED_ANNOTATIONS},
|
|
223
|
+
THRIFT_FIELD_INDEX_SET_TYPE => {type: ::Thrift::Types::STRUCT, name: 'set_type', class: ::Thrift::Types::Type_definition::SetTypeDefinition, optional: true, legacy_annotations: THRIFT_FIELD_SET_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SET_TYPE_STRUCTURED_ANNOTATIONS},
|
|
224
|
+
THRIFT_FIELD_INDEX_REFERENCE_TYPE => {type: ::Thrift::Types::STRUCT, name: 'reference_type', class: ::Thrift::Thrift::Types::Core::Reference, optional: true, legacy_annotations: THRIFT_FIELD_REFERENCE_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_REFERENCE_TYPE_STRUCTURED_ANNOTATIONS}
|
|
225
|
+
}.freeze
|
|
226
|
+
|
|
227
|
+
def struct_fields; FIELDS; end
|
|
228
|
+
|
|
229
|
+
def validate
|
|
230
|
+
raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?
|
|
231
|
+
if get_set_field == :scalar_type
|
|
232
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field scalar_type!') unless ::Thrift::Types::Type_definition::ScalarType::VALID_VALUES.include?(get_value)
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
::Thrift::Union.generate_accessors self
|
|
237
|
+
::Thrift.register_struct_type self
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
|
2
|
+
# Autogenerated by Thrift Compiler (2.7.0-upfluence)
|
|
3
3
|
#
|
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
5
|
#
|
|
@@ -17,10 +17,10 @@ module Thrift
|
|
|
17
17
|
|
|
18
18
|
class MapValue; end
|
|
19
19
|
|
|
20
|
-
class StructValue; end
|
|
21
|
-
|
|
22
20
|
class Value < ::Thrift::Union; end
|
|
23
21
|
|
|
22
|
+
class StructValue; end
|
|
23
|
+
|
|
24
24
|
class NullValue
|
|
25
25
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
26
26
|
|
|
@@ -36,7 +36,7 @@ module Thrift
|
|
|
36
36
|
|
|
37
37
|
FIELDS = {
|
|
38
38
|
|
|
39
|
-
}
|
|
39
|
+
}.freeze
|
|
40
40
|
|
|
41
41
|
def struct_fields; FIELDS; end
|
|
42
42
|
|
|
@@ -69,7 +69,7 @@ module Thrift
|
|
|
69
69
|
|
|
70
70
|
FIELDS = {
|
|
71
71
|
THRIFT_FIELD_INDEX_VALUES => {type: ::Thrift::Types::LIST, name: 'values', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}, legacy_annotations: THRIFT_FIELD_VALUES_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUES_STRUCTURED_ANNOTATIONS}
|
|
72
|
-
}
|
|
72
|
+
}.freeze
|
|
73
73
|
|
|
74
74
|
def struct_fields; FIELDS; end
|
|
75
75
|
|
|
@@ -111,7 +111,7 @@ module Thrift
|
|
|
111
111
|
FIELDS = {
|
|
112
112
|
THRIFT_FIELD_INDEX_KEY => {type: ::Thrift::Types::STRUCT, name: 'key', class: ::Thrift::Types::Value::Value, legacy_annotations: THRIFT_FIELD_KEY_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_KEY_STRUCTURED_ANNOTATIONS},
|
|
113
113
|
THRIFT_FIELD_INDEX_VALUE => {type: ::Thrift::Types::STRUCT, name: 'value', class: ::Thrift::Types::Value::Value, legacy_annotations: THRIFT_FIELD_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUE_STRUCTURED_ANNOTATIONS}
|
|
114
|
-
}
|
|
114
|
+
}.freeze
|
|
115
115
|
|
|
116
116
|
def struct_fields; FIELDS; end
|
|
117
117
|
|
|
@@ -146,46 +146,12 @@ module Thrift
|
|
|
146
146
|
|
|
147
147
|
FIELDS = {
|
|
148
148
|
THRIFT_FIELD_INDEX_ENTRIES => {type: ::Thrift::Types::LIST, name: 'entries', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::MapEntry}, legacy_annotations: THRIFT_FIELD_ENTRIES_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ENTRIES_STRUCTURED_ANNOTATIONS}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
def struct_fields; FIELDS; end
|
|
152
|
-
|
|
153
|
-
def validate
|
|
154
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field entries is unset!') unless @entries
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
::Thrift::Struct.generate_accessors self
|
|
158
|
-
::Thrift.register_struct_type self
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
class StructValue
|
|
162
|
-
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
163
|
-
|
|
164
|
-
NAME = 'StructValue'.freeze
|
|
165
|
-
NAMESPACE = 'types.value'.freeze
|
|
166
|
-
|
|
167
|
-
LEGACY_ANNOTATIONS = {
|
|
168
|
-
}.freeze
|
|
169
|
-
|
|
170
|
-
STRUCTURED_ANNOTATIONS = [
|
|
171
|
-
].freeze
|
|
172
|
-
|
|
173
|
-
THRIFT_FIELD_INDEX_FIELDS = 1
|
|
174
|
-
|
|
175
|
-
THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS = {
|
|
176
149
|
}.freeze
|
|
177
150
|
|
|
178
|
-
THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS = [
|
|
179
|
-
].freeze
|
|
180
|
-
|
|
181
|
-
FIELDS = {
|
|
182
|
-
THRIFT_FIELD_INDEX_FIELDS => {type: ::Thrift::Types::MAP, name: 'fields', key: {type: ::Thrift::Types::STRING}, value: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}, legacy_annotations: THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
151
|
def struct_fields; FIELDS; end
|
|
186
152
|
|
|
187
153
|
def validate
|
|
188
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field
|
|
154
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field entries is unset!') unless @entries
|
|
189
155
|
end
|
|
190
156
|
|
|
191
157
|
::Thrift::Struct.generate_accessors self
|
|
@@ -307,16 +273,16 @@ module Thrift
|
|
|
307
273
|
].freeze
|
|
308
274
|
|
|
309
275
|
FIELDS = {
|
|
310
|
-
THRIFT_FIELD_INDEX_NULL_VALUE => {type: ::Thrift::Types::STRUCT, name: 'null_value', class: ::Thrift::Types::Value::NullValue, legacy_annotations: THRIFT_FIELD_NULL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NULL_VALUE_STRUCTURED_ANNOTATIONS},
|
|
311
|
-
THRIFT_FIELD_INDEX_STRING_VALUE => {type: ::Thrift::Types::STRING, name: 'string_value', legacy_annotations: THRIFT_FIELD_STRING_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRING_VALUE_STRUCTURED_ANNOTATIONS},
|
|
312
|
-
THRIFT_FIELD_INDEX_BINARY_VALUE => {type: ::Thrift::Types::STRING, name: 'binary_value', binary: true, legacy_annotations: THRIFT_FIELD_BINARY_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BINARY_VALUE_STRUCTURED_ANNOTATIONS},
|
|
313
|
-
THRIFT_FIELD_INDEX_INTEGER_VALUE => {type: ::Thrift::Types::I64, name: 'integer_value', legacy_annotations: THRIFT_FIELD_INTEGER_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_INTEGER_VALUE_STRUCTURED_ANNOTATIONS},
|
|
314
|
-
THRIFT_FIELD_INDEX_DOUBLE_VALUE => {type: ::Thrift::Types::DOUBLE, name: 'double_value', legacy_annotations: THRIFT_FIELD_DOUBLE_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_DOUBLE_VALUE_STRUCTURED_ANNOTATIONS},
|
|
315
|
-
THRIFT_FIELD_INDEX_BOOL_VALUE => {type: ::Thrift::Types::BOOL, name: 'bool_value', legacy_annotations: THRIFT_FIELD_BOOL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BOOL_VALUE_STRUCTURED_ANNOTATIONS},
|
|
316
|
-
THRIFT_FIELD_INDEX_LIST_VALUE => {type: ::Thrift::Types::STRUCT, name: 'list_value', class: ::Thrift::Types::Value::ListValue, legacy_annotations: THRIFT_FIELD_LIST_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_LIST_VALUE_STRUCTURED_ANNOTATIONS},
|
|
317
|
-
THRIFT_FIELD_INDEX_MAP_VALUE => {type: ::Thrift::Types::STRUCT, name: 'map_value', class: ::Thrift::Types::Value::MapValue, legacy_annotations: THRIFT_FIELD_MAP_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_MAP_VALUE_STRUCTURED_ANNOTATIONS},
|
|
318
|
-
THRIFT_FIELD_INDEX_STRUCT_VALUE => {type: ::Thrift::Types::STRUCT, name: 'struct_value', class: ::Thrift::Types::Value::StructValue, legacy_annotations: THRIFT_FIELD_STRUCT_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRUCT_VALUE_STRUCTURED_ANNOTATIONS}
|
|
319
|
-
}
|
|
276
|
+
THRIFT_FIELD_INDEX_NULL_VALUE => {type: ::Thrift::Types::STRUCT, name: 'null_value', class: ::Thrift::Types::Value::NullValue, optional: true, legacy_annotations: THRIFT_FIELD_NULL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NULL_VALUE_STRUCTURED_ANNOTATIONS},
|
|
277
|
+
THRIFT_FIELD_INDEX_STRING_VALUE => {type: ::Thrift::Types::STRING, name: 'string_value', optional: true, legacy_annotations: THRIFT_FIELD_STRING_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRING_VALUE_STRUCTURED_ANNOTATIONS},
|
|
278
|
+
THRIFT_FIELD_INDEX_BINARY_VALUE => {type: ::Thrift::Types::STRING, name: 'binary_value', binary: true, optional: true, legacy_annotations: THRIFT_FIELD_BINARY_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BINARY_VALUE_STRUCTURED_ANNOTATIONS},
|
|
279
|
+
THRIFT_FIELD_INDEX_INTEGER_VALUE => {type: ::Thrift::Types::I64, name: 'integer_value', optional: true, legacy_annotations: THRIFT_FIELD_INTEGER_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_INTEGER_VALUE_STRUCTURED_ANNOTATIONS},
|
|
280
|
+
THRIFT_FIELD_INDEX_DOUBLE_VALUE => {type: ::Thrift::Types::DOUBLE, name: 'double_value', optional: true, legacy_annotations: THRIFT_FIELD_DOUBLE_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_DOUBLE_VALUE_STRUCTURED_ANNOTATIONS},
|
|
281
|
+
THRIFT_FIELD_INDEX_BOOL_VALUE => {type: ::Thrift::Types::BOOL, name: 'bool_value', optional: true, legacy_annotations: THRIFT_FIELD_BOOL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BOOL_VALUE_STRUCTURED_ANNOTATIONS},
|
|
282
|
+
THRIFT_FIELD_INDEX_LIST_VALUE => {type: ::Thrift::Types::STRUCT, name: 'list_value', class: ::Thrift::Types::Value::ListValue, optional: true, legacy_annotations: THRIFT_FIELD_LIST_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_LIST_VALUE_STRUCTURED_ANNOTATIONS},
|
|
283
|
+
THRIFT_FIELD_INDEX_MAP_VALUE => {type: ::Thrift::Types::STRUCT, name: 'map_value', class: ::Thrift::Types::Value::MapValue, optional: true, legacy_annotations: THRIFT_FIELD_MAP_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_MAP_VALUE_STRUCTURED_ANNOTATIONS},
|
|
284
|
+
THRIFT_FIELD_INDEX_STRUCT_VALUE => {type: ::Thrift::Types::STRUCT, name: 'struct_value', class: ::Thrift::Types::Value::StructValue, optional: true, legacy_annotations: THRIFT_FIELD_STRUCT_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRUCT_VALUE_STRUCTURED_ANNOTATIONS}
|
|
285
|
+
}.freeze
|
|
320
286
|
|
|
321
287
|
def struct_fields; FIELDS; end
|
|
322
288
|
|
|
@@ -328,6 +294,39 @@ module Thrift
|
|
|
328
294
|
::Thrift.register_struct_type self
|
|
329
295
|
end
|
|
330
296
|
|
|
297
|
+
class StructValue
|
|
298
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
|
299
|
+
|
|
300
|
+
NAME = 'StructValue'.freeze
|
|
301
|
+
NAMESPACE = 'types.value'.freeze
|
|
302
|
+
|
|
303
|
+
LEGACY_ANNOTATIONS = {
|
|
304
|
+
}.freeze
|
|
305
|
+
|
|
306
|
+
STRUCTURED_ANNOTATIONS = [
|
|
307
|
+
].freeze
|
|
308
|
+
|
|
309
|
+
THRIFT_FIELD_INDEX_FIELDS = 1
|
|
310
|
+
|
|
311
|
+
THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS = {
|
|
312
|
+
}.freeze
|
|
313
|
+
|
|
314
|
+
THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS = [
|
|
315
|
+
].freeze
|
|
316
|
+
|
|
317
|
+
FIELDS = {
|
|
318
|
+
THRIFT_FIELD_INDEX_FIELDS => {type: ::Thrift::Types::MAP, name: 'fields', key: {type: ::Thrift::Types::STRING}, value: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}, optional: true, legacy_annotations: THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS}
|
|
319
|
+
}.freeze
|
|
320
|
+
|
|
321
|
+
def struct_fields; FIELDS; end
|
|
322
|
+
|
|
323
|
+
def validate
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
::Thrift::Struct.generate_accessors self
|
|
327
|
+
::Thrift.register_struct_type self
|
|
328
|
+
end
|
|
329
|
+
|
|
331
330
|
end
|
|
332
331
|
end
|
|
333
332
|
end
|
data/lib/thrift/types.rb
CHANGED
|
@@ -91,10 +91,18 @@ module Thrift
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
module MessageTypes
|
|
94
|
-
CALL
|
|
95
|
-
REPLY
|
|
94
|
+
CALL = 1
|
|
95
|
+
REPLY = 2
|
|
96
96
|
EXCEPTION = 3
|
|
97
|
-
ONEWAY
|
|
97
|
+
ONEWAY = 4
|
|
98
|
+
|
|
99
|
+
CLIENT_STREAM_MESSAGE = 5
|
|
100
|
+
CLIENT_STREAM_GOAWAY = 6
|
|
101
|
+
CLIENT_STREAM_GOAWAY_ACK = 7
|
|
102
|
+
|
|
103
|
+
SERVER_STREAM_MESSAGE = 8
|
|
104
|
+
SERVER_STREAM_GOAWAY = 9
|
|
105
|
+
SERVER_STREAM_GOAWAY_ACK = 10
|
|
98
106
|
end
|
|
99
107
|
end
|
|
100
108
|
|
data/lib/thrift/union.rb
CHANGED
|
@@ -87,12 +87,9 @@ module Thrift
|
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def ==(other)
|
|
90
|
-
other
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def eql?(other)
|
|
94
|
-
self.class == other.class && self == other
|
|
90
|
+
other.equal?(self) || other.instance_of?(self.class) && @setfield == other.get_set_field && @value == other.get_value
|
|
95
91
|
end
|
|
92
|
+
alias_method :eql?, :==
|
|
96
93
|
|
|
97
94
|
def hash
|
|
98
95
|
[self.class.name, @setfield, @value].hash
|
|
@@ -176,4 +173,4 @@ module Thrift
|
|
|
176
173
|
end
|
|
177
174
|
end
|
|
178
175
|
end
|
|
179
|
-
end
|
|
176
|
+
end
|
data/lib/thrift.rb
CHANGED
|
@@ -30,6 +30,10 @@ require 'thrift/types'
|
|
|
30
30
|
require 'thrift/processor'
|
|
31
31
|
require 'thrift/multiplexed_processor'
|
|
32
32
|
require 'thrift/middleware'
|
|
33
|
+
require 'thrift/base_stream'
|
|
34
|
+
require 'thrift/outbound_stream'
|
|
35
|
+
require 'thrift/inbound_stream'
|
|
36
|
+
require 'thrift/bidi_stream'
|
|
33
37
|
require 'thrift/client'
|
|
34
38
|
require 'thrift/struct'
|
|
35
39
|
require 'thrift/union'
|
|
@@ -51,7 +55,9 @@ require 'thrift/protocol/multiplexed_protocol'
|
|
|
51
55
|
require 'thrift/transport/base_transport'
|
|
52
56
|
require 'thrift/transport/base_server_transport'
|
|
53
57
|
require 'thrift/transport/socket'
|
|
58
|
+
require 'thrift/transport/ssl_socket'
|
|
54
59
|
require 'thrift/transport/server_socket'
|
|
60
|
+
require 'thrift/transport/ssl_server_socket'
|
|
55
61
|
require 'thrift/transport/unix_socket'
|
|
56
62
|
require 'thrift/transport/unix_server_socket'
|
|
57
63
|
require 'thrift/transport/buffered_transport'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Autogenerated by Thrift Compiler (2.7.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 'types/annotation/deprecation/deprecation_types'
|
|
9
|
+
|
|
10
|
+
module Types
|
|
11
|
+
module Annotation
|
|
12
|
+
module Deprecation
|
|
13
|
+
::Thrift.register_program_definition('CwABAAAAC2RlcHJlY2F0aW9uCwACAAAAVi9Vc2Vycy9hbGV4aXMvY29kZS9zcmMvZ2l0aHViLmNvbS91cGZsdWVuY2UvdGhyaWZ0L3R5cGVzL2Fubm90YXRpb24vZGVwcmVjYXRpb24udGhyaWZ0DQAECwsAAAABAAAAASoAAAAcdHlwZXMuYW5ub3RhdGlvbi5kZXByZWNhdGlvbg8ABQwAAAAADQAGCwwAAAABAAAACkRlcHJlY2F0ZWQMAAELAAEAAAAKRGVwcmVjYXRlZA8AAgwAAAAADQADCwsAAAAAAAgAAgAAAAEPAAMMAAAAAAANAAcLDAAAAAANAAgLDAAAAAANAAkLDAAAAAANAAoLDAAAAAAA')
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|