Class: Io::Flow::V0::Models::InstallmentPlanPaymentError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ InstallmentPlanPaymentError

Returns a new instance of InstallmentPlanPaymentError.



26416
26417
26418
26419
26420
26421
26422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26416

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:code, :messages, :codes], 'InstallmentPlanPaymentError')
  @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::InstallmentPlanPaymentErrorCode) ? x : ::Io::Flow::V0::Models::InstallmentPlanPaymentErrorCode.apply(x))
  @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
  @codes = HttpClient::Preconditions.assert_class('codes', opts.delete(:codes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::InstallmentPlanPaymentErrorCode) ? x : ::Io::Flow::V0::Models::InstallmentPlanPaymentErrorCode.apply(x)) }
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



26414
26415
26416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26414

def code
  @code
end

#codesObject (readonly)

Returns the value of attribute codes.



26414
26415
26416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26414

def codes
  @codes
end

#messagesObject (readonly)

Returns the value of attribute messages.



26414
26415
26416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26414

def messages
  @messages
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26428
26429
26430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26428

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

#to_hashObject



26432
26433
26434
26435
26436
26437
26438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26432

def to_hash
  {
    :code => code.value,
    :messages => messages,
    :codes => codes.map { |o| o.value }
  }
end

#to_jsonObject



26424
26425
26426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26424

def to_json
  JSON.dump(to_hash)
end