flowcommerce 0.0.77 → 0.0.78
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 +223 -5
- 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: fc41c4adc3c81f70314a4e72a8f0d23aff8f929f
|
4
|
+
data.tar.gz: 46d5b340280048a5a5d8aae1841af75c8d4c1ad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef26e94306a215afe1063070dc207942f9f31f504fe8833798ba66f3fe9ea0b70e1c43f442742c33991f9f16b248188f2298e6cf3202a398f5f6a3c6e83efec8
|
7
|
+
data.tar.gz: 1b59a32288b3ec041c9e74620fcb643c85815a9bf9c9ff2a8be0312617bb7e0420ba075cca9b9bc45debe38c88ec0718fe734dd9196cc4ee6ae61b065ed39b62
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.38 http://www.apidoc.me/flow/api/0.1.
|
3
|
+
# apidoc:0.11.38 http://www.apidoc.me/flow/api/0.1.83/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.38 http://www.apidoc.me/flow/api/0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.38 http://www.apidoc.me/flow/api/0.1.83/ruby_client' unless defined?(Constants::USER_AGENT)
|
29
29
|
VERSION = '0.1.77' unless defined?(Constants::VERSION)
|
30
30
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
31
31
|
|
@@ -301,6 +301,10 @@ module Io
|
|
301
301
|
@healthchecks ||= ::Io::Flow::V0::Clients::Healthchecks.new(self)
|
302
302
|
end
|
303
303
|
|
304
|
+
def imports
|
305
|
+
@imports ||= ::Io::Flow::V0::Clients::Imports.new(self)
|
306
|
+
end
|
307
|
+
|
304
308
|
def invitations
|
305
309
|
@invitations ||= ::Io::Flow::V0::Clients::Invitations.new(self)
|
306
310
|
end
|
@@ -3373,6 +3377,68 @@ module Io
|
|
3373
3377
|
|
3374
3378
|
end
|
3375
3379
|
|
3380
|
+
class Imports
|
3381
|
+
|
3382
|
+
def initialize(client)
|
3383
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
3384
|
+
end
|
3385
|
+
|
3386
|
+
# Search imports. Always paginated.
|
3387
|
+
def get(organization, incoming={})
|
3388
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3389
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3390
|
+
query = {
|
3391
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
3392
|
+
:created_by_user_id => (x = opts.delete(:created_by_user_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('created_by_user_id', x, String)),
|
3393
|
+
:type => (x = opts.delete(:type); x.nil? ? nil : HttpClient::Preconditions.assert_class('type', x, String)),
|
3394
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3395
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3396
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
|
3397
|
+
}.delete_if { |k, v| v.nil? }
|
3398
|
+
r = @client.request("/#{CGI.escape(organization)}/imports").with_query(query).get
|
3399
|
+
r.map { |x| ::Io::Flow::V0::Models::Import.new(x) }
|
3400
|
+
end
|
3401
|
+
|
3402
|
+
# Create an import.
|
3403
|
+
def post(organization, import_form)
|
3404
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3405
|
+
HttpClient::Preconditions.assert_class('import_form', import_form, ::Io::Flow::V0::Models::ImportForm)
|
3406
|
+
r = @client.request("/#{CGI.escape(organization)}/imports").with_json(import_form.to_json).post
|
3407
|
+
::Io::Flow::V0::Models::Import.new(r)
|
3408
|
+
end
|
3409
|
+
|
3410
|
+
# Get a single import.
|
3411
|
+
def get_by_id(organization, id)
|
3412
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3413
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
3414
|
+
r = @client.request("/#{CGI.escape(organization)}/imports/#{CGI.escape(id)}").get
|
3415
|
+
::Io::Flow::V0::Models::Import.new(r)
|
3416
|
+
end
|
3417
|
+
|
3418
|
+
def delete_by_id(organization, id)
|
3419
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3420
|
+
HttpClient::Preconditions.assert_class('id', id, String)
|
3421
|
+
r = @client.request("/#{CGI.escape(organization)}/imports/#{CGI.escape(id)}").delete
|
3422
|
+
nil
|
3423
|
+
end
|
3424
|
+
|
3425
|
+
# Provides visibility into recent changes of each import, including deletion.
|
3426
|
+
def get_versions(organization, incoming={})
|
3427
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
3428
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
3429
|
+
query = {
|
3430
|
+
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
|
3431
|
+
:import_id => (x = opts.delete(:import_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('import_id', x, Array).map { |v| HttpClient::Preconditions.assert_class('import_id', v, String) }),
|
3432
|
+
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
|
3433
|
+
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
|
3434
|
+
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "journal_timestamp" : x), String)
|
3435
|
+
}.delete_if { |k, v| v.nil? }
|
3436
|
+
r = @client.request("/#{CGI.escape(organization)}/imports/versions").with_query(query).get
|
3437
|
+
r.map { |x| ::Io::Flow::V0::Models::ImportVersion.new(x) }
|
3438
|
+
end
|
3439
|
+
|
3440
|
+
end
|
3441
|
+
|
3376
3442
|
class Invitations
|
3377
3443
|
|
3378
3444
|
def initialize(client)
|
@@ -5544,6 +5610,45 @@ module Io
|
|
5544
5610
|
|
5545
5611
|
end
|
5546
5612
|
|
5613
|
+
class ImportType
|
5614
|
+
|
5615
|
+
attr_reader :value
|
5616
|
+
|
5617
|
+
def initialize(value)
|
5618
|
+
@value = HttpClient::Preconditions.assert_class('value', value, String)
|
5619
|
+
end
|
5620
|
+
|
5621
|
+
# Returns the instance of ImportType for this value, creating a new instance for an unknown value
|
5622
|
+
def ImportType.apply(value)
|
5623
|
+
if value.instance_of?(ImportType)
|
5624
|
+
value
|
5625
|
+
else
|
5626
|
+
HttpClient::Preconditions.assert_class_or_nil('value', value, String)
|
5627
|
+
value.nil? ? nil : (from_string(value) || ImportType.new(value))
|
5628
|
+
end
|
5629
|
+
end
|
5630
|
+
|
5631
|
+
# Returns the instance of ImportType for this value, or nil if not found
|
5632
|
+
def ImportType.from_string(value)
|
5633
|
+
HttpClient::Preconditions.assert_class('value', value, String)
|
5634
|
+
ImportType.ALL.find { |v| v.value == value }
|
5635
|
+
end
|
5636
|
+
|
5637
|
+
def ImportType.ALL
|
5638
|
+
@@all ||= [ImportType.harmonization_codes]
|
5639
|
+
end
|
5640
|
+
|
5641
|
+
# Provides upload of HS-6 and HS-10 codes for the items in a catalog
|
5642
|
+
def ImportType.harmonization_codes
|
5643
|
+
@@_harmonization_codes ||= ImportType.new('harmonization_codes')
|
5644
|
+
end
|
5645
|
+
|
5646
|
+
def to_hash
|
5647
|
+
value
|
5648
|
+
end
|
5649
|
+
|
5650
|
+
end
|
5651
|
+
|
5547
5652
|
class LevyComponent
|
5548
5653
|
|
5549
5654
|
attr_reader :value
|
@@ -11319,6 +11424,117 @@ module Io
|
|
11319
11424
|
|
11320
11425
|
end
|
11321
11426
|
|
11427
|
+
# Imports allow you to upload data to Flow via files in batch. Each import
|
11428
|
+
# fetches data from a given URL. The type of the import determines which file
|
11429
|
+
# format to expect and what data to update
|
11430
|
+
class Import
|
11431
|
+
|
11432
|
+
attr_reader :id, :type, :source_url, :status, :created_at, :started_at, :completed_at, :results_url, :deliveries
|
11433
|
+
|
11434
|
+
def initialize(incoming={})
|
11435
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11436
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :type, :source_url, :status, :created_at, :deliveries], 'Import')
|
11437
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11438
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ImportType) ? x : ::Io::Flow::V0::Models::ImportType.apply(x))
|
11439
|
+
@source_url = HttpClient::Preconditions.assert_class('source_url', opts.delete(:source_url), String)
|
11440
|
+
@status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ExportStatus) ? x : ::Io::Flow::V0::Models::ExportStatus.apply(x))
|
11441
|
+
@created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
|
11442
|
+
@started_at = (x = opts.delete(:started_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('started_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
11443
|
+
@completed_at = (x = opts.delete(:completed_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('completed_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
|
11444
|
+
@results_url = (x = opts.delete(:results_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('results_url', x, String))
|
11445
|
+
@deliveries = HttpClient::Preconditions.assert_class('deliveries', opts.delete(:deliveries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExportDelivery) ? x : ::Io::Flow::V0::Models::ExportDelivery.from_json(x)) }
|
11446
|
+
end
|
11447
|
+
|
11448
|
+
def to_json
|
11449
|
+
JSON.dump(to_hash)
|
11450
|
+
end
|
11451
|
+
|
11452
|
+
def copy(incoming={})
|
11453
|
+
Import.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11454
|
+
end
|
11455
|
+
|
11456
|
+
def to_hash
|
11457
|
+
{
|
11458
|
+
:id => id,
|
11459
|
+
:type => type.value,
|
11460
|
+
:source_url => source_url,
|
11461
|
+
:status => status.value,
|
11462
|
+
:created_at => created_at,
|
11463
|
+
:started_at => started_at,
|
11464
|
+
:completed_at => completed_at,
|
11465
|
+
:results_url => results_url,
|
11466
|
+
:deliveries => deliveries.map { |o| o.to_hash }
|
11467
|
+
}
|
11468
|
+
end
|
11469
|
+
|
11470
|
+
end
|
11471
|
+
|
11472
|
+
# Import forms create imports. The import type defines both the type of the
|
11473
|
+
# import (e.g. the CSV File format) and the URL at which the source data are
|
11474
|
+
# available. If you do not have a URL readily available, you can first upload a
|
11475
|
+
# file via the Flow API - see the resource named 'Upload'
|
11476
|
+
class ImportForm
|
11477
|
+
|
11478
|
+
attr_reader :type, :source_url, :emails
|
11479
|
+
|
11480
|
+
def initialize(incoming={})
|
11481
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11482
|
+
HttpClient::Preconditions.require_keys(opts, [:type, :source_url], 'ImportForm')
|
11483
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ImportType) ? x : ::Io::Flow::V0::Models::ImportType.apply(x))
|
11484
|
+
@source_url = HttpClient::Preconditions.assert_class('source_url', opts.delete(:source_url), String)
|
11485
|
+
@emails = (x = opts.delete(:emails); x.nil? ? nil : HttpClient::Preconditions.assert_class('emails', x, Array).map { |v| HttpClient::Preconditions.assert_class('emails', v, String) })
|
11486
|
+
end
|
11487
|
+
|
11488
|
+
def to_json
|
11489
|
+
JSON.dump(to_hash)
|
11490
|
+
end
|
11491
|
+
|
11492
|
+
def copy(incoming={})
|
11493
|
+
ImportForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11494
|
+
end
|
11495
|
+
|
11496
|
+
def to_hash
|
11497
|
+
{
|
11498
|
+
:type => type.value,
|
11499
|
+
:source_url => source_url,
|
11500
|
+
:emails => emails.nil? ? nil : emails
|
11501
|
+
}
|
11502
|
+
end
|
11503
|
+
|
11504
|
+
end
|
11505
|
+
|
11506
|
+
class ImportVersion
|
11507
|
+
|
11508
|
+
attr_reader :id, :timestamp, :type, :import
|
11509
|
+
|
11510
|
+
def initialize(incoming={})
|
11511
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
11512
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :import], 'ImportVersion')
|
11513
|
+
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
11514
|
+
@timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
|
11515
|
+
@type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x))
|
11516
|
+
@import = (x = opts.delete(:import); x.is_a?(::Io::Flow::V0::Models::Import) ? x : ::Io::Flow::V0::Models::Import.new(x))
|
11517
|
+
end
|
11518
|
+
|
11519
|
+
def to_json
|
11520
|
+
JSON.dump(to_hash)
|
11521
|
+
end
|
11522
|
+
|
11523
|
+
def copy(incoming={})
|
11524
|
+
ImportVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
11525
|
+
end
|
11526
|
+
|
11527
|
+
def to_hash
|
11528
|
+
{
|
11529
|
+
:id => id,
|
11530
|
+
:timestamp => timestamp,
|
11531
|
+
:type => type.value,
|
11532
|
+
:import => import.to_hash
|
11533
|
+
}
|
11534
|
+
end
|
11535
|
+
|
11536
|
+
end
|
11537
|
+
|
11322
11538
|
# Enables backorders, setting an optional number of units that we allow for
|
11323
11539
|
# backorder. For example, a backorder w/ quantity 10 will enable selling until
|
11324
11540
|
# the actual inventory quantity is -10.
|
@@ -16863,14 +17079,15 @@ module Io
|
|
16863
17079
|
|
16864
17080
|
class TargetingQuery
|
16865
17081
|
|
16866
|
-
attr_reader :id, :q, :outcome_id
|
17082
|
+
attr_reader :id, :q, :outcome_id, :position
|
16867
17083
|
|
16868
17084
|
def initialize(incoming={})
|
16869
17085
|
opts = HttpClient::Helper.symbolize_keys(incoming)
|
16870
|
-
HttpClient::Preconditions.require_keys(opts, [:id, :q, :outcome_id], 'TargetingQuery')
|
17086
|
+
HttpClient::Preconditions.require_keys(opts, [:id, :q, :outcome_id, :position], 'TargetingQuery')
|
16871
17087
|
@id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
|
16872
17088
|
@q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
|
16873
17089
|
@outcome_id = HttpClient::Preconditions.assert_class('outcome_id', opts.delete(:outcome_id), String)
|
17090
|
+
@position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
|
16874
17091
|
end
|
16875
17092
|
|
16876
17093
|
def to_json
|
@@ -16885,7 +17102,8 @@ module Io
|
|
16885
17102
|
{
|
16886
17103
|
:id => id,
|
16887
17104
|
:q => q,
|
16888
|
-
:outcome_id => outcome_id
|
17105
|
+
:outcome_id => outcome_id,
|
17106
|
+
:position => position
|
16889
17107
|
}
|
16890
17108
|
end
|
16891
17109
|
|
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.78
|
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-10-
|
11
|
+
date: 2016-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|