Class: Pago::V2026_04::Models::BalanceCreditOrderMetadata
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ order_id: "order_id", product_id: "product_id", subscription_id: "subscription_id", amount: "amount", currency: "currency", tax_amount: "tax_amount", tax_state: "tax_state", tax_country: "tax_country", fee: "fee", exchange_rate: "exchange_rate" }.freeze
- REQUIRED_KEYS =
["order_id", "amount", "currency", "tax_amount", "fee"].freeze
Instance Attribute Summary collapse
- #amount ⇒ Integer readonly
- #currency ⇒ String readonly
- #exchange_rate ⇒ Float readonly
- #fee ⇒ Integer readonly
- #order_id ⇒ String readonly
- #product_id ⇒ String readonly
- #subscription_id ⇒ String readonly
- #tax_amount ⇒ Integer readonly
- #tax_country ⇒ String? readonly
- #tax_state ⇒ String? readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(order_id:, product_id: ::Pago::UNSET, subscription_id: ::Pago::UNSET, amount:, currency:, tax_amount:, tax_state: ::Pago::UNSET, tax_country: ::Pago::UNSET, fee:, exchange_rate: ::Pago::UNSET) ⇒ BalanceCreditOrderMetadata
constructor
A new instance of BalanceCreditOrderMetadata.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(order_id:, product_id: ::Pago::UNSET, subscription_id: ::Pago::UNSET, amount:, currency:, tax_amount:, tax_state: ::Pago::UNSET, tax_country: ::Pago::UNSET, fee:, exchange_rate: ::Pago::UNSET) ⇒ BalanceCreditOrderMetadata
Returns a new instance of BalanceCreditOrderMetadata.
849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 |
# File 'lib/pago/v2026_04/models.rb', line 849 def initialize( order_id:, product_id: ::Pago::UNSET, subscription_id: ::Pago::UNSET, amount:, currency:, tax_amount:, tax_state: ::Pago::UNSET, tax_country: ::Pago::UNSET, fee:, exchange_rate: ::Pago::UNSET ) super() assign(:order_id, order_id) assign(:product_id, product_id) assign(:subscription_id, subscription_id) assign(:amount, amount) assign(:currency, currency) assign(:tax_amount, tax_amount) assign(:tax_state, tax_state) assign(:tax_country, tax_country) assign(:fee, fee) assign(:exchange_rate, exchange_rate) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
829 830 831 |
# File 'lib/pago/v2026_04/models.rb', line 829 def amount @amount end |
#currency ⇒ String (readonly)
832 833 834 |
# File 'lib/pago/v2026_04/models.rb', line 832 def currency @currency end |
#exchange_rate ⇒ Float (readonly)
847 848 849 |
# File 'lib/pago/v2026_04/models.rb', line 847 def exchange_rate @exchange_rate end |
#fee ⇒ Integer (readonly)
844 845 846 |
# File 'lib/pago/v2026_04/models.rb', line 844 def fee @fee end |
#order_id ⇒ String (readonly)
820 821 822 |
# File 'lib/pago/v2026_04/models.rb', line 820 def order_id @order_id end |
#product_id ⇒ String (readonly)
823 824 825 |
# File 'lib/pago/v2026_04/models.rb', line 823 def product_id @product_id end |
#subscription_id ⇒ String (readonly)
826 827 828 |
# File 'lib/pago/v2026_04/models.rb', line 826 def subscription_id @subscription_id end |
#tax_amount ⇒ Integer (readonly)
835 836 837 |
# File 'lib/pago/v2026_04/models.rb', line 835 def tax_amount @tax_amount end |
#tax_country ⇒ String? (readonly)
841 842 843 |
# File 'lib/pago/v2026_04/models.rb', line 841 def tax_country @tax_country end |
#tax_state ⇒ String? (readonly)
838 839 840 |
# File 'lib/pago/v2026_04/models.rb', line 838 def tax_state @tax_state end |
Class Method Details
.from_json(data) ⇒ BalanceCreditOrderMetadata?
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 |
# File 'lib/pago/v2026_04/models.rb', line 876 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( order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET), product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET), subscription_id: (data.key?("subscription_id") ? data["subscription_id"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET), tax_amount: (data.key?("tax_amount") ? data["tax_amount"] : ::Pago::UNSET), tax_state: (data.key?("tax_state") ? data["tax_state"] : ::Pago::UNSET), tax_country: (data.key?("tax_country") ? data["tax_country"] : ::Pago::UNSET), fee: (data.key?("fee") ? data["fee"] : ::Pago::UNSET), exchange_rate: (data.key?("exchange_rate") ? data["exchange_rate"] : ::Pago::UNSET) ), data ) end |