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.



10105
10106
10107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10105

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10103
10104
10105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10103

def value
  @value
end

Class Method Details

.ALLObject



10125
10126
10127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10125

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

.apply(value) ⇒ Object

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



10110
10111
10112
10113
10114
10115
10116
10117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10110

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)



10130
10131
10132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10130

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

.colorObject

The color of the item



10135
10136
10137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10135

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

.consumer_urlObject

A URL of the product detail page of the item



10182
10183
10184
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10182

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

.countries_of_originObject

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



10140
10141
10142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10140

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

.from_string(value) ⇒ Object

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



10120
10121
10122
10123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10120

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



10151
10152
10153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10151

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

.gtinObject

The Global Trade Item Number of this item.



10187
10188
10189
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10187

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

.hazardousObject

Identifies whether this item may contain hazardous materials



10156
10157
10158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10156

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

.mpnObject

The Manufacturer Part Number of this item.



10192
10193
10194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10192

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)



10162
10163
10164
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10162

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



10146
10147
10148
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10146

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

.sizeObject

A size label of the item



10167
10168
10169
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10167

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

.skuObject

An SKU for the item



10172
10173
10174
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10172

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

.taxabilityObject

Identifies whether taxes are applicable to an item



10177
10178
10179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10177

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

Instance Method Details

#to_hashObject



10196
10197
10198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10196

def to_hash
  value
end