Class: Io::Flow::V0::Models::TrackingEventForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TrackingEventForm
- 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.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#tracking_label_id ⇒ Object
readonly
Returns the value of attribute tracking_label_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TrackingEventForm
constructor
A new instance of TrackingEventForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TrackingEventForm
Returns a new instance of TrackingEventForm.
31952 31953 31954 31955 31956 31957 31958 31959 31960 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31952 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:tracking_label_id, :timestamp, :status], 'TrackingEventForm') @tracking_label_id = HttpClient::Preconditions.assert_class('tracking_label_id', opts.delete(:tracking_label_id), String) = 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.
31950 31951 31952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31950 def address @address end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
31950 31951 31952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31950 def description @description end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
31950 31951 31952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31950 def status @status end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
31950 31951 31952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31950 def end |
#tracking_label_id ⇒ Object (readonly)
Returns the value of attribute tracking_label_id.
31950 31951 31952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31950 def tracking_label_id @tracking_label_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31966 31967 31968 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31966 def copy(incoming={}) TrackingEventForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31970 31971 31972 31973 31974 31975 31976 31977 31978 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31970 def to_hash { :tracking_label_id => tracking_label_id, :timestamp => , :status => status.value, :description => description, :address => address } end |
#to_json ⇒ Object
31962 31963 31964 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31962 def to_json JSON.dump(to_hash) end |