metronome-sdk 3.7.0 → 3.8.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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/internal/transport/base_client.rb +4 -1
  5. data/lib/metronome_sdk/models/commit.rb +10 -1
  6. data/lib/metronome_sdk/models/contract_v2.rb +290 -7
  7. data/lib/metronome_sdk/models/contract_without_amendments.rb +178 -4
  8. data/lib/metronome_sdk/models/credit.rb +10 -1
  9. data/lib/metronome_sdk/models/override.rb +7 -1
  10. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +10 -2
  11. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +3 -1
  12. data/lib/metronome_sdk/models/subscription.rb +90 -2
  13. data/lib/metronome_sdk/models/v1/alert_create_params.rb +127 -1
  14. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +17 -4
  15. data/lib/metronome_sdk/models/v1/contract_create_params.rb +290 -10
  16. data/lib/metronome_sdk/models/v1/contract_create_response.rb +178 -4
  17. data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rb +88 -0
  18. data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rb +62 -0
  19. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +10 -1
  20. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +127 -1
  21. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +130 -3
  22. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +10 -1
  23. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +2 -0
  24. data/lib/metronome_sdk/models/v1/package_create_params.rb +279 -10
  25. data/lib/metronome_sdk/models/v1/package_list_response.rb +264 -7
  26. data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +264 -7
  27. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +515 -9
  28. data/lib/metronome_sdk/models/v2/contract_edit_response.rb +456 -8
  29. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +456 -8
  30. data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
  31. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +4 -0
  32. data/lib/metronome_sdk/resources/v1/contracts.rb +68 -1
  33. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +4 -2
  34. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +3 -1
  35. data/lib/metronome_sdk/resources/v1/dashboards.rb +7 -2
  36. data/lib/metronome_sdk/version.rb +1 -1
  37. data/lib/metronome_sdk.rb +2 -0
  38. data/rbi/metronome_sdk/models/commit.rbi +13 -0
  39. data/rbi/metronome_sdk/models/contract_v2.rbi +715 -3
  40. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +463 -0
  41. data/rbi/metronome_sdk/models/credit.rbi +13 -0
  42. data/rbi/metronome_sdk/models/override.rbi +9 -0
  43. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +11 -1
  44. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +4 -0
  45. data/rbi/metronome_sdk/models/subscription.rbi +212 -3
  46. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +373 -0
  47. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +27 -6
  48. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +719 -9
  49. data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +463 -0
  50. data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbi +112 -0
  51. data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbi +119 -0
  52. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +13 -0
  53. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +360 -0
  54. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +379 -2
  55. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +13 -0
  56. data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +10 -0
  57. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +706 -9
  58. data/rbi/metronome_sdk/models/v1/package_list_response.rbi +693 -3
  59. data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +693 -3
  60. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +1333 -40
  61. data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +1204 -67
  62. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1204 -67
  63. data/rbi/metronome_sdk/resources/v1/alerts.rbi +8 -0
  64. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +4 -0
  65. data/rbi/metronome_sdk/resources/v1/contracts.rbi +70 -0
  66. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +8 -1
  67. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +4 -0
  68. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +7 -2
  69. data/sig/metronome_sdk/models/commit.rbs +7 -0
  70. data/sig/metronome_sdk/models/contract_v2.rbs +278 -5
  71. data/sig/metronome_sdk/models/contract_without_amendments.rbs +169 -2
  72. data/sig/metronome_sdk/models/credit.rbs +7 -0
  73. data/sig/metronome_sdk/models/override.rbs +7 -0
  74. data/sig/metronome_sdk/models/subscription.rbs +88 -3
  75. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +144 -0
  76. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +7 -0
  77. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +278 -5
  78. data/sig/metronome_sdk/models/v1/contract_create_response.rbs +167 -2
  79. data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbs +63 -0
  80. data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbs +59 -0
  81. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +7 -0
  82. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +141 -0
  83. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +150 -0
  84. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +8 -1
  85. data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +4 -0
  86. data/sig/metronome_sdk/models/v1/package_create_params.rbs +271 -5
  87. data/sig/metronome_sdk/models/v1/package_list_response.rbs +265 -5
  88. data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +263 -5
  89. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +468 -5
  90. data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +428 -5
  91. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +427 -5
  92. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
  93. data/sig/metronome_sdk/resources/v1/contracts.rbs +13 -0
  94. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
  95. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +1 -0
  96. metadata +8 -2
@@ -776,6 +776,26 @@ module MetronomeSDK
776
776
  end
777
777
  attr_writer :proration
778
778
 
779
+ # Rounding configuration for prorated recurring commit amounts.
780
+ sig do
781
+ returns(
782
+ T.nilable(
783
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding
784
+ )
785
+ )
786
+ end
787
+ attr_reader :proration_rounding
788
+
789
+ sig do
790
+ params(
791
+ proration_rounding:
792
+ T.nilable(
793
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::OrHash
794
+ )
795
+ ).void
796
+ end
797
+ attr_writer :proration_rounding
798
+
779
799
  # The frequency at which the recurring commits will be created. If not provided: -
780
800
  # The commits will be created on the usage invoice frequency. If provided: - The
781
801
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -861,6 +881,10 @@ module MetronomeSDK
861
881
  netsuite_sales_order_id: String,
862
882
  proration:
863
883
  MetronomeSDK::ContractWithoutAmendments::RecurringCommit::Proration::OrSymbol,
884
+ proration_rounding:
885
+ T.nilable(
886
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::OrHash
887
+ ),
864
888
  recurrence_frequency:
865
889
  MetronomeSDK::ContractWithoutAmendments::RecurringCommit::RecurrenceFrequency::OrSymbol,
866
890
  rollover_fraction: Float,
@@ -902,6 +926,8 @@ module MetronomeSDK
902
926
  # Determines whether the first and last commit will be prorated. If not provided,
903
927
  # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
904
928
  proration: nil,
929
+ # Rounding configuration for prorated recurring commit amounts.
930
+ proration_rounding: nil,
905
931
  # The frequency at which the recurring commits will be created. If not provided: -
906
932
  # The commits will be created on the usage invoice frequency. If provided: - The
907
933
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -949,6 +975,10 @@ module MetronomeSDK
949
975
  netsuite_sales_order_id: String,
950
976
  proration:
951
977
  MetronomeSDK::ContractWithoutAmendments::RecurringCommit::Proration::TaggedSymbol,
978
+ proration_rounding:
979
+ T.nilable(
980
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding
981
+ ),
952
982
  recurrence_frequency:
953
983
  MetronomeSDK::ContractWithoutAmendments::RecurringCommit::RecurrenceFrequency::TaggedSymbol,
954
984
  rollover_fraction: Float,
@@ -1248,6 +1278,259 @@ module MetronomeSDK
1248
1278
  end
1249
1279
  end
1250
1280
 
1281
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
1282
+ OrHash =
1283
+ T.type_alias do
1284
+ T.any(
1285
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding,
1286
+ MetronomeSDK::Internal::AnyHash
1287
+ )
1288
+ end
1289
+
1290
+ sig do
1291
+ returns(
1292
+ T.nilable(
1293
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access
1294
+ )
1295
+ )
1296
+ end
1297
+ attr_reader :access
1298
+
1299
+ sig do
1300
+ params(
1301
+ access:
1302
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::OrHash
1303
+ ).void
1304
+ end
1305
+ attr_writer :access
1306
+
1307
+ sig do
1308
+ returns(
1309
+ T.nilable(
1310
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice
1311
+ )
1312
+ )
1313
+ end
1314
+ attr_reader :invoice
1315
+
1316
+ sig do
1317
+ params(
1318
+ invoice:
1319
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::OrHash
1320
+ ).void
1321
+ end
1322
+ attr_writer :invoice
1323
+
1324
+ # Rounding configuration for prorated recurring commit amounts.
1325
+ sig do
1326
+ params(
1327
+ access:
1328
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::OrHash,
1329
+ invoice:
1330
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::OrHash
1331
+ ).returns(T.attached_class)
1332
+ end
1333
+ def self.new(access: nil, invoice: nil)
1334
+ end
1335
+
1336
+ sig do
1337
+ override.returns(
1338
+ {
1339
+ access:
1340
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access,
1341
+ invoice:
1342
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice
1343
+ }
1344
+ )
1345
+ end
1346
+ def to_hash
1347
+ end
1348
+
1349
+ class Access < MetronomeSDK::Internal::Type::BaseModel
1350
+ OrHash =
1351
+ T.type_alias do
1352
+ T.any(
1353
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access,
1354
+ MetronomeSDK::Internal::AnyHash
1355
+ )
1356
+ end
1357
+
1358
+ # Number of decimal places to round to. Applied directly to the stored monetary
1359
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1360
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
1361
+ # dollar).
1362
+ sig { returns(Float) }
1363
+ attr_accessor :decimal_places
1364
+
1365
+ sig do
1366
+ returns(
1367
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
1368
+ )
1369
+ end
1370
+ attr_accessor :rounding_method
1371
+
1372
+ sig do
1373
+ params(
1374
+ decimal_places: Float,
1375
+ rounding_method:
1376
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::OrSymbol
1377
+ ).returns(T.attached_class)
1378
+ end
1379
+ def self.new(
1380
+ # Number of decimal places to round to. Applied directly to the stored monetary
1381
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1382
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
1383
+ # dollar).
1384
+ decimal_places:,
1385
+ rounding_method:
1386
+ )
1387
+ end
1388
+
1389
+ sig do
1390
+ override.returns(
1391
+ {
1392
+ decimal_places: Float,
1393
+ rounding_method:
1394
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
1395
+ }
1396
+ )
1397
+ end
1398
+ def to_hash
1399
+ end
1400
+
1401
+ module RoundingMethod
1402
+ extend MetronomeSDK::Internal::Type::Enum
1403
+
1404
+ TaggedSymbol =
1405
+ T.type_alias do
1406
+ T.all(
1407
+ Symbol,
1408
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod
1409
+ )
1410
+ end
1411
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1412
+
1413
+ HALF_UP =
1414
+ T.let(
1415
+ :HALF_UP,
1416
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
1417
+ )
1418
+ FLOOR =
1419
+ T.let(
1420
+ :FLOOR,
1421
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
1422
+ )
1423
+ CEILING =
1424
+ T.let(
1425
+ :CEILING,
1426
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
1427
+ )
1428
+
1429
+ sig do
1430
+ override.returns(
1431
+ T::Array[
1432
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
1433
+ ]
1434
+ )
1435
+ end
1436
+ def self.values
1437
+ end
1438
+ end
1439
+ end
1440
+
1441
+ class Invoice < MetronomeSDK::Internal::Type::BaseModel
1442
+ OrHash =
1443
+ T.type_alias do
1444
+ T.any(
1445
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice,
1446
+ MetronomeSDK::Internal::AnyHash
1447
+ )
1448
+ end
1449
+
1450
+ # Number of decimal places to round to. Applied directly to the stored monetary
1451
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1452
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
1453
+ # dollar).
1454
+ sig { returns(Float) }
1455
+ attr_accessor :decimal_places
1456
+
1457
+ sig do
1458
+ returns(
1459
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
1460
+ )
1461
+ end
1462
+ attr_accessor :rounding_method
1463
+
1464
+ sig do
1465
+ params(
1466
+ decimal_places: Float,
1467
+ rounding_method:
1468
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::OrSymbol
1469
+ ).returns(T.attached_class)
1470
+ end
1471
+ def self.new(
1472
+ # Number of decimal places to round to. Applied directly to the stored monetary
1473
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1474
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
1475
+ # dollar).
1476
+ decimal_places:,
1477
+ rounding_method:
1478
+ )
1479
+ end
1480
+
1481
+ sig do
1482
+ override.returns(
1483
+ {
1484
+ decimal_places: Float,
1485
+ rounding_method:
1486
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
1487
+ }
1488
+ )
1489
+ end
1490
+ def to_hash
1491
+ end
1492
+
1493
+ module RoundingMethod
1494
+ extend MetronomeSDK::Internal::Type::Enum
1495
+
1496
+ TaggedSymbol =
1497
+ T.type_alias do
1498
+ T.all(
1499
+ Symbol,
1500
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod
1501
+ )
1502
+ end
1503
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1504
+
1505
+ HALF_UP =
1506
+ T.let(
1507
+ :HALF_UP,
1508
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
1509
+ )
1510
+ FLOOR =
1511
+ T.let(
1512
+ :FLOOR,
1513
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
1514
+ )
1515
+ CEILING =
1516
+ T.let(
1517
+ :CEILING,
1518
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
1519
+ )
1520
+
1521
+ sig do
1522
+ override.returns(
1523
+ T::Array[
1524
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::ProrationRounding::Invoice::RoundingMethod::TaggedSymbol
1525
+ ]
1526
+ )
1527
+ end
1528
+ def self.values
1529
+ end
1530
+ end
1531
+ end
1532
+ end
1533
+
1251
1534
  # The frequency at which the recurring commits will be created. If not provided: -
1252
1535
  # The commits will be created on the usage invoice frequency. If provided: - The
1253
1536
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -1285,6 +1568,11 @@ module MetronomeSDK
1285
1568
  :WEEKLY,
1286
1569
  MetronomeSDK::ContractWithoutAmendments::RecurringCommit::RecurrenceFrequency::TaggedSymbol
1287
1570
  )
1571
+ DAILY =
1572
+ T.let(
1573
+ :DAILY,
1574
+ MetronomeSDK::ContractWithoutAmendments::RecurringCommit::RecurrenceFrequency::TaggedSymbol
1575
+ )
1288
1576
 
1289
1577
  sig do
1290
1578
  override.returns(
@@ -1463,6 +1751,26 @@ module MetronomeSDK
1463
1751
  end
1464
1752
  attr_writer :proration
1465
1753
 
1754
+ # Rounding configuration for prorated recurring credit amounts.
1755
+ sig do
1756
+ returns(
1757
+ T.nilable(
1758
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding
1759
+ )
1760
+ )
1761
+ end
1762
+ attr_reader :proration_rounding
1763
+
1764
+ sig do
1765
+ params(
1766
+ proration_rounding:
1767
+ T.nilable(
1768
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::OrHash
1769
+ )
1770
+ ).void
1771
+ end
1772
+ attr_writer :proration_rounding
1773
+
1466
1774
  # The frequency at which the recurring commits will be created. If not provided: -
1467
1775
  # The commits will be created on the usage invoice frequency. If provided: - The
1468
1776
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -1546,6 +1854,10 @@ module MetronomeSDK
1546
1854
  netsuite_sales_order_id: String,
1547
1855
  proration:
1548
1856
  MetronomeSDK::ContractWithoutAmendments::RecurringCredit::Proration::OrSymbol,
1857
+ proration_rounding:
1858
+ T.nilable(
1859
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::OrHash
1860
+ ),
1549
1861
  recurrence_frequency:
1550
1862
  MetronomeSDK::ContractWithoutAmendments::RecurringCredit::RecurrenceFrequency::OrSymbol,
1551
1863
  rollover_fraction: Float,
@@ -1585,6 +1897,8 @@ module MetronomeSDK
1585
1897
  # Determines whether the first and last commit will be prorated. If not provided,
1586
1898
  # the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1587
1899
  proration: nil,
1900
+ # Rounding configuration for prorated recurring credit amounts.
1901
+ proration_rounding: nil,
1588
1902
  # The frequency at which the recurring commits will be created. If not provided: -
1589
1903
  # The commits will be created on the usage invoice frequency. If provided: - The
1590
1904
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -1630,6 +1944,10 @@ module MetronomeSDK
1630
1944
  netsuite_sales_order_id: String,
1631
1945
  proration:
1632
1946
  MetronomeSDK::ContractWithoutAmendments::RecurringCredit::Proration::TaggedSymbol,
1947
+ proration_rounding:
1948
+ T.nilable(
1949
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding
1950
+ ),
1633
1951
  recurrence_frequency:
1634
1952
  MetronomeSDK::ContractWithoutAmendments::RecurringCredit::RecurrenceFrequency::TaggedSymbol,
1635
1953
  rollover_fraction: Float,
@@ -1891,6 +2209,146 @@ module MetronomeSDK
1891
2209
  end
1892
2210
  end
1893
2211
 
2212
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
2213
+ OrHash =
2214
+ T.type_alias do
2215
+ T.any(
2216
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding,
2217
+ MetronomeSDK::Internal::AnyHash
2218
+ )
2219
+ end
2220
+
2221
+ sig do
2222
+ returns(
2223
+ T.nilable(
2224
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access
2225
+ )
2226
+ )
2227
+ end
2228
+ attr_reader :access
2229
+
2230
+ sig do
2231
+ params(
2232
+ access:
2233
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::OrHash
2234
+ ).void
2235
+ end
2236
+ attr_writer :access
2237
+
2238
+ # Rounding configuration for prorated recurring credit amounts.
2239
+ sig do
2240
+ params(
2241
+ access:
2242
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::OrHash
2243
+ ).returns(T.attached_class)
2244
+ end
2245
+ def self.new(access: nil)
2246
+ end
2247
+
2248
+ sig do
2249
+ override.returns(
2250
+ {
2251
+ access:
2252
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access
2253
+ }
2254
+ )
2255
+ end
2256
+ def to_hash
2257
+ end
2258
+
2259
+ class Access < MetronomeSDK::Internal::Type::BaseModel
2260
+ OrHash =
2261
+ T.type_alias do
2262
+ T.any(
2263
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access,
2264
+ MetronomeSDK::Internal::AnyHash
2265
+ )
2266
+ end
2267
+
2268
+ # Number of decimal places to round to. Applied directly to the stored monetary
2269
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
2270
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
2271
+ # dollar).
2272
+ sig { returns(Float) }
2273
+ attr_accessor :decimal_places
2274
+
2275
+ sig do
2276
+ returns(
2277
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
2278
+ )
2279
+ end
2280
+ attr_accessor :rounding_method
2281
+
2282
+ sig do
2283
+ params(
2284
+ decimal_places: Float,
2285
+ rounding_method:
2286
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::OrSymbol
2287
+ ).returns(T.attached_class)
2288
+ end
2289
+ def self.new(
2290
+ # Number of decimal places to round to. Applied directly to the stored monetary
2291
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
2292
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
2293
+ # dollar).
2294
+ decimal_places:,
2295
+ rounding_method:
2296
+ )
2297
+ end
2298
+
2299
+ sig do
2300
+ override.returns(
2301
+ {
2302
+ decimal_places: Float,
2303
+ rounding_method:
2304
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
2305
+ }
2306
+ )
2307
+ end
2308
+ def to_hash
2309
+ end
2310
+
2311
+ module RoundingMethod
2312
+ extend MetronomeSDK::Internal::Type::Enum
2313
+
2314
+ TaggedSymbol =
2315
+ T.type_alias do
2316
+ T.all(
2317
+ Symbol,
2318
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod
2319
+ )
2320
+ end
2321
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2322
+
2323
+ HALF_UP =
2324
+ T.let(
2325
+ :HALF_UP,
2326
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
2327
+ )
2328
+ FLOOR =
2329
+ T.let(
2330
+ :FLOOR,
2331
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
2332
+ )
2333
+ CEILING =
2334
+ T.let(
2335
+ :CEILING,
2336
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
2337
+ )
2338
+
2339
+ sig do
2340
+ override.returns(
2341
+ T::Array[
2342
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::ProrationRounding::Access::RoundingMethod::TaggedSymbol
2343
+ ]
2344
+ )
2345
+ end
2346
+ def self.values
2347
+ end
2348
+ end
2349
+ end
2350
+ end
2351
+
1894
2352
  # The frequency at which the recurring commits will be created. If not provided: -
1895
2353
  # The commits will be created on the usage invoice frequency. If provided: - The
1896
2354
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -1928,6 +2386,11 @@ module MetronomeSDK
1928
2386
  :WEEKLY,
1929
2387
  MetronomeSDK::ContractWithoutAmendments::RecurringCredit::RecurrenceFrequency::TaggedSymbol
1930
2388
  )
2389
+ DAILY =
2390
+ T.let(
2391
+ :DAILY,
2392
+ MetronomeSDK::ContractWithoutAmendments::RecurringCredit::RecurrenceFrequency::TaggedSymbol
2393
+ )
1931
2394
 
1932
2395
  sig do
1933
2396
  override.returns(
@@ -67,6 +67,14 @@ module MetronomeSDK
67
67
  sig { params(contract: MetronomeSDK::Credit::Contract::OrHash).void }
68
68
  attr_writer :contract
69
69
 
70
+ # The actor who created this credit. Omitted for system-generated credits such as
71
+ # recurring credits.
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :created_by
74
+
75
+ sig { params(created_by: String).void }
76
+ attr_writer :created_by
77
+
70
78
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
71
79
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
72
80
  attr_reader :custom_fields
@@ -214,6 +222,7 @@ module MetronomeSDK
214
222
  applicable_product_tags: T::Array[String],
215
223
  balance: Float,
216
224
  contract: MetronomeSDK::Credit::Contract::OrHash,
225
+ created_by: String,
217
226
  custom_fields: T::Hash[Symbol, String],
218
227
  description: String,
219
228
  hierarchy_configuration:
@@ -262,6 +271,9 @@ module MetronomeSDK
262
271
  # included in the balance, including future-dated manual ledger entries.
263
272
  balance: nil,
264
273
  contract: nil,
274
+ # The actor who created this credit. Omitted for system-generated credits such as
275
+ # recurring credits.
276
+ created_by: nil,
265
277
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
266
278
  custom_fields: nil,
267
279
  description: nil,
@@ -310,6 +322,7 @@ module MetronomeSDK
310
322
  applicable_product_tags: T::Array[String],
311
323
  balance: Float,
312
324
  contract: MetronomeSDK::Credit::Contract,
325
+ created_by: String,
313
326
  custom_fields: T::Hash[Symbol, String],
314
327
  description: String,
315
328
  hierarchy_configuration: MetronomeSDK::CommitHierarchyConfiguration,
@@ -252,6 +252,12 @@ module MetronomeSDK
252
252
  )
253
253
  end
254
254
 
255
+ sig { returns(T.nilable(T::Array[String])) }
256
+ attr_reader :any_commit_or_credit_ids
257
+
258
+ sig { params(any_commit_or_credit_ids: T::Array[String]).void }
259
+ attr_writer :any_commit_or_credit_ids
260
+
255
261
  sig do
256
262
  returns(
257
263
  T.nilable(
@@ -311,6 +317,7 @@ module MetronomeSDK
311
317
 
312
318
  sig do
313
319
  params(
320
+ any_commit_or_credit_ids: T::Array[String],
314
321
  billing_frequency:
315
322
  MetronomeSDK::Override::OverrideSpecifier::BillingFrequency::OrSymbol,
316
323
  commit_ids: T::Array[String],
@@ -322,6 +329,7 @@ module MetronomeSDK
322
329
  ).returns(T.attached_class)
323
330
  end
324
331
  def self.new(
332
+ any_commit_or_credit_ids: nil,
325
333
  billing_frequency: nil,
326
334
  commit_ids: nil,
327
335
  presentation_group_values: nil,
@@ -335,6 +343,7 @@ module MetronomeSDK
335
343
  sig do
336
344
  override.returns(
337
345
  {
346
+ any_commit_or_credit_ids: T::Array[String],
338
347
  billing_frequency:
339
348
  MetronomeSDK::Override::OverrideSpecifier::BillingFrequency::TaggedSymbol,
340
349
  commit_ids: T::Array[String],
@@ -74,6 +74,8 @@ module MetronomeSDK
74
74
  end
75
75
  attr_writer :discount_configuration
76
76
 
77
+ # Determines which balances are excluded from remaining balance calculation for
78
+ # threshold billing.
77
79
  sig do
78
80
  returns(
79
81
  T.nilable(
@@ -128,6 +130,8 @@ module MetronomeSDK
128
130
  # commit amount will be in terms of this credit type instead of the fiat currency.
129
131
  custom_credit_type_id: nil,
130
132
  discount_configuration: nil,
133
+ # Determines which balances are excluded from remaining balance calculation for
134
+ # threshold billing.
131
135
  threshold_balance_specifiers: nil
132
136
  )
133
137
  end
@@ -344,6 +348,8 @@ module MetronomeSDK
344
348
  )
345
349
  end
346
350
 
351
+ # If any of the exclude specifier is met, the balance is not considered when
352
+ # evaluating threshold billing
347
353
  sig do
348
354
  returns(
349
355
  T::Array[
@@ -361,7 +367,11 @@ module MetronomeSDK
361
367
  ]
362
368
  ).returns(T.attached_class)
363
369
  end
364
- def self.new(exclude:)
370
+ def self.new(
371
+ # If any of the exclude specifier is met, the balance is not considered when
372
+ # evaluating threshold billing
373
+ exclude:
374
+ )
365
375
  end
366
376
 
367
377
  sig do
@@ -74,6 +74,8 @@ module MetronomeSDK
74
74
  end
75
75
  attr_writer :discount_configuration
76
76
 
77
+ # Determines which balances are excluded from remaining balance calculation for
78
+ # threshold billing.
77
79
  sig do
78
80
  returns(
79
81
  T.nilable(
@@ -128,6 +130,8 @@ module MetronomeSDK
128
130
  # commit amount will be in terms of this credit type instead of the fiat currency.
129
131
  custom_credit_type_id: nil,
130
132
  discount_configuration: nil,
133
+ # Determines which balances are excluded from remaining balance calculation for
134
+ # threshold billing.
131
135
  threshold_balance_specifiers: nil
132
136
  )
133
137
  end