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.



12109
12110
12111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12109

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12107
12108
12109
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12107

def value
  @value
end

Class Method Details

.ALLObject



12129
12130
12131
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12129

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



12114
12115
12116
12117
12118
12119
12120
12121
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12114

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)



12134
12135
12136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12134

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

.colorObject

The color of the item



12139
12140
12141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12139

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

.consumer_urlObject

A URL of the product detail page of the item



12186
12187
12188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12186

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



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

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.



12202
12203
12204
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12202

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

.facetObject

Identifies a facet.



12207
12208
12209
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12207

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



12124
12125
12126
12127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12124

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



12155
12156
12157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12155

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

.gtinObject

The Global Trade Item Number of this item.



12191
12192
12193
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12191

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

.hazardousObject

Identifies whether this item may contain hazardous materials



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

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

.mpnObject

The Manufacturer Part Number of this item.



12196
12197
12198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12196

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)



12166
12167
12168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12166

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



12150
12151
12152
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12150

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

.sizeObject

A size label of the item



12171
12172
12173
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12171

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

.skuObject

An SKU for the item



12176
12177
12178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12176

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

.taxabilityObject

Identifies whether taxes are applicable to an item



12181
12182
12183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12181

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

Instance Method Details

#to_hashObject



12211
12212
12213
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12211

def to_hash
  value
end