Class: Io::Flow::V0::Models::PaymentRequestUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#payment_request ⇒ Object
readonly
Returns the value of attribute payment_request.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentRequestUpserted
constructor
A new instance of PaymentRequestUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ PaymentRequestUpserted
Returns a new instance of PaymentRequestUpserted.
58936 58937 58938 58939 58940 58941 58942 58943 58944 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58936 def initialize(incoming={}) super(:discriminator => Event::Types::PAYMENT_REQUEST_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :payment_request], 'PaymentRequestUpserted') @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) @payment_request = (x = opts.delete(:payment_request); x.is_a?(::Io::Flow::V0::Models::PaymentRequest) ? x : ::Io::Flow::V0::Models::PaymentRequest.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
58934 58935 58936 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58934 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
58934 58935 58936 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58934 def organization @organization end |
#payment_request ⇒ Object (readonly)
Returns the value of attribute payment_request.
58934 58935 58936 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58934 def payment_request @payment_request end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
58934 58935 58936 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58934 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
58950 58951 58952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58950 def copy(incoming={}) PaymentRequestUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
58954 58955 58956 58957 58958 58959 58960 58961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58954 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :payment_request => payment_request.to_hash } end |
#to_json ⇒ Object
58946 58947 58948 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58946 def to_json JSON.dump(to_hash) end |