Class: Io::Flow::V0::Models::SetupBlocked

Inherits:
OnboardingState show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

The onboarding process is blocked by an issue that requires escalation

Instance Attribute Summary collapse

Attributes inherited from OnboardingState

#discriminator

Instance Method Summary collapse

Methods inherited from OnboardingState

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ SetupBlocked

Returns a new instance of SetupBlocked.



65763
65764
65765
65766
65767
65768
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65763

def initialize(incoming={})
  super(:discriminator => OnboardingState::Types::SETUP_BLOCKED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:reasons], 'SetupBlocked')
  @reasons = HttpClient::Preconditions.assert_class('reasons', opts.delete(:reasons), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OnboardingBlockedReason) ? x : ::Io::Flow::V0::Models::OnboardingBlockedReason.apply(x)) }
end

Instance Attribute Details

#reasonsObject (readonly)

Returns the value of attribute reasons.



65761
65762
65763
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65761

def reasons
  @reasons
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



65774
65775
65776
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65774

def copy(incoming={})
  SetupBlocked.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



65778
65779
65780
65781
65782
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65778

def subtype_to_hash
  {
    :reasons => reasons.map { |o| o.value }
  }
end

#to_jsonObject



65770
65771
65772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65770

def to_json
  JSON.dump(to_hash)
end