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.



7304
7305
7306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7304

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7302
7303
7304
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7302

def value
  @value
end

Class Method Details

.ALLObject



7324
7325
7326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7324

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



7309
7310
7311
7312
7313
7314
7315
7316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7309

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.



7330
7331
7332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7330

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



7319
7320
7321
7322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7319

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

.includedObject

Item is included



7335
7336
7337
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7335

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

.restrictedObject

Item is restricted and will be treated as excluded



7340
7341
7342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7340

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

Instance Method Details

#to_hashObject



7344
7345
7346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7344

def to_hash
  value
end