flowcommerce 0.2.66 → 0.2.67
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 +87 -13
- 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: c7d55e910f3e0bae6d0f591dff89cbddaf142d2d
|
4
|
+
data.tar.gz: a3e0b205a557a0e74aadf5e9c7c98ab32e6751d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1577ce90074a502ad993c0386084c004e18930098de5f604eaa7005eabd33e552ac59b226eca2a2898b2cb6a084ceb2239ac9a6c361922fb9193e64621081eb5
|
7
|
+
data.tar.gz: a12454d26f0da55704d88f205531a07a224a2e016632ee7e9d158fe32a323e6cfa195091f08c50818983417c7248b60455e10400e09d71ccca29a39263cce44d
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by API Builder - https://www.apibuilder.io
|
2
2
|
# Service version: 0.6.19
|
3
|
-
# apibuilder 0.14.3 app.apibuilder.io/flow/api/0.6.
|
3
|
+
# apibuilder 0.14.3 app.apibuilder.io/flow/api/0.6.25/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 = 'apibuilder 0.14.3 app.apibuilder.io/flow/api/0.6.
|
28
|
+
USER_AGENT = 'apibuilder 0.14.3 app.apibuilder.io/flow/api/0.6.25/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.6.19' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -4115,6 +4115,7 @@ module Io
|
|
4115
4115
|
:key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),
|
4116
4116
|
:name => (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String)),
|
4117
4117
|
:experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)),
|
4118
|
+
:expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),
|
4118
4119
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
4119
4120
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
4120
4121
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "name" : x), String)
|
@@ -4130,10 +4131,14 @@ module Io
|
|
4130
4131
|
::Io::Flow::V0::Models::ShippingConfiguration.new(r)
|
4131
4132
|
end
|
4132
4133
|
|
4133
|
-
def get_by_key(organization, key)
|
4134
|
+
def get_by_key(organization, key, incoming={})
|
4134
4135
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
4135
4136
|
HttpClient::Preconditions.assert_class('key', key, String)
|
4136
|
-
|
4137
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4138
|
+
query = {
|
4139
|
+
:expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
|
4140
|
+
}.delete_if { |k, v| v.nil? }
|
4141
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping/configuration/#{CGI.escape(key)}").with_query(query).get
|
4137
4142
|
::Io::Flow::V0::Models::ShippingConfiguration.new(r)
|
4138
4143
|
end
|
4139
4144
|
|
@@ -4159,6 +4164,7 @@ module Io
|
|
4159
4164
|
query = {
|
4160
4165
|
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
4161
4166
|
:region => (x = opts.delete(:region); x.nil? ? nil : HttpClient::Preconditions.assert_class('region', x, String)),
|
4167
|
+
:expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }),
|
4162
4168
|
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
4163
4169
|
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
4164
4170
|
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
@@ -4175,11 +4181,15 @@ module Io
|
|
4175
4181
|
::Io::Flow::V0::Models::ShippingLane.new(r)
|
4176
4182
|
end
|
4177
4183
|
|
4178
|
-
def get_lanes_by_key_and_id(organization, key, id)
|
4184
|
+
def get_lanes_by_key_and_id(organization, key, id, incoming={})
|
4179
4185
|
HttpClient::Preconditions.assert_class('organization', organization, String)
|
4180
4186
|
HttpClient::Preconditions.assert_class('key', key, String)
|
4181
4187
|
HttpClient::Preconditions.assert_class('id', id, String)
|
4182
|
-
|
4188
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
4189
|
+
query = {
|
4190
|
+
:expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) })
|
4191
|
+
}.delete_if { |k, v| v.nil? }
|
4192
|
+
r = @client.request("/#{CGI.escape(organization)}/shipping/configuration/#{CGI.escape(key)}/lanes/#{CGI.escape(id)}").with_query(query).get
|
4183
4193
|
::Io::Flow::V0::Models::ShippingLane.new(r)
|
4184
4194
|
end
|
4185
4195
|
|
@@ -7165,6 +7175,68 @@ module Io
|
|
7165
7175
|
|
7166
7176
|
end
|
7167
7177
|
|
7178
|
+
class ExpandableCenter
|
7179
|
+
|
7180
|
+
module Types
|
7181
|
+
CENTER = 'center' unless defined?(CENTER)
|
7182
|
+
CENTER_REFERENCE = 'center_reference' unless defined?(CENTER_REFERENCE)
|
7183
|
+
end
|
7184
|
+
|
7185
|
+
attr_reader :discriminator
|
7186
|
+
|
7187
|
+
def initialize(incoming={})
|
7188
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7189
|
+
HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ExpandableCenter')
|
7190
|
+
@discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
|
7191
|
+
end
|
7192
|
+
|
7193
|
+
def subtype_to_hash
|
7194
|
+
raise 'Cannot serialize an instance of expandable_center directly - must use one of the specific types: center, center_reference'
|
7195
|
+
end
|
7196
|
+
|
7197
|
+
def to_hash
|
7198
|
+
subtype_to_hash.merge(:discriminator => @discriminator)
|
7199
|
+
end
|
7200
|
+
|
7201
|
+
def ExpandableCenter.from_json(hash)
|
7202
|
+
HttpClient::Preconditions.assert_class('hash', hash, Hash)
|
7203
|
+
discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
|
7204
|
+
if discriminator.empty?
|
7205
|
+
raise "Union type[expandable_center] requires a field named 'discriminator'"
|
7206
|
+
end
|
7207
|
+
case discriminator
|
7208
|
+
when Types::CENTER; Center.new(hash)
|
7209
|
+
when Types::CENTER_REFERENCE; CenterReference.new(hash)
|
7210
|
+
else ExpandableCenterUndefinedType.new(:discriminator => discriminator)
|
7211
|
+
end
|
7212
|
+
end
|
7213
|
+
|
7214
|
+
end
|
7215
|
+
|
7216
|
+
class ExpandableCenterUndefinedType < ExpandableCenter
|
7217
|
+
|
7218
|
+
attr_reader :name
|
7219
|
+
|
7220
|
+
def initialize(incoming={})
|
7221
|
+
super(:discriminator => 'undefined_type')
|
7222
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
7223
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:discriminator), String)
|
7224
|
+
end
|
7225
|
+
|
7226
|
+
def subtype_to_hash
|
7227
|
+
raise 'Unable to serialize undefined type to json'
|
7228
|
+
end
|
7229
|
+
|
7230
|
+
def copy(incoming={})
|
7231
|
+
raise 'Operation not supported for undefined type'
|
7232
|
+
end
|
7233
|
+
|
7234
|
+
def to_hash
|
7235
|
+
raise 'Operation not supported for undefined type'
|
7236
|
+
end
|
7237
|
+
|
7238
|
+
end
|
7239
|
+
|
7168
7240
|
class ExpandableExperience
|
7169
7241
|
|
7170
7242
|
module Types
|
@@ -19158,11 +19230,12 @@ module Io
|
|
19158
19230
|
end
|
19159
19231
|
|
19160
19232
|
# Represents a facility capable of fulfilling a shipment
|
19161
|
-
class Center
|
19233
|
+
class Center < ExpandableCenter
|
19162
19234
|
|
19163
19235
|
attr_reader :id, :key, :address, :packaging, :name, :services, :schedule, :timezone, :capabilities, :partner_center
|
19164
19236
|
|
19165
19237
|
def initialize(incoming={})
|
19238
|
+
super(:discriminator => ExpandableCenter::Types::CENTER)
|
19166
19239
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
19167
19240
|
HttpClient::Preconditions.require_keys(opts, [:id, :key, :address, :packaging, :name, :services, :schedule, :timezone], 'Center')
|
19168
19241
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
@@ -19182,10 +19255,10 @@ module Io
|
|
19182
19255
|
end
|
19183
19256
|
|
19184
19257
|
def copy(incoming={})
|
19185
|
-
Center.new(
|
19258
|
+
Center.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
19186
19259
|
end
|
19187
19260
|
|
19188
|
-
def
|
19261
|
+
def subtype_to_hash
|
19189
19262
|
{
|
19190
19263
|
:id => id,
|
19191
19264
|
:key => key,
|
@@ -19270,11 +19343,12 @@ module Io
|
|
19270
19343
|
|
19271
19344
|
end
|
19272
19345
|
|
19273
|
-
class CenterReference
|
19346
|
+
class CenterReference < ExpandableCenter
|
19274
19347
|
|
19275
19348
|
attr_reader :organization_id, :center_key
|
19276
19349
|
|
19277
19350
|
def initialize(incoming={})
|
19351
|
+
super(:discriminator => ExpandableCenter::Types::CENTER_REFERENCE)
|
19278
19352
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
19279
19353
|
HttpClient::Preconditions.require_keys(opts, [:organization_id, :center_key], 'CenterReference')
|
19280
19354
|
@organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
|
@@ -19286,10 +19360,10 @@ module Io
|
|
19286
19360
|
end
|
19287
19361
|
|
19288
19362
|
def copy(incoming={})
|
19289
|
-
CenterReference.new(
|
19363
|
+
CenterReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
19290
19364
|
end
|
19291
19365
|
|
19292
|
-
def
|
19366
|
+
def subtype_to_hash
|
19293
19367
|
{
|
19294
19368
|
:organization_id => organization_id,
|
19295
19369
|
:center_key => center_key
|
@@ -36598,7 +36672,7 @@ module Io
|
|
36598
36672
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
36599
36673
|
@shipping_configuration = (x = opts.delete(:shipping_configuration); x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationReference) ? x : ::Io::Flow::V0::Models::ShippingConfigurationReference.new(x))
|
36600
36674
|
@region = HttpClient::Preconditions.assert_class('region', opts.delete(:region), String)
|
36601
|
-
@centers = HttpClient::Preconditions.assert_class('centers', opts.delete(:centers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::
|
36675
|
+
@centers = HttpClient::Preconditions.assert_class('centers', opts.delete(:centers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExpandableCenter) ? x : ::Io::Flow::V0::Models::ExpandableCenter.from_json(x)) }
|
36602
36676
|
@tiers = HttpClient::Preconditions.assert_class('tiers', opts.delete(:tiers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Tier) ? x : ::Io::Flow::V0::Models::Tier.new(x)) }
|
36603
36677
|
@query = (x = opts.delete(:query); x.is_a?(::Io::Flow::V0::Models::Query) ? x : ::Io::Flow::V0::Models::Query.new(x))
|
36604
36678
|
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.2.
|
4
|
+
version: 0.2.67
|
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: 2018-08-
|
11
|
+
date: 2018-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|