Class: Pago::V2026_04::Models::ProductUpdate
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema to update a product.
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", trial_interval: "trial_interval", trial_interval_count: "trial_interval_count", name: "name", description: "description", recurring_interval: "recurring_interval", recurring_interval_count: "recurring_interval_count", is_archived: "is_archived", visibility: "visibility", prices: "prices", medias: "medias", attached_custom_fields: "attached_custom_fields" }.freeze
- REQUIRED_KEYS =
[].freeze
Instance Attribute Summary collapse
- #attached_custom_fields ⇒ Array<Models::AttachedCustomFieldCreate>? readonly
-
#description ⇒ String?
readonly
The description of the product.
-
#is_archived ⇒ Boolean?
readonly
Whether the product is archived.
-
#medias ⇒ Array<String>?
readonly
List of file IDs.
-
#metadata ⇒ Hash{String => String, Integer, Float, Boolean}
readonly
Key-value object allowing you to store additional information.
- #name ⇒ String? readonly
-
#prices ⇒ Array<Models::ExistingProductPrice, Models::ProductPriceFixedCreate, Models::ProductPriceCustomCreate, Models::ProductPriceSeatBasedCreate, Models::ProductPriceMeteredUnitCreate>?
readonly
List of available prices for this product.
-
#recurring_interval ⇒ String?
readonly
The recurring interval of the product.
-
#recurring_interval_count ⇒ Integer?
readonly
Number of interval units of the subscription.
-
#trial_interval ⇒ String?
readonly
The interval unit for the trial period.
-
#trial_interval_count ⇒ Integer?
readonly
The number of interval units for the trial period.
-
#visibility ⇒ String?
readonly
The visibility of the product.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, name: ::Pago::UNSET, description: ::Pago::UNSET, recurring_interval: ::Pago::UNSET, recurring_interval_count: ::Pago::UNSET, is_archived: ::Pago::UNSET, visibility: ::Pago::UNSET, prices: ::Pago::UNSET, medias: ::Pago::UNSET, attached_custom_fields: ::Pago::UNSET) ⇒ ProductUpdate
constructor
A new instance of ProductUpdate.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(metadata: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, name: ::Pago::UNSET, description: ::Pago::UNSET, recurring_interval: ::Pago::UNSET, recurring_interval_count: ::Pago::UNSET, is_archived: ::Pago::UNSET, visibility: ::Pago::UNSET, prices: ::Pago::UNSET, medias: ::Pago::UNSET, attached_custom_fields: ::Pago::UNSET) ⇒ ProductUpdate
Returns a new instance of ProductUpdate.
38102 38103 38104 38105 38106 38107 38108 38109 38110 38111 38112 38113 38114 38115 38116 38117 38118 38119 38120 38121 38122 38123 38124 38125 38126 38127 38128 38129 |
# File 'lib/pago/v2026_04/models.rb', line 38102 def initialize( metadata: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, name: ::Pago::UNSET, description: ::Pago::UNSET, recurring_interval: ::Pago::UNSET, recurring_interval_count: ::Pago::UNSET, is_archived: ::Pago::UNSET, visibility: ::Pago::UNSET, prices: ::Pago::UNSET, medias: ::Pago::UNSET, attached_custom_fields: ::Pago::UNSET ) super() assign(:metadata, ) assign(:trial_interval, trial_interval) assign(:trial_interval_count, trial_interval_count) assign(:name, name) assign(:description, description) assign(:recurring_interval, recurring_interval) assign(:recurring_interval_count, recurring_interval_count) assign(:is_archived, is_archived) assign(:visibility, visibility) assign(:prices, prices) assign(:medias, medias) assign(:attached_custom_fields, attached_custom_fields) end |
Instance Attribute Details
#attached_custom_fields ⇒ Array<Models::AttachedCustomFieldCreate>? (readonly)
38100 38101 38102 |
# File 'lib/pago/v2026_04/models.rb', line 38100 def attached_custom_fields @attached_custom_fields end |
#description ⇒ String? (readonly)
The description of the product.
38073 38074 38075 |
# File 'lib/pago/v2026_04/models.rb', line 38073 def description @description end |
#is_archived ⇒ Boolean? (readonly)
Whether the product is archived. If true, the product won't be available for purchase anymore. Existing customers will still have access to their benefits, and subscriptions will continue normally.
38085 38086 38087 |
# File 'lib/pago/v2026_04/models.rb', line 38085 def is_archived @is_archived end |
#medias ⇒ Array<String>? (readonly)
List of file IDs. Each one must be on the same organization as the product, of type product_media and correctly uploaded.
38097 38098 38099 |
# File 'lib/pago/v2026_04/models.rb', line 38097 def medias @medias end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
Key-value object allowing you to store additional information.
The key must be a string with a maximum length of 40 characters. The value must be either:
- A string with a maximum length of 500 characters
- An integer
- A floating-point number
- A boolean
You can store up to 50 key-value pairs.
38058 38059 38060 |
# File 'lib/pago/v2026_04/models.rb', line 38058 def @metadata end |
#name ⇒ String? (readonly)
38069 38070 38071 |
# File 'lib/pago/v2026_04/models.rb', line 38069 def name @name end |
#prices ⇒ Array<Models::ExistingProductPrice, Models::ProductPriceFixedCreate, Models::ProductPriceCustomCreate, Models::ProductPriceSeatBasedCreate, Models::ProductPriceMeteredUnitCreate>? (readonly)
List of available prices for this product. If you want to keep existing prices, include them in the list as an ExistingProductPrice object.
38093 38094 38095 |
# File 'lib/pago/v2026_04/models.rb', line 38093 def prices @prices end |
#recurring_interval ⇒ String? (readonly)
The recurring interval of the product. If None, the product is a one-time purchase. Can only be set on legacy recurring products. Once set, it can't be changed.
38077 38078 38079 |
# File 'lib/pago/v2026_04/models.rb', line 38077 def recurring_interval @recurring_interval end |
#recurring_interval_count ⇒ Integer? (readonly)
Number of interval units of the subscription. If this is set to 1 the charge will happen every interval (e.g. every month), if set to 2 it will be every other month, and so on. Once set, it can't be changed.**
38081 38082 38083 |
# File 'lib/pago/v2026_04/models.rb', line 38081 def recurring_interval_count @recurring_interval_count end |
#trial_interval ⇒ String? (readonly)
The interval unit for the trial period.
38062 38063 38064 |
# File 'lib/pago/v2026_04/models.rb', line 38062 def trial_interval @trial_interval end |
#trial_interval_count ⇒ Integer? (readonly)
The number of interval units for the trial period.
38066 38067 38068 |
# File 'lib/pago/v2026_04/models.rb', line 38066 def trial_interval_count @trial_interval_count end |
#visibility ⇒ String? (readonly)
The visibility of the product.
38089 38090 38091 |
# File 'lib/pago/v2026_04/models.rb', line 38089 def visibility @visibility end |
Class Method Details
.from_json(data) ⇒ ProductUpdate?
38133 38134 38135 38136 38137 38138 38139 38140 38141 38142 38143 38144 38145 38146 38147 38148 38149 38150 38151 38152 38153 38154 38155 |
# File 'lib/pago/v2026_04/models.rb', line 38133 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), trial_interval: (data.key?("trial_interval") ? data["trial_interval"] : ::Pago::UNSET), trial_interval_count: (data.key?("trial_interval_count") ? data["trial_interval_count"] : ::Pago::UNSET), name: (data.key?("name") ? data["name"] : ::Pago::UNSET), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), recurring_interval: (data.key?("recurring_interval") ? data["recurring_interval"] : ::Pago::UNSET), recurring_interval_count: (data.key?("recurring_interval_count") ? data["recurring_interval_count"] : ::Pago::UNSET), is_archived: (data.key?("is_archived") ? data["is_archived"] : ::Pago::UNSET), visibility: (data.key?("visibility") ? data["visibility"] : ::Pago::UNSET), prices: (data.key?("prices") ? ::Pago::Serde.array(data["prices"]) { |item0| ::Pago::Serde.union(item0, variants: [Models::ExistingProductPrice]) } : ::Pago::UNSET), medias: (data.key?("medias") ? data["medias"] : ::Pago::UNSET), attached_custom_fields: (data.key?("attached_custom_fields") ? ::Pago::Serde.array(data["attached_custom_fields"]) { |item0| Models::AttachedCustomFieldCreate.from_json(item0) } : ::Pago::UNSET) ), data ) end |