dodopayments 1.51.1 → 1.52.5
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 +18 -0
- data/README.md +1 -1
- data/lib/dodopayments/client.rb +8 -0
- data/lib/dodopayments/models/add_meter_to_price.rb +58 -0
- data/lib/dodopayments/models/event.rb +71 -0
- data/lib/dodopayments/models/event_input.rb +70 -0
- data/lib/dodopayments/models/invoices/payment_retrieve_refund_params.rb +16 -0
- data/lib/dodopayments/models/meter.rb +88 -0
- data/lib/dodopayments/models/meter_aggregation.rb +39 -0
- data/lib/dodopayments/models/meter_archive_params.rb +14 -0
- data/lib/dodopayments/models/meter_create_params.rb +62 -0
- data/lib/dodopayments/models/meter_filter.rb +482 -0
- data/lib/dodopayments/models/meter_list_params.rb +38 -0
- data/lib/dodopayments/models/{product_delete_params.rb → meter_retrieve_params.rb} +2 -2
- data/lib/dodopayments/models/meter_unarchive_params.rb +14 -0
- data/lib/dodopayments/models/payment.rb +10 -1
- data/lib/dodopayments/models/price.rb +122 -7
- data/lib/dodopayments/models/product.rb +2 -2
- data/lib/dodopayments/models/product_archive_params.rb +14 -0
- data/lib/dodopayments/models/product_create_params.rb +2 -2
- data/lib/dodopayments/models/product_list_response.rb +2 -2
- data/lib/dodopayments/models/product_update_params.rb +2 -2
- data/lib/dodopayments/models/subscription.rb +57 -1
- data/lib/dodopayments/models/subscription_retrieve_usage_history_params.rb +54 -0
- data/lib/dodopayments/models/subscription_retrieve_usage_history_response.rb +101 -0
- data/lib/dodopayments/models/usage_event_ingest_params.rb +22 -0
- data/lib/dodopayments/models/usage_event_ingest_response.rb +16 -0
- data/lib/dodopayments/models/usage_event_list_params.rb +75 -0
- data/lib/dodopayments/models/usage_event_retrieve_params.rb +14 -0
- data/lib/dodopayments/models.rb +32 -2
- data/lib/dodopayments/resources/invoices/payments.rb +18 -0
- data/lib/dodopayments/resources/meters.rb +123 -0
- data/lib/dodopayments/resources/products.rb +5 -5
- data/lib/dodopayments/resources/subscriptions.rb +74 -0
- data/lib/dodopayments/resources/usage_events.rb +193 -0
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +21 -1
- data/rbi/dodopayments/client.rbi +6 -0
- data/rbi/dodopayments/models/add_meter_to_price.rbi +75 -0
- data/rbi/dodopayments/models/event.rbi +88 -0
- data/rbi/dodopayments/models/event_input.rbi +102 -0
- data/rbi/dodopayments/models/invoices/payment_retrieve_refund_params.rbi +34 -0
- data/rbi/dodopayments/models/meter.rbi +107 -0
- data/rbi/dodopayments/models/meter_aggregation.rbi +68 -0
- data/rbi/dodopayments/models/meter_archive_params.rbi +32 -0
- data/rbi/dodopayments/models/meter_create_params.rbi +92 -0
- data/rbi/dodopayments/models/meter_filter.rbi +1042 -0
- data/rbi/dodopayments/models/meter_list_params.rbi +68 -0
- data/rbi/dodopayments/models/{product_delete_params.rbi → meter_retrieve_params.rbi} +2 -2
- data/rbi/dodopayments/models/meter_unarchive_params.rbi +32 -0
- data/rbi/dodopayments/models/payment.rbi +10 -0
- data/rbi/dodopayments/models/price.rbi +153 -7
- data/rbi/dodopayments/models/product.rbi +2 -1
- data/rbi/dodopayments/models/product_archive_params.rbi +32 -0
- data/rbi/dodopayments/models/product_create_params.rbi +6 -3
- data/rbi/dodopayments/models/product_list_response.rbi +2 -1
- data/rbi/dodopayments/models/product_update_params.rbi +6 -3
- data/rbi/dodopayments/models/subscription.rbi +78 -0
- data/rbi/dodopayments/models/subscription_retrieve_usage_history_params.rbi +78 -0
- data/rbi/dodopayments/models/subscription_retrieve_usage_history_response.rbi +159 -0
- data/rbi/dodopayments/models/usage_event_ingest_params.rbi +46 -0
- data/rbi/dodopayments/models/usage_event_ingest_response.rbi +26 -0
- data/rbi/dodopayments/models/usage_event_list_params.rbi +119 -0
- data/rbi/dodopayments/models/usage_event_retrieve_params.rbi +32 -0
- data/rbi/dodopayments/models.rbi +33 -2
- data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
- data/rbi/dodopayments/resources/meters.rbi +102 -0
- data/rbi/dodopayments/resources/products.rbi +5 -3
- data/rbi/dodopayments/resources/subscriptions.rbi +74 -0
- data/rbi/dodopayments/resources/usage_events.rbi +175 -0
- data/sig/dodopayments/client.rbs +4 -0
- data/sig/dodopayments/models/add_meter_to_price.rbs +45 -0
- data/sig/dodopayments/models/event.rbs +53 -0
- data/sig/dodopayments/models/event_input.rbs +48 -0
- data/sig/dodopayments/models/invoices/payment_retrieve_refund_params.rbs +17 -0
- data/sig/dodopayments/models/meter.rbs +65 -0
- data/sig/dodopayments/models/meter_aggregation.rbs +35 -0
- data/sig/dodopayments/models/meter_archive_params.rbs +15 -0
- data/sig/dodopayments/models/meter_create_params.rbs +51 -0
- data/sig/dodopayments/models/meter_filter.rbs +417 -0
- data/sig/dodopayments/models/meter_list_params.rbs +38 -0
- data/sig/dodopayments/models/{product_delete_params.rbs → meter_retrieve_params.rbs} +2 -2
- data/sig/dodopayments/models/meter_unarchive_params.rbs +15 -0
- data/sig/dodopayments/models/payment.rbs +5 -0
- data/sig/dodopayments/models/price.rbs +88 -9
- data/sig/dodopayments/models/product_archive_params.rbs +15 -0
- data/sig/dodopayments/models/subscription.rbs +52 -0
- data/sig/dodopayments/models/subscription_retrieve_usage_history_params.rbs +46 -0
- data/sig/dodopayments/models/subscription_retrieve_usage_history_response.rbs +82 -0
- data/sig/dodopayments/models/usage_event_ingest_params.rbs +24 -0
- data/sig/dodopayments/models/usage_event_ingest_response.rbs +13 -0
- data/sig/dodopayments/models/usage_event_list_params.rbs +70 -0
- data/sig/dodopayments/models/usage_event_retrieve_params.rbs +15 -0
- data/sig/dodopayments/models.rbs +32 -2
- data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
- data/sig/dodopayments/resources/meters.rbs +39 -0
- data/sig/dodopayments/resources/products.rbs +1 -1
- data/sig/dodopayments/resources/subscriptions.rbs +10 -0
- data/sig/dodopayments/resources/usage_events.rbs +28 -0
- metadata +65 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90035c1d14b5aa55b3c8e33db01257b8f45bb2636259d2aca65d08f77a8303b2
|
4
|
+
data.tar.gz: 17bb0b417c9f606ee48df9a06bec7ecf9b8d7b1985146d6c03190509aeddc775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 193a65895d8e20cf1f818a6ea8f725a00a0bffefeaaf46def43ec2f1c64fb4662e1c845cda63e72fa4f4df6e4ecbd485fe4153ddc4c7ea6d4333380002300b6a
|
7
|
+
data.tar.gz: 6a50f094b283c7d173271bba624b2cd95346f9519dc9f051d404e90852def09a57011afdb47f7765057cb915cf3197f8651e5109ea9cac8f09a85ab45791b4c6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.52.5 (2025-09-04)
|
4
|
+
|
5
|
+
Full Changelog: [v1.52.4...v1.52.5](https://github.com/dodopayments/dodopayments-ruby/compare/v1.52.4...v1.52.5)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** updated openapi spec to v1.52.4 ([49331b8](https://github.com/dodopayments/dodopayments-ruby/commit/49331b8c97f7995f20e6428fb6d0e2f8f567273e))
|
10
|
+
|
11
|
+
## 1.52.4 (2025-09-03)
|
12
|
+
|
13
|
+
Full Changelog: [v1.51.1...v1.52.4](https://github.com/dodopayments/dodopayments-ruby/compare/v1.51.1...v1.52.4)
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
* **api:** manual updates ([0dd3323](https://github.com/dodopayments/dodopayments-ruby/commit/0dd3323b773634410a377238bf3d3d7fadac0d12))
|
18
|
+
* **api:** updated openapi spec ([c338d93](https://github.com/dodopayments/dodopayments-ruby/commit/c338d93bcded89768cc1b92410496b7acf6db609))
|
19
|
+
* updated openapi spec and added model and API functions for Usage Based Billing ([54d898a](https://github.com/dodopayments/dodopayments-ruby/commit/54d898a1cd82cb37a2877dfb2838f6f9e5209943))
|
20
|
+
|
3
21
|
## 1.51.1 (2025-08-25)
|
4
22
|
|
5
23
|
Full Changelog: [v1.51.0...v1.51.1](https://github.com/dodopayments/dodopayments-ruby/compare/v1.51.0...v1.51.1)
|
data/README.md
CHANGED
data/lib/dodopayments/client.rb
CHANGED
@@ -78,6 +78,12 @@ module Dodopayments
|
|
78
78
|
# @return [Dodopayments::Resources::Webhooks]
|
79
79
|
attr_reader :webhooks
|
80
80
|
|
81
|
+
# @return [Dodopayments::Resources::UsageEvents]
|
82
|
+
attr_reader :usage_events
|
83
|
+
|
84
|
+
# @return [Dodopayments::Resources::Meters]
|
85
|
+
attr_reader :meters
|
86
|
+
|
81
87
|
# @api private
|
82
88
|
#
|
83
89
|
# @return [Hash{String=>String}]
|
@@ -154,6 +160,8 @@ module Dodopayments
|
|
154
160
|
@addons = Dodopayments::Resources::Addons.new(client: self)
|
155
161
|
@brands = Dodopayments::Resources::Brands.new(client: self)
|
156
162
|
@webhooks = Dodopayments::Resources::Webhooks.new(client: self)
|
163
|
+
@usage_events = Dodopayments::Resources::UsageEvents.new(client: self)
|
164
|
+
@meters = Dodopayments::Resources::Meters.new(client: self)
|
157
165
|
end
|
158
166
|
end
|
159
167
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class AddMeterToPrice < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# @!attribute meter_id
|
7
|
+
#
|
8
|
+
# @return [String]
|
9
|
+
required :meter_id, String
|
10
|
+
|
11
|
+
# @!attribute price_per_unit
|
12
|
+
# The price per unit in lowest denomination. Must be greater than zero. Supports
|
13
|
+
# up to 5 digits before decimal point and 12 decimal places.
|
14
|
+
#
|
15
|
+
# @return [String]
|
16
|
+
required :price_per_unit, String
|
17
|
+
|
18
|
+
# @!attribute description
|
19
|
+
# Meter description. Will ignored on Request, but will be shown in response
|
20
|
+
#
|
21
|
+
# @return [String, nil]
|
22
|
+
optional :description, String, nil?: true
|
23
|
+
|
24
|
+
# @!attribute free_threshold
|
25
|
+
#
|
26
|
+
# @return [Integer, nil]
|
27
|
+
optional :free_threshold, Integer, nil?: true
|
28
|
+
|
29
|
+
# @!attribute measurement_unit
|
30
|
+
# Meter measurement unit. Will ignored on Request, but will be shown in response
|
31
|
+
#
|
32
|
+
# @return [String, nil]
|
33
|
+
optional :measurement_unit, String, nil?: true
|
34
|
+
|
35
|
+
# @!attribute name
|
36
|
+
# Meter name. Will ignored on Request, but will be shown in response
|
37
|
+
#
|
38
|
+
# @return [String, nil]
|
39
|
+
optional :name, String, nil?: true
|
40
|
+
|
41
|
+
# @!method initialize(meter_id:, price_per_unit:, description: nil, free_threshold: nil, measurement_unit: nil, name: nil)
|
42
|
+
# Some parameter documentations has been truncated, see
|
43
|
+
# {Dodopayments::Models::AddMeterToPrice} for more details.
|
44
|
+
#
|
45
|
+
# @param meter_id [String]
|
46
|
+
#
|
47
|
+
# @param price_per_unit [String] The price per unit in lowest denomination. Must be greater than zero. Supports u
|
48
|
+
#
|
49
|
+
# @param description [String, nil] Meter description. Will ignored on Request, but will be shown in response
|
50
|
+
#
|
51
|
+
# @param free_threshold [Integer, nil]
|
52
|
+
#
|
53
|
+
# @param measurement_unit [String, nil] Meter measurement unit. Will ignored on Request, but will be shown in response
|
54
|
+
#
|
55
|
+
# @param name [String, nil] Meter name. Will ignored on Request, but will be shown in response
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::UsageEvents#retrieve
|
6
|
+
class Event < Dodopayments::Internal::Type::BaseModel
|
7
|
+
# @!attribute business_id
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :business_id, String
|
11
|
+
|
12
|
+
# @!attribute customer_id
|
13
|
+
#
|
14
|
+
# @return [String]
|
15
|
+
required :customer_id, String
|
16
|
+
|
17
|
+
# @!attribute event_id
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
required :event_id, String
|
21
|
+
|
22
|
+
# @!attribute event_name
|
23
|
+
#
|
24
|
+
# @return [String]
|
25
|
+
required :event_name, String
|
26
|
+
|
27
|
+
# @!attribute timestamp
|
28
|
+
#
|
29
|
+
# @return [Time]
|
30
|
+
required :timestamp, Time
|
31
|
+
|
32
|
+
# @!attribute metadata
|
33
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
34
|
+
#
|
35
|
+
# @return [Hash{Symbol=>String, Float, Boolean}, nil]
|
36
|
+
optional :metadata,
|
37
|
+
-> { Dodopayments::Internal::Type::HashOf[union: Dodopayments::Event::Metadata] },
|
38
|
+
nil?: true
|
39
|
+
|
40
|
+
# @!method initialize(business_id:, customer_id:, event_id:, event_name:, timestamp:, metadata: nil)
|
41
|
+
# Some parameter documentations has been truncated, see
|
42
|
+
# {Dodopayments::Models::Event} for more details.
|
43
|
+
#
|
44
|
+
# @param business_id [String]
|
45
|
+
#
|
46
|
+
# @param customer_id [String]
|
47
|
+
#
|
48
|
+
# @param event_id [String]
|
49
|
+
#
|
50
|
+
# @param event_name [String]
|
51
|
+
#
|
52
|
+
# @param timestamp [Time]
|
53
|
+
#
|
54
|
+
# @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
55
|
+
|
56
|
+
# Metadata value can be a string, integer, number, or boolean
|
57
|
+
module Metadata
|
58
|
+
extend Dodopayments::Internal::Type::Union
|
59
|
+
|
60
|
+
variant String
|
61
|
+
|
62
|
+
variant Float
|
63
|
+
|
64
|
+
variant Dodopayments::Internal::Type::Boolean
|
65
|
+
|
66
|
+
# @!method self.variants
|
67
|
+
# @return [Array(String, Float, Boolean)]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class EventInput < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# @!attribute customer_id
|
7
|
+
# customer_id of the customer whose usage needs to be tracked
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :customer_id, String
|
11
|
+
|
12
|
+
# @!attribute event_id
|
13
|
+
# Event Id acts as an idempotency key. Any subsequent requests with the same
|
14
|
+
# event_id will be ignored
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :event_id, String
|
18
|
+
|
19
|
+
# @!attribute event_name
|
20
|
+
# Name of the event
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :event_name, String
|
24
|
+
|
25
|
+
# @!attribute metadata
|
26
|
+
# Custom metadata. Only key value pairs are accepted, objects or arrays submitted
|
27
|
+
# will be rejected.
|
28
|
+
#
|
29
|
+
# @return [Hash{Symbol=>String, Float, Boolean}, nil]
|
30
|
+
optional :metadata,
|
31
|
+
-> { Dodopayments::Internal::Type::HashOf[union: Dodopayments::EventInput::Metadata] },
|
32
|
+
nil?: true
|
33
|
+
|
34
|
+
# @!attribute timestamp
|
35
|
+
# Custom Timestamp. Defaults to current timestamp in UTC. Timestamps that are
|
36
|
+
# older that 1 hour or after 5 mins, from current timestamp, will be rejected.
|
37
|
+
#
|
38
|
+
# @return [Time, nil]
|
39
|
+
optional :timestamp, Time, nil?: true
|
40
|
+
|
41
|
+
# @!method initialize(customer_id:, event_id:, event_name:, metadata: nil, timestamp: nil)
|
42
|
+
# Some parameter documentations has been truncated, see
|
43
|
+
# {Dodopayments::Models::EventInput} for more details.
|
44
|
+
#
|
45
|
+
# @param customer_id [String] customer_id of the customer whose usage needs to be tracked
|
46
|
+
#
|
47
|
+
# @param event_id [String] Event Id acts as an idempotency key. Any subsequent requests with the same event
|
48
|
+
#
|
49
|
+
# @param event_name [String] Name of the event
|
50
|
+
#
|
51
|
+
# @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Custom metadata. Only key value pairs are accepted, objects or arrays submitted
|
52
|
+
#
|
53
|
+
# @param timestamp [Time, nil] Custom Timestamp. Defaults to current timestamp in UTC.
|
54
|
+
|
55
|
+
# Metadata value can be a string, integer, number, or boolean
|
56
|
+
module Metadata
|
57
|
+
extend Dodopayments::Internal::Type::Union
|
58
|
+
|
59
|
+
variant String
|
60
|
+
|
61
|
+
variant Float
|
62
|
+
|
63
|
+
variant Dodopayments::Internal::Type::Boolean
|
64
|
+
|
65
|
+
# @!method self.variants
|
66
|
+
# @return [Array(String, Float, Boolean)]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
module Invoices
|
6
|
+
# @see Dodopayments::Resources::Invoices::Payments#retrieve_refund
|
7
|
+
class PaymentRetrieveRefundParams < Dodopayments::Internal::Type::BaseModel
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
10
|
+
|
11
|
+
# @!method initialize(request_options: {})
|
12
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Meters#create
|
6
|
+
class Meter < Dodopayments::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
required :id, String
|
11
|
+
|
12
|
+
# @!attribute aggregation
|
13
|
+
#
|
14
|
+
# @return [Dodopayments::Models::MeterAggregation]
|
15
|
+
required :aggregation, -> { Dodopayments::MeterAggregation }
|
16
|
+
|
17
|
+
# @!attribute business_id
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
required :business_id, String
|
21
|
+
|
22
|
+
# @!attribute created_at
|
23
|
+
#
|
24
|
+
# @return [Time]
|
25
|
+
required :created_at, Time
|
26
|
+
|
27
|
+
# @!attribute event_name
|
28
|
+
#
|
29
|
+
# @return [String]
|
30
|
+
required :event_name, String
|
31
|
+
|
32
|
+
# @!attribute measurement_unit
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
required :measurement_unit, String
|
36
|
+
|
37
|
+
# @!attribute name
|
38
|
+
#
|
39
|
+
# @return [String]
|
40
|
+
required :name, String
|
41
|
+
|
42
|
+
# @!attribute updated_at
|
43
|
+
#
|
44
|
+
# @return [Time]
|
45
|
+
required :updated_at, Time
|
46
|
+
|
47
|
+
# @!attribute description
|
48
|
+
#
|
49
|
+
# @return [String, nil]
|
50
|
+
optional :description, String, nil?: true
|
51
|
+
|
52
|
+
# @!attribute filter
|
53
|
+
# A filter structure that combines multiple conditions with logical conjunctions
|
54
|
+
# (AND/OR).
|
55
|
+
#
|
56
|
+
# Supports up to 3 levels of nesting to create complex filter expressions. Each
|
57
|
+
# filter has a conjunction (and/or) and clauses that can be either direct
|
58
|
+
# conditions or nested filters.
|
59
|
+
#
|
60
|
+
# @return [Dodopayments::Models::MeterFilter, nil]
|
61
|
+
optional :filter, -> { Dodopayments::MeterFilter }, nil?: true
|
62
|
+
|
63
|
+
# @!method initialize(id:, aggregation:, business_id:, created_at:, event_name:, measurement_unit:, name:, updated_at:, description: nil, filter: nil)
|
64
|
+
# Some parameter documentations has been truncated, see
|
65
|
+
# {Dodopayments::Models::Meter} for more details.
|
66
|
+
#
|
67
|
+
# @param id [String]
|
68
|
+
#
|
69
|
+
# @param aggregation [Dodopayments::Models::MeterAggregation]
|
70
|
+
#
|
71
|
+
# @param business_id [String]
|
72
|
+
#
|
73
|
+
# @param created_at [Time]
|
74
|
+
#
|
75
|
+
# @param event_name [String]
|
76
|
+
#
|
77
|
+
# @param measurement_unit [String]
|
78
|
+
#
|
79
|
+
# @param name [String]
|
80
|
+
#
|
81
|
+
# @param updated_at [Time]
|
82
|
+
#
|
83
|
+
# @param description [String, nil]
|
84
|
+
#
|
85
|
+
# @param filter [Dodopayments::Models::MeterFilter, nil] A filter structure that combines multiple conditions with logical conjunctions (
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
class MeterAggregation < Dodopayments::Internal::Type::BaseModel
|
6
|
+
# @!attribute type
|
7
|
+
# Aggregation type for the meter
|
8
|
+
#
|
9
|
+
# @return [Symbol, Dodopayments::Models::MeterAggregation::Type]
|
10
|
+
required :type, enum: -> { Dodopayments::MeterAggregation::Type }
|
11
|
+
|
12
|
+
# @!attribute key
|
13
|
+
# Required when type is not COUNT
|
14
|
+
#
|
15
|
+
# @return [String, nil]
|
16
|
+
optional :key, String, nil?: true
|
17
|
+
|
18
|
+
# @!method initialize(type:, key: nil)
|
19
|
+
# @param type [Symbol, Dodopayments::Models::MeterAggregation::Type] Aggregation type for the meter
|
20
|
+
#
|
21
|
+
# @param key [String, nil] Required when type is not COUNT
|
22
|
+
|
23
|
+
# Aggregation type for the meter
|
24
|
+
#
|
25
|
+
# @see Dodopayments::Models::MeterAggregation#type
|
26
|
+
module Type
|
27
|
+
extend Dodopayments::Internal::Type::Enum
|
28
|
+
|
29
|
+
COUNT = :count
|
30
|
+
SUM = :sum
|
31
|
+
MAX = :max
|
32
|
+
LAST = :last
|
33
|
+
|
34
|
+
# @!method self.values
|
35
|
+
# @return [Array<Symbol>]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Meters#archive
|
6
|
+
class MeterArchiveParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!method initialize(request_options: {})
|
11
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dodopayments
|
4
|
+
module Models
|
5
|
+
# @see Dodopayments::Resources::Meters#create
|
6
|
+
class MeterCreateParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute aggregation
|
11
|
+
# Aggregation configuration for the meter
|
12
|
+
#
|
13
|
+
# @return [Dodopayments::Models::MeterAggregation]
|
14
|
+
required :aggregation, -> { Dodopayments::MeterAggregation }
|
15
|
+
|
16
|
+
# @!attribute event_name
|
17
|
+
# Event name to track
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
required :event_name, String
|
21
|
+
|
22
|
+
# @!attribute measurement_unit
|
23
|
+
# measurement unit
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
required :measurement_unit, String
|
27
|
+
|
28
|
+
# @!attribute name
|
29
|
+
# Name of the meter
|
30
|
+
#
|
31
|
+
# @return [String]
|
32
|
+
required :name, String
|
33
|
+
|
34
|
+
# @!attribute description
|
35
|
+
# Optional description of the meter
|
36
|
+
#
|
37
|
+
# @return [String, nil]
|
38
|
+
optional :description, String, nil?: true
|
39
|
+
|
40
|
+
# @!attribute filter
|
41
|
+
# Optional filter to apply to the meter
|
42
|
+
#
|
43
|
+
# @return [Dodopayments::Models::MeterFilter, nil]
|
44
|
+
optional :filter, -> { Dodopayments::MeterFilter }, nil?: true
|
45
|
+
|
46
|
+
# @!method initialize(aggregation:, event_name:, measurement_unit:, name:, description: nil, filter: nil, request_options: {})
|
47
|
+
# @param aggregation [Dodopayments::Models::MeterAggregation] Aggregation configuration for the meter
|
48
|
+
#
|
49
|
+
# @param event_name [String] Event name to track
|
50
|
+
#
|
51
|
+
# @param measurement_unit [String] measurement unit
|
52
|
+
#
|
53
|
+
# @param name [String] Name of the meter
|
54
|
+
#
|
55
|
+
# @param description [String, nil] Optional description of the meter
|
56
|
+
#
|
57
|
+
# @param filter [Dodopayments::Models::MeterFilter, nil] Optional filter to apply to the meter
|
58
|
+
#
|
59
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|