metronome-sdk 2.0.0 → 2.2.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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +75 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/internal/transport/base_client.rb +7 -1
  5. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +38 -26
  6. data/lib/metronome_sdk/internal/util.rb +7 -2
  7. data/lib/metronome_sdk/models/contract.rb +1 -0
  8. data/lib/metronome_sdk/models/contract_v2.rb +69 -23
  9. data/lib/metronome_sdk/models/hierarchy_configuration.rb +45 -21
  10. data/lib/metronome_sdk/models/subscription.rb +38 -1
  11. data/lib/metronome_sdk/models/v1/alert_create_params.rb +33 -1
  12. data/lib/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rb +10 -1
  13. data/lib/metronome_sdk/models/v1/contract_create_params.rb +195 -29
  14. data/lib/metronome_sdk/models/v1/contract_list_balances_params.rb +9 -1
  15. data/lib/metronome_sdk/models/v1/customer_create_params.rb +105 -3
  16. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +14 -10
  17. data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +1 -0
  18. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +1 -0
  19. data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_response.rb +111 -0
  20. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +32 -1
  21. data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +21 -2
  22. data/lib/metronome_sdk/models/v1/customers/billing_config_delete_params.rb +1 -0
  23. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rb +1 -0
  24. data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +21 -2
  25. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +1 -1
  26. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +34 -1
  27. data/lib/metronome_sdk/models/v1/customers/invoice.rb +144 -4
  28. data/lib/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rb +8 -1
  29. data/lib/metronome_sdk/models/v1/payment.rb +7 -1
  30. data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rb +74 -0
  31. data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rb +12 -0
  32. data/lib/metronome_sdk/models/v1/settings/billing_provider_create_params.rb +74 -0
  33. data/lib/metronome_sdk/models/v1/settings/billing_provider_create_response.rb +31 -0
  34. data/lib/metronome_sdk/models/v1/settings/billing_provider_list_params.rb +26 -0
  35. data/lib/metronome_sdk/models/v1/settings/billing_provider_list_response.rb +105 -0
  36. data/lib/metronome_sdk/models/v1/usage_search_response.rb +6 -3
  37. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +17 -1
  38. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +17 -1
  39. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +300 -10
  40. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +177 -3
  41. data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
  42. data/lib/metronome_sdk/resources/v1/contracts.rb +10 -4
  43. data/lib/metronome_sdk/resources/v1/credit_grants.rb +10 -5
  44. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +3 -1
  45. data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +12 -5
  46. data/lib/metronome_sdk/resources/v1/customers/commits.rb +2 -1
  47. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +2 -1
  48. data/lib/metronome_sdk/resources/v1/customers/plans.rb +8 -4
  49. data/lib/metronome_sdk/resources/v1/customers.rb +12 -8
  50. data/lib/metronome_sdk/resources/v1/plans.rb +8 -4
  51. data/lib/metronome_sdk/resources/v1/settings/billing_providers.rb +75 -0
  52. data/lib/metronome_sdk/resources/v1/settings.rb +57 -0
  53. data/lib/metronome_sdk/resources/v1.rb +4 -0
  54. data/lib/metronome_sdk/resources/v2/contracts.rb +10 -2
  55. data/lib/metronome_sdk/version.rb +1 -1
  56. data/lib/metronome_sdk.rb +11 -0
  57. data/manifest.yaml +2 -0
  58. data/rbi/metronome_sdk/internal/transport/base_client.rbi +5 -0
  59. data/rbi/metronome_sdk/internal/transport/pooled_net_requester.rbi +6 -2
  60. data/rbi/metronome_sdk/internal/type/base_model.rbi +8 -4
  61. data/rbi/metronome_sdk/models/contract.rbi +5 -0
  62. data/rbi/metronome_sdk/models/contract_v2.rbi +122 -33
  63. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +63 -27
  64. data/rbi/metronome_sdk/models/subscription.rbi +64 -3
  65. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +69 -0
  66. data/rbi/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbi +13 -0
  67. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +360 -33
  68. data/rbi/metronome_sdk/models/v1/contract_list_balances_params.rbi +11 -0
  69. data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +215 -0
  70. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +18 -11
  71. data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +5 -0
  72. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +5 -0
  73. data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_response.rbi +281 -0
  74. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +67 -0
  75. data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +29 -0
  76. data/rbi/metronome_sdk/models/v1/customers/billing_config_delete_params.rbi +5 -0
  77. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbi +5 -0
  78. data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +24 -0
  79. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +2 -2
  80. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +76 -0
  81. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +268 -0
  82. data/rbi/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbi +9 -0
  83. data/rbi/metronome_sdk/models/v1/payment.rbi +11 -3
  84. data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbi +128 -0
  85. data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbi +25 -0
  86. data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_params.rbi +162 -0
  87. data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_response.rbi +75 -0
  88. data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_params.rbi +50 -0
  89. data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_response.rbi +245 -0
  90. data/rbi/metronome_sdk/models/v1/usage_search_response.rbi +11 -3
  91. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +22 -0
  92. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +22 -0
  93. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +630 -9
  94. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +367 -3
  95. data/rbi/metronome_sdk/resources/v1/alerts.rbi +5 -0
  96. data/rbi/metronome_sdk/resources/v1/contracts.rbi +13 -1
  97. data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +10 -5
  98. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +5 -0
  99. data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +14 -4
  100. data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +3 -2
  101. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +2 -1
  102. data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +8 -4
  103. data/rbi/metronome_sdk/resources/v1/customers.rbi +19 -9
  104. data/rbi/metronome_sdk/resources/v1/plans.rbi +8 -4
  105. data/rbi/metronome_sdk/resources/v1/settings/billing_providers.rbi +63 -0
  106. data/rbi/metronome_sdk/resources/v1/settings.rbi +51 -0
  107. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  108. data/rbi/metronome_sdk/resources/v2/contracts.rbi +12 -0
  109. data/sig/metronome_sdk/internal/transport/base_client.rbs +2 -0
  110. data/sig/metronome_sdk/internal/transport/pooled_net_requester.rbs +4 -1
  111. data/sig/metronome_sdk/models/contract.rbs +2 -0
  112. data/sig/metronome_sdk/models/contract_v2.rbs +33 -6
  113. data/sig/metronome_sdk/models/subscription.rbs +22 -3
  114. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +28 -0
  115. data/sig/metronome_sdk/models/v1/contract_add_manual_balance_entry_params.rbs +7 -0
  116. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +104 -0
  117. data/sig/metronome_sdk/models/v1/contract_list_balances_params.rbs +7 -0
  118. data/sig/metronome_sdk/models/v1/customer_create_params.rbs +85 -0
  119. data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +2 -0
  120. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +2 -0
  121. data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_response.rbs +119 -0
  122. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +26 -1
  123. data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +16 -0
  124. data/sig/metronome_sdk/models/v1/customers/billing_config_delete_params.rbs +2 -0
  125. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbs +2 -0
  126. data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbs +14 -0
  127. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +32 -0
  128. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +130 -0
  129. data/sig/metronome_sdk/models/v1/customers/plan_list_price_adjustments_response.rbs +7 -0
  130. data/sig/metronome_sdk/models/v1/payment.rbs +10 -3
  131. data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbs +61 -0
  132. data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbs +13 -0
  133. data/sig/metronome_sdk/models/v1/settings/billing_provider_create_params.rbs +66 -0
  134. data/sig/metronome_sdk/models/v1/settings/billing_provider_create_response.rbs +34 -0
  135. data/sig/metronome_sdk/models/v1/settings/billing_provider_list_params.rbs +28 -0
  136. data/sig/metronome_sdk/models/v1/settings/billing_provider_list_response.rbs +102 -0
  137. data/sig/metronome_sdk/models/v1/usage_search_response.rbs +3 -1
  138. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +14 -0
  139. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +14 -0
  140. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +234 -3
  141. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +131 -3
  142. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
  143. data/sig/metronome_sdk/resources/v1/contracts.rbs +3 -0
  144. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
  145. data/sig/metronome_sdk/resources/v1/customers/billing_config.rbs +2 -0
  146. data/sig/metronome_sdk/resources/v1/customers.rbs +2 -1
  147. data/sig/metronome_sdk/resources/v1/settings/billing_providers.rbs +23 -0
  148. data/sig/metronome_sdk/resources/v1/settings.rbs +20 -0
  149. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  150. data/sig/metronome_sdk/resources/v2/contracts.rbs +4 -0
  151. metadata +29 -2
@@ -52,6 +52,29 @@ module MetronomeSDK
52
52
  sig { params(billable_status: T.anything).void }
53
53
  attr_writer :billable_status
54
54
 
55
+ # Account hierarchy M3 - Required on invoices with type USAGE_CONSOLIDATED. List
56
+ # of constituent invoices that were consolidated to create this invoice.
57
+ sig do
58
+ returns(
59
+ T.nilable(
60
+ T::Array[
61
+ MetronomeSDK::V1::Customers::Invoice::ConstituentInvoice
62
+ ]
63
+ )
64
+ )
65
+ end
66
+ attr_reader :constituent_invoices
67
+
68
+ sig do
69
+ params(
70
+ constituent_invoices:
71
+ T::Array[
72
+ MetronomeSDK::V1::Customers::Invoice::ConstituentInvoice::OrHash
73
+ ]
74
+ ).void
75
+ end
76
+ attr_writer :constituent_invoices
77
+
55
78
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
56
79
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
57
80
  attr_reader :contract_custom_fields
@@ -166,6 +189,20 @@ module MetronomeSDK
166
189
  sig { params(netsuite_sales_order_id: String).void }
167
190
  attr_writer :netsuite_sales_order_id
168
191
 
192
+ # Account hierarchy M3 - Required for account hierarchy usage invoices. An object
193
+ # containing the contract and customer UUIDs that pay for this invoice.
194
+ sig do
195
+ returns(T.nilable(MetronomeSDK::V1::Customers::Invoice::Payer))
196
+ end
197
+ attr_reader :payer
198
+
199
+ sig do
200
+ params(
201
+ payer: MetronomeSDK::V1::Customers::Invoice::Payer::OrHash
202
+ ).void
203
+ end
204
+ attr_writer :payer
205
+
169
206
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
170
207
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
171
208
  attr_reader :plan_custom_fields
@@ -235,6 +272,10 @@ module MetronomeSDK
235
272
  type: String,
236
273
  amendment_id: String,
237
274
  billable_status: T.anything,
275
+ constituent_invoices:
276
+ T::Array[
277
+ MetronomeSDK::V1::Customers::Invoice::ConstituentInvoice::OrHash
278
+ ],
238
279
  contract_custom_fields: T::Hash[Symbol, String],
239
280
  contract_id: String,
240
281
  correction_record:
@@ -254,6 +295,7 @@ module MetronomeSDK
254
295
  issued_at: Time,
255
296
  net_payment_terms_days: Float,
256
297
  netsuite_sales_order_id: String,
298
+ payer: MetronomeSDK::V1::Customers::Invoice::Payer::OrHash,
257
299
  plan_custom_fields: T::Hash[Symbol, String],
258
300
  plan_id: String,
259
301
  plan_name: String,
@@ -275,6 +317,9 @@ module MetronomeSDK
275
317
  amendment_id: nil,
276
318
  # This field's availability is dependent on your client's configuration.
277
319
  billable_status: nil,
320
+ # Account hierarchy M3 - Required on invoices with type USAGE_CONSOLIDATED. List
321
+ # of constituent invoices that were consolidated to create this invoice.
322
+ constituent_invoices: nil,
278
323
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
279
324
  contract_custom_fields: nil,
280
325
  contract_id: nil,
@@ -294,6 +339,9 @@ module MetronomeSDK
294
339
  net_payment_terms_days: nil,
295
340
  # This field's availability is dependent on your client's configuration.
296
341
  netsuite_sales_order_id: nil,
342
+ # Account hierarchy M3 - Required for account hierarchy usage invoices. An object
343
+ # containing the contract and customer UUIDs that pay for this invoice.
344
+ payer: nil,
297
345
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
298
346
  plan_custom_fields: nil,
299
347
  plan_id: nil,
@@ -321,6 +369,10 @@ module MetronomeSDK
321
369
  type: String,
322
370
  amendment_id: String,
323
371
  billable_status: T.anything,
372
+ constituent_invoices:
373
+ T::Array[
374
+ MetronomeSDK::V1::Customers::Invoice::ConstituentInvoice
375
+ ],
324
376
  contract_custom_fields: T::Hash[Symbol, String],
325
377
  contract_id: String,
326
378
  correction_record:
@@ -340,6 +392,7 @@ module MetronomeSDK
340
392
  issued_at: Time,
341
393
  net_payment_terms_days: Float,
342
394
  netsuite_sales_order_id: String,
395
+ payer: MetronomeSDK::V1::Customers::Invoice::Payer,
343
396
  plan_custom_fields: T::Hash[Symbol, String],
344
397
  plan_id: String,
345
398
  plan_name: String,
@@ -545,6 +598,26 @@ module MetronomeSDK
545
598
  sig { params(netsuite_item_id: String).void }
546
599
  attr_writer :netsuite_item_id
547
600
 
601
+ # Account hierarchy M3 - Present on line items from invoices with type
602
+ # USAGE_CONSOLIDATED. Indicates the original customer, contract, invoice and line
603
+ # item from which this line item was copied.
604
+ sig do
605
+ returns(
606
+ T.nilable(
607
+ MetronomeSDK::V1::Customers::Invoice::LineItem::Origin
608
+ )
609
+ )
610
+ end
611
+ attr_reader :origin
612
+
613
+ sig do
614
+ params(
615
+ origin:
616
+ MetronomeSDK::V1::Customers::Invoice::LineItem::Origin::OrHash
617
+ ).void
618
+ end
619
+ attr_writer :origin
620
+
548
621
  # Only present for line items paying for a postpaid commit true-up.
549
622
  sig do
550
623
  returns(
@@ -760,6 +833,8 @@ module MetronomeSDK
760
833
  netsuite_invoice_billing_end: Time,
761
834
  netsuite_invoice_billing_start: Time,
762
835
  netsuite_item_id: String,
836
+ origin:
837
+ MetronomeSDK::V1::Customers::Invoice::LineItem::Origin::OrHash,
763
838
  postpaid_commit:
764
839
  MetronomeSDK::V1::Customers::Invoice::LineItem::PostpaidCommit::OrHash,
765
840
  presentation_group_values: T::Hash[Symbol, T.nilable(String)],
@@ -853,6 +928,10 @@ module MetronomeSDK
853
928
  # The start date for the billing period on the invoice.
854
929
  netsuite_invoice_billing_start: nil,
855
930
  netsuite_item_id: nil,
931
+ # Account hierarchy M3 - Present on line items from invoices with type
932
+ # USAGE_CONSOLIDATED. Indicates the original customer, contract, invoice and line
933
+ # item from which this line item was copied.
934
+ origin: nil,
856
935
  # Only present for line items paying for a postpaid commit true-up.
857
936
  postpaid_commit: nil,
858
937
  # Includes the presentation group values associated with this line item if
@@ -922,6 +1001,8 @@ module MetronomeSDK
922
1001
  netsuite_invoice_billing_end: Time,
923
1002
  netsuite_invoice_billing_start: Time,
924
1003
  netsuite_item_id: String,
1004
+ origin:
1005
+ MetronomeSDK::V1::Customers::Invoice::LineItem::Origin,
925
1006
  postpaid_commit:
926
1007
  MetronomeSDK::V1::Customers::Invoice::LineItem::PostpaidCommit,
927
1008
  presentation_group_values: T::Hash[Symbol, T.nilable(String)],
@@ -1035,6 +1116,60 @@ module MetronomeSDK
1035
1116
  end
1036
1117
  end
1037
1118
 
1119
+ class Origin < MetronomeSDK::Internal::Type::BaseModel
1120
+ OrHash =
1121
+ T.type_alias do
1122
+ T.any(
1123
+ MetronomeSDK::V1::Customers::Invoice::LineItem::Origin,
1124
+ MetronomeSDK::Internal::AnyHash
1125
+ )
1126
+ end
1127
+
1128
+ sig { returns(String) }
1129
+ attr_accessor :contract_id
1130
+
1131
+ sig { returns(String) }
1132
+ attr_accessor :customer_id
1133
+
1134
+ sig { returns(String) }
1135
+ attr_accessor :invoice_id
1136
+
1137
+ sig { returns(String) }
1138
+ attr_accessor :line_item_id
1139
+
1140
+ # Account hierarchy M3 - Present on line items from invoices with type
1141
+ # USAGE_CONSOLIDATED. Indicates the original customer, contract, invoice and line
1142
+ # item from which this line item was copied.
1143
+ sig do
1144
+ params(
1145
+ contract_id: String,
1146
+ customer_id: String,
1147
+ invoice_id: String,
1148
+ line_item_id: String
1149
+ ).returns(T.attached_class)
1150
+ end
1151
+ def self.new(
1152
+ contract_id:,
1153
+ customer_id:,
1154
+ invoice_id:,
1155
+ line_item_id:
1156
+ )
1157
+ end
1158
+
1159
+ sig do
1160
+ override.returns(
1161
+ {
1162
+ contract_id: String,
1163
+ customer_id: String,
1164
+ invoice_id: String,
1165
+ line_item_id: String
1166
+ }
1167
+ )
1168
+ end
1169
+ def to_hash
1170
+ end
1171
+ end
1172
+
1038
1173
  class PostpaidCommit < MetronomeSDK::Internal::Type::BaseModel
1039
1174
  OrHash =
1040
1175
  T.type_alias do
@@ -1387,6 +1522,43 @@ module MetronomeSDK
1387
1522
  end
1388
1523
  end
1389
1524
 
1525
+ class ConstituentInvoice < MetronomeSDK::Internal::Type::BaseModel
1526
+ OrHash =
1527
+ T.type_alias do
1528
+ T.any(
1529
+ MetronomeSDK::V1::Customers::Invoice::ConstituentInvoice,
1530
+ MetronomeSDK::Internal::AnyHash
1531
+ )
1532
+ end
1533
+
1534
+ sig { returns(String) }
1535
+ attr_accessor :contract_id
1536
+
1537
+ sig { returns(String) }
1538
+ attr_accessor :customer_id
1539
+
1540
+ sig { returns(String) }
1541
+ attr_accessor :invoice_id
1542
+
1543
+ sig do
1544
+ params(
1545
+ contract_id: String,
1546
+ customer_id: String,
1547
+ invoice_id: String
1548
+ ).returns(T.attached_class)
1549
+ end
1550
+ def self.new(contract_id:, customer_id:, invoice_id:)
1551
+ end
1552
+
1553
+ sig do
1554
+ override.returns(
1555
+ { contract_id: String, customer_id: String, invoice_id: String }
1556
+ )
1557
+ end
1558
+ def to_hash
1559
+ end
1560
+ end
1561
+
1390
1562
  class CorrectionRecord < MetronomeSDK::Internal::Type::BaseModel
1391
1563
  OrHash =
1392
1564
  T.type_alias do
@@ -1469,6 +1641,20 @@ module MetronomeSDK
1469
1641
  end
1470
1642
  attr_accessor :billing_provider_type
1471
1643
 
1644
+ # Error message from the billing provider, if available.
1645
+ sig { returns(T.nilable(String)) }
1646
+ attr_reader :billing_provider_error
1647
+
1648
+ sig { params(billing_provider_error: String).void }
1649
+ attr_writer :billing_provider_error
1650
+
1651
+ # The ID of the payment in the external system, if available.
1652
+ sig { returns(T.nilable(String)) }
1653
+ attr_reader :external_payment_id
1654
+
1655
+ sig { params(external_payment_id: String).void }
1656
+ attr_writer :external_payment_id
1657
+
1472
1658
  sig do
1473
1659
  returns(
1474
1660
  T.nilable(
@@ -1541,6 +1727,8 @@ module MetronomeSDK
1541
1727
  params(
1542
1728
  billing_provider_type:
1543
1729
  MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::BillingProviderType::OrSymbol,
1730
+ billing_provider_error: String,
1731
+ external_payment_id: String,
1544
1732
  external_status:
1545
1733
  MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::ExternalStatus::OrSymbol,
1546
1734
  invoice_id: String,
@@ -1554,6 +1742,10 @@ module MetronomeSDK
1554
1742
  end
1555
1743
  def self.new(
1556
1744
  billing_provider_type:,
1745
+ # Error message from the billing provider, if available.
1746
+ billing_provider_error: nil,
1747
+ # The ID of the payment in the external system, if available.
1748
+ external_payment_id: nil,
1557
1749
  external_status: nil,
1558
1750
  invoice_id: nil,
1559
1751
  # The subtotal amount invoiced, if available from the billing provider.
@@ -1573,6 +1765,8 @@ module MetronomeSDK
1573
1765
  {
1574
1766
  billing_provider_type:
1575
1767
  MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::BillingProviderType::TaggedSymbol,
1768
+ billing_provider_error: String,
1769
+ external_payment_id: String,
1576
1770
  external_status:
1577
1771
  MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::ExternalStatus::TaggedSymbol,
1578
1772
  invoice_id: String,
@@ -1640,6 +1834,11 @@ module MetronomeSDK
1640
1834
  :gcp_marketplace,
1641
1835
  MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::BillingProviderType::TaggedSymbol
1642
1836
  )
1837
+ METRONOME =
1838
+ T.let(
1839
+ :metronome,
1840
+ MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::BillingProviderType::TaggedSymbol
1841
+ )
1643
1842
 
1644
1843
  sig do
1645
1844
  override.returns(
@@ -1679,6 +1878,11 @@ module MetronomeSDK
1679
1878
  :PAID,
1680
1879
  MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::ExternalStatus::TaggedSymbol
1681
1880
  )
1881
+ PARTIALLY_PAID =
1882
+ T.let(
1883
+ :PARTIALLY_PAID,
1884
+ MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::ExternalStatus::TaggedSymbol
1885
+ )
1682
1886
  UNCOLLECTIBLE =
1683
1887
  T.let(
1684
1888
  :UNCOLLECTIBLE,
@@ -1810,6 +2014,20 @@ module MetronomeSDK
1810
2014
  end
1811
2015
  attr_accessor :billing_provider_type
1812
2016
 
2017
+ # Error message from the billing provider, if available.
2018
+ sig { returns(T.nilable(String)) }
2019
+ attr_reader :billing_provider_error
2020
+
2021
+ sig { params(billing_provider_error: String).void }
2022
+ attr_writer :billing_provider_error
2023
+
2024
+ # The ID of the payment in the external system, if available.
2025
+ sig { returns(T.nilable(String)) }
2026
+ attr_reader :external_payment_id
2027
+
2028
+ sig { params(external_payment_id: String).void }
2029
+ attr_writer :external_payment_id
2030
+
1813
2031
  sig do
1814
2032
  returns(
1815
2033
  T.nilable(
@@ -1882,6 +2100,8 @@ module MetronomeSDK
1882
2100
  params(
1883
2101
  billing_provider_type:
1884
2102
  MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::BillingProviderType::OrSymbol,
2103
+ billing_provider_error: String,
2104
+ external_payment_id: String,
1885
2105
  external_status:
1886
2106
  MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::ExternalStatus::OrSymbol,
1887
2107
  invoice_id: String,
@@ -1895,6 +2115,10 @@ module MetronomeSDK
1895
2115
  end
1896
2116
  def self.new(
1897
2117
  billing_provider_type:,
2118
+ # Error message from the billing provider, if available.
2119
+ billing_provider_error: nil,
2120
+ # The ID of the payment in the external system, if available.
2121
+ external_payment_id: nil,
1898
2122
  external_status: nil,
1899
2123
  invoice_id: nil,
1900
2124
  # The subtotal amount invoiced, if available from the billing provider.
@@ -1914,6 +2138,8 @@ module MetronomeSDK
1914
2138
  {
1915
2139
  billing_provider_type:
1916
2140
  MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::BillingProviderType::TaggedSymbol,
2141
+ billing_provider_error: String,
2142
+ external_payment_id: String,
1917
2143
  external_status:
1918
2144
  MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::ExternalStatus::TaggedSymbol,
1919
2145
  invoice_id: String,
@@ -1981,6 +2207,11 @@ module MetronomeSDK
1981
2207
  :gcp_marketplace,
1982
2208
  MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::BillingProviderType::TaggedSymbol
1983
2209
  )
2210
+ METRONOME =
2211
+ T.let(
2212
+ :metronome,
2213
+ MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::BillingProviderType::TaggedSymbol
2214
+ )
1984
2215
 
1985
2216
  sig do
1986
2217
  override.returns(
@@ -2020,6 +2251,11 @@ module MetronomeSDK
2020
2251
  :PAID,
2021
2252
  MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::ExternalStatus::TaggedSymbol
2022
2253
  )
2254
+ PARTIALLY_PAID =
2255
+ T.let(
2256
+ :PARTIALLY_PAID,
2257
+ MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::ExternalStatus::TaggedSymbol
2258
+ )
2023
2259
  UNCOLLECTIBLE =
2024
2260
  T.let(
2025
2261
  :UNCOLLECTIBLE,
@@ -2206,6 +2442,38 @@ module MetronomeSDK
2206
2442
  end
2207
2443
  end
2208
2444
 
2445
+ class Payer < MetronomeSDK::Internal::Type::BaseModel
2446
+ OrHash =
2447
+ T.type_alias do
2448
+ T.any(
2449
+ MetronomeSDK::V1::Customers::Invoice::Payer,
2450
+ MetronomeSDK::Internal::AnyHash
2451
+ )
2452
+ end
2453
+
2454
+ sig { returns(String) }
2455
+ attr_accessor :contract_id
2456
+
2457
+ sig { returns(String) }
2458
+ attr_accessor :customer_id
2459
+
2460
+ # Account hierarchy M3 - Required for account hierarchy usage invoices. An object
2461
+ # containing the contract and customer UUIDs that pay for this invoice.
2462
+ sig do
2463
+ params(contract_id: String, customer_id: String).returns(
2464
+ T.attached_class
2465
+ )
2466
+ end
2467
+ def self.new(contract_id:, customer_id:)
2468
+ end
2469
+
2470
+ sig do
2471
+ override.returns({ contract_id: String, customer_id: String })
2472
+ end
2473
+ def to_hash
2474
+ end
2475
+ end
2476
+
2209
2477
  class ResellerRoyalty < MetronomeSDK::Internal::Type::BaseModel
2210
2478
  OrHash =
2211
2479
  T.type_alias do
@@ -147,6 +147,12 @@ module MetronomeSDK
147
147
  end
148
148
  attr_accessor :adjustment_type
149
149
 
150
+ sig { returns(T.nilable(Float)) }
151
+ attr_reader :quantity
152
+
153
+ sig { params(quantity: Float).void }
154
+ attr_writer :quantity
155
+
150
156
  # Used in pricing tiers. Indicates at what metric value the price applies.
151
157
  sig { returns(T.nilable(Float)) }
152
158
  attr_reader :tier
@@ -164,6 +170,7 @@ module MetronomeSDK
164
170
  params(
165
171
  adjustment_type:
166
172
  MetronomeSDK::Models::V1::Customers::PlanListPriceAdjustmentsResponse::Price::AdjustmentType::OrSymbol,
173
+ quantity: Float,
167
174
  tier: Float,
168
175
  value: Float
169
176
  ).returns(T.attached_class)
@@ -171,6 +178,7 @@ module MetronomeSDK
171
178
  def self.new(
172
179
  # Determines how the value will be applied.
173
180
  adjustment_type:,
181
+ quantity: nil,
174
182
  # Used in pricing tiers. Indicates at what metric value the price applies.
175
183
  tier: nil,
176
184
  value: nil
@@ -182,6 +190,7 @@ module MetronomeSDK
182
190
  {
183
191
  adjustment_type:
184
192
  MetronomeSDK::Models::V1::Customers::PlanListPriceAdjustmentsResponse::Price::AdjustmentType::TaggedSymbol,
193
+ quantity: Float,
185
194
  tier: Float,
186
195
  value: Float
187
196
  }
@@ -215,14 +215,21 @@ module MetronomeSDK
215
215
  end
216
216
  attr_writer :error
217
217
 
218
+ sig { returns(T.nilable(String)) }
219
+ attr_reader :payment_method_id
220
+
221
+ sig { params(payment_method_id: String).void }
222
+ attr_writer :payment_method_id
223
+
218
224
  sig do
219
225
  params(
220
226
  payment_intent_id: String,
221
227
  error:
222
- MetronomeSDK::V1::Payment::PaymentGateway::Stripe::Error::OrHash
228
+ MetronomeSDK::V1::Payment::PaymentGateway::Stripe::Error::OrHash,
229
+ payment_method_id: String
223
230
  ).returns(T.attached_class)
224
231
  end
225
- def self.new(payment_intent_id:, error: nil)
232
+ def self.new(payment_intent_id:, error: nil, payment_method_id: nil)
226
233
  end
227
234
 
228
235
  sig do
@@ -230,7 +237,8 @@ module MetronomeSDK
230
237
  {
231
238
  payment_intent_id: String,
232
239
  error:
233
- MetronomeSDK::V1::Payment::PaymentGateway::Stripe::Error
240
+ MetronomeSDK::V1::Payment::PaymentGateway::Stripe::Error,
241
+ payment_method_id: String
234
242
  }
235
243
  )
236
244
  end
@@ -0,0 +1,128 @@
1
+ # typed: strong
2
+
3
+ module MetronomeSDK
4
+ module Models
5
+ module V1
6
+ class SettingUpsertAvalaraCredentialsParams < MetronomeSDK::Internal::Type::BaseModel
7
+ extend MetronomeSDK::Internal::Type::RequestParameters::Converter
8
+ include MetronomeSDK::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams,
14
+ MetronomeSDK::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # The Avalara environment to use (SANDBOX or PRODUCTION).
19
+ sig do
20
+ returns(
21
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment::OrSymbol
22
+ )
23
+ end
24
+ attr_accessor :avalara_environment
25
+
26
+ # The password for the Avalara account.
27
+ sig { returns(String) }
28
+ attr_accessor :avalara_password
29
+
30
+ # The username for the Avalara account.
31
+ sig { returns(String) }
32
+ attr_accessor :avalara_username
33
+
34
+ # The delivery method IDs of the billing provider configurations to update, can be
35
+ # found in the response of the `/listConfiguredBillingProviders` endpoint.
36
+ sig { returns(T::Array[String]) }
37
+ attr_accessor :delivery_method_ids
38
+
39
+ # Commit transactions if you want Metronome tax calculations used for reporting
40
+ # and tax filings.
41
+ sig { returns(T.nilable(T::Boolean)) }
42
+ attr_reader :commit_transactions
43
+
44
+ sig { params(commit_transactions: T::Boolean).void }
45
+ attr_writer :commit_transactions
46
+
47
+ sig do
48
+ params(
49
+ avalara_environment:
50
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment::OrSymbol,
51
+ avalara_password: String,
52
+ avalara_username: String,
53
+ delivery_method_ids: T::Array[String],
54
+ commit_transactions: T::Boolean,
55
+ request_options: MetronomeSDK::RequestOptions::OrHash
56
+ ).returns(T.attached_class)
57
+ end
58
+ def self.new(
59
+ # The Avalara environment to use (SANDBOX or PRODUCTION).
60
+ avalara_environment:,
61
+ # The password for the Avalara account.
62
+ avalara_password:,
63
+ # The username for the Avalara account.
64
+ avalara_username:,
65
+ # The delivery method IDs of the billing provider configurations to update, can be
66
+ # found in the response of the `/listConfiguredBillingProviders` endpoint.
67
+ delivery_method_ids:,
68
+ # Commit transactions if you want Metronome tax calculations used for reporting
69
+ # and tax filings.
70
+ commit_transactions: nil,
71
+ request_options: {}
72
+ )
73
+ end
74
+
75
+ sig do
76
+ override.returns(
77
+ {
78
+ avalara_environment:
79
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment::OrSymbol,
80
+ avalara_password: String,
81
+ avalara_username: String,
82
+ delivery_method_ids: T::Array[String],
83
+ commit_transactions: T::Boolean,
84
+ request_options: MetronomeSDK::RequestOptions
85
+ }
86
+ )
87
+ end
88
+ def to_hash
89
+ end
90
+
91
+ # The Avalara environment to use (SANDBOX or PRODUCTION).
92
+ module AvalaraEnvironment
93
+ extend MetronomeSDK::Internal::Type::Enum
94
+
95
+ TaggedSymbol =
96
+ T.type_alias do
97
+ T.all(
98
+ Symbol,
99
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment
100
+ )
101
+ end
102
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
103
+
104
+ PRODUCTION =
105
+ T.let(
106
+ :PRODUCTION,
107
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment::TaggedSymbol
108
+ )
109
+ SANDBOX =
110
+ T.let(
111
+ :SANDBOX,
112
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment::TaggedSymbol
113
+ )
114
+
115
+ sig do
116
+ override.returns(
117
+ T::Array[
118
+ MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment::TaggedSymbol
119
+ ]
120
+ )
121
+ end
122
+ def self.values
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
@@ -0,0 +1,25 @@
1
+ # typed: strong
2
+
3
+ module MetronomeSDK
4
+ module Models
5
+ module V1
6
+ class SettingUpsertAvalaraCredentialsResponse < MetronomeSDK::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse,
11
+ MetronomeSDK::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(T.attached_class) }
16
+ def self.new
17
+ end
18
+
19
+ sig { override.returns({}) }
20
+ def to_hash
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end