Class: Io::Flow::V0::Models::ShopifySyncStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifySyncStatus
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#buckets ⇒ Object
readonly
Returns the value of attribute buckets.
-
#interval_seconds ⇒ Object
readonly
Returns the value of attribute interval_seconds.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
-
#sync_check ⇒ Object
readonly
Returns the value of attribute sync_check.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifySyncStatus
constructor
A new instance of ShopifySyncStatus.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifySyncStatus
Returns a new instance of ShopifySyncStatus.
68382 68383 68384 68385 68386 68387 68388 68389 68390 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68382 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:sync_check, :range, :interval_seconds, :total, :buckets], 'ShopifySyncStatus') @sync_check = (x = opts.delete(:sync_check); x.is_a?(::Io::Flow::V0::Models::ShopifySyncCheck) ? x : ::Io::Flow::V0::Models::ShopifySyncCheck.apply(x)) @range = (x = opts.delete(:range); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)) @interval_seconds = HttpClient::Preconditions.assert_class('interval_seconds', opts.delete(:interval_seconds), Integer) @total = HttpClient::Preconditions.assert_class('total', opts.delete(:total), Integer) @buckets = HttpClient::Preconditions.assert_class('buckets', opts.delete(:buckets), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShopifyEventBucket) ? x : ::Io::Flow::V0::Models::ShopifyEventBucket.from_json(x)) } end |
Instance Attribute Details
#buckets ⇒ Object (readonly)
Returns the value of attribute buckets.
68380 68381 68382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68380 def buckets @buckets end |
#interval_seconds ⇒ Object (readonly)
Returns the value of attribute interval_seconds.
68380 68381 68382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68380 def interval_seconds @interval_seconds end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
68380 68381 68382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68380 def range @range end |
#sync_check ⇒ Object (readonly)
Returns the value of attribute sync_check.
68380 68381 68382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68380 def sync_check @sync_check end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
68380 68381 68382 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68380 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
68396 68397 68398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68396 def copy(incoming={}) ShopifySyncStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
68400 68401 68402 68403 68404 68405 68406 68407 68408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68400 def to_hash { :sync_check => sync_check.value, :range => range.to_hash, :interval_seconds => interval_seconds, :total => total, :buckets => buckets.map { |o| o.to_hash } } end |
#to_json ⇒ Object
68392 68393 68394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68392 def to_json JSON.dump(to_hash) end |