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.



8299
8300
8301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8299

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8297
8298
8299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8297

def value
  @value
end

Class Method Details

.ALLObject



8319
8320
8321
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8319

def AttributeIntent.ALL
  @@all ||= [AttributeIntent.brand, 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



8304
8305
8306
8307
8308
8309
8310
8311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8304

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)



8324
8325
8326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8324

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

.consumer_urlObject

A URL of the product detail page of the item



8366
8367
8368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8366

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

.from_string(value) ⇒ Object

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



8314
8315
8316
8317
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8314

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



8335
8336
8337
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8335

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

.gtinObject

The Global Trade Item Number of this item.



8371
8372
8373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8371

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

.hazardousObject

Identifies whether this item may contain hazardous materials



8340
8341
8342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8340

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

.mpnObject

The Manufacturer Part Number of this item.



8376
8377
8378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8376

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)



8346
8347
8348
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8346

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



8330
8331
8332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8330

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

.sizeObject

A size label of the item



8351
8352
8353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8351

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

.skuObject

An SKU for the item



8356
8357
8358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8356

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

.taxabilityObject

Identifies whether taxes are applicable to an item



8361
8362
8363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8361

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

Instance Method Details

#to_hashObject



8380
8381
8382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8380

def to_hash
  value
end