flowcommerce 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/flow_commerce/flow_api_v0_client.rb +64 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 380f068aafe13f388ec15c7ab474a8e2213dbe4f
|
4
|
+
data.tar.gz: b6eaee21bd41444e245051a648e1541f89207453
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51efbe919dd4b2dc839e56a688227194ad22fec6a6c4c3ed7e0b559601d20bb3500c670797ab1a1a50d23684218adb632e592acea521b0d311008e6e7c33b157
|
7
|
+
data.tar.gz: 8d19c68ad667d270e488ab77b041ecd910778c60dd45771d2b38e78f75d4a7aab5d09b22b2a1a9a24363047badfb0df7c1b66598919ef1dae9f7e804cc0bbeb8
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Generated by apidoc - http://www.apidoc.me
|
2
2
|
# Service version: 0.1.77
|
3
|
-
# apidoc:0.11.45 http://www.apidoc.me/flow/api/0.1.
|
3
|
+
# apidoc:0.11.45 http://www.apidoc.me/flow/api/0.1.91/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.45 http://www.apidoc.me/flow/api/0.1.
|
28
|
+
USER_AGENT = 'apidoc:0.11.45 http://www.apidoc.me/flow/api/0.1.91/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
|
|
@@ -73,6 +73,10 @@ module Io
|
|
73
73
|
@experiences ||= ::Io::Flow::V0::Clients::Experiences.new(self)
|
74
74
|
end
|
75
75
|
|
76
|
+
def experience_defaults
|
77
|
+
@experience_defaults ||= ::Io::Flow::V0::Clients::ExperienceDefaults.new(self)
|
78
|
+
end
|
79
|
+
|
76
80
|
def items
|
77
81
|
@items ||= ::Io::Flow::V0::Clients::Items.new(self)
|
78
82
|
end
|
@@ -638,6 +642,25 @@ module Io
|
|
638
642
|
|
639
643
|
end
|
640
644
|
|
645
|
+
class ExperienceDefaults
|
646
|
+
|
647
|
+
def initialize(client)
|
648
|
+
@client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
|
649
|
+
end
|
650
|
+
|
651
|
+
# Returns recommended default settings when creating a new experience
|
652
|
+
def get(organization, incoming={})
|
653
|
+
HttpClient::Preconditions.assert_class('organization', organization, String)
|
654
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
655
|
+
query = {
|
656
|
+
:region_id => (x = opts.delete(:region_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('region_id', x, String))
|
657
|
+
}.delete_if { |k, v| v.nil? }
|
658
|
+
r = @client.request("/#{CGI.escape(organization)}/experience/defaults").with_query(query).get
|
659
|
+
::Io::Flow::V0::Models::ExperienceDefaults.new(r)
|
660
|
+
end
|
661
|
+
|
662
|
+
end
|
663
|
+
|
641
664
|
class Items
|
642
665
|
|
643
666
|
def initialize(client)
|
@@ -10074,6 +10097,45 @@ module Io
|
|
10074
10097
|
|
10075
10098
|
end
|
10076
10099
|
|
10100
|
+
# Defines a set of defaults for a given organization and region
|
10101
|
+
class ExperienceDefaults
|
10102
|
+
|
10103
|
+
attr_reader :key, :name, :delivered_duty, :country, :currency, :language, :measurement_system
|
10104
|
+
|
10105
|
+
def initialize(incoming={})
|
10106
|
+
opts = HttpClient::Helper.symbolize_keys(incoming)
|
10107
|
+
HttpClient::Preconditions.require_keys(opts, [:key, :name, :country, :currency, :language, :measurement_system], 'ExperienceDefaults')
|
10108
|
+
@key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
|
10109
|
+
@name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
|
10110
|
+
@delivered_duty = (x = opts.delete(:delivered_duty); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x)))
|
10111
|
+
@country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
|
10112
|
+
@currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
|
10113
|
+
@language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
|
10114
|
+
@measurement_system = (x = opts.delete(:measurement_system); x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x))
|
10115
|
+
end
|
10116
|
+
|
10117
|
+
def to_json
|
10118
|
+
JSON.dump(to_hash)
|
10119
|
+
end
|
10120
|
+
|
10121
|
+
def copy(incoming={})
|
10122
|
+
ExperienceDefaults.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
|
10123
|
+
end
|
10124
|
+
|
10125
|
+
def to_hash
|
10126
|
+
{
|
10127
|
+
:key => key,
|
10128
|
+
:name => name,
|
10129
|
+
:delivered_duty => delivered_duty.nil? ? nil : delivered_duty.value,
|
10130
|
+
:country => country,
|
10131
|
+
:currency => currency,
|
10132
|
+
:language => language,
|
10133
|
+
:measurement_system => measurement_system.value
|
10134
|
+
}
|
10135
|
+
end
|
10136
|
+
|
10137
|
+
end
|
10138
|
+
|
10077
10139
|
class ExperienceDeleted < Event
|
10078
10140
|
|
10079
10141
|
attr_reader :event_id, :timestamp, :organization, :key, :subcatalog_id
|