Class: Io::Flow::V0::Models::LabelUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#carrier_tracking_number ⇒ Object
readonly
Returns the value of attribute carrier_tracking_number.
-
#commercial_invoice ⇒ Object
readonly
Returns the value of attribute commercial_invoice.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#flow_tracking_number ⇒ Object
readonly
Returns the value of attribute flow_tracking_number.
-
#label_id ⇒ Object
readonly
Returns the value of attribute label_id.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
-
#png ⇒ Object
readonly
Returns the value of attribute png.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LabelUpserted
constructor
A new instance of LabelUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ LabelUpserted
Returns a new instance of LabelUpserted.
11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11980 def initialize(incoming={}) super(:name => Event::Types::LABEL_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :data, :destination, :origin, :carrier, :service], 'LabelUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = 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_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String) @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) @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), String) @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash) @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash) @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String) @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String) @commercial_invoice = (x = opts.delete(:commercial_invoice); x.nil? ? nil : HttpClient::Preconditions.assert_class('commercial_invoice', x, String)) @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String)) @png = (x = opts.delete(:png); x.nil? ? nil : HttpClient::Preconditions.assert_class('png', x, String)) @order = (x = opts.delete(:order); x.nil? ? nil : HttpClient::Preconditions.assert_class('order', x, String)) end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def carrier @carrier end |
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def carrier_tracking_number @carrier_tracking_number end |
#commercial_invoice ⇒ Object (readonly)
Returns the value of attribute commercial_invoice.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def commercial_invoice @commercial_invoice end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def data @data end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def event_id @event_id end |
#flow_tracking_number ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def flow_tracking_number @flow_tracking_number end |
#label_id ⇒ Object (readonly)
Returns the value of attribute label_id.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def label_id @label_id end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def order @order end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def organization @organization end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def origin @origin end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def pdf @pdf end |
#png ⇒ Object (readonly)
Returns the value of attribute png.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def png @png end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def service @service end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
11978 11979 11980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
12005 12006 12007 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12005 def copy(incoming={}) LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12009 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :label_id => label_id, :carrier_tracking_number => carrier_tracking_number, :flow_tracking_number => flow_tracking_number, :data => data, :destination => destination, :origin => origin, :carrier => carrier, :service => service, :commercial_invoice => commercial_invoice, :pdf => pdf, :png => png, :order => order } end |
#to_json ⇒ Object
12001 12002 12003 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12001 def to_json JSON.dump(to_hash) end |