flowcommerce 0.1.16 → 0.1.17

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: 095c670a513ef1cb91398a8be4b78178b5934f89
4
- data.tar.gz: e294e2bfcb6d58a75305d634de2f41f8de5b36f7
3
+ metadata.gz: cc2fab61a13044701e486bce3307b40a83b99550
4
+ data.tar.gz: 856b13274aa39b0a24dd23ce8bc4d02dfc7abb94
5
5
  SHA512:
6
- metadata.gz: 38d861aa193287b28186fa34f61cfd81655f92e79fbde1d219c110ceafc7e05670fc1a78b800ff90544cb9eadc313cd078e89ade66a01153df4d6b127bf815a0
7
- data.tar.gz: 48cda4e6c64288c8cf065360fa6015746a5a221cf38e69252ce6f3eccb237f58def6c6dbba43264070b0f65f19fa7f563924c6060fd0fb5f97681fbc1e577418
6
+ metadata.gz: eba49c62ce104a09d5a3b720094974bada2ed93af4475dd91d27d78a292a8e403948acbd1475df1e751f599eef6eebc2f1a761d7f6abf2cebf76e132a59d3e84
7
+ data.tar.gz: 88e995923e3706a9ec6ced16dca8d467f075e7a4d4a0542ed23ec4fa13335dfb1bfa1eb6d1db7a18ccc09b64e84152f10c6ea288c3976ebcaee56bb553cc1acb
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.2.65
3
- # apidoc:0.11.71 http://www.apidoc.me/flow/api/0.2.65/ruby_client
3
+ # apidoc:0.11.72 http://www.apidoc.me/flow/api/0.2.68/ruby_client
4
4
 
5
5
  require 'cgi'
6
6
  require 'net/http'
@@ -25,7 +25,7 @@ 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.71 http://www.apidoc.me/flow/api/0.2.65/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.72 http://www.apidoc.me/flow/api/0.2.68/ruby_client' unless defined?(Constants::USER_AGENT)
29
29
  VERSION = '0.2.65' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
@@ -273,6 +273,10 @@ module Io
273
273
  @languages ||= ::Io::Flow::V0::Clients::Languages.new(self)
274
274
  end
275
275
 
276
+ def locales
277
+ @locales ||= ::Io::Flow::V0::Clients::Locales.new(self)
278
+ end
279
+
276
280
  def regions
277
281
  @regions ||= ::Io::Flow::V0::Clients::Regions.new(self)
278
282
  end
@@ -3286,6 +3290,31 @@ module Io
3286
3290
 
3287
3291
  end
3288
3292
 
3293
+ class Locales
3294
+
3295
+ def initialize(client)
3296
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3297
+ end
3298
+
3299
+ # Returns a list of locales.
3300
+ def get(incoming={})
3301
+ opts = HttpClient::Helper.symbolize_keys(incoming)
3302
+ query = {
3303
+ :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
3304
+ }.delete_if { |k, v| v.nil? }
3305
+ r = @client.request("/reference/locales").with_query(query).get
3306
+ r.map { |x| ::Io::Flow::V0::Models::Locale.new(x) }
3307
+ end
3308
+
3309
+ # Returns the locale with the specifed id.
3310
+ def get_by_id(id)
3311
+ HttpClient::Preconditions.assert_class('id', id, String)
3312
+ r = @client.request("/reference/locales/#{CGI.escape(id)}").get
3313
+ ::Io::Flow::V0::Models::Locale.new(r)
3314
+ end
3315
+
3316
+ end
3317
+
3289
3318
  class Regions
3290
3319
 
3291
3320
  def initialize(client)
@@ -4319,8 +4348,6 @@ module Io
4319
4348
  LABEL_UPSERTED = 'label_upserted' unless defined?(LABEL_UPSERTED)
4320
4349
  NOTIFICATION_UPSERTED = 'notification_upserted' unless defined?(NOTIFICATION_UPSERTED)
4321
4350
  NOTIFICATION_DELETED = 'notification_deleted' unless defined?(NOTIFICATION_DELETED)
4322
- RMA_UPSERTED = 'rma_upserted' unless defined?(RMA_UPSERTED)
4323
- RMA_DELETED = 'rma_deleted' unless defined?(RMA_DELETED)
4324
4351
  LOCALIZED_ITEM_UPSERTED = 'localized_item_upserted' unless defined?(LOCALIZED_ITEM_UPSERTED)
4325
4352
  LOCALIZED_ITEM_DELETED = 'localized_item_deleted' unless defined?(LOCALIZED_ITEM_DELETED)
4326
4353
  LOCALIZED_ITEM_SNAPSHOT = 'localized_item_snapshot' unless defined?(LOCALIZED_ITEM_SNAPSHOT)
@@ -4334,6 +4361,8 @@ module Io
4334
4361
  CARD_UPSERTED = 'card_upserted' unless defined?(CARD_UPSERTED)
4335
4362
  CARD_DELETED = 'card_deleted' unless defined?(CARD_DELETED)
4336
4363
  REFUND_UPSERTED = 'refund_upserted' unless defined?(REFUND_UPSERTED)
4364
+ RETURN_UPSERTED = 'return_upserted' unless defined?(RETURN_UPSERTED)
4365
+ RETURN_DELETED = 'return_deleted' unless defined?(RETURN_DELETED)
4337
4366
  TARGETING_ITEM_UPSERTED = 'targeting_item_upserted' unless defined?(TARGETING_ITEM_UPSERTED)
4338
4367
  TARGETING_ITEM_DELETED = 'targeting_item_deleted' unless defined?(TARGETING_ITEM_DELETED)
4339
4368
  TRACKING_LABEL_EVENT_UPSERTED = 'tracking_label_event_upserted' unless defined?(TRACKING_LABEL_EVENT_UPSERTED)
@@ -4348,7 +4377,7 @@ module Io
4348
4377
  end
4349
4378
 
4350
4379
  def subtype_to_hash
4351
- raise 'Cannot serialize an instance of event directly - must use one of the specific types: catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, rma_upserted, rma_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4380
+ raise 'Cannot serialize an instance of event directly - must use one of the specific types: catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
4352
4381
  end
4353
4382
 
4354
4383
  def to_hash
@@ -4397,8 +4426,6 @@ module Io
4397
4426
  when Types::LABEL_UPSERTED; LabelUpserted.new(hash)
4398
4427
  when Types::NOTIFICATION_UPSERTED; NotificationUpserted.new(hash)
4399
4428
  when Types::NOTIFICATION_DELETED; NotificationDeleted.new(hash)
4400
- when Types::RMA_UPSERTED; RmaUpserted.new(hash)
4401
- when Types::RMA_DELETED; RmaDeleted.new(hash)
4402
4429
  when Types::LOCALIZED_ITEM_UPSERTED; LocalizedItemUpserted.new(hash)
4403
4430
  when Types::LOCALIZED_ITEM_DELETED; LocalizedItemDeleted.new(hash)
4404
4431
  when Types::LOCALIZED_ITEM_SNAPSHOT; LocalizedItemSnapshot.new(hash)
@@ -4412,6 +4439,8 @@ module Io
4412
4439
  when Types::CARD_UPSERTED; CardUpserted.new(hash)
4413
4440
  when Types::CARD_DELETED; CardDeleted.new(hash)
4414
4441
  when Types::REFUND_UPSERTED; RefundUpserted.new(hash)
4442
+ when Types::RETURN_UPSERTED; ReturnUpserted.new(hash)
4443
+ when Types::RETURN_DELETED; ReturnDeleted.new(hash)
4415
4444
  when Types::TARGETING_ITEM_UPSERTED; TargetingItemUpserted.new(hash)
4416
4445
  when Types::TARGETING_ITEM_DELETED; TargetingItemDeleted.new(hash)
4417
4446
  when Types::TRACKING_LABEL_EVENT_UPSERTED; TrackingLabelEventUpserted.new(hash)
@@ -6144,7 +6173,7 @@ module Io
6144
6173
  end
6145
6174
 
6146
6175
  def EventType.ALL
6147
- @@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.rate_deleted, EventType.rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.rma_upserted, EventType.rma_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
6176
+ @@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.rate_deleted, EventType.rate_upserted, EventType.experience_deleted, EventType.experience_upserted, EventType.item_margin_deleted, EventType.item_margin_upserted, EventType.label_format_deleted, EventType.label_format_upserted, EventType.order_deleted, EventType.order_upserted, EventType.order_identifier_deleted, EventType.order_identifier_upserted, EventType.pricing_deleted, EventType.pricing_upserted, EventType.hs6_code_upserted, EventType.hs6_code_deleted, EventType.hs10_code_upserted, EventType.hs10_code_deleted, EventType.item_origin_upserted, EventType.item_origin_deleted, EventType.harmonized_item_upserted, EventType.harmonized_item_deleted, EventType.snapshot_upserted, EventType.snapshot_deleted, EventType.label_upserted, EventType.notification_upserted, EventType.notification_deleted, EventType.localized_item_upserted, EventType.localized_item_deleted, EventType.localized_item_snapshot, EventType.membership_upserted, EventType.membership_deleted, EventType.organization_upserted, EventType.organization_deleted, EventType.authorization_upserted, EventType.authorization_deleted, EventType.capture_upserted, EventType.card_upserted, EventType.card_deleted, EventType.refund_upserted, EventType.return_upserted, EventType.return_deleted, EventType.targeting_item_upserted, EventType.targeting_item_deleted, EventType.tracking_label_event_upserted]
6148
6177
  end
6149
6178
 
6150
6179
  def EventType.catalog_upserted
@@ -6287,14 +6316,6 @@ module Io
6287
6316
  @@_notification_deleted ||= EventType.new('notification_deleted')
6288
6317
  end
6289
6318
 
6290
- def EventType.rma_upserted
6291
- @@_rma_upserted ||= EventType.new('rma_upserted')
6292
- end
6293
-
6294
- def EventType.rma_deleted
6295
- @@_rma_deleted ||= EventType.new('rma_deleted')
6296
- end
6297
-
6298
6319
  def EventType.localized_item_upserted
6299
6320
  @@_localized_item_upserted ||= EventType.new('localized_item_upserted')
6300
6321
  end
@@ -6347,6 +6368,14 @@ module Io
6347
6368
  @@_refund_upserted ||= EventType.new('refund_upserted')
6348
6369
  end
6349
6370
 
6371
+ def EventType.return_upserted
6372
+ @@_return_upserted ||= EventType.new('return_upserted')
6373
+ end
6374
+
6375
+ def EventType.return_deleted
6376
+ @@_return_deleted ||= EventType.new('return_deleted')
6377
+ end
6378
+
6350
6379
  def EventType.targeting_item_upserted
6351
6380
  @@_targeting_item_upserted ||= EventType.new('targeting_item_upserted')
6352
6381
  end
@@ -14773,6 +14802,71 @@ module Io
14773
14802
 
14774
14803
  end
14775
14804
 
14805
+ # Locales defines standard conventions for presentation of content. See
14806
+ # https://api.flow.io/reference/locales
14807
+ class Locale
14808
+
14809
+ attr_reader :id, :name, :country, :language, :numbers
14810
+
14811
+ def initialize(incoming={})
14812
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14813
+ HttpClient::Preconditions.require_keys(opts, [:id, :name, :country, :language, :numbers], 'Locale')
14814
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
14815
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
14816
+ @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
14817
+ @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
14818
+ @numbers = (x = opts.delete(:numbers); x.is_a?(::Io::Flow::V0::Models::LocaleNumbers) ? x : ::Io::Flow::V0::Models::LocaleNumbers.new(x))
14819
+ end
14820
+
14821
+ def to_json
14822
+ JSON.dump(to_hash)
14823
+ end
14824
+
14825
+ def copy(incoming={})
14826
+ Locale.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14827
+ end
14828
+
14829
+ def to_hash
14830
+ {
14831
+ :id => id,
14832
+ :name => name,
14833
+ :country => country,
14834
+ :language => language,
14835
+ :numbers => numbers.to_hash
14836
+ }
14837
+ end
14838
+
14839
+ end
14840
+
14841
+ # Number formats defined for a given locale
14842
+ class LocaleNumbers
14843
+
14844
+ attr_reader :decimal, :group
14845
+
14846
+ def initialize(incoming={})
14847
+ opts = HttpClient::Helper.symbolize_keys(incoming)
14848
+ HttpClient::Preconditions.require_keys(opts, [:decimal, :group], 'LocaleNumbers')
14849
+ @decimal = HttpClient::Preconditions.assert_class('decimal', opts.delete(:decimal), String)
14850
+ @group = HttpClient::Preconditions.assert_class('group', opts.delete(:group), String)
14851
+ end
14852
+
14853
+ def to_json
14854
+ JSON.dump(to_hash)
14855
+ end
14856
+
14857
+ def copy(incoming={})
14858
+ LocaleNumbers.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
14859
+ end
14860
+
14861
+ def to_hash
14862
+ {
14863
+ :decimal => decimal,
14864
+ :group => group
14865
+ }
14866
+ end
14867
+
14868
+ end
14869
+
14776
14870
  class LocalizedAdjustment
14777
14871
 
14778
14872
  attr_reader :currency, :amount, :label, :base, :reason
@@ -15654,17 +15748,17 @@ module Io
15654
15748
  # payment authorization for an order.
15655
15749
  class Order
15656
15750
 
15657
- attr_reader :id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total, :attributes, :submitted_at, :lines, :identifiers
15751
+ attr_reader :id, :number, :customer, :destination, :expires_at, :items, :deliveries, :selections, :prices, :total, :attributes, :submitted_at, :lines, :identifiers
15658
15752
 
15659
15753
  def initialize(incoming={})
15660
15754
  opts = HttpClient::Helper.symbolize_keys(incoming)
15661
- HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total, :attributes], 'Order')
15755
+ HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :destination, :expires_at, :items, :deliveries, :selections, :prices, :total, :attributes], 'Order')
15662
15756
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
15663
15757
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
15664
15758
  @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
15759
+ @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
15665
15760
  @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
15666
15761
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedLineItem) ? x : ::Io::Flow::V0::Models::LocalizedLineItem.new(x)) }
15667
- @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
15668
15762
  @deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Delivery) ? x : ::Io::Flow::V0::Models::Delivery.new(x)) }
15669
15763
  @selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
15670
15764
  @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x)) }
@@ -15688,9 +15782,9 @@ module Io
15688
15782
  :id => id,
15689
15783
  :number => number,
15690
15784
  :customer => customer.to_hash,
15785
+ :destination => destination.to_hash,
15691
15786
  :expires_at => expires_at,
15692
15787
  :items => items.map { |o| o.to_hash },
15693
- :destination => destination.to_hash,
15694
15788
  :deliveries => deliveries.map { |o| o.to_hash },
15695
15789
  :selections => selections,
15696
15790
  :prices => prices.map { |o| o.to_hash },
@@ -15925,15 +16019,15 @@ module Io
15925
16019
  # pricing and delivery options for destination and items/quantities specified
15926
16020
  class OrderForm
15927
16021
 
15928
- attr_reader :number, :customer, :destination, :items, :discount, :attributes
16022
+ attr_reader :customer, :items, :number, :destination, :discount, :attributes
15929
16023
 
15930
16024
  def initialize(incoming={})
15931
16025
  opts = HttpClient::Helper.symbolize_keys(incoming)
15932
- HttpClient::Preconditions.require_keys(opts, [:number, :destination, :items], 'OrderForm')
15933
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
16026
+ HttpClient::Preconditions.require_keys(opts, [:items], 'OrderForm')
15934
16027
  @customer = (x = opts.delete(:customer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)))
15935
- @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
15936
16028
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
16029
+ @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
16030
+ @destination = (x = opts.delete(:destination); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x)))
15937
16031
  @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
15938
16032
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
15939
16033
  end
@@ -15948,10 +16042,10 @@ module Io
15948
16042
 
15949
16043
  def to_hash
15950
16044
  {
15951
- :number => number,
15952
16045
  :customer => customer.nil? ? nil : customer.to_hash,
15953
- :destination => destination.to_hash,
15954
16046
  :items => items.map { |o| o.to_hash },
16047
+ :number => number,
16048
+ :destination => destination.nil? ? nil : destination.to_hash,
15955
16049
  :discount => discount.nil? ? nil : discount.to_hash,
15956
16050
  :attributes => attributes.nil? ? nil : attributes
15957
16051
  }
@@ -16197,15 +16291,15 @@ module Io
16197
16291
  # pricing and delivery options for destination and items/quantities specified.
16198
16292
  class OrderPutForm
16199
16293
 
16200
- attr_reader :destination, :items, :customer, :selections, :discount, :attributes
16294
+ attr_reader :items, :customer, :selections, :destination, :discount, :attributes
16201
16295
 
16202
16296
  def initialize(incoming={})
16203
16297
  opts = HttpClient::Helper.symbolize_keys(incoming)
16204
- HttpClient::Preconditions.require_keys(opts, [:destination, :items], 'OrderPutForm')
16205
- @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
16298
+ HttpClient::Preconditions.require_keys(opts, [:items], 'OrderPutForm')
16206
16299
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }
16207
16300
  @customer = (x = opts.delete(:customer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)))
16208
16301
  @selections = (x = opts.delete(:selections); x.nil? ? nil : HttpClient::Preconditions.assert_class('selections', x, Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) })
16302
+ @destination = (x = opts.delete(:destination); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x)))
16209
16303
  @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
16210
16304
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
16211
16305
  end
@@ -16220,10 +16314,10 @@ module Io
16220
16314
 
16221
16315
  def to_hash
16222
16316
  {
16223
- :destination => destination.to_hash,
16224
16317
  :items => items.map { |o| o.to_hash },
16225
16318
  :customer => customer.nil? ? nil : customer.to_hash,
16226
16319
  :selections => selections.nil? ? nil : selections,
16320
+ :destination => destination.nil? ? nil : destination.to_hash,
16227
16321
  :discount => discount.nil? ? nil : discount.to_hash,
16228
16322
  :attributes => attributes.nil? ? nil : attributes
16229
16323
  }
@@ -18129,7 +18223,7 @@ module Io
18129
18223
 
18130
18224
  class RefundUpserted < Event
18131
18225
 
18132
- attr_reader :event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :captures, :created_at
18226
+ attr_reader :event_id, :timestamp, :organization, :key, :authorization_key, :amount, :currency, :captures, :created_at, :order_number, :rma_key
18133
18227
 
18134
18228
  def initialize(incoming={})
18135
18229
  super(:discriminator => Event::Types::REFUND_UPSERTED)
@@ -18144,6 +18238,8 @@ module Io
18144
18238
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
18145
18239
  @captures = HttpClient::Preconditions.assert_class('captures', opts.delete(:captures), Array).map { |v| HttpClient::Preconditions.assert_class('captures', HttpClient::Helper.to_object(v), Hash) }
18146
18240
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
18241
+ @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
18242
+ @rma_key = (x = opts.delete(:rma_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('rma_key', x, String))
18147
18243
  end
18148
18244
 
18149
18245
  def to_json
@@ -18164,7 +18260,9 @@ module Io
18164
18260
  :amount => amount,
18165
18261
  :currency => currency,
18166
18262
  :captures => captures,
18167
- :created_at => created_at
18263
+ :created_at => created_at,
18264
+ :order_number => order_number,
18265
+ :rma_key => rma_key
18168
18266
  }
18169
18267
  end
18170
18268
 
@@ -18301,6 +18399,37 @@ module Io
18301
18399
 
18302
18400
  end
18303
18401
 
18402
+ class ReturnDeleted < Event
18403
+
18404
+ attr_reader :event_id, :timestamp, :id
18405
+
18406
+ def initialize(incoming={})
18407
+ super(:discriminator => Event::Types::RETURN_DELETED)
18408
+ opts = HttpClient::Helper.symbolize_keys(incoming)
18409
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id], 'ReturnDeleted')
18410
+ @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
18411
+ @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
18412
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18413
+ end
18414
+
18415
+ def to_json
18416
+ JSON.dump(to_hash)
18417
+ end
18418
+
18419
+ def copy(incoming={})
18420
+ ReturnDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18421
+ end
18422
+
18423
+ def subtype_to_hash
18424
+ {
18425
+ :event_id => event_id,
18426
+ :timestamp => timestamp,
18427
+ :id => id
18428
+ }
18429
+ end
18430
+
18431
+ end
18432
+
18304
18433
  class ReturnForm
18305
18434
 
18306
18435
  attr_reader :items, :service, :destination, :key, :origin
@@ -18501,51 +18630,24 @@ module Io
18501
18630
 
18502
18631
  end
18503
18632
 
18504
- class ReturnVersion
18633
+ class ReturnUpserted < Event
18505
18634
 
18506
- attr_reader :id, :timestamp, :type, :return_
18635
+ attr_reader :event_id, :timestamp, :id, :organization, :destination, :items, :key, :labels, :service, :origin
18507
18636
 
18508
18637
  def initialize(incoming={})
18638
+ super(:discriminator => Event::Types::RETURN_UPSERTED)
18509
18639
  opts = HttpClient::Helper.symbolize_keys(incoming)
18510
- HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :return_], 'ReturnVersion')
18511
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18512
- @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
18513
- @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
18514
- @return_ = (x = opts.delete(:return); x.is_a?(::Io::Flow::V0::Models::Return) ? x : ::Io::Flow::V0::Models::Return.new(x))
18515
- end
18516
-
18517
- def to_json
18518
- JSON.dump(to_hash)
18519
- end
18520
-
18521
- def copy(incoming={})
18522
- ReturnVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18523
- end
18524
-
18525
- def to_hash
18526
- {
18527
- :id => id,
18528
- :timestamp => timestamp,
18529
- :type => type.value,
18530
- :return => return_.to_hash
18531
- }
18532
- end
18533
-
18534
- end
18535
-
18536
- class RmaDeleted < Event
18537
-
18538
- attr_reader :event_id, :timestamp, :organization, :number, :rma_id
18539
-
18540
- def initialize(incoming={})
18541
- super(:discriminator => Event::Types::RMA_DELETED)
18542
- opts = HttpClient::Helper.symbolize_keys(incoming)
18543
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :rma_id], 'RmaDeleted')
18640
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :organization, :destination, :items, :key, :labels, :service, :origin], 'ReturnUpserted')
18544
18641
  @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
18545
18642
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
18643
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18546
18644
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
18547
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
18548
- @rma_id = HttpClient::Preconditions.assert_class('rma_id', opts.delete(:rma_id), String)
18645
+ @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
18646
+ @items = HttpClient::Preconditions.assert_class('items', HttpClient::Helper.to_object(opts.delete(:items)), Hash)
18647
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
18648
+ @labels = HttpClient::Preconditions.assert_class('labels', HttpClient::Helper.to_object(opts.delete(:labels)), Hash)
18649
+ @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
18650
+ @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
18549
18651
  end
18550
18652
 
18551
18653
  def to_json
@@ -18553,45 +18655,37 @@ module Io
18553
18655
  end
18554
18656
 
18555
18657
  def copy(incoming={})
18556
- RmaDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18658
+ ReturnUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18557
18659
  end
18558
18660
 
18559
18661
  def subtype_to_hash
18560
18662
  {
18561
18663
  :event_id => event_id,
18562
18664
  :timestamp => timestamp,
18665
+ :id => id,
18563
18666
  :organization => organization,
18564
- :number => number,
18565
- :rma_id => rma_id
18667
+ :destination => destination,
18668
+ :items => items,
18669
+ :key => key,
18670
+ :labels => labels,
18671
+ :service => service,
18672
+ :origin => origin
18566
18673
  }
18567
18674
  end
18568
18675
 
18569
18676
  end
18570
18677
 
18571
- class RmaUpserted < Event
18678
+ class ReturnVersion
18572
18679
 
18573
- attr_reader :event_id, :timestamp, :organization, :number, :rma_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :destination, :origin, :order_number, :service, :zpl, :pdf, :png, :created_at
18680
+ attr_reader :id, :timestamp, :type, :return_
18574
18681
 
18575
18682
  def initialize(incoming={})
18576
- super(:discriminator => Event::Types::RMA_UPSERTED)
18577
18683
  opts = HttpClient::Helper.symbolize_keys(incoming)
18578
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :rma_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :destination, :origin, :order_number, :service, :created_at], 'RmaUpserted')
18579
- @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
18684
+ HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :return_], 'ReturnVersion')
18685
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18580
18686
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
18581
- @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
18582
- @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
18583
- @rma_id = HttpClient::Preconditions.assert_class('rma_id', opts.delete(:rma_id), String)
18584
- @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
18585
- @commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String)
18586
- @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
18587
- @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
18588
- @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
18589
- @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
18590
- @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
18591
- @zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', x, String))
18592
- @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String))
18593
- @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String))
18594
- @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
18687
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
18688
+ @return_ = (x = opts.delete(:return); x.is_a?(::Io::Flow::V0::Models::Return) ? x : ::Io::Flow::V0::Models::Return.new(x))
18595
18689
  end
18596
18690
 
18597
18691
  def to_json
@@ -18599,27 +18693,15 @@ module Io
18599
18693
  end
18600
18694
 
18601
18695
  def copy(incoming={})
18602
- RmaUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18696
+ ReturnVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18603
18697
  end
18604
18698
 
18605
- def subtype_to_hash
18699
+ def to_hash
18606
18700
  {
18607
- :event_id => event_id,
18701
+ :id => id,
18608
18702
  :timestamp => timestamp,
18609
- :organization => organization,
18610
- :number => number,
18611
- :rma_id => rma_id,
18612
- :carrier_tracking_number => carrier_tracking_number,
18613
- :commercial_invoice => commercial_invoice,
18614
- :flow_tracking_number => flow_tracking_number,
18615
- :destination => destination,
18616
- :origin => origin,
18617
- :order_number => order_number,
18618
- :service => service,
18619
- :zpl => zpl,
18620
- :pdf => pdf,
18621
- :png => png,
18622
- :created_at => created_at
18703
+ :type => type.value,
18704
+ :return => return_.to_hash
18623
18705
  }
18624
18706
  end
18625
18707
 
@@ -19232,16 +19314,16 @@ module Io
19232
19314
 
19233
19315
  class SnapshotUpserted < Event
19234
19316
 
19235
- attr_reader :event_id, :timestamp, :snapshot_id, :organization, :available, :center_key, :item_number, :quantity
19317
+ attr_reader :event_id, :timestamp, :organization, :snapshot_id, :available, :center_key, :item_number, :quantity
19236
19318
 
19237
19319
  def initialize(incoming={})
19238
19320
  super(:discriminator => Event::Types::SNAPSHOT_UPSERTED)
19239
19321
  opts = HttpClient::Helper.symbolize_keys(incoming)
19240
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :snapshot_id, :organization, :available, :center_key, :item_number, :quantity], 'SnapshotUpserted')
19322
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :snapshot_id, :available, :center_key, :item_number, :quantity], 'SnapshotUpserted')
19241
19323
  @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19242
19324
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19243
- @snapshot_id = HttpClient::Preconditions.assert_class('snapshot_id', opts.delete(:snapshot_id), String)
19244
19325
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
19326
+ @snapshot_id = HttpClient::Preconditions.assert_class('snapshot_id', opts.delete(:snapshot_id), String)
19245
19327
  @available = HttpClient::Preconditions.assert_class('available', opts.delete(:available), Integer)
19246
19328
  @center_key = HttpClient::Preconditions.assert_class('center_key', opts.delete(:center_key), String)
19247
19329
  @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
@@ -19260,8 +19342,8 @@ module Io
19260
19342
  {
19261
19343
  :event_id => event_id,
19262
19344
  :timestamp => timestamp,
19263
- :snapshot_id => snapshot_id,
19264
19345
  :organization => organization,
19346
+ :snapshot_id => snapshot_id,
19265
19347
  :available => available,
19266
19348
  :center_key => center_key,
19267
19349
  :item_number => item_number,
@@ -19967,16 +20049,16 @@ module Io
19967
20049
  # outcome. The item number is unique within its targeting_id.
19968
20050
  class TargetingItemUpserted < Event
19969
20051
 
19970
- attr_reader :event_id, :timestamp, :id, :organization, :targeting_id, :item_number, :q, :outcome_id, :catalog_id, :key, :subcatalog_id
20052
+ attr_reader :event_id, :timestamp, :organization, :id, :targeting_id, :item_number, :q, :outcome_id, :catalog_id, :key, :subcatalog_id
19971
20053
 
19972
20054
  def initialize(incoming={})
19973
20055
  super(:discriminator => Event::Types::TARGETING_ITEM_UPSERTED)
19974
20056
  opts = HttpClient::Helper.symbolize_keys(incoming)
19975
- HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :organization, :targeting_id, :item_number, :q, :outcome_id, :catalog_id, :key], 'TargetingItemUpserted')
20057
+ HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :targeting_id, :item_number, :q, :outcome_id, :catalog_id, :key], 'TargetingItemUpserted')
19976
20058
  @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
19977
20059
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
19978
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
19979
20060
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
20061
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
19980
20062
  @targeting_id = HttpClient::Preconditions.assert_class('targeting_id', opts.delete(:targeting_id), String)
19981
20063
  @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
19982
20064
  @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
@@ -19998,8 +20080,8 @@ module Io
19998
20080
  {
19999
20081
  :event_id => event_id,
20000
20082
  :timestamp => timestamp,
20001
- :id => id,
20002
20083
  :organization => organization,
20084
+ :id => id,
20003
20085
  :targeting_id => targeting_id,
20004
20086
  :item_number => item_number,
20005
20087
  :q => q,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flow Commerce, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2017-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json