dodopayments 2.27.0 → 2.29.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 +21 -0
- data/README.md +1 -1
- data/lib/dodopayments/internal/type/union.rb +15 -5
- data/lib/dodopayments/models/balance_ledger_entry.rb +6 -0
- data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +6 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +19 -1
- data/lib/dodopayments/models/checkout_session_preview_response.rb +10 -1
- data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rb +1 -1
- data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_response.rb +21 -1
- data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +2 -7
- data/lib/dodopayments/models/customers/email_body.rb +57 -0
- data/lib/dodopayments/models/customers/email_failure_code.rb +28 -0
- data/lib/dodopayments/models/customers/email_list_params.rb +39 -0
- data/lib/dodopayments/models/customers/email_log_item.rb +112 -0
- data/lib/dodopayments/models/customers/email_log_status.rb +24 -0
- data/lib/dodopayments/models/customers/email_policies.rb +57 -0
- data/lib/dodopayments/models/customers/email_retrieve_body_params.rb +28 -0
- data/lib/dodopayments/models/price.rb +95 -27
- data/lib/dodopayments/models/subscription.rb +10 -1
- data/lib/dodopayments/models/subscription_create_response.rb +10 -1
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/resources/credit_entitlements/balances.rb +1 -0
- data/lib/dodopayments/resources/customers/emails.rb +76 -0
- data/lib/dodopayments/resources/customers.rb +4 -0
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +8 -0
- data/rbi/dodopayments/models/balance_ledger_entry.rbi +30 -0
- data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +30 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +31 -0
- data/rbi/dodopayments/models/checkout_session_preview_response.rbi +10 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbi +2 -2
- data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_response.rbi +8 -0
- data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +2 -6
- data/rbi/dodopayments/models/customers/email_body.rbi +88 -0
- data/rbi/dodopayments/models/customers/email_failure_code.rbi +75 -0
- data/rbi/dodopayments/models/customers/email_list_params.rbi +68 -0
- data/rbi/dodopayments/models/customers/email_log_item.rbi +147 -0
- data/rbi/dodopayments/models/customers/email_log_status.rbi +46 -0
- data/rbi/dodopayments/models/customers/email_policies.rbi +78 -0
- data/rbi/dodopayments/models/customers/email_retrieve_body_params.rbi +48 -0
- data/rbi/dodopayments/models/price.rbi +124 -25
- data/rbi/dodopayments/models/subscription.rbi +10 -0
- data/rbi/dodopayments/models/subscription_create_response.rbi +10 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
- data/rbi/dodopayments/resources/credit_entitlements/balances.rbi +2 -1
- data/rbi/dodopayments/resources/customers/emails.rbi +60 -0
- data/rbi/dodopayments/resources/customers.rbi +3 -0
- data/sig/dodopayments/models/balance_ledger_entry.rbs +12 -0
- data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +12 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_preview_response.rbs +5 -0
- data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_response.rbs +5 -0
- data/sig/dodopayments/models/customers/email_body.rbs +42 -0
- data/sig/dodopayments/models/customers/email_failure_code.rbs +32 -0
- data/sig/dodopayments/models/customers/email_list_params.rbs +38 -0
- data/sig/dodopayments/models/customers/email_log_item.rbs +77 -0
- data/sig/dodopayments/models/customers/email_log_status.rbs +20 -0
- data/sig/dodopayments/models/customers/email_policies.rbs +42 -0
- data/sig/dodopayments/models/customers/email_retrieve_body_params.rbs +30 -0
- data/sig/dodopayments/models/price.rbs +52 -17
- data/sig/dodopayments/models/subscription.rbs +5 -0
- data/sig/dodopayments/models/subscription_create_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/resources/customers/emails.rbs +22 -0
- data/sig/dodopayments/resources/customers.rbs +2 -0
- metadata +26 -2
|
@@ -43,6 +43,10 @@ module Dodopayments
|
|
|
43
43
|
sig { returns(T::Boolean) }
|
|
44
44
|
attr_accessor :is_credit
|
|
45
45
|
|
|
46
|
+
# Metadata stored on this entry.
|
|
47
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
48
|
+
attr_accessor :metadata
|
|
49
|
+
|
|
46
50
|
sig { returns(String) }
|
|
47
51
|
attr_accessor :overage_after
|
|
48
52
|
|
|
@@ -68,6 +72,7 @@ module Dodopayments
|
|
|
68
72
|
entry_type:
|
|
69
73
|
Dodopayments::CreditEntitlements::LedgerEntryType::OrSymbol,
|
|
70
74
|
is_credit: T::Boolean,
|
|
75
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
71
76
|
overage_after: String,
|
|
72
77
|
overage_before: String,
|
|
73
78
|
grant_id: T.nilable(String),
|
|
@@ -84,6 +89,8 @@ module Dodopayments
|
|
|
84
89
|
customer_id:,
|
|
85
90
|
entry_type:,
|
|
86
91
|
is_credit:,
|
|
92
|
+
# Metadata stored on this entry.
|
|
93
|
+
metadata:,
|
|
87
94
|
overage_after:,
|
|
88
95
|
overage_before:,
|
|
89
96
|
grant_id: nil,
|
|
@@ -104,6 +111,7 @@ module Dodopayments
|
|
|
104
111
|
entry_type:
|
|
105
112
|
Dodopayments::CreditEntitlements::LedgerEntryType::TaggedSymbol,
|
|
106
113
|
is_credit: T::Boolean,
|
|
114
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
107
115
|
overage_after: String,
|
|
108
116
|
overage_before: String,
|
|
109
117
|
grant_id: T.nilable(String),
|
|
@@ -43,9 +43,7 @@ module Dodopayments
|
|
|
43
43
|
sig { returns(T::Boolean) }
|
|
44
44
|
attr_accessor :is_credit
|
|
45
45
|
|
|
46
|
-
# Metadata associated with
|
|
47
|
-
# created at checkout). Empty when the grant has no resolvable source (e.g.
|
|
48
|
-
# credits granted directly via the API).
|
|
46
|
+
# Metadata associated with this entry.
|
|
49
47
|
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
50
48
|
attr_accessor :metadata
|
|
51
49
|
|
|
@@ -110,9 +108,7 @@ module Dodopayments
|
|
|
110
108
|
credit_entitlement_id:,
|
|
111
109
|
customer_id:,
|
|
112
110
|
is_credit:,
|
|
113
|
-
# Metadata associated with
|
|
114
|
-
# created at checkout). Empty when the grant has no resolvable source (e.g.
|
|
115
|
-
# credits granted directly via the API).
|
|
111
|
+
# Metadata associated with this entry.
|
|
116
112
|
metadata:,
|
|
117
113
|
overage_after:,
|
|
118
114
|
overage_before:,
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
class EmailBody < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Dodopayments::Customers::EmailBody,
|
|
11
|
+
Dodopayments::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Whether the merchant wrote this content. It is true for the recovery and dunning
|
|
16
|
+
# emails, which the merchant writes.
|
|
17
|
+
#
|
|
18
|
+
# The content is email HTML. Render it in a sandbox, whatever this value is.
|
|
19
|
+
sig { returns(T::Boolean) }
|
|
20
|
+
attr_accessor :merchant_authored
|
|
21
|
+
|
|
22
|
+
# Why the email did not arrive. It is null unless the email failed.
|
|
23
|
+
sig do
|
|
24
|
+
returns(
|
|
25
|
+
T.nilable(Dodopayments::Customers::EmailFailureCode::TaggedSymbol)
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
attr_accessor :failure_code
|
|
29
|
+
|
|
30
|
+
# A sentence that explains `failure_code`. It is null unless the email failed.
|
|
31
|
+
sig { returns(T.nilable(String)) }
|
|
32
|
+
attr_accessor :failure_reason
|
|
33
|
+
|
|
34
|
+
# The stored HTML. It is null on a text-only email.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_accessor :html
|
|
37
|
+
|
|
38
|
+
# The stored plain text.
|
|
39
|
+
sig { returns(T.nilable(String)) }
|
|
40
|
+
attr_accessor :text
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
merchant_authored: T::Boolean,
|
|
45
|
+
failure_code:
|
|
46
|
+
T.nilable(Dodopayments::Customers::EmailFailureCode::OrSymbol),
|
|
47
|
+
failure_reason: T.nilable(String),
|
|
48
|
+
html: T.nilable(String),
|
|
49
|
+
text: T.nilable(String)
|
|
50
|
+
).returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
# Whether the merchant wrote this content. It is true for the recovery and dunning
|
|
54
|
+
# emails, which the merchant writes.
|
|
55
|
+
#
|
|
56
|
+
# The content is email HTML. Render it in a sandbox, whatever this value is.
|
|
57
|
+
merchant_authored:,
|
|
58
|
+
# Why the email did not arrive. It is null unless the email failed.
|
|
59
|
+
failure_code: nil,
|
|
60
|
+
# A sentence that explains `failure_code`. It is null unless the email failed.
|
|
61
|
+
failure_reason: nil,
|
|
62
|
+
# The stored HTML. It is null on a text-only email.
|
|
63
|
+
html: nil,
|
|
64
|
+
# The stored plain text.
|
|
65
|
+
text: nil
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
sig do
|
|
70
|
+
override.returns(
|
|
71
|
+
{
|
|
72
|
+
merchant_authored: T::Boolean,
|
|
73
|
+
failure_code:
|
|
74
|
+
T.nilable(
|
|
75
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
76
|
+
),
|
|
77
|
+
failure_reason: T.nilable(String),
|
|
78
|
+
html: T.nilable(String),
|
|
79
|
+
text: T.nilable(String)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
def to_hash
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
# Why an email did not reach the recipient.
|
|
7
|
+
#
|
|
8
|
+
# The code is stable. `send_failed` is the catch-all: it covers every failure that
|
|
9
|
+
# the other codes do not name.
|
|
10
|
+
module EmailFailureCode
|
|
11
|
+
extend Dodopayments::Internal::Type::Enum
|
|
12
|
+
|
|
13
|
+
TaggedSymbol =
|
|
14
|
+
T.type_alias do
|
|
15
|
+
T.all(Symbol, Dodopayments::Customers::EmailFailureCode)
|
|
16
|
+
end
|
|
17
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
18
|
+
|
|
19
|
+
MAILBOX_NOT_FOUND =
|
|
20
|
+
T.let(
|
|
21
|
+
:mailbox_not_found,
|
|
22
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
23
|
+
)
|
|
24
|
+
ADDRESS_REJECTED =
|
|
25
|
+
T.let(
|
|
26
|
+
:address_rejected,
|
|
27
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
28
|
+
)
|
|
29
|
+
ADDRESS_SUPPRESSED =
|
|
30
|
+
T.let(
|
|
31
|
+
:address_suppressed,
|
|
32
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
33
|
+
)
|
|
34
|
+
MAILBOX_FULL =
|
|
35
|
+
T.let(
|
|
36
|
+
:mailbox_full,
|
|
37
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
38
|
+
)
|
|
39
|
+
TEMPORARY_FAILURE =
|
|
40
|
+
T.let(
|
|
41
|
+
:temporary_failure,
|
|
42
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
43
|
+
)
|
|
44
|
+
MESSAGE_TOO_LARGE =
|
|
45
|
+
T.let(
|
|
46
|
+
:message_too_large,
|
|
47
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
48
|
+
)
|
|
49
|
+
MARKED_AS_SPAM =
|
|
50
|
+
T.let(
|
|
51
|
+
:marked_as_spam,
|
|
52
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
53
|
+
)
|
|
54
|
+
SEND_FAILED =
|
|
55
|
+
T.let(
|
|
56
|
+
:send_failed,
|
|
57
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
58
|
+
)
|
|
59
|
+
TEST_MODE_QUOTA_SPENT =
|
|
60
|
+
T.let(
|
|
61
|
+
:test_mode_quota_spent,
|
|
62
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
sig do
|
|
66
|
+
override.returns(
|
|
67
|
+
T::Array[Dodopayments::Customers::EmailFailureCode::TaggedSymbol]
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
def self.values
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
class EmailListParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Dodopayments::Customers::EmailListParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :customer_id
|
|
20
|
+
|
|
21
|
+
# Which page to return. The default is 0.
|
|
22
|
+
sig { returns(T.nilable(Integer)) }
|
|
23
|
+
attr_reader :page_number
|
|
24
|
+
|
|
25
|
+
sig { params(page_number: Integer).void }
|
|
26
|
+
attr_writer :page_number
|
|
27
|
+
|
|
28
|
+
# How many emails to return. The default is 10 and the maximum is 100.
|
|
29
|
+
sig { returns(T.nilable(Integer)) }
|
|
30
|
+
attr_reader :page_size
|
|
31
|
+
|
|
32
|
+
sig { params(page_size: Integer).void }
|
|
33
|
+
attr_writer :page_size
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
customer_id: String,
|
|
38
|
+
page_number: Integer,
|
|
39
|
+
page_size: Integer,
|
|
40
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
41
|
+
).returns(T.attached_class)
|
|
42
|
+
end
|
|
43
|
+
def self.new(
|
|
44
|
+
customer_id:,
|
|
45
|
+
# Which page to return. The default is 0.
|
|
46
|
+
page_number: nil,
|
|
47
|
+
# How many emails to return. The default is 10 and the maximum is 100.
|
|
48
|
+
page_size: nil,
|
|
49
|
+
request_options: {}
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
override.returns(
|
|
55
|
+
{
|
|
56
|
+
customer_id: String,
|
|
57
|
+
page_number: Integer,
|
|
58
|
+
page_size: Integer,
|
|
59
|
+
request_options: Dodopayments::RequestOptions
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
def to_hash
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
class EmailLogItem < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Dodopayments::Customers::EmailLogItem,
|
|
11
|
+
Dodopayments::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The group this email belongs to: payments, refunds, subscriptions,
|
|
16
|
+
# dunning_recovery, entitlements or auth.
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :category
|
|
19
|
+
|
|
20
|
+
# When this email was sent.
|
|
21
|
+
sig { returns(Time) }
|
|
22
|
+
attr_accessor :created_at
|
|
23
|
+
|
|
24
|
+
# Identifies this email. Use it to read the body or to send it again.
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :email_log_id
|
|
27
|
+
|
|
28
|
+
# What kind of email this is, for example `payment_successful`.
|
|
29
|
+
sig { returns(String) }
|
|
30
|
+
attr_accessor :email_type
|
|
31
|
+
|
|
32
|
+
# Whether this email has content to show. The content endpoint can still refuse,
|
|
33
|
+
# because the content is removed after 180 days.
|
|
34
|
+
sig { returns(T::Boolean) }
|
|
35
|
+
attr_accessor :has_preview
|
|
36
|
+
|
|
37
|
+
# What you may do with this email.
|
|
38
|
+
sig { returns(Dodopayments::Customers::EmailPolicies) }
|
|
39
|
+
attr_reader :policies
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
params(policies: Dodopayments::Customers::EmailPolicies::OrHash).void
|
|
43
|
+
end
|
|
44
|
+
attr_writer :policies
|
|
45
|
+
|
|
46
|
+
# Where the email got to: sent, delivered, failed, complained or blocked.
|
|
47
|
+
sig { returns(Dodopayments::Customers::EmailLogStatus::TaggedSymbol) }
|
|
48
|
+
attr_accessor :status
|
|
49
|
+
|
|
50
|
+
# Why the email did not arrive. It is null unless the email failed.
|
|
51
|
+
sig do
|
|
52
|
+
returns(
|
|
53
|
+
T.nilable(Dodopayments::Customers::EmailFailureCode::TaggedSymbol)
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
attr_accessor :failure_code
|
|
57
|
+
|
|
58
|
+
# A sentence that explains `failure_code`. It is null unless the email failed.
|
|
59
|
+
sig { returns(T.nilable(String)) }
|
|
60
|
+
attr_accessor :failure_reason
|
|
61
|
+
|
|
62
|
+
# The address the email was sent from.
|
|
63
|
+
sig { returns(T.nilable(String)) }
|
|
64
|
+
attr_accessor :from
|
|
65
|
+
|
|
66
|
+
# The address the email reached.
|
|
67
|
+
sig { returns(T.nilable(String)) }
|
|
68
|
+
attr_accessor :recipient
|
|
69
|
+
|
|
70
|
+
# The subject line as it was sent. Empty until the provider replicates.
|
|
71
|
+
sig { returns(T.nilable(String)) }
|
|
72
|
+
attr_accessor :subject
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
params(
|
|
76
|
+
category: String,
|
|
77
|
+
created_at: Time,
|
|
78
|
+
email_log_id: String,
|
|
79
|
+
email_type: String,
|
|
80
|
+
has_preview: T::Boolean,
|
|
81
|
+
policies: Dodopayments::Customers::EmailPolicies::OrHash,
|
|
82
|
+
status: Dodopayments::Customers::EmailLogStatus::OrSymbol,
|
|
83
|
+
failure_code:
|
|
84
|
+
T.nilable(Dodopayments::Customers::EmailFailureCode::OrSymbol),
|
|
85
|
+
failure_reason: T.nilable(String),
|
|
86
|
+
from: T.nilable(String),
|
|
87
|
+
recipient: T.nilable(String),
|
|
88
|
+
subject: T.nilable(String)
|
|
89
|
+
).returns(T.attached_class)
|
|
90
|
+
end
|
|
91
|
+
def self.new(
|
|
92
|
+
# The group this email belongs to: payments, refunds, subscriptions,
|
|
93
|
+
# dunning_recovery, entitlements or auth.
|
|
94
|
+
category:,
|
|
95
|
+
# When this email was sent.
|
|
96
|
+
created_at:,
|
|
97
|
+
# Identifies this email. Use it to read the body or to send it again.
|
|
98
|
+
email_log_id:,
|
|
99
|
+
# What kind of email this is, for example `payment_successful`.
|
|
100
|
+
email_type:,
|
|
101
|
+
# Whether this email has content to show. The content endpoint can still refuse,
|
|
102
|
+
# because the content is removed after 180 days.
|
|
103
|
+
has_preview:,
|
|
104
|
+
# What you may do with this email.
|
|
105
|
+
policies:,
|
|
106
|
+
# Where the email got to: sent, delivered, failed, complained or blocked.
|
|
107
|
+
status:,
|
|
108
|
+
# Why the email did not arrive. It is null unless the email failed.
|
|
109
|
+
failure_code: nil,
|
|
110
|
+
# A sentence that explains `failure_code`. It is null unless the email failed.
|
|
111
|
+
failure_reason: nil,
|
|
112
|
+
# The address the email was sent from.
|
|
113
|
+
from: nil,
|
|
114
|
+
# The address the email reached.
|
|
115
|
+
recipient: nil,
|
|
116
|
+
# The subject line as it was sent. Empty until the provider replicates.
|
|
117
|
+
subject: nil
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
sig do
|
|
122
|
+
override.returns(
|
|
123
|
+
{
|
|
124
|
+
category: String,
|
|
125
|
+
created_at: Time,
|
|
126
|
+
email_log_id: String,
|
|
127
|
+
email_type: String,
|
|
128
|
+
has_preview: T::Boolean,
|
|
129
|
+
policies: Dodopayments::Customers::EmailPolicies,
|
|
130
|
+
status: Dodopayments::Customers::EmailLogStatus::TaggedSymbol,
|
|
131
|
+
failure_code:
|
|
132
|
+
T.nilable(
|
|
133
|
+
Dodopayments::Customers::EmailFailureCode::TaggedSymbol
|
|
134
|
+
),
|
|
135
|
+
failure_reason: T.nilable(String),
|
|
136
|
+
from: T.nilable(String),
|
|
137
|
+
recipient: T.nilable(String),
|
|
138
|
+
subject: T.nilable(String)
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
def to_hash
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
# The delivery status of one email.
|
|
7
|
+
#
|
|
8
|
+
# `sent` also covers an email that is still on its way. A status only becomes
|
|
9
|
+
# `delivered`, `failed` or `complained` when the mail server answers.
|
|
10
|
+
module EmailLogStatus
|
|
11
|
+
extend Dodopayments::Internal::Type::Enum
|
|
12
|
+
|
|
13
|
+
TaggedSymbol =
|
|
14
|
+
T.type_alias do
|
|
15
|
+
T.all(Symbol, Dodopayments::Customers::EmailLogStatus)
|
|
16
|
+
end
|
|
17
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
18
|
+
|
|
19
|
+
SENT =
|
|
20
|
+
T.let(:sent, Dodopayments::Customers::EmailLogStatus::TaggedSymbol)
|
|
21
|
+
DELIVERED =
|
|
22
|
+
T.let(
|
|
23
|
+
:delivered,
|
|
24
|
+
Dodopayments::Customers::EmailLogStatus::TaggedSymbol
|
|
25
|
+
)
|
|
26
|
+
FAILED =
|
|
27
|
+
T.let(:failed, Dodopayments::Customers::EmailLogStatus::TaggedSymbol)
|
|
28
|
+
COMPLAINED =
|
|
29
|
+
T.let(
|
|
30
|
+
:complained,
|
|
31
|
+
Dodopayments::Customers::EmailLogStatus::TaggedSymbol
|
|
32
|
+
)
|
|
33
|
+
BLOCKED =
|
|
34
|
+
T.let(:blocked, Dodopayments::Customers::EmailLogStatus::TaggedSymbol)
|
|
35
|
+
|
|
36
|
+
sig do
|
|
37
|
+
override.returns(
|
|
38
|
+
T::Array[Dodopayments::Customers::EmailLogStatus::TaggedSymbol]
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
def self.values
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
class EmailPolicies < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Dodopayments::Customers::EmailPolicies,
|
|
11
|
+
Dodopayments::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# A permanent failure was recorded, so the same address would be a no-op.
|
|
16
|
+
sig { returns(T::Boolean) }
|
|
17
|
+
attr_accessor :requires_different_address
|
|
18
|
+
|
|
19
|
+
# The row was delivered and may be sent again.
|
|
20
|
+
sig { returns(T::Boolean) }
|
|
21
|
+
attr_accessor :resend_allowed
|
|
22
|
+
|
|
23
|
+
# How many sends are left in this email's chain.
|
|
24
|
+
sig { returns(Integer) }
|
|
25
|
+
attr_accessor :resends_remaining
|
|
26
|
+
|
|
27
|
+
# The row failed and may be sent again.
|
|
28
|
+
sig { returns(T::Boolean) }
|
|
29
|
+
attr_accessor :retry_allowed
|
|
30
|
+
|
|
31
|
+
# A later send of this email reached the provider, so this row is history. To send
|
|
32
|
+
# it again would deliver a second copy.
|
|
33
|
+
sig { returns(T::Boolean) }
|
|
34
|
+
attr_accessor :superseded
|
|
35
|
+
|
|
36
|
+
# What the merchant may do with one row. The server decides; the client never
|
|
37
|
+
# derives eligibility itself.
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
requires_different_address: T::Boolean,
|
|
41
|
+
resend_allowed: T::Boolean,
|
|
42
|
+
resends_remaining: Integer,
|
|
43
|
+
retry_allowed: T::Boolean,
|
|
44
|
+
superseded: T::Boolean
|
|
45
|
+
).returns(T.attached_class)
|
|
46
|
+
end
|
|
47
|
+
def self.new(
|
|
48
|
+
# A permanent failure was recorded, so the same address would be a no-op.
|
|
49
|
+
requires_different_address:,
|
|
50
|
+
# The row was delivered and may be sent again.
|
|
51
|
+
resend_allowed:,
|
|
52
|
+
# How many sends are left in this email's chain.
|
|
53
|
+
resends_remaining:,
|
|
54
|
+
# The row failed and may be sent again.
|
|
55
|
+
retry_allowed:,
|
|
56
|
+
# A later send of this email reached the provider, so this row is history. To send
|
|
57
|
+
# it again would deliver a second copy.
|
|
58
|
+
superseded:
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns(
|
|
64
|
+
{
|
|
65
|
+
requires_different_address: T::Boolean,
|
|
66
|
+
resend_allowed: T::Boolean,
|
|
67
|
+
resends_remaining: Integer,
|
|
68
|
+
retry_allowed: T::Boolean,
|
|
69
|
+
superseded: T::Boolean
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
def to_hash
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Customers
|
|
6
|
+
class EmailRetrieveBodyParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Dodopayments::Customers::EmailRetrieveBodyParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :customer_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :email_log_id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
customer_id: String,
|
|
27
|
+
email_log_id: String,
|
|
28
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(customer_id:, email_log_id:, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
customer_id: String,
|
|
38
|
+
email_log_id: String,
|
|
39
|
+
request_options: Dodopayments::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|