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.
12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12393 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.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def carrier @carrier end |
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def carrier_tracking_number @carrier_tracking_number end |
#commercial_invoice ⇒ Object (readonly)
Returns the value of attribute commercial_invoice.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def commercial_invoice @commercial_invoice end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def data @data end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def event_id @event_id end |
#flow_tracking_number ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def flow_tracking_number @flow_tracking_number end |
#label_id ⇒ Object (readonly)
Returns the value of attribute label_id.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def label_id @label_id end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def order @order end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def organization @organization end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def origin @origin end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def pdf @pdf end |
#png ⇒ Object (readonly)
Returns the value of attribute png.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def png @png end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def service @service end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
12391 12392 12393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12391 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
12418 12419 12420 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12418 def copy(incoming={}) LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12422 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
12414 12415 12416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12414 def to_json JSON.dump(to_hash) end |