Class: Inttegro::PurchaseIntent::Variant

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/inttegro/purchase_intent/variant.rb

Overview

Typed representation of the variant object in the Inttegro API.

This generated model is immutable. Construct it with .new, or decode a string-keyed API payload with .from_hash. #serialize produces a string-keyed hash using the original wire field names and serialized enum values.

Instance Attribute Summary collapse

Instance Attribute Details

#active ⇒ Boolean (readonly)

Value of the active field in the Inttegro API payload.

Required in the API payload. Wire name: active.

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
# File 'lib/inttegro/purchase_intent/variant.rb', line 55

class Variant < T::Struct
  const :active, T::Boolean
  const :position, T.nilable(Integer), default: nil
  const :price, T.nilable(Inttegro::PurchaseIntent::Price), default: nil
  const :product, T.nilable(Inttegro::PurchaseIntent::Product), default: nil
  const :product_id, String
  const :variant_values, T::Hash[String, String]
end

#position ⇒ Integer? (readonly)

Value of the position field in the Inttegro API payload.

Optional in the API payload; omitted values default to nil. Wire name: position.

Returns:

  • (Integer, nil)


55
56
57
58
59
60
61
62
# File 'lib/inttegro/purchase_intent/variant.rb', line 55

class Variant < T::Struct
  const :active, T::Boolean
  const :position, T.nilable(Integer), default: nil
  const :price, T.nilable(Inttegro::PurchaseIntent::Price), default: nil
  const :product, T.nilable(Inttegro::PurchaseIntent::Product), default: nil
  const :product_id, String
  const :variant_values, T::Hash[String, String]
end

#price ⇒ Inttegro::PurchaseIntent::Price? (readonly)

Value of the price field in the Inttegro API payload.

Optional in the API payload; omitted values default to nil. Wire name: price.



55
56
57
58
59
60
61
62
# File 'lib/inttegro/purchase_intent/variant.rb', line 55

class Variant < T::Struct
  const :active, T::Boolean
  const :position, T.nilable(Integer), default: nil
  const :price, T.nilable(Inttegro::PurchaseIntent::Price), default: nil
  const :product, T.nilable(Inttegro::PurchaseIntent::Product), default: nil
  const :product_id, String
  const :variant_values, T::Hash[String, String]
end

#product ⇒ Inttegro::PurchaseIntent::Product? (readonly)

Value of the product field in the Inttegro API payload.

Optional in the API payload; omitted values default to nil. Wire name: product.



55
56
57
58
59
60
61
62
# File 'lib/inttegro/purchase_intent/variant.rb', line 55

class Variant < T::Struct
  const :active, T::Boolean
  const :position, T.nilable(Integer), default: nil
  const :price, T.nilable(Inttegro::PurchaseIntent::Price), default: nil
  const :product, T.nilable(Inttegro::PurchaseIntent::Product), default: nil
  const :product_id, String
  const :variant_values, T::Hash[String, String]
end

#product_id ⇒ String (readonly)

Value of the product_id field in the Inttegro API payload.

Required in the API payload. Wire name: product_id.

Returns:

  • (String)


55
56
57
58
59
60
61
62
# File 'lib/inttegro/purchase_intent/variant.rb', line 55

class Variant < T::Struct
  const :active, T::Boolean
  const :position, T.nilable(Integer), default: nil
  const :price, T.nilable(Inttegro::PurchaseIntent::Price), default: nil
  const :product, T.nilable(Inttegro::PurchaseIntent::Product), default: nil
  const :product_id, String
  const :variant_values, T::Hash[String, String]
end

#variant_values ⇒ Hash{String => String} (readonly)

Product variant attribute selections keyed by attribute name.

Required in the API payload. Wire name: variant_values.

Returns:

  • (Hash{String => String})


55
56
57
58
59
60
61
62
# File 'lib/inttegro/purchase_intent/variant.rb', line 55

class Variant < T::Struct
  const :active, T::Boolean
  const :position, T.nilable(Integer), default: nil
  const :price, T.nilable(Inttegro::PurchaseIntent::Price), default: nil
  const :product, T.nilable(Inttegro::PurchaseIntent::Product), default: nil
  const :product_id, String
  const :variant_values, T::Hash[String, String]
end