Class: Inttegro::Product

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/inttegro/product/product.rb,
lib/inttegro/product/base.rb,
lib/inttegro/product/page.rb,
lib/inttegro/product/type.rb,
lib/inttegro/product/media.rb,
lib/inttegro/product/render.rb,
lib/inttegro/product/stream.rb,
lib/inttegro/product/details.rb,
lib/inttegro/product/service.rb,
lib/inttegro/product/updated.rb,
lib/inttegro/product/delivery.rb,
lib/inttegro/product/download.rb,
lib/inttegro/product/response.rb,
lib/inttegro/product/shipment.rb,
lib/inttegro/product/attribute.rb,
lib/inttegro/product/line_item.rb,
lib/inttegro/product/questions.rb,
lib/inttegro/product/dimensions.rb,
lib/inttegro/product/page_request.rb,
lib/inttegro/product/page_response.rb,
lib/inttegro/product/price_summary.rb,
lib/inttegro/product/action_request.rb,
lib/inttegro/product/create_request.rb,
lib/inttegro/product/inline_details.rb,
lib/inttegro/product/line_item_type.rb,
lib/inttegro/product/lookup_request.rb,
lib/inttegro/product/shipment_input.rb,
lib/inttegro/product/update_request.rb,
lib/inttegro/product/search_response.rb,
lib/inttegro/product/update_response.rb,
lib/inttegro/product/add_price_request.rb,
lib/inttegro/product/dimensions_custom.rb,
lib/inttegro/product/shipment_variant1.rb,
lib/inttegro/product/shipment_variant2.rb,
lib/inttegro/product/shipment_variant3.rb,
lib/inttegro/product/shipment_variant4.rb,
lib/inttegro/product/shipment_variant5.rb,
lib/inttegro/product/add_price_response.rb,
lib/inttegro/product/dimensions_digital.rb,
lib/inttegro/product/dimensions_physical.rb,
lib/inttegro/product/fixed_price_summary.rb,
lib/inttegro/product/shipment_input_type.rb,
lib/inttegro/product/media_file_reference.rb,
lib/inttegro/product/search_response_search.rb,
lib/inttegro/product/shipment_variant1_type.rb,
lib/inttegro/product/shipment_variant2_type.rb,
lib/inttegro/product/shipment_variant3_type.rb,
lib/inttegro/product/shipment_variant4_type.rb,
lib/inttegro/product/shipment_variant5_type.rb,
lib/inttegro/product/add_fixed_price_request.rb,
lib/inttegro/product/catalog_with_price_data.rb,
lib/inttegro/product/fixed_price_summary_type.rb,
lib/inttegro/product/add_fixed_price_request_type.rb,
lib/inttegro/product/catalog_with_price_reference.rb,
lib/inttegro/product/customer_selected_price_input.rb,
lib/inttegro/product/set_default_unit_price_request.rb,
lib/inttegro/product/search_response_search_results_item.rb,
lib/inttegro/product/catalog_with_customer_selected_price.rb,
lib/inttegro/product/search_response_search_resource_types_item.rb,
lib/inttegro/product/search_response_search_resource_totals_item.rb,
lib/inttegro/product/search_response_search_results_item_resource.rb,
lib/inttegro/product/search_response_search_results_item_resource_type.rb,
lib/inttegro/product/search_response_search_resource_totals_item_relation.rb,
lib/inttegro/product/search_response_search_resource_totals_item_resource_type.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.

Defined Under Namespace

Classes: ActionRequest, AddFixedPriceRequest, AddFixedPriceRequestType, AddPriceResponse, Attribute, CatalogWithCustomerSelectedPrice, CatalogWithPriceData, CatalogWithPriceReference, CreateRequest, CustomerSelectedPriceInput, Delivery, Dimensions, DimensionsCustom, DimensionsDigital, DimensionsPhysical, Download, FixedPriceSummary, FixedPriceSummaryType, InlineDetails, LineItem, LineItemType, LookupRequest, Media, Page, PageRequest, PageResponse, Render, Response, SearchResponse, SearchResponseSearch, SearchResponseSearchResourceTotalsItem, SearchResponseSearchResourceTotalsItemRelation, SearchResponseSearchResourceTotalsItemResourceType, SearchResponseSearchResourceTypesItem, SearchResponseSearchResultsItem, SearchResponseSearchResultsItemResource, SearchResponseSearchResultsItemResourceType, Service, SetDefaultUnitPriceRequest, ShipmentInput, ShipmentInputType, ShipmentVariant1, ShipmentVariant1Type, ShipmentVariant2, ShipmentVariant2Type, ShipmentVariant3, ShipmentVariant3Type, ShipmentVariant4, ShipmentVariant4Type, ShipmentVariant5, ShipmentVariant5Type, Stream, Type, UpdateRequest, UpdateResponse, Updated

Constant Summary collapse

Details =

Provide either inline product data or a product_id reference to an existing catalog product. Catalog-backed product line items can use an explicit price or an existing price_id, or a validated customer_selected_price. Inttegro never falls back to a product's default unit price during order creation.

T.type_alias { T.any(Inttegro::Product::InlineDetails, Inttegro::Product::CatalogWithPriceData, Inttegro::Product::CatalogWithPriceReference, Inttegro::Product::CatalogWithCustomerSelectedPrice) }
Shipment =

Product fulfillment mode. Only the marker matching type may be returned; older records may omit that otherwise empty marker.

T.type_alias { T.any(Inttegro::Product::ShipmentVariant1, Inttegro::Product::ShipmentVariant2, Inttegro::Product::ShipmentVariant3, Inttegro::Product::ShipmentVariant4, Inttegro::Product::ShipmentVariant5) }
PriceSummary =

Typed representation of the price summary object in the Inttegro API.

T.type_alias { T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary) }
AddPriceRequest =

Typed representation of the add price request object in the Inttegro API.

T.type_alias { T.any(Inttegro::Product::AddFixedPriceRequest, Inttegro::Customer::AddSelectedProductPriceRequest) }
MediaFileReference =

An Inttegro Files API file or file-link reference. Remote URLs are not accepted.

Returns:

  • (String)
T.type_alias { String }

Instance Attribute Summary collapse

Class Method Summary collapse

Instance 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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

#archived_at ⇒ Time? (readonly)

Archive timestamp (if archived)

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

Returns:

  • (Time, nil)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

#attributes ⇒ Array<Inttegro::Product::Attribute>? (readonly)

Product attributes

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

Returns:



148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

#custom_data ⇒ Hash{String => String}? (readonly)

Merchant-defined string values attached to a resource when at least one value is present.

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

Returns:

  • (Hash{String => String}, nil)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

#dimensions ⇒ Inttegro::Product::Dimensions? (readonly)

At most one of physical, digital, or custom.

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



148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

#media ⇒ Inttegro::Product::Media? (readonly)

Value of the media field in the Inttegro API payload.

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

Returns:



148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

#name ⇒ String (readonly)

Product name

Required in the API payload. Wire name: name.

Returns:

  • (String)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

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

Non-archived prices that belong to this product

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



148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

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

Product fulfillment mode. Only the marker matching type may be returned; older records may omit that otherwise empty marker.

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



148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

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

Product type

Required in the API payload. Wire name: type.



148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      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)


148
149
150
151
152
153
154
155
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
200
201
202
203
204
205
206
# File 'lib/inttegro/product/product.rb', line 148

class Product
  const :id, String
  const :type, Inttegro::Product::Type
  const :reference, T.nilable(String), default: nil
  const :name, String
  const :description, T.nilable(String), default: nil
  const :about, T.nilable(String), default: nil
  const :tax_code, T.nilable(String), default: nil
  const :category, T.nilable(String), default: nil
  const :prices, T.nilable(T::Array[T.any(Inttegro::Product::FixedPriceSummary, Inttegro::Customer::SelectedProductPriceSummary)]), 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 :media, T.nilable(Inttegro::Product::Media), default: nil
  const :attributes, T.nilable(T::Array[Inttegro::Product::Attribute]), default: nil
  const :dimensions, T.nilable(Inttegro::Product::Dimensions), default: nil
  const :custom_data, T.nilable(T::Hash[String, String]), default: nil
  const :active, T::Boolean
  const :created_at, Time
  const :updated_at, T.nilable(Time), default: nil
  const :archived_at, T.nilable(Time), default: nil
  const :published_at, T.nilable(Time), default: nil
  const :unit_dim, 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
    if (shipment_value = data["shipment"]).is_a?(Hash)
      data["shipment"] = case shipment_value["type"]
      when "delivery"
        Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
      when "download"
        Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
      when "render"
        Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
      when "service"
        Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
      when "stream"
        Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
      else
        shipment_value
      end
    end
    super(data, strict)
  end
end

Class Method Details

.from_hash(hash, strict = false) ⇒ Object



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
200
201
202
203
204
205
# File 'lib/inttegro/product/product.rb', line 173

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
  if (shipment_value = data["shipment"]).is_a?(Hash)
    data["shipment"] = case shipment_value["type"]
    when "delivery"
      Inttegro::Product::ShipmentVariant1.from_hash(shipment_value)
    when "download"
      Inttegro::Product::ShipmentVariant2.from_hash(shipment_value)
    when "render"
      Inttegro::Product::ShipmentVariant3.from_hash(shipment_value)
    when "service"
      Inttegro::Product::ShipmentVariant4.from_hash(shipment_value)
    when "stream"
      Inttegro::Product::ShipmentVariant5.from_hash(shipment_value)
    else
      shipment_value
    end
  end
  super(data, strict)
end

Instance Method Details

#archived? ⇒ Boolean

Determine whether the API supplied an archive timestamp.

Returns:

  • (Boolean) —

    whether this product is archived



12
13
14
# File 'lib/inttegro/product/questions.rb', line 12

def archived?
  !archived_at.nil?
end

#ever_published? ⇒ Boolean

Determine whether the product has ever received a publication timestamp.

Returns:



31
32
33
# File 'lib/inttegro/product/questions.rb', line 31

def ever_published?
  !published_at.nil?
end

#published? ⇒ Boolean

Determine whether the product is currently active and not archived.

This local predicate does not infer publication from #published_at; it reflects the active and archived_at fields on the current model.

Returns:

  • (Boolean) —

    whether the product is currently published by this definition



23
24
25
# File 'lib/inttegro/product/questions.rb', line 23

def published?
  active && !archived?
end