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.



12102
12103
12104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12102

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12100
12101
12102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12100

def value
  @value
end

Class Method Details

.ALLObject



12122
12123
12124
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12122

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

.apply(value) ⇒ Object

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



12107
12108
12109
12110
12111
12112
12113
12114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12107

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)



12127
12128
12129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12127

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

.colorObject

The color of the item



12132
12133
12134
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12132

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

.consumer_urlObject

A URL of the product detail page of the item



12179
12180
12181
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12179

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



12137
12138
12139
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12137

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

.facetObject

Identifies a facet.



12194
12195
12196
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12194

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



12117
12118
12119
12120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12117

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



12148
12149
12150
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12148

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

.gtinObject

The Global Trade Item Number of this item.



12184
12185
12186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12184

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

.hazardousObject

Identifies whether this item may contain hazardous materials



12153
12154
12155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12153

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

.mpnObject

The Manufacturer Part Number of this item.



12189
12190
12191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12189

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)



12159
12160
12161
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12159

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



12143
12144
12145
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12143

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

.sizeObject

A size label of the item



12164
12165
12166
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12164

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

.skuObject

An SKU for the item



12169
12170
12171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12169

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

.taxabilityObject

Identifies whether taxes are applicable to an item



12174
12175
12176
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12174

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

Instance Method Details

#to_hashObject



12198
12199
12200
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12198

def to_hash
  value
end