Class: Io::Flow::V0::Models::SubcatalogItemVersion
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SubcatalogItemVersion
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#subcatalog_item ⇒ Object
readonly
Returns the value of attribute subcatalog_item.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SubcatalogItemVersion
constructor
A new instance of SubcatalogItemVersion.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SubcatalogItemVersion
Returns a new instance of SubcatalogItemVersion.
30662 30663 30664 30665 30666 30667 30668 30669 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30662 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :subcatalog_item], 'SubcatalogItemVersion') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x)) @subcatalog_item = (x = opts.delete(:subcatalog_item); x.is_a?(::Io::Flow::V0::Models::SubcatalogItem) ? x : ::Io::Flow::V0::Models::SubcatalogItem.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
30660 30661 30662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30660 def id @id end |
#subcatalog_item ⇒ Object (readonly)
Returns the value of attribute subcatalog_item.
30660 30661 30662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30660 def subcatalog_item @subcatalog_item end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
30660 30661 30662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30660 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
30660 30661 30662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30660 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30675 30676 30677 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30675 def copy(incoming={}) SubcatalogItemVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30679 30680 30681 30682 30683 30684 30685 30686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30679 def to_hash { :id => id, :timestamp => , :type => type.value, :subcatalog_item => subcatalog_item.to_hash } end |
#to_json ⇒ Object
30671 30672 30673 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30671 def to_json JSON.dump(to_hash) end |