Class: Io::Flow::V0::Models::OrderQuoteLineErrorCode

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ OrderQuoteLineErrorCode

Returns a new instance of OrderQuoteLineErrorCode.



20814
20815
20816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20814

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20812
20813
20814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20812

def value
  @value
end

Class Method Details

.ALLObject



20834
20835
20836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20834

def OrderQuoteLineErrorCode.ALL
  @@all ||= [OrderQuoteLineErrorCode.line_item_number_invalid, OrderQuoteLineErrorCode.line_item_number_not_available, OrderQuoteLineErrorCode.line_quantity_invalid, OrderQuoteLineErrorCode.line_value_threshold_exceeded]
end

.apply(value) ⇒ Object

Returns the instance of OrderQuoteLineErrorCode for this value, creating a new instance for an unknown value



20819
20820
20821
20822
20823
20824
20825
20826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20819

def OrderQuoteLineErrorCode.apply(value)
  if value.instance_of?(OrderQuoteLineErrorCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || OrderQuoteLineErrorCode.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of OrderQuoteLineErrorCode for this value, or nil if not found



20829
20830
20831
20832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20829

def OrderQuoteLineErrorCode.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  OrderQuoteLineErrorCode.ALL.find { |v| v.value == value }
end

.line_item_number_invalidObject



20838
20839
20840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20838

def OrderQuoteLineErrorCode.line_item_number_invalid
  @@_line_item_number_invalid ||= OrderQuoteLineErrorCode.new('line_item_number_invalid')
end

.line_item_number_not_availableObject



20842
20843
20844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20842

def OrderQuoteLineErrorCode.line_item_number_not_available
  @@_line_item_number_not_available ||= OrderQuoteLineErrorCode.new('line_item_number_not_available')
end

.line_quantity_invalidObject



20846
20847
20848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20846

def OrderQuoteLineErrorCode.line_quantity_invalid
  @@_line_quantity_invalid ||= OrderQuoteLineErrorCode.new('line_quantity_invalid')
end

.line_value_threshold_exceededObject



20850
20851
20852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20850

def OrderQuoteLineErrorCode.line_value_threshold_exceeded
  @@_line_value_threshold_exceeded ||= OrderQuoteLineErrorCode.new('line_value_threshold_exceeded')
end

Instance Method Details

#to_hashObject



20854
20855
20856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20854

def to_hash
  value
end