flowcommerce 0.1.17 → 0.1.18

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: cc2fab61a13044701e486bce3307b40a83b99550
4
- data.tar.gz: 856b13274aa39b0a24dd23ce8bc4d02dfc7abb94
3
+ metadata.gz: f0e6c41f191b0ace91f5de98c2dbf8b1f9af4223
4
+ data.tar.gz: 19307977173ebe0d46bf19d7179382b57bc9c2d0
5
5
  SHA512:
6
- metadata.gz: eba49c62ce104a09d5a3b720094974bada2ed93af4475dd91d27d78a292a8e403948acbd1475df1e751f599eef6eebc2f1a761d7f6abf2cebf76e132a59d3e84
7
- data.tar.gz: 88e995923e3706a9ec6ced16dca8d467f075e7a4d4a0542ed23ec4fa13335dfb1bfa1eb6d1db7a18ccc09b64e84152f10c6ea288c3976ebcaee56bb553cc1acb
6
+ metadata.gz: b3a9ec433cfef92c7b3e54fe7b4ca264c25d0cebdcc28e0a6c511550fe4da6c66a3fdc549d78714805fa8ac215a92b87cbfc888e599dd57770905ff41d9c5109
7
+ data.tar.gz: 16274ca3d1629de7b7c4fdc7b9fbb8313b4de000b490078fdb898c7c15e4ed777d66a51989ae91560b2148783d5788b94ba0b160ebae3c0522f03ca34503f9b4
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
2
  # Service version: 0.2.65
3
- # apidoc:0.11.72 http://www.apidoc.me/flow/api/0.2.68/ruby_client
3
+ # apidoc:0.11.72 http://www.apidoc.me/flow/api/0.2.69/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.72 http://www.apidoc.me/flow/api/0.2.68/ruby_client' unless defined?(Constants::USER_AGENT)
28
+ USER_AGENT = 'apidoc:0.11.72 http://www.apidoc.me/flow/api/0.2.69/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
 
@@ -209,6 +209,10 @@ module Io
209
209
  @quotes ||= ::Io::Flow::V0::Clients::Quotes.new(self)
210
210
  end
211
211
 
212
+ def returns
213
+ @returns ||= ::Io::Flow::V0::Clients::Returns.new(self)
214
+ end
215
+
212
216
  def shipping_labels
213
217
  @shipping_labels ||= ::Io::Flow::V0::Clients::ShippingLabels.new(self)
214
218
  end
@@ -325,10 +329,6 @@ module Io
325
329
  @password_reset_forms ||= ::Io::Flow::V0::Clients::PasswordResetForms.new(self)
326
330
  end
327
331
 
328
- def returns
329
- @returns ||= ::Io::Flow::V0::Clients::Returns.new(self)
330
- end
331
-
332
332
  def scheduled_exports
333
333
  @scheduled_exports ||= ::Io::Flow::V0::Clients::ScheduledExports.new(self)
334
334
  end
@@ -2594,6 +2594,75 @@ module Io
2594
2594
 
2595
2595
  end
2596
2596
 
2597
+ class Returns
2598
+
2599
+ def initialize(client)
2600
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
2601
+ end
2602
+
2603
+ def get(organization, incoming={})
2604
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2605
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2606
+ query = {
2607
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2608
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
2609
+ :order_number => (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('order_number', v, String) }),
2610
+ :flow_tracking_number => (x = opts.delete(:flow_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('flow_tracking_number', v, String) }),
2611
+ :carrier_tracking_number => (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier_tracking_number', v, String) }),
2612
+ :service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
2613
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2614
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2615
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
2616
+ }.delete_if { |k, v| v.nil? }
2617
+ r = @client.request("/#{CGI.escape(organization)}/returns").with_query(query).get
2618
+ r.map { |x| ::Io::Flow::V0::Models::Return.new(x) }
2619
+ end
2620
+
2621
+ def post(organization, return_form)
2622
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2623
+ HttpClient::Preconditions.assert_class('return_form', return_form, ::Io::Flow::V0::Models::ReturnForm)
2624
+ r = @client.request("/#{CGI.escape(organization)}/returns").with_json(return_form.to_json).post
2625
+ ::Io::Flow::V0::Models::Return.new(r)
2626
+ end
2627
+
2628
+ def get_by_key(organization, key)
2629
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2630
+ HttpClient::Preconditions.assert_class('key', key, String)
2631
+ r = @client.request("/#{CGI.escape(organization)}/returns/#{CGI.escape(key)}").get
2632
+ ::Io::Flow::V0::Models::Return.new(r)
2633
+ end
2634
+
2635
+ def put_by_key(organization, key, return_form)
2636
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2637
+ HttpClient::Preconditions.assert_class('key', key, String)
2638
+ HttpClient::Preconditions.assert_class('return_form', return_form, ::Io::Flow::V0::Models::ReturnForm)
2639
+ r = @client.request("/#{CGI.escape(organization)}/returns/#{CGI.escape(key)}").with_json(return_form.to_json).put
2640
+ ::Io::Flow::V0::Models::Return.new(r)
2641
+ end
2642
+
2643
+ def delete_by_key(organization, key)
2644
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2645
+ HttpClient::Preconditions.assert_class('key', key, String)
2646
+ r = @client.request("/#{CGI.escape(organization)}/returns/#{CGI.escape(key)}").delete
2647
+ nil
2648
+ end
2649
+
2650
+ def get_versions(organization, incoming={})
2651
+ HttpClient::Preconditions.assert_class('organization', organization, String)
2652
+ opts = HttpClient::Helper.symbolize_keys(incoming)
2653
+ query = {
2654
+ :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
2655
+ :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
2656
+ :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
2657
+ :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
2658
+ :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
2659
+ }.delete_if { |k, v| v.nil? }
2660
+ r = @client.request("/#{CGI.escape(organization)}/returns/versions").with_query(query).get
2661
+ r.map { |x| ::Io::Flow::V0::Models::ReturnVersion.new(x) }
2662
+ end
2663
+
2664
+ end
2665
+
2597
2666
  class ShippingLabels
2598
2667
 
2599
2668
  def initialize(client)
@@ -3785,75 +3854,6 @@ module Io
3785
3854
 
3786
3855
  end
3787
3856
 
3788
- class Returns
3789
-
3790
- def initialize(client)
3791
- @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3792
- end
3793
-
3794
- def get(organization, incoming={})
3795
- HttpClient::Preconditions.assert_class('organization', organization, String)
3796
- opts = HttpClient::Helper.symbolize_keys(incoming)
3797
- query = {
3798
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3799
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
3800
- :order_number => (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('order_number', v, String) }),
3801
- :flow_tracking_number => (x = opts.delete(:flow_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('flow_tracking_number', v, String) }),
3802
- :carrier_tracking_number => (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, Array).map { |v| HttpClient::Preconditions.assert_class('carrier_tracking_number', v, String) }),
3803
- :service => (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, Array).map { |v| HttpClient::Preconditions.assert_class('service', v, String) }),
3804
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3805
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3806
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
3807
- }.delete_if { |k, v| v.nil? }
3808
- r = @client.request("/#{CGI.escape(organization)}/returns").with_query(query).get
3809
- r.map { |x| ::Io::Flow::V0::Models::Return.new(x) }
3810
- end
3811
-
3812
- def post(organization, return_form)
3813
- HttpClient::Preconditions.assert_class('organization', organization, String)
3814
- HttpClient::Preconditions.assert_class('return_form', return_form, ::Io::Flow::V0::Models::ReturnForm)
3815
- r = @client.request("/#{CGI.escape(organization)}/returns").with_json(return_form.to_json).post
3816
- ::Io::Flow::V0::Models::Return.new(r)
3817
- end
3818
-
3819
- def get_by_key(organization, key)
3820
- HttpClient::Preconditions.assert_class('organization', organization, String)
3821
- HttpClient::Preconditions.assert_class('key', key, String)
3822
- r = @client.request("/#{CGI.escape(organization)}/returns/#{CGI.escape(key)}").get
3823
- ::Io::Flow::V0::Models::Return.new(r)
3824
- end
3825
-
3826
- def put_by_key(organization, key, return_form)
3827
- HttpClient::Preconditions.assert_class('organization', organization, String)
3828
- HttpClient::Preconditions.assert_class('key', key, String)
3829
- HttpClient::Preconditions.assert_class('return_form', return_form, ::Io::Flow::V0::Models::ReturnForm)
3830
- r = @client.request("/#{CGI.escape(organization)}/returns/#{CGI.escape(key)}").with_json(return_form.to_json).put
3831
- ::Io::Flow::V0::Models::Return.new(r)
3832
- end
3833
-
3834
- def delete_by_key(organization, key)
3835
- HttpClient::Preconditions.assert_class('organization', organization, String)
3836
- HttpClient::Preconditions.assert_class('key', key, String)
3837
- r = @client.request("/#{CGI.escape(organization)}/returns/#{CGI.escape(key)}").delete
3838
- nil
3839
- end
3840
-
3841
- def get_versions(organization, incoming={})
3842
- HttpClient::Preconditions.assert_class('organization', organization, String)
3843
- opts = HttpClient::Helper.symbolize_keys(incoming)
3844
- query = {
3845
- :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
3846
- :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
3847
- :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
3848
- :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
3849
- :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
3850
- }.delete_if { |k, v| v.nil? }
3851
- r = @client.request("/#{CGI.escape(organization)}/returns/versions").with_query(query).get
3852
- r.map { |x| ::Io::Flow::V0::Models::ReturnVersion.new(x) }
3853
- end
3854
-
3855
- end
3856
-
3857
3857
  class ScheduledExports
3858
3858
 
3859
3859
  def initialize(client)
@@ -10643,7 +10643,7 @@ module Io
10643
10643
  # https://api.flow.io/reference/currencies
10644
10644
  class Currency
10645
10645
 
10646
- attr_reader :name, :iso_4217_3, :number_decimals
10646
+ attr_reader :name, :iso_4217_3, :number_decimals, :symbols, :default_locale
10647
10647
 
10648
10648
  def initialize(incoming={})
10649
10649
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -10651,6 +10651,8 @@ module Io
10651
10651
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
10652
10652
  @iso_4217_3 = HttpClient::Preconditions.assert_class('iso_4217_3', opts.delete(:iso_4217_3), String)
10653
10653
  @number_decimals = HttpClient::Preconditions.assert_class('number_decimals', opts.delete(:number_decimals), Integer)
10654
+ @symbols = (x = opts.delete(:symbols); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CurrencySymbols) ? x : ::Io::Flow::V0::Models::CurrencySymbols.new(x)))
10655
+ @default_locale = (x = opts.delete(:default_locale); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_locale', x, String))
10654
10656
  end
10655
10657
 
10656
10658
  def to_json
@@ -10665,7 +10667,38 @@ module Io
10665
10667
  {
10666
10668
  :name => name,
10667
10669
  :iso_4217_3 => iso_4217_3,
10668
- :number_decimals => number_decimals
10670
+ :number_decimals => number_decimals,
10671
+ :symbols => symbols.nil? ? nil : symbols.to_hash,
10672
+ :default_locale => default_locale
10673
+ }
10674
+ end
10675
+
10676
+ end
10677
+
10678
+ # Defines one or more symbols representing this currency
10679
+ class CurrencySymbols
10680
+
10681
+ attr_reader :primary, :narrow
10682
+
10683
+ def initialize(incoming={})
10684
+ opts = HttpClient::Helper.symbolize_keys(incoming)
10685
+ HttpClient::Preconditions.require_keys(opts, [:primary], 'CurrencySymbols')
10686
+ @primary = HttpClient::Preconditions.assert_class('primary', opts.delete(:primary), String)
10687
+ @narrow = (x = opts.delete(:narrow); x.nil? ? nil : HttpClient::Preconditions.assert_class('narrow', x, String))
10688
+ end
10689
+
10690
+ def to_json
10691
+ JSON.dump(to_hash)
10692
+ end
10693
+
10694
+ def copy(incoming={})
10695
+ CurrencySymbols.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
10696
+ end
10697
+
10698
+ def to_hash
10699
+ {
10700
+ :primary => primary,
10701
+ :narrow => narrow
10669
10702
  }
10670
10703
  end
10671
10704
 
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.17
4
+ version: 0.1.18
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-24 00:00:00.000000000 Z
11
+ date: 2017-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json