Class: Io::Flow::V0::Models::LabelDeletedV2
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LabelDeletedV2
constructor
A new instance of LabelDeletedV2.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ LabelDeletedV2
Returns a new instance of LabelDeletedV2.
42638 42639 42640 42641 42642 42643 42644 42645 42646 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42638 def initialize(incoming={}) super(:discriminator => Event::Types::LABEL_DELETED_V2) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label], 'LabelDeletedV2') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @label = (x = opts.delete(:label); x.is_a?(::Io::Flow::V0::Models::ShippingLabel) ? x : ::Io::Flow::V0::Models::ShippingLabel.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
42636 42637 42638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42636 def event_id @event_id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
42636 42637 42638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42636 def label @label end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
42636 42637 42638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42636 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
42636 42637 42638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42636 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
42652 42653 42654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42652 def copy(incoming={}) LabelDeletedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
42656 42657 42658 42659 42660 42661 42662 42663 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42656 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :label => label.to_hash } end |
#to_json ⇒ Object
42648 42649 42650 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42648 def to_json JSON.dump(to_hash) end |