Skip to content

Commit dec0402

Browse files
AdyenAutomationBotAdyenAutomationBot
andauthored
Code generation: update services and models (#1516)
* false[adyen-sdk-automation] automated change * style(fmt): code formatted --------- Co-authored-by: AdyenAutomationBot <AdyenAutomationBot 38424300+AdyenAutomationBot@users.noreply.github.com>
1 parent 89e3cbe commit dec0402

File tree

7 files changed

+209
-14
lines changed

7 files changed

+209
-14
lines changed

src/main/java/com/adyen/model/acswebhooks/AcsWebhooksHandler.java

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ public AcsWebhooksHandler(String payload) {
4040
* @return an Optional containing the deserialized object, or empty if deserialization fails
4141
*/
4242
public Optional<AuthenticationNotificationRequest> getAuthenticationNotificationRequest() {
43-
return getOptionalField(AuthenticationNotificationRequest.class);
43+
44+
var optionalAuthenticationNotificationRequest =
45+
getOptionalField(AuthenticationNotificationRequest.class);
46+
47+
if (optionalAuthenticationNotificationRequest.isPresent()) {
48+
// verify event type
49+
for (var value : AuthenticationNotificationRequest.TypeEnum.values()) {
50+
if (value.equals(optionalAuthenticationNotificationRequest.get().getType())) {
51+
// found matching event type
52+
return optionalAuthenticationNotificationRequest;
53+
}
54+
}
55+
}
56+
57+
return Optional.empty();
4458
}
4559

4660
/**
@@ -49,7 +63,20 @@ public Optional<AuthenticationNotificationRequest> getAuthenticationNotification
4963
* @return an Optional containing the deserialized object, or empty if deserialization fails
5064
*/
5165
public Optional<RelayedAuthenticationRequest> getRelayedAuthenticationRequest() {
52-
return getOptionalField(RelayedAuthenticationRequest.class);
66+
67+
var optionalRelayedAuthenticationRequest = getOptionalField(RelayedAuthenticationRequest.class);
68+
69+
if (optionalRelayedAuthenticationRequest.isPresent()) {
70+
// verify event type
71+
for (var value : RelayedAuthenticationRequest.TypeEnum.values()) {
72+
if (value.equals(optionalRelayedAuthenticationRequest.get().getType())) {
73+
// found matching event type
74+
return optionalRelayedAuthenticationRequest;
75+
}
76+
}
77+
}
78+
79+
return Optional.empty();
5380
}
5481

5582
/**

src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,21 @@ public BalanceWebhooksHandler(String payload) {
4141
*/
4242
public Optional<BalanceAccountBalanceNotificationRequest>
4343
getBalanceAccountBalanceNotificationRequest() {
44-
return getOptionalField(BalanceAccountBalanceNotificationRequest.class);
44+
45+
var optionalBalanceAccountBalanceNotificationRequest =
46+
getOptionalField(BalanceAccountBalanceNotificationRequest.class);
47+
48+
if (optionalBalanceAccountBalanceNotificationRequest.isPresent()) {
49+
// verify event type
50+
for (var value : BalanceAccountBalanceNotificationRequest.TypeEnum.values()) {
51+
if (value.equals(optionalBalanceAccountBalanceNotificationRequest.get().getType())) {
52+
// found matching event type
53+
return optionalBalanceAccountBalanceNotificationRequest;
54+
}
55+
}
56+
}
57+
58+
return Optional.empty();
4559
}
4660

4761
/**

src/main/java/com/adyen/model/managementwebhooks/ManagementWebhooksHandler.java

Lines changed: 106 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ public ManagementWebhooksHandler(String payload) {
4040
* @return an Optional containing the deserialized object, or empty if deserialization fails
4141
*/
4242
public Optional<MerchantCreatedNotificationRequest> getMerchantCreatedNotificationRequest() {
43-
return getOptionalField(MerchantCreatedNotificationRequest.class);
43+
44+
var optionalMerchantCreatedNotificationRequest =
45+
getOptionalField(MerchantCreatedNotificationRequest.class);
46+
47+
if (optionalMerchantCreatedNotificationRequest.isPresent()) {
48+
// verify event type
49+
for (var value : MerchantCreatedNotificationRequest.TypeEnum.values()) {
50+
if (value.equals(optionalMerchantCreatedNotificationRequest.get().getType())) {
51+
// found matching event type
52+
return optionalMerchantCreatedNotificationRequest;
53+
}
54+
}
55+
}
56+
57+
return Optional.empty();
4458
}
4559

4660
/**
@@ -49,7 +63,21 @@ public Optional<MerchantCreatedNotificationRequest> getMerchantCreatedNotificati
4963
* @return an Optional containing the deserialized object, or empty if deserialization fails
5064
*/
5165
public Optional<MerchantUpdatedNotificationRequest> getMerchantUpdatedNotificationRequest() {
52-
return getOptionalField(MerchantUpdatedNotificationRequest.class);
66+
67+
var optionalMerchantUpdatedNotificationRequest =
68+
getOptionalField(MerchantUpdatedNotificationRequest.class);
69+
70+
if (optionalMerchantUpdatedNotificationRequest.isPresent()) {
71+
// verify event type
72+
for (var value : MerchantUpdatedNotificationRequest.TypeEnum.values()) {
73+
if (value.equals(optionalMerchantUpdatedNotificationRequest.get().getType())) {
74+
// found matching event type
75+
return optionalMerchantUpdatedNotificationRequest;
76+
}
77+
}
78+
}
79+
80+
return Optional.empty();
5381
}
5482

5583
/**
@@ -59,7 +87,21 @@ public Optional<MerchantUpdatedNotificationRequest> getMerchantUpdatedNotificati
5987
*/
6088
public Optional<PaymentMethodCreatedNotificationRequest>
6189
getPaymentMethodCreatedNotificationRequest() {
62-
return getOptionalField(PaymentMethodCreatedNotificationRequest.class);
90+
91+
var optionalPaymentMethodCreatedNotificationRequest =
92+
getOptionalField(PaymentMethodCreatedNotificationRequest.class);
93+
94+
if (optionalPaymentMethodCreatedNotificationRequest.isPresent()) {
95+
// verify event type
96+
for (var value : PaymentMethodCreatedNotificationRequest.TypeEnum.values()) {
97+
if (value.equals(optionalPaymentMethodCreatedNotificationRequest.get().getType())) {
98+
// found matching event type
99+
return optionalPaymentMethodCreatedNotificationRequest;
100+
}
101+
}
102+
}
103+
104+
return Optional.empty();
63105
}
64106

65107
/**
@@ -70,7 +112,21 @@ public Optional<MerchantUpdatedNotificationRequest> getMerchantUpdatedNotificati
70112
*/
71113
public Optional<PaymentMethodRequestRemovedNotificationRequest>
72114
getPaymentMethodRequestRemovedNotificationRequest() {
73-
return getOptionalField(PaymentMethodRequestRemovedNotificationRequest.class);
115+
116+
var optionalPaymentMethodRequestRemovedNotificationRequest =
117+
getOptionalField(PaymentMethodRequestRemovedNotificationRequest.class);
118+
119+
if (optionalPaymentMethodRequestRemovedNotificationRequest.isPresent()) {
120+
// verify event type
121+
for (var value : PaymentMethodRequestRemovedNotificationRequest.TypeEnum.values()) {
122+
if (value.equals(optionalPaymentMethodRequestRemovedNotificationRequest.get().getType())) {
123+
// found matching event type
124+
return optionalPaymentMethodRequestRemovedNotificationRequest;
125+
}
126+
}
127+
}
128+
129+
return Optional.empty();
74130
}
75131

76132
/**
@@ -81,7 +137,22 @@ public Optional<MerchantUpdatedNotificationRequest> getMerchantUpdatedNotificati
81137
*/
82138
public Optional<PaymentMethodScheduledForRemovalNotificationRequest>
83139
getPaymentMethodScheduledForRemovalNotificationRequest() {
84-
return getOptionalField(PaymentMethodScheduledForRemovalNotificationRequest.class);
140+
141+
var optionalPaymentMethodScheduledForRemovalNotificationRequest =
142+
getOptionalField(PaymentMethodScheduledForRemovalNotificationRequest.class);
143+
144+
if (optionalPaymentMethodScheduledForRemovalNotificationRequest.isPresent()) {
145+
// verify event type
146+
for (var value : PaymentMethodScheduledForRemovalNotificationRequest.TypeEnum.values()) {
147+
if (value.equals(
148+
optionalPaymentMethodScheduledForRemovalNotificationRequest.get().getType())) {
149+
// found matching event type
150+
return optionalPaymentMethodScheduledForRemovalNotificationRequest;
151+
}
152+
}
153+
}
154+
155+
return Optional.empty();
85156
}
86157

87158
/**
@@ -90,7 +161,21 @@ public Optional<MerchantUpdatedNotificationRequest> getMerchantUpdatedNotificati
90161
* @return an Optional containing the deserialized object, or empty if deserialization fails
91162
*/
92163
public Optional<TerminalBoardingNotificationRequest> getTerminalBoardingNotificationRequest() {
93-
return getOptionalField(TerminalBoardingNotificationRequest.class);
164+
165+
var optionalTerminalBoardingNotificationRequest =
166+
getOptionalField(TerminalBoardingNotificationRequest.class);
167+
168+
if (optionalTerminalBoardingNotificationRequest.isPresent()) {
169+
// verify event type
170+
for (var value : TerminalBoardingNotificationRequest.TypeEnum.values()) {
171+
if (value.equals(optionalTerminalBoardingNotificationRequest.get().getType())) {
172+
// found matching event type
173+
return optionalTerminalBoardingNotificationRequest;
174+
}
175+
}
176+
}
177+
178+
return Optional.empty();
94179
}
95180

96181
/**
@@ -99,7 +184,21 @@ public Optional<TerminalBoardingNotificationRequest> getTerminalBoardingNotifica
99184
* @return an Optional containing the deserialized object, or empty if deserialization fails
100185
*/
101186
public Optional<TerminalSettingsNotificationRequest> getTerminalSettingsNotificationRequest() {
102-
return getOptionalField(TerminalSettingsNotificationRequest.class);
187+
188+
var optionalTerminalSettingsNotificationRequest =
189+
getOptionalField(TerminalSettingsNotificationRequest.class);
190+
191+
if (optionalTerminalSettingsNotificationRequest.isPresent()) {
192+
// verify event type
193+
for (var value : TerminalSettingsNotificationRequest.TypeEnum.values()) {
194+
if (value.equals(optionalTerminalSettingsNotificationRequest.get().getType())) {
195+
// found matching event type
196+
return optionalTerminalSettingsNotificationRequest;
197+
}
198+
}
199+
}
200+
201+
return Optional.empty();
103202
}
104203

105204
/**

src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceWarningWebhooksHandler.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,22 @@ public NegativeBalanceWarningWebhooksHandler(String payload) {
4444
*/
4545
public Optional<NegativeBalanceCompensationWarningNotificationRequest>
4646
getNegativeBalanceCompensationWarningNotificationRequest() {
47-
return getOptionalField(NegativeBalanceCompensationWarningNotificationRequest.class);
47+
48+
var optionalNegativeBalanceCompensationWarningNotificationRequest =
49+
getOptionalField(NegativeBalanceCompensationWarningNotificationRequest.class);
50+
51+
if (optionalNegativeBalanceCompensationWarningNotificationRequest.isPresent()) {
52+
// verify event type
53+
for (var value : NegativeBalanceCompensationWarningNotificationRequest.TypeEnum.values()) {
54+
if (value.equals(
55+
optionalNegativeBalanceCompensationWarningNotificationRequest.get().getType())) {
56+
// found matching event type
57+
return optionalNegativeBalanceCompensationWarningNotificationRequest;
58+
}
59+
}
60+
}
61+
62+
return Optional.empty();
4863
}
4964

5065
/**

src/main/java/com/adyen/model/reportwebhooks/ReportWebhooksHandler.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@ public ReportWebhooksHandler(String payload) {
4040
* @return an Optional containing the deserialized object, or empty if deserialization fails
4141
*/
4242
public Optional<ReportNotificationRequest> getReportNotificationRequest() {
43-
return getOptionalField(ReportNotificationRequest.class);
43+
44+
var optionalReportNotificationRequest = getOptionalField(ReportNotificationRequest.class);
45+
46+
if (optionalReportNotificationRequest.isPresent()) {
47+
// verify event type
48+
for (var value : ReportNotificationRequest.TypeEnum.values()) {
49+
if (value.equals(optionalReportNotificationRequest.get().getType())) {
50+
// found matching event type
51+
return optionalReportNotificationRequest;
52+
}
53+
}
54+
}
55+
56+
return Optional.empty();
4457
}
4558

4659
/**

src/main/java/com/adyen/model/transactionwebhooks/TransactionWebhooksHandler.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ public TransactionWebhooksHandler(String payload) {
4040
* @return an Optional containing the deserialized object, or empty if deserialization fails
4141
*/
4242
public Optional<TransactionNotificationRequestV4> getTransactionNotificationRequestV4() {
43-
return getOptionalField(TransactionNotificationRequestV4.class);
43+
44+
var optionalTransactionNotificationRequestV4 =
45+
getOptionalField(TransactionNotificationRequestV4.class);
46+
47+
if (optionalTransactionNotificationRequestV4.isPresent()) {
48+
// verify event type
49+
for (var value : TransactionNotificationRequestV4.TypeEnum.values()) {
50+
if (value.equals(optionalTransactionNotificationRequestV4.get().getType())) {
51+
// found matching event type
52+
return optionalTransactionNotificationRequestV4;
53+
}
54+
}
55+
}
56+
57+
return Optional.empty();
4458
}
4559

4660
/**

src/main/java/com/adyen/model/transferwebhooks/TransferWebhooksHandler.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@ public TransferWebhooksHandler(String payload) {
4040
* @return an Optional containing the deserialized object, or empty if deserialization fails
4141
*/
4242
public Optional<TransferNotificationRequest> getTransferNotificationRequest() {
43-
return getOptionalField(TransferNotificationRequest.class);
43+
44+
var optionalTransferNotificationRequest = getOptionalField(TransferNotificationRequest.class);
45+
46+
if (optionalTransferNotificationRequest.isPresent()) {
47+
// verify event type
48+
for (var value : TransferNotificationRequest.TypeEnum.values()) {
49+
if (value.equals(optionalTransferNotificationRequest.get().getType())) {
50+
// found matching event type
51+
return optionalTransferNotificationRequest;
52+
}
53+
}
54+
}
55+
56+
return Optional.empty();
4457
}
4558

4659
/**

0 commit comments

Comments
 (0)