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.
-
#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.
-
#zpl ⇒ Object
readonly
Returns the value of attribute zpl.
Attributes inherited from Event
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
16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16406 def initialize(incoming={}) super(:discriminator => Event::Types::LABEL_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :commercial_invoice, :flow_tracking_number, :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) @commercial_invoice = HttpClient::Preconditions.assert_class('commercial_invoice', opts.delete(:commercial_invoice), String) @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), 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) @zpl = (x = opts.delete(:zpl); x.nil? ? nil : HttpClient::Preconditions.assert_class('zpl', 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.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def carrier @carrier end |
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def carrier_tracking_number @carrier_tracking_number end |
#commercial_invoice ⇒ Object (readonly)
Returns the value of attribute commercial_invoice.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def commercial_invoice @commercial_invoice end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def event_id @event_id end |
#flow_tracking_number ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def flow_tracking_number @flow_tracking_number end |
#label_id ⇒ Object (readonly)
Returns the value of attribute label_id.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def label_id @label_id end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def order @order end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def organization @organization end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def origin @origin end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def pdf @pdf end |
#png ⇒ Object (readonly)
Returns the value of attribute png.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def png @png end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def service @service end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def end |
#zpl ⇒ Object (readonly)
Returns the value of attribute zpl.
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def zpl @zpl end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16431 16432 16433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16431 def copy(incoming={}) LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16435 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :label_id => label_id, :carrier_tracking_number => carrier_tracking_number, :commercial_invoice => commercial_invoice, :flow_tracking_number => flow_tracking_number, :destination => destination, :origin => origin, :carrier => carrier, :service => service, :zpl => zpl, :pdf => pdf, :png => png, :order => order } end |
#to_json ⇒ Object
16427 16428 16429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16427 def to_json JSON.dump(to_hash) end |