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.



9213
9214
9215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9213

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9211
9212
9213
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9211

def value
  @value
end

Class Method Details

.ALLObject



9233
9234
9235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9233

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



9218
9219
9220
9221
9222
9223
9224
9225
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9218

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.



9239
9240
9241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9239

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



9228
9229
9230
9231
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9228

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

.includedObject

Item is included



9244
9245
9246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9244

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

.restrictedObject

Item is restricted and will be treated as excluded



9249
9250
9251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9249

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

Instance Method Details

#to_hashObject



9253
9254
9255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9253

def to_hash
  value
end