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
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MetronomeSDK
4
+ module Resources
5
+ class V1
6
+ class Settings
7
+ class BillingProviders
8
+ # Some parameter documentations has been truncated, see
9
+ # {MetronomeSDK::Models::V1::Settings::BillingProviderCreateParams} for more
10
+ # details.
11
+ #
12
+ # Set up account-level configuration for a billing provider. Once configured,
13
+ # individual contracts across customers can be mapped to this configuration using
14
+ # the returned delivery_method_id.
15
+ #
16
+ # @overload create(billing_provider:, configuration:, delivery_method:, request_options: {})
17
+ #
18
+ # @param billing_provider [Symbol, MetronomeSDK::Models::V1::Settings::BillingProviderCreateParams::BillingProvider] The billing provider set for this configuration.
19
+ #
20
+ # @param configuration [Hash{Symbol=>Object}] Account-level configuration for the billing provider. The structure of this obje
21
+ #
22
+ # @param delivery_method [Symbol, MetronomeSDK::Models::V1::Settings::BillingProviderCreateParams::DeliveryMethod] The method to use for delivering invoices for this configuration.
23
+ #
24
+ # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
25
+ #
26
+ # @return [MetronomeSDK::Models::V1::Settings::BillingProviderCreateResponse]
27
+ #
28
+ # @see MetronomeSDK::Models::V1::Settings::BillingProviderCreateParams
29
+ def create(params)
30
+ parsed, options = MetronomeSDK::V1::Settings::BillingProviderCreateParams.dump_request(params)
31
+ @client.request(
32
+ method: :post,
33
+ path: "v1/setUpBillingProvider",
34
+ body: parsed,
35
+ model: MetronomeSDK::Models::V1::Settings::BillingProviderCreateResponse,
36
+ options: options
37
+ )
38
+ end
39
+
40
+ # Lists all configured billing providers and their delivery method configurations
41
+ # for your account. Returns provider details, delivery method IDs, and
42
+ # configuration settings needed for mapping individual customer contracts to
43
+ # billing integrations.
44
+ #
45
+ # @overload list(next_page: nil, request_options: {})
46
+ #
47
+ # @param next_page [String, nil] The cursor to the next page of results
48
+ #
49
+ # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
50
+ #
51
+ # @return [MetronomeSDK::Models::V1::Settings::BillingProviderListResponse]
52
+ #
53
+ # @see MetronomeSDK::Models::V1::Settings::BillingProviderListParams
54
+ def list(params = {})
55
+ parsed, options = MetronomeSDK::V1::Settings::BillingProviderListParams.dump_request(params)
56
+ @client.request(
57
+ method: :post,
58
+ path: "v1/listConfiguredBillingProviders",
59
+ body: parsed,
60
+ model: MetronomeSDK::Models::V1::Settings::BillingProviderListResponse,
61
+ options: options
62
+ )
63
+ end
64
+
65
+ # @api private
66
+ #
67
+ # @param client [MetronomeSDK::Client]
68
+ def initialize(client:)
69
+ @client = client
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MetronomeSDK
4
+ module Resources
5
+ class V1
6
+ class Settings
7
+ # @return [MetronomeSDK::Resources::V1::Settings::BillingProviders]
8
+ attr_reader :billing_providers
9
+
10
+ # Some parameter documentations has been truncated, see
11
+ # {MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsParams} for more
12
+ # details.
13
+ #
14
+ # Set the Avalara credentials for some specified `delivery_method_ids`, which can
15
+ # be found in the `/listConfiguredBillingProviders` response. This maps the
16
+ # Avalara credentials to the appropriate billing entity. These credentials are
17
+ # only used for PLG Invoicing today.
18
+ #
19
+ # @overload upsert_avalara_credentials(avalara_environment:, avalara_password:, avalara_username:, delivery_method_ids:, commit_transactions: nil, request_options: {})
20
+ #
21
+ # @param avalara_environment [Symbol, MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsParams::AvalaraEnvironment] The Avalara environment to use (SANDBOX or PRODUCTION).
22
+ #
23
+ # @param avalara_password [String] The password for the Avalara account.
24
+ #
25
+ # @param avalara_username [String] The username for the Avalara account.
26
+ #
27
+ # @param delivery_method_ids [Array<String>] The delivery method IDs of the billing provider configurations to update, can be
28
+ #
29
+ # @param commit_transactions [Boolean] Commit transactions if you want Metronome tax calculations used for reporting an
30
+ #
31
+ # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
32
+ #
33
+ # @return [MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse]
34
+ #
35
+ # @see MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsParams
36
+ def upsert_avalara_credentials(params)
37
+ parsed, options = MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams.dump_request(params)
38
+ @client.request(
39
+ method: :post,
40
+ path: "v1/upsertAvalaraCredentials",
41
+ body: parsed,
42
+ model: MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse,
43
+ options: options
44
+ )
45
+ end
46
+
47
+ # @api private
48
+ #
49
+ # @param client [MetronomeSDK::Client]
50
+ def initialize(client:)
51
+ @client = client
52
+ @billing_providers = MetronomeSDK::Resources::V1::Settings::BillingProviders.new(client: client)
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -45,6 +45,9 @@ module MetronomeSDK
45
45
  # @return [MetronomeSDK::Resources::V1::Payments]
46
46
  attr_reader :payments
47
47
 
48
+ # @return [MetronomeSDK::Resources::V1::Settings]
49
+ attr_reader :settings
50
+
48
51
  # @api private
49
52
  #
50
53
  # @param client [MetronomeSDK::Client]
@@ -64,6 +67,7 @@ module MetronomeSDK
64
67
  @invoices = MetronomeSDK::Resources::V1::Invoices.new(client: client)
65
68
  @contracts = MetronomeSDK::Resources::V1::Contracts.new(client: client)
66
69
  @payments = MetronomeSDK::Resources::V1::Payments.new(client: client)
70
+ @settings = MetronomeSDK::Resources::V1::Settings.new(client: client)
67
71
  end
68
72
  end
69
73
  end
@@ -228,7 +228,7 @@ module MetronomeSDK
228
228
  # finalized invoice. You can void the invoice beforehand and then remove the
229
229
  # access schedule segment.
230
230
  #
231
- # @overload edit_commit(commit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, hierarchy_configuration: nil, invoice_contract_id: nil, invoice_schedule: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
231
+ # @overload edit_commit(commit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, invoice_contract_id: nil, invoice_schedule: nil, name: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
232
232
  #
233
233
  # @param commit_id [String] ID of the commit to edit
234
234
  #
@@ -240,12 +240,16 @@ module MetronomeSDK
240
240
  #
241
241
  # @param applicable_product_tags [Array<String>, nil] Which tags the commit applies to. If applicable*product_ids, applicable_product*
242
242
  #
243
+ # @param description [String] Updated description for the commit
244
+ #
243
245
  # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for commit hierarchy access control
244
246
  #
245
247
  # @param invoice_contract_id [String] ID of contract to use for invoicing
246
248
  #
247
249
  # @param invoice_schedule [MetronomeSDK::Models::V2::ContractEditCommitParams::InvoiceSchedule]
248
250
  #
251
+ # @param name [String] Updated name for the commit
252
+ #
249
253
  # @param priority [Float, nil] If multiple commits are applicable, the one with the lower priority will apply f
250
254
  #
251
255
  # @param product_id [String]
@@ -290,7 +294,7 @@ module MetronomeSDK
290
294
  # invoice. You can void the invoice beforehand and then remove the access
291
295
  # schedule segment.
292
296
  #
293
- # @overload edit_credit(credit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, hierarchy_configuration: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
297
+ # @overload edit_credit(credit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, name: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
294
298
  #
295
299
  # @param credit_id [String] ID of the credit to edit
296
300
  #
@@ -302,8 +306,12 @@ module MetronomeSDK
302
306
  #
303
307
  # @param applicable_product_tags [Array<String>, nil] Which tags the credit applies to. If both applicable*product_ids and applicable*
304
308
  #
309
+ # @param description [String] Updated description for the credit
310
+ #
305
311
  # @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for credit hierarchy access control
306
312
  #
313
+ # @param name [String] Updated name for the credit
314
+ #
307
315
  # @param priority [Float, nil] If multiple commits are applicable, the one with the lower priority will apply f
308
316
  #
309
317
  # @param product_id [String]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MetronomeSDK
4
- VERSION = "2.0.0"
4
+ VERSION = "2.2.0"
5
5
  end
data/lib/metronome_sdk.rb CHANGED
@@ -3,12 +3,14 @@
3
3
  # Standard libraries.
4
4
  # rubocop:disable Lint/RedundantRequireStatement
5
5
  require "English"
6
+ require "base64"
6
7
  require "cgi"
7
8
  require "date"
8
9
  require "erb"
9
10
  require "etc"
10
11
  require "json"
11
12
  require "net/http"
13
+ require "openssl"
12
14
  require "pathname"
13
15
  require "rbconfig"
14
16
  require "securerandom"
@@ -235,6 +237,7 @@ require_relative "metronome_sdk/models/v1/customers/plan_list_price_adjustments_
235
237
  require_relative "metronome_sdk/models/v1/customers/plan_list_price_adjustments_response"
236
238
  require_relative "metronome_sdk/models/v1/customers/plan_list_response"
237
239
  require_relative "metronome_sdk/models/v1/customer_set_billing_configurations_params"
240
+ require_relative "metronome_sdk/models/v1/customer_set_billing_configurations_response"
238
241
  require_relative "metronome_sdk/models/v1/customer_set_ingest_aliases_params"
239
242
  require_relative "metronome_sdk/models/v1/customer_set_name_params"
240
243
  require_relative "metronome_sdk/models/v1/customer_set_name_response"
@@ -273,6 +276,12 @@ require_relative "metronome_sdk/models/v1/rollover_amount_max_amount"
273
276
  require_relative "metronome_sdk/models/v1/rollover_amount_max_percentage"
274
277
  require_relative "metronome_sdk/models/v1/service_list_params"
275
278
  require_relative "metronome_sdk/models/v1/service_list_response"
279
+ require_relative "metronome_sdk/models/v1/settings/billing_provider_create_params"
280
+ require_relative "metronome_sdk/models/v1/settings/billing_provider_create_response"
281
+ require_relative "metronome_sdk/models/v1/settings/billing_provider_list_params"
282
+ require_relative "metronome_sdk/models/v1/settings/billing_provider_list_response"
283
+ require_relative "metronome_sdk/models/v1/setting_upsert_avalara_credentials_params"
284
+ require_relative "metronome_sdk/models/v1/setting_upsert_avalara_credentials_response"
276
285
  require_relative "metronome_sdk/models/v1/usage_ingest_params"
277
286
  require_relative "metronome_sdk/models/v1/usage_list_params"
278
287
  require_relative "metronome_sdk/models/v1/usage_list_response"
@@ -320,6 +329,8 @@ require_relative "metronome_sdk/resources/v1/payments"
320
329
  require_relative "metronome_sdk/resources/v1/plans"
321
330
  require_relative "metronome_sdk/resources/v1/pricing_units"
322
331
  require_relative "metronome_sdk/resources/v1/services"
332
+ require_relative "metronome_sdk/resources/v1/settings"
333
+ require_relative "metronome_sdk/resources/v1/settings/billing_providers"
323
334
  require_relative "metronome_sdk/resources/v1/usage"
324
335
  require_relative "metronome_sdk/resources/v2"
325
336
  require_relative "metronome_sdk/resources/v2/contracts"
data/manifest.yaml CHANGED
@@ -1,11 +1,13 @@
1
1
  dependencies:
2
2
  - English
3
+ - base64
3
4
  - cgi
4
5
  - date
5
6
  - erb
6
7
  - etc
7
8
  - json
8
9
  - net/http
10
+ - openssl
9
11
  - pathname
10
12
  - rbconfig
11
13
  - securerandom
@@ -180,6 +180,11 @@ module MetronomeSDK
180
180
  private def auth_headers
181
181
  end
182
182
 
183
+ # @api private
184
+ sig { returns(String) }
185
+ private def user_agent
186
+ end
187
+
183
188
  # @api private
184
189
  sig { returns(String) }
185
190
  private def generate_idempotency_key
@@ -26,8 +26,12 @@ module MetronomeSDK
26
26
 
27
27
  class << self
28
28
  # @api private
29
- sig { params(url: URI::Generic).returns(Net::HTTP) }
30
- def connect(url)
29
+ sig do
30
+ params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
31
+ Net::HTTP
32
+ )
33
+ end
34
+ def connect(cert_store:, url:)
31
35
  end
32
36
 
33
37
  # @api private
@@ -31,7 +31,7 @@ module MetronomeSDK
31
31
  #
32
32
  # Assumes superclass fields are totally defined before fields are accessed /
33
33
  # defined on subclasses.
34
- sig { params(child: T.self_type).void }
34
+ sig { params(child: MetronomeSDK::Internal::Type::BaseModel).void }
35
35
  def inherited(child)
36
36
  end
37
37
 
@@ -282,9 +282,13 @@ module MetronomeSDK
282
282
 
283
283
  # Create a new instance of a model.
284
284
  sig do
285
- params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(
286
- T.attached_class
287
- )
285
+ params(
286
+ data:
287
+ T.any(
288
+ T::Hash[Symbol, T.anything],
289
+ MetronomeSDK::Internal::Type::BaseModel
290
+ )
291
+ ).returns(T.attached_class)
288
292
  end
289
293
  def self.new(data = {})
290
294
  end
@@ -673,6 +673,11 @@ module MetronomeSDK
673
673
  :gcp_marketplace,
674
674
  MetronomeSDK::Contract::CustomerBillingProviderConfiguration::BillingProvider::TaggedSymbol
675
675
  )
676
+ METRONOME =
677
+ T.let(
678
+ :metronome,
679
+ MetronomeSDK::Contract::CustomerBillingProviderConfiguration::BillingProvider::TaggedSymbol
680
+ )
676
681
 
677
682
  sig do
678
683
  override.returns(
@@ -730,6 +730,20 @@ module MetronomeSDK
730
730
  end
731
731
  attr_writer :specifiers
732
732
 
733
+ # Attach a subscription to the recurring commit/credit.
734
+ sig do
735
+ returns(T.nilable(MetronomeSDK::RecurringCommitSubscriptionConfig))
736
+ end
737
+ attr_reader :subscription_config
738
+
739
+ sig do
740
+ params(
741
+ subscription_config:
742
+ MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
743
+ ).void
744
+ end
745
+ attr_writer :subscription_config
746
+
733
747
  sig do
734
748
  params(
735
749
  id: String,
@@ -777,7 +791,9 @@ module MetronomeSDK
777
791
  MetronomeSDK::ContractV2::Commit::RolledOverFrom::OrHash,
778
792
  rollover_fraction: Float,
779
793
  salesforce_opportunity_id: String,
780
- specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash]
794
+ specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
795
+ subscription_config:
796
+ MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
781
797
  ).returns(T.attached_class)
782
798
  end
783
799
  def self.new(
@@ -833,7 +849,9 @@ module MetronomeSDK
833
849
  # List of filters that determine what kind of customer usage draws down a commit
834
850
  # or credit. A customer's usage needs to meet the condition of at least one of the
835
851
  # specifiers to contribute to a commit's or credit's drawdown.
836
- specifiers: nil
852
+ specifiers: nil,
853
+ # Attach a subscription to the recurring commit/credit.
854
+ subscription_config: nil
837
855
  )
838
856
  end
839
857
 
@@ -869,7 +887,9 @@ module MetronomeSDK
869
887
  MetronomeSDK::ContractV2::Commit::RolledOverFrom,
870
888
  rollover_fraction: Float,
871
889
  salesforce_opportunity_id: String,
872
- specifiers: T::Array[MetronomeSDK::CommitSpecifier]
890
+ specifiers: T::Array[MetronomeSDK::CommitSpecifier],
891
+ subscription_config:
892
+ MetronomeSDK::RecurringCommitSubscriptionConfig
873
893
  }
874
894
  )
875
895
  end
@@ -3202,6 +3222,16 @@ module MetronomeSDK
3202
3222
  end
3203
3223
  attr_writer :contract
3204
3224
 
3225
+ # Timestamp of when the credit was created.
3226
+ #
3227
+ # - Recurring credits: latter of credit service period date and parent credit
3228
+ # start date
3229
+ sig { returns(T.nilable(Time)) }
3230
+ attr_reader :created_at
3231
+
3232
+ sig { params(created_at: Time).void }
3233
+ attr_writer :created_at
3234
+
3205
3235
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3206
3236
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
3207
3237
  attr_reader :custom_fields
@@ -3297,6 +3327,20 @@ module MetronomeSDK
3297
3327
  end
3298
3328
  attr_writer :specifiers
3299
3329
 
3330
+ # Attach a subscription to the recurring commit/credit.
3331
+ sig do
3332
+ returns(T.nilable(MetronomeSDK::RecurringCommitSubscriptionConfig))
3333
+ end
3334
+ attr_reader :subscription_config
3335
+
3336
+ sig do
3337
+ params(
3338
+ subscription_config:
3339
+ MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
3340
+ ).void
3341
+ end
3342
+ attr_writer :subscription_config
3343
+
3300
3344
  sig do
3301
3345
  params(
3302
3346
  id: String,
@@ -3308,6 +3352,7 @@ module MetronomeSDK
3308
3352
  applicable_product_tags: T::Array[String],
3309
3353
  balance: Float,
3310
3354
  contract: MetronomeSDK::ContractV2::Credit::Contract::OrHash,
3355
+ created_at: Time,
3311
3356
  custom_fields: T::Hash[Symbol, String],
3312
3357
  description: String,
3313
3358
  hierarchy_configuration:
@@ -3328,7 +3373,9 @@ module MetronomeSDK
3328
3373
  netsuite_sales_order_id: String,
3329
3374
  priority: Float,
3330
3375
  salesforce_opportunity_id: String,
3331
- specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash]
3376
+ specifiers: T::Array[MetronomeSDK::CommitSpecifier::OrHash],
3377
+ subscription_config:
3378
+ MetronomeSDK::RecurringCommitSubscriptionConfig::OrHash
3332
3379
  ).returns(T.attached_class)
3333
3380
  end
3334
3381
  def self.new(
@@ -3350,6 +3397,11 @@ module MetronomeSDK
3350
3397
  # included in the balance, including future-dated manual ledger entries.
3351
3398
  balance: nil,
3352
3399
  contract: nil,
3400
+ # Timestamp of when the credit was created.
3401
+ #
3402
+ # - Recurring credits: latter of credit service period date and parent credit
3403
+ # start date
3404
+ created_at: nil,
3353
3405
  # Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3354
3406
  custom_fields: nil,
3355
3407
  description: nil,
@@ -3369,7 +3421,9 @@ module MetronomeSDK
3369
3421
  # List of filters that determine what kind of customer usage draws down a commit
3370
3422
  # or credit. A customer's usage needs to meet the condition of at least one of the
3371
3423
  # specifiers to contribute to a commit's or credit's drawdown.
3372
- specifiers: nil
3424
+ specifiers: nil,
3425
+ # Attach a subscription to the recurring commit/credit.
3426
+ subscription_config: nil
3373
3427
  )
3374
3428
  end
3375
3429
 
@@ -3385,6 +3439,7 @@ module MetronomeSDK
3385
3439
  applicable_product_tags: T::Array[String],
3386
3440
  balance: Float,
3387
3441
  contract: MetronomeSDK::ContractV2::Credit::Contract,
3442
+ created_at: Time,
3388
3443
  custom_fields: T::Hash[Symbol, String],
3389
3444
  description: String,
3390
3445
  hierarchy_configuration:
@@ -3395,7 +3450,9 @@ module MetronomeSDK
3395
3450
  netsuite_sales_order_id: String,
3396
3451
  priority: Float,
3397
3452
  salesforce_opportunity_id: String,
3398
- specifiers: T::Array[MetronomeSDK::CommitSpecifier]
3453
+ specifiers: T::Array[MetronomeSDK::CommitSpecifier],
3454
+ subscription_config:
3455
+ MetronomeSDK::RecurringCommitSubscriptionConfig
3399
3456
  }
3400
3457
  )
3401
3458
  end
@@ -4232,6 +4289,11 @@ module MetronomeSDK
4232
4289
  :gcp_marketplace,
4233
4290
  MetronomeSDK::ContractV2::CustomerBillingProviderConfiguration::BillingProvider::TaggedSymbol
4234
4291
  )
4292
+ METRONOME =
4293
+ T.let(
4294
+ :metronome,
4295
+ MetronomeSDK::ContractV2::CustomerBillingProviderConfiguration::BillingProvider::TaggedSymbol
4296
+ )
4235
4297
 
4236
4298
  sig do
4237
4299
  override.returns(
@@ -4454,10 +4516,13 @@ module MetronomeSDK
4454
4516
  )
4455
4517
  end
4456
4518
 
4457
- # Indicates the desired behavior of consolidated invoices generated by the parent
4458
- # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
4459
- # customers will be appended to the consolidated invoice **NONE**: Do not generate
4460
- # consolidated invoices
4519
+ # Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
4520
+ # generated by the parent in a customer hierarchy
4521
+ #
4522
+ # **CONCATENATE**: Statements on the invoices of child customers will be appended
4523
+ # to the consolidated invoice
4524
+ #
4525
+ # **NONE**: Do not generate consolidated invoices
4461
4526
  sig do
4462
4527
  returns(
4463
4528
  T.nilable(
@@ -4482,10 +4547,13 @@ module MetronomeSDK
4482
4547
  ).returns(T.attached_class)
4483
4548
  end
4484
4549
  def self.new(
4485
- # Indicates the desired behavior of consolidated invoices generated by the parent
4486
- # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
4487
- # customers will be appended to the consolidated invoice **NONE**: Do not generate
4488
- # consolidated invoices
4550
+ # Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
4551
+ # generated by the parent in a customer hierarchy
4552
+ #
4553
+ # **CONCATENATE**: Statements on the invoices of child customers will be appended
4554
+ # to the consolidated invoice
4555
+ #
4556
+ # **NONE**: Do not generate consolidated invoices
4489
4557
  invoice_consolidation_type: nil
4490
4558
  )
4491
4559
  end
@@ -4501,10 +4569,13 @@ module MetronomeSDK
4501
4569
  def to_hash
4502
4570
  end
4503
4571
 
4504
- # Indicates the desired behavior of consolidated invoices generated by the parent
4505
- # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
4506
- # customers will be appended to the consolidated invoice **NONE**: Do not generate
4507
- # consolidated invoices
4572
+ # Account hierarchy M3 - Indicates the desired behavior of consolidated invoices
4573
+ # generated by the parent in a customer hierarchy
4574
+ #
4575
+ # **CONCATENATE**: Statements on the invoices of child customers will be appended
4576
+ # to the consolidated invoice
4577
+ #
4578
+ # **NONE**: Do not generate consolidated invoices
4508
4579
  module InvoiceConsolidationType
4509
4580
  extend MetronomeSDK::Internal::Type::Enum
4510
4581
 
@@ -4566,7 +4637,9 @@ module MetronomeSDK
4566
4637
  end
4567
4638
  attr_writer :parent
4568
4639
 
4569
- # Indicates whether the child or parent should pay for the child's invoice charges
4640
+ # Account hierarchy M3 - Indicates which customer should pay for the child's
4641
+ # invoice charges **SELF**: The child pays for its own invoice charges **PARENT**:
4642
+ # The parent pays for the child's invoice charges
4570
4643
  sig do
4571
4644
  returns(
4572
4645
  T.nilable(
@@ -4584,10 +4657,14 @@ module MetronomeSDK
4584
4657
  end
4585
4658
  attr_writer :payer
4586
4659
 
4587
- # Indicates the behavior of the child's invoice statements on the parent's
4588
- # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
4589
- # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
4590
- # appear on parent's consolidated invoices
4660
+ # Account hierarchy M3 - Indicates the behavior of the child's invoice statements
4661
+ # on the parent's invoices.
4662
+ #
4663
+ # **CONSOLIDATE**: Child's invoice statements will be added to parent's
4664
+ # consolidated invoices
4665
+ #
4666
+ # **SEPARATE**: Child's invoice statements will appear not appear on parent's
4667
+ # consolidated invoices
4591
4668
  sig do
4592
4669
  returns(
4593
4670
  T.nilable(
@@ -4618,12 +4695,18 @@ module MetronomeSDK
4618
4695
  def self.new(
4619
4696
  # The single parent contract/customer for this child.
4620
4697
  parent:,
4621
- # Indicates whether the child or parent should pay for the child's invoice charges
4698
+ # Account hierarchy M3 - Indicates which customer should pay for the child's
4699
+ # invoice charges **SELF**: The child pays for its own invoice charges **PARENT**:
4700
+ # The parent pays for the child's invoice charges
4622
4701
  payer: nil,
4623
- # Indicates the behavior of the child's invoice statements on the parent's
4624
- # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
4625
- # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
4626
- # appear on parent's consolidated invoices
4702
+ # Account hierarchy M3 - Indicates the behavior of the child's invoice statements
4703
+ # on the parent's invoices.
4704
+ #
4705
+ # **CONSOLIDATE**: Child's invoice statements will be added to parent's
4706
+ # consolidated invoices
4707
+ #
4708
+ # **SEPARATE**: Child's invoice statements will appear not appear on parent's
4709
+ # consolidated invoices
4627
4710
  usage_statement_behavior: nil
4628
4711
  )
4629
4712
  end
@@ -4674,7 +4757,9 @@ module MetronomeSDK
4674
4757
  end
4675
4758
  end
4676
4759
 
4677
- # Indicates whether the child or parent should pay for the child's invoice charges
4760
+ # Account hierarchy M3 - Indicates which customer should pay for the child's
4761
+ # invoice charges **SELF**: The child pays for its own invoice charges **PARENT**:
4762
+ # The parent pays for the child's invoice charges
4678
4763
  module Payer
4679
4764
  extend MetronomeSDK::Internal::Type::Enum
4680
4765
 
@@ -4709,10 +4794,14 @@ module MetronomeSDK
4709
4794
  end
4710
4795
  end
4711
4796
 
4712
- # Indicates the behavior of the child's invoice statements on the parent's
4713
- # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
4714
- # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
4715
- # appear on parent's consolidated invoices
4797
+ # Account hierarchy M3 - Indicates the behavior of the child's invoice statements
4798
+ # on the parent's invoices.
4799
+ #
4800
+ # **CONSOLIDATE**: Child's invoice statements will be added to parent's
4801
+ # consolidated invoices
4802
+ #
4803
+ # **SEPARATE**: Child's invoice statements will appear not appear on parent's
4804
+ # consolidated invoices
4716
4805
  module UsageStatementBehavior
4717
4806
  extend MetronomeSDK::Internal::Type::Enum
4718
4807