Class: Io::Flow::V0::Models::TrackingLabelEventUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#carrier_timestamp ⇒ Object
readonly
Returns the value of attribute carrier_timestamp.
-
#carrier_tracking_number ⇒ Object
readonly
Returns the value of attribute carrier_tracking_number.
-
#delivery_estimate ⇒ Object
readonly
Returns the value of attribute delivery_estimate.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#flow_tracking_number ⇒ Object
readonly
Returns the value of attribute flow_tracking_number.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TrackingLabelEventUpserted
constructor
A new instance of TrackingLabelEventUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ TrackingLabelEventUpserted
Returns a new instance of TrackingLabelEventUpserted.
22408 22409 22410 22411 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22408 def initialize(incoming={}) super(:discriminator => Event::Types::TRACKING_LABEL_EVENT_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :address, :carrier, :carrier_timestamp, :carrier_tracking_number, :flow_tracking_number, :status], 'TrackingLabelEventUpserted') @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) @address = HttpClient::Preconditions.assert_class('address', HttpClient::Helper.to_object(opts.delete(:address)), Hash) @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String) @carrier_timestamp = HttpClient::Preconditions.assert_class('carrier_timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:carrier_timestamp)), DateTime) @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String) @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String) @status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), String) @delivery_estimate = (x = opts.delete(:delivery_estimate); x.nil? ? nil : HttpClient::Preconditions.assert_class('delivery_estimate', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def address @address end |
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def carrier @carrier end |
#carrier_timestamp ⇒ Object (readonly)
Returns the value of attribute carrier_timestamp.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def @carrier_timestamp end |
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def carrier_tracking_number @carrier_tracking_number end |
#delivery_estimate ⇒ Object (readonly)
Returns the value of attribute delivery_estimate.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def delivery_estimate @delivery_estimate end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def description @description end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def event_id @event_id end |
#flow_tracking_number ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def flow_tracking_number @flow_tracking_number end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def order_number @order_number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def organization @organization end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def status @status end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22430 22431 22432 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22430 def copy(incoming={}) TrackingLabelEventUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22434 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :address => address, :carrier => carrier, :carrier_timestamp => , :carrier_tracking_number => carrier_tracking_number, :flow_tracking_number => flow_tracking_number, :status => status, :delivery_estimate => delivery_estimate, :description => description, :order_number => order_number } end |
#to_json ⇒ Object
22426 22427 22428 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22426 def to_json JSON.dump(to_hash) end |