metronome-sdk 3.5.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/client.rb +15 -1
  5. data/lib/metronome_sdk/internal/transport/base_client.rb +2 -0
  6. data/lib/metronome_sdk/internal/type/enum.rb +0 -25
  7. data/lib/metronome_sdk/models/commit.rb +27 -1
  8. data/lib/metronome_sdk/models/contract.rb +140 -1
  9. data/lib/metronome_sdk/models/contract_v2.rb +530 -6
  10. data/lib/metronome_sdk/models/contract_without_amendments.rb +142 -1
  11. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +105 -2
  12. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +103 -2
  13. data/lib/metronome_sdk/models/spend_threshold_configuration.rb +33 -1
  14. data/lib/metronome_sdk/models/spend_threshold_configuration_v2.rb +33 -1
  15. data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
  16. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +29 -177
  17. data/lib/metronome_sdk/models/v1/contract_create_params.rb +147 -180
  18. data/lib/metronome_sdk/models/v1/contract_create_response.rb +1134 -3
  19. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
  20. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
  21. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
  22. data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
  23. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
  24. data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
  25. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
  26. data/lib/metronome_sdk/models/v1/package_create_params.rb +115 -18
  27. data/lib/metronome_sdk/models/v1/package_list_response.rb +110 -1
  28. data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +114 -1
  29. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +303 -5
  30. data/lib/metronome_sdk/models/v2/contract_edit_response.rb +3862 -3
  31. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +507 -6
  32. data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
  33. data/lib/metronome_sdk/resources/v1/contracts.rb +72 -3
  34. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
  35. data/lib/metronome_sdk/resources/v1/packages.rb +6 -7
  36. data/lib/metronome_sdk/resources/v1.rb +0 -4
  37. data/lib/metronome_sdk/resources/v2/contracts.rb +5 -1
  38. data/lib/metronome_sdk/version.rb +1 -1
  39. data/lib/metronome_sdk.rb +2 -8
  40. data/rbi/metronome_sdk/models/commit.rbi +48 -0
  41. data/rbi/metronome_sdk/models/contract.rbi +354 -0
  42. data/rbi/metronome_sdk/models/contract_v2.rbi +1172 -4
  43. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +368 -0
  44. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +289 -6
  45. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +283 -6
  46. data/rbi/metronome_sdk/models/spend_threshold_configuration.rbi +78 -3
  47. data/rbi/metronome_sdk/models/spend_threshold_configuration_v2.rbi +78 -3
  48. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
  49. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +54 -396
  50. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +370 -398
  51. data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +2448 -4
  52. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
  53. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
  54. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
  55. data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
  56. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
  57. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
  58. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
  59. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +310 -56
  60. data/rbi/metronome_sdk/models/v1/package_list_response.rbi +307 -0
  61. data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +307 -0
  62. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +734 -11
  63. data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +8612 -4
  64. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1355 -219
  65. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
  66. data/rbi/metronome_sdk/resources/v1/contracts.rbi +88 -3
  67. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
  68. data/rbi/metronome_sdk/resources/v1/packages.rbi +8 -7
  69. data/rbi/metronome_sdk/resources/v1.rbi +0 -3
  70. data/rbi/metronome_sdk/resources/v2/contracts.rbi +10 -0
  71. data/sig/metronome_sdk/models/commit.rbs +19 -0
  72. data/sig/metronome_sdk/models/contract.rbs +151 -0
  73. data/sig/metronome_sdk/models/contract_v2.rbs +494 -6
  74. data/sig/metronome_sdk/models/contract_without_amendments.rbs +151 -0
  75. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration.rbs +116 -6
  76. data/sig/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbs +116 -6
  77. data/sig/metronome_sdk/models/spend_threshold_configuration.rbs +31 -3
  78. data/sig/metronome_sdk/models/spend_threshold_configuration_v2.rbs +31 -3
  79. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
  80. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +19 -137
  81. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +134 -137
  82. data/sig/metronome_sdk/models/v1/contract_create_response.rbs +1045 -4
  83. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
  84. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
  85. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
  86. data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
  87. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
  88. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
  89. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
  90. data/sig/metronome_sdk/models/v1/package_create_params.rbs +115 -20
  91. data/sig/metronome_sdk/models/v1/package_list_response.rbs +115 -0
  92. data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +115 -0
  93. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +283 -9
  94. data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +3792 -4
  95. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +461 -15
  96. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
  97. data/sig/metronome_sdk/resources/v1/contracts.rbs +16 -0
  98. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
  99. data/sig/metronome_sdk/resources/v1/packages.rbs +1 -1
  100. data/sig/metronome_sdk/resources/v1.rbs +0 -2
  101. data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
  102. metadata +8 -26
  103. data/lib/metronome_sdk/models/v1/payment.rb +0 -196
  104. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +0 -28
  105. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +0 -18
  106. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +0 -28
  107. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +0 -18
  108. data/lib/metronome_sdk/models/v1/payment_list_params.rb +0 -53
  109. data/lib/metronome_sdk/models/v1/payment_status.rb +0 -19
  110. data/lib/metronome_sdk/resources/v1/payments.rb +0 -102
  111. data/rbi/metronome_sdk/models/v1/payment.rbi +0 -403
  112. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +0 -48
  113. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +0 -35
  114. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +0 -48
  115. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +0 -35
  116. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +0 -91
  117. data/rbi/metronome_sdk/models/v1/payment_status.rbi +0 -33
  118. data/rbi/metronome_sdk/resources/v1/payments.rbi +0 -72
  119. data/sig/metronome_sdk/models/v1/payment.rbs +0 -243
  120. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +0 -30
  121. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +0 -15
  122. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +0 -30
  123. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +0 -15
  124. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +0 -56
  125. data/sig/metronome_sdk/models/v1/payment_status.rbs +0 -19
  126. data/sig/metronome_sdk/resources/v1/payments.rbs +0 -30
@@ -187,7 +187,7 @@ module MetronomeSDK
187
187
 
188
188
  # If provided, provisions a customer on a package instead of creating a
189
189
  # traditional contract. When specified, only customer_id, starting_at, package_id,
190
- # and uniqueness_key are allowed.
190
+ # uniqueness_key, transition, and custom_fields are allowed.
191
191
  sig { returns(T.nilable(String)) }
192
192
  attr_reader :package_id
193
193
 
@@ -379,6 +379,27 @@ module MetronomeSDK
379
379
  end
380
380
  attr_writer :spend_threshold_configuration
381
381
 
382
+ # Spend trackers to attach to this contract. Aliases must be unique within a
383
+ # contract.
384
+ sig do
385
+ returns(
386
+ T.nilable(
387
+ T::Array[MetronomeSDK::V1::ContractCreateParams::SpendTracker]
388
+ )
389
+ )
390
+ end
391
+ attr_reader :spend_trackers
392
+
393
+ sig do
394
+ params(
395
+ spend_trackers:
396
+ T::Array[
397
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::OrHash
398
+ ]
399
+ ).void
400
+ end
401
+ attr_writer :spend_trackers
402
+
382
403
  # Optional list of
383
404
  # [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
384
405
  # to add to the contract.
@@ -513,6 +534,10 @@ module MetronomeSDK
513
534
  MetronomeSDK::V1::ContractCreateParams::ScheduledChargesOnUsageInvoices::OrSymbol,
514
535
  spend_threshold_configuration:
515
536
  MetronomeSDK::SpendThresholdConfiguration::OrHash,
537
+ spend_trackers:
538
+ T::Array[
539
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::OrHash
540
+ ],
516
541
  subscriptions:
517
542
  T::Array[
518
543
  MetronomeSDK::V1::ContractCreateParams::Subscription::OrHash
@@ -558,7 +583,7 @@ module MetronomeSDK
558
583
  package_alias: nil,
559
584
  # If provided, provisions a customer on a package instead of creating a
560
585
  # traditional contract. When specified, only customer_id, starting_at, package_id,
561
- # and uniqueness_key are allowed.
586
+ # uniqueness_key, transition, and custom_fields are allowed.
562
587
  package_id: nil,
563
588
  prepaid_balance_threshold_configuration: nil,
564
589
  # This field's availability is dependent on your client's configuration.
@@ -584,6 +609,9 @@ module MetronomeSDK
584
609
  # on a separate invoice from usage charges.
585
610
  scheduled_charges_on_usage_invoices: nil,
586
611
  spend_threshold_configuration: nil,
612
+ # Spend trackers to attach to this contract. Aliases must be unique within a
613
+ # contract.
614
+ spend_trackers: nil,
587
615
  # Optional list of
588
616
  # [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
589
617
  # to add to the contract.
@@ -656,6 +684,8 @@ module MetronomeSDK
656
684
  MetronomeSDK::V1::ContractCreateParams::ScheduledChargesOnUsageInvoices::OrSymbol,
657
685
  spend_threshold_configuration:
658
686
  MetronomeSDK::SpendThresholdConfiguration,
687
+ spend_trackers:
688
+ T::Array[MetronomeSDK::V1::ContractCreateParams::SpendTracker],
659
689
  subscriptions:
660
690
  T::Array[MetronomeSDK::V1::ContractCreateParams::Subscription],
661
691
  total_contract_value: Float,
@@ -983,24 +1013,6 @@ module MetronomeSDK
983
1013
  sig { params(netsuite_sales_order_id: String).void }
984
1014
  attr_writer :netsuite_sales_order_id
985
1015
 
986
- # optionally payment gate this commit
987
- sig do
988
- returns(
989
- T.nilable(
990
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig
991
- )
992
- )
993
- end
994
- attr_reader :payment_gate_config
995
-
996
- sig do
997
- params(
998
- payment_gate_config:
999
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::OrHash
1000
- ).void
1001
- end
1002
- attr_writer :payment_gate_config
1003
-
1004
1016
  # If multiple commits are applicable, the one with the lower priority will apply
1005
1017
  # first.
1006
1018
  sig { returns(T.nilable(Float)) }
@@ -1049,6 +1061,24 @@ module MetronomeSDK
1049
1061
  end
1050
1062
  attr_writer :specifiers
1051
1063
 
1064
+ # Optional attributes for spend tracker integration. Immutable after creation.
1065
+ sig do
1066
+ returns(
1067
+ T.nilable(
1068
+ MetronomeSDK::V1::ContractCreateParams::Commit::SpendTrackerAttributes
1069
+ )
1070
+ )
1071
+ end
1072
+ attr_reader :spend_tracker_attributes
1073
+
1074
+ sig do
1075
+ params(
1076
+ spend_tracker_attributes:
1077
+ MetronomeSDK::V1::ContractCreateParams::Commit::SpendTrackerAttributes::OrHash
1078
+ ).void
1079
+ end
1080
+ attr_writer :spend_tracker_attributes
1081
+
1052
1082
  # A temporary ID for the commit that can be used to reference the commit for
1053
1083
  # commit specific overrides.
1054
1084
  sig { returns(T.nilable(String)) }
@@ -1075,13 +1105,13 @@ module MetronomeSDK
1075
1105
  MetronomeSDK::V1::ContractCreateParams::Commit::InvoiceSchedule::OrHash,
1076
1106
  name: String,
1077
1107
  netsuite_sales_order_id: String,
1078
- payment_gate_config:
1079
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::OrHash,
1080
1108
  priority: Float,
1081
1109
  rate_type:
1082
1110
  MetronomeSDK::V1::ContractCreateParams::Commit::RateType::OrSymbol,
1083
1111
  rollover_fraction: Float,
1084
1112
  specifiers: T::Array[MetronomeSDK::CommitSpecifierInput::OrHash],
1113
+ spend_tracker_attributes:
1114
+ MetronomeSDK::V1::ContractCreateParams::Commit::SpendTrackerAttributes::OrHash,
1085
1115
  temporary_id: String
1086
1116
  ).returns(T.attached_class)
1087
1117
  end
@@ -1117,8 +1147,6 @@ module MetronomeSDK
1117
1147
  name: nil,
1118
1148
  # This field's availability is dependent on your client's configuration.
1119
1149
  netsuite_sales_order_id: nil,
1120
- # optionally payment gate this commit
1121
- payment_gate_config: nil,
1122
1150
  # If multiple commits are applicable, the one with the lower priority will apply
1123
1151
  # first.
1124
1152
  priority: nil,
@@ -1130,6 +1158,8 @@ module MetronomeSDK
1130
1158
  # specifiers to contribute to a commit's or credit's drawdown. This field cannot
1131
1159
  # be used together with `applicable_product_ids` or `applicable_product_tags`.
1132
1160
  specifiers: nil,
1161
+ # Optional attributes for spend tracker integration. Immutable after creation.
1162
+ spend_tracker_attributes: nil,
1133
1163
  # A temporary ID for the commit that can be used to reference the commit for
1134
1164
  # commit specific overrides.
1135
1165
  temporary_id: nil
@@ -1155,13 +1185,13 @@ module MetronomeSDK
1155
1185
  MetronomeSDK::V1::ContractCreateParams::Commit::InvoiceSchedule,
1156
1186
  name: String,
1157
1187
  netsuite_sales_order_id: String,
1158
- payment_gate_config:
1159
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig,
1160
1188
  priority: Float,
1161
1189
  rate_type:
1162
1190
  MetronomeSDK::V1::ContractCreateParams::Commit::RateType::OrSymbol,
1163
1191
  rollover_fraction: Float,
1164
1192
  specifiers: T::Array[MetronomeSDK::CommitSpecifierInput],
1193
+ spend_tracker_attributes:
1194
+ MetronomeSDK::V1::ContractCreateParams::Commit::SpendTrackerAttributes,
1165
1195
  temporary_id: String
1166
1196
  }
1167
1197
  )
@@ -1700,378 +1730,6 @@ module MetronomeSDK
1700
1730
  end
1701
1731
  end
1702
1732
 
1703
- class PaymentGateConfig < MetronomeSDK::Internal::Type::BaseModel
1704
- OrHash =
1705
- T.type_alias do
1706
- T.any(
1707
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig,
1708
- MetronomeSDK::Internal::AnyHash
1709
- )
1710
- end
1711
-
1712
- # Gate access to the commit balance based on successful collection of payment.
1713
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1714
- # facilitate payment using your own payment integration. Select NONE if you do not
1715
- # wish to payment gate the commit balance.
1716
- sig do
1717
- returns(
1718
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::OrSymbol
1719
- )
1720
- end
1721
- attr_accessor :payment_gate_type
1722
-
1723
- # Only applicable if using PRECALCULATED as your tax type.
1724
- sig do
1725
- returns(
1726
- T.nilable(
1727
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig
1728
- )
1729
- )
1730
- end
1731
- attr_reader :precalculated_tax_config
1732
-
1733
- sig do
1734
- params(
1735
- precalculated_tax_config:
1736
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig::OrHash
1737
- ).void
1738
- end
1739
- attr_writer :precalculated_tax_config
1740
-
1741
- # Only applicable if using STRIPE as your payment gate type.
1742
- sig do
1743
- returns(
1744
- T.nilable(
1745
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig
1746
- )
1747
- )
1748
- end
1749
- attr_reader :stripe_config
1750
-
1751
- sig do
1752
- params(
1753
- stripe_config:
1754
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::OrHash
1755
- ).void
1756
- end
1757
- attr_writer :stripe_config
1758
-
1759
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1760
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
1761
- # will default to NONE.
1762
- sig do
1763
- returns(
1764
- T.nilable(
1765
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1766
- )
1767
- )
1768
- end
1769
- attr_reader :tax_type
1770
-
1771
- sig do
1772
- params(
1773
- tax_type:
1774
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1775
- ).void
1776
- end
1777
- attr_writer :tax_type
1778
-
1779
- # optionally payment gate this commit
1780
- sig do
1781
- params(
1782
- payment_gate_type:
1783
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::OrSymbol,
1784
- precalculated_tax_config:
1785
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig::OrHash,
1786
- stripe_config:
1787
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::OrHash,
1788
- tax_type:
1789
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1790
- ).returns(T.attached_class)
1791
- end
1792
- def self.new(
1793
- # Gate access to the commit balance based on successful collection of payment.
1794
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1795
- # facilitate payment using your own payment integration. Select NONE if you do not
1796
- # wish to payment gate the commit balance.
1797
- payment_gate_type:,
1798
- # Only applicable if using PRECALCULATED as your tax type.
1799
- precalculated_tax_config: nil,
1800
- # Only applicable if using STRIPE as your payment gate type.
1801
- stripe_config: nil,
1802
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1803
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
1804
- # will default to NONE.
1805
- tax_type: nil
1806
- )
1807
- end
1808
-
1809
- sig do
1810
- override.returns(
1811
- {
1812
- payment_gate_type:
1813
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::OrSymbol,
1814
- precalculated_tax_config:
1815
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig,
1816
- stripe_config:
1817
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig,
1818
- tax_type:
1819
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1820
- }
1821
- )
1822
- end
1823
- def to_hash
1824
- end
1825
-
1826
- # Gate access to the commit balance based on successful collection of payment.
1827
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1828
- # facilitate payment using your own payment integration. Select NONE if you do not
1829
- # wish to payment gate the commit balance.
1830
- module PaymentGateType
1831
- extend MetronomeSDK::Internal::Type::Enum
1832
-
1833
- TaggedSymbol =
1834
- T.type_alias do
1835
- T.all(
1836
- Symbol,
1837
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType
1838
- )
1839
- end
1840
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1841
-
1842
- NONE =
1843
- T.let(
1844
- :NONE,
1845
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1846
- )
1847
- STRIPE =
1848
- T.let(
1849
- :STRIPE,
1850
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1851
- )
1852
- EXTERNAL =
1853
- T.let(
1854
- :EXTERNAL,
1855
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1856
- )
1857
-
1858
- sig do
1859
- override.returns(
1860
- T::Array[
1861
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1862
- ]
1863
- )
1864
- end
1865
- def self.values
1866
- end
1867
- end
1868
-
1869
- class PrecalculatedTaxConfig < MetronomeSDK::Internal::Type::BaseModel
1870
- OrHash =
1871
- T.type_alias do
1872
- T.any(
1873
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig,
1874
- MetronomeSDK::Internal::AnyHash
1875
- )
1876
- end
1877
-
1878
- # Amount of tax to be applied. This should be in the same currency and
1879
- # denomination as the commit's invoice schedule
1880
- sig { returns(Float) }
1881
- attr_accessor :tax_amount
1882
-
1883
- # Name of the tax to be applied. This may be used in an invoice line item
1884
- # description.
1885
- sig { returns(T.nilable(String)) }
1886
- attr_reader :tax_name
1887
-
1888
- sig { params(tax_name: String).void }
1889
- attr_writer :tax_name
1890
-
1891
- # Only applicable if using PRECALCULATED as your tax type.
1892
- sig do
1893
- params(tax_amount: Float, tax_name: String).returns(
1894
- T.attached_class
1895
- )
1896
- end
1897
- def self.new(
1898
- # Amount of tax to be applied. This should be in the same currency and
1899
- # denomination as the commit's invoice schedule
1900
- tax_amount:,
1901
- # Name of the tax to be applied. This may be used in an invoice line item
1902
- # description.
1903
- tax_name: nil
1904
- )
1905
- end
1906
-
1907
- sig { override.returns({ tax_amount: Float, tax_name: String }) }
1908
- def to_hash
1909
- end
1910
- end
1911
-
1912
- class StripeConfig < MetronomeSDK::Internal::Type::BaseModel
1913
- OrHash =
1914
- T.type_alias do
1915
- T.any(
1916
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig,
1917
- MetronomeSDK::Internal::AnyHash
1918
- )
1919
- end
1920
-
1921
- # If left blank, will default to INVOICE
1922
- sig do
1923
- returns(
1924
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::OrSymbol
1925
- )
1926
- end
1927
- attr_accessor :payment_type
1928
-
1929
- # Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1930
- # your payment type.
1931
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
1932
- attr_reader :invoice_metadata
1933
-
1934
- sig { params(invoice_metadata: T::Hash[Symbol, String]).void }
1935
- attr_writer :invoice_metadata
1936
-
1937
- # If true, the payment will be made assuming the customer is present (i.e. on
1938
- # session).
1939
- #
1940
- # If false, the payment will be made assuming the customer is not present (i.e.
1941
- # off session). For cardholders from a country with an e-mandate requirement (e.g.
1942
- # India), the payment may be declined.
1943
- #
1944
- # If left blank, will default to false.
1945
- sig { returns(T.nilable(T::Boolean)) }
1946
- attr_reader :on_session_payment
1947
-
1948
- sig { params(on_session_payment: T::Boolean).void }
1949
- attr_writer :on_session_payment
1950
-
1951
- # Only applicable if using STRIPE as your payment gate type.
1952
- sig do
1953
- params(
1954
- payment_type:
1955
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::OrSymbol,
1956
- invoice_metadata: T::Hash[Symbol, String],
1957
- on_session_payment: T::Boolean
1958
- ).returns(T.attached_class)
1959
- end
1960
- def self.new(
1961
- # If left blank, will default to INVOICE
1962
- payment_type:,
1963
- # Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1964
- # your payment type.
1965
- invoice_metadata: nil,
1966
- # If true, the payment will be made assuming the customer is present (i.e. on
1967
- # session).
1968
- #
1969
- # If false, the payment will be made assuming the customer is not present (i.e.
1970
- # off session). For cardholders from a country with an e-mandate requirement (e.g.
1971
- # India), the payment may be declined.
1972
- #
1973
- # If left blank, will default to false.
1974
- on_session_payment: nil
1975
- )
1976
- end
1977
-
1978
- sig do
1979
- override.returns(
1980
- {
1981
- payment_type:
1982
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::OrSymbol,
1983
- invoice_metadata: T::Hash[Symbol, String],
1984
- on_session_payment: T::Boolean
1985
- }
1986
- )
1987
- end
1988
- def to_hash
1989
- end
1990
-
1991
- # If left blank, will default to INVOICE
1992
- module PaymentType
1993
- extend MetronomeSDK::Internal::Type::Enum
1994
-
1995
- TaggedSymbol =
1996
- T.type_alias do
1997
- T.all(
1998
- Symbol,
1999
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType
2000
- )
2001
- end
2002
- OrSymbol = T.type_alias { T.any(Symbol, String) }
2003
-
2004
- INVOICE =
2005
- T.let(
2006
- :INVOICE,
2007
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::TaggedSymbol
2008
- )
2009
- PAYMENT_INTENT =
2010
- T.let(
2011
- :PAYMENT_INTENT,
2012
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::TaggedSymbol
2013
- )
2014
-
2015
- sig do
2016
- override.returns(
2017
- T::Array[
2018
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::TaggedSymbol
2019
- ]
2020
- )
2021
- end
2022
- def self.values
2023
- end
2024
- end
2025
- end
2026
-
2027
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2028
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
2029
- # will default to NONE.
2030
- module TaxType
2031
- extend MetronomeSDK::Internal::Type::Enum
2032
-
2033
- TaggedSymbol =
2034
- T.type_alias do
2035
- T.all(
2036
- Symbol,
2037
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType
2038
- )
2039
- end
2040
- OrSymbol = T.type_alias { T.any(Symbol, String) }
2041
-
2042
- NONE =
2043
- T.let(
2044
- :NONE,
2045
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2046
- )
2047
- STRIPE =
2048
- T.let(
2049
- :STRIPE,
2050
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2051
- )
2052
- ANROK =
2053
- T.let(
2054
- :ANROK,
2055
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2056
- )
2057
- PRECALCULATED =
2058
- T.let(
2059
- :PRECALCULATED,
2060
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2061
- )
2062
-
2063
- sig do
2064
- override.returns(
2065
- T::Array[
2066
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2067
- ]
2068
- )
2069
- end
2070
- def self.values
2071
- end
2072
- end
2073
- end
2074
-
2075
1733
  module RateType
2076
1734
  extend MetronomeSDK::Internal::Type::Enum
2077
1735
 
@@ -2105,6 +1763,36 @@ module MetronomeSDK
2105
1763
  def self.values
2106
1764
  end
2107
1765
  end
1766
+
1767
+ class SpendTrackerAttributes < MetronomeSDK::Internal::Type::BaseModel
1768
+ OrHash =
1769
+ T.type_alias do
1770
+ T.any(
1771
+ MetronomeSDK::V1::ContractCreateParams::Commit::SpendTrackerAttributes,
1772
+ MetronomeSDK::Internal::AnyHash
1773
+ )
1774
+ end
1775
+
1776
+ # If true, this commit will be included in spend trackers with discounted set to
1777
+ # DISCOUNTED_ONLY
1778
+ sig { returns(T::Boolean) }
1779
+ attr_accessor :counts_as_discounted
1780
+
1781
+ # Optional attributes for spend tracker integration. Immutable after creation.
1782
+ sig do
1783
+ params(counts_as_discounted: T::Boolean).returns(T.attached_class)
1784
+ end
1785
+ def self.new(
1786
+ # If true, this commit will be included in spend trackers with discounted set to
1787
+ # DISCOUNTED_ONLY
1788
+ counts_as_discounted:
1789
+ )
1790
+ end
1791
+
1792
+ sig { override.returns({ counts_as_discounted: T::Boolean }) }
1793
+ def to_hash
1794
+ end
1795
+ end
2108
1796
  end
2109
1797
 
2110
1798
  class Credit < MetronomeSDK::Internal::Type::BaseModel
@@ -6627,6 +6315,290 @@ module MetronomeSDK
6627
6315
  end
6628
6316
  end
6629
6317
 
6318
+ class SpendTracker < MetronomeSDK::Internal::Type::BaseModel
6319
+ OrHash =
6320
+ T.type_alias do
6321
+ T.any(
6322
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker,
6323
+ MetronomeSDK::Internal::AnyHash
6324
+ )
6325
+ end
6326
+
6327
+ # Human-readable identifier, unique per contract.
6328
+ sig { returns(String) }
6329
+ attr_accessor :alias_
6330
+
6331
+ sig do
6332
+ returns(
6333
+ T::Array[
6334
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier
6335
+ ]
6336
+ )
6337
+ end
6338
+ attr_accessor :applicable_spend_specifiers
6339
+
6340
+ sig { returns(String) }
6341
+ attr_accessor :credit_type_id
6342
+
6343
+ sig do
6344
+ returns(
6345
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ResetFrequency::OrSymbol
6346
+ )
6347
+ end
6348
+ attr_accessor :reset_frequency
6349
+
6350
+ sig do
6351
+ params(
6352
+ alias_: String,
6353
+ applicable_spend_specifiers:
6354
+ T::Array[
6355
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::OrHash
6356
+ ],
6357
+ credit_type_id: String,
6358
+ reset_frequency:
6359
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ResetFrequency::OrSymbol
6360
+ ).returns(T.attached_class)
6361
+ end
6362
+ def self.new(
6363
+ # Human-readable identifier, unique per contract.
6364
+ alias_:,
6365
+ applicable_spend_specifiers:,
6366
+ credit_type_id:,
6367
+ reset_frequency:
6368
+ )
6369
+ end
6370
+
6371
+ sig do
6372
+ override.returns(
6373
+ {
6374
+ alias_: String,
6375
+ applicable_spend_specifiers:
6376
+ T::Array[
6377
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier
6378
+ ],
6379
+ credit_type_id: String,
6380
+ reset_frequency:
6381
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ResetFrequency::OrSymbol
6382
+ }
6383
+ )
6384
+ end
6385
+ def to_hash
6386
+ end
6387
+
6388
+ class ApplicableSpendSpecifier < MetronomeSDK::Internal::Type::BaseModel
6389
+ OrHash =
6390
+ T.type_alias do
6391
+ T.any(
6392
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier,
6393
+ MetronomeSDK::Internal::AnyHash
6394
+ )
6395
+ end
6396
+
6397
+ sig do
6398
+ returns(
6399
+ T::Array[
6400
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source::OrSymbol
6401
+ ]
6402
+ )
6403
+ end
6404
+ attr_accessor :sources
6405
+
6406
+ sig do
6407
+ returns(
6408
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::SpendType::OrSymbol
6409
+ )
6410
+ end
6411
+ attr_accessor :spend_type
6412
+
6413
+ # Filter by whether the spend was discounted. Defaults to ANY if omitted.
6414
+ sig do
6415
+ returns(
6416
+ T.nilable(
6417
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::OrSymbol
6418
+ )
6419
+ )
6420
+ end
6421
+ attr_reader :discounted
6422
+
6423
+ sig do
6424
+ params(
6425
+ discounted:
6426
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::OrSymbol
6427
+ ).void
6428
+ end
6429
+ attr_writer :discounted
6430
+
6431
+ sig do
6432
+ params(
6433
+ sources:
6434
+ T::Array[
6435
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source::OrSymbol
6436
+ ],
6437
+ spend_type:
6438
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::SpendType::OrSymbol,
6439
+ discounted:
6440
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::OrSymbol
6441
+ ).returns(T.attached_class)
6442
+ end
6443
+ def self.new(
6444
+ sources:,
6445
+ spend_type:,
6446
+ # Filter by whether the spend was discounted. Defaults to ANY if omitted.
6447
+ discounted: nil
6448
+ )
6449
+ end
6450
+
6451
+ sig do
6452
+ override.returns(
6453
+ {
6454
+ sources:
6455
+ T::Array[
6456
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source::OrSymbol
6457
+ ],
6458
+ spend_type:
6459
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::SpendType::OrSymbol,
6460
+ discounted:
6461
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::OrSymbol
6462
+ }
6463
+ )
6464
+ end
6465
+ def to_hash
6466
+ end
6467
+
6468
+ module Source
6469
+ extend MetronomeSDK::Internal::Type::Enum
6470
+
6471
+ TaggedSymbol =
6472
+ T.type_alias do
6473
+ T.all(
6474
+ Symbol,
6475
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source
6476
+ )
6477
+ end
6478
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
6479
+
6480
+ THRESHOLD_RECHARGE =
6481
+ T.let(
6482
+ :THRESHOLD_RECHARGE,
6483
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source::TaggedSymbol
6484
+ )
6485
+ MANUAL =
6486
+ T.let(
6487
+ :MANUAL,
6488
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source::TaggedSymbol
6489
+ )
6490
+
6491
+ sig do
6492
+ override.returns(
6493
+ T::Array[
6494
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Source::TaggedSymbol
6495
+ ]
6496
+ )
6497
+ end
6498
+ def self.values
6499
+ end
6500
+ end
6501
+
6502
+ module SpendType
6503
+ extend MetronomeSDK::Internal::Type::Enum
6504
+
6505
+ TaggedSymbol =
6506
+ T.type_alias do
6507
+ T.all(
6508
+ Symbol,
6509
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::SpendType
6510
+ )
6511
+ end
6512
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
6513
+
6514
+ COMMIT_PURCHASE =
6515
+ T.let(
6516
+ :COMMIT_PURCHASE,
6517
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::SpendType::TaggedSymbol
6518
+ )
6519
+
6520
+ sig do
6521
+ override.returns(
6522
+ T::Array[
6523
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::SpendType::TaggedSymbol
6524
+ ]
6525
+ )
6526
+ end
6527
+ def self.values
6528
+ end
6529
+ end
6530
+
6531
+ # Filter by whether the spend was discounted. Defaults to ANY if omitted.
6532
+ module Discounted
6533
+ extend MetronomeSDK::Internal::Type::Enum
6534
+
6535
+ TaggedSymbol =
6536
+ T.type_alias do
6537
+ T.all(
6538
+ Symbol,
6539
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted
6540
+ )
6541
+ end
6542
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
6543
+
6544
+ ANY =
6545
+ T.let(
6546
+ :ANY,
6547
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::TaggedSymbol
6548
+ )
6549
+ DISCOUNTED_ONLY =
6550
+ T.let(
6551
+ :DISCOUNTED_ONLY,
6552
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::TaggedSymbol
6553
+ )
6554
+ UNDISCOUNTED_ONLY =
6555
+ T.let(
6556
+ :UNDISCOUNTED_ONLY,
6557
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::TaggedSymbol
6558
+ )
6559
+
6560
+ sig do
6561
+ override.returns(
6562
+ T::Array[
6563
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ApplicableSpendSpecifier::Discounted::TaggedSymbol
6564
+ ]
6565
+ )
6566
+ end
6567
+ def self.values
6568
+ end
6569
+ end
6570
+ end
6571
+
6572
+ module ResetFrequency
6573
+ extend MetronomeSDK::Internal::Type::Enum
6574
+
6575
+ TaggedSymbol =
6576
+ T.type_alias do
6577
+ T.all(
6578
+ Symbol,
6579
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ResetFrequency
6580
+ )
6581
+ end
6582
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
6583
+
6584
+ BILLING_PERIOD =
6585
+ T.let(
6586
+ :BILLING_PERIOD,
6587
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ResetFrequency::TaggedSymbol
6588
+ )
6589
+
6590
+ sig do
6591
+ override.returns(
6592
+ T::Array[
6593
+ MetronomeSDK::V1::ContractCreateParams::SpendTracker::ResetFrequency::TaggedSymbol
6594
+ ]
6595
+ )
6596
+ end
6597
+ def self.values
6598
+ end
6599
+ end
6600
+ end
6601
+
6630
6602
  class Subscription < MetronomeSDK::Internal::Type::BaseModel
6631
6603
  OrHash =
6632
6604
  T.type_alias do