Class: Io::Flow::V0::Models::SyncStreamSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SyncStreamSettings

Returns a new instance of SyncStreamSettings.



53495
53496
53497
53498
53499
53500
53501
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53495

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:pending_record_after, :warn_after, :error_after], 'SyncStreamSettings')
  @pending_record_after = (x = opts.delete(:pending_record_after); x.is_a?(::Io::Flow::V0::Models::SyncDuration) ? x : ::Io::Flow::V0::Models::SyncDuration.new(x))
  @warn_after = (x = opts.delete(:warn_after); x.is_a?(::Io::Flow::V0::Models::SyncDuration) ? x : ::Io::Flow::V0::Models::SyncDuration.new(x))
  @error_after = (x = opts.delete(:error_after); x.is_a?(::Io::Flow::V0::Models::SyncDuration) ? x : ::Io::Flow::V0::Models::SyncDuration.new(x))
end

Instance Attribute Details

#error_afterObject (readonly)

Returns the value of attribute error_after.



53493
53494
53495
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53493

def error_after
  @error_after
end

#pending_record_afterObject (readonly)

Returns the value of attribute pending_record_after.



53493
53494
53495
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53493

def pending_record_after
  @pending_record_after
end

#warn_afterObject (readonly)

Returns the value of attribute warn_after.



53493
53494
53495
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53493

def warn_after
  @warn_after
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53507
53508
53509
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53507

def copy(incoming={})
  SyncStreamSettings.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



53511
53512
53513
53514
53515
53516
53517
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53511

def to_hash
  {
    :pending_record_after => pending_record_after.to_hash,
    :warn_after => warn_after.to_hash,
    :error_after => error_after.to_hash
  }
end

#to_jsonObject



53503
53504
53505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53503

def to_json
  JSON.dump(to_hash)
end