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.
-
#carrier_tracking_number_url ⇒ Object
readonly
Returns the value of attribute carrier_tracking_number_url.
-
#center_key ⇒ Object
readonly
Returns the value of attribute center_key.
-
#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.
-
#flow_tracking_number_url ⇒ Object
readonly
Returns the value of attribute flow_tracking_number_url.
-
#fulfillment_key ⇒ Object
readonly
Returns the value of attribute fulfillment_key.
-
#label_id ⇒ Object
readonly
Returns the value of attribute label_id.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#order_identifier ⇒ Object
readonly
Returns the value of attribute order_identifier.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
-
#png ⇒ Object
readonly
Returns the value of attribute png.
-
#recipient ⇒ Object
readonly
Returns the value of attribute recipient.
-
#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
Returns a new instance of LabelUpserted.
48198 48199 48200 48201 48202 48203 48204 48205 48206 48207 48208 48209 48210 48211 48212 48213 48214 48215 48216 48217 48218 48219 48220 48221 48222 48223 48224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48198 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) @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) @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 = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x)) @origin = (x = opts.delete(:origin); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x)) @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)) @carrier_tracking_number_url = (x = opts.delete(:carrier_tracking_number_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number_url', x, String)) @flow_tracking_number_url = (x = opts.delete(:flow_tracking_number_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number_url', x, String)) @center_key = (x = opts.delete(:center_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_key', x, String)) @recipient = (x = opts.delete(:recipient); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShipmentRecipient) ? x : ::Io::Flow::V0::Models::ShipmentRecipient.apply(x))) @package = (x = opts.delete(:package); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShippingLabelPackage) ? x : ::Io::Flow::V0::Models::ShippingLabelPackage.new(x))) @order_identifier = (x = opts.delete(:order_identifier); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_identifier', x, String)) @fulfillment_key = (x = opts.delete(:fulfillment_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('fulfillment_key', x, String)) end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def carrier @carrier end |
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def carrier_tracking_number @carrier_tracking_number end |
#carrier_tracking_number_url ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number_url.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def carrier_tracking_number_url @carrier_tracking_number_url end |
#center_key ⇒ Object (readonly)
Returns the value of attribute center_key.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def center_key @center_key end |
#commercial_invoice ⇒ Object (readonly)
Returns the value of attribute commercial_invoice.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def commercial_invoice @commercial_invoice end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def event_id @event_id end |
#flow_tracking_number ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def flow_tracking_number @flow_tracking_number end |
#flow_tracking_number_url ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number_url.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def flow_tracking_number_url @flow_tracking_number_url end |
#fulfillment_key ⇒ Object (readonly)
Returns the value of attribute fulfillment_key.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def fulfillment_key @fulfillment_key end |
#label_id ⇒ Object (readonly)
Returns the value of attribute label_id.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def label_id @label_id end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def order @order end |
#order_identifier ⇒ Object (readonly)
Returns the value of attribute order_identifier.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def order_identifier @order_identifier end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def organization @organization end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def origin @origin end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def package @package end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def pdf @pdf end |
#png ⇒ Object (readonly)
Returns the value of attribute png.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def png @png end |
#recipient ⇒ Object (readonly)
Returns the value of attribute recipient.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def recipient @recipient end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def service @service end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def @timestamp end |
#zpl ⇒ Object (readonly)
Returns the value of attribute zpl.
48196 48197 48198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48196 def zpl @zpl end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48230 48231 48232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48230 def copy(incoming={}) LabelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
48234 48235 48236 48237 48238 48239 48240 48241 48242 48243 48244 48245 48246 48247 48248 48249 48250 48251 48252 48253 48254 48255 48256 48257 48258 48259 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48234 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.to_hash, :origin => origin.to_hash, :carrier => carrier, :service => service, :zpl => zpl, :pdf => pdf, :png => png, :order => order, :carrier_tracking_number_url => carrier_tracking_number_url, :flow_tracking_number_url => flow_tracking_number_url, :center_key => center_key, :recipient => recipient.nil? ? nil : recipient.value, :package => package.nil? ? nil : package.to_hash, :order_identifier => order_identifier, :fulfillment_key => fulfillment_key } end |
#to_json ⇒ Object
48226 48227 48228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48226 def to_json JSON.dump(to_hash) end |