radar-api 0.11.0 → 0.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c06f3a8d2546ff0dc098f29b71fe409d2d47bde3
4
- data.tar.gz: b8276b6ea6489107e1e009cb21160d45eee61e2e
3
+ metadata.gz: 75af1ab18d88ed165051e9b84763acf4c9fa4c74
4
+ data.tar.gz: 551c0984183d1d471132319265bd15fbe6470419
5
5
  SHA512:
6
- metadata.gz: 3411da78ba1d2401b52e1e948e312b56c478eb733e81f5b17855d2fafd8078ae2479cbe3297a8d583be74a9a3eb62958b292199b2a8a75622e4587626f919acc
7
- data.tar.gz: 8dfa9d4567c626df75404b768847f4511444bdc2baec9e9070bc85d91da85a0e9a1373451fb5493e5d735c855cfb119064a86874b2c53b7ba200c94cf5f869b4
6
+ metadata.gz: dfb7c6657b8840a61a7f1c304048ec24c88118a656226d07de512ea2d5d1b63ee00317cc0fbc1f4ec56f5bd571cc05841e276abd7ce1ebe2d220a700a33060bf
7
+ data.tar.gz: 249cf66cc9052fc37f216bbc39c4ad11a467a187dd74d77e7c3bf2b1a7ede27241b1c067b86c17cc4818b79e3fff7ada53076593c133b60e042badeb7700db46
@@ -38,6 +38,13 @@ module Radar
38
38
  VALID_VALUES = Set.new([IN, OUT]).freeze
39
39
  end
40
40
 
41
+ module PositionSnapshotType
42
+ STOCK = 1
43
+ OPTION = 2
44
+ VALUE_MAP = {1 => "STOCK", 2 => "OPTION"}
45
+ VALID_VALUES = Set.new([STOCK, OPTION]).freeze
46
+ end
47
+
41
48
  class StockSell; end
42
49
 
43
50
  class StockBuy; end
@@ -270,17 +277,24 @@ module Radar
270
277
  STOCK = 2
271
278
  SHARES = 3
272
279
  PRICE = 4
280
+ MATURITY = 5
281
+ TYPE = 6
273
282
 
274
283
  FIELDS = {
275
284
  DATE => {:type => ::Thrift::Types::I64, :name => 'date'},
276
285
  STOCK => {:type => ::Thrift::Types::STRUCT, :name => 'stock', :class => ::Radar::Api::StockId},
277
286
  SHARES => {:type => ::Thrift::Types::I32, :name => 'shares'},
278
- PRICE => {:type => ::Thrift::Types::DOUBLE, :name => 'price'}
287
+ PRICE => {:type => ::Thrift::Types::DOUBLE, :name => 'price'},
288
+ MATURITY => {:type => ::Thrift::Types::I64, :name => 'maturity'},
289
+ TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Radar::Api::PositionSnapshotType}
279
290
  }
280
291
 
281
292
  def struct_fields; FIELDS; end
282
293
 
283
294
  def validate
295
+ unless @type.nil? || ::Radar::Api::PositionSnapshotType::VALID_VALUES.include?(@type)
296
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
297
+ end
284
298
  end
285
299
 
286
300
  ::Thrift::Struct.generate_accessors self
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.11.0
4
+ version: 0.11.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: 2019-10-17 00:00:00.000000000 Z
11
+ date: 2019-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler