flowcommerce 0.0.29 → 0.0.30

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: 9d18d28a4dac338086ccc6b1c56f004f3b3ad0c0
4
- data.tar.gz: 5c9b05cfcbe650313ae90ddf98333482ff57d57f
3
+ metadata.gz: 84cbabf8d7cf6bcc5b324acb2ff75ec7826cf64b
4
+ data.tar.gz: 3f82782306f46024b1641dbf87385d4fdf7d3b25
5
5
  SHA512:
6
- metadata.gz: 3f9e863634b649ebb36a31e326a01f32e8842d756096c2189d3c7d319a75460511bdeb8487a9274d723a0b3c64022e5d48b00446751880b03b70c0525d675562
7
- data.tar.gz: 5227d38ad94560cebb01b59bc47143e2c7dc9179b7bb761eeaa27f5e174a324ed9456b2be1a3ed6734f8063fe6dbeb2fc448e0a9a0756db76422d72952d683e9
6
+ metadata.gz: f5685b8277bdfe1136e257793153cab4edf225e55142f60953a7c8ea4c62881b8ec539203eecd503e7cbb4439bdab776c755157afcbf16ad3c707d91e19942d1
7
+ data.tar.gz: 0e997980113f937cb29a877aa2f864826a3446adbeb73c9fdfeccdf33f1a71c401adcd3e5785abbac34c97341be8baaecdc7c6786441b6811e704a75f54e0208
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.0.91
3
- # apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.91/ruby_client
2
+ # Service version: 0.0.92
3
+ # apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.92/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,8 +25,8 @@ module Io
25
25
 
26
26
  BASE_URL = 'https://api.flow.io' unless defined?(Constants::BASE_URL)
27
27
  NAMESPACE = 'io.flow.v0' unless defined?(Constants::NAMESPACE)
28
- USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.91/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.0.91' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.33 http://www.apidoc.me/flow/api/0.0.92/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.0.92' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -482,7 +482,7 @@ module Io
482
482
  HttpClient::Preconditions.assert_class('key', key, String)
483
483
  HttpClient::Preconditions.assert_class('number', number, String)
484
484
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(key)}/items/#{CGI.escape(number)}/price").get
485
- ::Io::Flow::V0::Models::ItemPriceDetails.new(r)
485
+ ::Io::Flow::V0::Models::PriceDetails.new(r)
486
486
  end
487
487
 
488
488
  def get_margins_by_key(organization, key, incoming={})
@@ -3908,6 +3908,14 @@ module Io
3908
3908
  CATALOG_ITEM_DELETED = 'catalog_item_deleted' unless defined?(CATALOG_ITEM_DELETED)
3909
3909
  SUBCATALOG_ITEM_UPSERTED = 'subcatalog_item_upserted' unless defined?(SUBCATALOG_ITEM_UPSERTED)
3910
3910
  SUBCATALOG_ITEM_DELETED = 'subcatalog_item_deleted' unless defined?(SUBCATALOG_ITEM_DELETED)
3911
+ FLOW_CURRENCY_SETTING_DELETED = 'flow_currency_setting_deleted' unless defined?(FLOW_CURRENCY_SETTING_DELETED)
3912
+ FLOW_CURRENCY_SETTING_UPSERTED = 'flow_currency_setting_upserted' unless defined?(FLOW_CURRENCY_SETTING_UPSERTED)
3913
+ RATE_DELETED = 'rate_deleted' unless defined?(RATE_DELETED)
3914
+ RATE_UPSERTED = 'rate_upserted' unless defined?(RATE_UPSERTED)
3915
+ SPOT_RATE_DELETED = 'spot_rate_deleted' unless defined?(SPOT_RATE_DELETED)
3916
+ SPOT_RATE_UPSERTED = 'spot_rate_upserted' unless defined?(SPOT_RATE_UPSERTED)
3917
+ ORGANIZATION_CURRENCY_SETTING_DELETED = 'organization_currency_setting_deleted' unless defined?(ORGANIZATION_CURRENCY_SETTING_DELETED)
3918
+ ORGANIZATION_CURRENCY_SETTING_UPSERTED = 'organization_currency_setting_upserted' unless defined?(ORGANIZATION_CURRENCY_SETTING_UPSERTED)
3911
3919
  EXPERIENCE_DELETED = 'experience_deleted' unless defined?(EXPERIENCE_DELETED)
3912
3920
  EXPERIENCE_UPSERTED = 'experience_upserted' unless defined?(EXPERIENCE_UPSERTED)
3913
3921
  HS6_CODE_UPSERTED = 'hs6_code_upserted' unless defined?(HS6_CODE_UPSERTED)
@@ -3937,6 +3945,14 @@ module Io
3937
3945
  when Types::CATALOG_ITEM_DELETED; CatalogItemDeleted.new(hash)
3938
3946
  when Types::SUBCATALOG_ITEM_UPSERTED; SubcatalogItemUpserted.new(hash)
3939
3947
  when Types::SUBCATALOG_ITEM_DELETED; SubcatalogItemDeleted.new(hash)
3948
+ when Types::FLOW_CURRENCY_SETTING_DELETED; FlowCurrencySettingDeleted.new(hash)
3949
+ when Types::FLOW_CURRENCY_SETTING_UPSERTED; FlowCurrencySettingUpserted.new(hash)
3950
+ when Types::RATE_DELETED; RateDeleted.new(hash)
3951
+ when Types::RATE_UPSERTED; RateUpserted.new(hash)
3952
+ when Types::SPOT_RATE_DELETED; SpotRateDeleted.new(hash)
3953
+ when Types::SPOT_RATE_UPSERTED; SpotRateUpserted.new(hash)
3954
+ when Types::ORGANIZATION_CURRENCY_SETTING_DELETED; OrganizationCurrencySettingDeleted.new(hash)
3955
+ when Types::ORGANIZATION_CURRENCY_SETTING_UPSERTED; OrganizationCurrencySettingUpserted.new(hash)
3940
3956
  when Types::EXPERIENCE_DELETED; ExperienceDeleted.new(hash)
3941
3957
  when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash)
3942
3958
  when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash)
@@ -4670,7 +4686,7 @@ module Io
4670
4686
  end
4671
4687
 
4672
4688
  def EventType.ALL
4673
- @@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.experience_deleted, EventType.experience_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted]
4689
+ @@all ||= [EventType.catalog_upserted, EventType.catalog_deleted, EventType.subcatalog_upserted, EventType.subcatalog_deleted, EventType.catalog_item_upserted, EventType.catalog_item_deleted, EventType.subcatalog_item_upserted, EventType.subcatalog_item_deleted, EventType.flow_currency_setting_deleted, EventType.flow_currency_setting_upserted, EventType.rate_deleted, EventType.rate_upserted, EventType.spot_rate_deleted, EventType.spot_rate_upserted, EventType.organization_currency_setting_deleted, EventType.organization_currency_setting_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted]
4674
4690
  end
4675
4691
 
4676
4692
  def EventType.catalog_upserted
@@ -4705,6 +4721,38 @@ module Io
4705
4721
  @@_subcatalog_item_deleted ||= EventType.new('subcatalog_item_deleted')
4706
4722
  end
4707
4723
 
4724
+ def EventType.flow_currency_setting_deleted
4725
+ @@_flow_currency_setting_deleted ||= EventType.new('flow_currency_setting_deleted')
4726
+ end
4727
+
4728
+ def EventType.flow_currency_setting_upserted
4729
+ @@_flow_currency_setting_upserted ||= EventType.new('flow_currency_setting_upserted')
4730
+ end
4731
+
4732
+ def EventType.rate_deleted
4733
+ @@_rate_deleted ||= EventType.new('rate_deleted')
4734
+ end
4735
+
4736
+ def EventType.rate_upserted
4737
+ @@_rate_upserted ||= EventType.new('rate_upserted')
4738
+ end
4739
+
4740
+ def EventType.spot_rate_deleted
4741
+ @@_spot_rate_deleted ||= EventType.new('spot_rate_deleted')
4742
+ end
4743
+
4744
+ def EventType.spot_rate_upserted
4745
+ @@_spot_rate_upserted ||= EventType.new('spot_rate_upserted')
4746
+ end
4747
+
4748
+ def EventType.organization_currency_setting_deleted
4749
+ @@_organization_currency_setting_deleted ||= EventType.new('organization_currency_setting_deleted')
4750
+ end
4751
+
4752
+ def EventType.organization_currency_setting_upserted
4753
+ @@_organization_currency_setting_upserted ||= EventType.new('organization_currency_setting_upserted')
4754
+ end
4755
+
4708
4756
  def EventType.experience_deleted
4709
4757
  @@_experience_deleted ||= EventType.new('experience_deleted')
4710
4758
  end
@@ -8671,6 +8719,80 @@ module Io
8671
8719
 
8672
8720
  end
8673
8721
 
8722
+ class FlowCurrencySettingDeleted < Event
8723
+
8724
+ attr_reader :event_id, :timestamp, :flow_currency_setting_id
8725
+
8726
+ def initialize(incoming={})
8727
+ super(:name => Event::Types::FLOW_CURRENCY_SETTING_DELETED)
8728
+ opts = HttpClient::Helper.symbolize_keys(incoming)
8729
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :flow_currency_setting_id], 'FlowCurrencySettingDeleted')
8730
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
8731
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
8732
+ @flow_currency_setting_id = HttpClient::Preconditions.assert_class('flow_currency_setting_id', opts.delete(:flow_currency_setting_id), String)
8733
+ end
8734
+
8735
+ def to_json
8736
+ JSON.dump(to_hash)
8737
+ end
8738
+
8739
+ def copy(incoming={})
8740
+ FlowCurrencySettingDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8741
+ end
8742
+
8743
+ def subtype_to_hash
8744
+ {
8745
+ :event_id => event_id,
8746
+ :timestamp => timestamp,
8747
+ :flow_currency_setting_id => flow_currency_setting_id
8748
+ }
8749
+ end
8750
+
8751
+ end
8752
+
8753
+ class FlowCurrencySettingUpserted < Event
8754
+
8755
+ attr_reader :event_id, :timestamp, :flow_currency_setting_id, :organization_id, :base, :target, :margin, :rate_lock_unit, :rate_lock_value
8756
+
8757
+ def initialize(incoming={})
8758
+ super(:name => Event::Types::FLOW_CURRENCY_SETTING_UPSERTED)
8759
+ opts = HttpClient::Helper.symbolize_keys(incoming)
8760
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :flow_currency_setting_id, :organization_id, :base, :target, :margin, :rate_lock_unit, :rate_lock_value], 'FlowCurrencySettingUpserted')
8761
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
8762
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
8763
+ @flow_currency_setting_id = HttpClient::Preconditions.assert_class('flow_currency_setting_id', opts.delete(:flow_currency_setting_id), String)
8764
+ @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
8765
+ @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
8766
+ @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
8767
+ @margin = HttpClient::Preconditions.assert_class('margin', HttpClient::Helper.to_big_decimal(opts.delete(:margin)), BigDecimal)
8768
+ @rate_lock_unit = HttpClient::Preconditions.assert_class('rate_lock_unit', opts.delete(:rate_lock_unit), String)
8769
+ @rate_lock_value = HttpClient::Preconditions.assert_class('rate_lock_value', opts.delete(:rate_lock_value), Integer)
8770
+ end
8771
+
8772
+ def to_json
8773
+ JSON.dump(to_hash)
8774
+ end
8775
+
8776
+ def copy(incoming={})
8777
+ FlowCurrencySettingUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
8778
+ end
8779
+
8780
+ def subtype_to_hash
8781
+ {
8782
+ :event_id => event_id,
8783
+ :timestamp => timestamp,
8784
+ :flow_currency_setting_id => flow_currency_setting_id,
8785
+ :organization_id => organization_id,
8786
+ :base => base,
8787
+ :target => target,
8788
+ :margin => margin,
8789
+ :rate_lock_unit => rate_lock_unit,
8790
+ :rate_lock_value => rate_lock_value
8791
+ }
8792
+ end
8793
+
8794
+ end
8795
+
8674
8796
  class FlowItemIndexMetadata
8675
8797
 
8676
8798
  attr_reader :status
@@ -10521,49 +10643,6 @@ module Io
10521
10643
 
10522
10644
  end
10523
10645
 
10524
- # Detailed information for the pricing of a given item within an experience
10525
- class ItemPriceDetails
10526
-
10527
- attr_reader :base, :local, :currency_margin, :item_margin, :vat, :duty, :shipping, :rounding, :total
10528
-
10529
- def initialize(incoming={})
10530
- opts = HttpClient::Helper.symbolize_keys(incoming)
10531
- HttpClient::Preconditions.require_keys(opts, [:base, :local, :currency_margin, :item_margin, :vat, :duty, :shipping, :rounding, :total], 'ItemPriceDetails')
10532
- @base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10533
- @local = (x = opts.delete(:local); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10534
- @currency_margin = (x = opts.delete(:currency_margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10535
- @item_margin = (x = opts.delete(:item_margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10536
- @vat = (x = opts.delete(:vat); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10537
- @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10538
- @shipping = (x = opts.delete(:shipping); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10539
- @rounding = (x = opts.delete(:rounding); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10540
- @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
10541
- end
10542
-
10543
- def to_json
10544
- JSON.dump(to_hash)
10545
- end
10546
-
10547
- def copy(incoming={})
10548
- ItemPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10549
- end
10550
-
10551
- def to_hash
10552
- {
10553
- :base => base.to_hash,
10554
- :local => local.to_hash,
10555
- :currency_margin => currency_margin.to_hash,
10556
- :item_margin => item_margin.to_hash,
10557
- :vat => vat.to_hash,
10558
- :duty => duty.to_hash,
10559
- :shipping => shipping.to_hash,
10560
- :rounding => rounding.to_hash,
10561
- :total => total.to_hash
10562
- }
10563
- end
10564
-
10565
- end
10566
-
10567
10646
  # Statistics covering product catalog item information, including total catalog
10568
10647
  # item count, number of distinct categories, etc.
10569
10648
  class ItemStatistics
@@ -11589,6 +11668,37 @@ module Io
11589
11668
 
11590
11669
  end
11591
11670
 
11671
+ class OrganizationCurrencySettingDeleted < Event
11672
+
11673
+ attr_reader :event_id, :timestamp, :organization_currency_setting_id
11674
+
11675
+ def initialize(incoming={})
11676
+ super(:name => Event::Types::ORGANIZATION_CURRENCY_SETTING_DELETED)
11677
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11678
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization_currency_setting_id], 'OrganizationCurrencySettingDeleted')
11679
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11680
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11681
+ @organization_currency_setting_id = HttpClient::Preconditions.assert_class('organization_currency_setting_id', opts.delete(:organization_currency_setting_id), String)
11682
+ end
11683
+
11684
+ def to_json
11685
+ JSON.dump(to_hash)
11686
+ end
11687
+
11688
+ def copy(incoming={})
11689
+ OrganizationCurrencySettingDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11690
+ end
11691
+
11692
+ def subtype_to_hash
11693
+ {
11694
+ :event_id => event_id,
11695
+ :timestamp => timestamp,
11696
+ :organization_currency_setting_id => organization_currency_setting_id
11697
+ }
11698
+ end
11699
+
11700
+ end
11701
+
11592
11702
  # Represents the parts of an organization setting that can be updated.
11593
11703
  class OrganizationCurrencySettingForm
11594
11704
 
@@ -11620,6 +11730,45 @@ module Io
11620
11730
 
11621
11731
  end
11622
11732
 
11733
+ class OrganizationCurrencySettingUpserted < Event
11734
+
11735
+ attr_reader :event_id, :timestamp, :organization_currency_setting_id, :organization_id, :base, :target, :margin
11736
+
11737
+ def initialize(incoming={})
11738
+ super(:name => Event::Types::ORGANIZATION_CURRENCY_SETTING_UPSERTED)
11739
+ opts = HttpClient::Helper.symbolize_keys(incoming)
11740
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization_currency_setting_id, :organization_id, :base, :target, :margin], 'OrganizationCurrencySettingUpserted')
11741
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
11742
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
11743
+ @organization_currency_setting_id = HttpClient::Preconditions.assert_class('organization_currency_setting_id', opts.delete(:organization_currency_setting_id), String)
11744
+ @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
11745
+ @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
11746
+ @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
11747
+ @margin = HttpClient::Preconditions.assert_class('margin', HttpClient::Helper.to_big_decimal(opts.delete(:margin)), BigDecimal)
11748
+ end
11749
+
11750
+ def to_json
11751
+ JSON.dump(to_hash)
11752
+ end
11753
+
11754
+ def copy(incoming={})
11755
+ OrganizationCurrencySettingUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
11756
+ end
11757
+
11758
+ def subtype_to_hash
11759
+ {
11760
+ :event_id => event_id,
11761
+ :timestamp => timestamp,
11762
+ :organization_currency_setting_id => organization_currency_setting_id,
11763
+ :organization_id => organization_id,
11764
+ :base => base,
11765
+ :target => target,
11766
+ :margin => margin
11767
+ }
11768
+ end
11769
+
11770
+ end
11771
+
11623
11772
  class OrganizationCurrencySettingVersion
11624
11773
 
11625
11774
  attr_reader :id, :timestamp, :type, :organization_currency_setting
@@ -12007,21 +12156,62 @@ module Io
12007
12156
 
12008
12157
  end
12009
12158
 
12159
+ # Detailed information for the pricing of a given item within an experience
12160
+ class PriceDetails
12161
+
12162
+ attr_reader :base, :local, :currency_margin, :margin, :vat, :duty, :rounding, :total
12163
+
12164
+ def initialize(incoming={})
12165
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12166
+ HttpClient::Preconditions.require_keys(opts, [:base, :local, :currency_margin, :margin, :vat, :duty, :rounding, :total], 'PriceDetails')
12167
+ @base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12168
+ @local = (x = opts.delete(:local); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12169
+ @currency_margin = (x = opts.delete(:currency_margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12170
+ @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12171
+ @vat = (x = opts.delete(:vat); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12172
+ @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12173
+ @rounding = (x = opts.delete(:rounding); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12174
+ @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x))
12175
+ end
12176
+
12177
+ def to_json
12178
+ JSON.dump(to_hash)
12179
+ end
12180
+
12181
+ def copy(incoming={})
12182
+ PriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12183
+ end
12184
+
12185
+ def to_hash
12186
+ {
12187
+ :base => base.to_hash,
12188
+ :local => local.to_hash,
12189
+ :currency_margin => currency_margin.to_hash,
12190
+ :margin => margin.to_hash,
12191
+ :vat => vat.to_hash,
12192
+ :duty => duty.to_hash,
12193
+ :rounding => rounding.to_hash,
12194
+ :total => total.to_hash
12195
+ }
12196
+ end
12197
+
12198
+ end
12199
+
12010
12200
  class PriceEquation
12011
12201
 
12012
- attr_reader :base_price, :conversion, :fixed_margin, :percent_margin, :insurance, :freight, :duty, :tax, :rounding
12202
+ attr_reader :base_price, :contracted_rate, :rate, :insurance, :freight, :margins, :duty, :tax, :rounding
12013
12203
 
12014
12204
  def initialize(incoming={})
12015
12205
  opts = HttpClient::Helper.symbolize_keys(incoming)
12016
- HttpClient::Preconditions.require_keys(opts, [:base_price, :conversion, :fixed_margin, :percent_margin, :insurance, :freight, :duty, :tax], 'PriceEquation')
12206
+ HttpClient::Preconditions.require_keys(opts, [:base_price, :contracted_rate, :rate, :insurance, :freight, :margins], 'PriceEquation')
12017
12207
  @base_price = HttpClient::Preconditions.assert_class('base_price', HttpClient::Helper.to_big_decimal(opts.delete(:base_price)), BigDecimal)
12018
- @conversion = (x = opts.delete(:conversion); x.is_a?(::Io::Flow::V0::Models::Conversion) ? x : ::Io::Flow::V0::Models::Conversion.new(x))
12019
- @fixed_margin = (x = opts.delete(:fixed_margin); x.is_a?(::Io::Flow::V0::Models::Margin) ? x : ::Io::Flow::V0::Models::Margin.new(x))
12020
- @percent_margin = (x = opts.delete(:percent_margin); x.is_a?(::Io::Flow::V0::Models::Margin) ? x : ::Io::Flow::V0::Models::Margin.new(x))
12208
+ @contracted_rate = HttpClient::Preconditions.assert_class('contracted_rate', HttpClient::Helper.to_big_decimal(opts.delete(:contracted_rate)), BigDecimal)
12209
+ @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
12021
12210
  @insurance = HttpClient::Preconditions.assert_class('insurance', HttpClient::Helper.to_big_decimal(opts.delete(:insurance)), BigDecimal)
12022
12211
  @freight = HttpClient::Preconditions.assert_class('freight', HttpClient::Helper.to_big_decimal(opts.delete(:freight)), BigDecimal)
12023
- @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Duty) ? x : ::Io::Flow::V0::Models::Duty.new(x))
12024
- @tax = (x = opts.delete(:tax); x.is_a?(::Io::Flow::V0::Models::Tax) ? x : ::Io::Flow::V0::Models::Tax.new(x))
12212
+ @margins = HttpClient::Preconditions.assert_class('margins', opts.delete(:margins), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Margin) ? x : ::Io::Flow::V0::Models::Margin.new(x)) }
12213
+ @duty = (x = opts.delete(:duty); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Duty) ? x : ::Io::Flow::V0::Models::Duty.new(x)))
12214
+ @tax = (x = opts.delete(:tax); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Tax) ? x : ::Io::Flow::V0::Models::Tax.new(x)))
12025
12215
  @rounding = (x = opts.delete(:rounding); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Rounding) ? x : ::Io::Flow::V0::Models::Rounding.new(x)))
12026
12216
  end
12027
12217
 
@@ -12036,13 +12226,13 @@ module Io
12036
12226
  def to_hash
12037
12227
  {
12038
12228
  :base_price => base_price,
12039
- :conversion => conversion.to_hash,
12040
- :fixed_margin => fixed_margin.to_hash,
12041
- :percent_margin => percent_margin.to_hash,
12229
+ :contracted_rate => contracted_rate,
12230
+ :rate => rate,
12042
12231
  :insurance => insurance,
12043
12232
  :freight => freight,
12044
- :duty => duty.to_hash,
12045
- :tax => tax.to_hash,
12233
+ :margins => margins.map { |o| o.to_hash },
12234
+ :duty => duty.nil? ? nil : duty.to_hash,
12235
+ :tax => tax.nil? ? nil : tax.to_hash,
12046
12236
  :rounding => rounding.nil? ? nil : rounding.to_hash
12047
12237
  }
12048
12238
  end
@@ -12333,6 +12523,37 @@ module Io
12333
12523
 
12334
12524
  end
12335
12525
 
12526
+ class RateDeleted < Event
12527
+
12528
+ attr_reader :event_id, :timestamp, :rate_id
12529
+
12530
+ def initialize(incoming={})
12531
+ super(:name => Event::Types::RATE_DELETED)
12532
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12533
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :rate_id], 'RateDeleted')
12534
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
12535
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12536
+ @rate_id = HttpClient::Preconditions.assert_class('rate_id', opts.delete(:rate_id), String)
12537
+ end
12538
+
12539
+ def to_json
12540
+ JSON.dump(to_hash)
12541
+ end
12542
+
12543
+ def copy(incoming={})
12544
+ RateDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12545
+ end
12546
+
12547
+ def subtype_to_hash
12548
+ {
12549
+ :event_id => event_id,
12550
+ :timestamp => timestamp,
12551
+ :rate_id => rate_id
12552
+ }
12553
+ end
12554
+
12555
+ end
12556
+
12336
12557
  # Represents the parts of an organization rate that can be updated.
12337
12558
  class RateForm
12338
12559
 
@@ -12364,6 +12585,47 @@ module Io
12364
12585
 
12365
12586
  end
12366
12587
 
12588
+ class RateUpserted < Event
12589
+
12590
+ attr_reader :event_id, :timestamp, :rate_id, :organization_id, :base, :target, :effective_at, :value
12591
+
12592
+ def initialize(incoming={})
12593
+ super(:name => Event::Types::RATE_UPSERTED)
12594
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12595
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :rate_id, :organization_id, :base, :target, :effective_at, :value], 'RateUpserted')
12596
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
12597
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
12598
+ @rate_id = HttpClient::Preconditions.assert_class('rate_id', opts.delete(:rate_id), String)
12599
+ @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
12600
+ @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
12601
+ @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
12602
+ @effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime)
12603
+ @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
12604
+ end
12605
+
12606
+ def to_json
12607
+ JSON.dump(to_hash)
12608
+ end
12609
+
12610
+ def copy(incoming={})
12611
+ RateUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12612
+ end
12613
+
12614
+ def subtype_to_hash
12615
+ {
12616
+ :event_id => event_id,
12617
+ :timestamp => timestamp,
12618
+ :rate_id => rate_id,
12619
+ :organization_id => organization_id,
12620
+ :base => base,
12621
+ :target => target,
12622
+ :effective_at => effective_at,
12623
+ :value => value
12624
+ }
12625
+ end
12626
+
12627
+ end
12628
+
12367
12629
  class RateVersion
12368
12630
 
12369
12631
  attr_reader :id, :timestamp, :type, :rate
@@ -13580,6 +13842,37 @@ module Io
13580
13842
 
13581
13843
  end
13582
13844
 
13845
+ class SpotRateDeleted < Event
13846
+
13847
+ attr_reader :event_id, :timestamp, :spot_rate_id
13848
+
13849
+ def initialize(incoming={})
13850
+ super(:name => Event::Types::SPOT_RATE_DELETED)
13851
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13852
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :spot_rate_id], 'SpotRateDeleted')
13853
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
13854
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
13855
+ @spot_rate_id = HttpClient::Preconditions.assert_class('spot_rate_id', opts.delete(:spot_rate_id), String)
13856
+ end
13857
+
13858
+ def to_json
13859
+ JSON.dump(to_hash)
13860
+ end
13861
+
13862
+ def copy(incoming={})
13863
+ SpotRateDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13864
+ end
13865
+
13866
+ def subtype_to_hash
13867
+ {
13868
+ :event_id => event_id,
13869
+ :timestamp => timestamp,
13870
+ :spot_rate_id => spot_rate_id
13871
+ }
13872
+ end
13873
+
13874
+ end
13875
+
13583
13876
  class SpotRateForm
13584
13877
 
13585
13878
  attr_reader :effective_at, :base, :target, :value
@@ -13612,6 +13905,45 @@ module Io
13612
13905
 
13613
13906
  end
13614
13907
 
13908
+ class SpotRateUpserted < Event
13909
+
13910
+ attr_reader :event_id, :timestamp, :spot_rate_id, :base, :target, :value, :effective_at
13911
+
13912
+ def initialize(incoming={})
13913
+ super(:name => Event::Types::SPOT_RATE_UPSERTED)
13914
+ opts = HttpClient::Helper.symbolize_keys(incoming)
13915
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :spot_rate_id, :base, :target, :value, :effective_at], 'SpotRateUpserted')
13916
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
13917
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
13918
+ @spot_rate_id = HttpClient::Preconditions.assert_class('spot_rate_id', opts.delete(:spot_rate_id), String)
13919
+ @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
13920
+ @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
13921
+ @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
13922
+ @effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime)
13923
+ end
13924
+
13925
+ def to_json
13926
+ JSON.dump(to_hash)
13927
+ end
13928
+
13929
+ def copy(incoming={})
13930
+ SpotRateUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
13931
+ end
13932
+
13933
+ def subtype_to_hash
13934
+ {
13935
+ :event_id => event_id,
13936
+ :timestamp => timestamp,
13937
+ :spot_rate_id => spot_rate_id,
13938
+ :base => base,
13939
+ :target => target,
13940
+ :value => value,
13941
+ :effective_at => effective_at
13942
+ }
13943
+ end
13944
+
13945
+ end
13946
+
13615
13947
  class SpotRateVersion
13616
13948
 
13617
13949
  attr_reader :id, :timestamp, :type, :spot_rate
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.