Class: Io::Flow::V0::Clients::ShopifySyncStatuses
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::ShopifySyncStatuses
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
- #get(organization, incoming = {}) ⇒ Object
-
#initialize(client) ⇒ ShopifySyncStatuses
constructor
A new instance of ShopifySyncStatuses.
Constructor Details
#initialize(client) ⇒ ShopifySyncStatuses
Returns a new instance of ShopifySyncStatuses.
7363 7364 7365 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7363 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(organization, incoming = {}) ⇒ Object
7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7367 def get(organization, incoming={}) HttpClient::Preconditions.assert_class('organization', organization, String) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :interval_seconds => HttpClient::Preconditions.assert_class('interval_seconds', (x = opts.delete(:interval_seconds); x.nil? ? 60 : x), Integer), :sync_check => (x = (x = opts.delete(:sync_check); x.nil? ? "localized_variants" : x); x.is_a?(::Io::Flow::V0::Models::ShopifySyncCheck) ? x : ::Io::Flow::V0::Models::ShopifySyncCheck.apply(x)).value }.delete_if { |k, v| v.nil? } r = @client.request("/#{CGI.escape(organization)}/shopify/sync/status").with_query(query).get ::Io::Flow::V0::Models::ShopifySyncStatus.new(r) end |