Class: Io::Flow::V0::Models::Action
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Action
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
ActionDisplayInlineWindow, ActionExecuteScript, ActionRedirect, ActionSelectPaymentOption, ActionUndefinedType, ActionUseSdkAdyenV3, ActionUseSdkAdyenV4, ActionUseSdkApplepayJsCompleteValidation, ActionUseSdkApplepayJsCreateSession, ActionUseSdkGooglepay, ActionUseSdkKlarnaV1, ActionUseSdkPaypal, ActionUseSdkStripeV3, ActionWait
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ Action
constructor
A new instance of Action.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Action
Returns a new instance of Action.
9314 9315 9316 9317 9318 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9314 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type], 'Action') @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
9312 9313 9314 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9312 def type @type end |
Class Method Details
.from_json(hash) ⇒ Object
Instance Method Details
#subtype_to_hash ⇒ Object
9320 9321 9322 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9320 def subtype_to_hash raise 'Cannot serialize an instance of action directly - must use one of the specific types: action_redirect, action_use_sdk_klarna_v1, action_use_sdk_applepay_js_create_session, action_use_sdk_applepay_js_complete_validation, action_use_sdk_googlepay, action_use_sdk_paypal, action_use_sdk_stripe_v3, action_use_sdk_adyen_v3, action_use_sdk_adyen_v4, action_select_payment_option, action_execute_script, action_display_inline_window, action_wait' end |
#to_hash ⇒ Object
9324 9325 9326 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9324 def to_hash subtype_to_hash.merge(:type => @type) end |