Class: Io::Flow::V0::Models::AuthorizationUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#card ⇒ Object
readonly
Returns the value of attribute card.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AuthorizationUpserted
constructor
A new instance of AuthorizationUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ AuthorizationUpserted
14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14716 def initialize(incoming={}) super(:discriminator => Event::Types::AUTHORIZATION_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :card, :amount, :currency, :customer, :attributes, :result, :created_at], 'AuthorizationUpserted') @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) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::ExpandableCard) ? x : ::Io::Flow::V0::Models::ExpandableCard.from_json(x)) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @customer = (x = opts.delete(:customer); x.is_a?(::Io::Flow::V0::Models::Customer) ? x : ::Io::Flow::V0::Models::Customer.new(x)) @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h } @destination = (x = opts.delete(:destination); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))) @result = (x = opts.delete(:result); x.is_a?(::Io::Flow::V0::Models::AuthorizationResult) ? x : ::Io::Flow::V0::Models::AuthorizationResult.new(x)) @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def attributes @attributes end |
#card ⇒ Object (readonly)
Returns the value of attribute card.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def card @card end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def currency @currency end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def customer @customer end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def destination @destination end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def event_id @event_id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def ip @ip end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def order_number @order_number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def organization @organization end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def result @result end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
14740 14741 14742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14740 def copy(incoming={}) AuthorizationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14744 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :key => key, :order_number => order_number, :card => card.to_hash, :amount => amount, :currency => currency, :customer => customer.to_hash, :attributes => attributes, :destination => destination.nil? ? nil : destination.to_hash, :result => result.to_hash, :ip => ip, :created_at => created_at } end |
#to_json ⇒ Object
14736 14737 14738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14736 def to_json JSON.dump(to_hash) end |