Class: Io::Flow::V0::Models::LocationErrorCode

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) ⇒ LocationErrorCode

Returns a new instance of LocationErrorCode.



19766
19767
19768
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19766

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19764
19765
19766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19764

def value
  @value
end

Class Method Details

.address_requiredObject

Indicates that a non empty address was not specified when required



19791
19792
19793
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19791

def LocationErrorCode.address_required
  @@_address_required ||= LocationErrorCode.new('address_required')
end

.ALLObject



19786
19787
19788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19786

def LocationErrorCode.ALL
  @@all ||= [LocationErrorCode.address_required, LocationErrorCode.ip_invalid, LocationErrorCode.ip_required, LocationErrorCode.timezone_unavailable]
end

.apply(value) ⇒ Object

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



19771
19772
19773
19774
19775
19776
19777
19778
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19771

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

.from_string(value) ⇒ Object

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



19781
19782
19783
19784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19781

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

.ip_invalidObject

Indicates the specified IP Address is invalid



19796
19797
19798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19796

def LocationErrorCode.ip_invalid
  @@_ip_invalid ||= LocationErrorCode.new('ip_invalid')
end

.ip_requiredObject

Indicates that a non empty IP Address was not specified when required



19801
19802
19803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19801

def LocationErrorCode.ip_required
  @@_ip_required ||= LocationErrorCode.new('ip_required')
end

.timezone_unavailableObject

Indicates that there is no timezone information available for the specified IP Address



19807
19808
19809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19807

def LocationErrorCode.timezone_unavailable
  @@_timezone_unavailable ||= LocationErrorCode.new('timezone_unavailable')
end

Instance Method Details

#to_hashObject



19811
19812
19813
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19811

def to_hash
  value
end