Class: Io::Flow::V0::Models::AttributeIntent

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

Returns a new instance of AttributeIntent.



9345
9346
9347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9345

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9343
9344
9345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9343

def value
  @value
end

Class Method Details

.ALLObject



9365
9366
9367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9365

def AttributeIntent.ALL
  @@all ||= [AttributeIntent.brand, AttributeIntent.color, AttributeIntent.countries_of_origin, AttributeIntent.product_id, AttributeIntent.fulfillment_method, AttributeIntent.hazardous, AttributeIntent.price, AttributeIntent.size, AttributeIntent.sku, AttributeIntent.taxability, AttributeIntent.consumer_url, AttributeIntent.gtin, AttributeIntent.mpn]
end

.apply(value) ⇒ Object

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



9350
9351
9352
9353
9354
9355
9356
9357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9350

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

.brandObject

A brand name of the item (for retailers that sell multiple brands)



9370
9371
9372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9370

def AttributeIntent.brand
  @@_brand ||= AttributeIntent.new('brand')
end

.colorObject

The color of the item



9375
9376
9377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9375

def AttributeIntent.color
  @@_color ||= AttributeIntent.new('color')
end

.consumer_urlObject

A URL of the product detail page of the item



9422
9423
9424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9422

def AttributeIntent.consumer_url
  @@_consumer_url ||= AttributeIntent.new('consumer_url')
end

.countries_of_originObject

A space separate list of the countries of origin for this item



9380
9381
9382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9380

def AttributeIntent.countries_of_origin
  @@_countries_of_origin ||= AttributeIntent.new('countries_of_origin')
end

.from_string(value) ⇒ Object

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



9360
9361
9362
9363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9360

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

.fulfillment_methodObject

Identifies whether the item is a physical or digital good



9391
9392
9393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9391

def AttributeIntent.fulfillment_method
  @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method')
end

.gtinObject

The Global Trade Item Number of this item.



9427
9428
9429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9427

def AttributeIntent.gtin
  @@_gtin ||= AttributeIntent.new('gtin')
end

.hazardousObject

Identifies whether this item may contain hazardous materials



9396
9397
9398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9396

def AttributeIntent.hazardous
  @@_hazardous ||= AttributeIntent.new('hazardous')
end

.mpnObject

The Manufacturer Part Number of this item.



9432
9433
9434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9432

def AttributeIntent.mpn
  @@_mpn ||= AttributeIntent.new('mpn')
end

.priceObject

A price for the item in the organization’s base currency (will be localized based on each Experience’s pricing policy)



9402
9403
9404
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9402

def AttributeIntent.price
  @@_price ||= AttributeIntent.new('price')
end

.product_idObject

An identifier used to group items that are variations of the same product, such as different sizes or colors of the same shirt



9386
9387
9388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9386

def AttributeIntent.product_id
  @@_product_id ||= AttributeIntent.new('product_id')
end

.sizeObject

A size label of the item



9407
9408
9409
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9407

def AttributeIntent.size
  @@_size ||= AttributeIntent.new('size')
end

.skuObject

An SKU for the item



9412
9413
9414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9412

def AttributeIntent.sku
  @@_sku ||= AttributeIntent.new('sku')
end

.taxabilityObject

Identifies whether taxes are applicable to an item



9417
9418
9419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9417

def AttributeIntent.taxability
  @@_taxability ||= AttributeIntent.new('taxability')
end

Instance Method Details

#to_hashObject



9436
9437
9438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9436

def to_hash
  value
end