class UltracartClient::Item

Attributes

accounting[RW]
amember[RW]
auto_order[RW]
ccbill[RW]
channel_partner_item_mappings[RW]

Channel Partner Item Mapping

chargeback[RW]
checkout[RW]
content[RW]
creation_dts[RW]

Date/time of creation

description[RW]

Description of the item up to 500 characters.

description_translated_text_instance_oid[RW]

Description translated text instance id

digital_delivery[RW]
ebay[RW]
email_notifications[RW]
enrollment123[RW]
gift_certificate[RW]
identifiers[RW]
inactive[RW]

True if this item is inactive and can not be purchased

instant_payment_notifications[RW]
internal[RW]
kit[RW]

True if this item is a kit

kit_component_only[RW]

True if this item can only be usd as a kit component

kit_definition[RW]
last_modified_dts[RW]

Date/time of last modification

merchant_id[RW]

UltraCart merchant ID owning item

merchant_item_id[RW]

Unique item id assigned to this item

merchant_item_oid[RW]

Unique object identifier for this item

options[RW]

Options

parent_category_id[RW]

Parent category of the item. Zero indicates the root folder.

parent_category_path[RW]

Parent category path. / indicates the root folder.

payment_processing[RW]
physical[RW]
pricing[RW]
properties[RW]

Properties

realtime_pricing[RW]
recommend_replenishment_days[RW]

Number of days to recommend replenishment after. Null is not configured. Set to zero to disable.

reporting[RW]
restriction[RW]
revguard[RW]
reviews[RW]
salesforce[RW]
shipping[RW]
tags[RW]
tax[RW]
third_party_email_marketing[RW]

3rd Party Email Marketing

variant_items[RW]

Variant Items

variations[RW]

Variations

wishlist_member[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/ultracart_api/models/item.rb, line 137
def self.attribute_map
  {
    :'accounting' => :'accounting',
    :'amember' => :'amember',
    :'auto_order' => :'auto_order',
    :'ccbill' => :'ccbill',
    :'channel_partner_item_mappings' => :'channel_partner_item_mappings',
    :'chargeback' => :'chargeback',
    :'checkout' => :'checkout',
    :'content' => :'content',
    :'creation_dts' => :'creation_dts',
    :'description' => :'description',
    :'description_translated_text_instance_oid' => :'description_translated_text_instance_oid',
    :'digital_delivery' => :'digital_delivery',
    :'ebay' => :'ebay',
    :'email_notifications' => :'email_notifications',
    :'enrollment123' => :'enrollment123',
    :'gift_certificate' => :'gift_certificate',
    :'google_product_search' => :'google_product_search',
    :'identifiers' => :'identifiers',
    :'inactive' => :'inactive',
    :'instant_payment_notifications' => :'instant_payment_notifications',
    :'internal' => :'internal',
    :'kit' => :'kit',
    :'kit_component_only' => :'kit_component_only',
    :'kit_definition' => :'kit_definition',
    :'last_modified_dts' => :'last_modified_dts',
    :'merchant_id' => :'merchant_id',
    :'merchant_item_id' => :'merchant_item_id',
    :'merchant_item_oid' => :'merchant_item_oid',
    :'options' => :'options',
    :'parent_category_id' => :'parent_category_id',
    :'parent_category_path' => :'parent_category_path',
    :'payment_processing' => :'payment_processing',
    :'physical' => :'physical',
    :'pricing' => :'pricing',
    :'properties' => :'properties',
    :'realtime_pricing' => :'realtime_pricing',
    :'recommend_replenishment_days' => :'recommend_replenishment_days',
    :'related' => :'related',
    :'reporting' => :'reporting',
    :'restriction' => :'restriction',
    :'revguard' => :'revguard',
    :'reviews' => :'reviews',
    :'salesforce' => :'salesforce',
    :'shipping' => :'shipping',
    :'tags' => :'tags',
    :'tax' => :'tax',
    :'third_party_email_marketing' => :'third_party_email_marketing',
    :'variant_items' => :'variant_items',
    :'variations' => :'variations',
    :'wishlist_member' => :'wishlist_member'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/ultracart_api/models/item.rb, line 250
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'accounting')
    self.accounting = attributes[:'accounting']
  end

  if attributes.has_key?(:'amember')
    self.amember = attributes[:'amember']
  end

  if attributes.has_key?(:'auto_order')
    self.auto_order = attributes[:'auto_order']
  end

  if attributes.has_key?(:'ccbill')
    self.ccbill = attributes[:'ccbill']
  end

  if attributes.has_key?(:'channel_partner_item_mappings')
    if (value = attributes[:'channel_partner_item_mappings']).is_a?(Array)
      self.channel_partner_item_mappings = value
    end
  end

  if attributes.has_key?(:'chargeback')
    self.chargeback = attributes[:'chargeback']
  end

  if attributes.has_key?(:'checkout')
    self.checkout = attributes[:'checkout']
  end

  if attributes.has_key?(:'content')
    self.content = attributes[:'content']
  end

  if attributes.has_key?(:'creation_dts')
    self.creation_dts = attributes[:'creation_dts']
  end

  if attributes.has_key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.has_key?(:'description_translated_text_instance_oid')
    self.description_translated_text_instance_oid = attributes[:'description_translated_text_instance_oid']
  end

  if attributes.has_key?(:'digital_delivery')
    self.digital_delivery = attributes[:'digital_delivery']
  end

  if attributes.has_key?(:'ebay')
    self.ebay = attributes[:'ebay']
  end

  if attributes.has_key?(:'email_notifications')
    self.email_notifications = attributes[:'email_notifications']
  end

  if attributes.has_key?(:'enrollment123')
    self.enrollment123 = attributes[:'enrollment123']
  end

  if attributes.has_key?(:'gift_certificate')
    self.gift_certificate = attributes[:'gift_certificate']
  end

  if attributes.has_key?(:'google_product_search')
    self.google_product_search = attributes[:'google_product_search']
  end

  if attributes.has_key?(:'identifiers')
    self.identifiers = attributes[:'identifiers']
  end

  if attributes.has_key?(:'inactive')
    self.inactive = attributes[:'inactive']
  end

  if attributes.has_key?(:'instant_payment_notifications')
    self.instant_payment_notifications = attributes[:'instant_payment_notifications']
  end

  if attributes.has_key?(:'internal')
    self.internal = attributes[:'internal']
  end

  if attributes.has_key?(:'kit')
    self.kit = attributes[:'kit']
  end

  if attributes.has_key?(:'kit_component_only')
    self.kit_component_only = attributes[:'kit_component_only']
  end

  if attributes.has_key?(:'kit_definition')
    self.kit_definition = attributes[:'kit_definition']
  end

  if attributes.has_key?(:'last_modified_dts')
    self.last_modified_dts = attributes[:'last_modified_dts']
  end

  if attributes.has_key?(:'merchant_id')
    self.merchant_id = attributes[:'merchant_id']
  end

  if attributes.has_key?(:'merchant_item_id')
    self.merchant_item_id = attributes[:'merchant_item_id']
  end

  if attributes.has_key?(:'merchant_item_oid')
    self.merchant_item_oid = attributes[:'merchant_item_oid']
  end

  if attributes.has_key?(:'options')
    if (value = attributes[:'options']).is_a?(Array)
      self.options = value
    end
  end

  if attributes.has_key?(:'parent_category_id')
    self.parent_category_id = attributes[:'parent_category_id']
  end

  if attributes.has_key?(:'parent_category_path')
    self.parent_category_path = attributes[:'parent_category_path']
  end

  if attributes.has_key?(:'payment_processing')
    self.payment_processing = attributes[:'payment_processing']
  end

  if attributes.has_key?(:'physical')
    self.physical = attributes[:'physical']
  end

  if attributes.has_key?(:'pricing')
    self.pricing = attributes[:'pricing']
  end

  if attributes.has_key?(:'properties')
    if (value = attributes[:'properties']).is_a?(Array)
      self.properties = value
    end
  end

  if attributes.has_key?(:'realtime_pricing')
    self.realtime_pricing = attributes[:'realtime_pricing']
  end

  if attributes.has_key?(:'recommend_replenishment_days')
    self.recommend_replenishment_days = attributes[:'recommend_replenishment_days']
  end

  if attributes.has_key?(:'related')
    self.related = attributes[:'related']
  end

  if attributes.has_key?(:'reporting')
    self.reporting = attributes[:'reporting']
  end

  if attributes.has_key?(:'restriction')
    self.restriction = attributes[:'restriction']
  end

  if attributes.has_key?(:'revguard')
    self.revguard = attributes[:'revguard']
  end

  if attributes.has_key?(:'reviews')
    self.reviews = attributes[:'reviews']
  end

  if attributes.has_key?(:'salesforce')
    self.salesforce = attributes[:'salesforce']
  end

  if attributes.has_key?(:'shipping')
    self.shipping = attributes[:'shipping']
  end

  if attributes.has_key?(:'tags')
    self.tags = attributes[:'tags']
  end

  if attributes.has_key?(:'tax')
    self.tax = attributes[:'tax']
  end

  if attributes.has_key?(:'third_party_email_marketing')
    if (value = attributes[:'third_party_email_marketing']).is_a?(Array)
      self.third_party_email_marketing = value
    end
  end

  if attributes.has_key?(:'variant_items')
    if (value = attributes[:'variant_items']).is_a?(Array)
      self.variant_items = value
    end
  end

  if attributes.has_key?(:'variations')
    if (value = attributes[:'variations']).is_a?(Array)
      self.variations = value
    end
  end

  if attributes.has_key?(:'wishlist_member')
    self.wishlist_member = attributes[:'wishlist_member']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/ultracart_api/models/item.rb, line 193
def self.swagger_types
  {
    :'accounting' => :'ItemAccounting',
    :'amember' => :'ItemAmember',
    :'auto_order' => :'ItemAutoOrder',
    :'ccbill' => :'ItemCCBill',
    :'channel_partner_item_mappings' => :'Array<ItemChannelPartnerMapping>',
    :'chargeback' => :'ItemChargeback',
    :'checkout' => :'ItemCheckout',
    :'content' => :'ItemContent',
    :'creation_dts' => :'String',
    :'description' => :'String',
    :'description_translated_text_instance_oid' => :'Integer',
    :'digital_delivery' => :'ItemDigitalDelivery',
    :'ebay' => :'ItemEbay',
    :'email_notifications' => :'ItemEmailNotifications',
    :'enrollment123' => :'ItemEnrollment123',
    :'gift_certificate' => :'ItemGiftCertificate',
    :'google_product_search' => :'ItemGoogleProductSearch',
    :'identifiers' => :'ItemIdentifiers',
    :'inactive' => :'BOOLEAN',
    :'instant_payment_notifications' => :'ItemInstantPaymentNotifications',
    :'internal' => :'ItemInternal',
    :'kit' => :'BOOLEAN',
    :'kit_component_only' => :'BOOLEAN',
    :'kit_definition' => :'ItemKitDefinition',
    :'last_modified_dts' => :'String',
    :'merchant_id' => :'String',
    :'merchant_item_id' => :'String',
    :'merchant_item_oid' => :'Integer',
    :'options' => :'Array<ItemOption>',
    :'parent_category_id' => :'Integer',
    :'parent_category_path' => :'String',
    :'payment_processing' => :'ItemPaymentProcessing',
    :'physical' => :'ItemPhysical',
    :'pricing' => :'ItemPricing',
    :'properties' => :'Array<ItemProperty>',
    :'realtime_pricing' => :'ItemRealtimePricing',
    :'recommend_replenishment_days' => :'Integer',
    :'related' => :'ItemRelated',
    :'reporting' => :'ItemReporting',
    :'restriction' => :'ItemRestriction',
    :'revguard' => :'ItemRevguard',
    :'reviews' => :'ItemReviews',
    :'salesforce' => :'ItemSalesforce',
    :'shipping' => :'ItemShipping',
    :'tags' => :'ItemTags',
    :'tax' => :'ItemTax',
    :'third_party_email_marketing' => :'Array<ItemThirdPartyEmailMarketing>',
    :'variant_items' => :'Array<ItemVariantItem>',
    :'variations' => :'Array<ItemVariation>',
    :'wishlist_member' => :'ItemWishlistMember'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/ultracart_api/models/item.rb, line 529
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      accounting == o.accounting &&
      amember == o.amember &&
      auto_order == o.auto_order &&
      ccbill == o.ccbill &&
      channel_partner_item_mappings == o.channel_partner_item_mappings &&
      chargeback == o.chargeback &&
      checkout == o.checkout &&
      content == o.content &&
      creation_dts == o.creation_dts &&
      description == o.description &&
      description_translated_text_instance_oid == o.description_translated_text_instance_oid &&
      digital_delivery == o.digital_delivery &&
      ebay == o.ebay &&
      email_notifications == o.email_notifications &&
      enrollment123 == o.enrollment123 &&
      gift_certificate == o.gift_certificate &&
      google_product_search == o.google_product_search &&
      identifiers == o.identifiers &&
      inactive == o.inactive &&
      instant_payment_notifications == o.instant_payment_notifications &&
      internal == o.internal &&
      kit == o.kit &&
      kit_component_only == o.kit_component_only &&
      kit_definition == o.kit_definition &&
      last_modified_dts == o.last_modified_dts &&
      merchant_id == o.merchant_id &&
      merchant_item_id == o.merchant_item_id &&
      merchant_item_oid == o.merchant_item_oid &&
      options == o.options &&
      parent_category_id == o.parent_category_id &&
      parent_category_path == o.parent_category_path &&
      payment_processing == o.payment_processing &&
      physical == o.physical &&
      pricing == o.pricing &&
      properties == o.properties &&
      realtime_pricing == o.realtime_pricing &&
      recommend_replenishment_days == o.recommend_replenishment_days &&
      related == o.related &&
      reporting == o.reporting &&
      restriction == o.restriction &&
      revguard == o.revguard &&
      reviews == o.reviews &&
      salesforce == o.salesforce &&
      shipping == o.shipping &&
      tags == o.tags &&
      tax == o.tax &&
      third_party_email_marketing == o.third_party_email_marketing &&
      variant_items == o.variant_items &&
      variations == o.variations &&
      wishlist_member == o.wishlist_member
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/ultracart_api/models/item.rb, line 620
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = UltracartClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/ultracart_api/models/item.rb, line 686
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/ultracart_api/models/item.rb, line 599
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
description=(description) click to toggle source

Custom attribute writer method with validation @param [Object] description Value to be assigned

# File lib/ultracart_api/models/item.rb, line 499
def description=(description)
  if !description.nil? && description.to_s.length > 512
    fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 512.'
  end

  @description = description
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/ultracart_api/models/item.rb, line 586
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/ultracart_api/models/item.rb, line 592
def hash
  [accounting, amember, auto_order, ccbill, channel_partner_item_mappings, chargeback, checkout, content, creation_dts, description, description_translated_text_instance_oid, digital_delivery, ebay, email_notifications, enrollment123, gift_certificate, google_product_search, identifiers, inactive, instant_payment_notifications, internal, kit, kit_component_only, kit_definition, last_modified_dts, merchant_id, merchant_item_id, merchant_item_oid, options, parent_category_id, parent_category_path, payment_processing, physical, pricing, properties, realtime_pricing, recommend_replenishment_days, related, reporting, restriction, revguard, reviews, salesforce, shipping, tags, tax, third_party_email_marketing, variant_items, variations, wishlist_member].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/ultracart_api/models/item.rb, line 471
def list_invalid_properties
  invalid_properties = Array.new
  if !@description.nil? && @description.to_s.length > 512
    invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 512.')
  end

  if !@merchant_id.nil? && @merchant_id.to_s.length > 5
    invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
  end

  if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
    invalid_properties.push('invalid value for "merchant_item_id", the character length must be smaller than or equal to 20.')
  end

  invalid_properties
end
merchant_id=(merchant_id) click to toggle source

Custom attribute writer method with validation @param [Object] merchant_id Value to be assigned

# File lib/ultracart_api/models/item.rb, line 509
def merchant_id=(merchant_id)
  if !merchant_id.nil? && merchant_id.to_s.length > 5
    fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
  end

  @merchant_id = merchant_id
end
merchant_item_id=(merchant_item_id) click to toggle source

Custom attribute writer method with validation @param [Object] merchant_item_id Value to be assigned

# File lib/ultracart_api/models/item.rb, line 519
def merchant_item_id=(merchant_item_id)
  if !merchant_item_id.nil? && merchant_item_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "merchant_item_id", the character length must be smaller than or equal to 20.'
  end

  @merchant_item_id = merchant_item_id
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/ultracart_api/models/item.rb, line 666
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/ultracart_api/models/item.rb, line 672
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/ultracart_api/models/item.rb, line 660
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/ultracart_api/models/item.rb, line 490
def valid?
  return false if !@description.nil? && @description.to_s.length > 512
  return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
  return false if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
  true
end