flowcommerce 0.0.58 → 0.0.59
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +67 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3794f05e0d2473671a65820cc28f49afd591ad42
|
4
|
+
data.tar.gz: 06918bbfe15e9803c8f47c722e8fa6fc7c84374b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa155675177ca6a535eada634e693874c41799957dc2b8c7e9f853c1e7f80b2b0ac58771776c1a97023232ac002118d4bf9825e4fcd9e9c83dfdf2a619740ec5
|
7
|
+
data.tar.gz: d13e65efa455ac8f64376b8d5b82846b7bee17257b222f3174c2c8eb1ab9b3f3f3ceb4bf68ca047ee2028848c6d52bb58d02005311f2cff84d8d59ea7fd5d4a0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
|
-
# Service version: 0.1.
|
3
|
-
# apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.
|
2
|
+
# Service version: 0.1.59
|
3
|
+
# apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.58/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.37 http://www.apidoc.me/flow/api/0.1.
|
29
|
-
VERSION = '0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.37 http://www.apidoc.me/flow/api/0.1.58/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
|
+
VERSION = '0.1.59' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
32
32
|
end
|
@@ -11998,15 +11998,16 @@ module Io
|
|
11998
11998
|
# line items as you like - including repeating item numbers across line items.
|
11999
11999
|
class LineItem
|
12000
12000
|
|
12001
|
-
attr_reader :number, :quantity, :
|
12001
|
+
attr_reader :number, :quantity, :price, :attributes, :center, :discount
|
12002
12002
|
|
12003
12003
|
def initialize(incoming={})
|
12004
12004
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12005
|
-
HttpClient::Preconditions.require_keys(opts, [:number, :quantity], 'LineItem')
|
12005
|
+
HttpClient::Preconditions.require_keys(opts, [:number, :quantity, :price, :attributes], 'LineItem')
|
12006
12006
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
12007
12007
|
@quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
|
12008
|
+
@price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
|
12009
|
+
@attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
|
12008
12010
|
@center = (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, String))
|
12009
|
-
@price = (x = opts.delete(:price); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
|
12010
12011
|
@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)))
|
12011
12012
|
end
|
12012
12013
|
|
@@ -12022,8 +12023,48 @@ module Io
|
|
12022
12023
|
{
|
12023
12024
|
:number => number,
|
12024
12025
|
:quantity => quantity,
|
12026
|
+
:price => price.to_hash,
|
12027
|
+
:attributes => attributes,
|
12025
12028
|
:center => center,
|
12029
|
+
:discount => discount.nil? ? nil : discount.to_hash
|
12030
|
+
}
|
12031
|
+
end
|
12032
|
+
|
12033
|
+
end
|
12034
|
+
|
12035
|
+
# Line items represent the items a consumer is purchasing, including additional
|
12036
|
+
# information to complete the transaction. Note that you may pass in as many
|
12037
|
+
# line items as you like - including repeating item numbers across line items.
|
12038
|
+
class LineItemForm
|
12039
|
+
|
12040
|
+
attr_reader :number, :quantity, :price, :attributes, :center, :discount
|
12041
|
+
|
12042
|
+
def initialize(incoming={})
|
12043
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12044
|
+
HttpClient::Preconditions.require_keys(opts, [:number, :quantity], 'LineItemForm')
|
12045
|
+
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
12046
|
+
@quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
|
12047
|
+
@price = (x = opts.delete(:price); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
|
12048
|
+
@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 })
|
12049
|
+
@center = (x = opts.delete(:center); x.nil? ? nil : HttpClient::Preconditions.assert_class('center', x, String))
|
12050
|
+
@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)))
|
12051
|
+
end
|
12052
|
+
|
12053
|
+
def to_json
|
12054
|
+
JSON.dump(to_hash)
|
12055
|
+
end
|
12056
|
+
|
12057
|
+
def copy(incoming={})
|
12058
|
+
LineItemForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
12059
|
+
end
|
12060
|
+
|
12061
|
+
def to_hash
|
12062
|
+
{
|
12063
|
+
:number => number,
|
12064
|
+
:quantity => quantity,
|
12026
12065
|
:price => price.nil? ? nil : price.to_hash,
|
12066
|
+
:attributes => attributes.nil? ? nil : attributes,
|
12067
|
+
:center => center,
|
12027
12068
|
:discount => discount.nil? ? nil : discount.to_hash
|
12028
12069
|
}
|
12029
12070
|
end
|
@@ -12603,11 +12644,11 @@ module Io
|
|
12603
12644
|
# then to book that order in order processing.
|
12604
12645
|
class Order
|
12605
12646
|
|
12606
|
-
attr_reader :id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total
|
12647
|
+
attr_reader :id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total, :attributes
|
12607
12648
|
|
12608
12649
|
def initialize(incoming={})
|
12609
12650
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
12610
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total], 'Order')
|
12651
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :number, :customer, :expires_at, :items, :destination, :deliveries, :selections, :prices, :total, :attributes], 'Order')
|
12611
12652
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
12612
12653
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
12613
12654
|
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
@@ -12618,6 +12659,7 @@ module Io
|
|
12618
12659
|
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
|
12619
12660
|
@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)) }
|
12620
12661
|
@total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::LocalizedPrice) ? x : ::Io::Flow::V0::Models::LocalizedPrice.new(x))
|
12662
|
+
@attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
|
12621
12663
|
end
|
12622
12664
|
|
12623
12665
|
def to_json
|
@@ -12639,7 +12681,8 @@ module Io
|
|
12639
12681
|
:deliveries => deliveries.map { |o| o.to_hash },
|
12640
12682
|
:selections => selections,
|
12641
12683
|
:prices => prices.map { |o| o.to_hash },
|
12642
|
-
:total => total.to_hash
|
12684
|
+
:total => total.to_hash,
|
12685
|
+
:attributes => attributes
|
12643
12686
|
}
|
12644
12687
|
end
|
12645
12688
|
|
@@ -12846,7 +12889,7 @@ module Io
|
|
12846
12889
|
# pricing and delivery options for destination and items/quantities specified
|
12847
12890
|
class OrderForm
|
12848
12891
|
|
12849
|
-
attr_reader :number, :customer, :destination, :items, :discount
|
12892
|
+
attr_reader :number, :customer, :destination, :items, :discount, :attributes
|
12850
12893
|
|
12851
12894
|
def initialize(incoming={})
|
12852
12895
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
@@ -12854,8 +12897,9 @@ module Io
|
|
12854
12897
|
@number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
|
12855
12898
|
@customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x))
|
12856
12899
|
@destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))
|
12857
|
-
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::
|
12900
|
+
@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)) }
|
12858
12901
|
@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)))
|
12902
|
+
@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 })
|
12859
12903
|
end
|
12860
12904
|
|
12861
12905
|
def to_json
|
@@ -12872,7 +12916,8 @@ module Io
|
|
12872
12916
|
:customer => customer.to_hash,
|
12873
12917
|
:destination => destination.to_hash,
|
12874
12918
|
:items => items.map { |o| o.to_hash },
|
12875
|
-
:discount => discount.nil? ? nil : discount.to_hash
|
12919
|
+
:discount => discount.nil? ? nil : discount.to_hash,
|
12920
|
+
:attributes => attributes.nil? ? nil : attributes
|
12876
12921
|
}
|
12877
12922
|
end
|
12878
12923
|
|
@@ -13066,11 +13111,11 @@ module Io
|
|
13066
13111
|
@experience_id = HttpClient::Preconditions.assert_class('experience_id', opts.delete(:experience_id), String)
|
13067
13112
|
@expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime)
|
13068
13113
|
@customer = HttpClient::Preconditions.assert_class('customer', HttpClient::Helper.to_object(opts.delete(:customer)), Hash)
|
13069
|
-
@selections = HttpClient::Preconditions.assert_class('selections',
|
13070
|
-
@items = HttpClient::Preconditions.assert_class('items',
|
13114
|
+
@selections = HttpClient::Preconditions.assert_class('selections', opts.delete(:selections), Array).map { |v| HttpClient::Preconditions.assert_class('selections', v, String) }
|
13115
|
+
@items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| HttpClient::Preconditions.assert_class('items', HttpClient::Helper.to_object(v), Hash) }
|
13071
13116
|
@destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
|
13072
|
-
@deliveries = HttpClient::Preconditions.assert_class('deliveries',
|
13073
|
-
@prices = HttpClient::Preconditions.assert_class('prices',
|
13117
|
+
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| HttpClient::Preconditions.assert_class('deliveries', HttpClient::Helper.to_object(v), Hash) }
|
13118
|
+
@prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| HttpClient::Preconditions.assert_class('prices', HttpClient::Helper.to_object(v), Hash) }
|
13074
13119
|
@discount = (x = opts.delete(:discount); x.nil? ? nil : HttpClient::Preconditions.assert_class('discount', HttpClient::Helper.to_object(x), Hash))
|
13075
13120
|
@total = HttpClient::Preconditions.assert_class('total', HttpClient::Helper.to_object(opts.delete(:total)), Hash)
|
13076
13121
|
end
|
@@ -16880,6 +16925,10 @@ module Io
|
|
16880
16925
|
|
16881
16926
|
end
|
16882
16927
|
|
16928
|
+
# Sets organization level settings to determine things like how many retries on
|
16929
|
+
# delivery, how long we wait, etc. By default, we will attempt delivery up to 6
|
16930
|
+
# times, using exponential backoff with a see of 1 minute (60k ms) - which means
|
16931
|
+
# that we will retry over the course of approximately an hour before giving up.
|
16883
16932
|
class WebhookSettings
|
16884
16933
|
|
16885
16934
|
attr_reader :secret, :retry_max_attempts, :retry_sleep_ms, :sleep_ms
|
@@ -16887,7 +16936,7 @@ module Io
|
|
16887
16936
|
def initialize(incoming={})
|
16888
16937
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
16889
16938
|
@secret = (x = opts.delete(:secret); x.nil? ? nil : HttpClient::Preconditions.assert_class('secret', x, String))
|
16890
|
-
@retry_max_attempts = HttpClient::Preconditions.assert_class('retry_max_attempts', (x = opts.delete(:retry_max_attempts); x.nil? ?
|
16939
|
+
@retry_max_attempts = HttpClient::Preconditions.assert_class('retry_max_attempts', (x = opts.delete(:retry_max_attempts); x.nil? ? 6 : x), Integer)
|
16891
16940
|
@retry_sleep_ms = HttpClient::Preconditions.assert_class('retry_sleep_ms', (x = opts.delete(:retry_sleep_ms); x.nil? ? 60000 : x), Integer)
|
16892
16941
|
@sleep_ms = HttpClient::Preconditions.assert_class('sleep_ms', (x = opts.delete(:sleep_ms); x.nil? ? 0 : x), Integer)
|
16893
16942
|
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.
|
4
|
+
version: 0.0.59
|
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-09-
|
11
|
+
date: 2016-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|