radar-api 0.6.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0aa2a93b72869095bf7a8250498ab1f85c9722ac
4
- data.tar.gz: ad16567823f6734fae2ff3574b45cfb01c2ab49d
3
+ metadata.gz: 4fd4b955e78610227bb6db4e4328ac35748376f8
4
+ data.tar.gz: 409a649229fac74707caddf2ecfc7a205dbd17d1
5
5
  SHA512:
6
- metadata.gz: abf2e1078e240f07c77311c864fab215697a201ba339df82f2113ebd0d3f64b7d4ae09196338dce9cebd835ac5855b58473164b6cde2b194ab448bc495e5a37f
7
- data.tar.gz: 0e034916bb2e136c9a66eb2d765bfdaf6c33711950dbcad3f646e83e4e97093df5f89f779bdacf02be6319dda1ab033d482c0868abdbdd08802eb84c01e45844
6
+ metadata.gz: 73c9b2b8bb7d5cfc05af8ba78b2e342cd0aa1d248d217f28c5f98b44da4bf5f1d18f53aeef9196194b586e884a6a3b46226077c6b8cbdb1e4bcff19889a61358
7
+ data.tar.gz: 2e25b83f3bbe714621f3f6f56385ca5569d61a9aca1ddccea3315a9f6ee1fee1bd5f96ee5074db774d9bb1d2ad2a9b3bff32f23102321d4836f04adfe231cc3e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radar-api (0.6.0)
4
+ radar-api (0.7.0)
5
5
  thrift (~> 0.9.0)
6
6
 
7
7
  GEM
@@ -0,0 +1,209 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'radar/api/transaction_importer_types'
9
+
10
+ module Radar
11
+ module Api
12
+ module TransactionImporter
13
+ class Client
14
+ include ::Thrift::Client
15
+
16
+ def name()
17
+ send_name()
18
+ return recv_name()
19
+ end
20
+
21
+ def send_name()
22
+ send_message('name', Name_args)
23
+ end
24
+
25
+ def recv_name()
26
+ result = receive_message(Name_result)
27
+ return result.success unless result.success.nil?
28
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'name failed: unknown result')
29
+ end
30
+
31
+ def accounts(username, password)
32
+ send_accounts(username, password)
33
+ return recv_accounts()
34
+ end
35
+
36
+ def send_accounts(username, password)
37
+ send_message('accounts', Accounts_args, :username => username, :password => password)
38
+ end
39
+
40
+ def recv_accounts()
41
+ result = receive_message(Accounts_result)
42
+ return result.success unless result.success.nil?
43
+ raise result.auth_error unless result.auth_error.nil?
44
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'accounts failed: unknown result')
45
+ end
46
+
47
+ def fetch(username, password, accounts)
48
+ send_fetch(username, password, accounts)
49
+ return recv_fetch()
50
+ end
51
+
52
+ def send_fetch(username, password, accounts)
53
+ send_message('fetch', Fetch_args, :username => username, :password => password, :accounts => accounts)
54
+ end
55
+
56
+ def recv_fetch()
57
+ result = receive_message(Fetch_result)
58
+ return result.success unless result.success.nil?
59
+ raise result.auth_error unless result.auth_error.nil?
60
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetch failed: unknown result')
61
+ end
62
+
63
+ end
64
+
65
+ class Processor
66
+ include ::Thrift::Processor
67
+
68
+ def process_name(seqid, iprot, oprot)
69
+ args = read_args(iprot, Name_args)
70
+ result = Name_result.new()
71
+ result.success = @handler.name()
72
+ write_result(result, oprot, 'name', seqid)
73
+ end
74
+
75
+ def process_accounts(seqid, iprot, oprot)
76
+ args = read_args(iprot, Accounts_args)
77
+ result = Accounts_result.new()
78
+ begin
79
+ result.success = @handler.accounts(args.username, args.password)
80
+ rescue ::Radar::Api::AuthenticationError => auth_error
81
+ result.auth_error = auth_error
82
+ end
83
+ write_result(result, oprot, 'accounts', seqid)
84
+ end
85
+
86
+ def process_fetch(seqid, iprot, oprot)
87
+ args = read_args(iprot, Fetch_args)
88
+ result = Fetch_result.new()
89
+ begin
90
+ result.success = @handler.fetch(args.username, args.password, args.accounts)
91
+ rescue ::Radar::Api::AuthenticationError => auth_error
92
+ result.auth_error = auth_error
93
+ end
94
+ write_result(result, oprot, 'fetch', seqid)
95
+ end
96
+
97
+ end
98
+
99
+ # HELPER FUNCTIONS AND STRUCTURES
100
+
101
+ class Name_args
102
+ include ::Thrift::Struct, ::Thrift::Struct_Union
103
+
104
+ FIELDS = {
105
+
106
+ }
107
+
108
+ def struct_fields; FIELDS; end
109
+
110
+ def validate
111
+ end
112
+
113
+ ::Thrift::Struct.generate_accessors self
114
+ end
115
+
116
+ class Name_result
117
+ include ::Thrift::Struct, ::Thrift::Struct_Union
118
+ SUCCESS = 0
119
+
120
+ FIELDS = {
121
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
122
+ }
123
+
124
+ def struct_fields; FIELDS; end
125
+
126
+ def validate
127
+ end
128
+
129
+ ::Thrift::Struct.generate_accessors self
130
+ end
131
+
132
+ class Accounts_args
133
+ include ::Thrift::Struct, ::Thrift::Struct_Union
134
+ USERNAME = 1
135
+ PASSWORD = 2
136
+
137
+ FIELDS = {
138
+ USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username'},
139
+ PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password'}
140
+ }
141
+
142
+ def struct_fields; FIELDS; end
143
+
144
+ def validate
145
+ end
146
+
147
+ ::Thrift::Struct.generate_accessors self
148
+ end
149
+
150
+ class Accounts_result
151
+ include ::Thrift::Struct, ::Thrift::Struct_Union
152
+ SUCCESS = 0
153
+ AUTH_ERROR = 1
154
+
155
+ FIELDS = {
156
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
157
+ AUTH_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'auth_error', :class => ::Radar::Api::AuthenticationError}
158
+ }
159
+
160
+ def struct_fields; FIELDS; end
161
+
162
+ def validate
163
+ end
164
+
165
+ ::Thrift::Struct.generate_accessors self
166
+ end
167
+
168
+ class Fetch_args
169
+ include ::Thrift::Struct, ::Thrift::Struct_Union
170
+ USERNAME = 1
171
+ PASSWORD = 2
172
+ ACCOUNTS = 3
173
+
174
+ FIELDS = {
175
+ USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username'},
176
+ PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password'},
177
+ ACCOUNTS => {:type => ::Thrift::Types::LIST, :name => 'accounts', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::Account}}
178
+ }
179
+
180
+ def struct_fields; FIELDS; end
181
+
182
+ def validate
183
+ end
184
+
185
+ ::Thrift::Struct.generate_accessors self
186
+ end
187
+
188
+ class Fetch_result
189
+ include ::Thrift::Struct, ::Thrift::Struct_Union
190
+ SUCCESS = 0
191
+ AUTH_ERROR = 1
192
+
193
+ FIELDS = {
194
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::Transaction}},
195
+ AUTH_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'auth_error', :class => ::Radar::Api::AuthenticationError}
196
+ }
197
+
198
+ def struct_fields; FIELDS; end
199
+
200
+ def validate
201
+ end
202
+
203
+ ::Thrift::Struct.generate_accessors self
204
+ end
205
+
206
+ end
207
+
208
+ end
209
+ end
@@ -5,7 +5,7 @@
5
5
  #
6
6
 
7
7
  require 'thrift'
8
- require 'radar/api/transaction_sync_types'
8
+ require 'radar/api/transaction_importer_types'
9
9
 
10
10
  module Radar
11
11
  module Api
@@ -20,12 +20,14 @@ module Radar
20
20
  class StockSellTransaction
21
21
  include ::Thrift::Struct, ::Thrift::Struct_Union
22
22
  DATE = 1
23
- STOCK = 2
24
- SHARES = 3
25
- PRICE = 4
23
+ ACCOUNT = 2
24
+ STOCK = 3
25
+ SHARES = 4
26
+ PRICE = 5
26
27
 
27
28
  FIELDS = {
28
29
  DATE => {:type => ::Thrift::Types::I64, :name => 'date'},
30
+ ACCOUNT => {:type => ::Thrift::Types::STRING, :name => 'account'},
29
31
  STOCK => {:type => ::Thrift::Types::STRUCT, :name => 'stock', :class => ::Radar::Api::StockId},
30
32
  SHARES => {:type => ::Thrift::Types::I32, :name => 'shares'},
31
33
  PRICE => {:type => ::Thrift::Types::DOUBLE, :name => 'price'}
@@ -42,13 +44,15 @@ module Radar
42
44
  class StockBuyTransaction
43
45
  include ::Thrift::Struct, ::Thrift::Struct_Union
44
46
  DATE = 1
45
- STOCK = 2
46
- SHARES = 3
47
- PRICE = 4
48
- TYPE = 5
47
+ ACCOUNT = 2
48
+ STOCK = 3
49
+ SHARES = 4
50
+ PRICE = 5
51
+ TYPE = 6
49
52
 
50
53
  FIELDS = {
51
54
  DATE => {:type => ::Thrift::Types::I64, :name => 'date'},
55
+ ACCOUNT => {:type => ::Thrift::Types::STRING, :name => 'account'},
52
56
  STOCK => {:type => ::Thrift::Types::STRUCT, :name => 'stock', :class => ::Radar::Api::StockId},
53
57
  SHARES => {:type => ::Thrift::Types::I32, :name => 'shares'},
54
58
  PRICE => {:type => ::Thrift::Types::DOUBLE, :name => 'price'},
@@ -95,14 +99,35 @@ module Radar
95
99
  ::Thrift::Union.generate_accessors self
96
100
  end
97
101
 
98
- class TransactionSynchronizerConfig
102
+ class Account
99
103
  include ::Thrift::Struct, ::Thrift::Struct_Union
100
104
  ID = 1
101
- NAME = 2
105
+ LAST_TRANSACTION_DATE = 2
102
106
 
103
107
  FIELDS = {
104
108
  ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
105
- NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}
109
+ LAST_TRANSACTION_DATE => {:type => ::Thrift::Types::I64, :name => 'last_transaction_date'}
110
+ }
111
+
112
+ def struct_fields; FIELDS; end
113
+
114
+ def validate
115
+ end
116
+
117
+ ::Thrift::Struct.generate_accessors self
118
+ end
119
+
120
+ class AuthenticationError < ::Thrift::Exception
121
+ include ::Thrift::Struct, ::Thrift::Struct_Union
122
+ def initialize(message=nil)
123
+ super()
124
+ self.message = message
125
+ end
126
+
127
+ MESSAGE = 1
128
+
129
+ FIELDS = {
130
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
106
131
  }
107
132
 
108
133
  def struct_fields; FIELDS; end
data/gen/radar_types.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  #
6
6
 
7
7
  require 'thrift'
8
- require 'radar/api/transaction_sync_types'
8
+ require 'radar/api/transaction_importer_types'
9
9
  require 'radar/api/portfolio_analyzer_types'
10
10
  require 'radar/api/data_server_types'
11
11
 
data/lib/radar-api.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'radar/api/analyzer_controller'
2
+ require 'radar/api/transaction_importer'
2
3
  require 'radar/api/fund_service'
3
4
  require 'radar/api/security_service'
4
5
  require 'radar/api/fund_service'
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.6.0
4
+ version: 0.7.0
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: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,9 +75,9 @@ files:
75
75
  - gen/radar/api/portfolio_analyzer_constants.rb
76
76
  - gen/radar/api/portfolio_analyzer_types.rb
77
77
  - gen/radar/api/security_service.rb
78
- - gen/radar/api/transaction_sync_constants.rb
79
- - gen/radar/api/transaction_sync_types.rb
80
- - gen/radar/api/transaction_synchronizer_controller.rb
78
+ - gen/radar/api/transaction_importer.rb
79
+ - gen/radar/api/transaction_importer_constants.rb
80
+ - gen/radar/api/transaction_importer_types.rb
81
81
  - gen/radar_constants.rb
82
82
  - gen/radar_types.rb
83
83
  - lib/radar-api.rb
@@ -1,135 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (0.9.3)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'radar/api/transaction_sync_types'
9
-
10
- module Radar
11
- module Api
12
- module TransactionSynchronizerController
13
- class Client
14
- include ::Thrift::Client
15
-
16
- def synchronizers()
17
- send_synchronizers()
18
- return recv_synchronizers()
19
- end
20
-
21
- def send_synchronizers()
22
- send_message('synchronizers', Synchronizers_args)
23
- end
24
-
25
- def recv_synchronizers()
26
- result = receive_message(Synchronizers_result)
27
- return result.success unless result.success.nil?
28
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'synchronizers failed: unknown result')
29
- end
30
-
31
- def sync(synchronizer_id)
32
- send_sync(synchronizer_id)
33
- return recv_sync()
34
- end
35
-
36
- def send_sync(synchronizer_id)
37
- send_message('sync', Sync_args, :synchronizer_id => synchronizer_id)
38
- end
39
-
40
- def recv_sync()
41
- result = receive_message(Sync_result)
42
- return result.success unless result.success.nil?
43
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'sync failed: unknown result')
44
- end
45
-
46
- end
47
-
48
- class Processor
49
- include ::Thrift::Processor
50
-
51
- def process_synchronizers(seqid, iprot, oprot)
52
- args = read_args(iprot, Synchronizers_args)
53
- result = Synchronizers_result.new()
54
- result.success = @handler.synchronizers()
55
- write_result(result, oprot, 'synchronizers', seqid)
56
- end
57
-
58
- def process_sync(seqid, iprot, oprot)
59
- args = read_args(iprot, Sync_args)
60
- result = Sync_result.new()
61
- result.success = @handler.sync(args.synchronizer_id)
62
- write_result(result, oprot, 'sync', seqid)
63
- end
64
-
65
- end
66
-
67
- # HELPER FUNCTIONS AND STRUCTURES
68
-
69
- class Synchronizers_args
70
- include ::Thrift::Struct, ::Thrift::Struct_Union
71
-
72
- FIELDS = {
73
-
74
- }
75
-
76
- def struct_fields; FIELDS; end
77
-
78
- def validate
79
- end
80
-
81
- ::Thrift::Struct.generate_accessors self
82
- end
83
-
84
- class Synchronizers_result
85
- include ::Thrift::Struct, ::Thrift::Struct_Union
86
- SUCCESS = 0
87
-
88
- FIELDS = {
89
- SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::TransactionSynchronizerConfig}}
90
- }
91
-
92
- def struct_fields; FIELDS; end
93
-
94
- def validate
95
- end
96
-
97
- ::Thrift::Struct.generate_accessors self
98
- end
99
-
100
- class Sync_args
101
- include ::Thrift::Struct, ::Thrift::Struct_Union
102
- SYNCHRONIZER_ID = 1
103
-
104
- FIELDS = {
105
- SYNCHRONIZER_ID => {:type => ::Thrift::Types::STRING, :name => 'synchronizer_id'}
106
- }
107
-
108
- def struct_fields; FIELDS; end
109
-
110
- def validate
111
- end
112
-
113
- ::Thrift::Struct.generate_accessors self
114
- end
115
-
116
- class Sync_result
117
- include ::Thrift::Struct, ::Thrift::Struct_Union
118
- SUCCESS = 0
119
-
120
- FIELDS = {
121
- SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::Transaction}}
122
- }
123
-
124
- def struct_fields; FIELDS; end
125
-
126
- def validate
127
- end
128
-
129
- ::Thrift::Struct.generate_accessors self
130
- end
131
-
132
- end
133
-
134
- end
135
- end