metronome-sdk 1.0.0 → 2.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +91 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/errors.rb +25 -11
- data/lib/metronome_sdk/file_part.rb +10 -7
- data/lib/metronome_sdk/internal/body_cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +1 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +11 -7
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +34 -31
- data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
- data/lib/metronome_sdk/internal/type/enum.rb +25 -0
- data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
- data/lib/metronome_sdk/internal/util.rb +8 -7
- data/lib/metronome_sdk/models/contract.rb +1 -0
- data/lib/metronome_sdk/models/contract_v2.rb +275 -6
- data/lib/metronome_sdk/models/contract_without_amendments.rb +2 -2
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +123 -2
- data/lib/metronome_sdk/models/payment_gate_config.rb +1 -0
- data/lib/metronome_sdk/models/payment_gate_config_v2.rb +1 -0
- data/lib/metronome_sdk/models/subscription.rb +95 -1
- data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +38 -36
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +157 -9
- data/lib/metronome_sdk/models/v1/contract_list_balances_params.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_create_params.rb +11 -1
- data/lib/metronome_sdk/models/v1/customer_detail.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +19 -25
- data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rb +1 -0
- data/lib/metronome_sdk/models/v1/customer_set_billing_configurations_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +3 -3
- data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +12 -12
- data/lib/metronome_sdk/models/v1/customers/billing_config_create_params.rb +6 -1
- data/lib/metronome_sdk/models/v1/customers/billing_config_delete_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rb +6 -1
- data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +1 -1
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +41 -38
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +256 -16
- data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
- data/lib/metronome_sdk/models/v1/payment.rb +157 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
- data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
- data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rb +65 -0
- data/lib/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rb +12 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_create_params.rb +73 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_create_response.rb +31 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_list_params.rb +26 -0
- data/lib/metronome_sdk/models/v1/settings/billing_provider_list_response.rb +105 -0
- data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +9 -1
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +9 -1
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +219 -9
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +195 -8
- data/lib/metronome_sdk/resources/v1/alerts.rb +57 -53
- data/lib/metronome_sdk/resources/v1/contracts.rb +8 -5
- data/lib/metronome_sdk/resources/v1/credit_grants.rb +10 -5
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +70 -51
- data/lib/metronome_sdk/resources/v1/customers/billing_config.rb +7 -4
- data/lib/metronome_sdk/resources/v1/customers/commits.rb +2 -1
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +57 -1
- data/lib/metronome_sdk/resources/v1/customers/plans.rb +8 -4
- data/lib/metronome_sdk/resources/v1/customers.rb +13 -8
- data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
- data/lib/metronome_sdk/resources/v1/plans.rb +8 -4
- data/lib/metronome_sdk/resources/v1/settings/billing_providers.rb +75 -0
- data/lib/metronome_sdk/resources/v1/settings.rb +55 -0
- data/lib/metronome_sdk/resources/v1/usage.rb +4 -2
- data/lib/metronome_sdk/resources/v1.rb +8 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +9 -3
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +17 -0
- data/rbi/metronome_sdk/errors.rbi +29 -2
- data/rbi/metronome_sdk/file_part.rbi +1 -1
- data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
- data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
- data/rbi/metronome_sdk/internal/util.rbi +1 -1
- data/rbi/metronome_sdk/models/contract.rbi +5 -0
- data/rbi/metronome_sdk/models/contract_v2.rbi +635 -10
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +2 -2
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +286 -6
- data/rbi/metronome_sdk/models/payment_gate_config.rbi +5 -0
- data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +5 -0
- data/rbi/metronome_sdk/models/subscription.rbi +190 -0
- data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +51 -47
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +326 -10
- data/rbi/metronome_sdk/models/v1/contract_list_balances_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customer_create_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customer_detail.rbi +8 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +24 -32
- data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
- data/rbi/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
- data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +14 -14
- data/rbi/metronome_sdk/models/v1/customers/billing_config_create_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_delete_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/customers/billing_config_retrieve_response.rbi +6 -0
- data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +53 -44
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +462 -38
- data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +324 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
- data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbi +115 -0
- data/rbi/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbi +25 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_params.rbi +157 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_create_response.rbi +75 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/settings/billing_provider_list_response.rbi +245 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +18 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +18 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +536 -12
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +462 -14
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +68 -64
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/credit_grants.rbi +10 -5
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +73 -54
- data/rbi/metronome_sdk/resources/v1/customers/billing_config.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/customers/commits.rbi +3 -2
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +38 -1
- data/rbi/metronome_sdk/resources/v1/customers/plans.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/customers.rbi +17 -11
- data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
- data/rbi/metronome_sdk/resources/v1/plans.rbi +8 -4
- data/rbi/metronome_sdk/resources/v1/settings/billing_providers.rbi +63 -0
- data/rbi/metronome_sdk/resources/v1/settings.rbi +47 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +4 -2
- data/rbi/metronome_sdk/resources/v1.rbi +6 -0
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +14 -0
- data/sig/metronome_sdk/errors.rbs +7 -0
- data/sig/metronome_sdk/file_part.rbs +1 -1
- data/sig/metronome_sdk/models/contract.rbs +2 -0
- data/sig/metronome_sdk/models/contract_v2.rbs +241 -12
- data/sig/metronome_sdk/models/hierarchy_configuration.rbs +87 -6
- data/sig/metronome_sdk/models/payment_gate_config.rbs +2 -1
- data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +2 -1
- data/sig/metronome_sdk/models/subscription.rbs +80 -0
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +2 -1
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +91 -5
- data/sig/metronome_sdk/models/v1/contract_list_balances_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customer_create_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
- data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
- data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
- data/sig/metronome_sdk/models/v1/customer_retrieve_billing_configurations_response.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customer_set_billing_configurations_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_create_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_delete_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/billing_config_retrieve_params.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +2 -0
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +244 -19
- data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +198 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
- data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
- data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_params.rbs +54 -0
- data/sig/metronome_sdk/models/v1/setting_upsert_avalara_credentials_response.rbs +13 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_create_params.rbs +64 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_create_response.rbs +34 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_list_params.rbs +28 -0
- data/sig/metronome_sdk/models/v1/settings/billing_provider_list_response.rbs +102 -0
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +9 -0
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +9 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +184 -7
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +221 -18
- data/sig/metronome_sdk/resources/v1/contracts.rbs +1 -0
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
- data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
- data/sig/metronome_sdk/resources/v1/settings/billing_providers.rbs +23 -0
- data/sig/metronome_sdk/resources/v1/settings.rbs +19 -0
- data/sig/metronome_sdk/resources/v1.rbs +4 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -0
- metadata +53 -2
|
@@ -176,7 +176,7 @@ module MetronomeSDK
|
|
|
176
176
|
# - Ingest aliases remain idempotent for archived customers. In order to reuse an
|
|
177
177
|
# ingest alias, first remove the ingest alias from the customer prior to
|
|
178
178
|
# archiving.
|
|
179
|
-
# - Any
|
|
179
|
+
# - Any notifications associated with the customer will no longer be triggered.
|
|
180
180
|
#
|
|
181
181
|
# @overload archive(id:, request_options: {})
|
|
182
182
|
#
|
|
@@ -240,7 +240,8 @@ module MetronomeSDK
|
|
|
240
240
|
|
|
241
241
|
# Fetch daily pending costs for the specified customer, broken down by credit type
|
|
242
242
|
# and line items. Note: this is not supported for customers whose plan includes a
|
|
243
|
-
# UNIQUE-type billable metric.
|
|
243
|
+
# UNIQUE-type billable metric. This is a Plans (deprecated) endpoint. New clients
|
|
244
|
+
# should implement using Contracts.
|
|
244
245
|
#
|
|
245
246
|
# @overload list_costs(customer_id:, ending_before:, starting_on:, limit: nil, next_page: nil, request_options: {})
|
|
246
247
|
#
|
|
@@ -278,20 +279,21 @@ module MetronomeSDK
|
|
|
278
279
|
# Some parameter documentations has been truncated, see
|
|
279
280
|
# {MetronomeSDK::Models::V1::CustomerPreviewEventsParams} for more details.
|
|
280
281
|
#
|
|
281
|
-
# Preview how a set of events will affect a customer's
|
|
282
|
-
#
|
|
282
|
+
# Preview how a set of events will affect a customer's invoices. Generates draft
|
|
283
|
+
# invoices for a customer using their current contract configuration and the
|
|
283
284
|
# provided events. This is useful for testing how new events will affect the
|
|
284
|
-
# customer's
|
|
285
|
+
# customer's invoices before they are actually processed. Customers on contracts
|
|
286
|
+
# with SQL billable metrics are not supported.
|
|
285
287
|
#
|
|
286
288
|
# @overload preview_events(customer_id:, events:, mode: nil, skip_zero_qty_line_items: nil, request_options: {})
|
|
287
289
|
#
|
|
288
290
|
# @param customer_id [String] Path param:
|
|
289
291
|
#
|
|
290
|
-
# @param events [Array<MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Event>] Body param:
|
|
292
|
+
# @param events [Array<MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Event>] Body param: Array of usage events to include in the preview calculation. Must co
|
|
291
293
|
#
|
|
292
|
-
# @param mode [Symbol, MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Mode] Body param:
|
|
294
|
+
# @param mode [Symbol, MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Mode] Body param: Controls how the provided events are combined with existing usage da
|
|
293
295
|
#
|
|
294
|
-
# @param skip_zero_qty_line_items [Boolean] Body param:
|
|
296
|
+
# @param skip_zero_qty_line_items [Boolean] Body param: When `true`, line items with zero quantity are excluded from the res
|
|
295
297
|
#
|
|
296
298
|
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
297
299
|
#
|
|
@@ -353,6 +355,9 @@ module MetronomeSDK
|
|
|
353
355
|
# through system A (e.g. Stripe) but will now be billed through system B (e.g.
|
|
354
356
|
# AWS). Once created, the new configuration can then be associated to the
|
|
355
357
|
# customer's contract.
|
|
358
|
+
# - Multiple configurations can be added per destination. For example, you can
|
|
359
|
+
# create two Stripe billing configurations for a Metronome customer that each
|
|
360
|
+
# have a distinct `collection_method`.
|
|
356
361
|
#
|
|
357
362
|
# ### Delivery method options:
|
|
358
363
|
#
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Payments
|
|
7
|
+
# Fetch all payment attempts for the given invoice.
|
|
8
|
+
#
|
|
9
|
+
# @overload list(customer_id:, invoice_id:, limit: nil, next_page: nil, statuses: nil, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param customer_id [String]
|
|
12
|
+
#
|
|
13
|
+
# @param invoice_id [String]
|
|
14
|
+
#
|
|
15
|
+
# @param limit [Integer] The maximum number of payments to return. Defaults to 25.
|
|
16
|
+
#
|
|
17
|
+
# @param next_page [String] The next page token from a previous response.
|
|
18
|
+
#
|
|
19
|
+
# @param statuses [Array<Symbol, MetronomeSDK::Models::V1::PaymentStatus>]
|
|
20
|
+
#
|
|
21
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
22
|
+
#
|
|
23
|
+
# @return [MetronomeSDK::Internal::BodyCursorPage<MetronomeSDK::Models::V1::Payment>]
|
|
24
|
+
#
|
|
25
|
+
# @see MetronomeSDK::Models::V1::PaymentListParams
|
|
26
|
+
def list(params)
|
|
27
|
+
parsed, options = MetronomeSDK::V1::PaymentListParams.dump_request(params)
|
|
28
|
+
@client.request(
|
|
29
|
+
method: :post,
|
|
30
|
+
path: "v1/payments/list",
|
|
31
|
+
body: parsed,
|
|
32
|
+
page: MetronomeSDK::Internal::BodyCursorPage,
|
|
33
|
+
model: MetronomeSDK::V1::Payment,
|
|
34
|
+
options: options
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Trigger a new attempt by canceling any existing attempts for this invoice and
|
|
39
|
+
# creating a new Payment. This will trigger another attempt to charge the
|
|
40
|
+
# Customer's configured Payment Gateway. Payment can only be attempted if all of
|
|
41
|
+
# the following are true:
|
|
42
|
+
#
|
|
43
|
+
# - The Metronome Invoice is finalized
|
|
44
|
+
# - PLG Invoicing is configured for the Customer
|
|
45
|
+
# - You cannot attempt payments for invoices that have already been `paid` or
|
|
46
|
+
# `voided`.
|
|
47
|
+
#
|
|
48
|
+
# Attempting to payment on an ineligible Invoice or Customer will result in a
|
|
49
|
+
# `400` response.
|
|
50
|
+
#
|
|
51
|
+
# @overload attempt(customer_id:, invoice_id:, request_options: {})
|
|
52
|
+
#
|
|
53
|
+
# @param customer_id [String]
|
|
54
|
+
# @param invoice_id [String]
|
|
55
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
56
|
+
#
|
|
57
|
+
# @return [MetronomeSDK::Models::V1::PaymentAttemptResponse]
|
|
58
|
+
#
|
|
59
|
+
# @see MetronomeSDK::Models::V1::PaymentAttemptParams
|
|
60
|
+
def attempt(params)
|
|
61
|
+
parsed, options = MetronomeSDK::V1::PaymentAttemptParams.dump_request(params)
|
|
62
|
+
@client.request(
|
|
63
|
+
method: :post,
|
|
64
|
+
path: "v1/payments/attempt",
|
|
65
|
+
body: parsed,
|
|
66
|
+
model: MetronomeSDK::Models::V1::PaymentAttemptResponse,
|
|
67
|
+
options: options
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Cancel an existing payment attempt for an invoice.
|
|
72
|
+
#
|
|
73
|
+
# @overload cancel(customer_id:, invoice_id:, request_options: {})
|
|
74
|
+
#
|
|
75
|
+
# @param customer_id [String]
|
|
76
|
+
# @param invoice_id [String]
|
|
77
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
78
|
+
#
|
|
79
|
+
# @return [MetronomeSDK::Models::V1::PaymentCancelResponse]
|
|
80
|
+
#
|
|
81
|
+
# @see MetronomeSDK::Models::V1::PaymentCancelParams
|
|
82
|
+
def cancel(params)
|
|
83
|
+
parsed, options = MetronomeSDK::V1::PaymentCancelParams.dump_request(params)
|
|
84
|
+
@client.request(
|
|
85
|
+
method: :post,
|
|
86
|
+
path: "v1/payments/cancel",
|
|
87
|
+
body: parsed,
|
|
88
|
+
model: MetronomeSDK::Models::V1::PaymentCancelResponse,
|
|
89
|
+
options: options
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# @api private
|
|
94
|
+
#
|
|
95
|
+
# @param client [MetronomeSDK::Client]
|
|
96
|
+
def initialize(client:)
|
|
97
|
+
@client = client
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -4,7 +4,8 @@ module MetronomeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Plans
|
|
7
|
-
# List all available plans.
|
|
7
|
+
# List all available plans. This is a Plans (deprecated) endpoint. New clients
|
|
8
|
+
# should implement using Contracts.
|
|
8
9
|
#
|
|
9
10
|
# @overload list(limit: nil, next_page: nil, request_options: {})
|
|
10
11
|
#
|
|
@@ -29,7 +30,8 @@ module MetronomeSDK
|
|
|
29
30
|
)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
|
-
# Fetch high level details of a specific plan.
|
|
33
|
+
# Fetch high level details of a specific plan. This is a Plans (deprecated)
|
|
34
|
+
# endpoint. New clients should implement using Contracts.
|
|
33
35
|
#
|
|
34
36
|
# @overload get_details(plan_id:, request_options: {})
|
|
35
37
|
#
|
|
@@ -53,7 +55,8 @@ module MetronomeSDK
|
|
|
53
55
|
)
|
|
54
56
|
end
|
|
55
57
|
|
|
56
|
-
# Fetches a list of charges of a specific plan.
|
|
58
|
+
# Fetches a list of charges of a specific plan. This is a Plans (deprecated)
|
|
59
|
+
# endpoint. New clients should implement using Contracts.
|
|
57
60
|
#
|
|
58
61
|
# @overload list_charges(plan_id:, limit: nil, next_page: nil, request_options: {})
|
|
59
62
|
#
|
|
@@ -88,7 +91,8 @@ module MetronomeSDK
|
|
|
88
91
|
# {MetronomeSDK::Models::V1::PlanListCustomersParams} for more details.
|
|
89
92
|
#
|
|
90
93
|
# Fetches a list of customers on a specific plan (by default, only currently
|
|
91
|
-
# active plans are included)
|
|
94
|
+
# active plans are included). This is a Plans (deprecated) endpoint. New clients
|
|
95
|
+
# should implement using Contracts.
|
|
92
96
|
#
|
|
93
97
|
# @overload list_customers(plan_id:, limit: nil, next_page: nil, status: nil, request_options: {})
|
|
94
98
|
#
|
|
@@ -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,55 @@
|
|
|
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:, 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 request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
30
|
+
#
|
|
31
|
+
# @return [MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse]
|
|
32
|
+
#
|
|
33
|
+
# @see MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsParams
|
|
34
|
+
def upsert_avalara_credentials(params)
|
|
35
|
+
parsed, options = MetronomeSDK::V1::SettingUpsertAvalaraCredentialsParams.dump_request(params)
|
|
36
|
+
@client.request(
|
|
37
|
+
method: :post,
|
|
38
|
+
path: "v1/upsertAvalaraCredentials",
|
|
39
|
+
body: parsed,
|
|
40
|
+
model: MetronomeSDK::Models::V1::SettingUpsertAvalaraCredentialsResponse,
|
|
41
|
+
options: options
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @api private
|
|
46
|
+
#
|
|
47
|
+
# @param client [MetronomeSDK::Client]
|
|
48
|
+
def initialize(client:)
|
|
49
|
+
@client = client
|
|
50
|
+
@billing_providers = MetronomeSDK::Resources::V1::Settings::BillingProviders.new(client: client)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -80,8 +80,7 @@ module MetronomeSDK
|
|
|
80
80
|
# ingestion, supports backdating 34 days, and is built to handle mission-critical
|
|
81
81
|
# usage data with enterprise-grade reliability. Metronome supports 100,000 events
|
|
82
82
|
# per second without requiring pre-aggregation or rollups and can scale up from
|
|
83
|
-
# there. See
|
|
84
|
-
# [Getting usage into Metronome](https://docs.metronome.com/connect-metronome/) to
|
|
83
|
+
# there. See the [Send usage events](/guides/events/send-usage-events) guide to
|
|
85
84
|
# learn more about usage events.
|
|
86
85
|
#
|
|
87
86
|
# ### Use this endpoint to:
|
|
@@ -124,6 +123,9 @@ module MetronomeSDK
|
|
|
124
123
|
# }
|
|
125
124
|
# ```
|
|
126
125
|
#
|
|
126
|
+
# Learn more about
|
|
127
|
+
# [usage event structure definitions](/guides/events/design-usage-events).
|
|
128
|
+
#
|
|
127
129
|
# #### Transaction ID
|
|
128
130
|
#
|
|
129
131
|
# The transaction_id serves as your idempotency key, ensuring events are processed
|
|
@@ -42,6 +42,12 @@ module MetronomeSDK
|
|
|
42
42
|
# @return [MetronomeSDK::Resources::V1::Contracts]
|
|
43
43
|
attr_reader :contracts
|
|
44
44
|
|
|
45
|
+
# @return [MetronomeSDK::Resources::V1::Payments]
|
|
46
|
+
attr_reader :payments
|
|
47
|
+
|
|
48
|
+
# @return [MetronomeSDK::Resources::V1::Settings]
|
|
49
|
+
attr_reader :settings
|
|
50
|
+
|
|
45
51
|
# @api private
|
|
46
52
|
#
|
|
47
53
|
# @param client [MetronomeSDK::Client]
|
|
@@ -60,6 +66,8 @@ module MetronomeSDK
|
|
|
60
66
|
@services = MetronomeSDK::Resources::V1::Services.new(client: client)
|
|
61
67
|
@invoices = MetronomeSDK::Resources::V1::Invoices.new(client: client)
|
|
62
68
|
@contracts = MetronomeSDK::Resources::V1::Contracts.new(client: client)
|
|
69
|
+
@payments = MetronomeSDK::Resources::V1::Payments.new(client: client)
|
|
70
|
+
@settings = MetronomeSDK::Resources::V1::Settings.new(client: client)
|
|
63
71
|
end
|
|
64
72
|
end
|
|
65
73
|
end
|
|
@@ -128,12 +128,14 @@ module MetronomeSDK
|
|
|
128
128
|
# - Contract editing must be enabled to use this endpoint. Reach out to your
|
|
129
129
|
# Metronome representative to learn more.
|
|
130
130
|
#
|
|
131
|
-
# @overload edit(contract_id:, customer_id:, add_commits: nil, add_credits: nil, add_discounts: nil, add_overrides: nil, add_prepaid_balance_threshold_configuration: nil, add_professional_services: nil, add_recurring_commits: nil, add_recurring_credits: nil, add_reseller_royalties: nil, add_scheduled_charges: nil, add_spend_threshold_configuration: nil, add_subscriptions: nil, allow_contract_ending_before_finalized_invoice: nil, archive_commits: nil, archive_credits: nil, archive_scheduled_charges: nil, remove_overrides: nil, uniqueness_key: nil, update_commits: nil, update_contract_end_date: nil, update_contract_name: nil, update_credits: nil, update_prepaid_balance_threshold_configuration: nil, update_recurring_commits: nil, update_recurring_credits: nil, update_scheduled_charges: nil, update_spend_threshold_configuration: nil, update_subscriptions: nil, request_options: {})
|
|
131
|
+
# @overload edit(contract_id:, customer_id:, add_billing_provider_configuration_update: nil, add_commits: nil, add_credits: nil, add_discounts: nil, add_overrides: nil, add_prepaid_balance_threshold_configuration: nil, add_professional_services: nil, add_recurring_commits: nil, add_recurring_credits: nil, add_reseller_royalties: nil, add_scheduled_charges: nil, add_spend_threshold_configuration: nil, add_subscriptions: nil, allow_contract_ending_before_finalized_invoice: nil, archive_commits: nil, archive_credits: nil, archive_scheduled_charges: nil, remove_overrides: nil, uniqueness_key: nil, update_commits: nil, update_contract_end_date: nil, update_contract_name: nil, update_credits: nil, update_prepaid_balance_threshold_configuration: nil, update_recurring_commits: nil, update_recurring_credits: nil, update_scheduled_charges: nil, update_spend_threshold_configuration: nil, update_subscriptions: nil, request_options: {})
|
|
132
132
|
#
|
|
133
133
|
# @param contract_id [String] ID of the contract being edited
|
|
134
134
|
#
|
|
135
135
|
# @param customer_id [String] ID of the customer whose contract is being edited
|
|
136
136
|
#
|
|
137
|
+
# @param add_billing_provider_configuration_update [MetronomeSDK::Models::V2::ContractEditParams::AddBillingProviderConfigurationUpdate] Update the billing provider configuration on the contract. Currently only suppor
|
|
138
|
+
#
|
|
137
139
|
# @param add_commits [Array<MetronomeSDK::Models::V2::ContractEditParams::AddCommit>]
|
|
138
140
|
#
|
|
139
141
|
# @param add_credits [Array<MetronomeSDK::Models::V2::ContractEditParams::AddCredit>]
|
|
@@ -226,7 +228,7 @@ module MetronomeSDK
|
|
|
226
228
|
# finalized invoice. You can void the invoice beforehand and then remove the
|
|
227
229
|
# access schedule segment.
|
|
228
230
|
#
|
|
229
|
-
# @overload edit_commit(commit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: 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, hierarchy_configuration: nil, invoice_contract_id: nil, invoice_schedule: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
|
|
230
232
|
#
|
|
231
233
|
# @param commit_id [String] ID of the commit to edit
|
|
232
234
|
#
|
|
@@ -238,6 +240,8 @@ module MetronomeSDK
|
|
|
238
240
|
#
|
|
239
241
|
# @param applicable_product_tags [Array<String>, nil] Which tags the commit applies to. If applicable*product_ids, applicable_product*
|
|
240
242
|
#
|
|
243
|
+
# @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for commit hierarchy access control
|
|
244
|
+
#
|
|
241
245
|
# @param invoice_contract_id [String] ID of contract to use for invoicing
|
|
242
246
|
#
|
|
243
247
|
# @param invoice_schedule [MetronomeSDK::Models::V2::ContractEditCommitParams::InvoiceSchedule]
|
|
@@ -286,7 +290,7 @@ module MetronomeSDK
|
|
|
286
290
|
# invoice. You can void the invoice beforehand and then remove the access
|
|
287
291
|
# schedule segment.
|
|
288
292
|
#
|
|
289
|
-
# @overload edit_credit(credit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, priority: nil, product_id: nil, rate_type: nil, specifiers: nil, request_options: {})
|
|
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: {})
|
|
290
294
|
#
|
|
291
295
|
# @param credit_id [String] ID of the credit to edit
|
|
292
296
|
#
|
|
@@ -298,6 +302,8 @@ module MetronomeSDK
|
|
|
298
302
|
#
|
|
299
303
|
# @param applicable_product_tags [Array<String>, nil] Which tags the credit applies to. If both applicable*product_ids and applicable*
|
|
300
304
|
#
|
|
305
|
+
# @param hierarchy_configuration [MetronomeSDK::Models::CommitHierarchyConfiguration] Optional configuration for credit hierarchy access control
|
|
306
|
+
#
|
|
301
307
|
# @param priority [Float, nil] If multiple commits are applicable, the one with the lower priority will apply f
|
|
302
308
|
#
|
|
303
309
|
# @param product_id [String]
|
data/lib/metronome_sdk.rb
CHANGED
|
@@ -221,6 +221,7 @@ require_relative "metronome_sdk/models/v1/customers/invoice_list_breakdowns_para
|
|
|
221
221
|
require_relative "metronome_sdk/models/v1/customers/invoice_list_breakdowns_response"
|
|
222
222
|
require_relative "metronome_sdk/models/v1/customers/invoice_list_params"
|
|
223
223
|
require_relative "metronome_sdk/models/v1/customers/invoice_retrieve_params"
|
|
224
|
+
require_relative "metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params"
|
|
224
225
|
require_relative "metronome_sdk/models/v1/customers/invoice_retrieve_response"
|
|
225
226
|
require_relative "metronome_sdk/models/v1/customers/named_schedule_retrieve_params"
|
|
226
227
|
require_relative "metronome_sdk/models/v1/customers/named_schedule_retrieve_response"
|
|
@@ -250,6 +251,13 @@ require_relative "metronome_sdk/models/v1/invoice_regenerate_params"
|
|
|
250
251
|
require_relative "metronome_sdk/models/v1/invoice_regenerate_response"
|
|
251
252
|
require_relative "metronome_sdk/models/v1/invoice_void_params"
|
|
252
253
|
require_relative "metronome_sdk/models/v1/invoice_void_response"
|
|
254
|
+
require_relative "metronome_sdk/models/v1/payment"
|
|
255
|
+
require_relative "metronome_sdk/models/v1/payment_attempt_params"
|
|
256
|
+
require_relative "metronome_sdk/models/v1/payment_attempt_response"
|
|
257
|
+
require_relative "metronome_sdk/models/v1/payment_cancel_params"
|
|
258
|
+
require_relative "metronome_sdk/models/v1/payment_cancel_response"
|
|
259
|
+
require_relative "metronome_sdk/models/v1/payment_list_params"
|
|
260
|
+
require_relative "metronome_sdk/models/v1/payment_status"
|
|
253
261
|
require_relative "metronome_sdk/models/v1/plan_detail"
|
|
254
262
|
require_relative "metronome_sdk/models/v1/plan_get_details_params"
|
|
255
263
|
require_relative "metronome_sdk/models/v1/plan_get_details_response"
|
|
@@ -265,6 +273,12 @@ require_relative "metronome_sdk/models/v1/rollover_amount_max_amount"
|
|
|
265
273
|
require_relative "metronome_sdk/models/v1/rollover_amount_max_percentage"
|
|
266
274
|
require_relative "metronome_sdk/models/v1/service_list_params"
|
|
267
275
|
require_relative "metronome_sdk/models/v1/service_list_response"
|
|
276
|
+
require_relative "metronome_sdk/models/v1/settings/billing_provider_create_params"
|
|
277
|
+
require_relative "metronome_sdk/models/v1/settings/billing_provider_create_response"
|
|
278
|
+
require_relative "metronome_sdk/models/v1/settings/billing_provider_list_params"
|
|
279
|
+
require_relative "metronome_sdk/models/v1/settings/billing_provider_list_response"
|
|
280
|
+
require_relative "metronome_sdk/models/v1/setting_upsert_avalara_credentials_params"
|
|
281
|
+
require_relative "metronome_sdk/models/v1/setting_upsert_avalara_credentials_response"
|
|
268
282
|
require_relative "metronome_sdk/models/v1/usage_ingest_params"
|
|
269
283
|
require_relative "metronome_sdk/models/v1/usage_list_params"
|
|
270
284
|
require_relative "metronome_sdk/models/v1/usage_list_response"
|
|
@@ -308,9 +322,12 @@ require_relative "metronome_sdk/resources/v1/customers/plans"
|
|
|
308
322
|
require_relative "metronome_sdk/resources/v1/custom_fields"
|
|
309
323
|
require_relative "metronome_sdk/resources/v1/dashboards"
|
|
310
324
|
require_relative "metronome_sdk/resources/v1/invoices"
|
|
325
|
+
require_relative "metronome_sdk/resources/v1/payments"
|
|
311
326
|
require_relative "metronome_sdk/resources/v1/plans"
|
|
312
327
|
require_relative "metronome_sdk/resources/v1/pricing_units"
|
|
313
328
|
require_relative "metronome_sdk/resources/v1/services"
|
|
329
|
+
require_relative "metronome_sdk/resources/v1/settings"
|
|
330
|
+
require_relative "metronome_sdk/resources/v1/settings/billing_providers"
|
|
314
331
|
require_relative "metronome_sdk/resources/v1/usage"
|
|
315
332
|
require_relative "metronome_sdk/resources/v2"
|
|
316
333
|
require_relative "metronome_sdk/resources/v2/contracts"
|
|
@@ -33,6 +33,9 @@ module MetronomeSDK
|
|
|
33
33
|
sig { returns(T.nilable(Integer)) }
|
|
34
34
|
attr_accessor :status
|
|
35
35
|
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
attr_accessor :headers
|
|
38
|
+
|
|
36
39
|
sig { returns(T.nilable(T.anything)) }
|
|
37
40
|
attr_accessor :body
|
|
38
41
|
|
|
@@ -41,6 +44,7 @@ module MetronomeSDK
|
|
|
41
44
|
params(
|
|
42
45
|
url: URI::Generic,
|
|
43
46
|
status: T.nilable(Integer),
|
|
47
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
44
48
|
body: T.nilable(Object),
|
|
45
49
|
request: NilClass,
|
|
46
50
|
response: NilClass,
|
|
@@ -50,6 +54,7 @@ module MetronomeSDK
|
|
|
50
54
|
def self.new(
|
|
51
55
|
url:,
|
|
52
56
|
status: nil,
|
|
57
|
+
headers: nil,
|
|
53
58
|
body: nil,
|
|
54
59
|
request: nil,
|
|
55
60
|
response: nil,
|
|
@@ -70,6 +75,7 @@ module MetronomeSDK
|
|
|
70
75
|
params(
|
|
71
76
|
url: URI::Generic,
|
|
72
77
|
status: NilClass,
|
|
78
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
73
79
|
body: NilClass,
|
|
74
80
|
request: NilClass,
|
|
75
81
|
response: NilClass,
|
|
@@ -79,6 +85,7 @@ module MetronomeSDK
|
|
|
79
85
|
def self.new(
|
|
80
86
|
url:,
|
|
81
87
|
status: nil,
|
|
88
|
+
headers: nil,
|
|
82
89
|
body: nil,
|
|
83
90
|
request: nil,
|
|
84
91
|
response: nil,
|
|
@@ -93,6 +100,7 @@ module MetronomeSDK
|
|
|
93
100
|
params(
|
|
94
101
|
url: URI::Generic,
|
|
95
102
|
status: NilClass,
|
|
103
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
96
104
|
body: NilClass,
|
|
97
105
|
request: NilClass,
|
|
98
106
|
response: NilClass,
|
|
@@ -102,6 +110,7 @@ module MetronomeSDK
|
|
|
102
110
|
def self.new(
|
|
103
111
|
url:,
|
|
104
112
|
status: nil,
|
|
113
|
+
headers: nil,
|
|
105
114
|
body: nil,
|
|
106
115
|
request: nil,
|
|
107
116
|
response: nil,
|
|
@@ -116,13 +125,22 @@ module MetronomeSDK
|
|
|
116
125
|
params(
|
|
117
126
|
url: URI::Generic,
|
|
118
127
|
status: Integer,
|
|
128
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
119
129
|
body: T.nilable(Object),
|
|
120
130
|
request: NilClass,
|
|
121
131
|
response: NilClass,
|
|
122
132
|
message: T.nilable(String)
|
|
123
133
|
).returns(T.attached_class)
|
|
124
134
|
end
|
|
125
|
-
def self.for(
|
|
135
|
+
def self.for(
|
|
136
|
+
url:,
|
|
137
|
+
status:,
|
|
138
|
+
headers:,
|
|
139
|
+
body:,
|
|
140
|
+
request:,
|
|
141
|
+
response:,
|
|
142
|
+
message: nil
|
|
143
|
+
)
|
|
126
144
|
end
|
|
127
145
|
|
|
128
146
|
sig { returns(Integer) }
|
|
@@ -133,13 +151,22 @@ module MetronomeSDK
|
|
|
133
151
|
params(
|
|
134
152
|
url: URI::Generic,
|
|
135
153
|
status: Integer,
|
|
154
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
136
155
|
body: T.nilable(Object),
|
|
137
156
|
request: NilClass,
|
|
138
157
|
response: NilClass,
|
|
139
158
|
message: T.nilable(String)
|
|
140
159
|
).returns(T.attached_class)
|
|
141
160
|
end
|
|
142
|
-
def self.new(
|
|
161
|
+
def self.new(
|
|
162
|
+
url:,
|
|
163
|
+
status:,
|
|
164
|
+
headers:,
|
|
165
|
+
body:,
|
|
166
|
+
request:,
|
|
167
|
+
response:,
|
|
168
|
+
message: nil
|
|
169
|
+
)
|
|
143
170
|
end
|
|
144
171
|
end
|
|
145
172
|
|
|
@@ -85,10 +85,9 @@ module MetronomeSDK
|
|
|
85
85
|
|
|
86
86
|
# @api private
|
|
87
87
|
sig do
|
|
88
|
-
params(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
).returns(T::Boolean)
|
|
88
|
+
params(status: Integer, headers: T::Hash[String, String]).returns(
|
|
89
|
+
T::Boolean
|
|
90
|
+
)
|
|
92
91
|
end
|
|
93
92
|
def should_retry?(status, headers:)
|
|
94
93
|
end
|
|
@@ -99,7 +98,7 @@ module MetronomeSDK
|
|
|
99
98
|
request:
|
|
100
99
|
MetronomeSDK::Internal::Transport::BaseClient::RequestInput,
|
|
101
100
|
status: Integer,
|
|
102
|
-
response_headers: T
|
|
101
|
+
response_headers: T::Hash[String, String]
|
|
103
102
|
).returns(
|
|
104
103
|
MetronomeSDK::Internal::Transport::BaseClient::RequestInput
|
|
105
104
|
)
|
|
@@ -31,7 +31,7 @@ module MetronomeSDK
|
|
|
31
31
|
client: MetronomeSDK::Internal::Transport::BaseClient,
|
|
32
32
|
req:
|
|
33
33
|
MetronomeSDK::Internal::Transport::BaseClient::RequestComponents,
|
|
34
|
-
headers: T
|
|
34
|
+
headers: T::Hash[String, String],
|
|
35
35
|
page_data: T.anything
|
|
36
36
|
).void
|
|
37
37
|
end
|
|
@@ -361,7 +361,7 @@ module MetronomeSDK
|
|
|
361
361
|
# Assumes each chunk in stream has `Encoding::BINARY`.
|
|
362
362
|
sig do
|
|
363
363
|
params(
|
|
364
|
-
headers: T
|
|
364
|
+
headers: T::Hash[String, String],
|
|
365
365
|
stream: T::Enumerable[String],
|
|
366
366
|
suppress_error: T::Boolean
|
|
367
367
|
).returns(T.anything)
|
|
@@ -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(
|