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.



9172
9173
9174
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9172

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9170
9171
9172
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9170

def value
  @value
end

Class Method Details

.ALLObject



9192
9193
9194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9192

def AttributeIntent.ALL
  @@all ||= [AttributeIntent.brand, 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



9177
9178
9179
9180
9181
9182
9183
9184
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9177

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)



9197
9198
9199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9197

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

.consumer_urlObject

A URL of the product detail page of the item



9239
9240
9241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9239

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

.from_string(value) ⇒ Object

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



9187
9188
9189
9190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9187

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



9208
9209
9210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9208

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

.gtinObject

The Global Trade Item Number of this item.



9244
9245
9246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9244

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

.hazardousObject

Identifies whether this item may contain hazardous materials



9213
9214
9215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9213

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

.mpnObject

The Manufacturer Part Number of this item.



9249
9250
9251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9249

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)



9219
9220
9221
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9219

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



9203
9204
9205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9203

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

.sizeObject

A size label of the item



9224
9225
9226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9224

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

.skuObject

An SKU for the item



9229
9230
9231
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9229

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

.taxabilityObject

Identifies whether taxes are applicable to an item



9234
9235
9236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9234

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

Instance Method Details

#to_hashObject



9253
9254
9255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9253

def to_hash
  value
end