radar-api 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +38 -3
- data/Guardfile +3 -0
- data/lib/radar/api/analyzer_controller.rb +106 -7
- data/lib/radar/api/index_service.rb +200 -0
- data/lib/radar/api/radar_types.rb +24 -5
- data/lib/radar/api/security_service.rb +316 -0
- data/lib/radar/api/version.rb +1 -1
- data/lib/radar-api.rb +2 -0
- data/radar-api.gemspec +2 -2
- metadata +14 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a13dbb10227349706eb8e24d25d922379d5b76fe
|
4
|
+
data.tar.gz: a7ff4c222cb8633b04fff78ee8d870eb8c8eb5b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a348461d00472abc9c9427d023607967ec56a20bc6fab4b224e1ea41c9adfb0933f121cd2eacdc487a9bd900e6533d98379a4a6a521909c3561a4fefe49fa2b5
|
7
|
+
data.tar.gz: af3443991b67d0efb3d14f6d01a0c81d8d8b8a220d918fd2d5cabbb84a17756f4123d1fadd641b2f5b571f6c63d6b03b93fcdb60d6295de4f1e7df44d92b59ac
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,54 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
radar-api (0.1.
|
5
|
-
thrift
|
4
|
+
radar-api (0.1.1)
|
5
|
+
thrift (= 0.9.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
celluloid (0.15.2)
|
11
|
+
timers (~> 1.1.0)
|
12
|
+
celluloid-io (0.15.0)
|
13
|
+
celluloid (>= 0.15.0)
|
14
|
+
nio4r (>= 0.5.0)
|
15
|
+
coderay (1.1.0)
|
16
|
+
ffi (1.9.3)
|
17
|
+
formatador (0.2.4)
|
18
|
+
guard (2.6.0)
|
19
|
+
formatador (>= 0.2.4)
|
20
|
+
listen (~> 2.7)
|
21
|
+
lumberjack (~> 1.0)
|
22
|
+
pry (>= 0.9.12)
|
23
|
+
thor (>= 0.18.1)
|
24
|
+
guard-rake (0.0.9)
|
25
|
+
guard
|
26
|
+
rake
|
27
|
+
listen (2.7.1)
|
28
|
+
celluloid (>= 0.15.2)
|
29
|
+
celluloid-io (>= 0.15.0)
|
30
|
+
rb-fsevent (>= 0.9.3)
|
31
|
+
rb-inotify (>= 0.9)
|
32
|
+
lumberjack (1.0.5)
|
33
|
+
method_source (0.8.2)
|
34
|
+
nio4r (1.0.0)
|
35
|
+
pry (0.9.12.6)
|
36
|
+
coderay (~> 1.0)
|
37
|
+
method_source (~> 0.8)
|
38
|
+
slop (~> 3.4)
|
10
39
|
rake (10.1.1)
|
40
|
+
rb-fsevent (0.9.4)
|
41
|
+
rb-inotify (0.9.3)
|
42
|
+
ffi (>= 0.5.0)
|
43
|
+
slop (3.5.0)
|
44
|
+
thor (0.19.1)
|
11
45
|
thrift (0.9.1)
|
46
|
+
timers (1.1.0)
|
12
47
|
|
13
48
|
PLATFORMS
|
14
49
|
ruby
|
15
50
|
|
16
51
|
DEPENDENCIES
|
17
52
|
bundler (~> 1.5)
|
53
|
+
guard-rake (= 0.0.9)
|
18
54
|
radar-api!
|
19
|
-
rake
|
data/Guardfile
ADDED
@@ -13,6 +13,21 @@ module Radar
|
|
13
13
|
class Client
|
14
14
|
include ::Thrift::Client
|
15
15
|
|
16
|
+
def analyzers()
|
17
|
+
send_analyzers()
|
18
|
+
return recv_analyzers()
|
19
|
+
end
|
20
|
+
|
21
|
+
def send_analyzers()
|
22
|
+
send_message('analyzers', Analyzers_args)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recv_analyzers()
|
26
|
+
result = receive_message(Analyzers_result)
|
27
|
+
return result.success unless result.success.nil?
|
28
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'analyzers failed: unknown result')
|
29
|
+
end
|
30
|
+
|
16
31
|
def on_each_day(sessionid, portfolio)
|
17
32
|
send_on_each_day(sessionid, portfolio)
|
18
33
|
end
|
@@ -20,6 +35,13 @@ module Radar
|
|
20
35
|
def send_on_each_day(sessionid, portfolio)
|
21
36
|
send_message('on_each_day', On_each_day_args, :sessionid => sessionid, :portfolio => portfolio)
|
22
37
|
end
|
38
|
+
def on_each_month(sessionid, portfolio)
|
39
|
+
send_on_each_month(sessionid, portfolio)
|
40
|
+
end
|
41
|
+
|
42
|
+
def send_on_each_month(sessionid, portfolio)
|
43
|
+
send_message('on_each_month', On_each_month_args, :sessionid => sessionid, :portfolio => portfolio)
|
44
|
+
end
|
23
45
|
def on_finish(session_id, portfolio)
|
24
46
|
send_on_finish(session_id, portfolio)
|
25
47
|
end
|
@@ -91,12 +113,25 @@ module Radar
|
|
91
113
|
class Processor
|
92
114
|
include ::Thrift::Processor
|
93
115
|
|
116
|
+
def process_analyzers(seqid, iprot, oprot)
|
117
|
+
args = read_args(iprot, Analyzers_args)
|
118
|
+
result = Analyzers_result.new()
|
119
|
+
result.success = @handler.analyzers()
|
120
|
+
write_result(result, oprot, 'analyzers', seqid)
|
121
|
+
end
|
122
|
+
|
94
123
|
def process_on_each_day(seqid, iprot, oprot)
|
95
124
|
args = read_args(iprot, On_each_day_args)
|
96
125
|
@handler.on_each_day(args.sessionid, args.portfolio)
|
97
126
|
return
|
98
127
|
end
|
99
128
|
|
129
|
+
def process_on_each_month(seqid, iprot, oprot)
|
130
|
+
args = read_args(iprot, On_each_month_args)
|
131
|
+
@handler.on_each_month(args.sessionid, args.portfolio)
|
132
|
+
return
|
133
|
+
end
|
134
|
+
|
100
135
|
def process_on_finish(seqid, iprot, oprot)
|
101
136
|
args = read_args(iprot, On_finish_args)
|
102
137
|
@handler.on_finish(args.session_id, args.portfolio)
|
@@ -140,13 +175,44 @@ module Radar
|
|
140
175
|
|
141
176
|
# HELPER FUNCTIONS AND STRUCTURES
|
142
177
|
|
178
|
+
class Analyzers_args
|
179
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
180
|
+
|
181
|
+
FIELDS = {
|
182
|
+
|
183
|
+
}
|
184
|
+
|
185
|
+
def struct_fields; FIELDS; end
|
186
|
+
|
187
|
+
def validate
|
188
|
+
end
|
189
|
+
|
190
|
+
::Thrift::Struct.generate_accessors self
|
191
|
+
end
|
192
|
+
|
193
|
+
class Analyzers_result
|
194
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
195
|
+
SUCCESS = 0
|
196
|
+
|
197
|
+
FIELDS = {
|
198
|
+
SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::API::AnalyzerConfig}}
|
199
|
+
}
|
200
|
+
|
201
|
+
def struct_fields; FIELDS; end
|
202
|
+
|
203
|
+
def validate
|
204
|
+
end
|
205
|
+
|
206
|
+
::Thrift::Struct.generate_accessors self
|
207
|
+
end
|
208
|
+
|
143
209
|
class On_each_day_args
|
144
210
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
145
211
|
SESSIONID = 1
|
146
212
|
PORTFOLIO = 2
|
147
213
|
|
148
214
|
FIELDS = {
|
149
|
-
SESSIONID => {:type => ::Thrift::Types::
|
215
|
+
SESSIONID => {:type => ::Thrift::Types::I16, :name => 'sessionid'},
|
150
216
|
PORTFOLIO => {:type => ::Thrift::Types::STRUCT, :name => 'portfolio', :class => ::Radar::API::Portfolio}
|
151
217
|
}
|
152
218
|
|
@@ -173,13 +239,46 @@ module Radar
|
|
173
239
|
::Thrift::Struct.generate_accessors self
|
174
240
|
end
|
175
241
|
|
242
|
+
class On_each_month_args
|
243
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
244
|
+
SESSIONID = 1
|
245
|
+
PORTFOLIO = 2
|
246
|
+
|
247
|
+
FIELDS = {
|
248
|
+
SESSIONID => {:type => ::Thrift::Types::I16, :name => 'sessionid'},
|
249
|
+
PORTFOLIO => {:type => ::Thrift::Types::STRUCT, :name => 'portfolio', :class => ::Radar::API::Portfolio}
|
250
|
+
}
|
251
|
+
|
252
|
+
def struct_fields; FIELDS; end
|
253
|
+
|
254
|
+
def validate
|
255
|
+
end
|
256
|
+
|
257
|
+
::Thrift::Struct.generate_accessors self
|
258
|
+
end
|
259
|
+
|
260
|
+
class On_each_month_result
|
261
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
262
|
+
|
263
|
+
FIELDS = {
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
def struct_fields; FIELDS; end
|
268
|
+
|
269
|
+
def validate
|
270
|
+
end
|
271
|
+
|
272
|
+
::Thrift::Struct.generate_accessors self
|
273
|
+
end
|
274
|
+
|
176
275
|
class On_finish_args
|
177
276
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
178
277
|
SESSION_ID = 1
|
179
278
|
PORTFOLIO = 2
|
180
279
|
|
181
280
|
FIELDS = {
|
182
|
-
SESSION_ID => {:type => ::Thrift::Types::
|
281
|
+
SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'},
|
183
282
|
PORTFOLIO => {:type => ::Thrift::Types::STRUCT, :name => 'portfolio', :class => ::Radar::API::Portfolio}
|
184
283
|
}
|
185
284
|
|
@@ -212,7 +311,7 @@ module Radar
|
|
212
311
|
ANALYZER_ID = 2
|
213
312
|
|
214
313
|
FIELDS = {
|
215
|
-
SESSION_ID => {:type => ::Thrift::Types::
|
314
|
+
SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'},
|
216
315
|
ANALYZER_ID => {:type => ::Thrift::Types::STRING, :name => 'analyzer_id'}
|
217
316
|
}
|
218
317
|
|
@@ -245,7 +344,7 @@ module Radar
|
|
245
344
|
SESSION_ID = 1
|
246
345
|
|
247
346
|
FIELDS = {
|
248
|
-
SESSION_ID => {:type => ::Thrift::Types::
|
347
|
+
SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'}
|
249
348
|
}
|
250
349
|
|
251
350
|
def struct_fields; FIELDS; end
|
@@ -278,7 +377,7 @@ module Radar
|
|
278
377
|
DATA = 2
|
279
378
|
|
280
379
|
FIELDS = {
|
281
|
-
SESSION_ID => {:type => ::Thrift::Types::
|
380
|
+
SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'},
|
282
381
|
DATA => {:type => ::Thrift::Types::STRING, :name => 'data', :binary => true}
|
283
382
|
}
|
284
383
|
|
@@ -310,7 +409,7 @@ module Radar
|
|
310
409
|
SESSION_ID = 1
|
311
410
|
|
312
411
|
FIELDS = {
|
313
|
-
SESSION_ID => {:type => ::Thrift::Types::
|
412
|
+
SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'}
|
314
413
|
}
|
315
414
|
|
316
415
|
def struct_fields; FIELDS; end
|
@@ -342,7 +441,7 @@ module Radar
|
|
342
441
|
SESSION_ID = 1
|
343
442
|
|
344
443
|
FIELDS = {
|
345
|
-
SESSION_ID => {:type => ::Thrift::Types::
|
444
|
+
SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'}
|
346
445
|
}
|
347
446
|
|
348
447
|
def struct_fields; FIELDS; end
|
@@ -0,0 +1,200 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (1.0.0-dev)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'radar_types'
|
9
|
+
|
10
|
+
module Radar
|
11
|
+
module API
|
12
|
+
module IndexService
|
13
|
+
class Client
|
14
|
+
include ::Thrift::Client
|
15
|
+
|
16
|
+
def prices(symbol, start_date, end_date)
|
17
|
+
send_prices(symbol, start_date, end_date)
|
18
|
+
return recv_prices()
|
19
|
+
end
|
20
|
+
|
21
|
+
def send_prices(symbol, start_date, end_date)
|
22
|
+
send_message('prices', Prices_args, :symbol => symbol, :start_date => start_date, :end_date => end_date)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recv_prices()
|
26
|
+
result = receive_message(Prices_result)
|
27
|
+
return result.success unless result.success.nil?
|
28
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'prices failed: unknown result')
|
29
|
+
end
|
30
|
+
|
31
|
+
def price(symbol, date)
|
32
|
+
send_price(symbol, date)
|
33
|
+
return recv_price()
|
34
|
+
end
|
35
|
+
|
36
|
+
def send_price(symbol, date)
|
37
|
+
send_message('price', Price_args, :symbol => symbol, :date => date)
|
38
|
+
end
|
39
|
+
|
40
|
+
def recv_price()
|
41
|
+
result = receive_message(Price_result)
|
42
|
+
return result.success unless result.success.nil?
|
43
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price failed: unknown result')
|
44
|
+
end
|
45
|
+
|
46
|
+
def price_change(symbol, start_date, end_date)
|
47
|
+
send_price_change(symbol, start_date, end_date)
|
48
|
+
return recv_price_change()
|
49
|
+
end
|
50
|
+
|
51
|
+
def send_price_change(symbol, start_date, end_date)
|
52
|
+
send_message('price_change', Price_change_args, :symbol => symbol, :start_date => start_date, :end_date => end_date)
|
53
|
+
end
|
54
|
+
|
55
|
+
def recv_price_change()
|
56
|
+
result = receive_message(Price_change_result)
|
57
|
+
return result.success unless result.success.nil?
|
58
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price_change failed: unknown result')
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
class Processor
|
64
|
+
include ::Thrift::Processor
|
65
|
+
|
66
|
+
def process_prices(seqid, iprot, oprot)
|
67
|
+
args = read_args(iprot, Prices_args)
|
68
|
+
result = Prices_result.new()
|
69
|
+
result.success = @handler.prices(args.symbol, args.start_date, args.end_date)
|
70
|
+
write_result(result, oprot, 'prices', seqid)
|
71
|
+
end
|
72
|
+
|
73
|
+
def process_price(seqid, iprot, oprot)
|
74
|
+
args = read_args(iprot, Price_args)
|
75
|
+
result = Price_result.new()
|
76
|
+
result.success = @handler.price(args.symbol, args.date)
|
77
|
+
write_result(result, oprot, 'price', seqid)
|
78
|
+
end
|
79
|
+
|
80
|
+
def process_price_change(seqid, iprot, oprot)
|
81
|
+
args = read_args(iprot, Price_change_args)
|
82
|
+
result = Price_change_result.new()
|
83
|
+
result.success = @handler.price_change(args.symbol, args.start_date, args.end_date)
|
84
|
+
write_result(result, oprot, 'price_change', seqid)
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
90
|
+
|
91
|
+
class Prices_args
|
92
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
93
|
+
SYMBOL = 1
|
94
|
+
START_DATE = 2
|
95
|
+
END_DATE = 3
|
96
|
+
|
97
|
+
FIELDS = {
|
98
|
+
SYMBOL => {:type => ::Thrift::Types::STRING, :name => 'symbol'},
|
99
|
+
START_DATE => {:type => ::Thrift::Types::I32, :name => 'start_date'},
|
100
|
+
END_DATE => {:type => ::Thrift::Types::I32, :name => 'end_date'}
|
101
|
+
}
|
102
|
+
|
103
|
+
def struct_fields; FIELDS; end
|
104
|
+
|
105
|
+
def validate
|
106
|
+
end
|
107
|
+
|
108
|
+
::Thrift::Struct.generate_accessors self
|
109
|
+
end
|
110
|
+
|
111
|
+
class Prices_result
|
112
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
113
|
+
SUCCESS = 0
|
114
|
+
|
115
|
+
FIELDS = {
|
116
|
+
SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::API::Price}}
|
117
|
+
}
|
118
|
+
|
119
|
+
def struct_fields; FIELDS; end
|
120
|
+
|
121
|
+
def validate
|
122
|
+
end
|
123
|
+
|
124
|
+
::Thrift::Struct.generate_accessors self
|
125
|
+
end
|
126
|
+
|
127
|
+
class Price_args
|
128
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
129
|
+
SYMBOL = 1
|
130
|
+
DATE = 2
|
131
|
+
|
132
|
+
FIELDS = {
|
133
|
+
SYMBOL => {:type => ::Thrift::Types::STRING, :name => 'symbol'},
|
134
|
+
DATE => {:type => ::Thrift::Types::I32, :name => 'date'}
|
135
|
+
}
|
136
|
+
|
137
|
+
def struct_fields; FIELDS; end
|
138
|
+
|
139
|
+
def validate
|
140
|
+
end
|
141
|
+
|
142
|
+
::Thrift::Struct.generate_accessors self
|
143
|
+
end
|
144
|
+
|
145
|
+
class Price_result
|
146
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
147
|
+
SUCCESS = 0
|
148
|
+
|
149
|
+
FIELDS = {
|
150
|
+
SUCCESS => {:type => ::Thrift::Types::DOUBLE, :name => 'success'}
|
151
|
+
}
|
152
|
+
|
153
|
+
def struct_fields; FIELDS; end
|
154
|
+
|
155
|
+
def validate
|
156
|
+
end
|
157
|
+
|
158
|
+
::Thrift::Struct.generate_accessors self
|
159
|
+
end
|
160
|
+
|
161
|
+
class Price_change_args
|
162
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
163
|
+
SYMBOL = 1
|
164
|
+
START_DATE = 2
|
165
|
+
END_DATE = 3
|
166
|
+
|
167
|
+
FIELDS = {
|
168
|
+
SYMBOL => {:type => ::Thrift::Types::STRING, :name => 'symbol'},
|
169
|
+
START_DATE => {:type => ::Thrift::Types::I32, :name => 'start_date'},
|
170
|
+
END_DATE => {:type => ::Thrift::Types::I32, :name => 'end_date'}
|
171
|
+
}
|
172
|
+
|
173
|
+
def struct_fields; FIELDS; end
|
174
|
+
|
175
|
+
def validate
|
176
|
+
end
|
177
|
+
|
178
|
+
::Thrift::Struct.generate_accessors self
|
179
|
+
end
|
180
|
+
|
181
|
+
class Price_change_result
|
182
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
183
|
+
SUCCESS = 0
|
184
|
+
|
185
|
+
FIELDS = {
|
186
|
+
SUCCESS => {:type => ::Thrift::Types::DOUBLE, :name => 'success'}
|
187
|
+
}
|
188
|
+
|
189
|
+
def struct_fields; FIELDS; end
|
190
|
+
|
191
|
+
def validate
|
192
|
+
end
|
193
|
+
|
194
|
+
::Thrift::Struct.generate_accessors self
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
200
|
+
end
|
@@ -497,7 +497,6 @@ module Radar
|
|
497
497
|
def struct_fields; FIELDS; end
|
498
498
|
|
499
499
|
def validate
|
500
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field date is unset!') unless @date
|
501
500
|
end
|
502
501
|
|
503
502
|
::Thrift::Struct.generate_accessors self
|
@@ -505,10 +504,14 @@ module Radar
|
|
505
504
|
|
506
505
|
class AnalyzerConfig
|
507
506
|
include ::Thrift::Struct, ::Thrift::Struct_Union
|
508
|
-
|
509
|
-
|
507
|
+
ID = 1
|
508
|
+
NAME = 2
|
509
|
+
RESULT_TYPE = 3
|
510
|
+
ACCEPTED_EVENTS = 4
|
510
511
|
|
511
512
|
FIELDS = {
|
513
|
+
ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
|
514
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
|
512
515
|
RESULT_TYPE => {:type => ::Thrift::Types::I32, :name => 'result_type', :enum_class => ::Radar::API::ResultType},
|
513
516
|
ACCEPTED_EVENTS => {:type => ::Thrift::Types::SET, :name => 'accepted_events', :element => {:type => ::Thrift::Types::I32, :enum_class => ::Radar::API::Event}}
|
514
517
|
}
|
@@ -516,8 +519,6 @@ module Radar
|
|
516
519
|
def struct_fields; FIELDS; end
|
517
520
|
|
518
521
|
def validate
|
519
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field result_type is unset!') unless @result_type
|
520
|
-
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field accepted_events is unset!') unless @accepted_events
|
521
522
|
unless @result_type.nil? || ::Radar::API::ResultType::VALID_VALUES.include?(@result_type)
|
522
523
|
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field result_type!')
|
523
524
|
end
|
@@ -526,5 +527,23 @@ module Radar
|
|
526
527
|
::Thrift::Struct.generate_accessors self
|
527
528
|
end
|
528
529
|
|
530
|
+
class Price
|
531
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
532
|
+
DATE = 1
|
533
|
+
CLOSE = 2
|
534
|
+
|
535
|
+
FIELDS = {
|
536
|
+
DATE => {:type => ::Thrift::Types::I32, :name => 'date'},
|
537
|
+
CLOSE => {:type => ::Thrift::Types::DOUBLE, :name => 'close'}
|
538
|
+
}
|
539
|
+
|
540
|
+
def struct_fields; FIELDS; end
|
541
|
+
|
542
|
+
def validate
|
543
|
+
end
|
544
|
+
|
545
|
+
::Thrift::Struct.generate_accessors self
|
546
|
+
end
|
547
|
+
|
529
548
|
end
|
530
549
|
end
|
@@ -0,0 +1,316 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (1.0.0-dev)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'radar_types'
|
9
|
+
|
10
|
+
module Radar
|
11
|
+
module API
|
12
|
+
module SecurityService
|
13
|
+
class Client
|
14
|
+
include ::Thrift::Client
|
15
|
+
|
16
|
+
def prices(id, start_date, end_date)
|
17
|
+
send_prices(id, start_date, end_date)
|
18
|
+
return recv_prices()
|
19
|
+
end
|
20
|
+
|
21
|
+
def send_prices(id, start_date, end_date)
|
22
|
+
send_message('prices', Prices_args, :id => id, :start_date => start_date, :end_date => end_date)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recv_prices()
|
26
|
+
result = receive_message(Prices_result)
|
27
|
+
return result.success unless result.success.nil?
|
28
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'prices failed: unknown result')
|
29
|
+
end
|
30
|
+
|
31
|
+
def price(id, date)
|
32
|
+
send_price(id, date)
|
33
|
+
return recv_price()
|
34
|
+
end
|
35
|
+
|
36
|
+
def send_price(id, date)
|
37
|
+
send_message('price', Price_args, :id => id, :date => date)
|
38
|
+
end
|
39
|
+
|
40
|
+
def recv_price()
|
41
|
+
result = receive_message(Price_result)
|
42
|
+
return result.success unless result.success.nil?
|
43
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price failed: unknown result')
|
44
|
+
end
|
45
|
+
|
46
|
+
def price_change(id, start_date, end_date)
|
47
|
+
send_price_change(id, start_date, end_date)
|
48
|
+
return recv_price_change()
|
49
|
+
end
|
50
|
+
|
51
|
+
def send_price_change(id, start_date, end_date)
|
52
|
+
send_message('price_change', Price_change_args, :id => id, :start_date => start_date, :end_date => end_date)
|
53
|
+
end
|
54
|
+
|
55
|
+
def recv_price_change()
|
56
|
+
result = receive_message(Price_change_result)
|
57
|
+
return result.success unless result.success.nil?
|
58
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price_change failed: unknown result')
|
59
|
+
end
|
60
|
+
|
61
|
+
def price_changes(id, start_date, end_date)
|
62
|
+
send_price_changes(id, start_date, end_date)
|
63
|
+
return recv_price_changes()
|
64
|
+
end
|
65
|
+
|
66
|
+
def send_price_changes(id, start_date, end_date)
|
67
|
+
send_message('price_changes', Price_changes_args, :id => id, :start_date => start_date, :end_date => end_date)
|
68
|
+
end
|
69
|
+
|
70
|
+
def recv_price_changes()
|
71
|
+
result = receive_message(Price_changes_result)
|
72
|
+
return result.success unless result.success.nil?
|
73
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price_changes failed: unknown result')
|
74
|
+
end
|
75
|
+
|
76
|
+
def price_volatility(id, start_date, end_date)
|
77
|
+
send_price_volatility(id, start_date, end_date)
|
78
|
+
return recv_price_volatility()
|
79
|
+
end
|
80
|
+
|
81
|
+
def send_price_volatility(id, start_date, end_date)
|
82
|
+
send_message('price_volatility', Price_volatility_args, :id => id, :start_date => start_date, :end_date => end_date)
|
83
|
+
end
|
84
|
+
|
85
|
+
def recv_price_volatility()
|
86
|
+
result = receive_message(Price_volatility_result)
|
87
|
+
return result.success unless result.success.nil?
|
88
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'price_volatility failed: unknown result')
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
class Processor
|
94
|
+
include ::Thrift::Processor
|
95
|
+
|
96
|
+
def process_prices(seqid, iprot, oprot)
|
97
|
+
args = read_args(iprot, Prices_args)
|
98
|
+
result = Prices_result.new()
|
99
|
+
result.success = @handler.prices(args.id, args.start_date, args.end_date)
|
100
|
+
write_result(result, oprot, 'prices', seqid)
|
101
|
+
end
|
102
|
+
|
103
|
+
def process_price(seqid, iprot, oprot)
|
104
|
+
args = read_args(iprot, Price_args)
|
105
|
+
result = Price_result.new()
|
106
|
+
result.success = @handler.price(args.id, args.date)
|
107
|
+
write_result(result, oprot, 'price', seqid)
|
108
|
+
end
|
109
|
+
|
110
|
+
def process_price_change(seqid, iprot, oprot)
|
111
|
+
args = read_args(iprot, Price_change_args)
|
112
|
+
result = Price_change_result.new()
|
113
|
+
result.success = @handler.price_change(args.id, args.start_date, args.end_date)
|
114
|
+
write_result(result, oprot, 'price_change', seqid)
|
115
|
+
end
|
116
|
+
|
117
|
+
def process_price_changes(seqid, iprot, oprot)
|
118
|
+
args = read_args(iprot, Price_changes_args)
|
119
|
+
result = Price_changes_result.new()
|
120
|
+
result.success = @handler.price_changes(args.id, args.start_date, args.end_date)
|
121
|
+
write_result(result, oprot, 'price_changes', seqid)
|
122
|
+
end
|
123
|
+
|
124
|
+
def process_price_volatility(seqid, iprot, oprot)
|
125
|
+
args = read_args(iprot, Price_volatility_args)
|
126
|
+
result = Price_volatility_result.new()
|
127
|
+
result.success = @handler.price_volatility(args.id, args.start_date, args.end_date)
|
128
|
+
write_result(result, oprot, 'price_volatility', seqid)
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
134
|
+
|
135
|
+
class Prices_args
|
136
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
137
|
+
ID = 1
|
138
|
+
START_DATE = 2
|
139
|
+
END_DATE = 3
|
140
|
+
|
141
|
+
FIELDS = {
|
142
|
+
ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::SecurityId},
|
143
|
+
START_DATE => {:type => ::Thrift::Types::I32, :name => 'start_date'},
|
144
|
+
END_DATE => {:type => ::Thrift::Types::I32, :name => 'end_date'}
|
145
|
+
}
|
146
|
+
|
147
|
+
def struct_fields; FIELDS; end
|
148
|
+
|
149
|
+
def validate
|
150
|
+
end
|
151
|
+
|
152
|
+
::Thrift::Struct.generate_accessors self
|
153
|
+
end
|
154
|
+
|
155
|
+
class Prices_result
|
156
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
157
|
+
SUCCESS = 0
|
158
|
+
|
159
|
+
FIELDS = {
|
160
|
+
SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::API::Price}}
|
161
|
+
}
|
162
|
+
|
163
|
+
def struct_fields; FIELDS; end
|
164
|
+
|
165
|
+
def validate
|
166
|
+
end
|
167
|
+
|
168
|
+
::Thrift::Struct.generate_accessors self
|
169
|
+
end
|
170
|
+
|
171
|
+
class Price_args
|
172
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
173
|
+
ID = 1
|
174
|
+
DATE = 2
|
175
|
+
|
176
|
+
FIELDS = {
|
177
|
+
ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::SecurityId},
|
178
|
+
DATE => {:type => ::Thrift::Types::I32, :name => 'date'}
|
179
|
+
}
|
180
|
+
|
181
|
+
def struct_fields; FIELDS; end
|
182
|
+
|
183
|
+
def validate
|
184
|
+
end
|
185
|
+
|
186
|
+
::Thrift::Struct.generate_accessors self
|
187
|
+
end
|
188
|
+
|
189
|
+
class Price_result
|
190
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
191
|
+
SUCCESS = 0
|
192
|
+
|
193
|
+
FIELDS = {
|
194
|
+
SUCCESS => {:type => ::Thrift::Types::DOUBLE, :name => 'success'}
|
195
|
+
}
|
196
|
+
|
197
|
+
def struct_fields; FIELDS; end
|
198
|
+
|
199
|
+
def validate
|
200
|
+
end
|
201
|
+
|
202
|
+
::Thrift::Struct.generate_accessors self
|
203
|
+
end
|
204
|
+
|
205
|
+
class Price_change_args
|
206
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
207
|
+
ID = 1
|
208
|
+
START_DATE = 2
|
209
|
+
END_DATE = 3
|
210
|
+
|
211
|
+
FIELDS = {
|
212
|
+
ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::SecurityId},
|
213
|
+
START_DATE => {:type => ::Thrift::Types::I32, :name => 'start_date'},
|
214
|
+
END_DATE => {:type => ::Thrift::Types::I32, :name => 'end_date'}
|
215
|
+
}
|
216
|
+
|
217
|
+
def struct_fields; FIELDS; end
|
218
|
+
|
219
|
+
def validate
|
220
|
+
end
|
221
|
+
|
222
|
+
::Thrift::Struct.generate_accessors self
|
223
|
+
end
|
224
|
+
|
225
|
+
class Price_change_result
|
226
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
227
|
+
SUCCESS = 0
|
228
|
+
|
229
|
+
FIELDS = {
|
230
|
+
SUCCESS => {:type => ::Thrift::Types::DOUBLE, :name => 'success'}
|
231
|
+
}
|
232
|
+
|
233
|
+
def struct_fields; FIELDS; end
|
234
|
+
|
235
|
+
def validate
|
236
|
+
end
|
237
|
+
|
238
|
+
::Thrift::Struct.generate_accessors self
|
239
|
+
end
|
240
|
+
|
241
|
+
class Price_changes_args
|
242
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
243
|
+
ID = 1
|
244
|
+
START_DATE = 2
|
245
|
+
END_DATE = 3
|
246
|
+
|
247
|
+
FIELDS = {
|
248
|
+
ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::SecurityId},
|
249
|
+
START_DATE => {:type => ::Thrift::Types::I32, :name => 'start_date'},
|
250
|
+
END_DATE => {:type => ::Thrift::Types::I32, :name => 'end_date'}
|
251
|
+
}
|
252
|
+
|
253
|
+
def struct_fields; FIELDS; end
|
254
|
+
|
255
|
+
def validate
|
256
|
+
end
|
257
|
+
|
258
|
+
::Thrift::Struct.generate_accessors self
|
259
|
+
end
|
260
|
+
|
261
|
+
class Price_changes_result
|
262
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
263
|
+
SUCCESS = 0
|
264
|
+
|
265
|
+
FIELDS = {
|
266
|
+
SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::DOUBLE}}
|
267
|
+
}
|
268
|
+
|
269
|
+
def struct_fields; FIELDS; end
|
270
|
+
|
271
|
+
def validate
|
272
|
+
end
|
273
|
+
|
274
|
+
::Thrift::Struct.generate_accessors self
|
275
|
+
end
|
276
|
+
|
277
|
+
class Price_volatility_args
|
278
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
279
|
+
ID = 1
|
280
|
+
START_DATE = 2
|
281
|
+
END_DATE = 3
|
282
|
+
|
283
|
+
FIELDS = {
|
284
|
+
ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::SecurityId},
|
285
|
+
START_DATE => {:type => ::Thrift::Types::I32, :name => 'start_date'},
|
286
|
+
END_DATE => {:type => ::Thrift::Types::I32, :name => 'end_date'}
|
287
|
+
}
|
288
|
+
|
289
|
+
def struct_fields; FIELDS; end
|
290
|
+
|
291
|
+
def validate
|
292
|
+
end
|
293
|
+
|
294
|
+
::Thrift::Struct.generate_accessors self
|
295
|
+
end
|
296
|
+
|
297
|
+
class Price_volatility_result
|
298
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
299
|
+
SUCCESS = 0
|
300
|
+
|
301
|
+
FIELDS = {
|
302
|
+
SUCCESS => {:type => ::Thrift::Types::DOUBLE, :name => 'success'}
|
303
|
+
}
|
304
|
+
|
305
|
+
def struct_fields; FIELDS; end
|
306
|
+
|
307
|
+
def validate
|
308
|
+
end
|
309
|
+
|
310
|
+
::Thrift::Struct.generate_accessors self
|
311
|
+
end
|
312
|
+
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
end
|
data/lib/radar/api/version.rb
CHANGED
data/lib/radar-api.rb
CHANGED
data/radar-api.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_dependency "thrift"
|
22
|
+
spec.add_development_dependency "guard-rake", "0.0.9"
|
23
|
+
spec.add_dependency "thrift", "0.9.1"
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radar-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Aizim Kelmanson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -25,33 +25,33 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
28
|
+
name: guard-rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.0.9
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.0.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: thrift
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.9.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.9.1
|
55
55
|
description: Radar API
|
56
56
|
email:
|
57
57
|
- andre@investtools.com.br
|
@@ -61,14 +61,17 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- Gemfile
|
63
63
|
- Gemfile.lock
|
64
|
+
- Guardfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|
66
67
|
- Rakefile
|
67
68
|
- lib/radar-api.rb
|
68
69
|
- lib/radar/api/analyzer_controller.rb
|
69
70
|
- lib/radar/api/fund_service.rb
|
71
|
+
- lib/radar/api/index_service.rb
|
70
72
|
- lib/radar/api/radar_constants.rb
|
71
73
|
- lib/radar/api/radar_types.rb
|
74
|
+
- lib/radar/api/security_service.rb
|
72
75
|
- lib/radar/api/version.rb
|
73
76
|
- lib/radar_types.rb
|
74
77
|
- radar-api.gemspec
|