Class: Inttegro::PurchaseIntent::Product

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/inttegro/purchase_intent/product.rb

Overview

Typed representation of the product 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

Class Method Summary collapse

Instance Attribute Details

#about ⇒ String? (readonly)

Full product description

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#active ⇒ Boolean (readonly)

Whether product is published and available

Required in the API payload. Wire name: active.

Returns:

  • (Boolean)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#archived_at ⇒ Time? (readonly)

Archive timestamp (if archived). A non-null value means active is false.

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

Returns:

  • (Time, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#attributes ⇒ Array<Inttegro::PurchaseIntent::ProductAttributesItem>? (readonly)

Product attributes

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



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#category ⇒ String? (readonly)

Product category

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#created_at ⇒ Time (readonly)

Product creation timestamp

Required in the API payload. Wire name: created_at.

Returns:

  • (Time)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#custom_data ⇒ Inttegro::CustomData? (readonly)

Merchant-defined string values attached to a resource. SDKs expose this as a semantic collection rather than a raw map.

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

Returns:



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#description ⇒ String? (readonly)

Short description

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#dimensions ⇒ Inttegro::PurchaseIntent::ProductDimensions? (readonly)

Product dimensions and size metadata

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



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#id ⇒ String (readonly)

Unique product identifier with prod_ prefix

Required in the API payload. Wire name: id.

Returns:

  • (String)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#media ⇒ Inttegro::PurchaseIntent::ProductMedia? (readonly)

Product media assets

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



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#name ⇒ String (readonly)

Product name

Required in the API payload. Wire name: name.

Returns:

  • (String)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#prices ⇒ Array<Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary>? (readonly)

Non-archived catalog prices currently attached to the product

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



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#published_at ⇒ Time? (readonly)

When the product was published

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

Returns:

  • (Time, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#reference ⇒ String? (readonly)

External reference or SKU

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#shipment ⇒ Inttegro::Product::ShipmentVariant1, ... (readonly)

Shipment and fulfillment details

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



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#tax_code ⇒ String? (readonly)

Tax classification code

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#type ⇒ Inttegro::Product::Type (readonly)

Product type

Required in the API payload. Wire name: type.



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#unit_dim ⇒ String? (readonly)

Unit dimension label

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#updated_at ⇒ Time? (readonly)

Last update timestamp

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

Returns:

  • (Time, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

#variant_set_id ⇒ String? (readonly)

Variant set configured for this Buy link

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

Returns:

  • (String, nil)


156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/inttegro/purchase_intent/product.rb', line 156

class Product < T::Struct
  const :id, String
  const :about, T.nilable(String), default: nil
  const :active, T::Boolean
  const :archived_at, T.nilable(Time), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::PurchaseIntent::ProductAttributesItem]), default: nil
  const :category, T.nilable(String), default: nil
  const :created_at, Time
  const :custom_data, T.nilable(Inttegro::CustomData), default: nil
  const :description, T.nilable(String), default: nil
  const :dimensions, T.nilable(Inttegro::PurchaseIntent::ProductDimensions), default: nil
  const :media, T.nilable(Inttegro::PurchaseIntent::ProductMedia), default: nil
  const :name, String
  const :published_at, T.nilable(Time), default: nil
  const :reference, T.nilable(String), default: nil
  const :shipment, T.nilable(T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5)), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :type, Inttegro::Product::Type
  const :unit_dim, T.nilable(String), default: nil
  const :updated_at, T.nilable(Time), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), default: nil
  const :variant_set_id, T.nilable(String), default: nil

  extend T::Sig

  sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
  def self.from_hash(hash, strict = false)
    data = hash.dup
    if (prices_value = data["prices"]).is_a?(Array)
      data["prices"] = prices_value.map do |item|
        next item unless item.is_a?(Hash)
        case item["type"]
        when "fixed_amount"
          Inttegro::Product::FixedPriceSummary.from_hash(item)
        when "customer_selected_amount"
          Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
        else
          item
        end
      end
    end
    super(data, strict)
  end
end

Class Method Details

.from_hash(hash, strict = false) ⇒ Object



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/inttegro/purchase_intent/product.rb', line 182

def self.from_hash(hash, strict = false)
  data = hash.dup
  if (prices_value = data["prices"]).is_a?(Array)
    data["prices"] = prices_value.map do |item|
      next item unless item.is_a?(Hash)
      case item["type"]
      when "fixed_amount"
        Inttegro::Product::FixedPriceSummary.from_hash(item)
      when "customer_selected_amount"
        Inttegro::Customer::SelectedProductPriceSummary.from_hash(item)
      else
        item
      end
    end
  end
  super(data, strict)
end