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.



10344
10345
10346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10344

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10342
10343
10344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10342

def value
  @value
end

Class Method Details

.ALLObject



10364
10365
10366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10364

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, AttributeIntent.excluded_regions]
end

.apply(value) ⇒ Object

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



10349
10350
10351
10352
10353
10354
10355
10356
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10349

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)



10369
10370
10371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10369

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

.colorObject

The color of the item



10374
10375
10376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10374

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

.consumer_urlObject

A URL of the product detail page of the item



10421
10422
10423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10421

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

.countries_of_originObject

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



10379
10380
10381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10379

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

.excluded_regionsObject

A space separated list of the regions (as defined in api.flow.io/reference/regions) where the item must be excluded.



10437
10438
10439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10437

def AttributeIntent.excluded_regions
  @@_excluded_regions ||= AttributeIntent.new('excluded_regions')
end

.from_string(value) ⇒ Object

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



10359
10360
10361
10362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10359

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



10390
10391
10392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10390

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

.gtinObject

The Global Trade Item Number of this item.



10426
10427
10428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10426

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

.hazardousObject

Identifies whether this item may contain hazardous materials



10395
10396
10397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10395

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

.mpnObject

The Manufacturer Part Number of this item.



10431
10432
10433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10431

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)



10401
10402
10403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10401

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



10385
10386
10387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10385

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

.sizeObject

A size label of the item



10406
10407
10408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10406

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

.skuObject

An SKU for the item



10411
10412
10413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10411

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

.taxabilityObject

Identifies whether taxes are applicable to an item



10416
10417
10418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10416

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

Instance Method Details

#to_hashObject



10441
10442
10443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10441

def to_hash
  value
end