Class: Io::Flow::V0::Models::NotificationUpserted
- 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.
-
#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.
-
#notification_id ⇒ Object
readonly
Returns the value of attribute notification_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.
-
#package ⇒ Object
readonly
Returns the value of attribute package.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ NotificationUpserted
constructor
A new instance of NotificationUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ NotificationUpserted
Returns a new instance of NotificationUpserted.
21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21198 def initialize(incoming={}) super(:discriminator => Event::Types::NOTIFICATION_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :notification_id, :carrier_tracking_number, :flow_tracking_number, :destination, :origin, :carrier, :service, :order, :package], 'NotificationUpserted') @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) @notification_id = HttpClient::Preconditions.assert_class('notification_id', opts.delete(:notification_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) @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) @order = HttpClient::Preconditions.assert_class('order', opts.delete(:order), String) @package = HttpClient::Preconditions.assert_class('package', HttpClient::Helper.to_object(opts.delete(:package)), Hash) end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def carrier @carrier end |
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def carrier_tracking_number @carrier_tracking_number end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def event_id @event_id end |
#flow_tracking_number ⇒ Object (readonly)
Returns the value of attribute flow_tracking_number.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def flow_tracking_number @flow_tracking_number end |
#notification_id ⇒ Object (readonly)
Returns the value of attribute notification_id.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def notification_id @notification_id end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def order @order end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def organization @organization end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def origin @origin end |
#package ⇒ Object (readonly)
Returns the value of attribute package.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def package @package end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def service @service end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
21196 21197 21198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21196 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21220 21221 21222 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21220 def copy(incoming={}) NotificationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21224 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :notification_id => notification_id, :carrier_tracking_number => carrier_tracking_number, :flow_tracking_number => flow_tracking_number, :destination => destination, :origin => origin, :carrier => carrier, :service => service, :order => order, :package => package } end |
#to_json ⇒ Object
21216 21217 21218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21216 def to_json JSON.dump(to_hash) end |