flowcommerce 0.0.16 → 0.0.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: d1b54a0158f4db7cbccdd47dffb072e187e110fb
4
- data.tar.gz: a9537d307a6e22a11305f5d7223021b683f3120a
3
+ metadata.gz: 7b2e380bd9da08a891fe2d30c574c5c0d6a2a32c
4
+ data.tar.gz: 67e842f2ef216917cedf6a66194954eed0dddad4
5
5
  SHA512:
6
- metadata.gz: b3eec40129a9f30ba2b49aa789f032cc91cfe40386ac5fb355c8a6bce4eae608312ea17aa2b50dfb33c914d7c09db8c90a68b4a222a2aea02cbbc18a9de6213b
7
- data.tar.gz: 4adcc2ee574bc9053f621bd0c6cb6fc678e3844116cb333dd70d07d9b461c6becac2c2b00b160829e5bebb868f78c320db6bd7281c7c300093ec080e88c86e50
6
+ metadata.gz: 303afc460da1ba5bf71378b7aec219163969e4be7c6769b76209b49b6c361837f43d5e3346b7a6c4be08d34551273d99c6ff2faa38fc301729f84caccc8354e9
7
+ data.tar.gz: 2e312c35847fae585661cc8b210ae1953391a69128beb34ffb7c18fc6aaffbaf767543e23804bdb1125cb349f5894c6fadd588c7d1cc4ed18f40fb2661a61701
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.0.53
3
- # apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.53/ruby_client
2
+ # Service version: 0.0.57
3
+ # apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.57/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.32 http://www.apidoc.me/flow/api/0.0.53/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.0.53' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.32 http://www.apidoc.me/flow/api/0.0.57/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.0.57' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -2100,7 +2100,7 @@ module Io
2100
2100
  HttpClient::Preconditions.assert_class('organization', organization, String)
2101
2101
  HttpClient::Preconditions.assert_class('quote_form', quote_form, ::Io::Flow::V0::Models::QuoteForm)
2102
2102
  r = @client.request("/#{CGI.escape(organization)}/quotes").with_json(quote_form.to_json).post
2103
- r.map { |x| ::Io::Flow::V0::Models::Quote.new(x) }
2103
+ ::Io::Flow::V0::Models::Quote.new(r)
2104
2104
  end
2105
2105
 
2106
2106
  def get_by_id(organization, id)
@@ -3645,52 +3645,6 @@ module Io
3645
3645
 
3646
3646
  end
3647
3647
 
3648
- class AdjustmentType
3649
-
3650
- attr_reader :value
3651
-
3652
- def initialize(value)
3653
- @value = HttpClient::Preconditions.assert_class('value', value, String)
3654
- end
3655
-
3656
- # Returns the instance of AdjustmentType for this value, creating a new instance for an unknown value
3657
- def AdjustmentType.apply(value)
3658
- if value.instance_of?(AdjustmentType)
3659
- value
3660
- else
3661
- HttpClient::Preconditions.assert_class_or_nil('value', value, String)
3662
- value.nil? ? nil : (from_string(value) || AdjustmentType.new(value))
3663
- end
3664
- end
3665
-
3666
- # Returns the instance of AdjustmentType for this value, or nil if not found
3667
- def AdjustmentType.from_string(value)
3668
- HttpClient::Preconditions.assert_class('value', value, String)
3669
- AdjustmentType.ALL.find { |v| v.value == value }
3670
- end
3671
-
3672
- def AdjustmentType.ALL
3673
- @@all ||= [AdjustmentType.fixed_margin, AdjustmentType.percent_margin, AdjustmentType.round]
3674
- end
3675
-
3676
- def AdjustmentType.fixed_margin
3677
- @@_fixed_margin ||= AdjustmentType.new('fixed_margin')
3678
- end
3679
-
3680
- def AdjustmentType.percent_margin
3681
- @@_percent_margin ||= AdjustmentType.new('percent_margin')
3682
- end
3683
-
3684
- def AdjustmentType.round
3685
- @@_round ||= AdjustmentType.new('round')
3686
- end
3687
-
3688
- def to_hash
3689
- value
3690
- end
3691
-
3692
- end
3693
-
3694
3648
  class Calendar
3695
3649
 
3696
3650
  attr_reader :value
@@ -4202,6 +4156,50 @@ module Io
4202
4156
 
4203
4157
  end
4204
4158
 
4159
+ class MarginType
4160
+
4161
+ attr_reader :value
4162
+
4163
+ def initialize(value)
4164
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
4165
+ end
4166
+
4167
+ # Returns the instance of MarginType for this value, creating a new instance for an unknown value
4168
+ def MarginType.apply(value)
4169
+ if value.instance_of?(MarginType)
4170
+ value
4171
+ else
4172
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
4173
+ value.nil? ? nil : (from_string(value) || MarginType.new(value))
4174
+ end
4175
+ end
4176
+
4177
+ # Returns the instance of MarginType for this value, or nil if not found
4178
+ def MarginType.from_string(value)
4179
+ HttpClient::Preconditions.assert_class('value', value, String)
4180
+ MarginType.ALL.find { |v| v.value == value }
4181
+ end
4182
+
4183
+ def MarginType.ALL
4184
+ @@all ||= [MarginType.fixed, MarginType.percent]
4185
+ end
4186
+
4187
+ # A fixed amount to add, e.g $1.25.
4188
+ def MarginType.fixed
4189
+ @@_fixed ||= MarginType.new('fixed')
4190
+ end
4191
+
4192
+ # A percent of the base cost to add, e.g. 0.52 (52%).
4193
+ def MarginType.percent
4194
+ @@_percent ||= MarginType.new('percent')
4195
+ end
4196
+
4197
+ def to_hash
4198
+ value
4199
+ end
4200
+
4201
+ end
4202
+
4205
4203
  class MeasurementSystem
4206
4204
 
4207
4205
  attr_reader :value
@@ -4379,6 +4377,52 @@ module Io
4379
4377
 
4380
4378
  end
4381
4379
 
4380
+ class RoundingType
4381
+
4382
+ attr_reader :value
4383
+
4384
+ def initialize(value)
4385
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
4386
+ end
4387
+
4388
+ # Returns the instance of RoundingType for this value, creating a new instance for an unknown value
4389
+ def RoundingType.apply(value)
4390
+ if value.instance_of?(RoundingType)
4391
+ value
4392
+ else
4393
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
4394
+ value.nil? ? nil : (from_string(value) || RoundingType.new(value))
4395
+ end
4396
+ end
4397
+
4398
+ # Returns the instance of RoundingType for this value, or nil if not found
4399
+ def RoundingType.from_string(value)
4400
+ HttpClient::Preconditions.assert_class('value', value, String)
4401
+ RoundingType.ALL.find { |v| v.value == value }
4402
+ end
4403
+
4404
+ def RoundingType.ALL
4405
+ @@all ||= [RoundingType.pattern, RoundingType.multiple]
4406
+ end
4407
+
4408
+ # Rounds a value to an amount ending with a pattern, e.g. an amount ending in
4409
+ # '.99'.
4410
+ def RoundingType.pattern
4411
+ @@_pattern ||= RoundingType.new('pattern')
4412
+ end
4413
+
4414
+ # Rounds a value to an amount that is the multiple of a value, e.g. rounding to
4415
+ # the nearest 1000.
4416
+ def RoundingType.multiple
4417
+ @@_multiple ||= RoundingType.new('multiple')
4418
+ end
4419
+
4420
+ def to_hash
4421
+ value
4422
+ end
4423
+
4424
+ end
4425
+
4382
4426
  class ScheduleExceptionStatus
4383
4427
 
4384
4428
  attr_reader :value
@@ -5207,7 +5251,7 @@ module Io
5207
5251
  @card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::CardReference) ? x : ::Io::Flow::V0::Models::CardReference.new(x))
5208
5252
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
5209
5253
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
5210
- @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::CustomerForm) ? x : ::Io::Flow::V0::Models::CustomerForm.new(x))
5254
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
5211
5255
  @metadata = HttpClient::Preconditions.assert_class('metadata', opts.delete(:metadata), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('metadata', d[1], String); h }
5212
5256
  @shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
5213
5257
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
@@ -5316,7 +5360,7 @@ module Io
5316
5360
  @token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
5317
5361
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
5318
5362
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
5319
- @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::CustomerForm) ? x : ::Io::Flow::V0::Models::CustomerForm.new(x))
5363
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
5320
5364
  @cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
5321
5365
  @metadata = (x = opts.delete(:metadata); x.nil? ? nil : HttpClient::Preconditions.assert_class('metadata', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('metadata', d[1], String); h })
5322
5366
  @shipping = (x = opts.delete(:shipping); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x)))
@@ -6381,7 +6425,7 @@ module Io
6381
6425
  def initialize(incoming={})
6382
6426
  opts = HttpClient::Helper.symbolize_keys(incoming)
6383
6427
  HttpClient::Preconditions.require_keys(opts, [:adjustments, :levies], 'Component')
6384
- @adjustments = HttpClient::Preconditions.assert_class('adjustments', opts.delete(:adjustments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x)) }
6428
+ @adjustments = HttpClient::Preconditions.assert_class('adjustments', opts.delete(:adjustments), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::MarginType) ? x : ::Io::Flow::V0::Models::MarginType.apply(x)) }
6385
6429
  @levies = HttpClient::Preconditions.assert_class('levies', opts.delete(:levies), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Levy) ? x : ::Io::Flow::V0::Models::Levy.apply(x)) }
6386
6430
  end
6387
6431
 
@@ -6541,51 +6585,11 @@ module Io
6541
6585
  # easieer.
6542
6586
  class Customer
6543
6587
 
6544
- attr_reader :id, :number, :name, :phone, :email
6545
-
6546
- def initialize(incoming={})
6547
- opts = HttpClient::Helper.symbolize_keys(incoming)
6548
- HttpClient::Preconditions.require_keys(opts, [:id, :name], 'Customer')
6549
- @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
6550
- @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
6551
- @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
6552
- @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
6553
- @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String))
6554
- end
6555
-
6556
- def to_json
6557
- JSON.dump(to_hash)
6558
- end
6559
-
6560
- def copy(incoming={})
6561
- Customer.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6562
- end
6563
-
6564
- def to_hash
6565
- {
6566
- :id => id,
6567
- :number => number,
6568
- :name => name.to_hash,
6569
- :phone => phone,
6570
- :email => email
6571
- }
6572
- end
6573
-
6574
- end
6575
-
6576
- # A customer represents the actual person purchasing from you. This information
6577
- # is needed primarily to support logistics (delivery to this person), fraud
6578
- # management (verification of who the person id), and reporting. We also
6579
- # recommend including your customer.number whenever possible as doing so will
6580
- # allow Flow to link up transactions for this customer making customer service
6581
- # easieer.
6582
- class CustomerForm
6583
-
6584
6588
  attr_reader :number, :name, :phone, :email
6585
6589
 
6586
6590
  def initialize(incoming={})
6587
6591
  opts = HttpClient::Helper.symbolize_keys(incoming)
6588
- HttpClient::Preconditions.require_keys(opts, [:name], 'CustomerForm')
6592
+ HttpClient::Preconditions.require_keys(opts, [:name], 'Customer')
6589
6593
  @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
6590
6594
  @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))
6591
6595
  @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String))
@@ -6597,7 +6601,7 @@ module Io
6597
6601
  end
6598
6602
 
6599
6603
  def copy(incoming={})
6600
- CustomerForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6604
+ Customer.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
6601
6605
  end
6602
6606
 
6603
6607
  def to_hash
@@ -9611,7 +9615,7 @@ module Io
9611
9615
  super(:name => Adjustment::Types::MARGIN)
9612
9616
  opts = HttpClient::Helper.symbolize_keys(incoming)
9613
9617
  HttpClient::Preconditions.require_keys(opts, [:name, :value], 'Margin')
9614
- @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x))
9618
+ @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::MarginType) ? x : ::Io::Flow::V0::Models::MarginType.apply(x))
9615
9619
  @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
9616
9620
  end
9617
9621
 
@@ -9878,15 +9882,16 @@ module Io
9878
9882
  # then to book that order in order processing.
9879
9883
  class Order
9880
9884
 
9881
- attr_reader :id, :number, :customer, :expires_at, :deliveries, :prices, :total
9885
+ attr_reader :id, :number, :customer, :expires_at, :destination, :deliveries, :prices, :total
9882
9886
 
9883
9887
  def initialize(incoming={})
9884
9888
  opts = HttpClient::Helper.symbolize_keys(incoming)
9885
- HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :deliveries, :prices, :total], 'Order')
9889
+ HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :destination, :deliveries, :prices, :total], 'Order')
9886
9890
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9887
9891
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9888
9892
  @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
9889
9893
  @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
9894
+ @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x))
9890
9895
  @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)) }
9891
9896
  @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x)) }
9892
9897
  @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x))
@@ -9906,6 +9911,7 @@ module Io
9906
9911
  :number => number,
9907
9912
  :customer => customer.to_hash,
9908
9913
  :expires_at => expires_at,
9914
+ :destination => destination.to_hash,
9909
9915
  :deliveries => deliveries.map { |o| o.to_hash },
9910
9916
  :prices => prices.map { |o| o.to_hash },
9911
9917
  :total => total.to_hash
@@ -9918,14 +9924,14 @@ module Io
9918
9924
  # deleted as they represent transactions in the real world
9919
9925
  class OrderBooking
9920
9926
 
9921
- attr_reader :id, :created_at, :order
9927
+ attr_reader :id, :order, :created_at
9922
9928
 
9923
9929
  def initialize(incoming={})
9924
9930
  opts = HttpClient::Helper.symbolize_keys(incoming)
9925
- HttpClient::Preconditions.require_keys(opts, [:id, :created_at, :order], 'OrderBooking')
9931
+ HttpClient::Preconditions.require_keys(opts, [:id, :order, :created_at], 'OrderBooking')
9926
9932
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
9927
- @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
9928
9933
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
9934
+ @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
9929
9935
  end
9930
9936
 
9931
9937
  def to_json
@@ -9939,8 +9945,8 @@ module Io
9939
9945
  def to_hash
9940
9946
  {
9941
9947
  :id => id,
9942
- :created_at => created_at,
9943
- :order => order.to_hash
9948
+ :order => order.to_hash,
9949
+ :created_at => created_at
9944
9950
  }
9945
9951
  end
9946
9952
 
@@ -9985,7 +9991,7 @@ module Io
9985
9991
  opts = HttpClient::Helper.symbolize_keys(incoming)
9986
9992
  HttpClient::Preconditions.require_keys(opts, [:number, :customer, :destination, :items], 'OrderForm')
9987
9993
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
9988
- @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::CustomerForm) ? x : ::Io::Flow::V0::Models::CustomerForm.new(x))
9994
+ @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
9989
9995
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Location) ? x : ::Io::Flow::V0::Models::Location.new(x))
9990
9996
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Line) ? x : ::Io::Flow::V0::Models::Line.new(x)) }
9991
9997
  end
@@ -10939,7 +10945,7 @@ module Io
10939
10945
  super(:name => Adjustment::Types::ROUNDING)
10940
10946
  opts = HttpClient::Helper.symbolize_keys(incoming)
10941
10947
  HttpClient::Preconditions.require_keys(opts, [:name, :method, :value], 'Rounding')
10942
- @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::AdjustmentType) ? x : ::Io::Flow::V0::Models::AdjustmentType.apply(x))
10948
+ @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::RoundingType) ? x : ::Io::Flow::V0::Models::RoundingType.apply(x))
10943
10949
  @method = (x = opts.delete(:method); x.is_a?(::Io::Flow::V0::Models::RoundingMethod) ? x : ::Io::Flow::V0::Models::RoundingMethod.apply(x))
10944
10950
  @value = HttpClient::Preconditions.assert_class('value', HttpClient::Helper.to_big_decimal(opts.delete(:value)), BigDecimal)
10945
10951
  end
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.0.16
4
+ version: 0.0.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: 2016-07-25 00:00:00.000000000 Z
11
+ date: 2016-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json