Class: Pago::V2026_04::Models::ProductCreateRecurring
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", name: "name", description: "description", visibility: "visibility", prices: "prices", medias: "medias", attached_custom_fields: "attached_custom_fields", organization_id: "organization_id", trial_interval: "trial_interval", trial_interval_count: "trial_interval_count", recurring_interval: "recurring_interval", recurring_interval_count: "recurring_interval_count", meter_interval: "meter_interval", meter_interval_count: "meter_interval_count" }.freeze
- REQUIRED_KEYS =
["name", "prices", "recurring_interval"].freeze
Instance Attribute Summary collapse
-
#attached_custom_fields ⇒ Array<Models::AttachedCustomFieldCreate>
readonly
List of custom fields to attach.
-
#description ⇒ String?
readonly
The description of the product.
-
#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.
-
#meter_interval ⇒ String?
readonly
Optional meter cycle, independent of the billing interval.
-
#meter_interval_count ⇒ Integer?
readonly
Number of meter interval units.
-
#name ⇒ String
readonly
The name of the product.
-
#organization_id ⇒ String?
readonly
The ID of the organization owning the product.
-
#prices ⇒ Array<Models::ProductPriceFixedCreate, Models::ProductPriceCustomCreate, Models::ProductPriceSeatBasedCreate, Models::ProductPriceMeteredUnitCreate>
readonly
List of available prices for this product.
- #recurring_interval ⇒ String readonly
-
#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
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: ::Pago::UNSET, name:, description: ::Pago::UNSET, visibility: ::Pago::UNSET, prices:, medias: ::Pago::UNSET, attached_custom_fields: ::Pago::UNSET, organization_id: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, recurring_interval:, recurring_interval_count: ::Pago::UNSET, meter_interval: ::Pago::UNSET, meter_interval_count: ::Pago::UNSET) ⇒ ProductCreateRecurring
constructor
A new instance of ProductCreateRecurring.
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, name:, description: ::Pago::UNSET, visibility: ::Pago::UNSET, prices:, medias: ::Pago::UNSET, attached_custom_fields: ::Pago::UNSET, organization_id: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, recurring_interval:, recurring_interval_count: ::Pago::UNSET, meter_interval: ::Pago::UNSET, meter_interval_count: ::Pago::UNSET) ⇒ ProductCreateRecurring
Returns a new instance of ProductCreateRecurring.
36408 36409 36410 36411 36412 36413 36414 36415 36416 36417 36418 36419 36420 36421 36422 36423 36424 36425 36426 36427 36428 36429 36430 36431 36432 36433 36434 36435 36436 36437 36438 36439 |
# File 'lib/pago/v2026_04/models.rb', line 36408 def initialize( metadata: ::Pago::UNSET, name:, description: ::Pago::UNSET, visibility: ::Pago::UNSET, prices:, medias: ::Pago::UNSET, attached_custom_fields: ::Pago::UNSET, organization_id: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, recurring_interval:, recurring_interval_count: ::Pago::UNSET, meter_interval: ::Pago::UNSET, meter_interval_count: ::Pago::UNSET ) super() assign(:metadata, ) assign(:name, name) assign(:description, description) assign(:visibility, visibility) assign(:prices, prices) assign(:medias, medias) assign(:attached_custom_fields, attached_custom_fields) assign(:organization_id, organization_id) assign(:trial_interval, trial_interval) assign(:trial_interval_count, trial_interval_count) assign(:recurring_interval, recurring_interval) assign(:recurring_interval_count, recurring_interval_count) assign(:meter_interval, meter_interval) assign(:meter_interval_count, meter_interval_count) end |
Instance Attribute Details
#attached_custom_fields ⇒ Array<Models::AttachedCustomFieldCreate> (readonly)
List of custom fields to attach.
36379 36380 36381 |
# File 'lib/pago/v2026_04/models.rb', line 36379 def attached_custom_fields @attached_custom_fields end |
#description ⇒ String? (readonly)
The description of the product.
36364 36365 36366 |
# File 'lib/pago/v2026_04/models.rb', line 36364 def description @description 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.
36375 36376 36377 |
# File 'lib/pago/v2026_04/models.rb', line 36375 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.
36356 36357 36358 |
# File 'lib/pago/v2026_04/models.rb', line 36356 def @metadata end |
#meter_interval ⇒ String? (readonly)
Optional meter cycle, independent of the billing interval. When set, overage settlement, meter resets and meter-credit grants run on this cadence rather than the billing interval — e.g. yearly billing with monthly credits. It must evenly divide the billing interval. If None, metered concerns follow the billing interval. Once set, it can't be changed.
36402 36403 36404 |
# File 'lib/pago/v2026_04/models.rb', line 36402 def meter_interval @meter_interval end |
#meter_interval_count ⇒ Integer? (readonly)
Number of meter interval units. Defaults to 1 when meter_interval is set. Ignored when meter_interval is None.
36406 36407 36408 |
# File 'lib/pago/v2026_04/models.rb', line 36406 def meter_interval_count @meter_interval_count end |
#name ⇒ String (readonly)
The name of the product.
36360 36361 36362 |
# File 'lib/pago/v2026_04/models.rb', line 36360 def name @name end |
#organization_id ⇒ String? (readonly)
The ID of the organization owning the product. Required unless you use an organization token.
36383 36384 36385 |
# File 'lib/pago/v2026_04/models.rb', line 36383 def organization_id @organization_id end |
#prices ⇒ Array<Models::ProductPriceFixedCreate, Models::ProductPriceCustomCreate, Models::ProductPriceSeatBasedCreate, Models::ProductPriceMeteredUnitCreate> (readonly)
List of available prices for this product. It may combine at most one fixed price with one seat-based price (billed as fixed + seat_charge), or contain a single custom or free price, plus any number of metered prices. A free price cannot be combined with other prices, and a custom price cannot be combined with a fixed or seat-based price. Metered prices are not supported on one-time purchase products.
36371 36372 36373 |
# File 'lib/pago/v2026_04/models.rb', line 36371 def prices @prices end |
#recurring_interval ⇒ String (readonly)
36394 36395 36396 |
# File 'lib/pago/v2026_04/models.rb', line 36394 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.
36398 36399 36400 |
# File 'lib/pago/v2026_04/models.rb', line 36398 def recurring_interval_count @recurring_interval_count end |
#trial_interval ⇒ String? (readonly)
The interval unit for the trial period.
36387 36388 36389 |
# File 'lib/pago/v2026_04/models.rb', line 36387 def trial_interval @trial_interval end |
#trial_interval_count ⇒ Integer? (readonly)
The number of interval units for the trial period.
36391 36392 36393 |
# File 'lib/pago/v2026_04/models.rb', line 36391 def trial_interval_count @trial_interval_count end |
#visibility ⇒ String (readonly)
36367 36368 36369 |
# File 'lib/pago/v2026_04/models.rb', line 36367 def visibility @visibility end |
Class Method Details
.from_json(data) ⇒ ProductCreateRecurring?
36443 36444 36445 36446 36447 36448 36449 36450 36451 36452 36453 36454 36455 36456 36457 36458 36459 36460 36461 36462 36463 36464 36465 36466 36467 |
# File 'lib/pago/v2026_04/models.rb', line 36443 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), name: (data.key?("name") ? data["name"] : ::Pago::UNSET), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), visibility: (data.key?("visibility") ? data["visibility"] : ::Pago::UNSET), prices: (data.key?("prices") ? ::Pago::Serde.array(data["prices"]) { |item0| ::Pago::Serde.union(item0, discriminator: "amount_type", mapping: { "custom" => Models::ProductPriceCustomCreate, "fixed" => Models::ProductPriceFixedCreate, "metered_unit" => Models::ProductPriceMeteredUnitCreate, "seat_based" => Models::ProductPriceSeatBasedCreate }, variants: [Models::ProductPriceFixedCreate, Models::ProductPriceCustomCreate, Models::ProductPriceSeatBasedCreate, Models::ProductPriceMeteredUnitCreate]) } : ::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), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::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), 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), meter_interval: (data.key?("meter_interval") ? data["meter_interval"] : ::Pago::UNSET), meter_interval_count: (data.key?("meter_interval_count") ? data["meter_interval_count"] : ::Pago::UNSET) ), data ) end |