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.



11401
11402
11403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11401

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11399
11400
11401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11399

def value
  @value
end

Class Method Details

.ALLObject



11421
11422
11423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11421

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

.apply(value) ⇒ Object

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



11406
11407
11408
11409
11410
11411
11412
11413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11406

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)



11426
11427
11428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11426

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

.colorObject

The color of the item



11431
11432
11433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11431

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

.consumer_urlObject

A URL of the product detail page of the item



11478
11479
11480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11478

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



11436
11437
11438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11436

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.



11494
11495
11496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11494

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

.facetObject

Identifies a facet.



11499
11500
11501
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11499

def AttributeIntent.facet
  @@_facet ||= AttributeIntent.new('facet')
end

.from_string(value) ⇒ Object

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



11416
11417
11418
11419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11416

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



11447
11448
11449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11447

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

.gtinObject

The Global Trade Item Number of this item.



11483
11484
11485
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11483

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

.hazardousObject

Identifies whether this item may contain hazardous materials



11452
11453
11454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11452

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

.mpnObject

The Manufacturer Part Number of this item.



11488
11489
11490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11488

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)



11458
11459
11460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11458

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



11442
11443
11444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11442

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

.sizeObject

A size label of the item



11463
11464
11465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11463

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

.skuObject

An SKU for the item



11468
11469
11470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11468

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

.taxabilityObject

Identifies whether taxes are applicable to an item



11473
11474
11475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11473

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

Instance Method Details

#to_hashObject



11503
11504
11505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11503

def to_hash
  value
end