flowcommerce 0.2.11 → 0.2.12

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: 690624be868a9121a4e352cd50287ab7ebd16ccd
4
- data.tar.gz: ab6e14b0b2a8790c6cd7a340a6ca33e4468e8920
3
+ metadata.gz: ab5696b4424f07eb939e67d96eefd198c8bbaa7e
4
+ data.tar.gz: 66f52d09a8bbe5b90c1e255bbf4ca0fe6fb5dcc0
5
5
  SHA512:
6
- metadata.gz: 50ee7f994a28b8716a09ef457e1723cf1eeec5d437dcba854f090ecc05678a6d9eb5a1c6f7987bce865abdd683be124b34d36900800fd90e830d2b139c79fe37
7
- data.tar.gz: b067528c1206b1b4ff1eb81839b0e4f149dc8e4a8042263b4ca022418f4bf1ec7aaadede89b017a0a81aea380e8c13e68999f431c91fd03ddfbc707ecb78d70b
6
+ metadata.gz: 4f3c67b3e8305505a0003d599030642b25c2c2bf5b2105b953504a29b1c08018c871353c937064eef8e89f54021f8af030eb8b58d3f4adc26452ee161c14d597
7
+ data.tar.gz: 2b5f2d487f3f218343b83ce622cf7386544f10fe3dc39040000fc667856ed893c38341380aed9cf52eb887c9a1d545a651818e02ffccac994436a38bf415b3fa
@@ -1,6 +1,6 @@
1
1
  # Generated by apidoc - http://www.apidoc.me
2
- # Service version: 0.2.87
3
- # apidoc:0.11.76 http://www.apidoc.me/flow/api/0.3.16/ruby_client
2
+ # Service version: 0.3.17
3
+ # apidoc:0.11.77 http://www.apidoc.me/flow/api/0.3.17/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.76 http://www.apidoc.me/flow/api/0.3.16/ruby_client' unless defined?(Constants::USER_AGENT)
29
- VERSION = '0.2.87' unless defined?(Constants::VERSION)
28
+ USER_AGENT = 'apidoc:0.11.77 http://www.apidoc.me/flow/api/0.3.17/ruby_client' unless defined?(Constants::USER_AGENT)
29
+ VERSION = '0.3.17' unless defined?(Constants::VERSION)
30
30
  VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
31
31
 
32
32
  end
@@ -288,6 +288,10 @@ module Io
288
288
  @locales ||= ::Io::Flow::V0::Clients::Locales.new(self)
289
289
  end
290
290
 
291
+ def provinces
292
+ @provinces ||= ::Io::Flow::V0::Clients::Provinces.new(self)
293
+ end
294
+
291
295
  def regions
292
296
  @regions ||= ::Io::Flow::V0::Clients::Regions.new(self)
293
297
  end
@@ -3499,6 +3503,32 @@ module Io
3499
3503
 
3500
3504
  end
3501
3505
 
3506
+ class Provinces
3507
+
3508
+ def initialize(client)
3509
+ @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
3510
+ end
3511
+
3512
+ # Returns a list of provinces.
3513
+ def get(incoming={})
3514
+ opts = HttpClient::Helper.symbolize_keys(incoming)
3515
+ query = {
3516
+ :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String)),
3517
+ :countries => (x = opts.delete(:countries); x.nil? ? nil : HttpClient::Preconditions.assert_class('countries', x, Array).map { |v| HttpClient::Preconditions.assert_class('countries', v, String) })
3518
+ }.delete_if { |k, v| v.nil? }
3519
+ r = @client.request("/reference/provinces").with_query(query).get
3520
+ r.map { |x| ::Io::Flow::V0::Models::Province.new(x) }
3521
+ end
3522
+
3523
+ # Returns the province with the specifed id.
3524
+ def get_by_id(id)
3525
+ HttpClient::Preconditions.assert_class('id', id, String)
3526
+ r = @client.request("/reference/provinces/#{CGI.escape(id)}").get
3527
+ ::Io::Flow::V0::Models::Province.new(r)
3528
+ end
3529
+
3530
+ end
3531
+
3502
3532
  class Regions
3503
3533
 
3504
3534
  def initialize(client)
@@ -8846,6 +8876,88 @@ module Io
8846
8876
 
8847
8877
  end
8848
8878
 
8879
+ class ProvinceType
8880
+
8881
+ attr_reader :value
8882
+
8883
+ def initialize(value)
8884
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
8885
+ end
8886
+
8887
+ # Returns the instance of ProvinceType for this value, creating a new instance for an unknown value
8888
+ def ProvinceType.apply(value)
8889
+ if value.instance_of?(ProvinceType)
8890
+ value
8891
+ else
8892
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
8893
+ value.nil? ? nil : (from_string(value) || ProvinceType.new(value))
8894
+ end
8895
+ end
8896
+
8897
+ # Returns the instance of ProvinceType for this value, or nil if not found
8898
+ def ProvinceType.from_string(value)
8899
+ HttpClient::Preconditions.assert_class('value', value, String)
8900
+ ProvinceType.ALL.find { |v| v.value == value }
8901
+ end
8902
+
8903
+ def ProvinceType.ALL
8904
+ @@all ||= [ProvinceType.city, ProvinceType.dependency, ProvinceType.district, ProvinceType.emirate, ProvinceType.entity, ProvinceType.municipality, ProvinceType.outlying_area, ProvinceType.parish, ProvinceType.province, ProvinceType.state, ProvinceType.territory, ProvinceType.other]
8905
+ end
8906
+
8907
+ def ProvinceType.city
8908
+ @@_city ||= ProvinceType.new('city')
8909
+ end
8910
+
8911
+ def ProvinceType.dependency
8912
+ @@_dependency ||= ProvinceType.new('dependency')
8913
+ end
8914
+
8915
+ def ProvinceType.district
8916
+ @@_district ||= ProvinceType.new('district')
8917
+ end
8918
+
8919
+ def ProvinceType.emirate
8920
+ @@_emirate ||= ProvinceType.new('emirate')
8921
+ end
8922
+
8923
+ def ProvinceType.entity
8924
+ @@_entity ||= ProvinceType.new('entity')
8925
+ end
8926
+
8927
+ def ProvinceType.municipality
8928
+ @@_municipality ||= ProvinceType.new('municipality')
8929
+ end
8930
+
8931
+ def ProvinceType.outlying_area
8932
+ @@_outlying_area ||= ProvinceType.new('outlying_area')
8933
+ end
8934
+
8935
+ def ProvinceType.parish
8936
+ @@_parish ||= ProvinceType.new('parish')
8937
+ end
8938
+
8939
+ def ProvinceType.province
8940
+ @@_province ||= ProvinceType.new('province')
8941
+ end
8942
+
8943
+ def ProvinceType.state
8944
+ @@_state ||= ProvinceType.new('state')
8945
+ end
8946
+
8947
+ def ProvinceType.territory
8948
+ @@_territory ||= ProvinceType.new('territory')
8949
+ end
8950
+
8951
+ def ProvinceType.other
8952
+ @@_other ||= ProvinceType.new('other')
8953
+ end
8954
+
8955
+ def to_hash
8956
+ value
8957
+ end
8958
+
8959
+ end
8960
+
8849
8961
  class QueryType
8850
8962
 
8851
8963
  attr_reader :value
@@ -9395,6 +9507,48 @@ module Io
9395
9507
 
9396
9508
  end
9397
9509
 
9510
+ class TierDirection
9511
+
9512
+ attr_reader :value
9513
+
9514
+ def initialize(value)
9515
+ @value = HttpClient::Preconditions.assert_class('value', value, String)
9516
+ end
9517
+
9518
+ # Returns the instance of TierDirection for this value, creating a new instance for an unknown value
9519
+ def TierDirection.apply(value)
9520
+ if value.instance_of?(TierDirection)
9521
+ value
9522
+ else
9523
+ HttpClient::Preconditions.assert_class_or_nil('value', value, String)
9524
+ value.nil? ? nil : (from_string(value) || TierDirection.new(value))
9525
+ end
9526
+ end
9527
+
9528
+ # Returns the instance of TierDirection for this value, or nil if not found
9529
+ def TierDirection.from_string(value)
9530
+ HttpClient::Preconditions.assert_class('value', value, String)
9531
+ TierDirection.ALL.find { |v| v.value == value }
9532
+ end
9533
+
9534
+ def TierDirection.ALL
9535
+ @@all ||= [TierDirection.outbound, TierDirection.return]
9536
+ end
9537
+
9538
+ def TierDirection.outbound
9539
+ @@_outbound ||= TierDirection.new('outbound')
9540
+ end
9541
+
9542
+ def TierDirection.return
9543
+ @@_return ||= TierDirection.new('return')
9544
+ end
9545
+
9546
+ def to_hash
9547
+ value
9548
+ end
9549
+
9550
+ end
9551
+
9398
9552
  class TierStrategy
9399
9553
 
9400
9554
  attr_reader :value
@@ -20565,6 +20719,42 @@ module Io
20565
20719
 
20566
20720
  end
20567
20721
 
20722
+ # A subdivision/province/state within a country. These conform to the ISO 3166-2
20723
+ # standard for country subdivisions. See https://api.flow.io/reference/provinces
20724
+ class Province
20725
+
20726
+ attr_reader :id, :iso_3166_2, :name, :country, :province_type
20727
+
20728
+ def initialize(incoming={})
20729
+ opts = HttpClient::Helper.symbolize_keys(incoming)
20730
+ HttpClient::Preconditions.require_keys(opts, [:id, :iso_3166_2, :name, :country, :province_type], 'Province')
20731
+ @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
20732
+ @iso_3166_2 = HttpClient::Preconditions.assert_class('iso_3166_2', opts.delete(:iso_3166_2), String)
20733
+ @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
20734
+ @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
20735
+ @province_type = (x = opts.delete(:province_type); x.is_a?(::Io::Flow::V0::Models::ProvinceType) ? x : ::Io::Flow::V0::Models::ProvinceType.apply(x))
20736
+ end
20737
+
20738
+ def to_json
20739
+ JSON.dump(to_hash)
20740
+ end
20741
+
20742
+ def copy(incoming={})
20743
+ Province.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
20744
+ end
20745
+
20746
+ def to_hash
20747
+ {
20748
+ :id => id,
20749
+ :iso_3166_2 => iso_3166_2,
20750
+ :name => name,
20751
+ :country => country,
20752
+ :province_type => province_type.value
20753
+ }
20754
+ end
20755
+
20756
+ end
20757
+
20568
20758
  # A public key is used to encrypt cards client side prior to submitting to the
20569
20759
  # Flow vault.
20570
20760
  class PublicKey
@@ -22008,7 +22198,7 @@ module Io
22008
22198
 
22009
22199
  class SessionForm
22010
22200
 
22011
- attr_reader :ip, :experience, :country, :currency, :language, :locale
22201
+ attr_reader :ip, :experience, :country, :currency, :language, :locale, :attributes
22012
22202
 
22013
22203
  def initialize(incoming={})
22014
22204
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -22018,6 +22208,7 @@ module Io
22018
22208
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
22019
22209
  @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
22020
22210
  @locale = (x = opts.delete(:locale); x.nil? ? nil : HttpClient::Preconditions.assert_class('locale', x, String))
22211
+ @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 })
22021
22212
  end
22022
22213
 
22023
22214
  def to_json
@@ -22035,7 +22226,8 @@ module Io
22035
22226
  :country => country,
22036
22227
  :currency => currency,
22037
22228
  :language => language,
22038
- :locale => locale
22229
+ :locale => locale,
22230
+ :attributes => attributes.nil? ? nil : attributes
22039
22231
  }
22040
22232
  end
22041
22233
 
@@ -22043,7 +22235,7 @@ module Io
22043
22235
 
22044
22236
  class SessionPutForm
22045
22237
 
22046
- attr_reader :experience, :country, :currency, :language, :locale
22238
+ attr_reader :experience, :country, :currency, :language, :locale, :attributes
22047
22239
 
22048
22240
  def initialize(incoming={})
22049
22241
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -22052,6 +22244,7 @@ module Io
22052
22244
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
22053
22245
  @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
22054
22246
  @locale = (x = opts.delete(:locale); x.nil? ? nil : HttpClient::Preconditions.assert_class('locale', x, String))
22247
+ @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 })
22055
22248
  end
22056
22249
 
22057
22250
  def to_json
@@ -22068,7 +22261,8 @@ module Io
22068
22261
  :country => country,
22069
22262
  :currency => currency,
22070
22263
  :language => language,
22071
- :locale => locale
22264
+ :locale => locale,
22265
+ :attributes => attributes.nil? ? nil : attributes
22072
22266
  }
22073
22267
  end
22074
22268
 
@@ -22319,19 +22513,19 @@ module Io
22319
22513
  # of shipped packages.
22320
22514
  class ShippingNotificationForm
22321
22515
 
22322
- attr_reader :key, :attributes, :carrier_tracking_number, :destination, :order_number, :origin, :package, :service
22516
+ attr_reader :key, :attributes, :carrier_tracking_number, :destination, :order_number, :package, :service, :origin
22323
22517
 
22324
22518
  def initialize(incoming={})
22325
22519
  opts = HttpClient::Helper.symbolize_keys(incoming)
22326
- HttpClient::Preconditions.require_keys(opts, [:carrier_tracking_number, :destination, :order_number, :origin, :package, :service], 'ShippingNotificationForm')
22520
+ HttpClient::Preconditions.require_keys(opts, [:carrier_tracking_number, :destination, :order_number, :package, :service], 'ShippingNotificationForm')
22327
22521
  @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
22328
22522
  @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 })
22329
22523
  @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
22330
22524
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
22331
22525
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
22332
- @origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))
22333
22526
  @package = (x = opts.delete(:package); x.is_a?(::Io::Flow::V0::Models::ShippingLabelPackage) ? x : ::Io::Flow::V0::Models::ShippingLabelPackage.new(x))
22334
22527
  @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
22528
+ @origin = (x = opts.delete(:origin); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x)))
22335
22529
  end
22336
22530
 
22337
22531
  def to_json
@@ -22349,9 +22543,9 @@ module Io
22349
22543
  :carrier_tracking_number => carrier_tracking_number,
22350
22544
  :destination => destination.to_hash,
22351
22545
  :order_number => order_number,
22352
- :origin => origin.to_hash,
22353
22546
  :package => package.to_hash,
22354
- :service => service
22547
+ :service => service,
22548
+ :origin => origin.nil? ? nil : origin.to_hash
22355
22549
  }
22356
22550
  end
22357
22551
 
@@ -23436,12 +23630,13 @@ module Io
23436
23630
  # Express tier, Economy tier
23437
23631
  class Tier
23438
23632
 
23439
- attr_reader :id, :experience, :integration, :name, :rules, :services, :strategy, :visibility, :description
23633
+ attr_reader :id, :direction, :experience, :integration, :name, :rules, :services, :strategy, :visibility, :description
23440
23634
 
23441
23635
  def initialize(incoming={})
23442
23636
  opts = HttpClient::Helper.symbolize_keys(incoming)
23443
23637
  HttpClient::Preconditions.require_keys(opts, [:id, :experience, :integration, :name, :rules, :services, :strategy, :visibility], 'Tier')
23444
23638
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
23639
+ @direction = (x = (x = opts.delete(:direction); x.nil? ? "outbound" : x); x.is_a?(::Io::Flow::V0::Models::TierDirection) ? x : ::Io::Flow::V0::Models::TierDirection.apply(x))
23445
23640
  @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::FulfillmentExperienceReference) ? x : ::Io::Flow::V0::Models::FulfillmentExperienceReference.new(x))
23446
23641
  @integration = (x = opts.delete(:integration); x.is_a?(::Io::Flow::V0::Models::ShipmentIntegrationType) ? x : ::Io::Flow::V0::Models::ShipmentIntegrationType.apply(x))
23447
23642
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
@@ -23463,6 +23658,7 @@ module Io
23463
23658
  def to_hash
23464
23659
  {
23465
23660
  :id => id,
23661
+ :direction => direction.value,
23466
23662
  :experience => experience.to_hash,
23467
23663
  :integration => integration.value,
23468
23664
  :name => name,
@@ -23606,7 +23802,7 @@ module Io
23606
23802
  # Express tier, Economy tier
23607
23803
  class TierForm
23608
23804
 
23609
- attr_reader :currency, :experience, :integration, :name, :rules, :services, :strategy, :visibility, :description
23805
+ attr_reader :currency, :experience, :integration, :name, :rules, :services, :strategy, :visibility, :description, :direction
23610
23806
 
23611
23807
  def initialize(incoming={})
23612
23808
  opts = HttpClient::Helper.symbolize_keys(incoming)
@@ -23620,6 +23816,7 @@ module Io
23620
23816
  @strategy = (x = opts.delete(:strategy); x.is_a?(::Io::Flow::V0::Models::TierStrategy) ? x : ::Io::Flow::V0::Models::TierStrategy.apply(x))
23621
23817
  @visibility = (x = opts.delete(:visibility); x.is_a?(::Io::Flow::V0::Models::Visibility) ? x : ::Io::Flow::V0::Models::Visibility.apply(x))
23622
23818
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
23819
+ @direction = (x = opts.delete(:direction); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TierDirection) ? x : ::Io::Flow::V0::Models::TierDirection.apply(x)))
23623
23820
  end
23624
23821
 
23625
23822
  def to_json
@@ -23640,7 +23837,8 @@ module Io
23640
23837
  :services => services,
23641
23838
  :strategy => strategy.value,
23642
23839
  :visibility => visibility.value,
23643
- :description => description
23840
+ :description => description,
23841
+ :direction => direction.nil? ? nil : direction.value
23644
23842
  }
23645
23843
  end
23646
23844
 
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.11
4
+ version: 0.2.12
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-04-18 00:00:00.000000000 Z
11
+ date: 2017-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json