radar-api 0.12.3 → 0.13.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
  SHA256:
3
- metadata.gz: b8fe6f11a24c26867e606eb7b2219068a4c813207d8bcc10619fa1d82ea51828
4
- data.tar.gz: 0651d361582a841408e119644cc87038616991322ab8dcb74cfb80d4833a97f8
3
+ metadata.gz: ecd9424b9f71dd58c588200543ee973bfd0c5d9f370bcc892ce0f7a86e944399
4
+ data.tar.gz: '080f7ee28eba452da1824ad66a2a740a55bfc06aa422485f76d937c95d1229a7'
5
5
  SHA512:
6
- metadata.gz: 27d93ef2907e5c39520ea89fec40983c4f7706ff7d20a3d2f33f04c812018f4a23f6f92480c7c9486bc694c06ff71c250eaab223c36b381a730d3aff774b0b92
7
- data.tar.gz: ed5194c1c845e250707d0019664139a9b27b975943077768a24f9a42b70996d321b0799de6d93368475a0cf11c4efd8642a3a6350c781a0e193fa5f56d416148
6
+ metadata.gz: 1ce87bb6f2d0145ce249083fa182e9249c4bc2c59c97d08aea80b6b133df326e2119976ec706f1022f85370a01f8555a8a6ed49ba3a4895dba89b2ae7be52577
7
+ data.tar.gz: a8364bd348c0eec81a6d272ed3911d75a0dc8bb00d766c1412262371e730da36bf924f7c81375886b6c8e566ad9bea7d82713291591d852f15534a1f9b5e2431
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radar-api (0.12.3)
4
+ radar-api (0.13.0)
5
5
  thrift (~> 0.9.0)
6
6
 
7
7
  GEM
@@ -25,6 +25,7 @@ module Radar
25
25
  def recv_analyzers()
26
26
  result = receive_message(Analyzers_result)
27
27
  return result.success unless result.success.nil?
28
+ raise result.app_error unless result.app_error.nil?
28
29
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'analyzers failed: unknown result')
29
30
  end
30
31
 
@@ -68,6 +69,7 @@ module Radar
68
69
  def recv_create_session()
69
70
  result = receive_message(Create_session_result)
70
71
  return result.success unless result.success.nil?
72
+ raise result.app_error unless result.app_error.nil?
71
73
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'create_session failed: unknown result')
72
74
  end
73
75
 
@@ -83,6 +85,7 @@ module Radar
83
85
  def recv_dump()
84
86
  result = receive_message(Dump_result)
85
87
  return result.success unless result.success.nil?
88
+ raise result.app_error unless result.app_error.nil?
86
89
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'dump failed: unknown result')
87
90
  end
88
91
 
@@ -105,6 +108,7 @@ module Radar
105
108
  def recv_result()
106
109
  result = receive_message(Result_result)
107
110
  return result.success unless result.success.nil?
111
+ raise result.app_error unless result.app_error.nil?
108
112
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'result failed: unknown result')
109
113
  end
110
114
 
@@ -119,6 +123,7 @@ module Radar
119
123
 
120
124
  def recv_example_result()
121
125
  result = receive_message(Example_result_result)
126
+ raise result.app_error unless result.app_error.nil?
122
127
  return
123
128
  end
124
129
 
@@ -137,7 +142,11 @@ module Radar
137
142
  def process_analyzers(seqid, iprot, oprot)
138
143
  args = read_args(iprot, Analyzers_args)
139
144
  result = Analyzers_result.new()
140
- result.success = @handler.analyzers()
145
+ begin
146
+ result.success = @handler.analyzers()
147
+ rescue ::Radar::Api::ApplicationError => app_error
148
+ result.app_error = app_error
149
+ end
141
150
  write_result(result, oprot, 'analyzers', seqid)
142
151
  end
143
152
 
@@ -168,14 +177,22 @@ module Radar
168
177
  def process_create_session(seqid, iprot, oprot)
169
178
  args = read_args(iprot, Create_session_args)
170
179
  result = Create_session_result.new()
171
- result.success = @handler.create_session(args.session_id, args.analyzer_id)
180
+ begin
181
+ result.success = @handler.create_session(args.session_id, args.analyzer_id)
182
+ rescue ::Radar::Api::ApplicationError => app_error
183
+ result.app_error = app_error
184
+ end
172
185
  write_result(result, oprot, 'create_session', seqid)
173
186
  end
174
187
 
175
188
  def process_dump(seqid, iprot, oprot)
176
189
  args = read_args(iprot, Dump_args)
177
190
  result = Dump_result.new()
178
- result.success = @handler.dump(args.session_id)
191
+ begin
192
+ result.success = @handler.dump(args.session_id)
193
+ rescue ::Radar::Api::ApplicationError => app_error
194
+ result.app_error = app_error
195
+ end
179
196
  write_result(result, oprot, 'dump', seqid)
180
197
  end
181
198
 
@@ -188,14 +205,22 @@ module Radar
188
205
  def process_result(seqid, iprot, oprot)
189
206
  args = read_args(iprot, Result_args)
190
207
  result = Result_result.new()
191
- result.success = @handler.result(args.session_id)
208
+ begin
209
+ result.success = @handler.result(args.session_id)
210
+ rescue ::Radar::Api::ApplicationError => app_error
211
+ result.app_error = app_error
212
+ end
192
213
  write_result(result, oprot, 'result', seqid)
193
214
  end
194
215
 
195
216
  def process_example_result(seqid, iprot, oprot)
196
217
  args = read_args(iprot, Example_result_args)
197
218
  result = Example_result_result.new()
198
- @handler.example_result(args.session_id)
219
+ begin
220
+ @handler.example_result(args.session_id)
221
+ rescue ::Radar::Api::ApplicationError => app_error
222
+ result.app_error = app_error
223
+ end
199
224
  write_result(result, oprot, 'example_result', seqid)
200
225
  end
201
226
 
@@ -227,9 +252,11 @@ module Radar
227
252
  class Analyzers_result
228
253
  include ::Thrift::Struct, ::Thrift::Struct_Union
229
254
  SUCCESS = 0
255
+ APP_ERROR = 100
230
256
 
231
257
  FIELDS = {
232
- SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::AnalyzerConfig}}
258
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::AnalyzerConfig}},
259
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError}
233
260
  }
234
261
 
235
262
  def struct_fields; FIELDS; end
@@ -393,9 +420,11 @@ module Radar
393
420
  class Create_session_result
394
421
  include ::Thrift::Struct, ::Thrift::Struct_Union
395
422
  SUCCESS = 0
423
+ APP_ERROR = 100
396
424
 
397
425
  FIELDS = {
398
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Radar::Api::AnalyzerConfig}
426
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Radar::Api::AnalyzerConfig},
427
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError}
399
428
  }
400
429
 
401
430
  def struct_fields; FIELDS; end
@@ -425,9 +454,11 @@ module Radar
425
454
  class Dump_result
426
455
  include ::Thrift::Struct, ::Thrift::Struct_Union
427
456
  SUCCESS = 0
457
+ APP_ERROR = 100
428
458
 
429
459
  FIELDS = {
430
- SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success', :binary => true}
460
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success', :binary => true},
461
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError}
431
462
  }
432
463
 
433
464
  def struct_fields; FIELDS; end
@@ -490,9 +521,11 @@ module Radar
490
521
  class Result_result
491
522
  include ::Thrift::Struct, ::Thrift::Struct_Union
492
523
  SUCCESS = 0
524
+ APP_ERROR = 100
493
525
 
494
526
  FIELDS = {
495
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Radar::Api::Result}
527
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Radar::Api::Result},
528
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError}
496
529
  }
497
530
 
498
531
  def struct_fields; FIELDS; end
@@ -521,9 +554,10 @@ module Radar
521
554
 
522
555
  class Example_result_result
523
556
  include ::Thrift::Struct, ::Thrift::Struct_Union
557
+ APP_ERROR = 100
524
558
 
525
559
  FIELDS = {
526
-
560
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError}
527
561
  }
528
562
 
529
563
  def struct_fields; FIELDS; end
@@ -24,6 +24,8 @@ module Radar
24
24
 
25
25
  class Broker; end
26
26
 
27
+ class ApplicationError < ::Thrift::Exception; end
28
+
27
29
  class StockId
28
30
  include ::Thrift::Struct, ::Thrift::Struct_Union
29
31
  SYMBOL = 1
@@ -199,5 +201,23 @@ module Radar
199
201
  ::Thrift::Struct.generate_accessors self
200
202
  end
201
203
 
204
+ class ApplicationError < ::Thrift::Exception
205
+ include ::Thrift::Struct, ::Thrift::Struct_Union
206
+ MESSAGE = 1
207
+ STACKTRACE = 2
208
+
209
+ FIELDS = {
210
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
211
+ STACKTRACE => {:type => ::Thrift::Types::LIST, :name => 'stacktrace', :element => {:type => ::Thrift::Types::STRING}}
212
+ }
213
+
214
+ def struct_fields; FIELDS; end
215
+
216
+ def validate
217
+ end
218
+
219
+ ::Thrift::Struct.generate_accessors self
220
+ end
221
+
202
222
  end
203
223
  end
@@ -25,6 +25,7 @@ module Radar
25
25
  def recv_extract()
26
26
  result = receive_message(Extract_result)
27
27
  return result.success unless result.success.nil?
28
+ raise result.app_error unless result.app_error.nil?
28
29
  raise result.col_quantity_error unless result.col_quantity_error.nil?
29
30
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'extract failed: unknown result')
30
31
  end
@@ -39,6 +40,8 @@ module Radar
39
40
  result = Extract_result.new()
40
41
  begin
41
42
  result.success = @handler.extract(args.data)
43
+ rescue ::Radar::Api::ApplicationError => app_error
44
+ result.app_error = app_error
42
45
  rescue ::Radar::Api::WrongFileStructure => col_quantity_error
43
46
  result.col_quantity_error = col_quantity_error
44
47
  end
@@ -68,10 +71,12 @@ module Radar
68
71
  class Extract_result
69
72
  include ::Thrift::Struct, ::Thrift::Struct_Union
70
73
  SUCCESS = 0
74
+ APP_ERROR = 100
71
75
  COL_QUANTITY_ERROR = 1
72
76
 
73
77
  FIELDS = {
74
78
  SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::Transaction}},
79
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError},
75
80
  COL_QUANTITY_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'col_quantity_error', :class => ::Radar::Api::WrongFileStructure}
76
81
  }
77
82
 
@@ -5,6 +5,7 @@
5
5
  #
6
6
 
7
7
  require 'thrift'
8
+ require 'radar/api/common_types'
8
9
  require 'radar/api/transaction_types'
9
10
 
10
11
 
@@ -25,6 +25,7 @@ module Radar
25
25
  def recv_authenticate()
26
26
  result = receive_message(Authenticate_result)
27
27
  return result.success unless result.success.nil?
28
+ raise result.app_error unless result.app_error.nil?
28
29
  raise result.auth_error unless result.auth_error.nil?
29
30
  raise result.system_unavailable unless result.system_unavailable.nil?
30
31
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'authenticate failed: unknown result')
@@ -41,6 +42,7 @@ module Radar
41
42
 
42
43
  def recv_fetch()
43
44
  result = receive_message(Fetch_result)
45
+ raise result.app_error unless result.app_error.nil?
44
46
  raise result.auth_error unless result.auth_error.nil?
45
47
  raise result.system_unavailable unless result.system_unavailable.nil?
46
48
  return
@@ -58,6 +60,7 @@ module Radar
58
60
  def recv_fetch_portfolio()
59
61
  result = receive_message(Fetch_portfolio_result)
60
62
  return result.success unless result.success.nil?
63
+ raise result.app_error unless result.app_error.nil?
61
64
  raise result.auth_error unless result.auth_error.nil?
62
65
  raise result.system_unavailable unless result.system_unavailable.nil?
63
66
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetch_portfolio failed: unknown result')
@@ -73,6 +76,8 @@ module Radar
73
76
  result = Authenticate_result.new()
74
77
  begin
75
78
  result.success = @handler.authenticate(args.username, args.password, args.user)
79
+ rescue ::Radar::Api::ApplicationError => app_error
80
+ result.app_error = app_error
76
81
  rescue ::Radar::Api::AuthenticationError => auth_error
77
82
  result.auth_error = auth_error
78
83
  rescue ::Radar::Api::SystemUnavailableError => system_unavailable
@@ -86,6 +91,8 @@ module Radar
86
91
  result = Fetch_result.new()
87
92
  begin
88
93
  @handler.fetch(args.username, args.password, args.user, args.last_transaction_date)
94
+ rescue ::Radar::Api::ApplicationError => app_error
95
+ result.app_error = app_error
89
96
  rescue ::Radar::Api::AuthenticationError => auth_error
90
97
  result.auth_error = auth_error
91
98
  rescue ::Radar::Api::SystemUnavailableError => system_unavailable
@@ -99,6 +106,8 @@ module Radar
99
106
  result = Fetch_portfolio_result.new()
100
107
  begin
101
108
  result.success = @handler.fetch_portfolio(args.username, args.password, args.date)
109
+ rescue ::Radar::Api::ApplicationError => app_error
110
+ result.app_error = app_error
102
111
  rescue ::Radar::Api::AuthenticationError => auth_error
103
112
  result.auth_error = auth_error
104
113
  rescue ::Radar::Api::SystemUnavailableError => system_unavailable
@@ -134,11 +143,13 @@ module Radar
134
143
  class Authenticate_result
135
144
  include ::Thrift::Struct, ::Thrift::Struct_Union
136
145
  SUCCESS = 0
146
+ APP_ERROR = 100
137
147
  AUTH_ERROR = 1
138
148
  SYSTEM_UNAVAILABLE = 2
139
149
 
140
150
  FIELDS = {
141
151
  SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'},
152
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError},
142
153
  AUTH_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'auth_error', :class => ::Radar::Api::AuthenticationError},
143
154
  SYSTEM_UNAVAILABLE => {:type => ::Thrift::Types::STRUCT, :name => 'system_unavailable', :class => ::Radar::Api::SystemUnavailableError}
144
155
  }
@@ -175,10 +186,12 @@ module Radar
175
186
 
176
187
  class Fetch_result
177
188
  include ::Thrift::Struct, ::Thrift::Struct_Union
189
+ APP_ERROR = 100
178
190
  AUTH_ERROR = 1
179
191
  SYSTEM_UNAVAILABLE = 2
180
192
 
181
193
  FIELDS = {
194
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError},
182
195
  AUTH_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'auth_error', :class => ::Radar::Api::AuthenticationError},
183
196
  SYSTEM_UNAVAILABLE => {:type => ::Thrift::Types::STRUCT, :name => 'system_unavailable', :class => ::Radar::Api::SystemUnavailableError}
184
197
  }
@@ -214,11 +227,13 @@ module Radar
214
227
  class Fetch_portfolio_result
215
228
  include ::Thrift::Struct, ::Thrift::Struct_Union
216
229
  SUCCESS = 0
230
+ APP_ERROR = 100
217
231
  AUTH_ERROR = 1
218
232
  SYSTEM_UNAVAILABLE = 2
219
233
 
220
234
  FIELDS = {
221
235
  SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRUCT, :class => ::Radar::Api::SecurityId}, :value => {:type => ::Thrift::Types::I32}},
236
+ APP_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'app_error', :class => ::Radar::Api::ApplicationError},
222
237
  AUTH_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'auth_error', :class => ::Radar::Api::AuthenticationError},
223
238
  SYSTEM_UNAVAILABLE => {:type => ::Thrift::Types::STRUCT, :name => 'system_unavailable', :class => ::Radar::Api::SystemUnavailableError}
224
239
  }
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.12.3
4
+ version: 0.13.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: 2019-12-12 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubygems_version: 3.0.3
116
+ rubygems_version: 3.0.6
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Radar API