Skip to content

Commit 6e0287e

Browse files
authored
Merge pull request #1158 from stainless-sdks/mirek_rbi
chore: Simplify custom webhook code
2 parents 6bacc68 + 67dc77a commit 6e0287e

File tree

1 file changed

+2
-124
lines changed

1 file changed

+2
-124
lines changed

rbi/lithic/resources/webhooks.rbi

Lines changed: 2 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -8,134 +8,12 @@ module Lithic
88
payload: String,
99
headers: T::Hash[String, String],
1010
secret: T.nilable(String)
11-
).returns(
12-
T.any(
13-
Lithic::AccountHolderCreatedWebhookEvent,
14-
Lithic::ParsedWebhookEvent::KYBPayload,
15-
Lithic::ParsedWebhookEvent::KYCPayload,
16-
Lithic::ParsedWebhookEvent::LegacyPayload,
17-
Lithic::AccountHolderVerificationWebhookEvent,
18-
Lithic::AccountHolderDocumentUpdatedWebhookEvent,
19-
Lithic::AsaRequestWebhookEvent,
20-
Lithic::TokenizationDecisioningRequestWebhookEvent,
21-
Lithic::AuthRulesBacktestReportCreatedWebhookEvent,
22-
Lithic::BalanceUpdatedWebhookEvent,
23-
Lithic::BookTransferTransactionCreatedWebhookEvent,
24-
Lithic::BookTransferTransactionUpdatedWebhookEvent,
25-
Lithic::CardCreatedWebhookEvent,
26-
Lithic::CardConvertedWebhookEvent,
27-
Lithic::CardRenewedWebhookEvent,
28-
Lithic::CardReissuedWebhookEvent,
29-
Lithic::CardShippedWebhookEvent,
30-
Lithic::CardTransactionUpdatedWebhookEvent,
31-
Lithic::CardTransactionEnhancedDataCreatedWebhookEvent,
32-
Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent,
33-
Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent,
34-
Lithic::DigitalWalletTokenizationResultWebhookEvent,
35-
Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent,
36-
Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent,
37-
Lithic::DigitalWalletTokenizationUpdatedWebhookEvent,
38-
Lithic::DisputeUpdatedWebhookEvent,
39-
Lithic::DisputeEvidenceUploadFailedWebhookEvent,
40-
Lithic::ExternalBankAccountCreatedWebhookEvent,
41-
Lithic::ExternalBankAccountUpdatedWebhookEvent,
42-
Lithic::ExternalPaymentCreatedWebhookEvent,
43-
Lithic::ExternalPaymentUpdatedWebhookEvent,
44-
Lithic::FinancialAccountCreatedWebhookEvent,
45-
Lithic::FinancialAccountUpdatedWebhookEvent,
46-
Lithic::FundingEventCreatedWebhookEvent,
47-
Lithic::LoanTapeCreatedWebhookEvent,
48-
Lithic::LoanTapeUpdatedWebhookEvent,
49-
Lithic::ManagementOperationCreatedWebhookEvent,
50-
Lithic::ManagementOperationUpdatedWebhookEvent,
51-
Lithic::InternalTransactionCreatedWebhookEvent,
52-
Lithic::InternalTransactionUpdatedWebhookEvent,
53-
Lithic::NetworkTotalCreatedWebhookEvent,
54-
Lithic::NetworkTotalUpdatedWebhookEvent,
55-
Lithic::PaymentTransactionCreatedWebhookEvent,
56-
Lithic::PaymentTransactionUpdatedWebhookEvent,
57-
Lithic::SettlementReportUpdatedWebhookEvent,
58-
Lithic::StatementsCreatedWebhookEvent,
59-
Lithic::ThreeDSAuthenticationCreatedWebhookEvent,
60-
Lithic::ThreeDSAuthenticationUpdatedWebhookEvent,
61-
Lithic::ThreeDSAuthenticationChallengeWebhookEvent,
62-
Lithic::TokenizationApprovalRequestWebhookEvent,
63-
Lithic::TokenizationResultWebhookEvent,
64-
Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent,
65-
Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent,
66-
Lithic::TokenizationUpdatedWebhookEvent,
67-
Lithic::ThreeDSAuthentication,
68-
Lithic::DisputeTransactionCreatedWebhookEvent,
69-
Lithic::DisputeTransactionUpdatedWebhookEvent
70-
)
71-
)
11+
).returns(Lithic::ParsedWebhookEvent::Variants)
7212
end
7313
def parse(payload, headers:, secret: nil)
7414
end
7515

76-
sig do
77-
params(payload: String).returns(
78-
T.any(
79-
Lithic::AccountHolderCreatedWebhookEvent,
80-
Lithic::ParsedWebhookEvent::KYBPayload,
81-
Lithic::ParsedWebhookEvent::KYCPayload,
82-
Lithic::ParsedWebhookEvent::LegacyPayload,
83-
Lithic::AccountHolderVerificationWebhookEvent,
84-
Lithic::AccountHolderDocumentUpdatedWebhookEvent,
85-
Lithic::AsaRequestWebhookEvent,
86-
Lithic::TokenizationDecisioningRequestWebhookEvent,
87-
Lithic::AuthRulesBacktestReportCreatedWebhookEvent,
88-
Lithic::BalanceUpdatedWebhookEvent,
89-
Lithic::BookTransferTransactionCreatedWebhookEvent,
90-
Lithic::BookTransferTransactionUpdatedWebhookEvent,
91-
Lithic::CardCreatedWebhookEvent,
92-
Lithic::CardConvertedWebhookEvent,
93-
Lithic::CardRenewedWebhookEvent,
94-
Lithic::CardReissuedWebhookEvent,
95-
Lithic::CardShippedWebhookEvent,
96-
Lithic::CardTransactionUpdatedWebhookEvent,
97-
Lithic::CardTransactionEnhancedDataCreatedWebhookEvent,
98-
Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent,
99-
Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent,
100-
Lithic::DigitalWalletTokenizationResultWebhookEvent,
101-
Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent,
102-
Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent,
103-
Lithic::DigitalWalletTokenizationUpdatedWebhookEvent,
104-
Lithic::DisputeUpdatedWebhookEvent,
105-
Lithic::DisputeEvidenceUploadFailedWebhookEvent,
106-
Lithic::ExternalBankAccountCreatedWebhookEvent,
107-
Lithic::ExternalBankAccountUpdatedWebhookEvent,
108-
Lithic::ExternalPaymentCreatedWebhookEvent,
109-
Lithic::ExternalPaymentUpdatedWebhookEvent,
110-
Lithic::FinancialAccountCreatedWebhookEvent,
111-
Lithic::FinancialAccountUpdatedWebhookEvent,
112-
Lithic::FundingEventCreatedWebhookEvent,
113-
Lithic::LoanTapeCreatedWebhookEvent,
114-
Lithic::LoanTapeUpdatedWebhookEvent,
115-
Lithic::ManagementOperationCreatedWebhookEvent,
116-
Lithic::ManagementOperationUpdatedWebhookEvent,
117-
Lithic::InternalTransactionCreatedWebhookEvent,
118-
Lithic::InternalTransactionUpdatedWebhookEvent,
119-
Lithic::NetworkTotalCreatedWebhookEvent,
120-
Lithic::NetworkTotalUpdatedWebhookEvent,
121-
Lithic::PaymentTransactionCreatedWebhookEvent,
122-
Lithic::PaymentTransactionUpdatedWebhookEvent,
123-
Lithic::SettlementReportUpdatedWebhookEvent,
124-
Lithic::StatementsCreatedWebhookEvent,
125-
Lithic::ThreeDSAuthenticationCreatedWebhookEvent,
126-
Lithic::ThreeDSAuthenticationUpdatedWebhookEvent,
127-
Lithic::ThreeDSAuthenticationChallengeWebhookEvent,
128-
Lithic::TokenizationApprovalRequestWebhookEvent,
129-
Lithic::TokenizationResultWebhookEvent,
130-
Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent,
131-
Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent,
132-
Lithic::TokenizationUpdatedWebhookEvent,
133-
Lithic::ThreeDSAuthentication,
134-
Lithic::DisputeTransactionCreatedWebhookEvent,
135-
Lithic::DisputeTransactionUpdatedWebhookEvent
136-
)
137-
)
138-
end
16+
sig { params(payload: String).returns(Lithic::ParsedWebhookEvent::Variants) }
13917
def parse_unsafe(payload)
14018
end
14119

0 commit comments

Comments
 (0)