Class: Io::Flow::V0::Models::GenericReservationError

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

Instance Attribute Summary collapse

Attributes inherited from ReservationError

#code

Instance Method Summary collapse

Methods inherited from ReservationError

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ GenericReservationError

Returns a new instance of GenericReservationError.



31865
31866
31867
31868
31869
31870
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31865

def initialize(incoming={})
  super(:code => ReservationError::Types::GENERIC_RESERVATION_ERROR)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:messages], 'GenericReservationError')
  @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



31863
31864
31865
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31863

def messages
  @messages
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31876
31877
31878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31876

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

#subtype_to_hashObject



31880
31881
31882
31883
31884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880

def subtype_to_hash
  {
    :messages => messages
  }
end

#to_jsonObject



31872
31873
31874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31872

def to_json
  JSON.dump(to_hash)
end