radar-api 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e819a7b63af2e3e5f372d88605582fa74b7ba31
4
- data.tar.gz: 9c64b43f3ab13fd9a823d4ed69c71487cc12b919
3
+ metadata.gz: 4acbe7c1666c71a7649bf0481bc1f72f49c71b7e
4
+ data.tar.gz: 4b6f6546afba2e17f4b084a9c50ceaf9b1d0a07d
5
5
  SHA512:
6
- metadata.gz: d7c9640c95ee8860883cc56f4632f4056d03f802632686b5e1ba93d17844379de4ddac789e01c7ada727cde4a6bc2de1d475d719eade7a6396d135508c79b264
7
- data.tar.gz: 401eb47e32f3ccf686db4a05ee7279019e22da05bf972d8c0e9cbf883946fb88149371ee0e01ea145a49c23aed444497e2d9151bede574ca5a780ef6b05212d3
6
+ metadata.gz: 27084b83a8e3e59cbe46190023c91ed5786b015578ac6a7df7beb6c909c3be7c7051cb519da75d918ac50520d393c59f15a266251e5f419e6afa945f6a07d079
7
+ data.tar.gz: 361dbdade799ed51f495128246eb9d68b0095d0053e6f5a41eee1a5c4b1f23f4d3e050dcf65a554ccc73b1e5537c0c4ba2a241c13abf885cae56017ba820b616
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radar-api (0.1.4)
4
+ radar-api (0.1.5)
5
5
  thrift (= 0.9.1)
6
6
 
7
7
  GEM
@@ -49,6 +49,13 @@ module Radar
49
49
  def send_on_finish(session_id, portfolio)
50
50
  send_message('on_finish', On_finish_args, :session_id => session_id, :portfolio => portfolio)
51
51
  end
52
+ def on_cash_flow(session_id, cash_flow)
53
+ send_on_cash_flow(session_id, cash_flow)
54
+ end
55
+
56
+ def send_on_cash_flow(session_id, cash_flow)
57
+ send_message('on_cash_flow', On_cash_flow_args, :session_id => session_id, :cash_flow => cash_flow)
58
+ end
52
59
  def create_session(session_id, analyzer_id)
53
60
  send_create_session(session_id, analyzer_id)
54
61
  return recv_create_session()
@@ -152,6 +159,12 @@ module Radar
152
159
  return
153
160
  end
154
161
 
162
+ def process_on_cash_flow(seqid, iprot, oprot)
163
+ args = read_args(iprot, On_cash_flow_args)
164
+ @handler.on_cash_flow(args.session_id, args.cash_flow)
165
+ return
166
+ end
167
+
155
168
  def process_create_session(seqid, iprot, oprot)
156
169
  args = read_args(iprot, Create_session_args)
157
170
  result = Create_session_result.new()
@@ -326,6 +339,39 @@ module Radar
326
339
  ::Thrift::Struct.generate_accessors self
327
340
  end
328
341
 
342
+ class On_cash_flow_args
343
+ include ::Thrift::Struct, ::Thrift::Struct_Union
344
+ SESSION_ID = 1
345
+ CASH_FLOW = 2
346
+
347
+ FIELDS = {
348
+ SESSION_ID => {:type => ::Thrift::Types::I16, :name => 'session_id'},
349
+ CASH_FLOW => {:type => ::Thrift::Types::STRUCT, :name => 'cash_flow', :class => ::Radar::API::CashFlow}
350
+ }
351
+
352
+ def struct_fields; FIELDS; end
353
+
354
+ def validate
355
+ end
356
+
357
+ ::Thrift::Struct.generate_accessors self
358
+ end
359
+
360
+ class On_cash_flow_result
361
+ include ::Thrift::Struct, ::Thrift::Struct_Union
362
+
363
+ FIELDS = {
364
+
365
+ }
366
+
367
+ def struct_fields; FIELDS; end
368
+
369
+ def validate
370
+ end
371
+
372
+ ::Thrift::Struct.generate_accessors self
373
+ end
374
+
329
375
  class Create_session_args
330
376
  include ::Thrift::Struct, ::Thrift::Struct_Union
331
377
  SESSION_ID = 1
@@ -28,6 +28,36 @@ module Radar
28
28
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'name failed: unknown result')
29
29
  end
30
30
 
31
+ def short_name(id)
32
+ send_short_name(id)
33
+ return recv_short_name()
34
+ end
35
+
36
+ def send_short_name(id)
37
+ send_message('short_name', Short_name_args, :id => id)
38
+ end
39
+
40
+ def recv_short_name()
41
+ result = receive_message(Short_name_result)
42
+ return result.success unless result.success.nil?
43
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'short_name failed: unknown result')
44
+ end
45
+
46
+ def daily_data(id, date)
47
+ send_daily_data(id, date)
48
+ return recv_daily_data()
49
+ end
50
+
51
+ def send_daily_data(id, date)
52
+ send_message('daily_data', Daily_data_args, :id => id, :date => date)
53
+ end
54
+
55
+ def recv_daily_data()
56
+ result = receive_message(Daily_data_result)
57
+ return result.success unless result.success.nil?
58
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'daily_data failed: unknown result')
59
+ end
60
+
31
61
  end
32
62
 
33
63
  class Processor
@@ -40,6 +70,20 @@ module Radar
40
70
  write_result(result, oprot, 'name', seqid)
41
71
  end
42
72
 
73
+ def process_short_name(seqid, iprot, oprot)
74
+ args = read_args(iprot, Short_name_args)
75
+ result = Short_name_result.new()
76
+ result.success = @handler.short_name(args.id)
77
+ write_result(result, oprot, 'short_name', seqid)
78
+ end
79
+
80
+ def process_daily_data(seqid, iprot, oprot)
81
+ args = read_args(iprot, Daily_data_args)
82
+ result = Daily_data_result.new()
83
+ result.success = @handler.daily_data(args.id, args.date)
84
+ write_result(result, oprot, 'daily_data', seqid)
85
+ end
86
+
43
87
  end
44
88
 
45
89
  # HELPER FUNCTIONS AND STRUCTURES
@@ -76,6 +120,72 @@ module Radar
76
120
  ::Thrift::Struct.generate_accessors self
77
121
  end
78
122
 
123
+ class Short_name_args
124
+ include ::Thrift::Struct, ::Thrift::Struct_Union
125
+ ID = 1
126
+
127
+ FIELDS = {
128
+ ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::FundId}
129
+ }
130
+
131
+ def struct_fields; FIELDS; end
132
+
133
+ def validate
134
+ end
135
+
136
+ ::Thrift::Struct.generate_accessors self
137
+ end
138
+
139
+ class Short_name_result
140
+ include ::Thrift::Struct, ::Thrift::Struct_Union
141
+ SUCCESS = 0
142
+
143
+ FIELDS = {
144
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
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 Daily_data_args
156
+ include ::Thrift::Struct, ::Thrift::Struct_Union
157
+ ID = 1
158
+ DATE = 2
159
+
160
+ FIELDS = {
161
+ ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::FundId},
162
+ DATE => {:type => ::Thrift::Types::I32, :name => 'date'}
163
+ }
164
+
165
+ def struct_fields; FIELDS; end
166
+
167
+ def validate
168
+ end
169
+
170
+ ::Thrift::Struct.generate_accessors self
171
+ end
172
+
173
+ class Daily_data_result
174
+ include ::Thrift::Struct, ::Thrift::Struct_Union
175
+ SUCCESS = 0
176
+
177
+ FIELDS = {
178
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Radar::API::DailyFundData}
179
+ }
180
+
181
+ def struct_fields; FIELDS; end
182
+
183
+ def validate
184
+ end
185
+
186
+ ::Thrift::Struct.generate_accessors self
187
+ end
188
+
79
189
  end
80
190
 
81
191
  end
@@ -18,9 +18,10 @@ module Radar
18
18
  module Event
19
19
  EACH_DAY = 0
20
20
  EACH_MONTH = 1
21
- FINISH = 2
22
- VALUE_MAP = {0 => "EACH_DAY", 1 => "EACH_MONTH", 2 => "FINISH"}
23
- VALID_VALUES = Set.new([EACH_DAY, EACH_MONTH, FINISH]).freeze
21
+ CASH_FLOW = 2
22
+ FINISH = 3
23
+ VALUE_MAP = {0 => "EACH_DAY", 1 => "EACH_MONTH", 2 => "CASH_FLOW", 3 => "FINISH"}
24
+ VALID_VALUES = Set.new([EACH_DAY, EACH_MONTH, CASH_FLOW, FINISH]).freeze
24
25
  end
25
26
 
26
27
  module ResultType
@@ -32,6 +33,15 @@ module Radar
32
33
  VALID_VALUES = Set.new([TABLE, PIE_CHART, LINE_CHART, BAR_CHART]).freeze
33
34
  end
34
35
 
36
+ module CashFlowType
37
+ DIVIDEND = 0
38
+ INTEREST_ON_OWN_CAPITAL = 1
39
+ DEPOSIT = 2
40
+ WITHDRAWAL = 3
41
+ VALUE_MAP = {0 => "DIVIDEND", 1 => "INTEREST_ON_OWN_CAPITAL", 2 => "DEPOSIT", 3 => "WITHDRAWAL"}
42
+ VALID_VALUES = Set.new([DIVIDEND, INTEREST_ON_OWN_CAPITAL, DEPOSIT, WITHDRAWAL]).freeze
43
+ end
44
+
35
45
  class StockId
36
46
  include ::Thrift::Struct, ::Thrift::Struct_Union
37
47
  SYMBOL = 1
@@ -83,11 +93,15 @@ module Radar
83
93
  class IndexLinkedBondId
84
94
  include ::Thrift::Struct, ::Thrift::Struct_Union
85
95
  INDEX = 1
86
- FATOR = 2
96
+ FACTOR = 2
97
+ BASE_DATE = 3
98
+ MATURITY_DATE = 4
87
99
 
88
100
  FIELDS = {
89
101
  INDEX => {:type => ::Thrift::Types::STRUCT, :name => 'index', :class => ::Radar::API::IndexId},
90
- FATOR => {:type => ::Thrift::Types::DOUBLE, :name => 'fator'}
102
+ FACTOR => {:type => ::Thrift::Types::DOUBLE, :name => 'factor'},
103
+ BASE_DATE => {:type => ::Thrift::Types::I32, :name => 'base_date'},
104
+ MATURITY_DATE => {:type => ::Thrift::Types::I32, :name => 'maturity_date'}
91
105
  }
92
106
 
93
107
  def struct_fields; FIELDS; end
@@ -471,11 +485,15 @@ module Radar
471
485
  ID = 1
472
486
  VALUE = 2
473
487
  RENTABILITY = 3
488
+ AVG_PRICE = 4
489
+ SHARES = 5
474
490
 
475
491
  FIELDS = {
476
492
  ID => {:type => ::Thrift::Types::STRUCT, :name => 'id', :class => ::Radar::API::SecurityId},
477
493
  VALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'value'},
478
- RENTABILITY => {:type => ::Thrift::Types::DOUBLE, :name => 'rentability'}
494
+ RENTABILITY => {:type => ::Thrift::Types::DOUBLE, :name => 'rentability'},
495
+ AVG_PRICE => {:type => ::Thrift::Types::DOUBLE, :name => 'avg_price'},
496
+ SHARES => {:type => ::Thrift::Types::DOUBLE, :name => 'shares'}
479
497
  }
480
498
 
481
499
  def struct_fields; FIELDS; end
@@ -489,15 +507,17 @@ module Radar
489
507
  class Portfolio
490
508
  include ::Thrift::Struct, ::Thrift::Struct_Union
491
509
  DATE = 1
492
- RENTABILITY = 2
493
- NAV = 3
494
- POSITIONS = 4
510
+ POSITIONS = 2
511
+ RENTABILITY = 3
512
+ NAV = 4
513
+ CASH = 5
495
514
 
496
515
  FIELDS = {
497
516
  DATE => {:type => ::Thrift::Types::I32, :name => 'date'},
517
+ POSITIONS => {:type => ::Thrift::Types::MAP, :name => 'positions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::API::Position}},
498
518
  RENTABILITY => {:type => ::Thrift::Types::DOUBLE, :name => 'rentability'},
499
519
  NAV => {:type => ::Thrift::Types::DOUBLE, :name => 'nav'},
500
- POSITIONS => {:type => ::Thrift::Types::MAP, :name => 'positions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::API::Position}}
520
+ CASH => {:type => ::Thrift::Types::DOUBLE, :name => 'cash'}
501
521
  }
502
522
 
503
523
  def struct_fields; FIELDS; end
@@ -551,5 +571,50 @@ module Radar
551
571
  ::Thrift::Struct.generate_accessors self
552
572
  end
553
573
 
574
+ class CashFlow
575
+ include ::Thrift::Struct, ::Thrift::Struct_Union
576
+ DATE = 1
577
+ VALUE = 2
578
+ BALANCE = 3
579
+ TYPE = 4
580
+
581
+ FIELDS = {
582
+ DATE => {:type => ::Thrift::Types::I32, :name => 'date'},
583
+ VALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'value'},
584
+ BALANCE => {:type => ::Thrift::Types::DOUBLE, :name => 'balance'},
585
+ TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Radar::API::CashFlowType}
586
+ }
587
+
588
+ def struct_fields; FIELDS; end
589
+
590
+ def validate
591
+ unless @type.nil? || ::Radar::API::CashFlowType::VALID_VALUES.include?(@type)
592
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
593
+ end
594
+ end
595
+
596
+ ::Thrift::Struct.generate_accessors self
597
+ end
598
+
599
+ class DailyFundData
600
+ include ::Thrift::Struct, ::Thrift::Struct_Union
601
+ PRICE = 1
602
+ DATE = 2
603
+ NAV = 3
604
+
605
+ FIELDS = {
606
+ PRICE => {:type => ::Thrift::Types::DOUBLE, :name => 'price'},
607
+ DATE => {:type => ::Thrift::Types::I32, :name => 'date'},
608
+ NAV => {:type => ::Thrift::Types::DOUBLE, :name => 'nav'}
609
+ }
610
+
611
+ def struct_fields; FIELDS; end
612
+
613
+ def validate
614
+ end
615
+
616
+ ::Thrift::Struct.generate_accessors self
617
+ end
618
+
554
619
  end
555
620
  end
@@ -1,5 +1,5 @@
1
1
  module Radar
2
2
  module API
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  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
4
+ version: 0.1.5
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-26 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler