Class: Io::Flow::V0::Models::CardUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#expiration ⇒ Object
readonly
Returns the value of attribute expiration.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#iin ⇒ Object
readonly
Returns the value of attribute iin.
-
#last4 ⇒ Object
readonly
Returns the value of attribute last4.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardUpserted
constructor
A new instance of CardUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ CardUpserted
Returns a new instance of CardUpserted.
15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15923 def initialize(incoming={}) super(:discriminator => Event::Types::CARD_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :type, :expiration, :iin, :last4, :name], 'CardUpserted') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) @expiration = (x = opts.delete(:expiration); x.is_a?(::Io::Flow::V0::Models::Expiration) ? x : ::Io::Flow::V0::Models::Expiration.new(x)) @iin = HttpClient::Preconditions.assert_class('iin', opts.delete(:iin), String) @last4 = HttpClient::Preconditions.assert_class('last4', opts.delete(:last4), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def address @address end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def event_id @event_id end |
#expiration ⇒ Object (readonly)
Returns the value of attribute expiration.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def expiration @expiration end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def id @id end |
#iin ⇒ Object (readonly)
Returns the value of attribute iin.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def iin @iin end |
#last4 ⇒ Object (readonly)
Returns the value of attribute last4.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def last4 @last4 end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
15921 15922 15923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15921 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15943 15944 15945 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15943 def copy(incoming={}) CardUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15947 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :id => id, :type => type, :expiration => expiration.to_hash, :iin => iin, :last4 => last4, :name => name, :address => address.nil? ? nil : address.to_hash } end |
#to_json ⇒ Object
15939 15940 15941 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15939 def to_json JSON.dump(to_hash) end |