Class: Pago::V2026_04::Models::CustomerOrderProduct
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", trial_interval: "trial_interval", trial_interval_count: "trial_interval_count", name: "name", description: "description", visibility: "visibility", recurring_interval: "recurring_interval", recurring_interval_count: "recurring_interval_count", meter_interval: "meter_interval", meter_interval_count: "meter_interval_count", is_recurring: "is_recurring", is_archived: "is_archived", organization_id: "organization_id", prices: "prices", benefits: "benefits", medias: "medias", organization: "organization" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "trial_interval", "trial_interval_count", "name", "description", "visibility", "recurring_interval", "recurring_interval_count", "meter_interval", "meter_interval_count", "is_recurring", "is_archived", "organization_id", "prices", "benefits", "medias", "organization"].freeze
Instance Attribute Summary collapse
-
#benefits ⇒ Array<Models::BenefitPublic>
readonly
List of benefits granted by the product.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#description ⇒ String?
readonly
The description of the product.
-
#id ⇒ String
readonly
The ID of the object.
-
#is_archived ⇒ Boolean
readonly
Whether the product is archived and no longer available.
-
#is_recurring ⇒ Boolean
readonly
Whether the product is a subscription.
-
#medias ⇒ Array<Models::ProductMediaFileRead>
readonly
List of medias associated to the product.
-
#meter_interval ⇒ String?
readonly
The meter cycle of the product, independent of the billing interval.
-
#meter_interval_count ⇒ Integer?
readonly
Number of meter interval units.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#name ⇒ String
readonly
The name of the product.
- #organization ⇒ Models::CustomerOrganization readonly
-
#organization_id ⇒ String
readonly
The ID of the organization owning the product.
-
#prices ⇒ Array<Object>
readonly
List of 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
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, modified_at:, trial_interval:, trial_interval_count:, name:, description:, visibility:, recurring_interval:, recurring_interval_count:, meter_interval:, meter_interval_count:, is_recurring:, is_archived:, organization_id:, prices:, benefits:, medias:, organization:) ⇒ CustomerOrderProduct
constructor
A new instance of CustomerOrderProduct.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, trial_interval:, trial_interval_count:, name:, description:, visibility:, recurring_interval:, recurring_interval_count:, meter_interval:, meter_interval_count:, is_recurring:, is_archived:, organization_id:, prices:, benefits:, medias:, organization:) ⇒ CustomerOrderProduct
Returns a new instance of CustomerOrderProduct.
17845 17846 17847 17848 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 |
# File 'lib/pago/v2026_04/models.rb', line 17845 def initialize( id:, created_at:, modified_at:, trial_interval:, trial_interval_count:, name:, description:, visibility:, recurring_interval:, recurring_interval_count:, meter_interval:, meter_interval_count:, is_recurring:, is_archived:, organization_id:, prices:, benefits:, medias:, organization: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:trial_interval, trial_interval) assign(:trial_interval_count, trial_interval_count) assign(:name, name) assign(:description, description) assign(:visibility, visibility) assign(:recurring_interval, recurring_interval) assign(:recurring_interval_count, recurring_interval_count) assign(:meter_interval, meter_interval) assign(:meter_interval_count, meter_interval_count) assign(:is_recurring, is_recurring) assign(:is_archived, is_archived) assign(:organization_id, organization_id) assign(:prices, prices) assign(:benefits, benefits) assign(:medias, medias) assign(:organization, organization) end |
Instance Attribute Details
#benefits ⇒ Array<Models::BenefitPublic> (readonly)
List of benefits granted by the product.
17836 17837 17838 |
# File 'lib/pago/v2026_04/models.rb', line 17836 def benefits @benefits end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
17777 17778 17779 |
# File 'lib/pago/v2026_04/models.rb', line 17777 def created_at @created_at end |
#description ⇒ String? (readonly)
The description of the product.
17797 17798 17799 |
# File 'lib/pago/v2026_04/models.rb', line 17797 def description @description end |
#id ⇒ String (readonly)
The ID of the object.
17773 17774 17775 |
# File 'lib/pago/v2026_04/models.rb', line 17773 def id @id end |
#is_archived ⇒ Boolean (readonly)
Whether the product is archived and no longer available.
17824 17825 17826 |
# File 'lib/pago/v2026_04/models.rb', line 17824 def is_archived @is_archived end |
#is_recurring ⇒ Boolean (readonly)
Whether the product is a subscription.
17820 17821 17822 |
# File 'lib/pago/v2026_04/models.rb', line 17820 def is_recurring @is_recurring end |
#medias ⇒ Array<Models::ProductMediaFileRead> (readonly)
List of medias associated to the product.
17840 17841 17842 |
# File 'lib/pago/v2026_04/models.rb', line 17840 def medias @medias end |
#meter_interval ⇒ String? (readonly)
The meter cycle of the product, independent of the billing interval. If None, metered concerns follow the billing interval.
17812 17813 17814 |
# File 'lib/pago/v2026_04/models.rb', line 17812 def meter_interval @meter_interval end |
#meter_interval_count ⇒ Integer? (readonly)
Number of meter interval units. None when no meter cycle is set.
17816 17817 17818 |
# File 'lib/pago/v2026_04/models.rb', line 17816 def meter_interval_count @meter_interval_count end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
17781 17782 17783 |
# File 'lib/pago/v2026_04/models.rb', line 17781 def modified_at @modified_at end |
#name ⇒ String (readonly)
The name of the product.
17793 17794 17795 |
# File 'lib/pago/v2026_04/models.rb', line 17793 def name @name end |
#organization ⇒ Models::CustomerOrganization (readonly)
17843 17844 17845 |
# File 'lib/pago/v2026_04/models.rb', line 17843 def organization @organization end |
#organization_id ⇒ String (readonly)
The ID of the organization owning the product.
17828 17829 17830 |
# File 'lib/pago/v2026_04/models.rb', line 17828 def organization_id @organization_id end |
#prices ⇒ Array<Object> (readonly)
List of prices for this product.
17832 17833 17834 |
# File 'lib/pago/v2026_04/models.rb', line 17832 def prices @prices end |
#recurring_interval ⇒ String? (readonly)
The recurring interval of the product. If None, the product is a one-time purchase.
17804 17805 17806 |
# File 'lib/pago/v2026_04/models.rb', line 17804 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. None for one-time products.
17808 17809 17810 |
# File 'lib/pago/v2026_04/models.rb', line 17808 def recurring_interval_count @recurring_interval_count end |
#trial_interval ⇒ String? (readonly)
The interval unit for the trial period.
17785 17786 17787 |
# File 'lib/pago/v2026_04/models.rb', line 17785 def trial_interval @trial_interval end |
#trial_interval_count ⇒ Integer? (readonly)
The number of interval units for the trial period.
17789 17790 17791 |
# File 'lib/pago/v2026_04/models.rb', line 17789 def trial_interval_count @trial_interval_count end |
#visibility ⇒ String (readonly)
17800 17801 17802 |
# File 'lib/pago/v2026_04/models.rb', line 17800 def visibility @visibility end |
Class Method Details
.from_json(data) ⇒ CustomerOrderProduct?
17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 |
# File 'lib/pago/v2026_04/models.rb', line 17890 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::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), visibility: (data.key?("visibility") ? data["visibility"] : ::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), is_recurring: (data.key?("is_recurring") ? data["is_recurring"] : ::Pago::UNSET), is_archived: (data.key?("is_archived") ? data["is_archived"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), prices: (data.key?("prices") ? ::Pago::Serde.array(data["prices"]) { |item0| ::Pago::Serde.union(item0, variants: [Unions::LegacyRecurringProductPrice, Unions::ProductPrice]) } : ::Pago::UNSET), benefits: (data.key?("benefits") ? ::Pago::Serde.array(data["benefits"]) { |item0| Models::BenefitPublic.from_json(item0) } : ::Pago::UNSET), medias: (data.key?("medias") ? ::Pago::Serde.array(data["medias"]) { |item0| Models::ProductMediaFileRead.from_json(item0) } : ::Pago::UNSET), organization: (data.key?("organization") ? Models::CustomerOrganization.from_json(data["organization"]) : ::Pago::UNSET) ), data ) end |