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.
- 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 +40 -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/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_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 +73 -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/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_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 +36 -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/price.rbs +88 -9
- data/sig/dodopayments/models/product_archive_params.rbs +15 -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
data/sig/dodopayments/client.rbs
CHANGED
@@ -51,6 +51,10 @@ module Dodopayments
|
|
51
51
|
|
52
52
|
attr_reader webhooks: Dodopayments::Resources::Webhooks
|
53
53
|
|
54
|
+
attr_reader usage_events: Dodopayments::Resources::UsageEvents
|
55
|
+
|
56
|
+
attr_reader meters: Dodopayments::Resources::Meters
|
57
|
+
|
54
58
|
private def auth_headers: -> ::Hash[String, String]
|
55
59
|
|
56
60
|
def initialize: (
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type add_meter_to_price =
|
4
|
+
{
|
5
|
+
meter_id: String,
|
6
|
+
price_per_unit: String,
|
7
|
+
description: String?,
|
8
|
+
free_threshold: Integer?,
|
9
|
+
measurement_unit: String?,
|
10
|
+
name: String?
|
11
|
+
}
|
12
|
+
|
13
|
+
class AddMeterToPrice < Dodopayments::Internal::Type::BaseModel
|
14
|
+
attr_accessor meter_id: String
|
15
|
+
|
16
|
+
attr_accessor price_per_unit: String
|
17
|
+
|
18
|
+
attr_accessor description: String?
|
19
|
+
|
20
|
+
attr_accessor free_threshold: Integer?
|
21
|
+
|
22
|
+
attr_accessor measurement_unit: String?
|
23
|
+
|
24
|
+
attr_accessor name: String?
|
25
|
+
|
26
|
+
def initialize: (
|
27
|
+
meter_id: String,
|
28
|
+
price_per_unit: String,
|
29
|
+
?description: String?,
|
30
|
+
?free_threshold: Integer?,
|
31
|
+
?measurement_unit: String?,
|
32
|
+
?name: String?
|
33
|
+
) -> void
|
34
|
+
|
35
|
+
def to_hash: -> {
|
36
|
+
meter_id: String,
|
37
|
+
price_per_unit: String,
|
38
|
+
description: String?,
|
39
|
+
free_threshold: Integer?,
|
40
|
+
measurement_unit: String?,
|
41
|
+
name: String?
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type event =
|
4
|
+
{
|
5
|
+
business_id: String,
|
6
|
+
customer_id: String,
|
7
|
+
event_id: String,
|
8
|
+
event_name: String,
|
9
|
+
timestamp: Time,
|
10
|
+
metadata: ::Hash[Symbol, Dodopayments::Models::Event::metadata]?
|
11
|
+
}
|
12
|
+
|
13
|
+
class Event < Dodopayments::Internal::Type::BaseModel
|
14
|
+
attr_accessor business_id: String
|
15
|
+
|
16
|
+
attr_accessor customer_id: String
|
17
|
+
|
18
|
+
attr_accessor event_id: String
|
19
|
+
|
20
|
+
attr_accessor event_name: String
|
21
|
+
|
22
|
+
attr_accessor timestamp: Time
|
23
|
+
|
24
|
+
attr_accessor metadata: ::Hash[Symbol, Dodopayments::Models::Event::metadata]?
|
25
|
+
|
26
|
+
def initialize: (
|
27
|
+
business_id: String,
|
28
|
+
customer_id: String,
|
29
|
+
event_id: String,
|
30
|
+
event_name: String,
|
31
|
+
timestamp: Time,
|
32
|
+
?metadata: ::Hash[Symbol, Dodopayments::Models::Event::metadata]?
|
33
|
+
) -> void
|
34
|
+
|
35
|
+
def to_hash: -> {
|
36
|
+
business_id: String,
|
37
|
+
customer_id: String,
|
38
|
+
event_id: String,
|
39
|
+
event_name: String,
|
40
|
+
timestamp: Time,
|
41
|
+
metadata: ::Hash[Symbol, Dodopayments::Models::Event::metadata]?
|
42
|
+
}
|
43
|
+
|
44
|
+
type metadata = String | Float | bool
|
45
|
+
|
46
|
+
module Metadata
|
47
|
+
extend Dodopayments::Internal::Type::Union
|
48
|
+
|
49
|
+
def self?.variants: -> ::Array[Dodopayments::Models::Event::metadata]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type event_input =
|
4
|
+
{
|
5
|
+
customer_id: String,
|
6
|
+
event_id: String,
|
7
|
+
event_name: String,
|
8
|
+
metadata: ::Hash[Symbol, Dodopayments::Models::EventInput::metadata]?,
|
9
|
+
timestamp: Time?
|
10
|
+
}
|
11
|
+
|
12
|
+
class EventInput < Dodopayments::Internal::Type::BaseModel
|
13
|
+
attr_accessor customer_id: String
|
14
|
+
|
15
|
+
attr_accessor event_id: String
|
16
|
+
|
17
|
+
attr_accessor event_name: String
|
18
|
+
|
19
|
+
attr_accessor metadata: ::Hash[Symbol, Dodopayments::Models::EventInput::metadata]?
|
20
|
+
|
21
|
+
attr_accessor timestamp: Time?
|
22
|
+
|
23
|
+
def initialize: (
|
24
|
+
customer_id: String,
|
25
|
+
event_id: String,
|
26
|
+
event_name: String,
|
27
|
+
?metadata: ::Hash[Symbol, Dodopayments::Models::EventInput::metadata]?,
|
28
|
+
?timestamp: Time?
|
29
|
+
) -> void
|
30
|
+
|
31
|
+
def to_hash: -> {
|
32
|
+
customer_id: String,
|
33
|
+
event_id: String,
|
34
|
+
event_name: String,
|
35
|
+
metadata: ::Hash[Symbol, Dodopayments::Models::EventInput::metadata]?,
|
36
|
+
timestamp: Time?
|
37
|
+
}
|
38
|
+
|
39
|
+
type metadata = String | Float | bool
|
40
|
+
|
41
|
+
module Metadata
|
42
|
+
extend Dodopayments::Internal::Type::Union
|
43
|
+
|
44
|
+
def self?.variants: -> ::Array[Dodopayments::Models::EventInput::metadata]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
module Invoices
|
4
|
+
type payment_retrieve_refund_params =
|
5
|
+
{ } & Dodopayments::Internal::Type::request_parameters
|
6
|
+
|
7
|
+
class PaymentRetrieveRefundParams < Dodopayments::Internal::Type::BaseModel
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
10
|
+
|
11
|
+
def initialize: (?request_options: Dodopayments::request_opts) -> void
|
12
|
+
|
13
|
+
def to_hash: -> { request_options: Dodopayments::RequestOptions }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type meter =
|
4
|
+
{
|
5
|
+
id: String,
|
6
|
+
aggregation: Dodopayments::MeterAggregation,
|
7
|
+
business_id: String,
|
8
|
+
created_at: Time,
|
9
|
+
event_name: String,
|
10
|
+
measurement_unit: String,
|
11
|
+
name: String,
|
12
|
+
updated_at: Time,
|
13
|
+
description: String?,
|
14
|
+
filter: Dodopayments::MeterFilter?
|
15
|
+
}
|
16
|
+
|
17
|
+
class Meter < Dodopayments::Internal::Type::BaseModel
|
18
|
+
attr_accessor id: String
|
19
|
+
|
20
|
+
attr_accessor aggregation: Dodopayments::MeterAggregation
|
21
|
+
|
22
|
+
attr_accessor business_id: String
|
23
|
+
|
24
|
+
attr_accessor created_at: Time
|
25
|
+
|
26
|
+
attr_accessor event_name: String
|
27
|
+
|
28
|
+
attr_accessor measurement_unit: String
|
29
|
+
|
30
|
+
attr_accessor name: String
|
31
|
+
|
32
|
+
attr_accessor updated_at: Time
|
33
|
+
|
34
|
+
attr_accessor description: String?
|
35
|
+
|
36
|
+
attr_accessor filter: Dodopayments::MeterFilter?
|
37
|
+
|
38
|
+
def initialize: (
|
39
|
+
id: String,
|
40
|
+
aggregation: Dodopayments::MeterAggregation,
|
41
|
+
business_id: String,
|
42
|
+
created_at: Time,
|
43
|
+
event_name: String,
|
44
|
+
measurement_unit: String,
|
45
|
+
name: String,
|
46
|
+
updated_at: Time,
|
47
|
+
?description: String?,
|
48
|
+
?filter: Dodopayments::MeterFilter?
|
49
|
+
) -> void
|
50
|
+
|
51
|
+
def to_hash: -> {
|
52
|
+
id: String,
|
53
|
+
aggregation: Dodopayments::MeterAggregation,
|
54
|
+
business_id: String,
|
55
|
+
created_at: Time,
|
56
|
+
event_name: String,
|
57
|
+
measurement_unit: String,
|
58
|
+
name: String,
|
59
|
+
updated_at: Time,
|
60
|
+
description: String?,
|
61
|
+
filter: Dodopayments::MeterFilter?
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type meter_aggregation =
|
4
|
+
{ type: Dodopayments::Models::MeterAggregation::type_, key: String? }
|
5
|
+
|
6
|
+
class MeterAggregation < Dodopayments::Internal::Type::BaseModel
|
7
|
+
attr_accessor type: Dodopayments::Models::MeterAggregation::type_
|
8
|
+
|
9
|
+
attr_accessor key: String?
|
10
|
+
|
11
|
+
def initialize: (
|
12
|
+
type: Dodopayments::Models::MeterAggregation::type_,
|
13
|
+
?key: String?
|
14
|
+
) -> void
|
15
|
+
|
16
|
+
def to_hash: -> {
|
17
|
+
type: Dodopayments::Models::MeterAggregation::type_,
|
18
|
+
key: String?
|
19
|
+
}
|
20
|
+
|
21
|
+
type type_ = :count | :sum | :unique_count | :max | :last
|
22
|
+
|
23
|
+
module Type
|
24
|
+
extend Dodopayments::Internal::Type::Enum
|
25
|
+
|
26
|
+
COUNT: :count
|
27
|
+
SUM: :sum
|
28
|
+
UNIQUE_COUNT: :unique_count
|
29
|
+
MAX: :max
|
30
|
+
LAST: :last
|
31
|
+
|
32
|
+
def self?.values: -> ::Array[Dodopayments::Models::MeterAggregation::type_]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type meter_archive_params =
|
4
|
+
{ } & Dodopayments::Internal::Type::request_parameters
|
5
|
+
|
6
|
+
class MeterArchiveParams < Dodopayments::Internal::Type::BaseModel
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
def initialize: (?request_options: Dodopayments::request_opts) -> void
|
11
|
+
|
12
|
+
def to_hash: -> { request_options: Dodopayments::RequestOptions }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Dodopayments
|
2
|
+
module Models
|
3
|
+
type meter_create_params =
|
4
|
+
{
|
5
|
+
aggregation: Dodopayments::MeterAggregation,
|
6
|
+
event_name: String,
|
7
|
+
measurement_unit: String,
|
8
|
+
name: String,
|
9
|
+
description: String?,
|
10
|
+
filter: Dodopayments::MeterFilter?
|
11
|
+
}
|
12
|
+
& Dodopayments::Internal::Type::request_parameters
|
13
|
+
|
14
|
+
class MeterCreateParams < Dodopayments::Internal::Type::BaseModel
|
15
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
16
|
+
include Dodopayments::Internal::Type::RequestParameters
|
17
|
+
|
18
|
+
attr_accessor aggregation: Dodopayments::MeterAggregation
|
19
|
+
|
20
|
+
attr_accessor event_name: String
|
21
|
+
|
22
|
+
attr_accessor measurement_unit: String
|
23
|
+
|
24
|
+
attr_accessor name: String
|
25
|
+
|
26
|
+
attr_accessor description: String?
|
27
|
+
|
28
|
+
attr_accessor filter: Dodopayments::MeterFilter?
|
29
|
+
|
30
|
+
def initialize: (
|
31
|
+
aggregation: Dodopayments::MeterAggregation,
|
32
|
+
event_name: String,
|
33
|
+
measurement_unit: String,
|
34
|
+
name: String,
|
35
|
+
?description: String?,
|
36
|
+
?filter: Dodopayments::MeterFilter?,
|
37
|
+
?request_options: Dodopayments::request_opts
|
38
|
+
) -> void
|
39
|
+
|
40
|
+
def to_hash: -> {
|
41
|
+
aggregation: Dodopayments::MeterAggregation,
|
42
|
+
event_name: String,
|
43
|
+
measurement_unit: String,
|
44
|
+
name: String,
|
45
|
+
description: String?,
|
46
|
+
filter: Dodopayments::MeterFilter?,
|
47
|
+
request_options: Dodopayments::RequestOptions
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|