Class: Io::Flow::V0::Models::LabelEventForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LabelEventForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#label_id ⇒ Object
readonly
Returns the value of attribute label_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LabelEventForm
constructor
A new instance of LabelEventForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LabelEventForm
Returns a new instance of LabelEventForm.
11783 11784 11785 11786 11787 11788 11789 11790 11791 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11783 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:label_id, :timestamp, :status], 'LabelEventForm') @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String) @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x)) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @address = (x = opts.delete(:address); x.nil? ? nil : HttpClient::Preconditions.assert_class('address', x, String)) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
11781 11782 11783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11781 def address @address end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11781 11782 11783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11781 def description @description end |
#label_id ⇒ Object (readonly)
Returns the value of attribute label_id.
11781 11782 11783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11781 def label_id @label_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11781 11782 11783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11781 def status @status end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
11781 11782 11783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11781 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
11797 11798 11799 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11797 def copy(incoming={}) LabelEventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
11801 11802 11803 11804 11805 11806 11807 11808 11809 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11801 def to_hash { :label_id => label_id, :timestamp => , :status => status.value, :description => description, :address => address } end |
#to_json ⇒ Object
11793 11794 11795 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11793 def to_json JSON.dump(to_hash) end |