flowcommerce 0.2.0 → 0.2.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: 845cd263bc5d636b7e0e929fc573c4c8811b4ab5
4
- data.tar.gz: 553882564ebe6fc3b7ee82a26452a0c42828fa6a
3
+ metadata.gz: 4b7bc4c483585d96f422328ead6507f6dafa0ac3
4
+ data.tar.gz: c4d637b12053e3bd6ed1eb897db4a8b1672fe948
5
5
  SHA512:
6
- metadata.gz: b20de21df8e080d45719424dd77c05452b454b7906232de9ec062a7b96929004d1ba0d707dd1c8c5c7f6338395996cee195da6f328d6dad77f128a9bb8c43368
7
- data.tar.gz: 83a2e8ecb6f9bfa6217b33ba1a97a4e73ecc963b34690d11c07d86d880117d4157581b1212545cba19c39d74b1ce8a78ffd7327b7703d4c24a372e04fb34c6a0
6
+ metadata.gz: 0e676ade655fea50e288c34b68db43ce519fe617074221d43ca1f0d38abb4a727a1b83370c0f5be5a931a4f612e729ea644c4cd3be323fe7240fda7b094f62f1
7
+ data.tar.gz: a7faf116aa799ddc718a0fd7847669065aced7696d480607010c070c6541352a26c9553d87f2d1cca7f9de7d81a86623c8ea11ff352db7a4288b9f8a9adaf20b
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.2.79
3
- # apidoc:0.11.75 http://www.apidoc.me/flow/api/0.2.80/ruby_client
2
+ # Service version: 0.2.82
3
+ # apidoc:0.11.75 http://www.apidoc.me/flow/api/0.2.83/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.75 http://www.apidoc.me/flow/api/0.2.80/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.2.79' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.75 http://www.apidoc.me/flow/api/0.2.83/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.2.82' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -6479,7 +6479,7 @@ module Io
6479
6479
  end
6480
6480
 
6481
6481
  def DeliveredDuty.ALL
6482
- @@all ||= [DeliveredDuty.paid, DeliveredDuty.unpaid, DeliveredDuty.choice]
6482
+ @@all ||= [DeliveredDuty.paid, DeliveredDuty.unpaid]
6483
6483
  end
6484
6484
 
6485
6485
  # Delivered Duty Paid (DDP). See https://en.wikipedia.org/wiki/Incoterms for
@@ -6494,11 +6494,6 @@ module Io
6494
6494
  @@_unpaid ||= DeliveredDuty.new('unpaid')
6495
6495
  end
6496
6496
 
6497
- # Allow the customer to choose whether they would like DDP or DDU
6498
- def DeliveredDuty.choice
6499
- @@_choice ||= DeliveredDuty.new('choice')
6500
- end
6501
-
6502
6497
  def to_hash
6503
6498
  value
6504
6499
  end
@@ -7681,6 +7676,57 @@ module Io
7681
7676
 
7682
7677
  end
7683
7678
 
7679
+ class PaymentMethodType
7680
+
7681
+ attr_reader :value
7682
+
7683
+ def initialize(value)
7684
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
7685
+ end
7686
+
7687
+ # Returns the instance of PaymentMethodType for this value, creating a new instance for an unknown value
7688
+ def PaymentMethodType.apply(value)
7689
+ if value.instance_of?(PaymentMethodType)
7690
+ value
7691
+ else
7692
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
7693
+ value.nil? ? nil : (from_string(value) || PaymentMethodType.new(value))
7694
+ end
7695
+ end
7696
+
7697
+ # Returns the instance of PaymentMethodType for this value, or nil if not found
7698
+ def PaymentMethodType.from_string(value)
7699
+ HttpClient::Preconditions.assert_class('value', value, String)
7700
+ PaymentMethodType.ALL.find { |v| v.value == value }
7701
+ end
7702
+
7703
+ def PaymentMethodType.ALL
7704
+ @@all ||= [PaymentMethodType.card, PaymentMethodType.online, PaymentMethodType.offline]
7705
+ end
7706
+
7707
+ # Represents all form of card payment (e.g. credit, debit, etc.)
7708
+ def PaymentMethodType.card
7709
+ @@_card ||= PaymentMethodType.new('card')
7710
+ end
7711
+
7712
+ # Represents the most common form of alternative payment methods which require
7713
+ # some degree of integration online (e.g. a redirect) to complete payment.
7714
+ def PaymentMethodType.online
7715
+ @@_online ||= PaymentMethodType.new('online')
7716
+ end
7717
+
7718
+ # Offline payment method types represent payments like Cash On Delivery which
7719
+ # require offline collection
7720
+ def PaymentMethodType.offline
7721
+ @@_offline ||= PaymentMethodType.new('offline')
7722
+ end
7723
+
7724
+ def to_hash
7725
+ value
7726
+ end
7727
+
7728
+ end
7729
+
7684
7730
  class PriceDetailComponentKey
7685
7731
 
7686
7732
  attr_reader :value
@@ -11234,7 +11280,7 @@ module Io
11234
11280
  # upper case ISO code. See https://api.flow.io/reference/countries
11235
11281
  class Country
11236
11282
 
11237
- attr_reader :name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system, :default_currency, :timezones
11283
+ attr_reader :name, :iso_3166_2, :iso_3166_3, :languages, :measurement_system, :default_currency, :timezones, :default_delivered_duty
11238
11284
 
11239
11285
  def initialize(incoming={})
11240
11286
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -11246,6 +11292,7 @@ module Io
11246
11292
  @measurement_system = HttpClient::Preconditions.assert_class('measurement_system', opts.delete(:measurement_system), String)
11247
11293
  @default_currency = (x = opts.delete(:default_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_currency', x, String))
11248
11294
  @timezones = HttpClient::Preconditions.assert_class('timezones', opts.delete(:timezones), Array).map { |v| HttpClient::Preconditions.assert_class('timezones', v, String) }
11295
+ @default_delivered_duty = (x = opts.delete(:default_delivered_duty); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_delivered_duty', x, String))
11249
11296
  end
11250
11297
 
11251
11298
  def to_json
@@ -11264,7 +11311,8 @@ module Io
11264
11311
  :languages => languages,
11265
11312
  :measurement_system => measurement_system,
11266
11313
  :default_currency => default_currency,
11267
- :timezones => timezones
11314
+ :timezones => timezones,
11315
+ :default_delivered_duty => default_delivered_duty
11268
11316
  }
11269
11317
  end
11270
11318
 
@@ -12274,6 +12322,32 @@ module Io
12274
12322
 
12275
12323
  end
12276
12324
 
12325
+ class ExperienceKeyReference
12326
+
12327
+ attr_reader :key
12328
+
12329
+ def initialize(incoming={})
12330
+ opts = HttpClient::Helper.symbolize_keys(incoming)
12331
+ HttpClient::Preconditions.require_keys(opts, [:key], 'ExperienceKeyReference')
12332
+ @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
12333
+ end
12334
+
12335
+ def to_json
12336
+ JSON.dump(to_hash)
12337
+ end
12338
+
12339
+ def copy(incoming={})
12340
+ ExperienceKeyReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
12341
+ end
12342
+
12343
+ def to_hash
12344
+ {
12345
+ :key => key
12346
+ }
12347
+ end
12348
+
12349
+ end
12350
+
12277
12351
  class ExperienceReference
12278
12352
 
12279
12353
  attr_reader :id
@@ -14995,7 +15069,7 @@ module Io
14995
15069
 
14996
15070
  class ItemMarginUpserted < Event
14997
15071
 
14998
- attr_reader :event_id, :timestamp, :item_margin_id, :organization_id, :experience_key, :name, :q, :fixed, :percent, :position
15072
+ attr_reader :event_id, :timestamp, :item_margin_id, :organization_id, :experience_key, :name, :q, :fixed, :percent, :position, :key
14999
15073
 
15000
15074
  def initialize(incoming={})
15001
15075
  super(:discriminator => Event::Types::ITEM_MARGIN_UPSERTED)
@@ -15011,6 +15085,7 @@ module Io
15011
15085
  @fixed = HttpClient::Preconditions.assert_class('fixed', HttpClient::Helper.to_big_decimal(opts.delete(:fixed)), BigDecimal)
15012
15086
  @percent = HttpClient::Preconditions.assert_class('percent', HttpClient::Helper.to_big_decimal(opts.delete(:percent)), BigDecimal)
15013
15087
  @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
15088
+ @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
15014
15089
  end
15015
15090
 
15016
15091
  def to_json
@@ -15032,7 +15107,8 @@ module Io
15032
15107
  :q => q,
15033
15108
  :fixed => fixed,
15034
15109
  :percent => percent,
15035
- :position => position
15110
+ :position => position,
15111
+ :key => key
15036
15112
  }
15037
15113
  end
15038
15114
 
@@ -15604,7 +15680,7 @@ module Io
15604
15680
  @country = (x = opts.delete(:country); x.is_a?(::Io::Flow::V0::Models::Country) ? x : ::Io::Flow::V0::Models::Country.new(x))
15605
15681
  @currency = (x = opts.delete(:currency); x.is_a?(::Io::Flow::V0::Models::Currency) ? x : ::Io::Flow::V0::Models::Currency.new(x))
15606
15682
  @language = (x = opts.delete(:language); x.is_a?(::Io::Flow::V0::Models::Language) ? x : ::Io::Flow::V0::Models::Language.new(x))
15607
- @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::SessionExperienceReference) ? x : ::Io::Flow::V0::Models::SessionExperienceReference.new(x))
15683
+ @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceKeyReference) ? x : ::Io::Flow::V0::Models::ExperienceKeyReference.new(x))
15608
15684
  end
15609
15685
 
15610
15686
  def to_json
@@ -18103,6 +18179,102 @@ module Io
18103
18179
 
18104
18180
  end
18105
18181
 
18182
+ # Represents a single payment method - e.g VISA or Paypal - and any associated
18183
+ # metadata required for processing
18184
+ class PaymentMethod
18185
+
18186
+ attr_reader :id, :type, :name, :images, :regions
18187
+
18188
+ def initialize(incoming={})
18189
+ opts = HttpClient::Helper.symbolize_keys(incoming)
18190
+ HttpClient::Preconditions.require_keys(opts, [:id, :type, :name, :images, :regions], 'PaymentMethod')
18191
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
18192
+ @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::PaymentMethodType) ? x : ::Io::Flow::V0::Models::PaymentMethodType.apply(x))
18193
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
18194
+ @images = (x = opts.delete(:images); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImages) ? x : ::Io::Flow::V0::Models::PaymentMethodImages.new(x))
18195
+ @regions = HttpClient::Preconditions.assert_class('regions', opts.delete(:regions), Array).map { |v| HttpClient::Preconditions.assert_class('regions', v, String) }
18196
+ end
18197
+
18198
+ def to_json
18199
+ JSON.dump(to_hash)
18200
+ end
18201
+
18202
+ def copy(incoming={})
18203
+ PaymentMethod.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18204
+ end
18205
+
18206
+ def to_hash
18207
+ {
18208
+ :id => id,
18209
+ :type => type.value,
18210
+ :name => name,
18211
+ :images => images.to_hash,
18212
+ :regions => regions
18213
+ }
18214
+ end
18215
+
18216
+ end
18217
+
18218
+ class PaymentMethodImage
18219
+
18220
+ attr_reader :url, :width, :height
18221
+
18222
+ def initialize(incoming={})
18223
+ opts = HttpClient::Helper.symbolize_keys(incoming)
18224
+ HttpClient::Preconditions.require_keys(opts, [:url, :width, :height], 'PaymentMethodImage')
18225
+ @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
18226
+ @width = HttpClient::Preconditions.assert_class('width', opts.delete(:width), Integer)
18227
+ @height = HttpClient::Preconditions.assert_class('height', opts.delete(:height), Integer)
18228
+ end
18229
+
18230
+ def to_json
18231
+ JSON.dump(to_hash)
18232
+ end
18233
+
18234
+ def copy(incoming={})
18235
+ PaymentMethodImage.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18236
+ end
18237
+
18238
+ def to_hash
18239
+ {
18240
+ :url => url,
18241
+ :width => width,
18242
+ :height => height
18243
+ }
18244
+ end
18245
+
18246
+ end
18247
+
18248
+ class PaymentMethodImages
18249
+
18250
+ attr_reader :small, :medium, :large
18251
+
18252
+ def initialize(incoming={})
18253
+ opts = HttpClient::Helper.symbolize_keys(incoming)
18254
+ HttpClient::Preconditions.require_keys(opts, [:small, :medium, :large], 'PaymentMethodImages')
18255
+ @small = (x = opts.delete(:small); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImage) ? x : ::Io::Flow::V0::Models::PaymentMethodImage.new(x))
18256
+ @medium = (x = opts.delete(:medium); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImage) ? x : ::Io::Flow::V0::Models::PaymentMethodImage.new(x))
18257
+ @large = (x = opts.delete(:large); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImage) ? x : ::Io::Flow::V0::Models::PaymentMethodImage.new(x))
18258
+ end
18259
+
18260
+ def to_json
18261
+ JSON.dump(to_hash)
18262
+ end
18263
+
18264
+ def copy(incoming={})
18265
+ PaymentMethodImages.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
18266
+ end
18267
+
18268
+ def to_hash
18269
+ {
18270
+ :small => small.to_hash,
18271
+ :medium => medium.to_hash,
18272
+ :large => large.to_hash
18273
+ }
18274
+ end
18275
+
18276
+ end
18277
+
18106
18278
  # Rule outcome where shipping surfaced in quote is actual cost plus a predefined
18107
18279
  # margin percentage
18108
18280
  class PercentMargin < TierRuleOutcome
@@ -18554,8 +18726,9 @@ module Io
18554
18726
 
18555
18727
  def initialize(incoming={})
18556
18728
  opts = HttpClient::Helper.symbolize_keys(incoming)
18557
- @applied = (x = opts.delete(:applied); x.nil? ? nil : HttpClient::Preconditions.assert_class('applied', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AppliedPromotion) ? x : ::Io::Flow::V0::Models::AppliedPromotion.new(x)) })
18558
- @available = (x = opts.delete(:available); x.nil? ? nil : HttpClient::Preconditions.assert_class('available', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailablePromotion) ? x : ::Io::Flow::V0::Models::AvailablePromotion.from_json(x)) })
18729
+ HttpClient::Preconditions.require_keys(opts, [:applied, :available], 'Promotions')
18730
+ @applied = HttpClient::Preconditions.assert_class('applied', opts.delete(:applied), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AppliedPromotion) ? x : ::Io::Flow::V0::Models::AppliedPromotion.new(x)) }
18731
+ @available = HttpClient::Preconditions.assert_class('available', opts.delete(:available), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailablePromotion) ? x : ::Io::Flow::V0::Models::AvailablePromotion.from_json(x)) }
18559
18732
  end
18560
18733
 
18561
18734
  def to_json
@@ -18568,8 +18741,8 @@ module Io
18568
18741
 
18569
18742
  def to_hash
18570
18743
  {
18571
- :applied => applied.nil? ? nil : applied.map { |o| o.to_hash },
18572
- :available => available.nil? ? nil : available.map { |o| o.to_hash }
18744
+ :applied => applied.map { |o| o.to_hash },
18745
+ :available => available.map { |o| o.to_hash }
18573
18746
  }
18574
18747
  end
18575
18748
 
@@ -19973,32 +20146,6 @@ module Io
19973
20146
 
19974
20147
  end
19975
20148
 
19976
- class SessionExperienceReference
19977
-
19978
- attr_reader :key
19979
-
19980
- def initialize(incoming={})
19981
- opts = HttpClient::Helper.symbolize_keys(incoming)
19982
- HttpClient::Preconditions.require_keys(opts, [:key], 'SessionExperienceReference')
19983
- @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
19984
- end
19985
-
19986
- def to_json
19987
- JSON.dump(to_hash)
19988
- end
19989
-
19990
- def copy(incoming={})
19991
- SessionExperienceReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
19992
- end
19993
-
19994
- def to_hash
19995
- {
19996
- :key => key
19997
- }
19998
- end
19999
-
20000
- end
20001
-
20002
20149
  class SessionForm
20003
20150
 
20004
20151
  attr_reader :ip, :experience, :country, :currency, :language
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.2.0
4
+ version: 0.2.1
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-03-20 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json