metronome-sdk 3.3.0 → 3.4.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 +17 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/client.rb +7 -0
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +9 -1
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_archive_billing_configurations_params.rb +32 -0
- data/lib/metronome_sdk/models/v1/customer_archive_billing_configurations_response.rb +38 -0
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +17 -2
- data/lib/metronome_sdk/resources/v1/customers.rb +53 -0
- data/lib/metronome_sdk/resources/v1/usage.rb +21 -0
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +2 -0
- data/rbi/metronome_sdk/client.rbi +6 -0
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +11 -0
- data/rbi/metronome_sdk/models/v1/customer_archive_billing_configurations_params.rbi +56 -0
- data/rbi/metronome_sdk/models/v1/customer_archive_billing_configurations_response.rbi +95 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +20 -3
- data/rbi/metronome_sdk/resources/v1/customers.rbi +48 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +21 -0
- data/sig/metronome_sdk/client.rbs +3 -0
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +7 -0
- data/sig/metronome_sdk/models/v1/customer_archive_billing_configurations_params.rbs +33 -0
- data/sig/metronome_sdk/models/v1/customer_archive_billing_configurations_response.rbs +44 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +15 -3
- data/sig/metronome_sdk/resources/v1/customers.rbs +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e790ead396d794ecaa6da7fe2daebbc0d2889ac357ab7d388d7d271ff11ddca7
|
|
4
|
+
data.tar.gz: bbb781138592c99fd427f0fc8817cf27f64fedd92b85b3a52c84e82e0900a905
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 824e2718830473643d02f38f5ba467c820e19c505cb1e37c18fb7c69fee28425f41eeb38aa32715eb180613d79c4dfcc5753f53abb8e01c8f8eb2033750b118a
|
|
7
|
+
data.tar.gz: e521c9add4393abe34ad717c69fc23c3a9dd32fc84a9c65b151d65f83f2b7d84f66ca61d45a58977f06d66e8ef3ecb8e1bfd621b90d0aaf3bd6b5d2c2f797a6a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.4.0 (2026-03-11)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v3.3.0...v3.4.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v3.3.0...v3.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* (docs): update documentation for /usage/groups ([cb98f76](https://github.com/Metronome-Industries/metronome-ruby/commit/cb98f762fd49b8bc4bf1db518c4b3fca2dfbdd76))
|
|
10
|
+
* Add archive_billing_configurations endpoint ([693b236](https://github.com/Metronome-Industries/metronome-ruby/commit/693b236a57927c30bee80fa18708b335d5b3216c))
|
|
11
|
+
* **client:** add webhook support ([b80cc07](https://github.com/Metronome-Industries/metronome-ruby/commit/b80cc07d79fc8f86ee10c081260c60f72421b2cc))
|
|
12
|
+
* Enable rollover fraction on credits ([8cb1d11](https://github.com/Metronome-Industries/metronome-ruby/commit/8cb1d11bea6edbf2c37ebe651f37b5daea0c8e51))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Chores
|
|
16
|
+
|
|
17
|
+
* **ci:** skip uploading artifacts on stainless-internal branches ([80252b9](https://github.com/Metronome-Industries/metronome-ruby/commit/80252b925a2136ac68afdcbc57105656b6b93d8e))
|
|
18
|
+
* **test:** do not count install time for mock server timeout ([c95574c](https://github.com/Metronome-Industries/metronome-ruby/commit/c95574c224e6565840f2c6ac6e47970ac151a5d4))
|
|
19
|
+
|
|
3
20
|
## 3.3.0 (2026-03-03)
|
|
4
21
|
|
|
5
22
|
Full Changelog: [v3.2.0...v3.3.0](https://github.com/Metronome-Industries/metronome-ruby/compare/v3.2.0...v3.3.0)
|
data/README.md
CHANGED
data/lib/metronome_sdk/client.rb
CHANGED
|
@@ -18,6 +18,9 @@ module MetronomeSDK
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
attr_reader :bearer_token
|
|
20
20
|
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
attr_reader :webhook_secret
|
|
23
|
+
|
|
21
24
|
# @return [MetronomeSDK::Resources::V2]
|
|
22
25
|
attr_reader :v2
|
|
23
26
|
|
|
@@ -37,6 +40,8 @@ module MetronomeSDK
|
|
|
37
40
|
#
|
|
38
41
|
# @param bearer_token [String, nil] Defaults to `ENV["METRONOME_BEARER_TOKEN"]`
|
|
39
42
|
#
|
|
43
|
+
# @param webhook_secret [String, nil] Defaults to `ENV["METRONOME_WEBHOOK_SECRET"]`
|
|
44
|
+
#
|
|
40
45
|
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
|
|
41
46
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["METRONOME_BASE_URL"]`
|
|
42
47
|
#
|
|
@@ -49,6 +54,7 @@ module MetronomeSDK
|
|
|
49
54
|
# @param max_retry_delay [Float]
|
|
50
55
|
def initialize(
|
|
51
56
|
bearer_token: ENV["METRONOME_BEARER_TOKEN"],
|
|
57
|
+
webhook_secret: ENV["METRONOME_WEBHOOK_SECRET"],
|
|
52
58
|
base_url: ENV["METRONOME_BASE_URL"],
|
|
53
59
|
max_retries: self.class::DEFAULT_MAX_RETRIES,
|
|
54
60
|
timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
|
|
@@ -62,6 +68,7 @@ module MetronomeSDK
|
|
|
62
68
|
end
|
|
63
69
|
|
|
64
70
|
@bearer_token = bearer_token.to_s
|
|
71
|
+
@webhook_secret = webhook_secret&.to_s
|
|
65
72
|
|
|
66
73
|
super(
|
|
67
74
|
base_url: base_url,
|
|
@@ -789,6 +789,12 @@ module MetronomeSDK
|
|
|
789
789
|
# @return [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Credit::RateType, nil]
|
|
790
790
|
optional :rate_type, enum: -> { MetronomeSDK::V1::ContractAmendParams::Credit::RateType }
|
|
791
791
|
|
|
792
|
+
# @!attribute rollover_fraction
|
|
793
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
794
|
+
#
|
|
795
|
+
# @return [Float, nil]
|
|
796
|
+
optional :rollover_fraction, Float
|
|
797
|
+
|
|
792
798
|
# @!attribute specifiers
|
|
793
799
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
794
800
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
@@ -798,7 +804,7 @@ module MetronomeSDK
|
|
|
798
804
|
# @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
|
|
799
805
|
optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] }
|
|
800
806
|
|
|
801
|
-
# @!method initialize(access_schedule:, product_id:, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, specifiers: nil)
|
|
807
|
+
# @!method initialize(access_schedule:, product_id:, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil)
|
|
802
808
|
# Some parameter documentations has been truncated, see
|
|
803
809
|
# {MetronomeSDK::Models::V1::ContractAmendParams::Credit} for more details.
|
|
804
810
|
#
|
|
@@ -824,6 +830,8 @@ module MetronomeSDK
|
|
|
824
830
|
#
|
|
825
831
|
# @param rate_type [Symbol, MetronomeSDK::Models::V1::ContractAmendParams::Credit::RateType]
|
|
826
832
|
#
|
|
833
|
+
# @param rollover_fraction [Float] Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
834
|
+
#
|
|
827
835
|
# @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
|
|
828
836
|
|
|
829
837
|
# @see MetronomeSDK::Models::V1::ContractAmendParams::Credit#access_schedule
|
|
@@ -1035,6 +1035,12 @@ module MetronomeSDK
|
|
|
1035
1035
|
# @return [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::Credit::RateType, nil]
|
|
1036
1036
|
optional :rate_type, enum: -> { MetronomeSDK::V1::ContractCreateParams::Credit::RateType }
|
|
1037
1037
|
|
|
1038
|
+
# @!attribute rollover_fraction
|
|
1039
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1040
|
+
#
|
|
1041
|
+
# @return [Float, nil]
|
|
1042
|
+
optional :rollover_fraction, Float
|
|
1043
|
+
|
|
1038
1044
|
# @!attribute specifiers
|
|
1039
1045
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
1040
1046
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
@@ -1044,7 +1050,7 @@ module MetronomeSDK
|
|
|
1044
1050
|
# @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
|
|
1045
1051
|
optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] }
|
|
1046
1052
|
|
|
1047
|
-
# @!method initialize(access_schedule:, product_id:, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, specifiers: nil)
|
|
1053
|
+
# @!method initialize(access_schedule:, product_id:, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil)
|
|
1048
1054
|
# Some parameter documentations has been truncated, see
|
|
1049
1055
|
# {MetronomeSDK::Models::V1::ContractCreateParams::Credit} for more details.
|
|
1050
1056
|
#
|
|
@@ -1070,6 +1076,8 @@ module MetronomeSDK
|
|
|
1070
1076
|
#
|
|
1071
1077
|
# @param rate_type [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::Credit::RateType]
|
|
1072
1078
|
#
|
|
1079
|
+
# @param rollover_fraction [Float] Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1080
|
+
#
|
|
1073
1081
|
# @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
|
|
1074
1082
|
|
|
1075
1083
|
# @see MetronomeSDK::Models::V1::ContractCreateParams::Credit#access_schedule
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see MetronomeSDK::Resources::V1::Customers#archive_billing_configurations
|
|
7
|
+
class CustomerArchiveBillingConfigurationsParams < MetronomeSDK::Internal::Type::BaseModel
|
|
8
|
+
extend MetronomeSDK::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include MetronomeSDK::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute customer_billing_provider_configuration_ids
|
|
12
|
+
# Array of billing provider configuration IDs to archive
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<String>]
|
|
15
|
+
required :customer_billing_provider_configuration_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
|
|
16
|
+
|
|
17
|
+
# @!attribute customer_id
|
|
18
|
+
# The customer ID the billing provider configurations belong to
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
required :customer_id, String
|
|
22
|
+
|
|
23
|
+
# @!method initialize(customer_billing_provider_configuration_ids:, customer_id:, request_options: {})
|
|
24
|
+
# @param customer_billing_provider_configuration_ids [Array<String>] Array of billing provider configuration IDs to archive
|
|
25
|
+
#
|
|
26
|
+
# @param customer_id [String] The customer ID the billing provider configurations belong to
|
|
27
|
+
#
|
|
28
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see MetronomeSDK::Resources::V1::Customers#archive_billing_configurations
|
|
7
|
+
class CustomerArchiveBillingConfigurationsResponse < MetronomeSDK::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute data
|
|
9
|
+
#
|
|
10
|
+
# @return [MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data]
|
|
11
|
+
required :data, -> { MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data }
|
|
12
|
+
|
|
13
|
+
# @!method initialize(data:)
|
|
14
|
+
# @param data [MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data]
|
|
15
|
+
|
|
16
|
+
# @see MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse#data
|
|
17
|
+
class Data < MetronomeSDK::Internal::Type::BaseModel
|
|
18
|
+
# @!attribute customer_billing_provider_configuration_ids
|
|
19
|
+
# Array of billing provider configuration IDs to archive
|
|
20
|
+
#
|
|
21
|
+
# @return [Array<String>]
|
|
22
|
+
required :customer_billing_provider_configuration_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
|
|
23
|
+
|
|
24
|
+
# @!attribute customer_id
|
|
25
|
+
# The customer ID the billing provider configurations belong to
|
|
26
|
+
#
|
|
27
|
+
# @return [String]
|
|
28
|
+
required :customer_id, String
|
|
29
|
+
|
|
30
|
+
# @!method initialize(customer_billing_provider_configuration_ids:, customer_id:)
|
|
31
|
+
# @param customer_billing_provider_configuration_ids [Array<String>] Array of billing provider configuration IDs to archive
|
|
32
|
+
#
|
|
33
|
+
# @param customer_id [String] The customer ID the billing provider configurations belong to
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -1081,6 +1081,12 @@ module MetronomeSDK
|
|
|
1081
1081
|
# @return [Symbol, MetronomeSDK::Models::V2::ContractEditParams::AddCredit::RateType, nil]
|
|
1082
1082
|
optional :rate_type, enum: -> { MetronomeSDK::V2::ContractEditParams::AddCredit::RateType }
|
|
1083
1083
|
|
|
1084
|
+
# @!attribute rollover_fraction
|
|
1085
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1086
|
+
#
|
|
1087
|
+
# @return [Float, nil]
|
|
1088
|
+
optional :rollover_fraction, Float
|
|
1089
|
+
|
|
1084
1090
|
# @!attribute specifiers
|
|
1085
1091
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
1086
1092
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
@@ -1092,7 +1098,7 @@ module MetronomeSDK
|
|
|
1092
1098
|
# @return [Array<MetronomeSDK::Models::CommitSpecifierInput>, nil]
|
|
1093
1099
|
optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifierInput] }
|
|
1094
1100
|
|
|
1095
|
-
# @!method initialize(access_schedule:, product_id:, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, specifiers: nil)
|
|
1101
|
+
# @!method initialize(access_schedule:, product_id:, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil)
|
|
1096
1102
|
# Some parameter documentations has been truncated, see
|
|
1097
1103
|
# {MetronomeSDK::Models::V2::ContractEditParams::AddCredit} for more details.
|
|
1098
1104
|
#
|
|
@@ -1118,6 +1124,8 @@ module MetronomeSDK
|
|
|
1118
1124
|
#
|
|
1119
1125
|
# @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditParams::AddCredit::RateType]
|
|
1120
1126
|
#
|
|
1127
|
+
# @param rollover_fraction [Float] Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1128
|
+
#
|
|
1121
1129
|
# @param specifiers [Array<MetronomeSDK::Models::CommitSpecifierInput>] List of filters that determine what kind of customer usage draws down a commit o
|
|
1122
1130
|
|
|
1123
1131
|
# @see MetronomeSDK::Models::V2::ContractEditParams::AddCredit#access_schedule
|
|
@@ -3696,7 +3704,12 @@ module MetronomeSDK
|
|
|
3696
3704
|
# @return [Symbol, MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::RateType, nil]
|
|
3697
3705
|
optional :rate_type, enum: -> { MetronomeSDK::V2::ContractEditParams::UpdateCredit::RateType }
|
|
3698
3706
|
|
|
3699
|
-
# @!
|
|
3707
|
+
# @!attribute rollover_fraction
|
|
3708
|
+
#
|
|
3709
|
+
# @return [Float, nil]
|
|
3710
|
+
optional :rollover_fraction, Float, nil?: true
|
|
3711
|
+
|
|
3712
|
+
# @!method initialize(credit_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, description: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, priority: nil, product_id: nil, rate_type: nil, rollover_fraction: nil)
|
|
3700
3713
|
# Some parameter documentations has been truncated, see
|
|
3701
3714
|
# {MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit} for more details.
|
|
3702
3715
|
#
|
|
@@ -3721,6 +3734,8 @@ module MetronomeSDK
|
|
|
3721
3734
|
# @param product_id [String]
|
|
3722
3735
|
#
|
|
3723
3736
|
# @param rate_type [Symbol, MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::RateType] If provided, updates the credit to use the specified rate type for current and f
|
|
3737
|
+
#
|
|
3738
|
+
# @param rollover_fraction [Float, nil]
|
|
3724
3739
|
|
|
3725
3740
|
# @see MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit#access_schedule
|
|
3726
3741
|
class AccessSchedule < MetronomeSDK::Internal::Type::BaseModel
|
|
@@ -221,6 +221,59 @@ module MetronomeSDK
|
|
|
221
221
|
)
|
|
222
222
|
end
|
|
223
223
|
|
|
224
|
+
# Deprecate an existing billing configuration for a customer to handle churn or
|
|
225
|
+
# billing and collection preference changes. Archiving a billing configuration
|
|
226
|
+
# takes effect immediately. If there are active contracts using the configuration,
|
|
227
|
+
# Metronome will archive the configuration on the contract and immediately stop
|
|
228
|
+
# metering to downstream systems.
|
|
229
|
+
#
|
|
230
|
+
# ### Use this endpoint to:
|
|
231
|
+
#
|
|
232
|
+
# - Remove billing provider customer data and configurations when no longer needed
|
|
233
|
+
# - Clean up test or deprecated billing provider configurations
|
|
234
|
+
# - Free up uniqueness keys for reuse with new billing provider configurations
|
|
235
|
+
# - Disable threshold recharge configurations associated with archived billing
|
|
236
|
+
# providers
|
|
237
|
+
#
|
|
238
|
+
# ### Key response fields:
|
|
239
|
+
#
|
|
240
|
+
# A successful response returns:
|
|
241
|
+
#
|
|
242
|
+
# - `success`: Boolean indicating the operation completed successfully
|
|
243
|
+
# - `error`: Null on success, error message on failure
|
|
244
|
+
#
|
|
245
|
+
# ### Usage guidelines:
|
|
246
|
+
#
|
|
247
|
+
# - Archiving a contract configuration during a grace period will result in the
|
|
248
|
+
# invoice not being sent to the customer
|
|
249
|
+
# - Automatically disables both spend-based and credit-based threshold recharge
|
|
250
|
+
# configurations for contracts using the archived billing provider
|
|
251
|
+
# - You can archive multiple configurations for a single customer in a single
|
|
252
|
+
# request, but any validation failures for an individual configuration will
|
|
253
|
+
# prevent the entire operation from succeeding
|
|
254
|
+
#
|
|
255
|
+
# @overload archive_billing_configurations(customer_billing_provider_configuration_ids:, customer_id:, request_options: {})
|
|
256
|
+
#
|
|
257
|
+
# @param customer_billing_provider_configuration_ids [Array<String>] Array of billing provider configuration IDs to archive
|
|
258
|
+
#
|
|
259
|
+
# @param customer_id [String] The customer ID the billing provider configurations belong to
|
|
260
|
+
#
|
|
261
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
262
|
+
#
|
|
263
|
+
# @return [MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse]
|
|
264
|
+
#
|
|
265
|
+
# @see MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsParams
|
|
266
|
+
def archive_billing_configurations(params)
|
|
267
|
+
parsed, options = MetronomeSDK::V1::CustomerArchiveBillingConfigurationsParams.dump_request(params)
|
|
268
|
+
@client.request(
|
|
269
|
+
method: :post,
|
|
270
|
+
path: "v1/archiveCustomerBillingProviderConfigurations",
|
|
271
|
+
body: parsed,
|
|
272
|
+
model: MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse,
|
|
273
|
+
options: options
|
|
274
|
+
)
|
|
275
|
+
end
|
|
276
|
+
|
|
224
277
|
# Some parameter documentations has been truncated, see
|
|
225
278
|
# {MetronomeSDK::Models::V1::CustomerListBillableMetricsParams} for more details.
|
|
226
279
|
#
|
|
@@ -199,6 +199,27 @@ module MetronomeSDK
|
|
|
199
199
|
# - Build detailed usage dashboards with dimensional filtering
|
|
200
200
|
# - Identify high-usage segments for optimization opportunities
|
|
201
201
|
#
|
|
202
|
+
# ### Request parameters
|
|
203
|
+
#
|
|
204
|
+
# Use [`group_key`](#body-group-key) and [`group_filters`](#body-group-filters) to
|
|
205
|
+
# group by one or more dimensions. This is required for compound group keys and
|
|
206
|
+
# recommended for all new integrations:
|
|
207
|
+
#
|
|
208
|
+
# ```json
|
|
209
|
+
# {
|
|
210
|
+
# "group_key": ["region", "team"],
|
|
211
|
+
# "group_filters": {
|
|
212
|
+
# "region": ["US-East", "US-West"]
|
|
213
|
+
# }
|
|
214
|
+
# }
|
|
215
|
+
# ```
|
|
216
|
+
#
|
|
217
|
+
# Important: For compound group keys, you must pass the complete set of keys that
|
|
218
|
+
# make up the compound key. Partial key combinations are not supported. For
|
|
219
|
+
# example, if your billable metric has a compound group key [region, team,
|
|
220
|
+
# environment], you must pass all three keys in group_key—you cannot pass just
|
|
221
|
+
# `[region]` or `[region, team]`.
|
|
222
|
+
#
|
|
202
223
|
# ### Key response fields:
|
|
203
224
|
#
|
|
204
225
|
# An array of `PagedUsageAggregate` objects containing:
|
data/lib/metronome_sdk.rb
CHANGED
|
@@ -185,6 +185,8 @@ require_relative "metronome_sdk/models/v1/credit_grant_void_params"
|
|
|
185
185
|
require_relative "metronome_sdk/models/v1/credit_grant_void_response"
|
|
186
186
|
require_relative "metronome_sdk/models/v1/credit_ledger_entry"
|
|
187
187
|
require_relative "metronome_sdk/models/v1/customer"
|
|
188
|
+
require_relative "metronome_sdk/models/v1/customer_archive_billing_configurations_params"
|
|
189
|
+
require_relative "metronome_sdk/models/v1/customer_archive_billing_configurations_response"
|
|
188
190
|
require_relative "metronome_sdk/models/v1/customer_archive_params"
|
|
189
191
|
require_relative "metronome_sdk/models/v1/customer_archive_response"
|
|
190
192
|
require_relative "metronome_sdk/models/v1/customer_create_params"
|
|
@@ -13,6 +13,9 @@ module MetronomeSDK
|
|
|
13
13
|
sig { returns(String) }
|
|
14
14
|
attr_reader :bearer_token
|
|
15
15
|
|
|
16
|
+
sig { returns(T.nilable(String)) }
|
|
17
|
+
attr_reader :webhook_secret
|
|
18
|
+
|
|
16
19
|
sig { returns(MetronomeSDK::Resources::V2) }
|
|
17
20
|
attr_reader :v2
|
|
18
21
|
|
|
@@ -28,6 +31,7 @@ module MetronomeSDK
|
|
|
28
31
|
sig do
|
|
29
32
|
params(
|
|
30
33
|
bearer_token: T.nilable(String),
|
|
34
|
+
webhook_secret: T.nilable(String),
|
|
31
35
|
base_url: T.nilable(String),
|
|
32
36
|
max_retries: Integer,
|
|
33
37
|
timeout: Float,
|
|
@@ -38,6 +42,8 @@ module MetronomeSDK
|
|
|
38
42
|
def self.new(
|
|
39
43
|
# Defaults to `ENV["METRONOME_BEARER_TOKEN"]`
|
|
40
44
|
bearer_token: ENV["METRONOME_BEARER_TOKEN"],
|
|
45
|
+
# Defaults to `ENV["METRONOME_WEBHOOK_SECRET"]`
|
|
46
|
+
webhook_secret: ENV["METRONOME_WEBHOOK_SECRET"],
|
|
41
47
|
# Override the default base URL for the API, e.g.,
|
|
42
48
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["METRONOME_BASE_URL"]`
|
|
43
49
|
base_url: ENV["METRONOME_BASE_URL"],
|
|
@@ -1631,6 +1631,13 @@ module MetronomeSDK
|
|
|
1631
1631
|
end
|
|
1632
1632
|
attr_writer :rate_type
|
|
1633
1633
|
|
|
1634
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1635
|
+
sig { returns(T.nilable(Float)) }
|
|
1636
|
+
attr_reader :rollover_fraction
|
|
1637
|
+
|
|
1638
|
+
sig { params(rollover_fraction: Float).void }
|
|
1639
|
+
attr_writer :rollover_fraction
|
|
1640
|
+
|
|
1634
1641
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
1635
1642
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1636
1643
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -1663,6 +1670,7 @@ module MetronomeSDK
|
|
|
1663
1670
|
priority: Float,
|
|
1664
1671
|
rate_type:
|
|
1665
1672
|
MetronomeSDK::V1::ContractAmendParams::Credit::RateType::OrSymbol,
|
|
1673
|
+
rollover_fraction: Float,
|
|
1666
1674
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput::OrHash]
|
|
1667
1675
|
).returns(T.attached_class)
|
|
1668
1676
|
end
|
|
@@ -1690,6 +1698,8 @@ module MetronomeSDK
|
|
|
1690
1698
|
# first.
|
|
1691
1699
|
priority: nil,
|
|
1692
1700
|
rate_type: nil,
|
|
1701
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
1702
|
+
rollover_fraction: nil,
|
|
1693
1703
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
1694
1704
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1695
1705
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -1715,6 +1725,7 @@ module MetronomeSDK
|
|
|
1715
1725
|
priority: Float,
|
|
1716
1726
|
rate_type:
|
|
1717
1727
|
MetronomeSDK::V1::ContractAmendParams::Credit::RateType::OrSymbol,
|
|
1728
|
+
rollover_fraction: Float,
|
|
1718
1729
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput]
|
|
1719
1730
|
}
|
|
1720
1731
|
)
|
|
@@ -2216,6 +2216,13 @@ module MetronomeSDK
|
|
|
2216
2216
|
end
|
|
2217
2217
|
attr_writer :rate_type
|
|
2218
2218
|
|
|
2219
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2220
|
+
sig { returns(T.nilable(Float)) }
|
|
2221
|
+
attr_reader :rollover_fraction
|
|
2222
|
+
|
|
2223
|
+
sig { params(rollover_fraction: Float).void }
|
|
2224
|
+
attr_writer :rollover_fraction
|
|
2225
|
+
|
|
2219
2226
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
2220
2227
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2221
2228
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -2248,6 +2255,7 @@ module MetronomeSDK
|
|
|
2248
2255
|
priority: Float,
|
|
2249
2256
|
rate_type:
|
|
2250
2257
|
MetronomeSDK::V1::ContractCreateParams::Credit::RateType::OrSymbol,
|
|
2258
|
+
rollover_fraction: Float,
|
|
2251
2259
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput::OrHash]
|
|
2252
2260
|
).returns(T.attached_class)
|
|
2253
2261
|
end
|
|
@@ -2275,6 +2283,8 @@ module MetronomeSDK
|
|
|
2275
2283
|
# first.
|
|
2276
2284
|
priority: nil,
|
|
2277
2285
|
rate_type: nil,
|
|
2286
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2287
|
+
rollover_fraction: nil,
|
|
2278
2288
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
2279
2289
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2280
2290
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -2300,6 +2310,7 @@ module MetronomeSDK
|
|
|
2300
2310
|
priority: Float,
|
|
2301
2311
|
rate_type:
|
|
2302
2312
|
MetronomeSDK::V1::ContractCreateParams::Credit::RateType::OrSymbol,
|
|
2313
|
+
rollover_fraction: Float,
|
|
2303
2314
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput]
|
|
2304
2315
|
}
|
|
2305
2316
|
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
class CustomerArchiveBillingConfigurationsParams < 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::CustomerArchiveBillingConfigurationsParams,
|
|
14
|
+
MetronomeSDK::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Array of billing provider configuration IDs to archive
|
|
19
|
+
sig { returns(T::Array[String]) }
|
|
20
|
+
attr_accessor :customer_billing_provider_configuration_ids
|
|
21
|
+
|
|
22
|
+
# The customer ID the billing provider configurations belong to
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :customer_id
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
customer_billing_provider_configuration_ids: T::Array[String],
|
|
29
|
+
customer_id: String,
|
|
30
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
31
|
+
).returns(T.attached_class)
|
|
32
|
+
end
|
|
33
|
+
def self.new(
|
|
34
|
+
# Array of billing provider configuration IDs to archive
|
|
35
|
+
customer_billing_provider_configuration_ids:,
|
|
36
|
+
# The customer ID the billing provider configurations belong to
|
|
37
|
+
customer_id:,
|
|
38
|
+
request_options: {}
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
override.returns(
|
|
44
|
+
{
|
|
45
|
+
customer_billing_provider_configuration_ids: T::Array[String],
|
|
46
|
+
customer_id: String,
|
|
47
|
+
request_options: MetronomeSDK::RequestOptions
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
def to_hash
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
class CustomerArchiveBillingConfigurationsResponse < MetronomeSDK::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse,
|
|
11
|
+
MetronomeSDK::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
sig do
|
|
16
|
+
returns(
|
|
17
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
attr_reader :data
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
data:
|
|
25
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data::OrHash
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :data
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
data:
|
|
33
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data::OrHash
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(data:)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
override.returns(
|
|
41
|
+
{
|
|
42
|
+
data:
|
|
43
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
def to_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
class Data < MetronomeSDK::Internal::Type::BaseModel
|
|
51
|
+
OrHash =
|
|
52
|
+
T.type_alias do
|
|
53
|
+
T.any(
|
|
54
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data,
|
|
55
|
+
MetronomeSDK::Internal::AnyHash
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Array of billing provider configuration IDs to archive
|
|
60
|
+
sig { returns(T::Array[String]) }
|
|
61
|
+
attr_accessor :customer_billing_provider_configuration_ids
|
|
62
|
+
|
|
63
|
+
# The customer ID the billing provider configurations belong to
|
|
64
|
+
sig { returns(String) }
|
|
65
|
+
attr_accessor :customer_id
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
customer_billing_provider_configuration_ids: T::Array[String],
|
|
70
|
+
customer_id: String
|
|
71
|
+
).returns(T.attached_class)
|
|
72
|
+
end
|
|
73
|
+
def self.new(
|
|
74
|
+
# Array of billing provider configuration IDs to archive
|
|
75
|
+
customer_billing_provider_configuration_ids:,
|
|
76
|
+
# The customer ID the billing provider configurations belong to
|
|
77
|
+
customer_id:
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
customer_billing_provider_configuration_ids: T::Array[String],
|
|
85
|
+
customer_id: String
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
def to_hash
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -2517,6 +2517,13 @@ module MetronomeSDK
|
|
|
2517
2517
|
end
|
|
2518
2518
|
attr_writer :rate_type
|
|
2519
2519
|
|
|
2520
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2521
|
+
sig { returns(T.nilable(Float)) }
|
|
2522
|
+
attr_reader :rollover_fraction
|
|
2523
|
+
|
|
2524
|
+
sig { params(rollover_fraction: Float).void }
|
|
2525
|
+
attr_writer :rollover_fraction
|
|
2526
|
+
|
|
2520
2527
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
2521
2528
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2522
2529
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -2551,6 +2558,7 @@ module MetronomeSDK
|
|
|
2551
2558
|
priority: Float,
|
|
2552
2559
|
rate_type:
|
|
2553
2560
|
MetronomeSDK::V2::ContractEditParams::AddCredit::RateType::OrSymbol,
|
|
2561
|
+
rollover_fraction: Float,
|
|
2554
2562
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput::OrHash]
|
|
2555
2563
|
).returns(T.attached_class)
|
|
2556
2564
|
end
|
|
@@ -2578,6 +2586,8 @@ module MetronomeSDK
|
|
|
2578
2586
|
# first.
|
|
2579
2587
|
priority: nil,
|
|
2580
2588
|
rate_type: nil,
|
|
2589
|
+
# Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2590
|
+
rollover_fraction: nil,
|
|
2581
2591
|
# List of filters that determine what kind of customer usage draws down a commit
|
|
2582
2592
|
# or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2583
2593
|
# specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
@@ -2605,6 +2615,7 @@ module MetronomeSDK
|
|
|
2605
2615
|
priority: Float,
|
|
2606
2616
|
rate_type:
|
|
2607
2617
|
MetronomeSDK::V2::ContractEditParams::AddCredit::RateType::OrSymbol,
|
|
2618
|
+
rollover_fraction: Float,
|
|
2608
2619
|
specifiers: T::Array[MetronomeSDK::CommitSpecifierInput]
|
|
2609
2620
|
}
|
|
2610
2621
|
)
|
|
@@ -8144,6 +8155,9 @@ module MetronomeSDK
|
|
|
8144
8155
|
end
|
|
8145
8156
|
attr_writer :rate_type
|
|
8146
8157
|
|
|
8158
|
+
sig { returns(T.nilable(Float)) }
|
|
8159
|
+
attr_accessor :rollover_fraction
|
|
8160
|
+
|
|
8147
8161
|
sig do
|
|
8148
8162
|
params(
|
|
8149
8163
|
credit_id: String,
|
|
@@ -8159,7 +8173,8 @@ module MetronomeSDK
|
|
|
8159
8173
|
priority: T.nilable(Float),
|
|
8160
8174
|
product_id: String,
|
|
8161
8175
|
rate_type:
|
|
8162
|
-
MetronomeSDK::V2::ContractEditParams::UpdateCredit::RateType::OrSymbol
|
|
8176
|
+
MetronomeSDK::V2::ContractEditParams::UpdateCredit::RateType::OrSymbol,
|
|
8177
|
+
rollover_fraction: T.nilable(Float)
|
|
8163
8178
|
).returns(T.attached_class)
|
|
8164
8179
|
end
|
|
8165
8180
|
def self.new(
|
|
@@ -8183,7 +8198,8 @@ module MetronomeSDK
|
|
|
8183
8198
|
# If provided, updates the credit to use the specified rate type for current and
|
|
8184
8199
|
# future invoices. Previously finalized invoices will need to be voided and
|
|
8185
8200
|
# regenerated to reflect the rate type change.
|
|
8186
|
-
rate_type: nil
|
|
8201
|
+
rate_type: nil,
|
|
8202
|
+
rollover_fraction: nil
|
|
8187
8203
|
)
|
|
8188
8204
|
end
|
|
8189
8205
|
|
|
@@ -8203,7 +8219,8 @@ module MetronomeSDK
|
|
|
8203
8219
|
priority: T.nilable(Float),
|
|
8204
8220
|
product_id: String,
|
|
8205
8221
|
rate_type:
|
|
8206
|
-
MetronomeSDK::V2::ContractEditParams::UpdateCredit::RateType::OrSymbol
|
|
8222
|
+
MetronomeSDK::V2::ContractEditParams::UpdateCredit::RateType::OrSymbol,
|
|
8223
|
+
rollover_fraction: T.nilable(Float)
|
|
8207
8224
|
}
|
|
8208
8225
|
)
|
|
8209
8226
|
end
|
|
@@ -192,6 +192,54 @@ module MetronomeSDK
|
|
|
192
192
|
def archive(id:, request_options: {})
|
|
193
193
|
end
|
|
194
194
|
|
|
195
|
+
# Deprecate an existing billing configuration for a customer to handle churn or
|
|
196
|
+
# billing and collection preference changes. Archiving a billing configuration
|
|
197
|
+
# takes effect immediately. If there are active contracts using the configuration,
|
|
198
|
+
# Metronome will archive the configuration on the contract and immediately stop
|
|
199
|
+
# metering to downstream systems.
|
|
200
|
+
#
|
|
201
|
+
# ### Use this endpoint to:
|
|
202
|
+
#
|
|
203
|
+
# - Remove billing provider customer data and configurations when no longer needed
|
|
204
|
+
# - Clean up test or deprecated billing provider configurations
|
|
205
|
+
# - Free up uniqueness keys for reuse with new billing provider configurations
|
|
206
|
+
# - Disable threshold recharge configurations associated with archived billing
|
|
207
|
+
# providers
|
|
208
|
+
#
|
|
209
|
+
# ### Key response fields:
|
|
210
|
+
#
|
|
211
|
+
# A successful response returns:
|
|
212
|
+
#
|
|
213
|
+
# - `success`: Boolean indicating the operation completed successfully
|
|
214
|
+
# - `error`: Null on success, error message on failure
|
|
215
|
+
#
|
|
216
|
+
# ### Usage guidelines:
|
|
217
|
+
#
|
|
218
|
+
# - Archiving a contract configuration during a grace period will result in the
|
|
219
|
+
# invoice not being sent to the customer
|
|
220
|
+
# - Automatically disables both spend-based and credit-based threshold recharge
|
|
221
|
+
# configurations for contracts using the archived billing provider
|
|
222
|
+
# - You can archive multiple configurations for a single customer in a single
|
|
223
|
+
# request, but any validation failures for an individual configuration will
|
|
224
|
+
# prevent the entire operation from succeeding
|
|
225
|
+
sig do
|
|
226
|
+
params(
|
|
227
|
+
customer_billing_provider_configuration_ids: T::Array[String],
|
|
228
|
+
customer_id: String,
|
|
229
|
+
request_options: MetronomeSDK::RequestOptions::OrHash
|
|
230
|
+
).returns(
|
|
231
|
+
MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse
|
|
232
|
+
)
|
|
233
|
+
end
|
|
234
|
+
def archive_billing_configurations(
|
|
235
|
+
# Array of billing provider configuration IDs to archive
|
|
236
|
+
customer_billing_provider_configuration_ids:,
|
|
237
|
+
# The customer ID the billing provider configurations belong to
|
|
238
|
+
customer_id:,
|
|
239
|
+
request_options: {}
|
|
240
|
+
)
|
|
241
|
+
end
|
|
242
|
+
|
|
195
243
|
# Get all billable metrics available for a specific customer. Supports pagination
|
|
196
244
|
# and filtering by current plan status or archived metrics. Use this endpoint to
|
|
197
245
|
# see which metrics are being tracked for billing calculations for a given
|
|
@@ -188,6 +188,27 @@ module MetronomeSDK
|
|
|
188
188
|
# - Build detailed usage dashboards with dimensional filtering
|
|
189
189
|
# - Identify high-usage segments for optimization opportunities
|
|
190
190
|
#
|
|
191
|
+
# ### Request parameters
|
|
192
|
+
#
|
|
193
|
+
# Use [`group_key`](#body-group-key) and [`group_filters`](#body-group-filters) to
|
|
194
|
+
# group by one or more dimensions. This is required for compound group keys and
|
|
195
|
+
# recommended for all new integrations:
|
|
196
|
+
#
|
|
197
|
+
# ```json
|
|
198
|
+
# {
|
|
199
|
+
# "group_key": ["region", "team"],
|
|
200
|
+
# "group_filters": {
|
|
201
|
+
# "region": ["US-East", "US-West"]
|
|
202
|
+
# }
|
|
203
|
+
# }
|
|
204
|
+
# ```
|
|
205
|
+
#
|
|
206
|
+
# Important: For compound group keys, you must pass the complete set of keys that
|
|
207
|
+
# make up the compound key. Partial key combinations are not supported. For
|
|
208
|
+
# example, if your billable metric has a compound group key [region, team,
|
|
209
|
+
# environment], you must pass all three keys in group_key—you cannot pass just
|
|
210
|
+
# `[region]` or `[region, team]`.
|
|
211
|
+
#
|
|
191
212
|
# ### Key response fields:
|
|
192
213
|
#
|
|
193
214
|
# An array of `PagedUsageAggregate` objects containing:
|
|
@@ -10,6 +10,8 @@ module MetronomeSDK
|
|
|
10
10
|
|
|
11
11
|
attr_reader bearer_token: String
|
|
12
12
|
|
|
13
|
+
attr_reader webhook_secret: String?
|
|
14
|
+
|
|
13
15
|
attr_reader v2: MetronomeSDK::Resources::V2
|
|
14
16
|
|
|
15
17
|
attr_reader v1: MetronomeSDK::Resources::V1
|
|
@@ -18,6 +20,7 @@ module MetronomeSDK
|
|
|
18
20
|
|
|
19
21
|
def initialize: (
|
|
20
22
|
?bearer_token: String?,
|
|
23
|
+
?webhook_secret: String?,
|
|
21
24
|
?base_url: String?,
|
|
22
25
|
?max_retries: Integer,
|
|
23
26
|
?timeout: Float,
|
|
@@ -640,6 +640,7 @@ module MetronomeSDK
|
|
|
640
640
|
netsuite_sales_order_id: String,
|
|
641
641
|
priority: Float,
|
|
642
642
|
rate_type: MetronomeSDK::Models::V1::ContractAmendParams::Credit::rate_type,
|
|
643
|
+
rollover_fraction: Float,
|
|
643
644
|
specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
644
645
|
}
|
|
645
646
|
|
|
@@ -688,6 +689,10 @@ module MetronomeSDK
|
|
|
688
689
|
MetronomeSDK::Models::V1::ContractAmendParams::Credit::rate_type
|
|
689
690
|
) -> MetronomeSDK::Models::V1::ContractAmendParams::Credit::rate_type
|
|
690
691
|
|
|
692
|
+
attr_reader rollover_fraction: Float?
|
|
693
|
+
|
|
694
|
+
def rollover_fraction=: (Float) -> Float
|
|
695
|
+
|
|
691
696
|
attr_reader specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]?
|
|
692
697
|
|
|
693
698
|
def specifiers=: (
|
|
@@ -706,6 +711,7 @@ module MetronomeSDK
|
|
|
706
711
|
?netsuite_sales_order_id: String,
|
|
707
712
|
?priority: Float,
|
|
708
713
|
?rate_type: MetronomeSDK::Models::V1::ContractAmendParams::Credit::rate_type,
|
|
714
|
+
?rollover_fraction: Float,
|
|
709
715
|
?specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
710
716
|
) -> void
|
|
711
717
|
|
|
@@ -721,6 +727,7 @@ module MetronomeSDK
|
|
|
721
727
|
netsuite_sales_order_id: String,
|
|
722
728
|
priority: Float,
|
|
723
729
|
rate_type: MetronomeSDK::Models::V1::ContractAmendParams::Credit::rate_type,
|
|
730
|
+
rollover_fraction: Float,
|
|
724
731
|
specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
725
732
|
}
|
|
726
733
|
|
|
@@ -878,6 +878,7 @@ module MetronomeSDK
|
|
|
878
878
|
netsuite_sales_order_id: String,
|
|
879
879
|
priority: Float,
|
|
880
880
|
rate_type: MetronomeSDK::Models::V1::ContractCreateParams::Credit::rate_type,
|
|
881
|
+
rollover_fraction: Float,
|
|
881
882
|
specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
882
883
|
}
|
|
883
884
|
|
|
@@ -926,6 +927,10 @@ module MetronomeSDK
|
|
|
926
927
|
MetronomeSDK::Models::V1::ContractCreateParams::Credit::rate_type
|
|
927
928
|
) -> MetronomeSDK::Models::V1::ContractCreateParams::Credit::rate_type
|
|
928
929
|
|
|
930
|
+
attr_reader rollover_fraction: Float?
|
|
931
|
+
|
|
932
|
+
def rollover_fraction=: (Float) -> Float
|
|
933
|
+
|
|
929
934
|
attr_reader specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]?
|
|
930
935
|
|
|
931
936
|
def specifiers=: (
|
|
@@ -944,6 +949,7 @@ module MetronomeSDK
|
|
|
944
949
|
?netsuite_sales_order_id: String,
|
|
945
950
|
?priority: Float,
|
|
946
951
|
?rate_type: MetronomeSDK::Models::V1::ContractCreateParams::Credit::rate_type,
|
|
952
|
+
?rollover_fraction: Float,
|
|
947
953
|
?specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
948
954
|
) -> void
|
|
949
955
|
|
|
@@ -959,6 +965,7 @@ module MetronomeSDK
|
|
|
959
965
|
netsuite_sales_order_id: String,
|
|
960
966
|
priority: Float,
|
|
961
967
|
rate_type: MetronomeSDK::Models::V1::ContractCreateParams::Credit::rate_type,
|
|
968
|
+
rollover_fraction: Float,
|
|
962
969
|
specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
963
970
|
}
|
|
964
971
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module MetronomeSDK
|
|
2
|
+
module Models
|
|
3
|
+
module V1
|
|
4
|
+
type customer_archive_billing_configurations_params =
|
|
5
|
+
{
|
|
6
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
7
|
+
customer_id: String
|
|
8
|
+
}
|
|
9
|
+
& MetronomeSDK::Internal::Type::request_parameters
|
|
10
|
+
|
|
11
|
+
class CustomerArchiveBillingConfigurationsParams < MetronomeSDK::Internal::Type::BaseModel
|
|
12
|
+
extend MetronomeSDK::Internal::Type::RequestParameters::Converter
|
|
13
|
+
include MetronomeSDK::Internal::Type::RequestParameters
|
|
14
|
+
|
|
15
|
+
attr_accessor customer_billing_provider_configuration_ids: ::Array[String]
|
|
16
|
+
|
|
17
|
+
attr_accessor customer_id: String
|
|
18
|
+
|
|
19
|
+
def initialize: (
|
|
20
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
21
|
+
customer_id: String,
|
|
22
|
+
?request_options: MetronomeSDK::request_opts
|
|
23
|
+
) -> void
|
|
24
|
+
|
|
25
|
+
def to_hash: -> {
|
|
26
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
27
|
+
customer_id: String,
|
|
28
|
+
request_options: MetronomeSDK::RequestOptions
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module MetronomeSDK
|
|
2
|
+
module Models
|
|
3
|
+
module V1
|
|
4
|
+
type customer_archive_billing_configurations_response =
|
|
5
|
+
{
|
|
6
|
+
data: MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class CustomerArchiveBillingConfigurationsResponse < MetronomeSDK::Internal::Type::BaseModel
|
|
10
|
+
attr_accessor data: MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
data: MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data
|
|
14
|
+
) -> void
|
|
15
|
+
|
|
16
|
+
def to_hash: -> {
|
|
17
|
+
data: MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse::Data
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type data =
|
|
21
|
+
{
|
|
22
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
23
|
+
customer_id: String
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class Data < MetronomeSDK::Internal::Type::BaseModel
|
|
27
|
+
attr_accessor customer_billing_provider_configuration_ids: ::Array[String]
|
|
28
|
+
|
|
29
|
+
attr_accessor customer_id: String
|
|
30
|
+
|
|
31
|
+
def initialize: (
|
|
32
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
33
|
+
customer_id: String
|
|
34
|
+
) -> void
|
|
35
|
+
|
|
36
|
+
def to_hash: -> {
|
|
37
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
38
|
+
customer_id: String
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -936,6 +936,7 @@ module MetronomeSDK
|
|
|
936
936
|
netsuite_sales_order_id: String,
|
|
937
937
|
priority: Float,
|
|
938
938
|
rate_type: MetronomeSDK::Models::V2::ContractEditParams::AddCredit::rate_type,
|
|
939
|
+
rollover_fraction: Float,
|
|
939
940
|
specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
940
941
|
}
|
|
941
942
|
|
|
@@ -984,6 +985,10 @@ module MetronomeSDK
|
|
|
984
985
|
MetronomeSDK::Models::V2::ContractEditParams::AddCredit::rate_type
|
|
985
986
|
) -> MetronomeSDK::Models::V2::ContractEditParams::AddCredit::rate_type
|
|
986
987
|
|
|
988
|
+
attr_reader rollover_fraction: Float?
|
|
989
|
+
|
|
990
|
+
def rollover_fraction=: (Float) -> Float
|
|
991
|
+
|
|
987
992
|
attr_reader specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]?
|
|
988
993
|
|
|
989
994
|
def specifiers=: (
|
|
@@ -1002,6 +1007,7 @@ module MetronomeSDK
|
|
|
1002
1007
|
?netsuite_sales_order_id: String,
|
|
1003
1008
|
?priority: Float,
|
|
1004
1009
|
?rate_type: MetronomeSDK::Models::V2::ContractEditParams::AddCredit::rate_type,
|
|
1010
|
+
?rollover_fraction: Float,
|
|
1005
1011
|
?specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
1006
1012
|
) -> void
|
|
1007
1013
|
|
|
@@ -1017,6 +1023,7 @@ module MetronomeSDK
|
|
|
1017
1023
|
netsuite_sales_order_id: String,
|
|
1018
1024
|
priority: Float,
|
|
1019
1025
|
rate_type: MetronomeSDK::Models::V2::ContractEditParams::AddCredit::rate_type,
|
|
1026
|
+
rollover_fraction: Float,
|
|
1020
1027
|
specifiers: ::Array[MetronomeSDK::CommitSpecifierInput]
|
|
1021
1028
|
}
|
|
1022
1029
|
|
|
@@ -3366,7 +3373,8 @@ module MetronomeSDK
|
|
|
3366
3373
|
netsuite_sales_order_id: String?,
|
|
3367
3374
|
priority: Float?,
|
|
3368
3375
|
product_id: String,
|
|
3369
|
-
rate_type: MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type
|
|
3376
|
+
rate_type: MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type,
|
|
3377
|
+
rollover_fraction: Float?
|
|
3370
3378
|
}
|
|
3371
3379
|
|
|
3372
3380
|
class UpdateCredit < MetronomeSDK::Internal::Type::BaseModel
|
|
@@ -3410,6 +3418,8 @@ module MetronomeSDK
|
|
|
3410
3418
|
MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type
|
|
3411
3419
|
) -> MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type
|
|
3412
3420
|
|
|
3421
|
+
attr_accessor rollover_fraction: Float?
|
|
3422
|
+
|
|
3413
3423
|
def initialize: (
|
|
3414
3424
|
credit_id: String,
|
|
3415
3425
|
?access_schedule: MetronomeSDK::V2::ContractEditParams::UpdateCredit::AccessSchedule,
|
|
@@ -3421,7 +3431,8 @@ module MetronomeSDK
|
|
|
3421
3431
|
?netsuite_sales_order_id: String?,
|
|
3422
3432
|
?priority: Float?,
|
|
3423
3433
|
?product_id: String,
|
|
3424
|
-
?rate_type: MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type
|
|
3434
|
+
?rate_type: MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type,
|
|
3435
|
+
?rollover_fraction: Float?
|
|
3425
3436
|
) -> void
|
|
3426
3437
|
|
|
3427
3438
|
def to_hash: -> {
|
|
@@ -3435,7 +3446,8 @@ module MetronomeSDK
|
|
|
3435
3446
|
netsuite_sales_order_id: String?,
|
|
3436
3447
|
priority: Float?,
|
|
3437
3448
|
product_id: String,
|
|
3438
|
-
rate_type: MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type
|
|
3449
|
+
rate_type: MetronomeSDK::Models::V2::ContractEditParams::UpdateCredit::rate_type,
|
|
3450
|
+
rollover_fraction: Float?
|
|
3439
3451
|
}
|
|
3440
3452
|
|
|
3441
3453
|
type access_schedule =
|
|
@@ -47,6 +47,12 @@ module MetronomeSDK
|
|
|
47
47
|
?request_options: MetronomeSDK::request_opts
|
|
48
48
|
) -> MetronomeSDK::Models::V1::CustomerArchiveResponse
|
|
49
49
|
|
|
50
|
+
def archive_billing_configurations: (
|
|
51
|
+
customer_billing_provider_configuration_ids: ::Array[String],
|
|
52
|
+
customer_id: String,
|
|
53
|
+
?request_options: MetronomeSDK::request_opts
|
|
54
|
+
) -> MetronomeSDK::Models::V1::CustomerArchiveBillingConfigurationsResponse
|
|
55
|
+
|
|
50
56
|
def list_billable_metrics: (
|
|
51
57
|
customer_id: String,
|
|
52
58
|
?include_archived: bool,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metronome-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Metronome
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -207,6 +207,8 @@ files:
|
|
|
207
207
|
- lib/metronome_sdk/models/v1/custom_field_remove_key_params.rb
|
|
208
208
|
- lib/metronome_sdk/models/v1/custom_field_set_values_params.rb
|
|
209
209
|
- lib/metronome_sdk/models/v1/customer.rb
|
|
210
|
+
- lib/metronome_sdk/models/v1/customer_archive_billing_configurations_params.rb
|
|
211
|
+
- lib/metronome_sdk/models/v1/customer_archive_billing_configurations_response.rb
|
|
210
212
|
- lib/metronome_sdk/models/v1/customer_archive_params.rb
|
|
211
213
|
- lib/metronome_sdk/models/v1/customer_archive_response.rb
|
|
212
214
|
- lib/metronome_sdk/models/v1/customer_create_params.rb
|
|
@@ -524,6 +526,8 @@ files:
|
|
|
524
526
|
- rbi/metronome_sdk/models/v1/custom_field_remove_key_params.rbi
|
|
525
527
|
- rbi/metronome_sdk/models/v1/custom_field_set_values_params.rbi
|
|
526
528
|
- rbi/metronome_sdk/models/v1/customer.rbi
|
|
529
|
+
- rbi/metronome_sdk/models/v1/customer_archive_billing_configurations_params.rbi
|
|
530
|
+
- rbi/metronome_sdk/models/v1/customer_archive_billing_configurations_response.rbi
|
|
527
531
|
- rbi/metronome_sdk/models/v1/customer_archive_params.rbi
|
|
528
532
|
- rbi/metronome_sdk/models/v1/customer_archive_response.rbi
|
|
529
533
|
- rbi/metronome_sdk/models/v1/customer_create_params.rbi
|
|
@@ -840,6 +844,8 @@ files:
|
|
|
840
844
|
- sig/metronome_sdk/models/v1/custom_field_remove_key_params.rbs
|
|
841
845
|
- sig/metronome_sdk/models/v1/custom_field_set_values_params.rbs
|
|
842
846
|
- sig/metronome_sdk/models/v1/customer.rbs
|
|
847
|
+
- sig/metronome_sdk/models/v1/customer_archive_billing_configurations_params.rbs
|
|
848
|
+
- sig/metronome_sdk/models/v1/customer_archive_billing_configurations_response.rbs
|
|
843
849
|
- sig/metronome_sdk/models/v1/customer_archive_params.rbs
|
|
844
850
|
- sig/metronome_sdk/models/v1/customer_archive_response.rbs
|
|
845
851
|
- sig/metronome_sdk/models/v1/customer_create_params.rbs
|