dodopayments 1.51.0 → 1.52.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +8 -0
  5. data/lib/dodopayments/models/add_meter_to_price.rb +58 -0
  6. data/lib/dodopayments/models/event.rb +71 -0
  7. data/lib/dodopayments/models/event_input.rb +70 -0
  8. data/lib/dodopayments/models/invoices/payment_retrieve_refund_params.rb +16 -0
  9. data/lib/dodopayments/models/meter.rb +88 -0
  10. data/lib/dodopayments/models/meter_aggregation.rb +40 -0
  11. data/lib/dodopayments/models/meter_archive_params.rb +14 -0
  12. data/lib/dodopayments/models/meter_create_params.rb +62 -0
  13. data/lib/dodopayments/models/meter_filter.rb +482 -0
  14. data/lib/dodopayments/models/meter_list_params.rb +38 -0
  15. data/lib/dodopayments/models/{product_delete_params.rb → meter_retrieve_params.rb} +2 -2
  16. data/lib/dodopayments/models/meter_unarchive_params.rb +14 -0
  17. data/lib/dodopayments/models/price.rb +122 -7
  18. data/lib/dodopayments/models/product.rb +2 -2
  19. data/lib/dodopayments/models/product_archive_params.rb +14 -0
  20. data/lib/dodopayments/models/product_create_params.rb +2 -2
  21. data/lib/dodopayments/models/product_list_response.rb +2 -2
  22. data/lib/dodopayments/models/product_update_params.rb +2 -2
  23. data/lib/dodopayments/models/subscription_retrieve_usage_history_params.rb +54 -0
  24. data/lib/dodopayments/models/subscription_retrieve_usage_history_response.rb +101 -0
  25. data/lib/dodopayments/models/usage_event_ingest_params.rb +22 -0
  26. data/lib/dodopayments/models/usage_event_ingest_response.rb +16 -0
  27. data/lib/dodopayments/models/usage_event_list_params.rb +75 -0
  28. data/lib/dodopayments/models/usage_event_retrieve_params.rb +14 -0
  29. data/lib/dodopayments/models.rb +32 -2
  30. data/lib/dodopayments/resources/invoices/payments.rb +18 -0
  31. data/lib/dodopayments/resources/meters.rb +123 -0
  32. data/lib/dodopayments/resources/products.rb +5 -5
  33. data/lib/dodopayments/resources/subscriptions.rb +74 -0
  34. data/lib/dodopayments/resources/usage_events.rb +193 -0
  35. data/lib/dodopayments/version.rb +1 -1
  36. data/lib/dodopayments.rb +21 -1
  37. data/rbi/dodopayments/client.rbi +6 -0
  38. data/rbi/dodopayments/models/add_meter_to_price.rbi +75 -0
  39. data/rbi/dodopayments/models/event.rbi +88 -0
  40. data/rbi/dodopayments/models/event_input.rbi +102 -0
  41. data/rbi/dodopayments/models/invoices/payment_retrieve_refund_params.rbi +34 -0
  42. data/rbi/dodopayments/models/meter.rbi +107 -0
  43. data/rbi/dodopayments/models/meter_aggregation.rbi +73 -0
  44. data/rbi/dodopayments/models/meter_archive_params.rbi +32 -0
  45. data/rbi/dodopayments/models/meter_create_params.rbi +92 -0
  46. data/rbi/dodopayments/models/meter_filter.rbi +1042 -0
  47. data/rbi/dodopayments/models/meter_list_params.rbi +68 -0
  48. data/rbi/dodopayments/models/{product_delete_params.rbi → meter_retrieve_params.rbi} +2 -2
  49. data/rbi/dodopayments/models/meter_unarchive_params.rbi +32 -0
  50. data/rbi/dodopayments/models/price.rbi +153 -7
  51. data/rbi/dodopayments/models/product.rbi +2 -1
  52. data/rbi/dodopayments/models/product_archive_params.rbi +32 -0
  53. data/rbi/dodopayments/models/product_create_params.rbi +6 -3
  54. data/rbi/dodopayments/models/product_list_response.rbi +2 -1
  55. data/rbi/dodopayments/models/product_update_params.rbi +6 -3
  56. data/rbi/dodopayments/models/subscription_retrieve_usage_history_params.rbi +78 -0
  57. data/rbi/dodopayments/models/subscription_retrieve_usage_history_response.rbi +159 -0
  58. data/rbi/dodopayments/models/usage_event_ingest_params.rbi +46 -0
  59. data/rbi/dodopayments/models/usage_event_ingest_response.rbi +26 -0
  60. data/rbi/dodopayments/models/usage_event_list_params.rbi +119 -0
  61. data/rbi/dodopayments/models/usage_event_retrieve_params.rbi +32 -0
  62. data/rbi/dodopayments/models.rbi +33 -2
  63. data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
  64. data/rbi/dodopayments/resources/meters.rbi +102 -0
  65. data/rbi/dodopayments/resources/products.rbi +5 -3
  66. data/rbi/dodopayments/resources/subscriptions.rbi +74 -0
  67. data/rbi/dodopayments/resources/usage_events.rbi +175 -0
  68. data/sig/dodopayments/client.rbs +4 -0
  69. data/sig/dodopayments/models/add_meter_to_price.rbs +45 -0
  70. data/sig/dodopayments/models/event.rbs +53 -0
  71. data/sig/dodopayments/models/event_input.rbs +48 -0
  72. data/sig/dodopayments/models/invoices/payment_retrieve_refund_params.rbs +17 -0
  73. data/sig/dodopayments/models/meter.rbs +65 -0
  74. data/sig/dodopayments/models/meter_aggregation.rbs +36 -0
  75. data/sig/dodopayments/models/meter_archive_params.rbs +15 -0
  76. data/sig/dodopayments/models/meter_create_params.rbs +51 -0
  77. data/sig/dodopayments/models/meter_filter.rbs +417 -0
  78. data/sig/dodopayments/models/meter_list_params.rbs +38 -0
  79. data/sig/dodopayments/models/{product_delete_params.rbs → meter_retrieve_params.rbs} +2 -2
  80. data/sig/dodopayments/models/meter_unarchive_params.rbs +15 -0
  81. data/sig/dodopayments/models/price.rbs +88 -9
  82. data/sig/dodopayments/models/product_archive_params.rbs +15 -0
  83. data/sig/dodopayments/models/subscription_retrieve_usage_history_params.rbs +46 -0
  84. data/sig/dodopayments/models/subscription_retrieve_usage_history_response.rbs +82 -0
  85. data/sig/dodopayments/models/usage_event_ingest_params.rbs +24 -0
  86. data/sig/dodopayments/models/usage_event_ingest_response.rbs +13 -0
  87. data/sig/dodopayments/models/usage_event_list_params.rbs +70 -0
  88. data/sig/dodopayments/models/usage_event_retrieve_params.rbs +15 -0
  89. data/sig/dodopayments/models.rbs +32 -2
  90. data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
  91. data/sig/dodopayments/resources/meters.rbs +39 -0
  92. data/sig/dodopayments/resources/products.rbs +1 -1
  93. data/sig/dodopayments/resources/subscriptions.rbs +10 -0
  94. data/sig/dodopayments/resources/usage_events.rbs +28 -0
  95. metadata +65 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27b3f4907ed54bf17daf2d0d0b698348ccb9a185922dc5b53238e2a0ecb34ac3
4
- data.tar.gz: a422263192ffa157e37b623c4091e0547b73af221444f82845206c6129d16bfe
3
+ metadata.gz: f8b3375383dfb63c0a529779a6560ff9d2a06b4ee263eab32ef541a378c966d8
4
+ data.tar.gz: 8e20558f9600b21c48a0d8723693fc424b6ecacb65bb978c97c795cd3a38114c
5
5
  SHA512:
6
- metadata.gz: d6931eea775b0bb4a8ca4cdd9cadbc435cfa749807a658eb62b46d18d610d70bfa8a030d11d01eb87a70ffb97ee2ada7e792722c57e62b2bc49c101805fd0843
7
- data.tar.gz: 73cb30d62ed8ebf413366dc102e691603733adf2f1aedd5207e64790e5195920a82f80be81ec958ce99ebe9ff701ddbb0c21f779e94a58c4c6a82291778ea4d3
6
+ metadata.gz: ea75a705c5089e059f612eb7e2eea38a39ac2581fa81d00c36132d6e0046a3f4886144ff995b0d32ce667c79d1b73e226bf3b225e6165c08c9a10976d994a9cc
7
+ data.tar.gz: 657b089c1f4a37dbd0c704f1331f5b6b2b49c8ab003138562b81143a9753be721f9a491ffe0dab3d0361ab457e3c7ab0ba239edf5964cc02cb5876009941e90c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.52.4 (2025-09-03)
4
+
5
+ Full Changelog: [v1.51.1...v1.52.4](https://github.com/dodopayments/dodopayments-ruby/compare/v1.51.1...v1.52.4)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([0dd3323](https://github.com/dodopayments/dodopayments-ruby/commit/0dd3323b773634410a377238bf3d3d7fadac0d12))
10
+ * **api:** updated openapi spec ([c338d93](https://github.com/dodopayments/dodopayments-ruby/commit/c338d93bcded89768cc1b92410496b7acf6db609))
11
+ * updated openapi spec and added model and API functions for Usage Based Billing ([54d898a](https://github.com/dodopayments/dodopayments-ruby/commit/54d898a1cd82cb37a2877dfb2838f6f9e5209943))
12
+
13
+ ## 1.51.1 (2025-08-25)
14
+
15
+ Full Changelog: [v1.51.0...v1.51.1](https://github.com/dodopayments/dodopayments-ruby/compare/v1.51.0...v1.51.1)
16
+
17
+ ### Chores
18
+
19
+ * add json schema comment for rubocop.yml ([86dcdab](https://github.com/dodopayments/dodopayments-ruby/commit/86dcdab494c5262fed8d513ded57ea81fa486885))
20
+
3
21
  ## 1.51.0 (2025-08-22)
4
22
 
5
23
  Full Changelog: [v1.49.0...v1.51.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.49.0...v1.51.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "dodopayments", "~> 1.51.0"
20
+ gem "dodopayments", "~> 1.52.4"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -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,40 @@
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
+ UNIQUE_COUNT = :unique_count
32
+ MAX = :max
33
+ LAST = :last
34
+
35
+ # @!method self.values
36
+ # @return [Array<Symbol>]
37
+ end
38
+ end
39
+ end
40
+ 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