Class: Io::Flow::V0::Models::SubcatalogItemStatus

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

Returns a new instance of SubcatalogItemStatus.



9772
9773
9774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9772

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9770
9771
9772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9770

def value
  @value
end

Class Method Details

.ALLObject



9792
9793
9794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9792

def SubcatalogItemStatus.ALL
  @@all ||= [SubcatalogItemStatus.excluded, SubcatalogItemStatus.included, SubcatalogItemStatus.restricted]
end

.apply(value) ⇒ Object

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



9777
9778
9779
9780
9781
9782
9783
9784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9777

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

.excludedObject

Item is excluded based on targeting query. This is separate from an item marked as restricted.



9798
9799
9800
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9798

def SubcatalogItemStatus.excluded
  @@_excluded ||= SubcatalogItemStatus.new('excluded')
end

.from_string(value) ⇒ Object

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



9787
9788
9789
9790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9787

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

.includedObject

Item is included



9803
9804
9805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9803

def SubcatalogItemStatus.included
  @@_included ||= SubcatalogItemStatus.new('included')
end

.restrictedObject

Item is restricted and will be treated as excluded



9808
9809
9810
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9808

def SubcatalogItemStatus.restricted
  @@_restricted ||= SubcatalogItemStatus.new('restricted')
end

Instance Method Details

#to_hashObject



9812
9813
9814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9812

def to_hash
  value
end