Class: Io::Flow::V0::Models::SyncStream
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SyncStream
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#systems ⇒ Object
readonly
Returns the value of attribute systems.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SyncStream
constructor
A new instance of SyncStream.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SyncStream
Returns a new instance of SyncStream.
69704 69705 69706 69707 69708 69709 69710 69711 69712 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69704 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :key, :type, :systems, :settings], 'SyncStream') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::SyncStreamType) ? x : ::Io::Flow::V0::Models::SyncStreamType.apply(x)) @systems = HttpClient::Preconditions.assert_class('systems', opts.delete(:systems), Array).map { |v| HttpClient::Preconditions.assert_class('systems', v, String) } @settings = (x = opts.delete(:settings); x.is_a?(::Io::Flow::V0::Models::SyncStreamSettings) ? x : ::Io::Flow::V0::Models::SyncStreamSettings.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
69702 69703 69704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69702 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
69702 69703 69704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69702 def key @key end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
69702 69703 69704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69702 def settings @settings end |
#systems ⇒ Object (readonly)
Returns the value of attribute systems.
69702 69703 69704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69702 def systems @systems end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
69702 69703 69704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69702 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
69718 69719 69720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69718 def copy(incoming={}) SyncStream.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
69722 69723 69724 69725 69726 69727 69728 69729 69730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69722 def to_hash { :id => id, :key => key, :type => type.value, :systems => systems, :settings => settings.to_hash } end |
#to_json ⇒ Object
69714 69715 69716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69714 def to_json JSON.dump(to_hash) end |