Class: Io::Flow::V0::Models::OrderQuoteLineError

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 = {}) ⇒ OrderQuoteLineError

Returns a new instance of OrderQuoteLineError.



53187
53188
53189
53190
53191
53192
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53187

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:code, :message], 'OrderQuoteLineError')
  @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::OrderQuoteLineErrorCode) ? x : ::Io::Flow::V0::Models::OrderQuoteLineErrorCode.apply(x))
  @message = HttpClient::Preconditions.assert_class('message', opts.delete(:message), String)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



53185
53186
53187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53185

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



53185
53186
53187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53185

def message
  @message
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53198
53199
53200
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53198

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

#to_hashObject



53202
53203
53204
53205
53206
53207
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53202

def to_hash
  {
    :code => code.value,
    :message => message
  }
end

#to_jsonObject



53194
53195
53196
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53194

def to_json
  JSON.dump(to_hash)
end