From 489a10f5849abea7e559a4c1c985d6b515d311b8 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 27 Mar 2026 10:34:41 +0100 Subject: [PATCH 1/4] Generate models --- .../com/adyen/model/tapi/AbortRequest.java | 289 ++++ .../model/tapi/AbstractOpenApiSchema.java | 142 ++ .../com/adyen/model/tapi/AccountType.java | 65 + .../com/adyen/model/tapi/AdminRequest.java | 177 +++ .../com/adyen/model/tapi/AdminResponse.java | 175 +++ .../com/adyen/model/tapi/AlignmentType.java | 53 + .../java/com/adyen/model/tapi/AmountsReq.java | 591 +++++++ .../com/adyen/model/tapi/AmountsResp.java | 441 ++++++ .../java/com/adyen/model/tapi/AreaSize.java | 234 +++ .../model/tapi/BalanceInquiryRequest.java | 231 +++ .../model/tapi/BalanceInquiryResponse.java | 302 ++++ .../adyen/model/tapi/CapturedSignature.java | 256 +++ .../model/tapi/CardAcquisitionRequest.java | 238 +++ .../model/tapi/CardAcquisitionResponse.java | 467 ++++++ .../tapi/CardAcquisitionTransaction.java | 753 +++++++++ .../java/com/adyen/model/tapi/CardData.java | 693 +++++++++ .../com/adyen/model/tapi/CardHolderPIN.java | 279 ++++ .../model/tapi/CardReaderAPDURequest.java | 451 ++++++ .../model/tapi/CardReaderAPDUResponse.java | 284 ++++ .../adyen/model/tapi/CharacterHeightType.java | 51 + .../adyen/model/tapi/CharacterStyleType.java | 53 + .../adyen/model/tapi/CharacterWidthType.java | 49 + .../java/com/adyen/model/tapi/CheckData.java | 486 ++++++ .../com/adyen/model/tapi/ConvertedAmount.java | 226 +++ .../adyen/model/tapi/CurrencyConversion.java | 450 ++++++ .../java/com/adyen/model/tapi/DeviceType.java | 53 + .../adyen/model/tapi/DiagnosisRequest.java | 296 ++++ .../adyen/model/tapi/DiagnosisResponse.java | 287 ++++ .../com/adyen/model/tapi/DisplayOutput.java | 559 +++++++ .../com/adyen/model/tapi/DisplayRequest.java | 195 +++ .../com/adyen/model/tapi/DisplayResponse.java | 194 +++ .../model/tapi/DocumentQualifierType.java | 57 + .../model/tapi/EnableServiceRequest.java | 377 +++++ .../model/tapi/EnableServiceResponse.java | 179 +++ .../adyen/model/tapi/ErrorConditionType.java | 79 + .../adyen/model/tapi/EventNotification.java | 492 ++++++ .../adyen/model/tapi/EventToNotifyType.java | 87 ++ .../model/tapi/GeographicCoordinates.java | 232 +++ .../com/adyen/model/tapi/Geolocation.java | 228 +++ .../adyen/model/tapi/GetTotalsRequest.java | 319 ++++ .../adyen/model/tapi/GetTotalsResponse.java | 297 ++++ .../adyen/model/tapi/GlobalStatusType.java | 53 + .../java/com/adyen/model/tapi/HostStatus.java | 225 +++ .../com/adyen/model/tapi/ICCResetData.java | 230 +++ .../model/tapi/IdentificationSupportType.java | 57 + .../adyen/model/tapi/IdentificationType.java | 55 + .../com/adyen/model/tapi/InfoQualifyType.java | 65 + src/main/java/com/adyen/model/tapi/Input.java | 537 +++++++ .../adyen/model/tapi/InputCommandType.java | 63 + .../java/com/adyen/model/tapi/InputData.java | 1383 +++++++++++++++++ .../com/adyen/model/tapi/InputRequest.java | 247 +++ .../com/adyen/model/tapi/InputResponse.java | 234 +++ .../com/adyen/model/tapi/InputResult.java | 365 +++++ .../com/adyen/model/tapi/InputUpdate.java | 493 ++++++ .../java/com/adyen/model/tapi/Instalment.java | 664 ++++++++ .../com/adyen/model/tapi/InstalmentType.java | 54 + src/main/java/com/adyen/model/tapi/JSON.java | 251 +++ .../com/adyen/model/tapi/LoginRequest.java | 756 +++++++++ .../com/adyen/model/tapi/LoginResponse.java | 284 ++++ .../com/adyen/model/tapi/LogoutRequest.java | 184 +++ .../com/adyen/model/tapi/LogoutResponse.java | 175 +++ .../com/adyen/model/tapi/LoyaltyAccount.java | 228 +++ .../adyen/model/tapi/LoyaltyAccountID.java | 448 ++++++ .../adyen/model/tapi/LoyaltyAccountReq.java | 233 +++ .../adyen/model/tapi/LoyaltyAcquirerData.java | 354 +++++ .../com/adyen/model/tapi/LoyaltyData.java | 248 +++ .../adyen/model/tapi/LoyaltyHandlingType.java | 55 + .../com/adyen/model/tapi/LoyaltyResponse.java | 403 +++++ .../com/adyen/model/tapi/LoyaltyResult.java | 292 ++++ .../java/com/adyen/model/tapi/MenuEntry.java | 470 ++++++ .../adyen/model/tapi/MenuEntryTagType.java | 56 + .../adyen/model/tapi/MessageCategoryType.java | 87 ++ .../adyen/model/tapi/MessageClassType.java | 51 + .../com/adyen/model/tapi/MessageHeader.java | 580 +++++++ .../adyen/model/tapi/MessageReference.java | 428 +++++ .../com/adyen/model/tapi/MessageType.java | 51 + .../java/com/adyen/model/tapi/MobileData.java | 451 ++++++ .../model/tapi/OriginalPOITransaction.java | 557 +++++++ .../com/adyen/model/tapi/OutputBarcode.java | 175 +++ .../com/adyen/model/tapi/OutputContent.java | 423 +++++ .../adyen/model/tapi/OutputFormatType.java | 56 + .../com/adyen/model/tapi/OutputResult.java | 313 ++++ .../java/com/adyen/model/tapi/OutputText.java | 640 ++++++++ .../com/adyen/model/tapi/PINFormatType.java | 53 + .../com/adyen/model/tapi/PINRequestType.java | 51 + .../java/com/adyen/model/tapi/POIData.java | 233 +++ .../com/adyen/model/tapi/POISoftware.java | 366 +++++ .../java/com/adyen/model/tapi/POIStatus.java | 519 +++++++ .../com/adyen/model/tapi/POISystemData.java | 278 ++++ .../adyen/model/tapi/PaymentAccountReq.java | 301 ++++ .../model/tapi/PaymentAccountStatus.java | 338 ++++ .../adyen/model/tapi/PaymentAcquirerData.java | 452 ++++++ .../com/adyen/model/tapi/PaymentData.java | 479 ++++++ .../model/tapi/PaymentInstrumentData.java | 470 ++++++ .../model/tapi/PaymentInstrumentType.java | 55 + .../com/adyen/model/tapi/PaymentReceipt.java | 352 +++++ .../com/adyen/model/tapi/PaymentRequest.java | 348 +++++ .../com/adyen/model/tapi/PaymentResponse.java | 468 ++++++ .../com/adyen/model/tapi/PaymentResult.java | 1035 ++++++++++++ .../com/adyen/model/tapi/PaymentToken.java | 301 ++++ .../com/adyen/model/tapi/PaymentTotals.java | 316 ++++ .../adyen/model/tapi/PaymentTransaction.java | 286 ++++ .../com/adyen/model/tapi/PaymentType.java | 69 + .../model/tapi/PerformedTransaction.java | 441 ++++++ .../java/com/adyen/model/tapi/PeriodUnit.java | 56 + src/main/java/com/adyen/model/tapi/Point.java | 222 +++ .../adyen/model/tapi/PredefinedContent.java | 228 +++ .../com/adyen/model/tapi/PrintOutput.java | 438 ++++++ .../com/adyen/model/tapi/PrintRequest.java | 178 +++ .../com/adyen/model/tapi/PrintResponse.java | 247 +++ .../adyen/model/tapi/PrinterStatusType.java | 58 + .../model/tapi/ReconciliationRequest.java | 321 ++++ .../model/tapi/ReconciliationResponse.java | 369 +++++ .../adyen/model/tapi/ReconciliationType.java | 53 + .../model/tapi/RepeatedMessageResponse.java | 239 +++ .../tapi/RepeatedResponseMessageBody.java | 449 ++++++ .../java/com/adyen/model/tapi/Response.java | 324 ++++ .../adyen/model/tapi/ResponseModeType.java | 53 + .../java/com/adyen/model/tapi/ResultType.java | 51 + .../adyen/model/tapi/ReversalReasonType.java | 56 + .../com/adyen/model/tapi/ReversalRequest.java | 348 +++++ .../adyen/model/tapi/ReversalResponse.java | 396 +++++ .../java/com/adyen/model/tapi/SaleData.java | 825 ++++++++++ .../com/adyen/model/tapi/SaleSoftware.java | 335 ++++ .../adyen/model/tapi/SaleTerminalData.java | 192 +++ .../adyen/model/tapi/SaleToIssuerData.java | 178 +++ .../adyen/model/tapi/SaleToPOIRequest.java | 1201 ++++++++++++++ .../adyen/model/tapi/SaleToPOIResponse.java | 1106 +++++++++++++ .../com/adyen/model/tapi/SecurityTrailer.java | 382 +++++ .../adyen/model/tapi/SensitiveCardData.java | 349 +++++ .../adyen/model/tapi/SensitiveMobileData.java | 295 ++++ .../com/adyen/model/tapi/SoundActionType.java | 51 + .../com/adyen/model/tapi/SoundContent.java | 329 ++++ .../com/adyen/model/tapi/SoundFormatType.java | 51 + .../model/tapi/StoredValueAccountID.java | 627 ++++++++ .../model/tapi/StoredValueAccountStatus.java | 232 +++ .../model/tapi/StoredValueAccountType.java | 51 + .../com/adyen/model/tapi/StoredValueData.java | 584 +++++++ .../adyen/model/tapi/StoredValueRequest.java | 239 +++ .../adyen/model/tapi/StoredValueResponse.java | 410 +++++ .../adyen/model/tapi/StoredValueResult.java | 515 ++++++ .../tapi/StoredValueTransactionType.java | 57 + .../adyen/model/tapi/TerminalAPIRequest.java | 176 +++ .../adyen/model/tapi/TerminalAPIResponse.java | 176 +++ .../adyen/model/tapi/TokenRequestedType.java | 53 + .../com/adyen/model/tapi/TotalFilter.java | 385 +++++ .../java/com/adyen/model/tapi/TrackData.java | 279 ++++ .../com/adyen/model/tapi/TrackFormatType.java | 49 + .../model/tapi/TransactionActionType.java | 55 + .../model/tapi/TransactionConditions.java | 735 +++++++++ .../model/tapi/TransactionIdentification.java | 248 +++ .../model/tapi/TransactionStatusRequest.java | 328 ++++ .../model/tapi/TransactionStatusResponse.java | 297 ++++ .../adyen/model/tapi/TransactionTotals.java | 741 +++++++++ .../com/adyen/model/tapi/TransactionType.java | 83 + .../com/adyen/model/tapi/TypeCodeType.java | 49 + .../com/adyen/model/tapi/UTMCoordinates.java | 280 ++++ 157 files changed, 47581 insertions(+) create mode 100644 src/main/java/com/adyen/model/tapi/AbortRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/tapi/AccountType.java create mode 100644 src/main/java/com/adyen/model/tapi/AdminRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/AdminResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/AlignmentType.java create mode 100644 src/main/java/com/adyen/model/tapi/AmountsReq.java create mode 100644 src/main/java/com/adyen/model/tapi/AmountsResp.java create mode 100644 src/main/java/com/adyen/model/tapi/AreaSize.java create mode 100644 src/main/java/com/adyen/model/tapi/BalanceInquiryRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/BalanceInquiryResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/CapturedSignature.java create mode 100644 src/main/java/com/adyen/model/tapi/CardAcquisitionRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/CardAcquisitionResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/CardAcquisitionTransaction.java create mode 100644 src/main/java/com/adyen/model/tapi/CardData.java create mode 100644 src/main/java/com/adyen/model/tapi/CardHolderPIN.java create mode 100644 src/main/java/com/adyen/model/tapi/CardReaderAPDURequest.java create mode 100644 src/main/java/com/adyen/model/tapi/CardReaderAPDUResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/CharacterHeightType.java create mode 100644 src/main/java/com/adyen/model/tapi/CharacterStyleType.java create mode 100644 src/main/java/com/adyen/model/tapi/CharacterWidthType.java create mode 100644 src/main/java/com/adyen/model/tapi/CheckData.java create mode 100644 src/main/java/com/adyen/model/tapi/ConvertedAmount.java create mode 100644 src/main/java/com/adyen/model/tapi/CurrencyConversion.java create mode 100644 src/main/java/com/adyen/model/tapi/DeviceType.java create mode 100644 src/main/java/com/adyen/model/tapi/DiagnosisRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/DiagnosisResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/DisplayOutput.java create mode 100644 src/main/java/com/adyen/model/tapi/DisplayRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/DisplayResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/DocumentQualifierType.java create mode 100644 src/main/java/com/adyen/model/tapi/EnableServiceRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/EnableServiceResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/ErrorConditionType.java create mode 100644 src/main/java/com/adyen/model/tapi/EventNotification.java create mode 100644 src/main/java/com/adyen/model/tapi/EventToNotifyType.java create mode 100644 src/main/java/com/adyen/model/tapi/GeographicCoordinates.java create mode 100644 src/main/java/com/adyen/model/tapi/Geolocation.java create mode 100644 src/main/java/com/adyen/model/tapi/GetTotalsRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/GetTotalsResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/GlobalStatusType.java create mode 100644 src/main/java/com/adyen/model/tapi/HostStatus.java create mode 100644 src/main/java/com/adyen/model/tapi/ICCResetData.java create mode 100644 src/main/java/com/adyen/model/tapi/IdentificationSupportType.java create mode 100644 src/main/java/com/adyen/model/tapi/IdentificationType.java create mode 100644 src/main/java/com/adyen/model/tapi/InfoQualifyType.java create mode 100644 src/main/java/com/adyen/model/tapi/Input.java create mode 100644 src/main/java/com/adyen/model/tapi/InputCommandType.java create mode 100644 src/main/java/com/adyen/model/tapi/InputData.java create mode 100644 src/main/java/com/adyen/model/tapi/InputRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/InputResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/InputResult.java create mode 100644 src/main/java/com/adyen/model/tapi/InputUpdate.java create mode 100644 src/main/java/com/adyen/model/tapi/Instalment.java create mode 100644 src/main/java/com/adyen/model/tapi/InstalmentType.java create mode 100644 src/main/java/com/adyen/model/tapi/JSON.java create mode 100644 src/main/java/com/adyen/model/tapi/LoginRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/LoginResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/LogoutRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/LogoutResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyAccount.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyAccountID.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyAccountReq.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyAcquirerData.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyData.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyHandlingType.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/LoyaltyResult.java create mode 100644 src/main/java/com/adyen/model/tapi/MenuEntry.java create mode 100644 src/main/java/com/adyen/model/tapi/MenuEntryTagType.java create mode 100644 src/main/java/com/adyen/model/tapi/MessageCategoryType.java create mode 100644 src/main/java/com/adyen/model/tapi/MessageClassType.java create mode 100644 src/main/java/com/adyen/model/tapi/MessageHeader.java create mode 100644 src/main/java/com/adyen/model/tapi/MessageReference.java create mode 100644 src/main/java/com/adyen/model/tapi/MessageType.java create mode 100644 src/main/java/com/adyen/model/tapi/MobileData.java create mode 100644 src/main/java/com/adyen/model/tapi/OriginalPOITransaction.java create mode 100644 src/main/java/com/adyen/model/tapi/OutputBarcode.java create mode 100644 src/main/java/com/adyen/model/tapi/OutputContent.java create mode 100644 src/main/java/com/adyen/model/tapi/OutputFormatType.java create mode 100644 src/main/java/com/adyen/model/tapi/OutputResult.java create mode 100644 src/main/java/com/adyen/model/tapi/OutputText.java create mode 100644 src/main/java/com/adyen/model/tapi/PINFormatType.java create mode 100644 src/main/java/com/adyen/model/tapi/PINRequestType.java create mode 100644 src/main/java/com/adyen/model/tapi/POIData.java create mode 100644 src/main/java/com/adyen/model/tapi/POISoftware.java create mode 100644 src/main/java/com/adyen/model/tapi/POIStatus.java create mode 100644 src/main/java/com/adyen/model/tapi/POISystemData.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentAccountReq.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentAccountStatus.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentAcquirerData.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentData.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentInstrumentData.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentInstrumentType.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentReceipt.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentResult.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentToken.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentTotals.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentTransaction.java create mode 100644 src/main/java/com/adyen/model/tapi/PaymentType.java create mode 100644 src/main/java/com/adyen/model/tapi/PerformedTransaction.java create mode 100644 src/main/java/com/adyen/model/tapi/PeriodUnit.java create mode 100644 src/main/java/com/adyen/model/tapi/Point.java create mode 100644 src/main/java/com/adyen/model/tapi/PredefinedContent.java create mode 100644 src/main/java/com/adyen/model/tapi/PrintOutput.java create mode 100644 src/main/java/com/adyen/model/tapi/PrintRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/PrintResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/PrinterStatusType.java create mode 100644 src/main/java/com/adyen/model/tapi/ReconciliationRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/ReconciliationResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/ReconciliationType.java create mode 100644 src/main/java/com/adyen/model/tapi/RepeatedMessageResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/RepeatedResponseMessageBody.java create mode 100644 src/main/java/com/adyen/model/tapi/Response.java create mode 100644 src/main/java/com/adyen/model/tapi/ResponseModeType.java create mode 100644 src/main/java/com/adyen/model/tapi/ResultType.java create mode 100644 src/main/java/com/adyen/model/tapi/ReversalReasonType.java create mode 100644 src/main/java/com/adyen/model/tapi/ReversalRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/ReversalResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/SaleData.java create mode 100644 src/main/java/com/adyen/model/tapi/SaleSoftware.java create mode 100644 src/main/java/com/adyen/model/tapi/SaleTerminalData.java create mode 100644 src/main/java/com/adyen/model/tapi/SaleToIssuerData.java create mode 100644 src/main/java/com/adyen/model/tapi/SaleToPOIRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/SaleToPOIResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/SecurityTrailer.java create mode 100644 src/main/java/com/adyen/model/tapi/SensitiveCardData.java create mode 100644 src/main/java/com/adyen/model/tapi/SensitiveMobileData.java create mode 100644 src/main/java/com/adyen/model/tapi/SoundActionType.java create mode 100644 src/main/java/com/adyen/model/tapi/SoundContent.java create mode 100644 src/main/java/com/adyen/model/tapi/SoundFormatType.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueAccountID.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueAccountStatus.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueAccountType.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueData.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueResult.java create mode 100644 src/main/java/com/adyen/model/tapi/StoredValueTransactionType.java create mode 100644 src/main/java/com/adyen/model/tapi/TerminalAPIRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/TerminalAPIResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/TokenRequestedType.java create mode 100644 src/main/java/com/adyen/model/tapi/TotalFilter.java create mode 100644 src/main/java/com/adyen/model/tapi/TrackData.java create mode 100644 src/main/java/com/adyen/model/tapi/TrackFormatType.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionActionType.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionConditions.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionIdentification.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionStatusRequest.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionStatusResponse.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionTotals.java create mode 100644 src/main/java/com/adyen/model/tapi/TransactionType.java create mode 100644 src/main/java/com/adyen/model/tapi/TypeCodeType.java create mode 100644 src/main/java/com/adyen/model/tapi/UTMCoordinates.java diff --git a/src/main/java/com/adyen/model/tapi/AbortRequest.java b/src/main/java/com/adyen/model/tapi/AbortRequest.java new file mode 100644 index 000000000..4ca8752c6 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AbortRequest.java @@ -0,0 +1,289 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Body of the Abort Request message. It conveys Information requested for identification of the + * message request carrying the transaction to abort. A message to display on the CustomerError + * Device could be sent by the Sale System (DisplayOutput). + */ +@JsonPropertyOrder({ + AbortRequest.JSON_PROPERTY_MESSAGE_REFERENCE, + AbortRequest.JSON_PROPERTY_ABORT_REASON, + AbortRequest.JSON_PROPERTY_DISPLAY_OUTPUT +}) +public class AbortRequest { + public static final String JSON_PROPERTY_MESSAGE_REFERENCE = "MessageReference"; + private MessageReference messageReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageReference = false; + + public static final String JSON_PROPERTY_ABORT_REASON = "AbortReason"; + private String abortReason; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAbortReason = false; + + public static final String JSON_PROPERTY_DISPLAY_OUTPUT = "DisplayOutput"; + private DisplayOutput displayOutput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AbortRequest() {} + + /** + * Identification of a previous POI transaction. + * + * @param messageReference Identification of a previous POI transaction. + * @return the current {@code AbortRequest} instance, allowing for method chaining + */ + public AbortRequest messageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + return this; + } + + /** + * Identification of a previous POI transaction. + * + * @return messageReference Identification of a previous POI transaction. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Identification of a previous POI transaction. + * + * @param messageReference Identification of a previous POI transaction. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + } + + /** + * Reason of aborting a transaction. + * + * @param abortReason Reason of aborting a transaction. + * @return the current {@code AbortRequest} instance, allowing for method chaining + */ + public AbortRequest abortReason(String abortReason) { + this.abortReason = abortReason; + isSetAbortReason = true; // mark as set + return this; + } + + /** + * Reason of aborting a transaction. + * + * @return abortReason Reason of aborting a transaction. + */ + @JsonProperty(JSON_PROPERTY_ABORT_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAbortReason() { + return abortReason; + } + + /** + * Reason of aborting a transaction. + * + * @param abortReason Reason of aborting a transaction. + */ + @JsonProperty(JSON_PROPERTY_ABORT_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbortReason(String abortReason) { + this.abortReason = abortReason; + isSetAbortReason = true; // mark as set + } + + /** + * Information to display and the way to process the display. To display an abort message to the + * Customer. + * + * @param displayOutput Information to display and the way to process the display. To display an + * abort message to the Customer. + * @return the current {@code AbortRequest} instance, allowing for method chaining + */ + public AbortRequest displayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + return this; + } + + /** + * Information to display and the way to process the display. To display an abort message to the + * Customer. + * + * @return displayOutput Information to display and the way to process the display. To display an + * abort message to the Customer. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Information to display and the way to process the display. To display an abort message to the + * Customer. + * + * @param displayOutput Information to display and the way to process the display. To display an + * abort message to the Customer. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AbortRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AbortRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbortRequest abortRequest = (AbortRequest) o; + return Objects.equals(this.messageReference, abortRequest.messageReference) + && Objects.equals(this.isSetMessageReference, abortRequest.isSetMessageReference) + && Objects.equals(this.abortReason, abortRequest.abortReason) + && Objects.equals(this.isSetAbortReason, abortRequest.isSetAbortReason) + && Objects.equals(this.displayOutput, abortRequest.displayOutput) + && Objects.equals(this.isSetDisplayOutput, abortRequest.isSetDisplayOutput); + } + + @Override + public int hashCode() { + return Objects.hash( + messageReference, + isSetMessageReference, + abortReason, + isSetAbortReason, + displayOutput, + isSetDisplayOutput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbortRequest {\n"); + sb.append(" messageReference: ").append(toIndentedString(messageReference)).append("\n"); + sb.append(" abortReason: ").append(toIndentedString(abortReason)).append("\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageReference) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_REFERENCE, this.messageReference); + } + if (isSetAbortReason) { + addIfNull(nulls, JSON_PROPERTY_ABORT_REASON, this.abortReason); + } + if (isSetDisplayOutput) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_OUTPUT, this.displayOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AbortRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AbortRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to AbortRequest + */ + public static AbortRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AbortRequest.class); + } + + /** + * Convert an instance of AbortRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/tapi/AbstractOpenApiSchema.java new file mode 100644 index 000000000..25b16c517 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AbstractOpenApiSchema.java @@ -0,0 +1,142 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.ws.rs.core.GenericType; +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + /** + * @param schemaType the schema type + * @param isNullable whether the instance is nullable + */ + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + return Boolean.TRUE.equals(isNullable); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AccountType.java b/src/main/java/com/adyen/model/tapi/AccountType.java new file mode 100644 index 000000000..78badf92a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AccountType.java @@ -0,0 +1,65 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Type of cardholder account used for the transaction. Allows a cardholder to select the type of + * account used for the transaction. Possible values: * **CardTotals** * **Checking** * + * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** * **Universal** + */ +public enum AccountType { + CARD_TOTALS("CardTotals"), + + CHECKING("Checking"), + + CREDIT_CARD("CreditCard"), + + DEFAULT("Default"), + + EPURSE_CARD("EpurseCard"), + + INVESTMENT("Investment"), + + SAVINGS("Savings"), + + UNIVERSAL("Universal"); + + private String value; + + AccountType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AccountType fromValue(String value) { + for (AccountType b : AccountType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AdminRequest.java b/src/main/java/com/adyen/model/tapi/AdminRequest.java new file mode 100644 index 000000000..01e274bb5 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AdminRequest.java @@ -0,0 +1,177 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Empty. Content of the Custom Admin Request message. */ +@JsonPropertyOrder({AdminRequest.JSON_PROPERTY_SERVICE_IDENTIFICATION}) +public class AdminRequest { + public static final String JSON_PROPERTY_SERVICE_IDENTIFICATION = "ServiceIdentification"; + private String serviceIdentification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetServiceIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AdminRequest() {} + + /** + * Identification of the administrative service to process. + * + * @param serviceIdentification Identification of the administrative service to process. + * @return the current {@code AdminRequest} instance, allowing for method chaining + */ + public AdminRequest serviceIdentification(String serviceIdentification) { + this.serviceIdentification = serviceIdentification; + isSetServiceIdentification = true; // mark as set + return this; + } + + /** + * Identification of the administrative service to process. + * + * @return serviceIdentification Identification of the administrative service to process. + */ + @JsonProperty(JSON_PROPERTY_SERVICE_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceIdentification() { + return serviceIdentification; + } + + /** + * Identification of the administrative service to process. + * + * @param serviceIdentification Identification of the administrative service to process. + */ + @JsonProperty(JSON_PROPERTY_SERVICE_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceIdentification(String serviceIdentification) { + this.serviceIdentification = serviceIdentification; + isSetServiceIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdminRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AdminRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminRequest adminRequest = (AdminRequest) o; + return Objects.equals(this.serviceIdentification, adminRequest.serviceIdentification) + && Objects.equals(this.isSetServiceIdentification, adminRequest.isSetServiceIdentification); + } + + @Override + public int hashCode() { + return Objects.hash(serviceIdentification, isSetServiceIdentification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminRequest {\n"); + sb.append(" serviceIdentification: ") + .append(toIndentedString(serviceIdentification)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetServiceIdentification) { + addIfNull(nulls, JSON_PROPERTY_SERVICE_IDENTIFICATION, this.serviceIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AdminRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdminRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to AdminRequest + */ + public static AdminRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AdminRequest.class); + } + + /** + * Convert an instance of AdminRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AdminResponse.java b/src/main/java/com/adyen/model/tapi/AdminResponse.java new file mode 100644 index 000000000..3b97d28aa --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AdminResponse.java @@ -0,0 +1,175 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** It conveys the result of the Custom Admin. Content of the Custom Admin Response message. */ +@JsonPropertyOrder({AdminResponse.JSON_PROPERTY_RESPONSE}) +public class AdminResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AdminResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code AdminResponse} instance, allowing for method chaining + */ + public AdminResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdminResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AdminResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminResponse adminResponse = (AdminResponse) o; + return Objects.equals(this.response, adminResponse.response) + && Objects.equals(this.isSetResponse, adminResponse.isSetResponse); + } + + @Override + public int hashCode() { + return Objects.hash(response, isSetResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AdminResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdminResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to AdminResponse + */ + public static AdminResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AdminResponse.class); + } + + /** + * Convert an instance of AdminResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AlignmentType.java b/src/main/java/com/adyen/model/tapi/AlignmentType.java new file mode 100644 index 000000000..c4134d1a7 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AlignmentType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets Alignment */ +public enum AlignmentType { + CENTRED("Centred"), + + JUSTIFIED("Justified"), + + LEFT("Left"), + + RIGHT("Right"); + + private String value; + + AlignmentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AlignmentType fromValue(String value) { + for (AlignmentType b : AlignmentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AmountsReq.java b/src/main/java/com/adyen/model/tapi/AmountsReq.java new file mode 100644 index 000000000..5acfa5902 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AmountsReq.java @@ -0,0 +1,591 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** Various amounts related to the payment request from the Sale System. */ +@JsonPropertyOrder({ + AmountsReq.JSON_PROPERTY_CURRENCY, + AmountsReq.JSON_PROPERTY_REQUESTED_AMOUNT, + AmountsReq.JSON_PROPERTY_CASH_BACK_AMOUNT, + AmountsReq.JSON_PROPERTY_TIP_AMOUNT, + AmountsReq.JSON_PROPERTY_PAID_AMOUNT, + AmountsReq.JSON_PROPERTY_MINIMUM_AMOUNT_TO_DELIVER, + AmountsReq.JSON_PROPERTY_MAXIMUM_CASH_BACK_AMOUNT, + AmountsReq.JSON_PROPERTY_MINIMUM_SPLIT_AMOUNT +}) +public class AmountsReq { + public static final String JSON_PROPERTY_CURRENCY = "Currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_REQUESTED_AMOUNT = "RequestedAmount"; + private BigDecimal requestedAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedAmount = false; + + public static final String JSON_PROPERTY_CASH_BACK_AMOUNT = "CashBackAmount"; + private BigDecimal cashBackAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCashBackAmount = false; + + public static final String JSON_PROPERTY_TIP_AMOUNT = "TipAmount"; + private BigDecimal tipAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTipAmount = false; + + public static final String JSON_PROPERTY_PAID_AMOUNT = "PaidAmount"; + private BigDecimal paidAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaidAmount = false; + + public static final String JSON_PROPERTY_MINIMUM_AMOUNT_TO_DELIVER = "MinimumAmountToDeliver"; + private BigDecimal minimumAmountToDeliver; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinimumAmountToDeliver = false; + + public static final String JSON_PROPERTY_MAXIMUM_CASH_BACK_AMOUNT = "MaximumCashBackAmount"; + private BigDecimal maximumCashBackAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaximumCashBackAmount = false; + + public static final String JSON_PROPERTY_MINIMUM_SPLIT_AMOUNT = "MinimumSplitAmount"; + private BigDecimal minimumSplitAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinimumSplitAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AmountsReq() {} + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. + * + * @return currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * Amount requested by the Sale for the payment. + * + * @param requestedAmount Amount requested by the Sale for the payment. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq requestedAmount(BigDecimal requestedAmount) { + this.requestedAmount = requestedAmount; + isSetRequestedAmount = true; // mark as set + return this; + } + + /** + * Amount requested by the Sale for the payment. minimum: 0.0 maximum: 99999999.999999 + * + * @return requestedAmount Amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getRequestedAmount() { + return requestedAmount; + } + + /** + * Amount requested by the Sale for the payment. + * + * @param requestedAmount Amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestedAmount(BigDecimal requestedAmount) { + this.requestedAmount = requestedAmount; + isSetRequestedAmount = true; // mark as set + } + + /** + * The cash-back part of the amount requested by the Sale for the payment. + * + * @param cashBackAmount The cash-back part of the amount requested by the Sale for the payment. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq cashBackAmount(BigDecimal cashBackAmount) { + this.cashBackAmount = cashBackAmount; + isSetCashBackAmount = true; // mark as set + return this; + } + + /** + * The cash-back part of the amount requested by the Sale for the payment. minimum: 0.0 maximum: + * 99999999.999999 + * + * @return cashBackAmount The cash-back part of the amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_CASH_BACK_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCashBackAmount() { + return cashBackAmount; + } + + /** + * The cash-back part of the amount requested by the Sale for the payment. + * + * @param cashBackAmount The cash-back part of the amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_CASH_BACK_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCashBackAmount(BigDecimal cashBackAmount) { + this.cashBackAmount = cashBackAmount; + isSetCashBackAmount = true; // mark as set + } + + /** + * Amount paid for a tip. Allow the printing of the tip on the receipt, and to qualify the tip + * part of the amount. + * + * @param tipAmount Amount paid for a tip. Allow the printing of the tip on the receipt, and to + * qualify the tip part of the amount. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq tipAmount(BigDecimal tipAmount) { + this.tipAmount = tipAmount; + isSetTipAmount = true; // mark as set + return this; + } + + /** + * Amount paid for a tip. Allow the printing of the tip on the receipt, and to qualify the tip + * part of the amount. minimum: 0.0 maximum: 99999999.999999 + * + * @return tipAmount Amount paid for a tip. Allow the printing of the tip on the receipt, and to + * qualify the tip part of the amount. + */ + @JsonProperty(JSON_PROPERTY_TIP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTipAmount() { + return tipAmount; + } + + /** + * Amount paid for a tip. Allow the printing of the tip on the receipt, and to qualify the tip + * part of the amount. + * + * @param tipAmount Amount paid for a tip. Allow the printing of the tip on the receipt, and to + * qualify the tip part of the amount. + */ + @JsonProperty(JSON_PROPERTY_TIP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTipAmount(BigDecimal tipAmount) { + this.tipAmount = tipAmount; + isSetTipAmount = true; // mark as set + } + + /** + * Amount already paid in case of split payment. Depending on the context, a split payment is + * either a split amount, or a split basket (required by some payment means as fleet cards). The + * PaidAmount is present when the split payment is a split of the amount. Split of the basket + * involves two Sale Transactions, and does not have to be recognised by the POI. + * + * @param paidAmount Amount already paid in case of split payment. Depending on the context, a + * split payment is either a split amount, or a split basket (required by some payment means + * as fleet cards). The PaidAmount is present when the split payment is a split of the amount. + * Split of the basket involves two Sale Transactions, and does not have to be recognised by + * the POI. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq paidAmount(BigDecimal paidAmount) { + this.paidAmount = paidAmount; + isSetPaidAmount = true; // mark as set + return this; + } + + /** + * Amount already paid in case of split payment. Depending on the context, a split payment is + * either a split amount, or a split basket (required by some payment means as fleet cards). The + * PaidAmount is present when the split payment is a split of the amount. Split of the basket + * involves two Sale Transactions, and does not have to be recognised by the POI. minimum: 0.0 + * maximum: 99999999.999999 + * + * @return paidAmount Amount already paid in case of split payment. Depending on the context, a + * split payment is either a split amount, or a split basket (required by some payment means + * as fleet cards). The PaidAmount is present when the split payment is a split of the amount. + * Split of the basket involves two Sale Transactions, and does not have to be recognised by + * the POI. + */ + @JsonProperty(JSON_PROPERTY_PAID_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPaidAmount() { + return paidAmount; + } + + /** + * Amount already paid in case of split payment. Depending on the context, a split payment is + * either a split amount, or a split basket (required by some payment means as fleet cards). The + * PaidAmount is present when the split payment is a split of the amount. Split of the basket + * involves two Sale Transactions, and does not have to be recognised by the POI. + * + * @param paidAmount Amount already paid in case of split payment. Depending on the context, a + * split payment is either a split amount, or a split basket (required by some payment means + * as fleet cards). The PaidAmount is present when the split payment is a split of the amount. + * Split of the basket involves two Sale Transactions, and does not have to be recognised by + * the POI. + */ + @JsonProperty(JSON_PROPERTY_PAID_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaidAmount(BigDecimal paidAmount) { + this.paidAmount = paidAmount; + isSetPaidAmount = true; // mark as set + } + + /** + * Minimum amount the Sale System is allowed to deliver for this payment. For the + * OneTimeReservation, when the maximum amount is unknown, the Sale System indicates the minimum + * amount it allows. + * + * @param minimumAmountToDeliver Minimum amount the Sale System is allowed to deliver for this + * payment. For the OneTimeReservation, when the maximum amount is unknown, the Sale System + * indicates the minimum amount it allows. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq minimumAmountToDeliver(BigDecimal minimumAmountToDeliver) { + this.minimumAmountToDeliver = minimumAmountToDeliver; + isSetMinimumAmountToDeliver = true; // mark as set + return this; + } + + /** + * Minimum amount the Sale System is allowed to deliver for this payment. For the + * OneTimeReservation, when the maximum amount is unknown, the Sale System indicates the minimum + * amount it allows. minimum: 0.0 maximum: 99999999.999999 + * + * @return minimumAmountToDeliver Minimum amount the Sale System is allowed to deliver for this + * payment. For the OneTimeReservation, when the maximum amount is unknown, the Sale System + * indicates the minimum amount it allows. + */ + @JsonProperty(JSON_PROPERTY_MINIMUM_AMOUNT_TO_DELIVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMinimumAmountToDeliver() { + return minimumAmountToDeliver; + } + + /** + * Minimum amount the Sale System is allowed to deliver for this payment. For the + * OneTimeReservation, when the maximum amount is unknown, the Sale System indicates the minimum + * amount it allows. + * + * @param minimumAmountToDeliver Minimum amount the Sale System is allowed to deliver for this + * payment. For the OneTimeReservation, when the maximum amount is unknown, the Sale System + * indicates the minimum amount it allows. + */ + @JsonProperty(JSON_PROPERTY_MINIMUM_AMOUNT_TO_DELIVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinimumAmountToDeliver(BigDecimal minimumAmountToDeliver) { + this.minimumAmountToDeliver = minimumAmountToDeliver; + isSetMinimumAmountToDeliver = true; // mark as set + } + + /** + * Maximum amount which could be requested for cash-back to the Sale System. Allows the Cashier to + * limit the amount value of cash-back to deliver to the Customer. + * + * @param maximumCashBackAmount Maximum amount which could be requested for cash-back to the Sale + * System. Allows the Cashier to limit the amount value of cash-back to deliver to the + * Customer. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq maximumCashBackAmount(BigDecimal maximumCashBackAmount) { + this.maximumCashBackAmount = maximumCashBackAmount; + isSetMaximumCashBackAmount = true; // mark as set + return this; + } + + /** + * Maximum amount which could be requested for cash-back to the Sale System. Allows the Cashier to + * limit the amount value of cash-back to deliver to the Customer. minimum: 0.0 maximum: + * 99999999.999999 + * + * @return maximumCashBackAmount Maximum amount which could be requested for cash-back to the Sale + * System. Allows the Cashier to limit the amount value of cash-back to deliver to the + * Customer. + */ + @JsonProperty(JSON_PROPERTY_MAXIMUM_CASH_BACK_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMaximumCashBackAmount() { + return maximumCashBackAmount; + } + + /** + * Maximum amount which could be requested for cash-back to the Sale System. Allows the Cashier to + * limit the amount value of cash-back to deliver to the Customer. + * + * @param maximumCashBackAmount Maximum amount which could be requested for cash-back to the Sale + * System. Allows the Cashier to limit the amount value of cash-back to deliver to the + * Customer. + */ + @JsonProperty(JSON_PROPERTY_MAXIMUM_CASH_BACK_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaximumCashBackAmount(BigDecimal maximumCashBackAmount) { + this.maximumCashBackAmount = maximumCashBackAmount; + isSetMaximumCashBackAmount = true; // mark as set + } + + /** + * Minimum amount of a split, which could be requested by a Customer.Allows the Merchant to limit + * the number of split requested by the Customer. + * + * @param minimumSplitAmount Minimum amount of a split, which could be requested by a + * Customer.Allows the Merchant to limit the number of split requested by the Customer. + * @return the current {@code AmountsReq} instance, allowing for method chaining + */ + public AmountsReq minimumSplitAmount(BigDecimal minimumSplitAmount) { + this.minimumSplitAmount = minimumSplitAmount; + isSetMinimumSplitAmount = true; // mark as set + return this; + } + + /** + * Minimum amount of a split, which could be requested by a Customer.Allows the Merchant to limit + * the number of split requested by the Customer. minimum: 0.0 maximum: 99999999.999999 + * + * @return minimumSplitAmount Minimum amount of a split, which could be requested by a + * Customer.Allows the Merchant to limit the number of split requested by the Customer. + */ + @JsonProperty(JSON_PROPERTY_MINIMUM_SPLIT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMinimumSplitAmount() { + return minimumSplitAmount; + } + + /** + * Minimum amount of a split, which could be requested by a Customer.Allows the Merchant to limit + * the number of split requested by the Customer. + * + * @param minimumSplitAmount Minimum amount of a split, which could be requested by a + * Customer.Allows the Merchant to limit the number of split requested by the Customer. + */ + @JsonProperty(JSON_PROPERTY_MINIMUM_SPLIT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinimumSplitAmount(BigDecimal minimumSplitAmount) { + this.minimumSplitAmount = minimumSplitAmount; + isSetMinimumSplitAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountsReq includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AmountsReq object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AmountsReq amountsReq = (AmountsReq) o; + return Objects.equals(this.currency, amountsReq.currency) + && Objects.equals(this.isSetCurrency, amountsReq.isSetCurrency) + && Objects.equals(this.requestedAmount, amountsReq.requestedAmount) + && Objects.equals(this.isSetRequestedAmount, amountsReq.isSetRequestedAmount) + && Objects.equals(this.cashBackAmount, amountsReq.cashBackAmount) + && Objects.equals(this.isSetCashBackAmount, amountsReq.isSetCashBackAmount) + && Objects.equals(this.tipAmount, amountsReq.tipAmount) + && Objects.equals(this.isSetTipAmount, amountsReq.isSetTipAmount) + && Objects.equals(this.paidAmount, amountsReq.paidAmount) + && Objects.equals(this.isSetPaidAmount, amountsReq.isSetPaidAmount) + && Objects.equals(this.minimumAmountToDeliver, amountsReq.minimumAmountToDeliver) + && Objects.equals(this.isSetMinimumAmountToDeliver, amountsReq.isSetMinimumAmountToDeliver) + && Objects.equals(this.maximumCashBackAmount, amountsReq.maximumCashBackAmount) + && Objects.equals(this.isSetMaximumCashBackAmount, amountsReq.isSetMaximumCashBackAmount) + && Objects.equals(this.minimumSplitAmount, amountsReq.minimumSplitAmount) + && Objects.equals(this.isSetMinimumSplitAmount, amountsReq.isSetMinimumSplitAmount); + } + + @Override + public int hashCode() { + return Objects.hash( + currency, + isSetCurrency, + requestedAmount, + isSetRequestedAmount, + cashBackAmount, + isSetCashBackAmount, + tipAmount, + isSetTipAmount, + paidAmount, + isSetPaidAmount, + minimumAmountToDeliver, + isSetMinimumAmountToDeliver, + maximumCashBackAmount, + isSetMaximumCashBackAmount, + minimumSplitAmount, + isSetMinimumSplitAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AmountsReq {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" requestedAmount: ").append(toIndentedString(requestedAmount)).append("\n"); + sb.append(" cashBackAmount: ").append(toIndentedString(cashBackAmount)).append("\n"); + sb.append(" tipAmount: ").append(toIndentedString(tipAmount)).append("\n"); + sb.append(" paidAmount: ").append(toIndentedString(paidAmount)).append("\n"); + sb.append(" minimumAmountToDeliver: ") + .append(toIndentedString(minimumAmountToDeliver)) + .append("\n"); + sb.append(" maximumCashBackAmount: ") + .append(toIndentedString(maximumCashBackAmount)) + .append("\n"); + sb.append(" minimumSplitAmount: ").append(toIndentedString(minimumSplitAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetRequestedAmount) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_AMOUNT, this.requestedAmount); + } + if (isSetCashBackAmount) { + addIfNull(nulls, JSON_PROPERTY_CASH_BACK_AMOUNT, this.cashBackAmount); + } + if (isSetTipAmount) { + addIfNull(nulls, JSON_PROPERTY_TIP_AMOUNT, this.tipAmount); + } + if (isSetPaidAmount) { + addIfNull(nulls, JSON_PROPERTY_PAID_AMOUNT, this.paidAmount); + } + if (isSetMinimumAmountToDeliver) { + addIfNull(nulls, JSON_PROPERTY_MINIMUM_AMOUNT_TO_DELIVER, this.minimumAmountToDeliver); + } + if (isSetMaximumCashBackAmount) { + addIfNull(nulls, JSON_PROPERTY_MAXIMUM_CASH_BACK_AMOUNT, this.maximumCashBackAmount); + } + if (isSetMinimumSplitAmount) { + addIfNull(nulls, JSON_PROPERTY_MINIMUM_SPLIT_AMOUNT, this.minimumSplitAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AmountsReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AmountsReq + * @throws JsonProcessingException if the JSON string is invalid with respect to AmountsReq + */ + public static AmountsReq fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AmountsReq.class); + } + + /** + * Convert an instance of AmountsReq to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AmountsResp.java b/src/main/java/com/adyen/model/tapi/AmountsResp.java new file mode 100644 index 000000000..22294d2fe --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AmountsResp.java @@ -0,0 +1,441 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** AmountsResp */ +@JsonPropertyOrder({ + AmountsResp.JSON_PROPERTY_CURRENCY, + AmountsResp.JSON_PROPERTY_AUTHORIZED_AMOUNT, + AmountsResp.JSON_PROPERTY_TOTAL_REBATES_AMOUNT, + AmountsResp.JSON_PROPERTY_TOTAL_FEES_AMOUNT, + AmountsResp.JSON_PROPERTY_CASH_BACK_AMOUNT, + AmountsResp.JSON_PROPERTY_TIP_AMOUNT +}) +public class AmountsResp { + public static final String JSON_PROPERTY_CURRENCY = "Currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_AUTHORIZED_AMOUNT = "AuthorizedAmount"; + private BigDecimal authorizedAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizedAmount = false; + + public static final String JSON_PROPERTY_TOTAL_REBATES_AMOUNT = "TotalRebatesAmount"; + private BigDecimal totalRebatesAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalRebatesAmount = false; + + public static final String JSON_PROPERTY_TOTAL_FEES_AMOUNT = "TotalFeesAmount"; + private BigDecimal totalFeesAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalFeesAmount = false; + + public static final String JSON_PROPERTY_CASH_BACK_AMOUNT = "CashBackAmount"; + private BigDecimal cashBackAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCashBackAmount = false; + + public static final String JSON_PROPERTY_TIP_AMOUNT = "TipAmount"; + private BigDecimal tipAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTipAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AmountsResp() {} + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + * @return the current {@code AmountsResp} instance, allowing for method chaining + */ + public AmountsResp currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. + * + * @return currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * Amount requested by the Sale for the payment. + * + * @param authorizedAmount Amount requested by the Sale for the payment. + * @return the current {@code AmountsResp} instance, allowing for method chaining + */ + public AmountsResp authorizedAmount(BigDecimal authorizedAmount) { + this.authorizedAmount = authorizedAmount; + isSetAuthorizedAmount = true; // mark as set + return this; + } + + /** + * Amount requested by the Sale for the payment. minimum: 0.0 maximum: 99999999.999999 + * + * @return authorizedAmount Amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_AUTHORIZED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAuthorizedAmount() { + return authorizedAmount; + } + + /** + * Amount requested by the Sale for the payment. + * + * @param authorizedAmount Amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_AUTHORIZED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthorizedAmount(BigDecimal authorizedAmount) { + this.authorizedAmount = authorizedAmount; + isSetAuthorizedAmount = true; // mark as set + } + + /** + * Sum of rebates in amount (total amount or line item amount) for all the loyalty programs. + * + * @param totalRebatesAmount Sum of rebates in amount (total amount or line item amount) for all + * the loyalty programs. + * @return the current {@code AmountsResp} instance, allowing for method chaining + */ + public AmountsResp totalRebatesAmount(BigDecimal totalRebatesAmount) { + this.totalRebatesAmount = totalRebatesAmount; + isSetTotalRebatesAmount = true; // mark as set + return this; + } + + /** + * Sum of rebates in amount (total amount or line item amount) for all the loyalty programs. + * minimum: 0.0 maximum: 99999999.999999 + * + * @return totalRebatesAmount Sum of rebates in amount (total amount or line item amount) for all + * the loyalty programs. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_REBATES_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTotalRebatesAmount() { + return totalRebatesAmount; + } + + /** + * Sum of rebates in amount (total amount or line item amount) for all the loyalty programs. + * + * @param totalRebatesAmount Sum of rebates in amount (total amount or line item amount) for all + * the loyalty programs. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_REBATES_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalRebatesAmount(BigDecimal totalRebatesAmount) { + this.totalRebatesAmount = totalRebatesAmount; + isSetTotalRebatesAmount = true; // mark as set + } + + /** + * Total amount of financial fees. + * + * @param totalFeesAmount Total amount of financial fees. + * @return the current {@code AmountsResp} instance, allowing for method chaining + */ + public AmountsResp totalFeesAmount(BigDecimal totalFeesAmount) { + this.totalFeesAmount = totalFeesAmount; + isSetTotalFeesAmount = true; // mark as set + return this; + } + + /** + * Total amount of financial fees. minimum: 0.0 maximum: 99999999.999999 + * + * @return totalFeesAmount Total amount of financial fees. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FEES_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTotalFeesAmount() { + return totalFeesAmount; + } + + /** + * Total amount of financial fees. + * + * @param totalFeesAmount Total amount of financial fees. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FEES_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalFeesAmount(BigDecimal totalFeesAmount) { + this.totalFeesAmount = totalFeesAmount; + isSetTotalFeesAmount = true; // mark as set + } + + /** + * The cash-back part of the amount requested by the Sale for the payment. + * + * @param cashBackAmount The cash-back part of the amount requested by the Sale for the payment. + * @return the current {@code AmountsResp} instance, allowing for method chaining + */ + public AmountsResp cashBackAmount(BigDecimal cashBackAmount) { + this.cashBackAmount = cashBackAmount; + isSetCashBackAmount = true; // mark as set + return this; + } + + /** + * The cash-back part of the amount requested by the Sale for the payment. minimum: 0.0 maximum: + * 99999999.999999 + * + * @return cashBackAmount The cash-back part of the amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_CASH_BACK_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCashBackAmount() { + return cashBackAmount; + } + + /** + * The cash-back part of the amount requested by the Sale for the payment. + * + * @param cashBackAmount The cash-back part of the amount requested by the Sale for the payment. + */ + @JsonProperty(JSON_PROPERTY_CASH_BACK_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCashBackAmount(BigDecimal cashBackAmount) { + this.cashBackAmount = cashBackAmount; + isSetCashBackAmount = true; // mark as set + } + + /** + * Amount paid for a tip. Allow the printing of the tip on the receipt, and to qualify the tip + * part of the amount. + * + * @param tipAmount Amount paid for a tip. Allow the printing of the tip on the receipt, and to + * qualify the tip part of the amount. + * @return the current {@code AmountsResp} instance, allowing for method chaining + */ + public AmountsResp tipAmount(BigDecimal tipAmount) { + this.tipAmount = tipAmount; + isSetTipAmount = true; // mark as set + return this; + } + + /** + * Amount paid for a tip. Allow the printing of the tip on the receipt, and to qualify the tip + * part of the amount. minimum: 0.0 maximum: 99999999.999999 + * + * @return tipAmount Amount paid for a tip. Allow the printing of the tip on the receipt, and to + * qualify the tip part of the amount. + */ + @JsonProperty(JSON_PROPERTY_TIP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTipAmount() { + return tipAmount; + } + + /** + * Amount paid for a tip. Allow the printing of the tip on the receipt, and to qualify the tip + * part of the amount. + * + * @param tipAmount Amount paid for a tip. Allow the printing of the tip on the receipt, and to + * qualify the tip part of the amount. + */ + @JsonProperty(JSON_PROPERTY_TIP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTipAmount(BigDecimal tipAmount) { + this.tipAmount = tipAmount; + isSetTipAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountsResp includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AmountsResp object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AmountsResp amountsResp = (AmountsResp) o; + return Objects.equals(this.currency, amountsResp.currency) + && Objects.equals(this.isSetCurrency, amountsResp.isSetCurrency) + && Objects.equals(this.authorizedAmount, amountsResp.authorizedAmount) + && Objects.equals(this.isSetAuthorizedAmount, amountsResp.isSetAuthorizedAmount) + && Objects.equals(this.totalRebatesAmount, amountsResp.totalRebatesAmount) + && Objects.equals(this.isSetTotalRebatesAmount, amountsResp.isSetTotalRebatesAmount) + && Objects.equals(this.totalFeesAmount, amountsResp.totalFeesAmount) + && Objects.equals(this.isSetTotalFeesAmount, amountsResp.isSetTotalFeesAmount) + && Objects.equals(this.cashBackAmount, amountsResp.cashBackAmount) + && Objects.equals(this.isSetCashBackAmount, amountsResp.isSetCashBackAmount) + && Objects.equals(this.tipAmount, amountsResp.tipAmount) + && Objects.equals(this.isSetTipAmount, amountsResp.isSetTipAmount); + } + + @Override + public int hashCode() { + return Objects.hash( + currency, + isSetCurrency, + authorizedAmount, + isSetAuthorizedAmount, + totalRebatesAmount, + isSetTotalRebatesAmount, + totalFeesAmount, + isSetTotalFeesAmount, + cashBackAmount, + isSetCashBackAmount, + tipAmount, + isSetTipAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AmountsResp {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" authorizedAmount: ").append(toIndentedString(authorizedAmount)).append("\n"); + sb.append(" totalRebatesAmount: ").append(toIndentedString(totalRebatesAmount)).append("\n"); + sb.append(" totalFeesAmount: ").append(toIndentedString(totalFeesAmount)).append("\n"); + sb.append(" cashBackAmount: ").append(toIndentedString(cashBackAmount)).append("\n"); + sb.append(" tipAmount: ").append(toIndentedString(tipAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetAuthorizedAmount) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZED_AMOUNT, this.authorizedAmount); + } + if (isSetTotalRebatesAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_REBATES_AMOUNT, this.totalRebatesAmount); + } + if (isSetTotalFeesAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_FEES_AMOUNT, this.totalFeesAmount); + } + if (isSetCashBackAmount) { + addIfNull(nulls, JSON_PROPERTY_CASH_BACK_AMOUNT, this.cashBackAmount); + } + if (isSetTipAmount) { + addIfNull(nulls, JSON_PROPERTY_TIP_AMOUNT, this.tipAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AmountsResp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AmountsResp + * @throws JsonProcessingException if the JSON string is invalid with respect to AmountsResp + */ + public static AmountsResp fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AmountsResp.class); + } + + /** + * Convert an instance of AmountsResp to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/AreaSize.java b/src/main/java/com/adyen/model/tapi/AreaSize.java new file mode 100644 index 000000000..4f7f234fe --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/AreaSize.java @@ -0,0 +1,234 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** AreaSize */ +@JsonPropertyOrder({AreaSize.JSON_PROPERTY_X, AreaSize.JSON_PROPERTY_Y}) +public class AreaSize { + public static final String JSON_PROPERTY_X = "X"; + private String X; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetX = false; + + public static final String JSON_PROPERTY_Y = "Y"; + private String Y; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetY = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AreaSize() {} + + /** + * Abscissa of a point coordinates. The hexadecimal value in text of the abscissa of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * + * @param X Abscissa of a point coordinates. The hexadecimal value in text of the abscissa of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * @return the current {@code AreaSize} instance, allowing for method chaining + */ + public AreaSize X(String X) { + this.X = X; + isSetX = true; // mark as set + return this; + } + + /** + * Abscissa of a point coordinates. The hexadecimal value in text of the abscissa of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * + * @return X Abscissa of a point coordinates. The hexadecimal value in text of the abscissa of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + */ + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getX() { + return X; + } + + /** + * Abscissa of a point coordinates. The hexadecimal value in text of the abscissa of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * + * @param X Abscissa of a point coordinates. The hexadecimal value in text of the abscissa of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + */ + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(String X) { + this.X = X; + isSetX = true; // mark as set + } + + /** + * Ordinate of a point coordinates. The hexadecimal value in text of the ordinate of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * + * @param Y Ordinate of a point coordinates. The hexadecimal value in text of the ordinate of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * @return the current {@code AreaSize} instance, allowing for method chaining + */ + public AreaSize Y(String Y) { + this.Y = Y; + isSetY = true; // mark as set + return this; + } + + /** + * Ordinate of a point coordinates. The hexadecimal value in text of the ordinate of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * + * @return Y Ordinate of a point coordinates. The hexadecimal value in text of the ordinate of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + */ + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getY() { + return Y; + } + + /** + * Ordinate of a point coordinates. The hexadecimal value in text of the ordinate of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + * + * @param Y Ordinate of a point coordinates. The hexadecimal value in text of the ordinate of the + * coordinates of a point. Leading zero can be removed (e.g. 3BC, 0, and 1287). + */ + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(String Y) { + this.Y = Y; + isSetY = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AreaSize includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AreaSize object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AreaSize areaSize = (AreaSize) o; + return Objects.equals(this.X, areaSize.X) + && Objects.equals(this.isSetX, areaSize.isSetX) + && Objects.equals(this.Y, areaSize.Y) + && Objects.equals(this.isSetY, areaSize.isSetY); + } + + @Override + public int hashCode() { + return Objects.hash(X, isSetX, Y, isSetY); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AreaSize {\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetX) { + addIfNull(nulls, JSON_PROPERTY_X, this.X); + } + if (isSetY) { + addIfNull(nulls, JSON_PROPERTY_Y, this.Y); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AreaSize given an JSON string + * + * @param jsonString JSON string + * @return An instance of AreaSize + * @throws JsonProcessingException if the JSON string is invalid with respect to AreaSize + */ + public static AreaSize fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AreaSize.class); + } + + /** + * Convert an instance of AreaSize to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/BalanceInquiryRequest.java b/src/main/java/com/adyen/model/tapi/BalanceInquiryRequest.java new file mode 100644 index 000000000..daf9c6f41 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/BalanceInquiryRequest.java @@ -0,0 +1,231 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * It conveys Information related to the account for which a Balance Inquiry is requested. Content + * of the Balance Inquiry Request message. + */ +@JsonPropertyOrder({ + BalanceInquiryRequest.JSON_PROPERTY_PAYMENT_ACCOUNT_REQ, + BalanceInquiryRequest.JSON_PROPERTY_LOYALTY_ACCOUNT_REQ +}) +public class BalanceInquiryRequest { + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_REQ = "PaymentAccountReq"; + private PaymentAccountReq paymentAccountReq; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountReq = false; + + public static final String JSON_PROPERTY_LOYALTY_ACCOUNT_REQ = "LoyaltyAccountReq"; + private LoyaltyAccountReq loyaltyAccountReq; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAccountReq = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public BalanceInquiryRequest() {} + + /** + * Data related to the account pointed by the payment card. + * + * @param paymentAccountReq Data related to the account pointed by the payment card. + * @return the current {@code BalanceInquiryRequest} instance, allowing for method chaining + */ + public BalanceInquiryRequest paymentAccountReq(PaymentAccountReq paymentAccountReq) { + this.paymentAccountReq = paymentAccountReq; + isSetPaymentAccountReq = true; // mark as set + return this; + } + + /** + * Data related to the account pointed by the payment card. + * + * @return paymentAccountReq Data related to the account pointed by the payment card. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACCOUNT_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentAccountReq getPaymentAccountReq() { + return paymentAccountReq; + } + + /** + * Data related to the account pointed by the payment card. + * + * @param paymentAccountReq Data related to the account pointed by the payment card. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACCOUNT_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentAccountReq(PaymentAccountReq paymentAccountReq) { + this.paymentAccountReq = paymentAccountReq; + isSetPaymentAccountReq = true; // mark as set + } + + /** + * Data related to a requested Loyalty program or account. + * + * @param loyaltyAccountReq Data related to a requested Loyalty program or account. + * @return the current {@code BalanceInquiryRequest} instance, allowing for method chaining + */ + public BalanceInquiryRequest loyaltyAccountReq(LoyaltyAccountReq loyaltyAccountReq) { + this.loyaltyAccountReq = loyaltyAccountReq; + isSetLoyaltyAccountReq = true; // mark as set + return this; + } + + /** + * Data related to a requested Loyalty program or account. + * + * @return loyaltyAccountReq Data related to a requested Loyalty program or account. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyAccountReq getLoyaltyAccountReq() { + return loyaltyAccountReq; + } + + /** + * Data related to a requested Loyalty program or account. + * + * @param loyaltyAccountReq Data related to a requested Loyalty program or account. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAccountReq(LoyaltyAccountReq loyaltyAccountReq) { + this.loyaltyAccountReq = loyaltyAccountReq; + isSetLoyaltyAccountReq = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceInquiryRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this BalanceInquiryRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceInquiryRequest balanceInquiryRequest = (BalanceInquiryRequest) o; + return Objects.equals(this.paymentAccountReq, balanceInquiryRequest.paymentAccountReq) + && Objects.equals(this.isSetPaymentAccountReq, balanceInquiryRequest.isSetPaymentAccountReq) + && Objects.equals(this.loyaltyAccountReq, balanceInquiryRequest.loyaltyAccountReq) + && Objects.equals( + this.isSetLoyaltyAccountReq, balanceInquiryRequest.isSetLoyaltyAccountReq); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentAccountReq, isSetPaymentAccountReq, loyaltyAccountReq, isSetLoyaltyAccountReq); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceInquiryRequest {\n"); + sb.append(" paymentAccountReq: ").append(toIndentedString(paymentAccountReq)).append("\n"); + sb.append(" loyaltyAccountReq: ").append(toIndentedString(loyaltyAccountReq)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentAccountReq) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_REQ, this.paymentAccountReq); + } + if (isSetLoyaltyAccountReq) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACCOUNT_REQ, this.loyaltyAccountReq); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of BalanceInquiryRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceInquiryRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * BalanceInquiryRequest + */ + public static BalanceInquiryRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BalanceInquiryRequest.class); + } + + /** + * Convert an instance of BalanceInquiryRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/BalanceInquiryResponse.java b/src/main/java/com/adyen/model/tapi/BalanceInquiryResponse.java new file mode 100644 index 000000000..312cf2aeb --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/BalanceInquiryResponse.java @@ -0,0 +1,302 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * Content of the Balance Inquiry Response message. It conveys the balance and the identification of + * the associated payment, loyalty or stored value account. + */ +@JsonPropertyOrder({ + BalanceInquiryResponse.JSON_PROPERTY_RESPONSE, + BalanceInquiryResponse.JSON_PROPERTY_PAYMENT_ACCOUNT_STATUS, + BalanceInquiryResponse.JSON_PROPERTY_PAYMENT_RECEIPT +}) +public class BalanceInquiryResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_STATUS = "PaymentAccountStatus"; + private PaymentAccountStatus paymentAccountStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountStatus = false; + + public static final String JSON_PROPERTY_PAYMENT_RECEIPT = "PaymentReceipt"; + private List paymentReceipt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReceipt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public BalanceInquiryResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code BalanceInquiryResponse} instance, allowing for method chaining + */ + public BalanceInquiryResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data related to the result of a Balance Inquiry request. If BalanceInquiryRequest. + * PaymentAccount present. + * + * @param paymentAccountStatus Data related to the result of a Balance Inquiry request. If + * BalanceInquiryRequest. PaymentAccount present. + * @return the current {@code BalanceInquiryResponse} instance, allowing for method chaining + */ + public BalanceInquiryResponse paymentAccountStatus(PaymentAccountStatus paymentAccountStatus) { + this.paymentAccountStatus = paymentAccountStatus; + isSetPaymentAccountStatus = true; // mark as set + return this; + } + + /** + * Data related to the result of a Balance Inquiry request. If BalanceInquiryRequest. + * PaymentAccount present. + * + * @return paymentAccountStatus Data related to the result of a Balance Inquiry request. If + * BalanceInquiryRequest. PaymentAccount present. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACCOUNT_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentAccountStatus getPaymentAccountStatus() { + return paymentAccountStatus; + } + + /** + * Data related to the result of a Balance Inquiry request. If BalanceInquiryRequest. + * PaymentAccount present. + * + * @param paymentAccountStatus Data related to the result of a Balance Inquiry request. If + * BalanceInquiryRequest. PaymentAccount present. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACCOUNT_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentAccountStatus(PaymentAccountStatus paymentAccountStatus) { + this.paymentAccountStatus = paymentAccountStatus; + isSetPaymentAccountStatus = true; // mark as set + } + + /** + * paymentReceipt + * + * @param paymentReceipt + * @return the current {@code BalanceInquiryResponse} instance, allowing for method chaining + */ + public BalanceInquiryResponse paymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + return this; + } + + public BalanceInquiryResponse addPaymentReceiptItem(PaymentReceipt paymentReceiptItem) { + if (this.paymentReceipt == null) { + this.paymentReceipt = new ArrayList<>(); + } + this.paymentReceipt.add(paymentReceiptItem); + return this; + } + + /** + * Get paymentReceipt + * + * @return paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentReceipt() { + return paymentReceipt; + } + + /** + * paymentReceipt + * + * @param paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceInquiryResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this BalanceInquiryResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceInquiryResponse balanceInquiryResponse = (BalanceInquiryResponse) o; + return Objects.equals(this.response, balanceInquiryResponse.response) + && Objects.equals(this.isSetResponse, balanceInquiryResponse.isSetResponse) + && Objects.equals(this.paymentAccountStatus, balanceInquiryResponse.paymentAccountStatus) + && Objects.equals( + this.isSetPaymentAccountStatus, balanceInquiryResponse.isSetPaymentAccountStatus) + && Objects.equals(this.paymentReceipt, balanceInquiryResponse.paymentReceipt) + && Objects.equals(this.isSetPaymentReceipt, balanceInquiryResponse.isSetPaymentReceipt); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + paymentAccountStatus, + isSetPaymentAccountStatus, + paymentReceipt, + isSetPaymentReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceInquiryResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" paymentAccountStatus: ") + .append(toIndentedString(paymentAccountStatus)) + .append("\n"); + sb.append(" paymentReceipt: ").append(toIndentedString(paymentReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetPaymentAccountStatus) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_STATUS, this.paymentAccountStatus); + } + if (isSetPaymentReceipt) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RECEIPT, this.paymentReceipt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of BalanceInquiryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceInquiryResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * BalanceInquiryResponse + */ + public static BalanceInquiryResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BalanceInquiryResponse.class); + } + + /** + * Convert an instance of BalanceInquiryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CapturedSignature.java b/src/main/java/com/adyen/model/tapi/CapturedSignature.java new file mode 100644 index 000000000..9fc294925 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CapturedSignature.java @@ -0,0 +1,256 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** CapturedSignature */ +@JsonPropertyOrder({ + CapturedSignature.JSON_PROPERTY_AREA_SIZE, + CapturedSignature.JSON_PROPERTY_SIGNATURE_POINT +}) +public class CapturedSignature { + public static final String JSON_PROPERTY_AREA_SIZE = "AreaSize"; + private AreaSize areaSize; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAreaSize = false; + + public static final String JSON_PROPERTY_SIGNATURE_POINT = "SignaturePoint"; + private List signaturePoint; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSignaturePoint = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CapturedSignature() {} + + /** + * Size of an area. Contain the size of the pad area where the signature is written, given with + * the maximum abscissa and ordinate values (X and Y). The maximum value is FFFF. + * + * @param areaSize Size of an area. Contain the size of the pad area where the signature is + * written, given with the maximum abscissa and ordinate values (X and Y). The maximum value + * is FFFF. + * @return the current {@code CapturedSignature} instance, allowing for method chaining + */ + public CapturedSignature areaSize(AreaSize areaSize) { + this.areaSize = areaSize; + isSetAreaSize = true; // mark as set + return this; + } + + /** + * Size of an area. Contain the size of the pad area where the signature is written, given with + * the maximum abscissa and ordinate values (X and Y). The maximum value is FFFF. + * + * @return areaSize Size of an area. Contain the size of the pad area where the signature is + * written, given with the maximum abscissa and ordinate values (X and Y). The maximum value + * is FFFF. + */ + @JsonProperty(JSON_PROPERTY_AREA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AreaSize getAreaSize() { + return areaSize; + } + + /** + * Size of an area. Contain the size of the pad area where the signature is written, given with + * the maximum abscissa and ordinate values (X and Y). The maximum value is FFFF. + * + * @param areaSize Size of an area. Contain the size of the pad area where the signature is + * written, given with the maximum abscissa and ordinate values (X and Y). The maximum value + * is FFFF. + */ + @JsonProperty(JSON_PROPERTY_AREA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAreaSize(AreaSize areaSize) { + this.areaSize = areaSize; + isSetAreaSize = true; // mark as set + } + + /** + * Coordinates of a point where the pen changes direction or lift. Contain the Coordinates of a + * point of the written signature where the pen changes direction or lift where (X and Y). When + * the signer lifts the pen, both X and Y have the value FFFF. + * + * @param signaturePoint Coordinates of a point where the pen changes direction or lift. Contain + * the Coordinates of a point of the written signature where the pen changes direction or lift + * where (X and Y). When the signer lifts the pen, both X and Y have the value FFFF. + * @return the current {@code CapturedSignature} instance, allowing for method chaining + */ + public CapturedSignature signaturePoint(List signaturePoint) { + this.signaturePoint = signaturePoint; + isSetSignaturePoint = true; // mark as set + return this; + } + + public CapturedSignature addSignaturePointItem(Point signaturePointItem) { + if (this.signaturePoint == null) { + this.signaturePoint = new ArrayList<>(); + } + this.signaturePoint.add(signaturePointItem); + return this; + } + + /** + * Coordinates of a point where the pen changes direction or lift. Contain the Coordinates of a + * point of the written signature where the pen changes direction or lift where (X and Y). When + * the signer lifts the pen, both X and Y have the value FFFF. + * + * @return signaturePoint Coordinates of a point where the pen changes direction or lift. Contain + * the Coordinates of a point of the written signature where the pen changes direction or lift + * where (X and Y). When the signer lifts the pen, both X and Y have the value FFFF. + */ + @JsonProperty(JSON_PROPERTY_SIGNATURE_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignaturePoint() { + return signaturePoint; + } + + /** + * Coordinates of a point where the pen changes direction or lift. Contain the Coordinates of a + * point of the written signature where the pen changes direction or lift where (X and Y). When + * the signer lifts the pen, both X and Y have the value FFFF. + * + * @param signaturePoint Coordinates of a point where the pen changes direction or lift. Contain + * the Coordinates of a point of the written signature where the pen changes direction or lift + * where (X and Y). When the signer lifts the pen, both X and Y have the value FFFF. + */ + @JsonProperty(JSON_PROPERTY_SIGNATURE_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignaturePoint(List signaturePoint) { + this.signaturePoint = signaturePoint; + isSetSignaturePoint = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapturedSignature includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CapturedSignature object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapturedSignature capturedSignature = (CapturedSignature) o; + return Objects.equals(this.areaSize, capturedSignature.areaSize) + && Objects.equals(this.isSetAreaSize, capturedSignature.isSetAreaSize) + && Objects.equals(this.signaturePoint, capturedSignature.signaturePoint) + && Objects.equals(this.isSetSignaturePoint, capturedSignature.isSetSignaturePoint); + } + + @Override + public int hashCode() { + return Objects.hash(areaSize, isSetAreaSize, signaturePoint, isSetSignaturePoint); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapturedSignature {\n"); + sb.append(" areaSize: ").append(toIndentedString(areaSize)).append("\n"); + sb.append(" signaturePoint: ").append(toIndentedString(signaturePoint)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAreaSize) { + addIfNull(nulls, JSON_PROPERTY_AREA_SIZE, this.areaSize); + } + if (isSetSignaturePoint) { + addIfNull(nulls, JSON_PROPERTY_SIGNATURE_POINT, this.signaturePoint); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CapturedSignature given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapturedSignature + * @throws JsonProcessingException if the JSON string is invalid with respect to CapturedSignature + */ + public static CapturedSignature fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CapturedSignature.class); + } + + /** + * Convert an instance of CapturedSignature to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardAcquisitionRequest.java b/src/main/java/com/adyen/model/tapi/CardAcquisitionRequest.java new file mode 100644 index 000000000..10a7ad8bf --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardAcquisitionRequest.java @@ -0,0 +1,238 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * It conveys Information related to the payment and loyalty cards to read and analyse. This message + * pair is usually followed by a message pair (e.g. payment or loyalty) which refers to this Card + * Acquisition message pair. Content of the Card Acquisition Request message. + */ +@JsonPropertyOrder({ + CardAcquisitionRequest.JSON_PROPERTY_SALE_DATA, + CardAcquisitionRequest.JSON_PROPERTY_CARD_ACQUISITION_TRANSACTION +}) +public class CardAcquisitionRequest { + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_CARD_ACQUISITION_TRANSACTION = + "CardAcquisitionTransaction"; + private CardAcquisitionTransaction cardAcquisitionTransaction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionTransaction = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardAcquisitionRequest() {} + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + * @return the current {@code CardAcquisitionRequest} instance, allowing for method chaining + */ + public CardAcquisitionRequest saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. + * + * @return saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the payment and loyalty card acquisition. + * + * @param cardAcquisitionTransaction Data related to the payment and loyalty card acquisition. + * @return the current {@code CardAcquisitionRequest} instance, allowing for method chaining + */ + public CardAcquisitionRequest cardAcquisitionTransaction( + CardAcquisitionTransaction cardAcquisitionTransaction) { + this.cardAcquisitionTransaction = cardAcquisitionTransaction; + isSetCardAcquisitionTransaction = true; // mark as set + return this; + } + + /** + * Data related to the payment and loyalty card acquisition. + * + * @return cardAcquisitionTransaction Data related to the payment and loyalty card acquisition. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardAcquisitionTransaction getCardAcquisitionTransaction() { + return cardAcquisitionTransaction; + } + + /** + * Data related to the payment and loyalty card acquisition. + * + * @param cardAcquisitionTransaction Data related to the payment and loyalty card acquisition. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionTransaction(CardAcquisitionTransaction cardAcquisitionTransaction) { + this.cardAcquisitionTransaction = cardAcquisitionTransaction; + isSetCardAcquisitionTransaction = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardAcquisitionRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardAcquisitionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardAcquisitionRequest cardAcquisitionRequest = (CardAcquisitionRequest) o; + return Objects.equals(this.saleData, cardAcquisitionRequest.saleData) + && Objects.equals(this.isSetSaleData, cardAcquisitionRequest.isSetSaleData) + && Objects.equals( + this.cardAcquisitionTransaction, cardAcquisitionRequest.cardAcquisitionTransaction) + && Objects.equals( + this.isSetCardAcquisitionTransaction, + cardAcquisitionRequest.isSetCardAcquisitionTransaction); + } + + @Override + public int hashCode() { + return Objects.hash( + saleData, isSetSaleData, cardAcquisitionTransaction, isSetCardAcquisitionTransaction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardAcquisitionRequest {\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" cardAcquisitionTransaction: ") + .append(toIndentedString(cardAcquisitionTransaction)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetCardAcquisitionTransaction) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_TRANSACTION, this.cardAcquisitionTransaction); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardAcquisitionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardAcquisitionRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CardAcquisitionRequest + */ + public static CardAcquisitionRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardAcquisitionRequest.class); + } + + /** + * Convert an instance of CardAcquisitionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardAcquisitionResponse.java b/src/main/java/com/adyen/model/tapi/CardAcquisitionResponse.java new file mode 100644 index 000000000..34299c4ef --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardAcquisitionResponse.java @@ -0,0 +1,467 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the payment and loyalty cards read and processed by the POI + * System and entered by the Customer. Content of the Card Acquisition Response message. + */ +@JsonPropertyOrder({ + CardAcquisitionResponse.JSON_PROPERTY_RESPONSE, + CardAcquisitionResponse.JSON_PROPERTY_SALE_DATA, + CardAcquisitionResponse.JSON_PROPERTY_PO_I_DATA, + CardAcquisitionResponse.JSON_PROPERTY_PAYMENT_BRAND, + CardAcquisitionResponse.JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, + CardAcquisitionResponse.JSON_PROPERTY_LOYALTY_ACCOUNT +}) +public class CardAcquisitionResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_PO_I_DATA = "POIData"; + private POIData poIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIData = false; + + public static final String JSON_PROPERTY_PAYMENT_BRAND = "PaymentBrand"; + private List paymentBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentBrand = false; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA = "PaymentInstrumentData"; + private PaymentInstrumentData paymentInstrumentData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentData = false; + + public static final String JSON_PROPERTY_LOYALTY_ACCOUNT = "LoyaltyAccount"; + private List loyaltyAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAccount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardAcquisitionResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code CardAcquisitionResponse} instance, allowing for method chaining + */ + public CardAcquisitionResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + * @return the current {@code CardAcquisitionResponse} instance, allowing for method chaining + */ + public CardAcquisitionResponse saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. + * + * @return saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + * @return the current {@code CardAcquisitionResponse} instance, allowing for method chaining + */ + public CardAcquisitionResponse poIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + return this; + } + + /** + * Data related to the POI System. + * + * @return poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIData getPoIData() { + return poIData; + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + } + + /** + * Type of payment card. Brands available for payment by the card and not chosen by the Customer. + * + * @param paymentBrand Type of payment card. Brands available for payment by the card and not + * chosen by the Customer. + * @return the current {@code CardAcquisitionResponse} instance, allowing for method chaining + */ + public CardAcquisitionResponse paymentBrand(List paymentBrand) { + this.paymentBrand = paymentBrand; + isSetPaymentBrand = true; // mark as set + return this; + } + + public CardAcquisitionResponse addPaymentBrandItem(String paymentBrandItem) { + if (this.paymentBrand == null) { + this.paymentBrand = new ArrayList<>(); + } + this.paymentBrand.add(paymentBrandItem); + return this; + } + + /** + * Type of payment card. Brands available for payment by the card and not chosen by the Customer. + * + * @return paymentBrand Type of payment card. Brands available for payment by the card and not + * chosen by the Customer. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentBrand() { + return paymentBrand; + } + + /** + * Type of payment card. Brands available for payment by the card and not chosen by the Customer. + * + * @param paymentBrand Type of payment card. Brands available for payment by the card and not + * chosen by the Customer. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentBrand(List paymentBrand) { + this.paymentBrand = paymentBrand; + isSetPaymentBrand = true; // mark as set + } + + /** + * Data related to the instrument of payment for the transaction. If this type of payment card is + * configured to send information if the CardAcquisition response. + * + * @param paymentInstrumentData Data related to the instrument of payment for the transaction. If + * this type of payment card is configured to send information if the CardAcquisition + * response. + * @return the current {@code CardAcquisitionResponse} instance, allowing for method chaining + */ + public CardAcquisitionResponse paymentInstrumentData( + PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + return this; + } + + /** + * Data related to the instrument of payment for the transaction. If this type of payment card is + * configured to send information if the CardAcquisition response. + * + * @return paymentInstrumentData Data related to the instrument of payment for the transaction. If + * this type of payment card is configured to send information if the CardAcquisition + * response. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * Data related to the instrument of payment for the transaction. If this type of payment card is + * configured to send information if the CardAcquisition response. + * + * @param paymentInstrumentData Data related to the instrument of payment for the transaction. If + * this type of payment card is configured to send information if the CardAcquisition + * response. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + } + + /** + * Data related to the loyalty System. + * + * @param loyaltyAccount Data related to the loyalty System. + * @return the current {@code CardAcquisitionResponse} instance, allowing for method chaining + */ + public CardAcquisitionResponse loyaltyAccount(List loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + isSetLoyaltyAccount = true; // mark as set + return this; + } + + public CardAcquisitionResponse addLoyaltyAccountItem(LoyaltyAccount loyaltyAccountItem) { + if (this.loyaltyAccount == null) { + this.loyaltyAccount = new ArrayList<>(); + } + this.loyaltyAccount.add(loyaltyAccountItem); + return this; + } + + /** + * Data related to the loyalty System. + * + * @return loyaltyAccount Data related to the loyalty System. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLoyaltyAccount() { + return loyaltyAccount; + } + + /** + * Data related to the loyalty System. + * + * @param loyaltyAccount Data related to the loyalty System. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAccount(List loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + isSetLoyaltyAccount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardAcquisitionResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardAcquisitionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardAcquisitionResponse cardAcquisitionResponse = (CardAcquisitionResponse) o; + return Objects.equals(this.response, cardAcquisitionResponse.response) + && Objects.equals(this.isSetResponse, cardAcquisitionResponse.isSetResponse) + && Objects.equals(this.saleData, cardAcquisitionResponse.saleData) + && Objects.equals(this.isSetSaleData, cardAcquisitionResponse.isSetSaleData) + && Objects.equals(this.poIData, cardAcquisitionResponse.poIData) + && Objects.equals(this.isSetPoIData, cardAcquisitionResponse.isSetPoIData) + && Objects.equals(this.paymentBrand, cardAcquisitionResponse.paymentBrand) + && Objects.equals(this.isSetPaymentBrand, cardAcquisitionResponse.isSetPaymentBrand) + && Objects.equals(this.paymentInstrumentData, cardAcquisitionResponse.paymentInstrumentData) + && Objects.equals( + this.isSetPaymentInstrumentData, cardAcquisitionResponse.isSetPaymentInstrumentData) + && Objects.equals(this.loyaltyAccount, cardAcquisitionResponse.loyaltyAccount) + && Objects.equals(this.isSetLoyaltyAccount, cardAcquisitionResponse.isSetLoyaltyAccount); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + saleData, + isSetSaleData, + poIData, + isSetPoIData, + paymentBrand, + isSetPaymentBrand, + paymentInstrumentData, + isSetPaymentInstrumentData, + loyaltyAccount, + isSetLoyaltyAccount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardAcquisitionResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poIData: ").append(toIndentedString(poIData)).append("\n"); + sb.append(" paymentBrand: ").append(toIndentedString(paymentBrand)).append("\n"); + sb.append(" paymentInstrumentData: ") + .append(toIndentedString(paymentInstrumentData)) + .append("\n"); + sb.append(" loyaltyAccount: ").append(toIndentedString(loyaltyAccount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetPoIData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_DATA, this.poIData); + } + if (isSetPaymentBrand) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_BRAND, this.paymentBrand); + } + if (isSetPaymentInstrumentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, this.paymentInstrumentData); + } + if (isSetLoyaltyAccount) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACCOUNT, this.loyaltyAccount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardAcquisitionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardAcquisitionResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CardAcquisitionResponse + */ + public static CardAcquisitionResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardAcquisitionResponse.class); + } + + /** + * Convert an instance of CardAcquisitionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardAcquisitionTransaction.java b/src/main/java/com/adyen/model/tapi/CardAcquisitionTransaction.java new file mode 100644 index 000000000..2c80955ed --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardAcquisitionTransaction.java @@ -0,0 +1,753 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** CardAcquisitionTransaction */ +@JsonPropertyOrder({ + CardAcquisitionTransaction.JSON_PROPERTY_ALLOWED_PAYMENT_BRAND, + CardAcquisitionTransaction.JSON_PROPERTY_ALLOWED_LOYALTY_BRAND, + CardAcquisitionTransaction.JSON_PROPERTY_LOYALTY_HANDLING, + CardAcquisitionTransaction.JSON_PROPERTY_CUSTOMER_LANGUAGE, + CardAcquisitionTransaction.JSON_PROPERTY_FORCE_ENTRY_MODE, + CardAcquisitionTransaction.JSON_PROPERTY_FORCE_CUSTOMER_SELECTION_FLAG, + CardAcquisitionTransaction.JSON_PROPERTY_TOTAL_AMOUNT, + CardAcquisitionTransaction.JSON_PROPERTY_PAYMENT_TYPE, + CardAcquisitionTransaction.JSON_PROPERTY_CASH_BACK_FLAG +}) +public class CardAcquisitionTransaction { + public static final String JSON_PROPERTY_ALLOWED_PAYMENT_BRAND = "AllowedPaymentBrand"; + private List allowedPaymentBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentBrand = false; + + public static final String JSON_PROPERTY_ALLOWED_LOYALTY_BRAND = "AllowedLoyaltyBrand"; + private List allowedLoyaltyBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLoyaltyBrand = false; + + public static final String JSON_PROPERTY_LOYALTY_HANDLING = "LoyaltyHandling"; + private LoyaltyHandlingType loyaltyHandling; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyHandling = false; + + public static final String JSON_PROPERTY_CUSTOMER_LANGUAGE = "CustomerLanguage"; + private String customerLanguage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerLanguage = false; + + /** Gets or Sets forceEntryMode */ + public enum ForceEntryModeEnum { + CHECK_READER(String.valueOf("CheckReader")), + + CONTACTLESS(String.valueOf("Contactless")), + + FILE(String.valueOf("File")), + + ICC(String.valueOf("ICC")), + + KEYED(String.valueOf("Keyed")), + + MAG_STRIPE(String.valueOf("MagStripe")), + + MANUAL(String.valueOf("Manual")), + + RFID(String.valueOf("RFID")), + + SCANNED(String.valueOf("Scanned")), + + SYNCHRONOUS_ICC(String.valueOf("SynchronousICC")), + + TAPPED(String.valueOf("Tapped")); + + private static final Logger LOG = Logger.getLogger(ForceEntryModeEnum.class.getName()); + + private String value; + + ForceEntryModeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ForceEntryModeEnum fromValue(String value) { + for (ForceEntryModeEnum b : ForceEntryModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "ForceEntryModeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ForceEntryModeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_FORCE_ENTRY_MODE = "ForceEntryMode"; + private List forceEntryMode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetForceEntryMode = false; + + public static final String JSON_PROPERTY_FORCE_CUSTOMER_SELECTION_FLAG = + "ForceCustomerSelectionFlag"; + private Boolean forceCustomerSelectionFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetForceCustomerSelectionFlag = false; + + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "TotalAmount"; + private BigDecimal totalAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + + public static final String JSON_PROPERTY_PAYMENT_TYPE = "PaymentType"; + private PaymentType paymentType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentType = false; + + public static final String JSON_PROPERTY_CASH_BACK_FLAG = "CashBackFlag"; + private Boolean cashBackFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCashBackFlag = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardAcquisitionTransaction() {} + + /** + * Card payment brands allowed by the Sale System for the payment transaction. + * + * @param allowedPaymentBrand Card payment brands allowed by the Sale System for the payment + * transaction. + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction allowedPaymentBrand(List allowedPaymentBrand) { + this.allowedPaymentBrand = allowedPaymentBrand; + isSetAllowedPaymentBrand = true; // mark as set + return this; + } + + public CardAcquisitionTransaction addAllowedPaymentBrandItem(String allowedPaymentBrandItem) { + if (this.allowedPaymentBrand == null) { + this.allowedPaymentBrand = new ArrayList<>(); + } + this.allowedPaymentBrand.add(allowedPaymentBrandItem); + return this; + } + + /** + * Card payment brands allowed by the Sale System for the payment transaction. + * + * @return allowedPaymentBrand Card payment brands allowed by the Sale System for the payment + * transaction. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowedPaymentBrand() { + return allowedPaymentBrand; + } + + /** + * Card payment brands allowed by the Sale System for the payment transaction. + * + * @param allowedPaymentBrand Card payment brands allowed by the Sale System for the payment + * transaction. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedPaymentBrand(List allowedPaymentBrand) { + this.allowedPaymentBrand = allowedPaymentBrand; + isSetAllowedPaymentBrand = true; // mark as set + } + + /** + * Loyalty brands or programs allowed by the Sale System for the loyalty transaction. + * + * @param allowedLoyaltyBrand Loyalty brands or programs allowed by the Sale System for the + * loyalty transaction. + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction allowedLoyaltyBrand(List allowedLoyaltyBrand) { + this.allowedLoyaltyBrand = allowedLoyaltyBrand; + isSetAllowedLoyaltyBrand = true; // mark as set + return this; + } + + public CardAcquisitionTransaction addAllowedLoyaltyBrandItem(String allowedLoyaltyBrandItem) { + if (this.allowedLoyaltyBrand == null) { + this.allowedLoyaltyBrand = new ArrayList<>(); + } + this.allowedLoyaltyBrand.add(allowedLoyaltyBrandItem); + return this; + } + + /** + * Loyalty brands or programs allowed by the Sale System for the loyalty transaction. + * + * @return allowedLoyaltyBrand Loyalty brands or programs allowed by the Sale System for the + * loyalty transaction. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_LOYALTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowedLoyaltyBrand() { + return allowedLoyaltyBrand; + } + + /** + * Loyalty brands or programs allowed by the Sale System for the loyalty transaction. + * + * @param allowedLoyaltyBrand Loyalty brands or programs allowed by the Sale System for the + * loyalty transaction. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_LOYALTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedLoyaltyBrand(List allowedLoyaltyBrand) { + this.allowedLoyaltyBrand = allowedLoyaltyBrand; + isSetAllowedLoyaltyBrand = true; // mark as set + } + + /** + * Type of Loyalty processing requested by the Sale System. An way to specify what the POI has to + * handle concerning the loyalty. Possible values: * **Allowed** * **Forbidden** * **Processed** * + * **Proposed** * **Required** + * + * @param loyaltyHandling Type of Loyalty processing requested by the Sale System. An way to + * specify what the POI has to handle concerning the loyalty. Possible values: * **Allowed** * + * **Forbidden** * **Processed** * **Proposed** * **Required** + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction loyaltyHandling(LoyaltyHandlingType loyaltyHandling) { + this.loyaltyHandling = loyaltyHandling; + isSetLoyaltyHandling = true; // mark as set + return this; + } + + /** + * Type of Loyalty processing requested by the Sale System. An way to specify what the POI has to + * handle concerning the loyalty. Possible values: * **Allowed** * **Forbidden** * **Processed** * + * **Proposed** * **Required** + * + * @return loyaltyHandling Type of Loyalty processing requested by the Sale System. An way to + * specify what the POI has to handle concerning the loyalty. Possible values: * **Allowed** * + * **Forbidden** * **Processed** * **Proposed** * **Required** + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_HANDLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyHandlingType getLoyaltyHandling() { + return loyaltyHandling; + } + + /** + * Type of Loyalty processing requested by the Sale System. An way to specify what the POI has to + * handle concerning the loyalty. Possible values: * **Allowed** * **Forbidden** * **Processed** * + * **Proposed** * **Required** + * + * @param loyaltyHandling Type of Loyalty processing requested by the Sale System. An way to + * specify what the POI has to handle concerning the loyalty. Possible values: * **Allowed** * + * **Forbidden** * **Processed** * **Proposed** * **Required** + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_HANDLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyHandling(LoyaltyHandlingType loyaltyHandling) { + this.loyaltyHandling = loyaltyHandling; + isSetLoyaltyHandling = true; // mark as set + } + + /** + * The language used on the terminal screen or in text printed by the terminal. Typical use case + * is setting the language on unattended terminals. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @param customerLanguage The language used on the terminal screen or in text printed by the + * terminal. Typical use case is setting the language on unattended terminals. Format: + * two-character [ISO 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) + * format. + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction customerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + isSetCustomerLanguage = true; // mark as set + return this; + } + + /** + * The language used on the terminal screen or in text printed by the terminal. Typical use case + * is setting the language on unattended terminals. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @return customerLanguage The language used on the terminal screen or in text printed by the + * terminal. Typical use case is setting the language on unattended terminals. Format: + * two-character [ISO 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) + * format. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * The language used on the terminal screen or in text printed by the terminal. Typical use case + * is setting the language on unattended terminals. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @param customerLanguage The language used on the terminal screen or in text printed by the + * terminal. Typical use case is setting the language on unattended terminals. Format: + * two-character [ISO 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) + * format. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + isSetCustomerLanguage = true; // mark as set + } + + /** + * forceEntryMode + * + * @param forceEntryMode + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction forceEntryMode(List forceEntryMode) { + this.forceEntryMode = forceEntryMode; + isSetForceEntryMode = true; // mark as set + return this; + } + + public CardAcquisitionTransaction addForceEntryModeItem(ForceEntryModeEnum forceEntryModeItem) { + if (this.forceEntryMode == null) { + this.forceEntryMode = new ArrayList<>(); + } + this.forceEntryMode.add(forceEntryModeItem); + return this; + } + + /** + * Get forceEntryMode + * + * @return forceEntryMode + */ + @JsonProperty(JSON_PROPERTY_FORCE_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getForceEntryMode() { + return forceEntryMode; + } + + /** + * forceEntryMode + * + * @param forceEntryMode + */ + @JsonProperty(JSON_PROPERTY_FORCE_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceEntryMode(List forceEntryMode) { + this.forceEntryMode = forceEntryMode; + isSetForceEntryMode = true; // mark as set + } + + /** + * Indicates if the Customer realises the selection of the card application. + * + * @param forceCustomerSelectionFlag Indicates if the Customer realises the selection of the card + * application. + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction forceCustomerSelectionFlag(Boolean forceCustomerSelectionFlag) { + this.forceCustomerSelectionFlag = forceCustomerSelectionFlag; + isSetForceCustomerSelectionFlag = true; // mark as set + return this; + } + + /** + * Indicates if the Customer realises the selection of the card application. + * + * @return forceCustomerSelectionFlag Indicates if the Customer realises the selection of the card + * application. + */ + @JsonProperty(JSON_PROPERTY_FORCE_CUSTOMER_SELECTION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceCustomerSelectionFlag() { + return forceCustomerSelectionFlag; + } + + /** + * Indicates if the Customer realises the selection of the card application. + * + * @param forceCustomerSelectionFlag Indicates if the Customer realises the selection of the card + * application. + */ + @JsonProperty(JSON_PROPERTY_FORCE_CUSTOMER_SELECTION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceCustomerSelectionFlag(Boolean forceCustomerSelectionFlag) { + this.forceCustomerSelectionFlag = forceCustomerSelectionFlag; + isSetForceCustomerSelectionFlag = true; // mark as set + } + + /** + * Amount of a transaction. In the Card Acquisition Request message, it allows the processing of a + * contactless card. + * + * @param totalAmount Amount of a transaction. In the Card Acquisition Request message, it allows + * the processing of a contactless card. + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction totalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set + return this; + } + + /** + * Amount of a transaction. In the Card Acquisition Request message, it allows the processing of a + * contactless card. minimum: 0.0 maximum: 99999999.999999 + * + * @return totalAmount Amount of a transaction. In the Card Acquisition Request message, it allows + * the processing of a contactless card. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTotalAmount() { + return totalAmount; + } + + /** + * Amount of a transaction. In the Card Acquisition Request message, it allows the processing of a + * contactless card. + * + * @param totalAmount Amount of a transaction. In the Card Acquisition Request message, it allows + * the processing of a contactless card. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @param paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction paymentType(PaymentType paymentType) { + this.paymentType = paymentType; + isSetPaymentType = true; // mark as set + return this; + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @return paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentType getPaymentType() { + return paymentType; + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @param paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentType(PaymentType paymentType) { + this.paymentType = paymentType; + isSetPaymentType = true; // mark as set + } + + /** + * Cash back has been requested with the payment transaction. Allows choice of the Customer + * language when the POI displays messages or print text to Merchant interface. + * + * @param cashBackFlag Cash back has been requested with the payment transaction. Allows choice of + * the Customer language when the POI displays messages or print text to Merchant interface. + * @return the current {@code CardAcquisitionTransaction} instance, allowing for method chaining + */ + public CardAcquisitionTransaction cashBackFlag(Boolean cashBackFlag) { + this.cashBackFlag = cashBackFlag; + isSetCashBackFlag = true; // mark as set + return this; + } + + /** + * Cash back has been requested with the payment transaction. Allows choice of the Customer + * language when the POI displays messages or print text to Merchant interface. + * + * @return cashBackFlag Cash back has been requested with the payment transaction. Allows choice + * of the Customer language when the POI displays messages or print text to Merchant + * interface. + */ + @JsonProperty(JSON_PROPERTY_CASH_BACK_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCashBackFlag() { + return cashBackFlag; + } + + /** + * Cash back has been requested with the payment transaction. Allows choice of the Customer + * language when the POI displays messages or print text to Merchant interface. + * + * @param cashBackFlag Cash back has been requested with the payment transaction. Allows choice of + * the Customer language when the POI displays messages or print text to Merchant interface. + */ + @JsonProperty(JSON_PROPERTY_CASH_BACK_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCashBackFlag(Boolean cashBackFlag) { + this.cashBackFlag = cashBackFlag; + isSetCashBackFlag = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardAcquisitionTransaction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardAcquisitionTransaction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardAcquisitionTransaction cardAcquisitionTransaction = (CardAcquisitionTransaction) o; + return Objects.equals(this.allowedPaymentBrand, cardAcquisitionTransaction.allowedPaymentBrand) + && Objects.equals( + this.isSetAllowedPaymentBrand, cardAcquisitionTransaction.isSetAllowedPaymentBrand) + && Objects.equals(this.allowedLoyaltyBrand, cardAcquisitionTransaction.allowedLoyaltyBrand) + && Objects.equals( + this.isSetAllowedLoyaltyBrand, cardAcquisitionTransaction.isSetAllowedLoyaltyBrand) + && Objects.equals(this.loyaltyHandling, cardAcquisitionTransaction.loyaltyHandling) + && Objects.equals( + this.isSetLoyaltyHandling, cardAcquisitionTransaction.isSetLoyaltyHandling) + && Objects.equals(this.customerLanguage, cardAcquisitionTransaction.customerLanguage) + && Objects.equals( + this.isSetCustomerLanguage, cardAcquisitionTransaction.isSetCustomerLanguage) + && Objects.equals(this.forceEntryMode, cardAcquisitionTransaction.forceEntryMode) + && Objects.equals(this.isSetForceEntryMode, cardAcquisitionTransaction.isSetForceEntryMode) + && Objects.equals( + this.forceCustomerSelectionFlag, cardAcquisitionTransaction.forceCustomerSelectionFlag) + && Objects.equals( + this.isSetForceCustomerSelectionFlag, + cardAcquisitionTransaction.isSetForceCustomerSelectionFlag) + && Objects.equals(this.totalAmount, cardAcquisitionTransaction.totalAmount) + && Objects.equals(this.isSetTotalAmount, cardAcquisitionTransaction.isSetTotalAmount) + && Objects.equals(this.paymentType, cardAcquisitionTransaction.paymentType) + && Objects.equals(this.isSetPaymentType, cardAcquisitionTransaction.isSetPaymentType) + && Objects.equals(this.cashBackFlag, cardAcquisitionTransaction.cashBackFlag) + && Objects.equals(this.isSetCashBackFlag, cardAcquisitionTransaction.isSetCashBackFlag); + } + + @Override + public int hashCode() { + return Objects.hash( + allowedPaymentBrand, + isSetAllowedPaymentBrand, + allowedLoyaltyBrand, + isSetAllowedLoyaltyBrand, + loyaltyHandling, + isSetLoyaltyHandling, + customerLanguage, + isSetCustomerLanguage, + forceEntryMode, + isSetForceEntryMode, + forceCustomerSelectionFlag, + isSetForceCustomerSelectionFlag, + totalAmount, + isSetTotalAmount, + paymentType, + isSetPaymentType, + cashBackFlag, + isSetCashBackFlag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardAcquisitionTransaction {\n"); + sb.append(" allowedPaymentBrand: ") + .append(toIndentedString(allowedPaymentBrand)) + .append("\n"); + sb.append(" allowedLoyaltyBrand: ") + .append(toIndentedString(allowedLoyaltyBrand)) + .append("\n"); + sb.append(" loyaltyHandling: ").append(toIndentedString(loyaltyHandling)).append("\n"); + sb.append(" customerLanguage: ").append(toIndentedString(customerLanguage)).append("\n"); + sb.append(" forceEntryMode: ").append(toIndentedString(forceEntryMode)).append("\n"); + sb.append(" forceCustomerSelectionFlag: ") + .append(toIndentedString(forceCustomerSelectionFlag)) + .append("\n"); + sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" cashBackFlag: ").append(toIndentedString(cashBackFlag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowedPaymentBrand) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_BRAND, this.allowedPaymentBrand); + } + if (isSetAllowedLoyaltyBrand) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LOYALTY_BRAND, this.allowedLoyaltyBrand); + } + if (isSetLoyaltyHandling) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_HANDLING, this.loyaltyHandling); + } + if (isSetCustomerLanguage) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_LANGUAGE, this.customerLanguage); + } + if (isSetForceEntryMode) { + addIfNull(nulls, JSON_PROPERTY_FORCE_ENTRY_MODE, this.forceEntryMode); + } + if (isSetForceCustomerSelectionFlag) { + addIfNull( + nulls, JSON_PROPERTY_FORCE_CUSTOMER_SELECTION_FLAG, this.forceCustomerSelectionFlag); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TYPE, this.paymentType); + } + if (isSetCashBackFlag) { + addIfNull(nulls, JSON_PROPERTY_CASH_BACK_FLAG, this.cashBackFlag); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardAcquisitionTransaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardAcquisitionTransaction + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CardAcquisitionTransaction + */ + public static CardAcquisitionTransaction fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardAcquisitionTransaction.class); + } + + /** + * Convert an instance of CardAcquisitionTransaction to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardData.java b/src/main/java/com/adyen/model/tapi/CardData.java new file mode 100644 index 000000000..822c0a3c0 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardData.java @@ -0,0 +1,693 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * Information related to the payment card used for the transaction. Allows acquisition of the card + * data by the Sale System before the Payment, CardAcquisition, or BalanceInquiry request to the + * POI. It can also be sent in the CardAcquisition response, to be processed by the Sale System. + */ +@JsonPropertyOrder({ + CardData.JSON_PROPERTY_PAYMENT_BRAND, + CardData.JSON_PROPERTY_MASKED_PAN, + CardData.JSON_PROPERTY_PAYMENT_ACCOUNT_REF, + CardData.JSON_PROPERTY_ENTRY_MODE, + CardData.JSON_PROPERTY_CARD_COUNTRY_CODE, + CardData.JSON_PROPERTY_PROTECTED_CARD_DATA, + CardData.JSON_PROPERTY_SENSITIVE_CARD_DATA, + CardData.JSON_PROPERTY_PAYMENT_TOKEN +}) +public class CardData { + public static final String JSON_PROPERTY_PAYMENT_BRAND = "PaymentBrand"; + private String paymentBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentBrand = false; + + public static final String JSON_PROPERTY_MASKED_PAN = "MaskedPan"; + private String maskedPan; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskedPan = false; + + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_REF = "PaymentAccountRef"; + private String paymentAccountRef; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountRef = false; + + /** Gets or Sets entryMode */ + public enum EntryModeEnum { + CONTACTLESS(String.valueOf("Contactless")), + + FILE(String.valueOf("File")), + + ICC(String.valueOf("ICC")), + + KEYED(String.valueOf("Keyed")), + + MAG_STRIPE(String.valueOf("MagStripe")), + + MANUAL(String.valueOf("Manual")), + + MOBILE(String.valueOf("Mobile")), + + RFID(String.valueOf("RFID")), + + SCANNED(String.valueOf("Scanned")), + + SYNCHRONOUS_ICC(String.valueOf("SynchronousICC")), + + TAPPED(String.valueOf("Tapped")); + + private static final Logger LOG = Logger.getLogger(EntryModeEnum.class.getName()); + + private String value; + + EntryModeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EntryModeEnum fromValue(String value) { + for (EntryModeEnum b : EntryModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "EntryModeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(EntryModeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_ENTRY_MODE = "EntryMode"; + private List entryMode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntryMode = false; + + public static final String JSON_PROPERTY_CARD_COUNTRY_CODE = "CardCountryCode"; + private Integer cardCountryCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardCountryCode = false; + + public static final String JSON_PROPERTY_PROTECTED_CARD_DATA = "ProtectedCardData"; + private String protectedCardData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProtectedCardData = false; + + public static final String JSON_PROPERTY_SENSITIVE_CARD_DATA = "SensitiveCardData"; + private SensitiveCardData sensitiveCardData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSensitiveCardData = false; + + public static final String JSON_PROPERTY_PAYMENT_TOKEN = "PaymentToken"; + private PaymentToken paymentToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardData() {} + + /** + * Type of payment card. If card PAN is readable. Indicates the card used to pay in the + * PaymentResponse. Sent in the CardAcquisitionResponse, to leave the Cashier to choose between + * several applications in a smartcard, or several brand in a co-branded card. In this case, the + * CardAcquisitionRequest.ForceCustomerSelectionFlag must contain the value False. Brands are part + * of the POI and Sale Systems configurations. + * + * @param paymentBrand Type of payment card. If card PAN is readable. Indicates the card used to + * pay in the PaymentResponse. Sent in the CardAcquisitionResponse, to leave the Cashier to + * choose between several applications in a smartcard, or several brand in a co-branded card. + * In this case, the CardAcquisitionRequest.ForceCustomerSelectionFlag must contain the value + * False. Brands are part of the POI and Sale Systems configurations. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData paymentBrand(String paymentBrand) { + this.paymentBrand = paymentBrand; + isSetPaymentBrand = true; // mark as set + return this; + } + + /** + * Type of payment card. If card PAN is readable. Indicates the card used to pay in the + * PaymentResponse. Sent in the CardAcquisitionResponse, to leave the Cashier to choose between + * several applications in a smartcard, or several brand in a co-branded card. In this case, the + * CardAcquisitionRequest.ForceCustomerSelectionFlag must contain the value False. Brands are part + * of the POI and Sale Systems configurations. + * + * @return paymentBrand Type of payment card. If card PAN is readable. Indicates the card used to + * pay in the PaymentResponse. Sent in the CardAcquisitionResponse, to leave the Cashier to + * choose between several applications in a smartcard, or several brand in a co-branded card. + * In this case, the CardAcquisitionRequest.ForceCustomerSelectionFlag must contain the value + * False. Brands are part of the POI and Sale Systems configurations. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPaymentBrand() { + return paymentBrand; + } + + /** + * Type of payment card. If card PAN is readable. Indicates the card used to pay in the + * PaymentResponse. Sent in the CardAcquisitionResponse, to leave the Cashier to choose between + * several applications in a smartcard, or several brand in a co-branded card. In this case, the + * CardAcquisitionRequest.ForceCustomerSelectionFlag must contain the value False. Brands are part + * of the POI and Sale Systems configurations. + * + * @param paymentBrand Type of payment card. If card PAN is readable. Indicates the card used to + * pay in the PaymentResponse. Sent in the CardAcquisitionResponse, to leave the Cashier to + * choose between several applications in a smartcard, or several brand in a co-branded card. + * In this case, the CardAcquisitionRequest.ForceCustomerSelectionFlag must contain the value + * False. Brands are part of the POI and Sale Systems configurations. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentBrand(String paymentBrand) { + this.paymentBrand = paymentBrand; + isSetPaymentBrand = true; // mark as set + } + + /** + * Masked Primary Account Number Part of the PAN is replaced by a string of * characters, to + * identify a customer account or relationship. Presence of this data element, which replace the + * PAN when SensitiveCardData is protected and replaced by ProtectedCardData. Alternatively the + * MaskedPAN can be used as a token to identify a customer. + * + * @param maskedPan Masked Primary Account Number Part of the PAN is replaced by a string of * + * characters, to identify a customer account or relationship. Presence of this data element, + * which replace the PAN when SensitiveCardData is protected and replaced by + * ProtectedCardData. Alternatively the MaskedPAN can be used as a token to identify a + * customer. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData maskedPan(String maskedPan) { + this.maskedPan = maskedPan; + isSetMaskedPan = true; // mark as set + return this; + } + + /** + * Masked Primary Account Number Part of the PAN is replaced by a string of * characters, to + * identify a customer account or relationship. Presence of this data element, which replace the + * PAN when SensitiveCardData is protected and replaced by ProtectedCardData. Alternatively the + * MaskedPAN can be used as a token to identify a customer. + * + * @return maskedPan Masked Primary Account Number Part of the PAN is replaced by a string of * + * characters, to identify a customer account or relationship. Presence of this data element, + * which replace the PAN when SensitiveCardData is protected and replaced by + * ProtectedCardData. Alternatively the MaskedPAN can be used as a token to identify a + * customer. + */ + @JsonProperty(JSON_PROPERTY_MASKED_PAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMaskedPan() { + return maskedPan; + } + + /** + * Masked Primary Account Number Part of the PAN is replaced by a string of * characters, to + * identify a customer account or relationship. Presence of this data element, which replace the + * PAN when SensitiveCardData is protected and replaced by ProtectedCardData. Alternatively the + * MaskedPAN can be used as a token to identify a customer. + * + * @param maskedPan Masked Primary Account Number Part of the PAN is replaced by a string of * + * characters, to identify a customer account or relationship. Presence of this data element, + * which replace the PAN when SensitiveCardData is protected and replaced by + * ProtectedCardData. Alternatively the MaskedPAN can be used as a token to identify a + * customer. + */ + @JsonProperty(JSON_PROPERTY_MASKED_PAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaskedPan(String maskedPan) { + this.maskedPan = maskedPan; + isSetMaskedPan = true; // mark as set + } + + /** + * Reference of the PAN, which identifies the PAN or the card uniquely, named also PAR (Payment + * Account Reference). This reference may be defined by the card issuer or by a token service + * provider under the control of the card issuer, and cannot be used for a payment transaction. + * + * @param paymentAccountRef Reference of the PAN, which identifies the PAN or the card uniquely, + * named also PAR (Payment Account Reference). This reference may be defined by the card + * issuer or by a token service provider under the control of the card issuer, and cannot be + * used for a payment transaction. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData paymentAccountRef(String paymentAccountRef) { + this.paymentAccountRef = paymentAccountRef; + isSetPaymentAccountRef = true; // mark as set + return this; + } + + /** + * Reference of the PAN, which identifies the PAN or the card uniquely, named also PAR (Payment + * Account Reference). This reference may be defined by the card issuer or by a token service + * provider under the control of the card issuer, and cannot be used for a payment transaction. + * + * @return paymentAccountRef Reference of the PAN, which identifies the PAN or the card uniquely, + * named also PAR (Payment Account Reference). This reference may be defined by the card + * issuer or by a token service provider under the control of the card issuer, and cannot be + * used for a payment transaction. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACCOUNT_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPaymentAccountRef() { + return paymentAccountRef; + } + + /** + * Reference of the PAN, which identifies the PAN or the card uniquely, named also PAR (Payment + * Account Reference). This reference may be defined by the card issuer or by a token service + * provider under the control of the card issuer, and cannot be used for a payment transaction. + * + * @param paymentAccountRef Reference of the PAN, which identifies the PAN or the card uniquely, + * named also PAR (Payment Account Reference). This reference may be defined by the card + * issuer or by a token service provider under the control of the card issuer, and cannot be + * used for a payment transaction. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACCOUNT_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentAccountRef(String paymentAccountRef) { + this.paymentAccountRef = paymentAccountRef; + isSetPaymentAccountRef = true; // mark as set + } + + /** + * entryMode + * + * @param entryMode + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData entryMode(List entryMode) { + this.entryMode = entryMode; + isSetEntryMode = true; // mark as set + return this; + } + + public CardData addEntryModeItem(EntryModeEnum entryModeItem) { + if (this.entryMode == null) { + this.entryMode = new ArrayList<>(); + } + this.entryMode.add(entryModeItem); + return this; + } + + /** + * Get entryMode + * + * @return entryMode + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEntryMode() { + return entryMode; + } + + /** + * entryMode + * + * @param entryMode + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntryMode(List entryMode) { + this.entryMode = entryMode; + isSetEntryMode = true; // mark as set + } + + /** + * Country Code attached to the card (3 numerics). If available in the card. + * + * @param cardCountryCode Country Code attached to the card (3 numerics). If available in the + * card. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData cardCountryCode(Integer cardCountryCode) { + this.cardCountryCode = cardCountryCode; + isSetCardCountryCode = true; // mark as set + return this; + } + + /** + * Country Code attached to the card (3 numerics). If available in the card. minimum: 3 maximum: 3 + * + * @return cardCountryCode Country Code attached to the card (3 numerics). If available in the + * card. + */ + @JsonProperty(JSON_PROPERTY_CARD_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCardCountryCode() { + return cardCountryCode; + } + + /** + * Country Code attached to the card (3 numerics). If available in the card. + * + * @param cardCountryCode Country Code attached to the card (3 numerics). If available in the + * card. + */ + @JsonProperty(JSON_PROPERTY_CARD_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardCountryCode(Integer cardCountryCode) { + this.cardCountryCode = cardCountryCode; + isSetCardCountryCode = true; // mark as set + } + + /** + * Sensitive information related to the payment card, protected by CMS. SensitiveCardData + * protected by CMS EnvelopedData. + * + * @param protectedCardData Sensitive information related to the payment card, protected by CMS. + * SensitiveCardData protected by CMS EnvelopedData. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData protectedCardData(String protectedCardData) { + this.protectedCardData = protectedCardData; + isSetProtectedCardData = true; // mark as set + return this; + } + + /** + * Sensitive information related to the payment card, protected by CMS. SensitiveCardData + * protected by CMS EnvelopedData. + * + * @return protectedCardData Sensitive information related to the payment card, protected by CMS. + * SensitiveCardData protected by CMS EnvelopedData. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtectedCardData() { + return protectedCardData; + } + + /** + * Sensitive information related to the payment card, protected by CMS. SensitiveCardData + * protected by CMS EnvelopedData. + * + * @param protectedCardData Sensitive information related to the payment card, protected by CMS. + * SensitiveCardData protected by CMS EnvelopedData. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtectedCardData(String protectedCardData) { + this.protectedCardData = protectedCardData; + isSetProtectedCardData = true; // mark as set + } + + /** + * Sensitive information related to the payment card, entered or read by the Sale System. If + * structure non empty and unprotected. + * + * @param sensitiveCardData Sensitive information related to the payment card, entered or read by + * the Sale System. If structure non empty and unprotected. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData sensitiveCardData(SensitiveCardData sensitiveCardData) { + this.sensitiveCardData = sensitiveCardData; + isSetSensitiveCardData = true; // mark as set + return this; + } + + /** + * Sensitive information related to the payment card, entered or read by the Sale System. If + * structure non empty and unprotected. + * + * @return sensitiveCardData Sensitive information related to the payment card, entered or read by + * the Sale System. If structure non empty and unprotected. + */ + @JsonProperty(JSON_PROPERTY_SENSITIVE_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SensitiveCardData getSensitiveCardData() { + return sensitiveCardData; + } + + /** + * Sensitive information related to the payment card, entered or read by the Sale System. If + * structure non empty and unprotected. + * + * @param sensitiveCardData Sensitive information related to the payment card, entered or read by + * the Sale System. If structure non empty and unprotected. + */ + @JsonProperty(JSON_PROPERTY_SENSITIVE_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSensitiveCardData(SensitiveCardData sensitiveCardData) { + this.sensitiveCardData = sensitiveCardData; + isSetSensitiveCardData = true; // mark as set + } + + /** + * Surrogate of the PAN (Primary Account Number) of the payment card to identify the payment mean + * of the customer. It allows, for a merchant, to identify the customer. Restriction of product + * payable by a card. + * + * @param paymentToken Surrogate of the PAN (Primary Account Number) of the payment card to + * identify the payment mean of the customer. It allows, for a merchant, to identify the + * customer. Restriction of product payable by a card. + * @return the current {@code CardData} instance, allowing for method chaining + */ + public CardData paymentToken(PaymentToken paymentToken) { + this.paymentToken = paymentToken; + isSetPaymentToken = true; // mark as set + return this; + } + + /** + * Surrogate of the PAN (Primary Account Number) of the payment card to identify the payment mean + * of the customer. It allows, for a merchant, to identify the customer. Restriction of product + * payable by a card. + * + * @return paymentToken Surrogate of the PAN (Primary Account Number) of the payment card to + * identify the payment mean of the customer. It allows, for a merchant, to identify the + * customer. Restriction of product payable by a card. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentToken getPaymentToken() { + return paymentToken; + } + + /** + * Surrogate of the PAN (Primary Account Number) of the payment card to identify the payment mean + * of the customer. It allows, for a merchant, to identify the customer. Restriction of product + * payable by a card. + * + * @param paymentToken Surrogate of the PAN (Primary Account Number) of the payment card to + * identify the payment mean of the customer. It allows, for a merchant, to identify the + * customer. Restriction of product payable by a card. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentToken(PaymentToken paymentToken) { + this.paymentToken = paymentToken; + isSetPaymentToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardData cardData = (CardData) o; + return Objects.equals(this.paymentBrand, cardData.paymentBrand) + && Objects.equals(this.isSetPaymentBrand, cardData.isSetPaymentBrand) + && Objects.equals(this.maskedPan, cardData.maskedPan) + && Objects.equals(this.isSetMaskedPan, cardData.isSetMaskedPan) + && Objects.equals(this.paymentAccountRef, cardData.paymentAccountRef) + && Objects.equals(this.isSetPaymentAccountRef, cardData.isSetPaymentAccountRef) + && Objects.equals(this.entryMode, cardData.entryMode) + && Objects.equals(this.isSetEntryMode, cardData.isSetEntryMode) + && Objects.equals(this.cardCountryCode, cardData.cardCountryCode) + && Objects.equals(this.isSetCardCountryCode, cardData.isSetCardCountryCode) + && Objects.equals(this.protectedCardData, cardData.protectedCardData) + && Objects.equals(this.isSetProtectedCardData, cardData.isSetProtectedCardData) + && Objects.equals(this.sensitiveCardData, cardData.sensitiveCardData) + && Objects.equals(this.isSetSensitiveCardData, cardData.isSetSensitiveCardData) + && Objects.equals(this.paymentToken, cardData.paymentToken) + && Objects.equals(this.isSetPaymentToken, cardData.isSetPaymentToken); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentBrand, + isSetPaymentBrand, + maskedPan, + isSetMaskedPan, + paymentAccountRef, + isSetPaymentAccountRef, + entryMode, + isSetEntryMode, + cardCountryCode, + isSetCardCountryCode, + protectedCardData, + isSetProtectedCardData, + sensitiveCardData, + isSetSensitiveCardData, + paymentToken, + isSetPaymentToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardData {\n"); + sb.append(" paymentBrand: ").append(toIndentedString(paymentBrand)).append("\n"); + sb.append(" maskedPan: ").append(toIndentedString(maskedPan)).append("\n"); + sb.append(" paymentAccountRef: ").append(toIndentedString(paymentAccountRef)).append("\n"); + sb.append(" entryMode: ").append(toIndentedString(entryMode)).append("\n"); + sb.append(" cardCountryCode: ").append(toIndentedString(cardCountryCode)).append("\n"); + sb.append(" protectedCardData: ").append(toIndentedString(protectedCardData)).append("\n"); + sb.append(" sensitiveCardData: ").append(toIndentedString(sensitiveCardData)).append("\n"); + sb.append(" paymentToken: ").append(toIndentedString(paymentToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentBrand) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_BRAND, this.paymentBrand); + } + if (isSetMaskedPan) { + addIfNull(nulls, JSON_PROPERTY_MASKED_PAN, this.maskedPan); + } + if (isSetPaymentAccountRef) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_REF, this.paymentAccountRef); + } + if (isSetEntryMode) { + addIfNull(nulls, JSON_PROPERTY_ENTRY_MODE, this.entryMode); + } + if (isSetCardCountryCode) { + addIfNull(nulls, JSON_PROPERTY_CARD_COUNTRY_CODE, this.cardCountryCode); + } + if (isSetProtectedCardData) { + addIfNull(nulls, JSON_PROPERTY_PROTECTED_CARD_DATA, this.protectedCardData); + } + if (isSetSensitiveCardData) { + addIfNull(nulls, JSON_PROPERTY_SENSITIVE_CARD_DATA, this.sensitiveCardData); + } + if (isSetPaymentToken) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TOKEN, this.paymentToken); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardData + * @throws JsonProcessingException if the JSON string is invalid with respect to CardData + */ + public static CardData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardData.class); + } + + /** + * Convert an instance of CardData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardHolderPIN.java b/src/main/java/com/adyen/model/tapi/CardHolderPIN.java new file mode 100644 index 000000000..3e014abed --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardHolderPIN.java @@ -0,0 +1,279 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CardHolderPIN */ +@JsonPropertyOrder({ + CardHolderPIN.JSON_PROPERTY_ENCR_P_I_N_BLOCK, + CardHolderPIN.JSON_PROPERTY_PI_N_FORMAT, + CardHolderPIN.JSON_PROPERTY_ADDITIONAL_INPUT +}) +public class CardHolderPIN { + public static final String JSON_PROPERTY_ENCR_P_I_N_BLOCK = "EncrPINBlock"; + private String encrPINBlock; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncrPINBlock = false; + + public static final String JSON_PROPERTY_PI_N_FORMAT = "PINFormat"; + private PINFormatType piNFormat; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPiNFormat = false; + + public static final String JSON_PROPERTY_ADDITIONAL_INPUT = "AdditionalInput"; + private String additionalInput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardHolderPIN() {} + + /** + * encrPINBlock + * + * @param encrPINBlock + * @return the current {@code CardHolderPIN} instance, allowing for method chaining + */ + public CardHolderPIN encrPINBlock(String encrPINBlock) { + this.encrPINBlock = encrPINBlock; + isSetEncrPINBlock = true; // mark as set + return this; + } + + /** + * Get encrPINBlock + * + * @return encrPINBlock + */ + @JsonProperty(JSON_PROPERTY_ENCR_P_I_N_BLOCK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncrPINBlock() { + return encrPINBlock; + } + + /** + * encrPINBlock + * + * @param encrPINBlock + */ + @JsonProperty(JSON_PROPERTY_ENCR_P_I_N_BLOCK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncrPINBlock(String encrPINBlock) { + this.encrPINBlock = encrPINBlock; + isSetEncrPINBlock = true; // mark as set + } + + /** + * Possible values: * **ISO0** * **ISO1** * **ISO2** * **ISO3** + * + * @param piNFormat Possible values: * **ISO0** * **ISO1** * **ISO2** * **ISO3** + * @return the current {@code CardHolderPIN} instance, allowing for method chaining + */ + public CardHolderPIN piNFormat(PINFormatType piNFormat) { + this.piNFormat = piNFormat; + isSetPiNFormat = true; // mark as set + return this; + } + + /** + * Possible values: * **ISO0** * **ISO1** * **ISO2** * **ISO3** + * + * @return piNFormat Possible values: * **ISO0** * **ISO1** * **ISO2** * **ISO3** + */ + @JsonProperty(JSON_PROPERTY_PI_N_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PINFormatType getPiNFormat() { + return piNFormat; + } + + /** + * Possible values: * **ISO0** * **ISO1** * **ISO2** * **ISO3** + * + * @param piNFormat Possible values: * **ISO0** * **ISO1** * **ISO2** * **ISO3** + */ + @JsonProperty(JSON_PROPERTY_PI_N_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPiNFormat(PINFormatType piNFormat) { + this.piNFormat = piNFormat; + isSetPiNFormat = true; // mark as set + } + + /** + * additionalInput + * + * @param additionalInput + * @return the current {@code CardHolderPIN} instance, allowing for method chaining + */ + public CardHolderPIN additionalInput(String additionalInput) { + this.additionalInput = additionalInput; + isSetAdditionalInput = true; // mark as set + return this; + } + + /** + * Get additionalInput + * + * @return additionalInput + */ + @JsonProperty(JSON_PROPERTY_ADDITIONAL_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAdditionalInput() { + return additionalInput; + } + + /** + * additionalInput + * + * @param additionalInput + */ + @JsonProperty(JSON_PROPERTY_ADDITIONAL_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalInput(String additionalInput) { + this.additionalInput = additionalInput; + isSetAdditionalInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardHolderPIN includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardHolderPIN object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardHolderPIN cardHolderPIN = (CardHolderPIN) o; + return Objects.equals(this.encrPINBlock, cardHolderPIN.encrPINBlock) + && Objects.equals(this.isSetEncrPINBlock, cardHolderPIN.isSetEncrPINBlock) + && Objects.equals(this.piNFormat, cardHolderPIN.piNFormat) + && Objects.equals(this.isSetPiNFormat, cardHolderPIN.isSetPiNFormat) + && Objects.equals(this.additionalInput, cardHolderPIN.additionalInput) + && Objects.equals(this.isSetAdditionalInput, cardHolderPIN.isSetAdditionalInput); + } + + @Override + public int hashCode() { + return Objects.hash( + encrPINBlock, + isSetEncrPINBlock, + piNFormat, + isSetPiNFormat, + additionalInput, + isSetAdditionalInput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardHolderPIN {\n"); + sb.append(" encrPINBlock: ").append(toIndentedString(encrPINBlock)).append("\n"); + sb.append(" piNFormat: ").append(toIndentedString(piNFormat)).append("\n"); + sb.append(" additionalInput: ").append(toIndentedString(additionalInput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEncrPINBlock) { + addIfNull(nulls, JSON_PROPERTY_ENCR_P_I_N_BLOCK, this.encrPINBlock); + } + if (isSetPiNFormat) { + addIfNull(nulls, JSON_PROPERTY_PI_N_FORMAT, this.piNFormat); + } + if (isSetAdditionalInput) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_INPUT, this.additionalInput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardHolderPIN given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardHolderPIN + * @throws JsonProcessingException if the JSON string is invalid with respect to CardHolderPIN + */ + public static CardHolderPIN fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardHolderPIN.class); + } + + /** + * Convert an instance of CardHolderPIN to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardReaderAPDURequest.java b/src/main/java/com/adyen/model/tapi/CardReaderAPDURequest.java new file mode 100644 index 000000000..96cb42bc0 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardReaderAPDURequest.java @@ -0,0 +1,451 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; + +/** + * It contains the APDU request to send to the chip of the card, and a possible invitation message + * to display on the CashierInterface or the CustomerInterface. Content of the Card Reader APDU + * Request message. + */ +@JsonPropertyOrder({ + CardReaderAPDURequest.JSON_PROPERTY_AP_D_U_CLASS, + CardReaderAPDURequest.JSON_PROPERTY_AP_D_U_INSTRUCTION, + CardReaderAPDURequest.JSON_PROPERTY_AP_D_U_PAR1, + CardReaderAPDURequest.JSON_PROPERTY_AP_D_U_PAR2, + CardReaderAPDURequest.JSON_PROPERTY_AP_D_U_DATA, + CardReaderAPDURequest.JSON_PROPERTY_AP_D_U_EXPECTED_LENGTH +}) +public class CardReaderAPDURequest { + public static final String JSON_PROPERTY_AP_D_U_CLASS = "APDUClass"; + private byte[] apDUClass; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUClass = false; + + public static final String JSON_PROPERTY_AP_D_U_INSTRUCTION = "APDUInstruction"; + private byte[] apDUInstruction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUInstruction = false; + + public static final String JSON_PROPERTY_AP_D_U_PAR1 = "APDUPar1"; + private byte[] apDUPar1; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUPar1 = false; + + public static final String JSON_PROPERTY_AP_D_U_PAR2 = "APDUPar2"; + private byte[] apDUPar2; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUPar2 = false; + + public static final String JSON_PROPERTY_AP_D_U_DATA = "APDUData"; + private byte[] apDUData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUData = false; + + public static final String JSON_PROPERTY_AP_D_U_EXPECTED_LENGTH = "APDUExpectedLength"; + private byte[] apDUExpectedLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUExpectedLength = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardReaderAPDURequest() {} + + /** + * Class field of the APDU command (CLA). APDU request for Card Reader device request. For + * specific card like synchronous card, a private value should be used in accordance to ISO 7816- + * 4 (private range D0-FE). + * + * @param apDUClass Class field of the APDU command (CLA). APDU request for Card Reader device + * request. For specific card like synchronous card, a private value should be used in + * accordance to ISO 7816- 4 (private range D0-FE). + * @return the current {@code CardReaderAPDURequest} instance, allowing for method chaining + */ + public CardReaderAPDURequest apDUClass(byte[] apDUClass) { + this.apDUClass = apDUClass; + isSetApDUClass = true; // mark as set + return this; + } + + /** + * Class field of the APDU command (CLA). APDU request for Card Reader device request. For + * specific card like synchronous card, a private value should be used in accordance to ISO 7816- + * 4 (private range D0-FE). + * + * @return apDUClass Class field of the APDU command (CLA). APDU request for Card Reader device + * request. For specific card like synchronous card, a private value should be used in + * accordance to ISO 7816- 4 (private range D0-FE). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUClass() { + return apDUClass; + } + + /** + * Class field of the APDU command (CLA). APDU request for Card Reader device request. For + * specific card like synchronous card, a private value should be used in accordance to ISO 7816- + * 4 (private range D0-FE). + * + * @param apDUClass Class field of the APDU command (CLA). APDU request for Card Reader device + * request. For specific card like synchronous card, a private value should be used in + * accordance to ISO 7816- 4 (private range D0-FE). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUClass(byte[] apDUClass) { + this.apDUClass = apDUClass; + isSetApDUClass = true; // mark as set + } + + /** + * Instruction field of the APDU command (INS). + * + * @param apDUInstruction Instruction field of the APDU command (INS). + * @return the current {@code CardReaderAPDURequest} instance, allowing for method chaining + */ + public CardReaderAPDURequest apDUInstruction(byte[] apDUInstruction) { + this.apDUInstruction = apDUInstruction; + isSetApDUInstruction = true; // mark as set + return this; + } + + /** + * Instruction field of the APDU command (INS). + * + * @return apDUInstruction Instruction field of the APDU command (INS). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_INSTRUCTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUInstruction() { + return apDUInstruction; + } + + /** + * Instruction field of the APDU command (INS). + * + * @param apDUInstruction Instruction field of the APDU command (INS). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_INSTRUCTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUInstruction(byte[] apDUInstruction) { + this.apDUInstruction = apDUInstruction; + isSetApDUInstruction = true; // mark as set + } + + /** + * Parameter 1 field of the APDU command (P1). + * + * @param apDUPar1 Parameter 1 field of the APDU command (P1). + * @return the current {@code CardReaderAPDURequest} instance, allowing for method chaining + */ + public CardReaderAPDURequest apDUPar1(byte[] apDUPar1) { + this.apDUPar1 = apDUPar1; + isSetApDUPar1 = true; // mark as set + return this; + } + + /** + * Parameter 1 field of the APDU command (P1). + * + * @return apDUPar1 Parameter 1 field of the APDU command (P1). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_PAR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUPar1() { + return apDUPar1; + } + + /** + * Parameter 1 field of the APDU command (P1). + * + * @param apDUPar1 Parameter 1 field of the APDU command (P1). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_PAR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUPar1(byte[] apDUPar1) { + this.apDUPar1 = apDUPar1; + isSetApDUPar1 = true; // mark as set + } + + /** + * Parameter 2 field of the APDU command(P2). + * + * @param apDUPar2 Parameter 2 field of the APDU command(P2). + * @return the current {@code CardReaderAPDURequest} instance, allowing for method chaining + */ + public CardReaderAPDURequest apDUPar2(byte[] apDUPar2) { + this.apDUPar2 = apDUPar2; + isSetApDUPar2 = true; // mark as set + return this; + } + + /** + * Parameter 2 field of the APDU command(P2). + * + * @return apDUPar2 Parameter 2 field of the APDU command(P2). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_PAR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUPar2() { + return apDUPar2; + } + + /** + * Parameter 2 field of the APDU command(P2). + * + * @param apDUPar2 Parameter 2 field of the APDU command(P2). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_PAR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUPar2(byte[] apDUPar2) { + this.apDUPar2 = apDUPar2; + isSetApDUPar2 = true; // mark as set + } + + /** + * Data field of the APDU command (Lc + Data). + * + * @param apDUData Data field of the APDU command (Lc + Data). + * @return the current {@code CardReaderAPDURequest} instance, allowing for method chaining + */ + public CardReaderAPDURequest apDUData(byte[] apDUData) { + this.apDUData = apDUData; + isSetApDUData = true; // mark as set + return this; + } + + /** + * Data field of the APDU command (Lc + Data). + * + * @return apDUData Data field of the APDU command (Lc + Data). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUData() { + return apDUData; + } + + /** + * Data field of the APDU command (Lc + Data). + * + * @param apDUData Data field of the APDU command (Lc + Data). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUData(byte[] apDUData) { + this.apDUData = apDUData; + isSetApDUData = true; // mark as set + } + + /** + * Expected length of the data field of the APDU response to the command (Le). + * + * @param apDUExpectedLength Expected length of the data field of the APDU response to the command + * (Le). + * @return the current {@code CardReaderAPDURequest} instance, allowing for method chaining + */ + public CardReaderAPDURequest apDUExpectedLength(byte[] apDUExpectedLength) { + this.apDUExpectedLength = apDUExpectedLength; + isSetApDUExpectedLength = true; // mark as set + return this; + } + + /** + * Expected length of the data field of the APDU response to the command (Le). + * + * @return apDUExpectedLength Expected length of the data field of the APDU response to the + * command (Le). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_EXPECTED_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUExpectedLength() { + return apDUExpectedLength; + } + + /** + * Expected length of the data field of the APDU response to the command (Le). + * + * @param apDUExpectedLength Expected length of the data field of the APDU response to the command + * (Le). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_EXPECTED_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUExpectedLength(byte[] apDUExpectedLength) { + this.apDUExpectedLength = apDUExpectedLength; + isSetApDUExpectedLength = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardReaderAPDURequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardReaderAPDURequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardReaderAPDURequest cardReaderAPDURequest = (CardReaderAPDURequest) o; + return Arrays.equals(this.apDUClass, cardReaderAPDURequest.apDUClass) + && Objects.equals(this.isSetApDUClass, cardReaderAPDURequest.isSetApDUClass) + && Arrays.equals(this.apDUInstruction, cardReaderAPDURequest.apDUInstruction) + && Objects.equals(this.isSetApDUInstruction, cardReaderAPDURequest.isSetApDUInstruction) + && Arrays.equals(this.apDUPar1, cardReaderAPDURequest.apDUPar1) + && Objects.equals(this.isSetApDUPar1, cardReaderAPDURequest.isSetApDUPar1) + && Arrays.equals(this.apDUPar2, cardReaderAPDURequest.apDUPar2) + && Objects.equals(this.isSetApDUPar2, cardReaderAPDURequest.isSetApDUPar2) + && Arrays.equals(this.apDUData, cardReaderAPDURequest.apDUData) + && Objects.equals(this.isSetApDUData, cardReaderAPDURequest.isSetApDUData) + && Arrays.equals(this.apDUExpectedLength, cardReaderAPDURequest.apDUExpectedLength) + && Objects.equals( + this.isSetApDUExpectedLength, cardReaderAPDURequest.isSetApDUExpectedLength); + } + + @Override + public int hashCode() { + return Objects.hash( + Arrays.hashCode(apDUClass), + isSetApDUClass, + Arrays.hashCode(apDUInstruction), + isSetApDUInstruction, + Arrays.hashCode(apDUPar1), + isSetApDUPar1, + Arrays.hashCode(apDUPar2), + isSetApDUPar2, + Arrays.hashCode(apDUData), + isSetApDUData, + Arrays.hashCode(apDUExpectedLength), + isSetApDUExpectedLength); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardReaderAPDURequest {\n"); + sb.append(" apDUClass: ").append(toIndentedString(apDUClass)).append("\n"); + sb.append(" apDUInstruction: ").append(toIndentedString(apDUInstruction)).append("\n"); + sb.append(" apDUPar1: ").append(toIndentedString(apDUPar1)).append("\n"); + sb.append(" apDUPar2: ").append(toIndentedString(apDUPar2)).append("\n"); + sb.append(" apDUData: ").append(toIndentedString(apDUData)).append("\n"); + sb.append(" apDUExpectedLength: ").append(toIndentedString(apDUExpectedLength)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApDUClass) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_CLASS, this.apDUClass); + } + if (isSetApDUInstruction) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_INSTRUCTION, this.apDUInstruction); + } + if (isSetApDUPar1) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_PAR1, this.apDUPar1); + } + if (isSetApDUPar2) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_PAR2, this.apDUPar2); + } + if (isSetApDUData) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_DATA, this.apDUData); + } + if (isSetApDUExpectedLength) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_EXPECTED_LENGTH, this.apDUExpectedLength); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardReaderAPDURequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardReaderAPDURequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CardReaderAPDURequest + */ + public static CardReaderAPDURequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardReaderAPDURequest.class); + } + + /** + * Convert an instance of CardReaderAPDURequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CardReaderAPDUResponse.java b/src/main/java/com/adyen/model/tapi/CardReaderAPDUResponse.java new file mode 100644 index 000000000..2ff4ff354 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CardReaderAPDUResponse.java @@ -0,0 +1,284 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; + +/** + * Content of the Card Reader APDU Response message. It contains the result of the requested + * service, APDU response sent by the chip of the card in response to the APDU request. + */ +@JsonPropertyOrder({ + CardReaderAPDUResponse.JSON_PROPERTY_RESPONSE, + CardReaderAPDUResponse.JSON_PROPERTY_AP_D_U_DATA, + CardReaderAPDUResponse.JSON_PROPERTY_CARD_STATUS_WORDS +}) +public class CardReaderAPDUResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_AP_D_U_DATA = "APDUData"; + private byte[] apDUData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApDUData = false; + + public static final String JSON_PROPERTY_CARD_STATUS_WORDS = "CardStatusWords"; + private byte[] cardStatusWords; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardStatusWords = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CardReaderAPDUResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code CardReaderAPDUResponse} instance, allowing for method chaining + */ + public CardReaderAPDUResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data field of the APDU command (Lc + Data). + * + * @param apDUData Data field of the APDU command (Lc + Data). + * @return the current {@code CardReaderAPDUResponse} instance, allowing for method chaining + */ + public CardReaderAPDUResponse apDUData(byte[] apDUData) { + this.apDUData = apDUData; + isSetApDUData = true; // mark as set + return this; + } + + /** + * Data field of the APDU command (Lc + Data). + * + * @return apDUData Data field of the APDU command (Lc + Data). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getApDUData() { + return apDUData; + } + + /** + * Data field of the APDU command (Lc + Data). + * + * @param apDUData Data field of the APDU command (Lc + Data). + */ + @JsonProperty(JSON_PROPERTY_AP_D_U_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApDUData(byte[] apDUData) { + this.apDUData = apDUData; + isSetApDUData = true; // mark as set + } + + /** + * Status of a smartcard response to a command (SW1-SW2). + * + * @param cardStatusWords Status of a smartcard response to a command (SW1-SW2). + * @return the current {@code CardReaderAPDUResponse} instance, allowing for method chaining + */ + public CardReaderAPDUResponse cardStatusWords(byte[] cardStatusWords) { + this.cardStatusWords = cardStatusWords; + isSetCardStatusWords = true; // mark as set + return this; + } + + /** + * Status of a smartcard response to a command (SW1-SW2). + * + * @return cardStatusWords Status of a smartcard response to a command (SW1-SW2). + */ + @JsonProperty(JSON_PROPERTY_CARD_STATUS_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getCardStatusWords() { + return cardStatusWords; + } + + /** + * Status of a smartcard response to a command (SW1-SW2). + * + * @param cardStatusWords Status of a smartcard response to a command (SW1-SW2). + */ + @JsonProperty(JSON_PROPERTY_CARD_STATUS_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardStatusWords(byte[] cardStatusWords) { + this.cardStatusWords = cardStatusWords; + isSetCardStatusWords = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardReaderAPDUResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CardReaderAPDUResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardReaderAPDUResponse cardReaderAPDUResponse = (CardReaderAPDUResponse) o; + return Objects.equals(this.response, cardReaderAPDUResponse.response) + && Objects.equals(this.isSetResponse, cardReaderAPDUResponse.isSetResponse) + && Arrays.equals(this.apDUData, cardReaderAPDUResponse.apDUData) + && Objects.equals(this.isSetApDUData, cardReaderAPDUResponse.isSetApDUData) + && Arrays.equals(this.cardStatusWords, cardReaderAPDUResponse.cardStatusWords) + && Objects.equals(this.isSetCardStatusWords, cardReaderAPDUResponse.isSetCardStatusWords); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + Arrays.hashCode(apDUData), + isSetApDUData, + Arrays.hashCode(cardStatusWords), + isSetCardStatusWords); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardReaderAPDUResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" apDUData: ").append(toIndentedString(apDUData)).append("\n"); + sb.append(" cardStatusWords: ").append(toIndentedString(cardStatusWords)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetApDUData) { + addIfNull(nulls, JSON_PROPERTY_AP_D_U_DATA, this.apDUData); + } + if (isSetCardStatusWords) { + addIfNull(nulls, JSON_PROPERTY_CARD_STATUS_WORDS, this.cardStatusWords); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CardReaderAPDUResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardReaderAPDUResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CardReaderAPDUResponse + */ + public static CardReaderAPDUResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardReaderAPDUResponse.class); + } + + /** + * Convert an instance of CardReaderAPDUResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CharacterHeightType.java b/src/main/java/com/adyen/model/tapi/CharacterHeightType.java new file mode 100644 index 000000000..680cefbd8 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CharacterHeightType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets CharacterHeight */ +public enum CharacterHeightType { + DOUBLE_HEIGHT("DoubleHeight"), + + HALF_HEIGHT("HalfHeight"), + + SINGLE_HEIGHT("SingleHeight"); + + private String value; + + CharacterHeightType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CharacterHeightType fromValue(String value) { + for (CharacterHeightType b : CharacterHeightType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CharacterStyleType.java b/src/main/java/com/adyen/model/tapi/CharacterStyleType.java new file mode 100644 index 000000000..5370514d3 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CharacterStyleType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets CharacterStyle */ +public enum CharacterStyleType { + BOLD("Bold"), + + ITALIC("Italic"), + + NORMAL("Normal"), + + UNDERLINE("Underline"); + + private String value; + + CharacterStyleType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CharacterStyleType fromValue(String value) { + for (CharacterStyleType b : CharacterStyleType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CharacterWidthType.java b/src/main/java/com/adyen/model/tapi/CharacterWidthType.java new file mode 100644 index 000000000..67aad550b --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CharacterWidthType.java @@ -0,0 +1,49 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets CharacterWidth */ +public enum CharacterWidthType { + DOUBLE_WIDTH("DoubleWidth"), + + SINGLE_WIDTH("SingleWidth"); + + private String value; + + CharacterWidthType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CharacterWidthType fromValue(String value) { + for (CharacterWidthType b : CharacterWidthType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CheckData.java b/src/main/java/com/adyen/model/tapi/CheckData.java new file mode 100644 index 000000000..1ae6af16c --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CheckData.java @@ -0,0 +1,486 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Information related to the paper check used for the transaction. Allows the check information to + * be provided by the Sale System before requesting the payment, or stored by the Sale System after + * processing of the payment. + */ +@JsonPropertyOrder({ + CheckData.JSON_PROPERTY_BANK_I_D, + CheckData.JSON_PROPERTY_ACCOUNT_NUMBER, + CheckData.JSON_PROPERTY_CHECK_NUMBER, + CheckData.JSON_PROPERTY_TRACK_DATA, + CheckData.JSON_PROPERTY_CHECK_CARD_NUMBER, + CheckData.JSON_PROPERTY_TYPE_CODE, + CheckData.JSON_PROPERTY_COUNTRY +}) +public class CheckData { + public static final String JSON_PROPERTY_BANK_I_D = "BankID"; + private String bankID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankID = false; + + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "AccountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_CHECK_NUMBER = "CheckNumber"; + private String checkNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckNumber = false; + + public static final String JSON_PROPERTY_TRACK_DATA = "TrackData"; + private TrackData trackData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackData = false; + + public static final String JSON_PROPERTY_CHECK_CARD_NUMBER = "CheckCardNumber"; + private String checkCardNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckCardNumber = false; + + public static final String JSON_PROPERTY_TYPE_CODE = "TypeCode"; + private TypeCodeType typeCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTypeCode = false; + + public static final String JSON_PROPERTY_COUNTRY = "Country"; + private String country; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckData() {} + + /** + * Identification of the bank. Mandatory if TrackData absent. + * + * @param bankID Identification of the bank. Mandatory if TrackData absent. + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData bankID(String bankID) { + this.bankID = bankID; + isSetBankID = true; // mark as set + return this; + } + + /** + * Identification of the bank. Mandatory if TrackData absent. + * + * @return bankID Identification of the bank. Mandatory if TrackData absent. + */ + @JsonProperty(JSON_PROPERTY_BANK_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBankID() { + return bankID; + } + + /** + * Identification of the bank. Mandatory if TrackData absent. + * + * @param bankID Identification of the bank. Mandatory if TrackData absent. + */ + @JsonProperty(JSON_PROPERTY_BANK_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankID(String bankID) { + this.bankID = bankID; + isSetBankID = true; // mark as set + } + + /** + * Identification of the customer account. Mandatory if TrackData absent. + * + * @param accountNumber Identification of the customer account. Mandatory if TrackData absent. + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * Identification of the customer account. Mandatory if TrackData absent. + * + * @return accountNumber Identification of the customer account. Mandatory if TrackData absent. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * Identification of the customer account. Mandatory if TrackData absent. + * + * @param accountNumber Identification of the customer account. Mandatory if TrackData absent. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * Identification of the bank check. Mandatory if TrackData absent. + * + * @param checkNumber Identification of the bank check. Mandatory if TrackData absent. + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData checkNumber(String checkNumber) { + this.checkNumber = checkNumber; + isSetCheckNumber = true; // mark as set + return this; + } + + /** + * Identification of the bank check. Mandatory if TrackData absent. + * + * @return checkNumber Identification of the bank check. Mandatory if TrackData absent. + */ + @JsonProperty(JSON_PROPERTY_CHECK_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCheckNumber() { + return checkNumber; + } + + /** + * Identification of the bank check. Mandatory if TrackData absent. + * + * @param checkNumber Identification of the bank check. Mandatory if TrackData absent. + */ + @JsonProperty(JSON_PROPERTY_CHECK_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCheckNumber(String checkNumber) { + this.checkNumber = checkNumber; + isSetCheckNumber = true; // mark as set + } + + /** + * Magnetic track or magnetic ink characters line. Mandatory if CheckNumber absent. + * + * @param trackData Magnetic track or magnetic ink characters line. Mandatory if CheckNumber + * absent. + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData trackData(TrackData trackData) { + this.trackData = trackData; + isSetTrackData = true; // mark as set + return this; + } + + /** + * Magnetic track or magnetic ink characters line. Mandatory if CheckNumber absent. + * + * @return trackData Magnetic track or magnetic ink characters line. Mandatory if CheckNumber + * absent. + */ + @JsonProperty(JSON_PROPERTY_TRACK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TrackData getTrackData() { + return trackData; + } + + /** + * Magnetic track or magnetic ink characters line. Mandatory if CheckNumber absent. + * + * @param trackData Magnetic track or magnetic ink characters line. Mandatory if CheckNumber + * absent. + */ + @JsonProperty(JSON_PROPERTY_TRACK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrackData(TrackData trackData) { + this.trackData = trackData; + isSetTrackData = true; // mark as set + } + + /** + * Check guarantee card number. If provided by the customer. + * + * @param checkCardNumber Check guarantee card number. If provided by the customer. + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData checkCardNumber(String checkCardNumber) { + this.checkCardNumber = checkCardNumber; + isSetCheckCardNumber = true; // mark as set + return this; + } + + /** + * Check guarantee card number. If provided by the customer. + * + * @return checkCardNumber Check guarantee card number. If provided by the customer. + */ + @JsonProperty(JSON_PROPERTY_CHECK_CARD_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCheckCardNumber() { + return checkCardNumber; + } + + /** + * Check guarantee card number. If provided by the customer. + * + * @param checkCardNumber Check guarantee card number. If provided by the customer. + */ + @JsonProperty(JSON_PROPERTY_CHECK_CARD_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCheckCardNumber(String checkCardNumber) { + this.checkCardNumber = checkCardNumber; + isSetCheckCardNumber = true; // mark as set + } + + /** + * Type of bank check. Possible values: * **Company** * **Personal** + * + * @param typeCode Type of bank check. Possible values: * **Company** * **Personal** + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData typeCode(TypeCodeType typeCode) { + this.typeCode = typeCode; + isSetTypeCode = true; // mark as set + return this; + } + + /** + * Type of bank check. Possible values: * **Company** * **Personal** + * + * @return typeCode Type of bank check. Possible values: * **Company** * **Personal** + */ + @JsonProperty(JSON_PROPERTY_TYPE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeCodeType getTypeCode() { + return typeCode; + } + + /** + * Type of bank check. Possible values: * **Company** * **Personal** + * + * @param typeCode Type of bank check. Possible values: * **Company** * **Personal** + */ + @JsonProperty(JSON_PROPERTY_TYPE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTypeCode(TypeCodeType typeCode) { + this.typeCode = typeCode; + isSetTypeCode = true; // mark as set + } + + /** + * Country of the bank check. Absent if country of the Sale system. + * + * @param country Country of the bank check. Absent if country of the Sale system. + * @return the current {@code CheckData} instance, allowing for method chaining + */ + public CheckData country(String country) { + this.country = country; + isSetCountry = true; // mark as set + return this; + } + + /** + * Country of the bank check. Absent if country of the Sale system. + * + * @return country Country of the bank check. Absent if country of the Sale system. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + /** + * Country of the bank check. Absent if country of the Sale system. + * + * @param country Country of the bank check. Absent if country of the Sale system. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(String country) { + this.country = country; + isSetCountry = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckData checkData = (CheckData) o; + return Objects.equals(this.bankID, checkData.bankID) + && Objects.equals(this.isSetBankID, checkData.isSetBankID) + && Objects.equals(this.accountNumber, checkData.accountNumber) + && Objects.equals(this.isSetAccountNumber, checkData.isSetAccountNumber) + && Objects.equals(this.checkNumber, checkData.checkNumber) + && Objects.equals(this.isSetCheckNumber, checkData.isSetCheckNumber) + && Objects.equals(this.trackData, checkData.trackData) + && Objects.equals(this.isSetTrackData, checkData.isSetTrackData) + && Objects.equals(this.checkCardNumber, checkData.checkCardNumber) + && Objects.equals(this.isSetCheckCardNumber, checkData.isSetCheckCardNumber) + && Objects.equals(this.typeCode, checkData.typeCode) + && Objects.equals(this.isSetTypeCode, checkData.isSetTypeCode) + && Objects.equals(this.country, checkData.country) + && Objects.equals(this.isSetCountry, checkData.isSetCountry); + } + + @Override + public int hashCode() { + return Objects.hash( + bankID, + isSetBankID, + accountNumber, + isSetAccountNumber, + checkNumber, + isSetCheckNumber, + trackData, + isSetTrackData, + checkCardNumber, + isSetCheckCardNumber, + typeCode, + isSetTypeCode, + country, + isSetCountry); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckData {\n"); + sb.append(" bankID: ").append(toIndentedString(bankID)).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" checkNumber: ").append(toIndentedString(checkNumber)).append("\n"); + sb.append(" trackData: ").append(toIndentedString(trackData)).append("\n"); + sb.append(" checkCardNumber: ").append(toIndentedString(checkCardNumber)).append("\n"); + sb.append(" typeCode: ").append(toIndentedString(typeCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankID) { + addIfNull(nulls, JSON_PROPERTY_BANK_I_D, this.bankID); + } + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetCheckNumber) { + addIfNull(nulls, JSON_PROPERTY_CHECK_NUMBER, this.checkNumber); + } + if (isSetTrackData) { + addIfNull(nulls, JSON_PROPERTY_TRACK_DATA, this.trackData); + } + if (isSetCheckCardNumber) { + addIfNull(nulls, JSON_PROPERTY_CHECK_CARD_NUMBER, this.checkCardNumber); + } + if (isSetTypeCode) { + addIfNull(nulls, JSON_PROPERTY_TYPE_CODE, this.typeCode); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckData + * @throws JsonProcessingException if the JSON string is invalid with respect to CheckData + */ + public static CheckData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckData.class); + } + + /** + * Convert an instance of CheckData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ConvertedAmount.java b/src/main/java/com/adyen/model/tapi/ConvertedAmount.java new file mode 100644 index 000000000..7759945d0 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ConvertedAmount.java @@ -0,0 +1,226 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** ConvertedAmount */ +@JsonPropertyOrder({ + ConvertedAmount.JSON_PROPERTY_AMOUNT_VALUE, + ConvertedAmount.JSON_PROPERTY_CURRENCY +}) +public class ConvertedAmount { + public static final String JSON_PROPERTY_AMOUNT_VALUE = "AmountValue"; + private BigDecimal amountValue; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountValue = false; + + public static final String JSON_PROPERTY_CURRENCY = "Currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ConvertedAmount() {} + + /** + * Value of an amount. + * + * @param amountValue Value of an amount. + * @return the current {@code ConvertedAmount} instance, allowing for method chaining + */ + public ConvertedAmount amountValue(BigDecimal amountValue) { + this.amountValue = amountValue; + isSetAmountValue = true; // mark as set + return this; + } + + /** + * Value of an amount. minimum: 0.0 maximum: 99999999.999999 + * + * @return amountValue Value of an amount. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAmountValue() { + return amountValue; + } + + /** + * Value of an amount. + * + * @param amountValue Value of an amount. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmountValue(BigDecimal amountValue) { + this.amountValue = amountValue; + isSetAmountValue = true; // mark as set + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + * @return the current {@code ConvertedAmount} instance, allowing for method chaining + */ + public ConvertedAmount currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. + * + * @return currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ConvertedAmount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ConvertedAmount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConvertedAmount convertedAmount = (ConvertedAmount) o; + return Objects.equals(this.amountValue, convertedAmount.amountValue) + && Objects.equals(this.isSetAmountValue, convertedAmount.isSetAmountValue) + && Objects.equals(this.currency, convertedAmount.currency) + && Objects.equals(this.isSetCurrency, convertedAmount.isSetCurrency); + } + + @Override + public int hashCode() { + return Objects.hash(amountValue, isSetAmountValue, currency, isSetCurrency); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConvertedAmount {\n"); + sb.append(" amountValue: ").append(toIndentedString(amountValue)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmountValue) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_VALUE, this.amountValue); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ConvertedAmount given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConvertedAmount + * @throws JsonProcessingException if the JSON string is invalid with respect to ConvertedAmount + */ + public static ConvertedAmount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ConvertedAmount.class); + } + + /** + * Convert an instance of ConvertedAmount to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/CurrencyConversion.java b/src/main/java/com/adyen/model/tapi/CurrencyConversion.java new file mode 100644 index 000000000..b8874a576 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/CurrencyConversion.java @@ -0,0 +1,450 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** + * Information related to a currency conversion. A currency conversion occurred in the payment, and + * the merchant needs to know information related to this conversion (e.g. to print on the sale + * receipt). + */ +@JsonPropertyOrder({ + CurrencyConversion.JSON_PROPERTY_CUSTOMER_APPROVED_FLAG, + CurrencyConversion.JSON_PROPERTY_CONVERTED_AMOUNT, + CurrencyConversion.JSON_PROPERTY_RATE, + CurrencyConversion.JSON_PROPERTY_MARKUP, + CurrencyConversion.JSON_PROPERTY_COMMISSION, + CurrencyConversion.JSON_PROPERTY_DECLARATION +}) +public class CurrencyConversion { + public static final String JSON_PROPERTY_CUSTOMER_APPROVED_FLAG = "CustomerApprovedFlag"; + private Boolean customerApprovedFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerApprovedFlag = false; + + public static final String JSON_PROPERTY_CONVERTED_AMOUNT = "ConvertedAmount"; + private ConvertedAmount convertedAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConvertedAmount = false; + + public static final String JSON_PROPERTY_RATE = "Rate"; + private String rate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRate = false; + + public static final String JSON_PROPERTY_MARKUP = "Markup"; + private String markup; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMarkup = false; + + public static final String JSON_PROPERTY_COMMISSION = "Commission"; + private BigDecimal commission; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCommission = false; + + public static final String JSON_PROPERTY_DECLARATION = "Declaration"; + private String declaration; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeclaration = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CurrencyConversion() {} + + /** + * Notify if the customer has approved something. Indicates if the customer has accepted a + * currency conversion. + * + * @param customerApprovedFlag Notify if the customer has approved something. Indicates if the + * customer has accepted a currency conversion. + * @return the current {@code CurrencyConversion} instance, allowing for method chaining + */ + public CurrencyConversion customerApprovedFlag(Boolean customerApprovedFlag) { + this.customerApprovedFlag = customerApprovedFlag; + isSetCustomerApprovedFlag = true; // mark as set + return this; + } + + /** + * Notify if the customer has approved something. Indicates if the customer has accepted a + * currency conversion. + * + * @return customerApprovedFlag Notify if the customer has approved something. Indicates if the + * customer has accepted a currency conversion. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_APPROVED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCustomerApprovedFlag() { + return customerApprovedFlag; + } + + /** + * Notify if the customer has approved something. Indicates if the customer has accepted a + * currency conversion. + * + * @param customerApprovedFlag Notify if the customer has approved something. Indicates if the + * customer has accepted a currency conversion. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_APPROVED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerApprovedFlag(Boolean customerApprovedFlag) { + this.customerApprovedFlag = customerApprovedFlag; + isSetCustomerApprovedFlag = true; // mark as set + } + + /** + * Amount after a currency conversion. + * + * @param convertedAmount Amount after a currency conversion. + * @return the current {@code CurrencyConversion} instance, allowing for method chaining + */ + public CurrencyConversion convertedAmount(ConvertedAmount convertedAmount) { + this.convertedAmount = convertedAmount; + isSetConvertedAmount = true; // mark as set + return this; + } + + /** + * Amount after a currency conversion. + * + * @return convertedAmount Amount after a currency conversion. + */ + @JsonProperty(JSON_PROPERTY_CONVERTED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ConvertedAmount getConvertedAmount() { + return convertedAmount; + } + + /** + * Amount after a currency conversion. + * + * @param convertedAmount Amount after a currency conversion. + */ + @JsonProperty(JSON_PROPERTY_CONVERTED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConvertedAmount(ConvertedAmount convertedAmount) { + this.convertedAmount = convertedAmount; + isSetConvertedAmount = true; // mark as set + } + + /** + * Rate of currency conversion. + * + * @param rate Rate of currency conversion. + * @return the current {@code CurrencyConversion} instance, allowing for method chaining + */ + public CurrencyConversion rate(String rate) { + this.rate = rate; + isSetRate = true; // mark as set + return this; + } + + /** + * Rate of currency conversion. + * + * @return rate Rate of currency conversion. + */ + @JsonProperty(JSON_PROPERTY_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRate() { + return rate; + } + + /** + * Rate of currency conversion. + * + * @param rate Rate of currency conversion. + */ + @JsonProperty(JSON_PROPERTY_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRate(String rate) { + this.rate = rate; + isSetRate = true; // mark as set + } + + /** + * Markup of a currency conversion amount as a percentage. + * + * @param markup Markup of a currency conversion amount as a percentage. + * @return the current {@code CurrencyConversion} instance, allowing for method chaining + */ + public CurrencyConversion markup(String markup) { + this.markup = markup; + isSetMarkup = true; // mark as set + return this; + } + + /** + * Markup of a currency conversion amount as a percentage. + * + * @return markup Markup of a currency conversion amount as a percentage. + */ + @JsonProperty(JSON_PROPERTY_MARKUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMarkup() { + return markup; + } + + /** + * Markup of a currency conversion amount as a percentage. + * + * @param markup Markup of a currency conversion amount as a percentage. + */ + @JsonProperty(JSON_PROPERTY_MARKUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMarkup(String markup) { + this.markup = markup; + isSetMarkup = true; // mark as set + } + + /** + * Commission for a currency conversion. + * + * @param commission Commission for a currency conversion. + * @return the current {@code CurrencyConversion} instance, allowing for method chaining + */ + public CurrencyConversion commission(BigDecimal commission) { + this.commission = commission; + isSetCommission = true; // mark as set + return this; + } + + /** + * Commission for a currency conversion. minimum: 0.0 maximum: 99999999.999999 + * + * @return commission Commission for a currency conversion. + */ + @JsonProperty(JSON_PROPERTY_COMMISSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCommission() { + return commission; + } + + /** + * Commission for a currency conversion. + * + * @param commission Commission for a currency conversion. + */ + @JsonProperty(JSON_PROPERTY_COMMISSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommission(BigDecimal commission) { + this.commission = commission; + isSetCommission = true; // mark as set + } + + /** + * Declaration to present to the customer or the cashier for validation. If a declaration has to + * be presented to the customer. + * + * @param declaration Declaration to present to the customer or the cashier for validation. If a + * declaration has to be presented to the customer. + * @return the current {@code CurrencyConversion} instance, allowing for method chaining + */ + public CurrencyConversion declaration(String declaration) { + this.declaration = declaration; + isSetDeclaration = true; // mark as set + return this; + } + + /** + * Declaration to present to the customer or the cashier for validation. If a declaration has to + * be presented to the customer. + * + * @return declaration Declaration to present to the customer or the cashier for validation. If a + * declaration has to be presented to the customer. + */ + @JsonProperty(JSON_PROPERTY_DECLARATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeclaration() { + return declaration; + } + + /** + * Declaration to present to the customer or the cashier for validation. If a declaration has to + * be presented to the customer. + * + * @param declaration Declaration to present to the customer or the cashier for validation. If a + * declaration has to be presented to the customer. + */ + @JsonProperty(JSON_PROPERTY_DECLARATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclaration(String declaration) { + this.declaration = declaration; + isSetDeclaration = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CurrencyConversion includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CurrencyConversion object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CurrencyConversion currencyConversion = (CurrencyConversion) o; + return Objects.equals(this.customerApprovedFlag, currencyConversion.customerApprovedFlag) + && Objects.equals( + this.isSetCustomerApprovedFlag, currencyConversion.isSetCustomerApprovedFlag) + && Objects.equals(this.convertedAmount, currencyConversion.convertedAmount) + && Objects.equals(this.isSetConvertedAmount, currencyConversion.isSetConvertedAmount) + && Objects.equals(this.rate, currencyConversion.rate) + && Objects.equals(this.isSetRate, currencyConversion.isSetRate) + && Objects.equals(this.markup, currencyConversion.markup) + && Objects.equals(this.isSetMarkup, currencyConversion.isSetMarkup) + && Objects.equals(this.commission, currencyConversion.commission) + && Objects.equals(this.isSetCommission, currencyConversion.isSetCommission) + && Objects.equals(this.declaration, currencyConversion.declaration) + && Objects.equals(this.isSetDeclaration, currencyConversion.isSetDeclaration); + } + + @Override + public int hashCode() { + return Objects.hash( + customerApprovedFlag, + isSetCustomerApprovedFlag, + convertedAmount, + isSetConvertedAmount, + rate, + isSetRate, + markup, + isSetMarkup, + commission, + isSetCommission, + declaration, + isSetDeclaration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurrencyConversion {\n"); + sb.append(" customerApprovedFlag: ") + .append(toIndentedString(customerApprovedFlag)) + .append("\n"); + sb.append(" convertedAmount: ").append(toIndentedString(convertedAmount)).append("\n"); + sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); + sb.append(" markup: ").append(toIndentedString(markup)).append("\n"); + sb.append(" commission: ").append(toIndentedString(commission)).append("\n"); + sb.append(" declaration: ").append(toIndentedString(declaration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCustomerApprovedFlag) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_APPROVED_FLAG, this.customerApprovedFlag); + } + if (isSetConvertedAmount) { + addIfNull(nulls, JSON_PROPERTY_CONVERTED_AMOUNT, this.convertedAmount); + } + if (isSetRate) { + addIfNull(nulls, JSON_PROPERTY_RATE, this.rate); + } + if (isSetMarkup) { + addIfNull(nulls, JSON_PROPERTY_MARKUP, this.markup); + } + if (isSetCommission) { + addIfNull(nulls, JSON_PROPERTY_COMMISSION, this.commission); + } + if (isSetDeclaration) { + addIfNull(nulls, JSON_PROPERTY_DECLARATION, this.declaration); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CurrencyConversion given an JSON string + * + * @param jsonString JSON string + * @return An instance of CurrencyConversion + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CurrencyConversion + */ + public static CurrencyConversion fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CurrencyConversion.class); + } + + /** + * Convert an instance of CurrencyConversion to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DeviceType.java b/src/main/java/com/adyen/model/tapi/DeviceType.java new file mode 100644 index 000000000..b6f6b3b1e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DeviceType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets Device */ +public enum DeviceType { + CASHIER_DISPLAY("CashierDisplay"), + + CASHIER_INPUT("CashierInput"), + + CUSTOMER_DISPLAY("CustomerDisplay"), + + CUSTOMER_INPUT("CustomerInput"); + + private String value; + + DeviceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DeviceType fromValue(String value) { + for (DeviceType b : DeviceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DiagnosisRequest.java b/src/main/java/com/adyen/model/tapi/DiagnosisRequest.java new file mode 100644 index 000000000..1c566dcda --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DiagnosisRequest.java @@ -0,0 +1,296 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the target POI for which the diagnosis is requested. Content of + * the Diagnosis Request message. + */ +@JsonPropertyOrder({ + DiagnosisRequest.JSON_PROPERTY_P_O_I_I_D, + DiagnosisRequest.JSON_PROPERTY_HOST_DIAGNOSIS_FLAG, + DiagnosisRequest.JSON_PROPERTY_ACQUIRER_I_D +}) +public class DiagnosisRequest { + public static final String JSON_PROPERTY_P_O_I_I_D = "POIID"; + private String POIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPOIID = false; + + public static final String JSON_PROPERTY_HOST_DIAGNOSIS_FLAG = "HostDiagnosisFlag"; + private Boolean hostDiagnosisFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostDiagnosisFlag = false; + + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private List acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DiagnosisRequest() {} + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * MessageHeader.POIID. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * MessageHeader.POIID. + * @return the current {@code DiagnosisRequest} instance, allowing for method chaining + */ + public DiagnosisRequest POIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + return this; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * MessageHeader.POIID. + * + * @return POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * MessageHeader.POIID. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPOIID() { + return POIID; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * MessageHeader.POIID. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * MessageHeader.POIID. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPOIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + } + + /** + * Indicates if Host Diagnosis are required. + * + * @param hostDiagnosisFlag Indicates if Host Diagnosis are required. + * @return the current {@code DiagnosisRequest} instance, allowing for method chaining + */ + public DiagnosisRequest hostDiagnosisFlag(Boolean hostDiagnosisFlag) { + this.hostDiagnosisFlag = hostDiagnosisFlag; + isSetHostDiagnosisFlag = true; // mark as set + return this; + } + + /** + * Indicates if Host Diagnosis are required. + * + * @return hostDiagnosisFlag Indicates if Host Diagnosis are required. + */ + @JsonProperty(JSON_PROPERTY_HOST_DIAGNOSIS_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHostDiagnosisFlag() { + return hostDiagnosisFlag; + } + + /** + * Indicates if Host Diagnosis are required. + * + * @param hostDiagnosisFlag Indicates if Host Diagnosis are required. + */ + @JsonProperty(JSON_PROPERTY_HOST_DIAGNOSIS_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostDiagnosisFlag(Boolean hostDiagnosisFlag) { + this.hostDiagnosisFlag = hostDiagnosisFlag; + isSetHostDiagnosisFlag = true; // mark as set + } + + /** + * Identification of the Acquirer. Present if requesting the diagnosis of these hosts only. + * + * @param acquirerID Identification of the Acquirer. Present if requesting the diagnosis of these + * hosts only. + * @return the current {@code DiagnosisRequest} instance, allowing for method chaining + */ + public DiagnosisRequest acquirerID(List acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + public DiagnosisRequest addAcquirerIDItem(Integer acquirerIDItem) { + if (this.acquirerID == null) { + this.acquirerID = new ArrayList<>(); + } + this.acquirerID.add(acquirerIDItem); + return this; + } + + /** + * Identification of the Acquirer. Present if requesting the diagnosis of these hosts only. + * + * @return acquirerID Identification of the Acquirer. Present if requesting the diagnosis of these + * hosts only. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. Present if requesting the diagnosis of these hosts only. + * + * @param acquirerID Identification of the Acquirer. Present if requesting the diagnosis of these + * hosts only. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(List acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DiagnosisRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DiagnosisRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiagnosisRequest diagnosisRequest = (DiagnosisRequest) o; + return Objects.equals(this.POIID, diagnosisRequest.POIID) + && Objects.equals(this.isSetPOIID, diagnosisRequest.isSetPOIID) + && Objects.equals(this.hostDiagnosisFlag, diagnosisRequest.hostDiagnosisFlag) + && Objects.equals(this.isSetHostDiagnosisFlag, diagnosisRequest.isSetHostDiagnosisFlag) + && Objects.equals(this.acquirerID, diagnosisRequest.acquirerID) + && Objects.equals(this.isSetAcquirerID, diagnosisRequest.isSetAcquirerID); + } + + @Override + public int hashCode() { + return Objects.hash( + POIID, isSetPOIID, hostDiagnosisFlag, isSetHostDiagnosisFlag, acquirerID, isSetAcquirerID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiagnosisRequest {\n"); + sb.append(" POIID: ").append(toIndentedString(POIID)).append("\n"); + sb.append(" hostDiagnosisFlag: ").append(toIndentedString(hostDiagnosisFlag)).append("\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPOIID) { + addIfNull(nulls, JSON_PROPERTY_P_O_I_I_D, this.POIID); + } + if (isSetHostDiagnosisFlag) { + addIfNull(nulls, JSON_PROPERTY_HOST_DIAGNOSIS_FLAG, this.hostDiagnosisFlag); + } + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DiagnosisRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiagnosisRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to DiagnosisRequest + */ + public static DiagnosisRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DiagnosisRequest.class); + } + + /** + * Convert an instance of DiagnosisRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DiagnosisResponse.java b/src/main/java/com/adyen/model/tapi/DiagnosisResponse.java new file mode 100644 index 000000000..3c24cba99 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DiagnosisResponse.java @@ -0,0 +1,287 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys the result of the requested diagnosis and a possible message to display on a logical + * device. Content of the Diagnosis Response message. + */ +@JsonPropertyOrder({ + DiagnosisResponse.JSON_PROPERTY_RESPONSE, + DiagnosisResponse.JSON_PROPERTY_PO_I_STATUS, + DiagnosisResponse.JSON_PROPERTY_HOST_STATUS +}) +public class DiagnosisResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_PO_I_STATUS = "POIStatus"; + private POIStatus poIStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIStatus = false; + + public static final String JSON_PROPERTY_HOST_STATUS = "HostStatus"; + private List hostStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DiagnosisResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code DiagnosisResponse} instance, allowing for method chaining + */ + public DiagnosisResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * State of a POI Terminal. If `Response.Result` is Success. + * + * @param poIStatus State of a POI Terminal. If `Response.Result` is Success. + * @return the current {@code DiagnosisResponse} instance, allowing for method chaining + */ + public DiagnosisResponse poIStatus(POIStatus poIStatus) { + this.poIStatus = poIStatus; + isSetPoIStatus = true; // mark as set + return this; + } + + /** + * State of a POI Terminal. If `Response.Result` is Success. + * + * @return poIStatus State of a POI Terminal. If `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIStatus getPoIStatus() { + return poIStatus; + } + + /** + * State of a POI Terminal. If `Response.Result` is Success. + * + * @param poIStatus State of a POI Terminal. If `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIStatus(POIStatus poIStatus) { + this.poIStatus = poIStatus; + isSetPoIStatus = true; // mark as set + } + + /** + * State of a Host. + * + * @param hostStatus State of a Host. + * @return the current {@code DiagnosisResponse} instance, allowing for method chaining + */ + public DiagnosisResponse hostStatus(List hostStatus) { + this.hostStatus = hostStatus; + isSetHostStatus = true; // mark as set + return this; + } + + public DiagnosisResponse addHostStatusItem(HostStatus hostStatusItem) { + if (this.hostStatus == null) { + this.hostStatus = new ArrayList<>(); + } + this.hostStatus.add(hostStatusItem); + return this; + } + + /** + * State of a Host. + * + * @return hostStatus State of a Host. + */ + @JsonProperty(JSON_PROPERTY_HOST_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHostStatus() { + return hostStatus; + } + + /** + * State of a Host. + * + * @param hostStatus State of a Host. + */ + @JsonProperty(JSON_PROPERTY_HOST_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostStatus(List hostStatus) { + this.hostStatus = hostStatus; + isSetHostStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DiagnosisResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DiagnosisResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiagnosisResponse diagnosisResponse = (DiagnosisResponse) o; + return Objects.equals(this.response, diagnosisResponse.response) + && Objects.equals(this.isSetResponse, diagnosisResponse.isSetResponse) + && Objects.equals(this.poIStatus, diagnosisResponse.poIStatus) + && Objects.equals(this.isSetPoIStatus, diagnosisResponse.isSetPoIStatus) + && Objects.equals(this.hostStatus, diagnosisResponse.hostStatus) + && Objects.equals(this.isSetHostStatus, diagnosisResponse.isSetHostStatus); + } + + @Override + public int hashCode() { + return Objects.hash( + response, isSetResponse, poIStatus, isSetPoIStatus, hostStatus, isSetHostStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiagnosisResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" poIStatus: ").append(toIndentedString(poIStatus)).append("\n"); + sb.append(" hostStatus: ").append(toIndentedString(hostStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetPoIStatus) { + addIfNull(nulls, JSON_PROPERTY_PO_I_STATUS, this.poIStatus); + } + if (isSetHostStatus) { + addIfNull(nulls, JSON_PROPERTY_HOST_STATUS, this.hostStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DiagnosisResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiagnosisResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to DiagnosisResponse + */ + public static DiagnosisResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DiagnosisResponse.class); + } + + /** + * Convert an instance of DiagnosisResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DisplayOutput.java b/src/main/java/com/adyen/model/tapi/DisplayOutput.java new file mode 100644 index 000000000..c471322b3 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DisplayOutput.java @@ -0,0 +1,559 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Information to display and how to process it. Contains a complete display operation for a Display + * or an Input Device type. For the Input Devices, Diagnosis and `EnableService`, + * `ResponseRequiredFlag`, and `MinimumDisplayTime` shall be absent. + */ +@JsonPropertyOrder({ + DisplayOutput.JSON_PROPERTY_RESPONSE_REQUIRED_FLAG, + DisplayOutput.JSON_PROPERTY_MINIMUM_DISPLAY_TIME, + DisplayOutput.JSON_PROPERTY_DEVICE, + DisplayOutput.JSON_PROPERTY_INFO_QUALIFY, + DisplayOutput.JSON_PROPERTY_OUTPUT_CONTENT, + DisplayOutput.JSON_PROPERTY_MENU_ENTRY, + DisplayOutput.JSON_PROPERTY_OUTPUT_SIGNATURE +}) +public class DisplayOutput { + public static final String JSON_PROPERTY_RESPONSE_REQUIRED_FLAG = "ResponseRequiredFlag"; + private Boolean responseRequiredFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponseRequiredFlag = false; + + public static final String JSON_PROPERTY_MINIMUM_DISPLAY_TIME = "MinimumDisplayTime"; + private Integer minimumDisplayTime; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinimumDisplayTime = false; + + public static final String JSON_PROPERTY_DEVICE = "Device"; + private DeviceType device; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + + public static final String JSON_PROPERTY_INFO_QUALIFY = "InfoQualify"; + private InfoQualifyType infoQualify; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInfoQualify = false; + + public static final String JSON_PROPERTY_OUTPUT_CONTENT = "OutputContent"; + private OutputContent outputContent; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputContent = false; + + public static final String JSON_PROPERTY_MENU_ENTRY = "MenuEntry"; + private List menuEntry; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMenuEntry = false; + + public static final String JSON_PROPERTY_OUTPUT_SIGNATURE = "OutputSignature"; + private byte[] outputSignature; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputSignature = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DisplayOutput() {} + + /** + * Indicates if the message response is required. + * + * @param responseRequiredFlag Indicates if the message response is required. + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput responseRequiredFlag(Boolean responseRequiredFlag) { + this.responseRequiredFlag = responseRequiredFlag; + isSetResponseRequiredFlag = true; // mark as set + return this; + } + + /** + * Indicates if the message response is required. + * + * @return responseRequiredFlag Indicates if the message response is required. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE_REQUIRED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getResponseRequiredFlag() { + return responseRequiredFlag; + } + + /** + * Indicates if the message response is required. + * + * @param responseRequiredFlag Indicates if the message response is required. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE_REQUIRED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseRequiredFlag(Boolean responseRequiredFlag) { + this.responseRequiredFlag = responseRequiredFlag; + isSetResponseRequiredFlag = true; // mark as set + } + + /** + * Number of seconds the message has to be displayed. + * + * @param minimumDisplayTime Number of seconds the message has to be displayed. + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput minimumDisplayTime(Integer minimumDisplayTime) { + this.minimumDisplayTime = minimumDisplayTime; + isSetMinimumDisplayTime = true; // mark as set + return this; + } + + /** + * Number of seconds the message has to be displayed. minimum: 0 maximum: 999 + * + * @return minimumDisplayTime Number of seconds the message has to be displayed. + */ + @JsonProperty(JSON_PROPERTY_MINIMUM_DISPLAY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinimumDisplayTime() { + return minimumDisplayTime; + } + + /** + * Number of seconds the message has to be displayed. + * + * @param minimumDisplayTime Number of seconds the message has to be displayed. + */ + @JsonProperty(JSON_PROPERTY_MINIMUM_DISPLAY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinimumDisplayTime(Integer minimumDisplayTime) { + this.minimumDisplayTime = minimumDisplayTime; + isSetMinimumDisplayTime = true; // mark as set + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in terms of class of information + * to output (display, print, or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, in terms of class of + * information to output (display, print, or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput device(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + return this; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in terms of class of information + * to output (display, print, or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @return device Logical device located on a Sale Terminal or a POI Terminal, in terms of class + * of information to output (display, print, or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceType getDevice() { + return device; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in terms of class of information + * to output (display, print, or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, in terms of class of + * information to output (display, print, or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDevice(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + } + + /** + * Qualification of the information to sent to an output logical device, to display or print to + * the Cashier or the Customer. Allows the manager of the device, Sale or POI Terminal, to send + * the information to a particular physical device or to present the information accordingly. + * Possible values: * **CustomerAssistance** * **Display** * **Document** * **Error** * **Input** + * * **POIReplication** * **Receipt** * **Sound** * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to sent to an output logical device, to + * display or print to the Cashier or the Customer. Allows the manager of the device, Sale or + * POI Terminal, to send the information to a particular physical device or to present the + * information accordingly. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput infoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + return this; + } + + /** + * Qualification of the information to sent to an output logical device, to display or print to + * the Cashier or the Customer. Allows the manager of the device, Sale or POI Terminal, to send + * the information to a particular physical device or to present the information accordingly. + * Possible values: * **CustomerAssistance** * **Display** * **Document** * **Error** * **Input** + * * **POIReplication** * **Receipt** * **Sound** * **Status** * **Voucher** + * + * @return infoQualify Qualification of the information to sent to an output logical device, to + * display or print to the Cashier or the Customer. Allows the manager of the device, Sale or + * POI Terminal, to send the information to a particular physical device or to present the + * information accordingly. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Qualification of the information to sent to an output logical device, to display or print to + * the Cashier or the Customer. Allows the manager of the device, Sale or POI Terminal, to send + * the information to a particular physical device or to present the information accordingly. + * Possible values: * **CustomerAssistance** * **Display** * **Document** * **Error** * **Input** + * * **POIReplication** * **Receipt** * **Sound** * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to sent to an output logical device, to + * display or print to the Cashier or the Customer. Allows the manager of the device, Sale or + * POI Terminal, to send the information to a particular physical device or to present the + * information accordingly. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + } + + /** + * Content to display or print. + * + * @param outputContent Content to display or print. + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput outputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + return this; + } + + /** + * Content to display or print. + * + * @return outputContent Content to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Content to display or print. + * + * @param outputContent Content to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + } + + /** + * An entry of the menu to present to the Cashier. It conveys the message text and parameters of + * the menu entry. This output data could be only provided for an input command, in order to + * choose an entryof the menu. + * + * @param menuEntry An entry of the menu to present to the Cashier. It conveys the message text + * and parameters of the menu entry. This output data could be only provided for an input + * command, in order to choose an entryof the menu. + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput menuEntry(List menuEntry) { + this.menuEntry = menuEntry; + isSetMenuEntry = true; // mark as set + return this; + } + + public DisplayOutput addMenuEntryItem(MenuEntry menuEntryItem) { + if (this.menuEntry == null) { + this.menuEntry = new ArrayList<>(); + } + this.menuEntry.add(menuEntryItem); + return this; + } + + /** + * An entry of the menu to present to the Cashier. It conveys the message text and parameters of + * the menu entry. This output data could be only provided for an input command, in order to + * choose an entryof the menu. + * + * @return menuEntry An entry of the menu to present to the Cashier. It conveys the message text + * and parameters of the menu entry. This output data could be only provided for an input + * command, in order to choose an entryof the menu. + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMenuEntry() { + return menuEntry; + } + + /** + * An entry of the menu to present to the Cashier. It conveys the message text and parameters of + * the menu entry. This output data could be only provided for an input command, in order to + * choose an entryof the menu. + * + * @param menuEntry An entry of the menu to present to the Cashier. It conveys the message text + * and parameters of the menu entry. This output data could be only provided for an input + * command, in order to choose an entryof the menu. + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuEntry(List menuEntry) { + this.menuEntry = menuEntry; + isSetMenuEntry = true; // mark as set + } + + /** + * Vendor-specific signature of the text message to display or print. If protection has to be + * provided to the vendor on the text to display or print. + * + * @param outputSignature Vendor-specific signature of the text message to display or print. If + * protection has to be provided to the vendor on the text to display or print. + * @return the current {@code DisplayOutput} instance, allowing for method chaining + */ + public DisplayOutput outputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + isSetOutputSignature = true; // mark as set + return this; + } + + /** + * Vendor-specific signature of the text message to display or print. If protection has to be + * provided to the vendor on the text to display or print. + * + * @return outputSignature Vendor-specific signature of the text message to display or print. If + * protection has to be provided to the vendor on the text to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getOutputSignature() { + return outputSignature; + } + + /** + * Vendor-specific signature of the text message to display or print. If protection has to be + * provided to the vendor on the text to display or print. + * + * @param outputSignature Vendor-specific signature of the text message to display or print. If + * protection has to be provided to the vendor on the text to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + isSetOutputSignature = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisplayOutput includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DisplayOutput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisplayOutput displayOutput = (DisplayOutput) o; + return Objects.equals(this.responseRequiredFlag, displayOutput.responseRequiredFlag) + && Objects.equals(this.isSetResponseRequiredFlag, displayOutput.isSetResponseRequiredFlag) + && Objects.equals(this.minimumDisplayTime, displayOutput.minimumDisplayTime) + && Objects.equals(this.isSetMinimumDisplayTime, displayOutput.isSetMinimumDisplayTime) + && Objects.equals(this.device, displayOutput.device) + && Objects.equals(this.isSetDevice, displayOutput.isSetDevice) + && Objects.equals(this.infoQualify, displayOutput.infoQualify) + && Objects.equals(this.isSetInfoQualify, displayOutput.isSetInfoQualify) + && Objects.equals(this.outputContent, displayOutput.outputContent) + && Objects.equals(this.isSetOutputContent, displayOutput.isSetOutputContent) + && Objects.equals(this.menuEntry, displayOutput.menuEntry) + && Objects.equals(this.isSetMenuEntry, displayOutput.isSetMenuEntry) + && Arrays.equals(this.outputSignature, displayOutput.outputSignature) + && Objects.equals(this.isSetOutputSignature, displayOutput.isSetOutputSignature); + } + + @Override + public int hashCode() { + return Objects.hash( + responseRequiredFlag, + isSetResponseRequiredFlag, + minimumDisplayTime, + isSetMinimumDisplayTime, + device, + isSetDevice, + infoQualify, + isSetInfoQualify, + outputContent, + isSetOutputContent, + menuEntry, + isSetMenuEntry, + Arrays.hashCode(outputSignature), + isSetOutputSignature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisplayOutput {\n"); + sb.append(" responseRequiredFlag: ") + .append(toIndentedString(responseRequiredFlag)) + .append("\n"); + sb.append(" minimumDisplayTime: ").append(toIndentedString(minimumDisplayTime)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" infoQualify: ").append(toIndentedString(infoQualify)).append("\n"); + sb.append(" outputContent: ").append(toIndentedString(outputContent)).append("\n"); + sb.append(" menuEntry: ").append(toIndentedString(menuEntry)).append("\n"); + sb.append(" outputSignature: ").append(toIndentedString(outputSignature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponseRequiredFlag) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE_REQUIRED_FLAG, this.responseRequiredFlag); + } + if (isSetMinimumDisplayTime) { + addIfNull(nulls, JSON_PROPERTY_MINIMUM_DISPLAY_TIME, this.minimumDisplayTime); + } + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetInfoQualify) { + addIfNull(nulls, JSON_PROPERTY_INFO_QUALIFY, this.infoQualify); + } + if (isSetOutputContent) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_CONTENT, this.outputContent); + } + if (isSetMenuEntry) { + addIfNull(nulls, JSON_PROPERTY_MENU_ENTRY, this.menuEntry); + } + if (isSetOutputSignature) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_SIGNATURE, this.outputSignature); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DisplayOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisplayOutput + * @throws JsonProcessingException if the JSON string is invalid with respect to DisplayOutput + */ + public static DisplayOutput fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DisplayOutput.class); + } + + /** + * Convert an instance of DisplayOutput to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DisplayRequest.java b/src/main/java/com/adyen/model/tapi/DisplayRequest.java new file mode 100644 index 000000000..d13bdd354 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DisplayRequest.java @@ -0,0 +1,195 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys the data to display and the way to process the display. It contains the complete + * content to display. It might contain an operation (the DisplayOutput element) per Display Device + * type. Content of the Display Request message. + */ +@JsonPropertyOrder({DisplayRequest.JSON_PROPERTY_DISPLAY_OUTPUT}) +public class DisplayRequest { + public static final String JSON_PROPERTY_DISPLAY_OUTPUT = "DisplayOutput"; + private List displayOutput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DisplayRequest() {} + + /** + * Information to display and the way to process the display. Complete display content for output + * devices. At most one DisplayOutput per Device/ InfoQualify pair. + * + * @param displayOutput Information to display and the way to process the display. Complete + * display content for output devices. At most one DisplayOutput per Device/ InfoQualify pair. + * @return the current {@code DisplayRequest} instance, allowing for method chaining + */ + public DisplayRequest displayOutput(List displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + return this; + } + + public DisplayRequest addDisplayOutputItem(DisplayOutput displayOutputItem) { + if (this.displayOutput == null) { + this.displayOutput = new ArrayList<>(); + } + this.displayOutput.add(displayOutputItem); + return this; + } + + /** + * Information to display and the way to process the display. Complete display content for output + * devices. At most one DisplayOutput per Device/ InfoQualify pair. + * + * @return displayOutput Information to display and the way to process the display. Complete + * display content for output devices. At most one DisplayOutput per Device/ InfoQualify pair. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisplayOutput() { + return displayOutput; + } + + /** + * Information to display and the way to process the display. Complete display content for output + * devices. At most one DisplayOutput per Device/ InfoQualify pair. + * + * @param displayOutput Information to display and the way to process the display. Complete + * display content for output devices. At most one DisplayOutput per Device/ InfoQualify pair. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOutput(List displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisplayRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DisplayRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisplayRequest displayRequest = (DisplayRequest) o; + return Objects.equals(this.displayOutput, displayRequest.displayOutput) + && Objects.equals(this.isSetDisplayOutput, displayRequest.isSetDisplayOutput); + } + + @Override + public int hashCode() { + return Objects.hash(displayOutput, isSetDisplayOutput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisplayRequest {\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDisplayOutput) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_OUTPUT, this.displayOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DisplayRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisplayRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to DisplayRequest + */ + public static DisplayRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DisplayRequest.class); + } + + /** + * Convert an instance of DisplayRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DisplayResponse.java b/src/main/java/com/adyen/model/tapi/DisplayResponse.java new file mode 100644 index 000000000..c75230872 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DisplayResponse.java @@ -0,0 +1,194 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys the result of the display, parallel to the message request, except if response not + * required and absent. Content of the Display Response message. + */ +@JsonPropertyOrder({DisplayResponse.JSON_PROPERTY_OUTPUT_RESULT}) +public class DisplayResponse { + public static final String JSON_PROPERTY_OUTPUT_RESULT = "OutputResult"; + private List outputResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DisplayResponse() {} + + /** + * Information related to the result the output (display, print, input). One per DisplayOutput + * item of the request, and in the same order. + * + * @param outputResult Information related to the result the output (display, print, input). One + * per DisplayOutput item of the request, and in the same order. + * @return the current {@code DisplayResponse} instance, allowing for method chaining + */ + public DisplayResponse outputResult(List outputResult) { + this.outputResult = outputResult; + isSetOutputResult = true; // mark as set + return this; + } + + public DisplayResponse addOutputResultItem(OutputResult outputResultItem) { + if (this.outputResult == null) { + this.outputResult = new ArrayList<>(); + } + this.outputResult.add(outputResultItem); + return this; + } + + /** + * Information related to the result the output (display, print, input). One per DisplayOutput + * item of the request, and in the same order. + * + * @return outputResult Information related to the result the output (display, print, input). One + * per DisplayOutput item of the request, and in the same order. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOutputResult() { + return outputResult; + } + + /** + * Information related to the result the output (display, print, input). One per DisplayOutput + * item of the request, and in the same order. + * + * @param outputResult Information related to the result the output (display, print, input). One + * per DisplayOutput item of the request, and in the same order. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputResult(List outputResult) { + this.outputResult = outputResult; + isSetOutputResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisplayResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DisplayResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisplayResponse displayResponse = (DisplayResponse) o; + return Objects.equals(this.outputResult, displayResponse.outputResult) + && Objects.equals(this.isSetOutputResult, displayResponse.isSetOutputResult); + } + + @Override + public int hashCode() { + return Objects.hash(outputResult, isSetOutputResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisplayResponse {\n"); + sb.append(" outputResult: ").append(toIndentedString(outputResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOutputResult) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_RESULT, this.outputResult); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DisplayResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisplayResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to DisplayResponse + */ + public static DisplayResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DisplayResponse.class); + } + + /** + * Convert an instance of DisplayResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/DocumentQualifierType.java b/src/main/java/com/adyen/model/tapi/DocumentQualifierType.java new file mode 100644 index 000000000..5b5feba67 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/DocumentQualifierType.java @@ -0,0 +1,57 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets DocumentQualifier */ +public enum DocumentQualifierType { + CASHIER_RECEIPT("CashierReceipt"), + + CUSTOMER_RECEIPT("CustomerReceipt"), + + DOCUMENT("Document"), + + JOURNAL("Journal"), + + SALE_RECEIPT("SaleReceipt"), + + VOUCHER("Voucher"); + + private String value; + + DocumentQualifierType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DocumentQualifierType fromValue(String value) { + for (DocumentQualifierType b : DocumentQualifierType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/EnableServiceRequest.java b/src/main/java/com/adyen/model/tapi/EnableServiceRequest.java new file mode 100644 index 000000000..3b25ccbec --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/EnableServiceRequest.java @@ -0,0 +1,377 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * It conveys the services that will be enabled for the POI Terminal without the request of the Sale + * System, and a possible invitation for the Customer to start the services. Content of the Enable + * Service Request message. + */ +@JsonPropertyOrder({ + EnableServiceRequest.JSON_PROPERTY_TRANSACTION_ACTION, + EnableServiceRequest.JSON_PROPERTY_SERVICES_ENABLED, + EnableServiceRequest.JSON_PROPERTY_DISPLAY_OUTPUT +}) +public class EnableServiceRequest { + public static final String JSON_PROPERTY_TRANSACTION_ACTION = "TransactionAction"; + private TransactionActionType transactionAction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionAction = false; + + /** Gets or Sets servicesEnabled */ + public enum ServicesEnabledEnum { + CARD_ACQUISITION(String.valueOf("CardAcquisition")), + + LOYALTY(String.valueOf("Loyalty")), + + PAYMENT(String.valueOf("Payment")); + + private static final Logger LOG = Logger.getLogger(ServicesEnabledEnum.class.getName()); + + private String value; + + ServicesEnabledEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ServicesEnabledEnum fromValue(String value) { + for (ServicesEnabledEnum b : ServicesEnabledEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "ServicesEnabledEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ServicesEnabledEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_SERVICES_ENABLED = "ServicesEnabled"; + private List servicesEnabled; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetServicesEnabled = false; + + public static final String JSON_PROPERTY_DISPLAY_OUTPUT = "DisplayOutput"; + private DisplayOutput displayOutput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public EnableServiceRequest() {} + + /** + * Action to realise on a transaction. In an `EnableService` request message: - Starts a + * transaction by a swipe-ahead mechanism, with the services which are enabled. - Aborts a + * swipe-ahead transaction or started by a `CardAcquisition`, and not followed by a + * service request from the Sale System to complete the transaction. Possible values: * + * **AbortTransaction** * **StartTransaction** + * + * @param transactionAction Action to realise on a transaction. In an `EnableService` + * request message: - Starts a transaction by a swipe-ahead mechanism, with the services which + * are enabled. - Aborts a swipe-ahead transaction or started by a + * `CardAcquisition`, and not followed by a service request from the Sale System to + * complete the transaction. Possible values: * **AbortTransaction** * **StartTransaction** + * @return the current {@code EnableServiceRequest} instance, allowing for method chaining + */ + public EnableServiceRequest transactionAction(TransactionActionType transactionAction) { + this.transactionAction = transactionAction; + isSetTransactionAction = true; // mark as set + return this; + } + + /** + * Action to realise on a transaction. In an `EnableService` request message: - Starts a + * transaction by a swipe-ahead mechanism, with the services which are enabled. - Aborts a + * swipe-ahead transaction or started by a `CardAcquisition`, and not followed by a + * service request from the Sale System to complete the transaction. Possible values: * + * **AbortTransaction** * **StartTransaction** + * + * @return transactionAction Action to realise on a transaction. In an `EnableService` + * request message: - Starts a transaction by a swipe-ahead mechanism, with the services which + * are enabled. - Aborts a swipe-ahead transaction or started by a + * `CardAcquisition`, and not followed by a service request from the Sale System to + * complete the transaction. Possible values: * **AbortTransaction** * **StartTransaction** + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionActionType getTransactionAction() { + return transactionAction; + } + + /** + * Action to realise on a transaction. In an `EnableService` request message: - Starts a + * transaction by a swipe-ahead mechanism, with the services which are enabled. - Aborts a + * swipe-ahead transaction or started by a `CardAcquisition`, and not followed by a + * service request from the Sale System to complete the transaction. Possible values: * + * **AbortTransaction** * **StartTransaction** + * + * @param transactionAction Action to realise on a transaction. In an `EnableService` + * request message: - Starts a transaction by a swipe-ahead mechanism, with the services which + * are enabled. - Aborts a swipe-ahead transaction or started by a + * `CardAcquisition`, and not followed by a service request from the Sale System to + * complete the transaction. Possible values: * **AbortTransaction** * **StartTransaction** + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionAction(TransactionActionType transactionAction) { + this.transactionAction = transactionAction; + isSetTransactionAction = true; // mark as set + } + + /** + * Services which are enabled before the start-up of a transaction. Mandatory if + * `TransactionAction` is `StartTransaction`, absent if not. Possible values: + * * **CardAcquisition** * **Loyalty** * **Payment** + * + * @param servicesEnabled Services which are enabled before the start-up of a transaction. + * Mandatory if `TransactionAction` is `StartTransaction`, absent if not. + * Possible values: * **CardAcquisition** * **Loyalty** * **Payment** + * @return the current {@code EnableServiceRequest} instance, allowing for method chaining + */ + public EnableServiceRequest servicesEnabled(List servicesEnabled) { + this.servicesEnabled = servicesEnabled; + isSetServicesEnabled = true; // mark as set + return this; + } + + public EnableServiceRequest addServicesEnabledItem(ServicesEnabledEnum servicesEnabledItem) { + if (this.servicesEnabled == null) { + this.servicesEnabled = new ArrayList<>(); + } + this.servicesEnabled.add(servicesEnabledItem); + return this; + } + + /** + * Services which are enabled before the start-up of a transaction. Mandatory if + * `TransactionAction` is `StartTransaction`, absent if not. Possible values: + * * **CardAcquisition** * **Loyalty** * **Payment** + * + * @return servicesEnabled Services which are enabled before the start-up of a transaction. + * Mandatory if `TransactionAction` is `StartTransaction`, absent if not. + * Possible values: * **CardAcquisition** * **Loyalty** * **Payment** + */ + @JsonProperty(JSON_PROPERTY_SERVICES_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getServicesEnabled() { + return servicesEnabled; + } + + /** + * Services which are enabled before the start-up of a transaction. Mandatory if + * `TransactionAction` is `StartTransaction`, absent if not. Possible values: + * * **CardAcquisition** * **Loyalty** * **Payment** + * + * @param servicesEnabled Services which are enabled before the start-up of a transaction. + * Mandatory if `TransactionAction` is `StartTransaction`, absent if not. + * Possible values: * **CardAcquisition** * **Loyalty** * **Payment** + */ + @JsonProperty(JSON_PROPERTY_SERVICES_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServicesEnabled(List servicesEnabled) { + this.servicesEnabled = servicesEnabled; + isSetServicesEnabled = true; // mark as set + } + + /** + * Information to display and the way to process the display. + * + * @param displayOutput Information to display and the way to process the display. + * @return the current {@code EnableServiceRequest} instance, allowing for method chaining + */ + public EnableServiceRequest displayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + return this; + } + + /** + * Information to display and the way to process the display. + * + * @return displayOutput Information to display and the way to process the display. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Information to display and the way to process the display. + * + * @param displayOutput Information to display and the way to process the display. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EnableServiceRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this EnableServiceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnableServiceRequest enableServiceRequest = (EnableServiceRequest) o; + return Objects.equals(this.transactionAction, enableServiceRequest.transactionAction) + && Objects.equals(this.isSetTransactionAction, enableServiceRequest.isSetTransactionAction) + && Objects.equals(this.servicesEnabled, enableServiceRequest.servicesEnabled) + && Objects.equals(this.isSetServicesEnabled, enableServiceRequest.isSetServicesEnabled) + && Objects.equals(this.displayOutput, enableServiceRequest.displayOutput) + && Objects.equals(this.isSetDisplayOutput, enableServiceRequest.isSetDisplayOutput); + } + + @Override + public int hashCode() { + return Objects.hash( + transactionAction, + isSetTransactionAction, + servicesEnabled, + isSetServicesEnabled, + displayOutput, + isSetDisplayOutput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnableServiceRequest {\n"); + sb.append(" transactionAction: ").append(toIndentedString(transactionAction)).append("\n"); + sb.append(" servicesEnabled: ").append(toIndentedString(servicesEnabled)).append("\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransactionAction) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ACTION, this.transactionAction); + } + if (isSetServicesEnabled) { + addIfNull(nulls, JSON_PROPERTY_SERVICES_ENABLED, this.servicesEnabled); + } + if (isSetDisplayOutput) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_OUTPUT, this.displayOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of EnableServiceRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnableServiceRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * EnableServiceRequest + */ + public static EnableServiceRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, EnableServiceRequest.class); + } + + /** + * Convert an instance of EnableServiceRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/EnableServiceResponse.java b/src/main/java/com/adyen/model/tapi/EnableServiceResponse.java new file mode 100644 index 000000000..3259353d3 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/EnableServiceResponse.java @@ -0,0 +1,179 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * It conveys the result of the Enable Service processing. Content of the Enable Service Response + * message. + */ +@JsonPropertyOrder({EnableServiceResponse.JSON_PROPERTY_RESPONSE}) +public class EnableServiceResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public EnableServiceResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code EnableServiceResponse} instance, allowing for method chaining + */ + public EnableServiceResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EnableServiceResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this EnableServiceResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnableServiceResponse enableServiceResponse = (EnableServiceResponse) o; + return Objects.equals(this.response, enableServiceResponse.response) + && Objects.equals(this.isSetResponse, enableServiceResponse.isSetResponse); + } + + @Override + public int hashCode() { + return Objects.hash(response, isSetResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnableServiceResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of EnableServiceResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnableServiceResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * EnableServiceResponse + */ + public static EnableServiceResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, EnableServiceResponse.class); + } + + /** + * Convert an instance of EnableServiceResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ErrorConditionType.java b/src/main/java/com/adyen/model/tapi/ErrorConditionType.java new file mode 100644 index 000000000..ad0b79941 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ErrorConditionType.java @@ -0,0 +1,79 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets ErrorCondition */ +public enum ErrorConditionType { + ABORTED("Aborted"), + + BUSY("Busy"), + + CANCEL("Cancel"), + + DEVICE_OUT("DeviceOut"), + + IN_PROGRESS("InProgress"), + + INSERTED_CARD("InsertedCard"), + + INVALID_CARD("InvalidCard"), + + LOGGED_OUT("LoggedOut"), + + MESSAGE_FORMAT("MessageFormat"), + + NOT_ALLOWED("NotAllowed"), + + NOT_FOUND("NotFound"), + + PAYMENT_RESTRICTION("PaymentRestriction"), + + REFUSAL("Refusal"), + + UNAVAILABLE_DEVICE("UnavailableDevice"), + + UNAVAILABLE_SERVICE("UnavailableService"), + + UNREACHABLE_HOST("UnreachableHost"), + + WRONG_PIN("WrongPIN"); + + private String value; + + ErrorConditionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ErrorConditionType fromValue(String value) { + for (ErrorConditionType b : ErrorConditionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/EventNotification.java b/src/main/java/com/adyen/model/tapi/EventNotification.java new file mode 100644 index 000000000..1a3426904 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/EventNotification.java @@ -0,0 +1,492 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Content of the EventNotification message. It conveys Information related to the event, and + * possible action (maintenance, message to display). + */ +@JsonPropertyOrder({ + EventNotification.JSON_PROPERTY_TIME_STAMP, + EventNotification.JSON_PROPERTY_EVENT_TO_NOTIFY, + EventNotification.JSON_PROPERTY_EVENT_DETAILS, + EventNotification.JSON_PROPERTY_REJECTED_MESSAGE, + EventNotification.JSON_PROPERTY_MAINTENANCE_REQUIRED_FLAG, + EventNotification.JSON_PROPERTY_DISPLAY_OUTPUT +}) +public class EventNotification { + public static final String JSON_PROPERTY_TIME_STAMP = "TimeStamp"; + private OffsetDateTime timeStamp; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeStamp = false; + + public static final String JSON_PROPERTY_EVENT_TO_NOTIFY = "EventToNotify"; + private EventToNotifyType eventToNotify; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventToNotify = false; + + public static final String JSON_PROPERTY_EVENT_DETAILS = "EventDetails"; + private String eventDetails; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventDetails = false; + + public static final String JSON_PROPERTY_REJECTED_MESSAGE = "RejectedMessage"; + private byte[] rejectedMessage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRejectedMessage = false; + + public static final String JSON_PROPERTY_MAINTENANCE_REQUIRED_FLAG = "MaintenanceRequiredFlag"; + private Boolean maintenanceRequiredFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaintenanceRequiredFlag = false; + + public static final String JSON_PROPERTY_DISPLAY_OUTPUT = "DisplayOutput"; + private List displayOutput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public EventNotification() {} + + /** + * Date and time of a transaction for the Sale System, the POI System or the Acquirer. + * + * @param timeStamp Date and time of a transaction for the Sale System, the POI System or the + * Acquirer. + * @return the current {@code EventNotification} instance, allowing for method chaining + */ + public EventNotification timeStamp(OffsetDateTime timeStamp) { + this.timeStamp = timeStamp; + isSetTimeStamp = true; // mark as set + return this; + } + + /** + * Date and time of a transaction for the Sale System, the POI System or the Acquirer. + * + * @return timeStamp Date and time of a transaction for the Sale System, the POI System or the + * Acquirer. + */ + @JsonProperty(JSON_PROPERTY_TIME_STAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getTimeStamp() { + return timeStamp; + } + + /** + * Date and time of a transaction for the Sale System, the POI System or the Acquirer. + * + * @param timeStamp Date and time of a transaction for the Sale System, the POI System or the + * Acquirer. + */ + @JsonProperty(JSON_PROPERTY_TIME_STAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeStamp(OffsetDateTime timeStamp) { + this.timeStamp = timeStamp; + isSetTimeStamp = true; // mark as set + } + + /** + * Event the POI notifies to the Sale System. Possible values: * **Abort** * **BeginMaintenance** + * * **CardInserted** * **CardRemoved** * **Completed** * **CustomerLanguage** * + * **EndMaintenance** * **Initialised** * **KeyPressed** * **OutOfOrder** * **Reject** * + * **SaleAdmin** * **SaleWakeUp** * **ScanBarcodeResult** * **SecurityAlarm** * **Shutdown** * + * **StopAssistance** * **UseAnotherCardForPreauth** + * + * @param eventToNotify Event the POI notifies to the Sale System. Possible values: * **Abort** * + * **BeginMaintenance** * **CardInserted** * **CardRemoved** * **Completed** * + * **CustomerLanguage** * **EndMaintenance** * **Initialised** * **KeyPressed** * + * **OutOfOrder** * **Reject** * **SaleAdmin** * **SaleWakeUp** * **ScanBarcodeResult** * + * **SecurityAlarm** * **Shutdown** * **StopAssistance** * **UseAnotherCardForPreauth** + * @return the current {@code EventNotification} instance, allowing for method chaining + */ + public EventNotification eventToNotify(EventToNotifyType eventToNotify) { + this.eventToNotify = eventToNotify; + isSetEventToNotify = true; // mark as set + return this; + } + + /** + * Event the POI notifies to the Sale System. Possible values: * **Abort** * **BeginMaintenance** + * * **CardInserted** * **CardRemoved** * **Completed** * **CustomerLanguage** * + * **EndMaintenance** * **Initialised** * **KeyPressed** * **OutOfOrder** * **Reject** * + * **SaleAdmin** * **SaleWakeUp** * **ScanBarcodeResult** * **SecurityAlarm** * **Shutdown** * + * **StopAssistance** * **UseAnotherCardForPreauth** + * + * @return eventToNotify Event the POI notifies to the Sale System. Possible values: * **Abort** * + * **BeginMaintenance** * **CardInserted** * **CardRemoved** * **Completed** * + * **CustomerLanguage** * **EndMaintenance** * **Initialised** * **KeyPressed** * + * **OutOfOrder** * **Reject** * **SaleAdmin** * **SaleWakeUp** * **ScanBarcodeResult** * + * **SecurityAlarm** * **Shutdown** * **StopAssistance** * **UseAnotherCardForPreauth** + */ + @JsonProperty(JSON_PROPERTY_EVENT_TO_NOTIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventToNotifyType getEventToNotify() { + return eventToNotify; + } + + /** + * Event the POI notifies to the Sale System. Possible values: * **Abort** * **BeginMaintenance** + * * **CardInserted** * **CardRemoved** * **Completed** * **CustomerLanguage** * + * **EndMaintenance** * **Initialised** * **KeyPressed** * **OutOfOrder** * **Reject** * + * **SaleAdmin** * **SaleWakeUp** * **ScanBarcodeResult** * **SecurityAlarm** * **Shutdown** * + * **StopAssistance** * **UseAnotherCardForPreauth** + * + * @param eventToNotify Event the POI notifies to the Sale System. Possible values: * **Abort** * + * **BeginMaintenance** * **CardInserted** * **CardRemoved** * **Completed** * + * **CustomerLanguage** * **EndMaintenance** * **Initialised** * **KeyPressed** * + * **OutOfOrder** * **Reject** * **SaleAdmin** * **SaleWakeUp** * **ScanBarcodeResult** * + * **SecurityAlarm** * **Shutdown** * **StopAssistance** * **UseAnotherCardForPreauth** + */ + @JsonProperty(JSON_PROPERTY_EVENT_TO_NOTIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventToNotify(EventToNotifyType eventToNotify) { + this.eventToNotify = eventToNotify; + isSetEventToNotify = true; // mark as set + } + + /** + * Information about the event the POI notifies to the Sale System. If present, the Sale logs it + * for further examination. + * + * @param eventDetails Information about the event the POI notifies to the Sale System. If + * present, the Sale logs it for further examination. + * @return the current {@code EventNotification} instance, allowing for method chaining + */ + public EventNotification eventDetails(String eventDetails) { + this.eventDetails = eventDetails; + isSetEventDetails = true; // mark as set + return this; + } + + /** + * Information about the event the POI notifies to the Sale System. If present, the Sale logs it + * for further examination. + * + * @return eventDetails Information about the event the POI notifies to the Sale System. If + * present, the Sale logs it for further examination. + */ + @JsonProperty(JSON_PROPERTY_EVENT_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventDetails() { + return eventDetails; + } + + /** + * Information about the event the POI notifies to the Sale System. If present, the Sale logs it + * for further examination. + * + * @param eventDetails Information about the event the POI notifies to the Sale System. If + * present, the Sale logs it for further examination. + */ + @JsonProperty(JSON_PROPERTY_EVENT_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventDetails(String eventDetails) { + this.eventDetails = eventDetails; + isSetEventDetails = true; // mark as set + } + + /** + * Message request rejected by the receiver. Mandatory if EventToNotify is Reject, absent in other + * cases. + * + * @param rejectedMessage Message request rejected by the receiver. Mandatory if EventToNotify is + * Reject, absent in other cases. + * @return the current {@code EventNotification} instance, allowing for method chaining + */ + public EventNotification rejectedMessage(byte[] rejectedMessage) { + this.rejectedMessage = rejectedMessage; + isSetRejectedMessage = true; // mark as set + return this; + } + + /** + * Message request rejected by the receiver. Mandatory if EventToNotify is Reject, absent in other + * cases. + * + * @return rejectedMessage Message request rejected by the receiver. Mandatory if EventToNotify is + * Reject, absent in other cases. + */ + @JsonProperty(JSON_PROPERTY_REJECTED_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getRejectedMessage() { + return rejectedMessage; + } + + /** + * Message request rejected by the receiver. Mandatory if EventToNotify is Reject, absent in other + * cases. + * + * @param rejectedMessage Message request rejected by the receiver. Mandatory if EventToNotify is + * Reject, absent in other cases. + */ + @JsonProperty(JSON_PROPERTY_REJECTED_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRejectedMessage(byte[] rejectedMessage) { + this.rejectedMessage = rejectedMessage; + isSetRejectedMessage = true; // mark as set + } + + /** + * Indicates if the occurred event requires maintenance call or action. + * + * @param maintenanceRequiredFlag Indicates if the occurred event requires maintenance call or + * action. + * @return the current {@code EventNotification} instance, allowing for method chaining + */ + public EventNotification maintenanceRequiredFlag(Boolean maintenanceRequiredFlag) { + this.maintenanceRequiredFlag = maintenanceRequiredFlag; + isSetMaintenanceRequiredFlag = true; // mark as set + return this; + } + + /** + * Indicates if the occurred event requires maintenance call or action. + * + * @return maintenanceRequiredFlag Indicates if the occurred event requires maintenance call or + * action. + */ + @JsonProperty(JSON_PROPERTY_MAINTENANCE_REQUIRED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMaintenanceRequiredFlag() { + return maintenanceRequiredFlag; + } + + /** + * Indicates if the occurred event requires maintenance call or action. + * + * @param maintenanceRequiredFlag Indicates if the occurred event requires maintenance call or + * action. + */ + @JsonProperty(JSON_PROPERTY_MAINTENANCE_REQUIRED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaintenanceRequiredFlag(Boolean maintenanceRequiredFlag) { + this.maintenanceRequiredFlag = maintenanceRequiredFlag; + isSetMaintenanceRequiredFlag = true; // mark as set + } + + /** + * Information to display and the way to process the display. To display an event message. + * + * @param displayOutput Information to display and the way to process the display. To display an + * event message. + * @return the current {@code EventNotification} instance, allowing for method chaining + */ + public EventNotification displayOutput(List displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + return this; + } + + public EventNotification addDisplayOutputItem(DisplayOutput displayOutputItem) { + if (this.displayOutput == null) { + this.displayOutput = new ArrayList<>(); + } + this.displayOutput.add(displayOutputItem); + return this; + } + + /** + * Information to display and the way to process the display. To display an event message. + * + * @return displayOutput Information to display and the way to process the display. To display an + * event message. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisplayOutput() { + return displayOutput; + } + + /** + * Information to display and the way to process the display. To display an event message. + * + * @param displayOutput Information to display and the way to process the display. To display an + * event message. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOutput(List displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EventNotification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this EventNotification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventNotification eventNotification = (EventNotification) o; + return Objects.equals(this.timeStamp, eventNotification.timeStamp) + && Objects.equals(this.isSetTimeStamp, eventNotification.isSetTimeStamp) + && Objects.equals(this.eventToNotify, eventNotification.eventToNotify) + && Objects.equals(this.isSetEventToNotify, eventNotification.isSetEventToNotify) + && Objects.equals(this.eventDetails, eventNotification.eventDetails) + && Objects.equals(this.isSetEventDetails, eventNotification.isSetEventDetails) + && Arrays.equals(this.rejectedMessage, eventNotification.rejectedMessage) + && Objects.equals(this.isSetRejectedMessage, eventNotification.isSetRejectedMessage) + && Objects.equals(this.maintenanceRequiredFlag, eventNotification.maintenanceRequiredFlag) + && Objects.equals( + this.isSetMaintenanceRequiredFlag, eventNotification.isSetMaintenanceRequiredFlag) + && Objects.equals(this.displayOutput, eventNotification.displayOutput) + && Objects.equals(this.isSetDisplayOutput, eventNotification.isSetDisplayOutput); + } + + @Override + public int hashCode() { + return Objects.hash( + timeStamp, + isSetTimeStamp, + eventToNotify, + isSetEventToNotify, + eventDetails, + isSetEventDetails, + Arrays.hashCode(rejectedMessage), + isSetRejectedMessage, + maintenanceRequiredFlag, + isSetMaintenanceRequiredFlag, + displayOutput, + isSetDisplayOutput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventNotification {\n"); + sb.append(" timeStamp: ").append(toIndentedString(timeStamp)).append("\n"); + sb.append(" eventToNotify: ").append(toIndentedString(eventToNotify)).append("\n"); + sb.append(" eventDetails: ").append(toIndentedString(eventDetails)).append("\n"); + sb.append(" rejectedMessage: ").append(toIndentedString(rejectedMessage)).append("\n"); + sb.append(" maintenanceRequiredFlag: ") + .append(toIndentedString(maintenanceRequiredFlag)) + .append("\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTimeStamp) { + addIfNull(nulls, JSON_PROPERTY_TIME_STAMP, this.timeStamp); + } + if (isSetEventToNotify) { + addIfNull(nulls, JSON_PROPERTY_EVENT_TO_NOTIFY, this.eventToNotify); + } + if (isSetEventDetails) { + addIfNull(nulls, JSON_PROPERTY_EVENT_DETAILS, this.eventDetails); + } + if (isSetRejectedMessage) { + addIfNull(nulls, JSON_PROPERTY_REJECTED_MESSAGE, this.rejectedMessage); + } + if (isSetMaintenanceRequiredFlag) { + addIfNull(nulls, JSON_PROPERTY_MAINTENANCE_REQUIRED_FLAG, this.maintenanceRequiredFlag); + } + if (isSetDisplayOutput) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_OUTPUT, this.displayOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of EventNotification given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventNotification + * @throws JsonProcessingException if the JSON string is invalid with respect to EventNotification + */ + public static EventNotification fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, EventNotification.class); + } + + /** + * Convert an instance of EventNotification to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/EventToNotifyType.java b/src/main/java/com/adyen/model/tapi/EventToNotifyType.java new file mode 100644 index 000000000..41cb93c4d --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/EventToNotifyType.java @@ -0,0 +1,87 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Event the POI notifies to the Sale System. Possible values: * **Abort** * **BeginMaintenance** * + * **CardInserted** * **CardRemoved** * **Completed** * **CustomerLanguage** * **EndMaintenance** * + * **Initialised** * **KeyPressed** * **OutOfOrder** * **Reject** * **SaleAdmin** * **SaleWakeUp** * + * **ScanBarcodeResult** * **SecurityAlarm** * **Shutdown** * **StopAssistance** * + * **UseAnotherCardForPreauth** + */ +public enum EventToNotifyType { + ABORT("Abort"), + + BEGIN_MAINTENANCE("BeginMaintenance"), + + CARD_INSERTED("CardInserted"), + + CARD_REMOVED("CardRemoved"), + + COMPLETED("Completed"), + + CUSTOMER_LANGUAGE("CustomerLanguage"), + + END_MAINTENANCE("EndMaintenance"), + + INITIALISED("Initialised"), + + KEY_PRESSED("KeyPressed"), + + OUT_OF_ORDER("OutOfOrder"), + + REJECT("Reject"), + + SALE_ADMIN("SaleAdmin"), + + SALE_WAKE_UP("SaleWakeUp"), + + SCAN_BARCODE_RESULT("ScanBarcodeResult"), + + SECURITY_ALARM("SecurityAlarm"), + + SHUTDOWN("Shutdown"), + + STOP_ASSISTANCE("StopAssistance"), + + USE_ANOTHER_CARD_FOR_PREAUTH("UseAnotherCardForPreauth"); + + private String value; + + EventToNotifyType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventToNotifyType fromValue(String value) { + for (EventToNotifyType b : EventToNotifyType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/GeographicCoordinates.java b/src/main/java/com/adyen/model/tapi/GeographicCoordinates.java new file mode 100644 index 000000000..f8c523fef --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/GeographicCoordinates.java @@ -0,0 +1,232 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** GeographicCoordinates */ +@JsonPropertyOrder({ + GeographicCoordinates.JSON_PROPERTY_LATITUDE, + GeographicCoordinates.JSON_PROPERTY_LONGITUDE +}) +public class GeographicCoordinates { + public static final String JSON_PROPERTY_LATITUDE = "Latitude"; + private String latitude; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLatitude = false; + + public static final String JSON_PROPERTY_LONGITUDE = "Longitude"; + private String longitude; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLongitude = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GeographicCoordinates() {} + + /** + * Angular distance of a location on the earth south or north of the equator. + * + * @param latitude Angular distance of a location on the earth south or north of the equator. + * @return the current {@code GeographicCoordinates} instance, allowing for method chaining + */ + public GeographicCoordinates latitude(String latitude) { + this.latitude = latitude; + isSetLatitude = true; // mark as set + return this; + } + + /** + * Angular distance of a location on the earth south or north of the equator. + * + * @return latitude Angular distance of a location on the earth south or north of the equator. + */ + @JsonProperty(JSON_PROPERTY_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLatitude() { + return latitude; + } + + /** + * Angular distance of a location on the earth south or north of the equator. + * + * @param latitude Angular distance of a location on the earth south or north of the equator. + */ + @JsonProperty(JSON_PROPERTY_LATITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLatitude(String latitude) { + this.latitude = latitude; + isSetLatitude = true; // mark as set + } + + /** + * Angular measurement of the distance of a location on the earth east or west of the Greenwich + * observatory. + * + * @param longitude Angular measurement of the distance of a location on the earth east or west of + * the Greenwich observatory. + * @return the current {@code GeographicCoordinates} instance, allowing for method chaining + */ + public GeographicCoordinates longitude(String longitude) { + this.longitude = longitude; + isSetLongitude = true; // mark as set + return this; + } + + /** + * Angular measurement of the distance of a location on the earth east or west of the Greenwich + * observatory. + * + * @return longitude Angular measurement of the distance of a location on the earth east or west + * of the Greenwich observatory. + */ + @JsonProperty(JSON_PROPERTY_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLongitude() { + return longitude; + } + + /** + * Angular measurement of the distance of a location on the earth east or west of the Greenwich + * observatory. + * + * @param longitude Angular measurement of the distance of a location on the earth east or west of + * the Greenwich observatory. + */ + @JsonProperty(JSON_PROPERTY_LONGITUDE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLongitude(String longitude) { + this.longitude = longitude; + isSetLongitude = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GeographicCoordinates includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GeographicCoordinates object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeographicCoordinates geographicCoordinates = (GeographicCoordinates) o; + return Objects.equals(this.latitude, geographicCoordinates.latitude) + && Objects.equals(this.isSetLatitude, geographicCoordinates.isSetLatitude) + && Objects.equals(this.longitude, geographicCoordinates.longitude) + && Objects.equals(this.isSetLongitude, geographicCoordinates.isSetLongitude); + } + + @Override + public int hashCode() { + return Objects.hash(latitude, isSetLatitude, longitude, isSetLongitude); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeographicCoordinates {\n"); + sb.append(" latitude: ").append(toIndentedString(latitude)).append("\n"); + sb.append(" longitude: ").append(toIndentedString(longitude)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLatitude) { + addIfNull(nulls, JSON_PROPERTY_LATITUDE, this.latitude); + } + if (isSetLongitude) { + addIfNull(nulls, JSON_PROPERTY_LONGITUDE, this.longitude); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GeographicCoordinates given an JSON string + * + * @param jsonString JSON string + * @return An instance of GeographicCoordinates + * @throws JsonProcessingException if the JSON string is invalid with respect to + * GeographicCoordinates + */ + public static GeographicCoordinates fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GeographicCoordinates.class); + } + + /** + * Convert an instance of GeographicCoordinates to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/Geolocation.java b/src/main/java/com/adyen/model/tapi/Geolocation.java new file mode 100644 index 000000000..f917cb4fd --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/Geolocation.java @@ -0,0 +1,228 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Geolocation */ +@JsonPropertyOrder({ + Geolocation.JSON_PROPERTY_GEOGRAPHIC_COORDINATES, + Geolocation.JSON_PROPERTY_UT_M_COORDINATES +}) +public class Geolocation { + public static final String JSON_PROPERTY_GEOGRAPHIC_COORDINATES = "GeographicCoordinates"; + private GeographicCoordinates geographicCoordinates; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGeographicCoordinates = false; + + public static final String JSON_PROPERTY_UT_M_COORDINATES = "UTMCoordinates"; + private UTMCoordinates utMCoordinates; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUtMCoordinates = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Geolocation() {} + + /** + * geographicCoordinates + * + * @param geographicCoordinates + * @return the current {@code Geolocation} instance, allowing for method chaining + */ + public Geolocation geographicCoordinates(GeographicCoordinates geographicCoordinates) { + this.geographicCoordinates = geographicCoordinates; + isSetGeographicCoordinates = true; // mark as set + return this; + } + + /** + * Get geographicCoordinates + * + * @return geographicCoordinates + */ + @JsonProperty(JSON_PROPERTY_GEOGRAPHIC_COORDINATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GeographicCoordinates getGeographicCoordinates() { + return geographicCoordinates; + } + + /** + * geographicCoordinates + * + * @param geographicCoordinates + */ + @JsonProperty(JSON_PROPERTY_GEOGRAPHIC_COORDINATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGeographicCoordinates(GeographicCoordinates geographicCoordinates) { + this.geographicCoordinates = geographicCoordinates; + isSetGeographicCoordinates = true; // mark as set + } + + /** + * utMCoordinates + * + * @param utMCoordinates + * @return the current {@code Geolocation} instance, allowing for method chaining + */ + public Geolocation utMCoordinates(UTMCoordinates utMCoordinates) { + this.utMCoordinates = utMCoordinates; + isSetUtMCoordinates = true; // mark as set + return this; + } + + /** + * Get utMCoordinates + * + * @return utMCoordinates + */ + @JsonProperty(JSON_PROPERTY_UT_M_COORDINATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UTMCoordinates getUtMCoordinates() { + return utMCoordinates; + } + + /** + * utMCoordinates + * + * @param utMCoordinates + */ + @JsonProperty(JSON_PROPERTY_UT_M_COORDINATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUtMCoordinates(UTMCoordinates utMCoordinates) { + this.utMCoordinates = utMCoordinates; + isSetUtMCoordinates = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Geolocation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Geolocation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Geolocation geolocation = (Geolocation) o; + return Objects.equals(this.geographicCoordinates, geolocation.geographicCoordinates) + && Objects.equals(this.isSetGeographicCoordinates, geolocation.isSetGeographicCoordinates) + && Objects.equals(this.utMCoordinates, geolocation.utMCoordinates) + && Objects.equals(this.isSetUtMCoordinates, geolocation.isSetUtMCoordinates); + } + + @Override + public int hashCode() { + return Objects.hash( + geographicCoordinates, isSetGeographicCoordinates, utMCoordinates, isSetUtMCoordinates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Geolocation {\n"); + sb.append(" geographicCoordinates: ") + .append(toIndentedString(geographicCoordinates)) + .append("\n"); + sb.append(" utMCoordinates: ").append(toIndentedString(utMCoordinates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetGeographicCoordinates) { + addIfNull(nulls, JSON_PROPERTY_GEOGRAPHIC_COORDINATES, this.geographicCoordinates); + } + if (isSetUtMCoordinates) { + addIfNull(nulls, JSON_PROPERTY_UT_M_COORDINATES, this.utMCoordinates); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Geolocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Geolocation + * @throws JsonProcessingException if the JSON string is invalid with respect to Geolocation + */ + public static Geolocation fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Geolocation.class); + } + + /** + * Convert an instance of Geolocation to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/GetTotalsRequest.java b/src/main/java/com/adyen/model/tapi/GetTotalsRequest.java new file mode 100644 index 000000000..5816d928d --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/GetTotalsRequest.java @@ -0,0 +1,319 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * It conveys information from the Sale System related to the scope and the format of the totals to + * be computed by the POI System. Content of the Get Totals Request message. + */ +@JsonPropertyOrder({ + GetTotalsRequest.JSON_PROPERTY_TOTAL_DETAILS, + GetTotalsRequest.JSON_PROPERTY_TOTAL_FILTER +}) +public class GetTotalsRequest { + /** Gets or Sets totalDetails */ + public enum TotalDetailsEnum { + OPERATOR_ID(String.valueOf("OperatorID")), + + POIID(String.valueOf("POIID")), + + SALE_ID(String.valueOf("SaleID")), + + SHIFT_NUMBER(String.valueOf("ShiftNumber")), + + TOTALS_GROUP_ID(String.valueOf("TotalsGroupID")); + + private static final Logger LOG = Logger.getLogger(TotalDetailsEnum.class.getName()); + + private String value; + + TotalDetailsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TotalDetailsEnum fromValue(String value) { + for (TotalDetailsEnum b : TotalDetailsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TotalDetailsEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TotalDetailsEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TOTAL_DETAILS = "TotalDetails"; + private List totalDetails; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalDetails = false; + + public static final String JSON_PROPERTY_TOTAL_FILTER = "TotalFilter"; + private TotalFilter totalFilter; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalFilter = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GetTotalsRequest() {} + + /** + * Indicates the hierarchical structure of the reconciliation result of the Sale to POI + * reconciliation. Required to present totals per value of element included in this cluster (POI + * Terminal, Sale Terminal, Cashier, Shift, TotalsGroupID). Possible values: * **OperatorID** * + * **POIID** * **SaleID** * **ShiftNumber** * **TotalsGroupID** + * + * @param totalDetails Indicates the hierarchical structure of the reconciliation result of the + * Sale to POI reconciliation. Required to present totals per value of element included in + * this cluster (POI Terminal, Sale Terminal, Cashier, Shift, TotalsGroupID). Possible values: + * * **OperatorID** * **POIID** * **SaleID** * **ShiftNumber** * **TotalsGroupID** + * @return the current {@code GetTotalsRequest} instance, allowing for method chaining + */ + public GetTotalsRequest totalDetails(List totalDetails) { + this.totalDetails = totalDetails; + isSetTotalDetails = true; // mark as set + return this; + } + + public GetTotalsRequest addTotalDetailsItem(TotalDetailsEnum totalDetailsItem) { + if (this.totalDetails == null) { + this.totalDetails = new ArrayList<>(); + } + this.totalDetails.add(totalDetailsItem); + return this; + } + + /** + * Indicates the hierarchical structure of the reconciliation result of the Sale to POI + * reconciliation. Required to present totals per value of element included in this cluster (POI + * Terminal, Sale Terminal, Cashier, Shift, TotalsGroupID). Possible values: * **OperatorID** * + * **POIID** * **SaleID** * **ShiftNumber** * **TotalsGroupID** + * + * @return totalDetails Indicates the hierarchical structure of the reconciliation result of the + * Sale to POI reconciliation. Required to present totals per value of element included in + * this cluster (POI Terminal, Sale Terminal, Cashier, Shift, TotalsGroupID). Possible values: + * * **OperatorID** * **POIID** * **SaleID** * **ShiftNumber** * **TotalsGroupID** + */ + @JsonProperty(JSON_PROPERTY_TOTAL_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTotalDetails() { + return totalDetails; + } + + /** + * Indicates the hierarchical structure of the reconciliation result of the Sale to POI + * reconciliation. Required to present totals per value of element included in this cluster (POI + * Terminal, Sale Terminal, Cashier, Shift, TotalsGroupID). Possible values: * **OperatorID** * + * **POIID** * **SaleID** * **ShiftNumber** * **TotalsGroupID** + * + * @param totalDetails Indicates the hierarchical structure of the reconciliation result of the + * Sale to POI reconciliation. Required to present totals per value of element included in + * this cluster (POI Terminal, Sale Terminal, Cashier, Shift, TotalsGroupID). Possible values: + * * **OperatorID** * **POIID** * **SaleID** * **ShiftNumber** * **TotalsGroupID** + */ + @JsonProperty(JSON_PROPERTY_TOTAL_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalDetails(List totalDetails) { + this.totalDetails = totalDetails; + isSetTotalDetails = true; // mark as set + } + + /** + * Filter to compute the totals. Used for the Get Totals, to request totals for a (or a + * combination of) particular value of the POI Terminal, Sale Terminal, Cashier, Shift, or + * TotalsGroupID. + * + * @param totalFilter Filter to compute the totals. Used for the Get Totals, to request totals for + * a (or a combination of) particular value of the POI Terminal, Sale Terminal, Cashier, + * Shift, or TotalsGroupID. + * @return the current {@code GetTotalsRequest} instance, allowing for method chaining + */ + public GetTotalsRequest totalFilter(TotalFilter totalFilter) { + this.totalFilter = totalFilter; + isSetTotalFilter = true; // mark as set + return this; + } + + /** + * Filter to compute the totals. Used for the Get Totals, to request totals for a (or a + * combination of) particular value of the POI Terminal, Sale Terminal, Cashier, Shift, or + * TotalsGroupID. + * + * @return totalFilter Filter to compute the totals. Used for the Get Totals, to request totals + * for a (or a combination of) particular value of the POI Terminal, Sale Terminal, Cashier, + * Shift, or TotalsGroupID. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TotalFilter getTotalFilter() { + return totalFilter; + } + + /** + * Filter to compute the totals. Used for the Get Totals, to request totals for a (or a + * combination of) particular value of the POI Terminal, Sale Terminal, Cashier, Shift, or + * TotalsGroupID. + * + * @param totalFilter Filter to compute the totals. Used for the Get Totals, to request totals for + * a (or a combination of) particular value of the POI Terminal, Sale Terminal, Cashier, + * Shift, or TotalsGroupID. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FILTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalFilter(TotalFilter totalFilter) { + this.totalFilter = totalFilter; + isSetTotalFilter = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetTotalsRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GetTotalsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTotalsRequest getTotalsRequest = (GetTotalsRequest) o; + return Objects.equals(this.totalDetails, getTotalsRequest.totalDetails) + && Objects.equals(this.isSetTotalDetails, getTotalsRequest.isSetTotalDetails) + && Objects.equals(this.totalFilter, getTotalsRequest.totalFilter) + && Objects.equals(this.isSetTotalFilter, getTotalsRequest.isSetTotalFilter); + } + + @Override + public int hashCode() { + return Objects.hash(totalDetails, isSetTotalDetails, totalFilter, isSetTotalFilter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTotalsRequest {\n"); + sb.append(" totalDetails: ").append(toIndentedString(totalDetails)).append("\n"); + sb.append(" totalFilter: ").append(toIndentedString(totalFilter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTotalDetails) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_DETAILS, this.totalDetails); + } + if (isSetTotalFilter) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_FILTER, this.totalFilter); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GetTotalsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTotalsRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to GetTotalsRequest + */ + public static GetTotalsRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GetTotalsRequest.class); + } + + /** + * Convert an instance of GetTotalsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/GetTotalsResponse.java b/src/main/java/com/adyen/model/tapi/GetTotalsResponse.java new file mode 100644 index 000000000..1d70e2730 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/GetTotalsResponse.java @@ -0,0 +1,297 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * Content of the Reconciliation Response message. It conveys Information related to the + * Reconciliation transaction processed by the POI System. + */ +@JsonPropertyOrder({ + GetTotalsResponse.JSON_PROPERTY_RESPONSE, + GetTotalsResponse.JSON_PROPERTY_PO_I_RECONCILIATION_I_D, + GetTotalsResponse.JSON_PROPERTY_TRANSACTION_TOTALS +}) +public class GetTotalsResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_PO_I_RECONCILIATION_I_D = "POIReconciliationID"; + private Integer poIReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIReconciliationID = false; + + public static final String JSON_PROPERTY_TRANSACTION_TOTALS = "TransactionTotals"; + private List transactionTotals; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionTotals = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GetTotalsResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code GetTotalsResponse} instance, allowing for method chaining + */ + public GetTotalsResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Identification of the reconciliation period between Sale and POI. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. + * @return the current {@code GetTotalsResponse} instance, allowing for method chaining + */ + public GetTotalsResponse poIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + return this; + } + + /** + * Identification of the reconciliation period between Sale and POI. + * + * @return poIReconciliationID Identification of the reconciliation period between Sale and POI. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPoIReconciliationID() { + return poIReconciliationID; + } + + /** + * Identification of the reconciliation period between Sale and POI. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + } + + /** + * Result of the Sale to POI Reconciliation processing. If `Response.Result` is Success. + * + * @param transactionTotals Result of the Sale to POI Reconciliation processing. If + * `Response.Result` is Success. + * @return the current {@code GetTotalsResponse} instance, allowing for method chaining + */ + public GetTotalsResponse transactionTotals(List transactionTotals) { + this.transactionTotals = transactionTotals; + isSetTransactionTotals = true; // mark as set + return this; + } + + public GetTotalsResponse addTransactionTotalsItem(TransactionTotals transactionTotalsItem) { + if (this.transactionTotals == null) { + this.transactionTotals = new ArrayList<>(); + } + this.transactionTotals.add(transactionTotalsItem); + return this; + } + + /** + * Result of the Sale to POI Reconciliation processing. If `Response.Result` is Success. + * + * @return transactionTotals Result of the Sale to POI Reconciliation processing. If + * `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_TOTALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTransactionTotals() { + return transactionTotals; + } + + /** + * Result of the Sale to POI Reconciliation processing. If `Response.Result` is Success. + * + * @param transactionTotals Result of the Sale to POI Reconciliation processing. If + * `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_TOTALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionTotals(List transactionTotals) { + this.transactionTotals = transactionTotals; + isSetTransactionTotals = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetTotalsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GetTotalsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTotalsResponse getTotalsResponse = (GetTotalsResponse) o; + return Objects.equals(this.response, getTotalsResponse.response) + && Objects.equals(this.isSetResponse, getTotalsResponse.isSetResponse) + && Objects.equals(this.poIReconciliationID, getTotalsResponse.poIReconciliationID) + && Objects.equals(this.isSetPoIReconciliationID, getTotalsResponse.isSetPoIReconciliationID) + && Objects.equals(this.transactionTotals, getTotalsResponse.transactionTotals) + && Objects.equals(this.isSetTransactionTotals, getTotalsResponse.isSetTransactionTotals); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + poIReconciliationID, + isSetPoIReconciliationID, + transactionTotals, + isSetTransactionTotals); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTotalsResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" poIReconciliationID: ") + .append(toIndentedString(poIReconciliationID)) + .append("\n"); + sb.append(" transactionTotals: ").append(toIndentedString(transactionTotals)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetPoIReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_PO_I_RECONCILIATION_I_D, this.poIReconciliationID); + } + if (isSetTransactionTotals) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_TOTALS, this.transactionTotals); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GetTotalsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTotalsResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to GetTotalsResponse + */ + public static GetTotalsResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GetTotalsResponse.class); + } + + /** + * Convert an instance of GetTotalsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/GlobalStatusType.java b/src/main/java/com/adyen/model/tapi/GlobalStatusType.java new file mode 100644 index 000000000..d4a29a3af --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/GlobalStatusType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets GlobalStatus */ +public enum GlobalStatusType { + BUSY("Busy"), + + MAINTENANCE("Maintenance"), + + OK("OK"), + + UNREACHABLE("Unreachable"); + + private String value; + + GlobalStatusType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GlobalStatusType fromValue(String value) { + for (GlobalStatusType b : GlobalStatusType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/HostStatus.java b/src/main/java/com/adyen/model/tapi/HostStatus.java new file mode 100644 index 000000000..b3769ca1c --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/HostStatus.java @@ -0,0 +1,225 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Indicate the reachability of the host by the POI Terminal. State of a Host. */ +@JsonPropertyOrder({ + HostStatus.JSON_PROPERTY_ACQUIRER_I_D, + HostStatus.JSON_PROPERTY_IS_REACHABLE_FLAG +}) +public class HostStatus { + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private Integer acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + public static final String JSON_PROPERTY_IS_REACHABLE_FLAG = "IsReachableFlag"; + private Boolean isReachableFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIsReachableFlag = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public HostStatus() {} + + /** + * Identification of the Acquirer. + * + * @param acquirerID Identification of the Acquirer. + * @return the current {@code HostStatus} instance, allowing for method chaining + */ + public HostStatus acquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + /** + * Identification of the Acquirer. + * + * @return acquirerID Identification of the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. + * + * @param acquirerID Identification of the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * Indicate if a Host is reachable. + * + * @param isReachableFlag Indicate if a Host is reachable. + * @return the current {@code HostStatus} instance, allowing for method chaining + */ + public HostStatus isReachableFlag(Boolean isReachableFlag) { + this.isReachableFlag = isReachableFlag; + isSetIsReachableFlag = true; // mark as set + return this; + } + + /** + * Indicate if a Host is reachable. + * + * @return isReachableFlag Indicate if a Host is reachable. + */ + @JsonProperty(JSON_PROPERTY_IS_REACHABLE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsReachableFlag() { + return isReachableFlag; + } + + /** + * Indicate if a Host is reachable. + * + * @param isReachableFlag Indicate if a Host is reachable. + */ + @JsonProperty(JSON_PROPERTY_IS_REACHABLE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsReachableFlag(Boolean isReachableFlag) { + this.isReachableFlag = isReachableFlag; + isSetIsReachableFlag = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HostStatus includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this HostStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HostStatus hostStatus = (HostStatus) o; + return Objects.equals(this.acquirerID, hostStatus.acquirerID) + && Objects.equals(this.isSetAcquirerID, hostStatus.isSetAcquirerID) + && Objects.equals(this.isReachableFlag, hostStatus.isReachableFlag) + && Objects.equals(this.isSetIsReachableFlag, hostStatus.isSetIsReachableFlag); + } + + @Override + public int hashCode() { + return Objects.hash(acquirerID, isSetAcquirerID, isReachableFlag, isSetIsReachableFlag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HostStatus {\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append(" isReachableFlag: ").append(toIndentedString(isReachableFlag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + if (isSetIsReachableFlag) { + addIfNull(nulls, JSON_PROPERTY_IS_REACHABLE_FLAG, this.isReachableFlag); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of HostStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of HostStatus + * @throws JsonProcessingException if the JSON string is invalid with respect to HostStatus + */ + public static HostStatus fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, HostStatus.class); + } + + /** + * Convert an instance of HostStatus to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ICCResetData.java b/src/main/java/com/adyen/model/tapi/ICCResetData.java new file mode 100644 index 000000000..c37587aab --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ICCResetData.java @@ -0,0 +1,230 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; + +/** ICCResetData */ +@JsonPropertyOrder({ + ICCResetData.JSON_PROPERTY_AT_R_VALUE, + ICCResetData.JSON_PROPERTY_CARD_STATUS_WORDS +}) +public class ICCResetData { + public static final String JSON_PROPERTY_AT_R_VALUE = "ATRValue"; + private byte[] atRValue; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAtRValue = false; + + public static final String JSON_PROPERTY_CARD_STATUS_WORDS = "CardStatusWords"; + private byte[] cardStatusWords; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardStatusWords = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ICCResetData() {} + + /** + * atRValue + * + * @param atRValue + * @return the current {@code ICCResetData} instance, allowing for method chaining + */ + public ICCResetData atRValue(byte[] atRValue) { + this.atRValue = atRValue; + isSetAtRValue = true; // mark as set + return this; + } + + /** + * Get atRValue + * + * @return atRValue + */ + @JsonProperty(JSON_PROPERTY_AT_R_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getAtRValue() { + return atRValue; + } + + /** + * atRValue + * + * @param atRValue + */ + @JsonProperty(JSON_PROPERTY_AT_R_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAtRValue(byte[] atRValue) { + this.atRValue = atRValue; + isSetAtRValue = true; // mark as set + } + + /** + * cardStatusWords + * + * @param cardStatusWords + * @return the current {@code ICCResetData} instance, allowing for method chaining + */ + public ICCResetData cardStatusWords(byte[] cardStatusWords) { + this.cardStatusWords = cardStatusWords; + isSetCardStatusWords = true; // mark as set + return this; + } + + /** + * Get cardStatusWords + * + * @return cardStatusWords + */ + @JsonProperty(JSON_PROPERTY_CARD_STATUS_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getCardStatusWords() { + return cardStatusWords; + } + + /** + * cardStatusWords + * + * @param cardStatusWords + */ + @JsonProperty(JSON_PROPERTY_CARD_STATUS_WORDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardStatusWords(byte[] cardStatusWords) { + this.cardStatusWords = cardStatusWords; + isSetCardStatusWords = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ICCResetData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ICCResetData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ICCResetData icCResetData = (ICCResetData) o; + return Arrays.equals(this.atRValue, icCResetData.atRValue) + && Objects.equals(this.isSetAtRValue, icCResetData.isSetAtRValue) + && Arrays.equals(this.cardStatusWords, icCResetData.cardStatusWords) + && Objects.equals(this.isSetCardStatusWords, icCResetData.isSetCardStatusWords); + } + + @Override + public int hashCode() { + return Objects.hash( + Arrays.hashCode(atRValue), + isSetAtRValue, + Arrays.hashCode(cardStatusWords), + isSetCardStatusWords); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ICCResetData {\n"); + sb.append(" atRValue: ").append(toIndentedString(atRValue)).append("\n"); + sb.append(" cardStatusWords: ").append(toIndentedString(cardStatusWords)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAtRValue) { + addIfNull(nulls, JSON_PROPERTY_AT_R_VALUE, this.atRValue); + } + if (isSetCardStatusWords) { + addIfNull(nulls, JSON_PROPERTY_CARD_STATUS_WORDS, this.cardStatusWords); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ICCResetData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ICCResetData + * @throws JsonProcessingException if the JSON string is invalid with respect to ICCResetData + */ + public static ICCResetData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ICCResetData.class); + } + + /** + * Convert an instance of ICCResetData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/IdentificationSupportType.java b/src/main/java/com/adyen/model/tapi/IdentificationSupportType.java new file mode 100644 index 000000000..ee3a935d7 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/IdentificationSupportType.java @@ -0,0 +1,57 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Support of the loyalty account identification. Allows knowing where and how you have found the + * loyalty account identification. Possible values: * **HybridCard** * **LinkedCard** * + * **LoyaltyCard** * **NoCard** + */ +public enum IdentificationSupportType { + HYBRID_CARD("HybridCard"), + + LINKED_CARD("LinkedCard"), + + LOYALTY_CARD("LoyaltyCard"), + + NO_CARD("NoCard"); + + private String value; + + IdentificationSupportType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IdentificationSupportType fromValue(String value) { + for (IdentificationSupportType b : IdentificationSupportType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/IdentificationType.java b/src/main/java/com/adyen/model/tapi/IdentificationType.java new file mode 100644 index 000000000..122fccc62 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/IdentificationType.java @@ -0,0 +1,55 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets IdentificationType */ +public enum IdentificationType { + ACCOUNT_NUMBER("AccountNumber"), + + BAR_CODE("BarCode"), + + ISO_TRACK2("ISOTrack2"), + + PAN("PAN"), + + PHONE_NUMBER("PhoneNumber"); + + private String value; + + IdentificationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IdentificationType fromValue(String value) { + for (IdentificationType b : IdentificationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InfoQualifyType.java b/src/main/java/com/adyen/model/tapi/InfoQualifyType.java new file mode 100644 index 000000000..631dcae9a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InfoQualifyType.java @@ -0,0 +1,65 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets InfoQualify */ +public enum InfoQualifyType { + CUSTOMER_ASSISTANCE("CustomerAssistance"), + + DISPLAY("Display"), + + DOCUMENT("Document"), + + ERROR("Error"), + + INPUT("Input"), + + POI_REPLICATION("POIReplication"), + + RECEIPT("Receipt"), + + SOUND("Sound"), + + STATUS("Status"), + + VOUCHER("Voucher"); + + private String value; + + InfoQualifyType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InfoQualifyType fromValue(String value) { + for (InfoQualifyType b : InfoQualifyType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/Input.java b/src/main/java/com/adyen/model/tapi/Input.java new file mode 100644 index 000000000..0e269480d --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/Input.java @@ -0,0 +1,537 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Input */ +@JsonPropertyOrder({ + Input.JSON_PROPERTY_INPUT_COMMAND, + Input.JSON_PROPERTY_CONFIRMED_FLAG, + Input.JSON_PROPERTY_FUNCTION_KEY, + Input.JSON_PROPERTY_TEXT_INPUT, + Input.JSON_PROPERTY_DIGIT_INPUT, + Input.JSON_PROPERTY_PASSWORD, + Input.JSON_PROPERTY_MENU_ENTRY_NUMBER +}) +public class Input { + public static final String JSON_PROPERTY_INPUT_COMMAND = "InputCommand"; + private InputCommandType inputCommand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputCommand = false; + + public static final String JSON_PROPERTY_CONFIRMED_FLAG = "ConfirmedFlag"; + private Boolean confirmedFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfirmedFlag = false; + + public static final String JSON_PROPERTY_FUNCTION_KEY = "FunctionKey"; + private Integer functionKey; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFunctionKey = false; + + public static final String JSON_PROPERTY_TEXT_INPUT = "TextInput"; + private String textInput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTextInput = false; + + public static final String JSON_PROPERTY_DIGIT_INPUT = "DigitInput"; + private Integer digitInput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDigitInput = false; + + public static final String JSON_PROPERTY_PASSWORD = "Password"; + private String password; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassword = false; + + public static final String JSON_PROPERTY_MENU_ENTRY_NUMBER = "MenuEntryNumber"; + private List menuEntryNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMenuEntryNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Input() {} + + /** + * Type of requested input. Can be: **GetConfirmation**, **TextString**, **DigitString**, + * **DecimalString** or **GetMenuEntry**. Possible values: * **DecimalString** * **DigitString** * + * **GetAnyKey** * **GetConfirmation** * **GetFunctionKey** * **GetMenuEntry** * **Password** * + * **SiteManager** * **TextString** + * + * @param inputCommand Type of requested input. Can be: **GetConfirmation**, **TextString**, + * **DigitString**, **DecimalString** or **GetMenuEntry**. Possible values: * + * **DecimalString** * **DigitString** * **GetAnyKey** * **GetConfirmation** * + * **GetFunctionKey** * **GetMenuEntry** * **Password** * **SiteManager** * **TextString** + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input inputCommand(InputCommandType inputCommand) { + this.inputCommand = inputCommand; + isSetInputCommand = true; // mark as set + return this; + } + + /** + * Type of requested input. Can be: **GetConfirmation**, **TextString**, **DigitString**, + * **DecimalString** or **GetMenuEntry**. Possible values: * **DecimalString** * **DigitString** * + * **GetAnyKey** * **GetConfirmation** * **GetFunctionKey** * **GetMenuEntry** * **Password** * + * **SiteManager** * **TextString** + * + * @return inputCommand Type of requested input. Can be: **GetConfirmation**, **TextString**, + * **DigitString**, **DecimalString** or **GetMenuEntry**. Possible values: * + * **DecimalString** * **DigitString** * **GetAnyKey** * **GetConfirmation** * + * **GetFunctionKey** * **GetMenuEntry** * **Password** * **SiteManager** * **TextString** + */ + @JsonProperty(JSON_PROPERTY_INPUT_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputCommandType getInputCommand() { + return inputCommand; + } + + /** + * Type of requested input. Can be: **GetConfirmation**, **TextString**, **DigitString**, + * **DecimalString** or **GetMenuEntry**. Possible values: * **DecimalString** * **DigitString** * + * **GetAnyKey** * **GetConfirmation** * **GetFunctionKey** * **GetMenuEntry** * **Password** * + * **SiteManager** * **TextString** + * + * @param inputCommand Type of requested input. Can be: **GetConfirmation**, **TextString**, + * **DigitString**, **DecimalString** or **GetMenuEntry**. Possible values: * + * **DecimalString** * **DigitString** * **GetAnyKey** * **GetConfirmation** * + * **GetFunctionKey** * **GetMenuEntry** * **Password** * **SiteManager** * **TextString** + */ + @JsonProperty(JSON_PROPERTY_INPUT_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputCommand(InputCommandType inputCommand) { + this.inputCommand = inputCommand; + isSetInputCommand = true; // mark as set + } + + /** + * Indicates te response of the user from the `GetConfirmation` input command. + * + * @param confirmedFlag Indicates te response of the user from the `GetConfirmation` + * input command. + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input confirmedFlag(Boolean confirmedFlag) { + this.confirmedFlag = confirmedFlag; + isSetConfirmedFlag = true; // mark as set + return this; + } + + /** + * Indicates te response of the user from the `GetConfirmation` input command. + * + * @return confirmedFlag Indicates te response of the user from the `GetConfirmation` + * input command. + */ + @JsonProperty(JSON_PROPERTY_CONFIRMED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getConfirmedFlag() { + return confirmedFlag; + } + + /** + * Indicates te response of the user from the `GetConfirmation` input command. + * + * @param confirmedFlag Indicates te response of the user from the `GetConfirmation` + * input command. + */ + @JsonProperty(JSON_PROPERTY_CONFIRMED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfirmedFlag(Boolean confirmedFlag) { + this.confirmedFlag = confirmedFlag; + isSetConfirmedFlag = true; // mark as set + } + + /** + * The number of the function key which is typed by the Customer on the POI or the Cashier on the + * Sale Terminal. + * + * @param functionKey The number of the function key which is typed by the Customer on the POI or + * the Cashier on the Sale Terminal. + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input functionKey(Integer functionKey) { + this.functionKey = functionKey; + isSetFunctionKey = true; // mark as set + return this; + } + + /** + * The number of the function key which is typed by the Customer on the POI or the Cashier on the + * Sale Terminal. + * + * @return functionKey The number of the function key which is typed by the Customer on the POI or + * the Cashier on the Sale Terminal. + */ + @JsonProperty(JSON_PROPERTY_FUNCTION_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFunctionKey() { + return functionKey; + } + + /** + * The number of the function key which is typed by the Customer on the POI or the Cashier on the + * Sale Terminal. + * + * @param functionKey The number of the function key which is typed by the Customer on the POI or + * the Cashier on the Sale Terminal. + */ + @JsonProperty(JSON_PROPERTY_FUNCTION_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunctionKey(Integer functionKey) { + this.functionKey = functionKey; + isSetFunctionKey = true; // mark as set + } + + /** + * The text typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @param textInput The text typed by the Customer on the POI or by the Cashier on the Sale + * Terminal. + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input textInput(String textInput) { + this.textInput = textInput; + isSetTextInput = true; // mark as set + return this; + } + + /** + * The text typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @return textInput The text typed by the Customer on the POI or by the Cashier on the Sale + * Terminal. + */ + @JsonProperty(JSON_PROPERTY_TEXT_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTextInput() { + return textInput; + } + + /** + * The text typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @param textInput The text typed by the Customer on the POI or by the Cashier on the Sale + * Terminal. + */ + @JsonProperty(JSON_PROPERTY_TEXT_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextInput(String textInput) { + this.textInput = textInput; + isSetTextInput = true; // mark as set + } + + /** + * The digits typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @param digitInput The digits typed by the Customer on the POI or by the Cashier on the Sale + * Terminal. + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input digitInput(Integer digitInput) { + this.digitInput = digitInput; + isSetDigitInput = true; // mark as set + return this; + } + + /** + * The digits typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @return digitInput The digits typed by the Customer on the POI or by the Cashier on the Sale + * Terminal. + */ + @JsonProperty(JSON_PROPERTY_DIGIT_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDigitInput() { + return digitInput; + } + + /** + * The digits typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @param digitInput The digits typed by the Customer on the POI or by the Cashier on the Sale + * Terminal. + */ + @JsonProperty(JSON_PROPERTY_DIGIT_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDigitInput(Integer digitInput) { + this.digitInput = digitInput; + isSetDigitInput = true; // mark as set + } + + /** + * The text password typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @param password The text password typed by the Customer on the POI or by the Cashier on the + * Sale Terminal. + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input password(String password) { + this.password = password; + isSetPassword = true; // mark as set + return this; + } + + /** + * The text password typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @return password The text password typed by the Customer on the POI or by the Cashier on the + * Sale Terminal. + */ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + /** + * The text password typed by the Customer on the POI or by the Cashier on the Sale Terminal. + * + * @param password The text password typed by the Customer on the POI or by the Cashier on the + * Sale Terminal. + */ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + isSetPassword = true; // mark as set + } + + /** + * The index of the menu item (from 1 to n) which is selected by the Cashier on the Sale Terminal. + * The value -1 indicates that the immediate upper level of the menu is requested. The value 0 + * indicates that the root of the menu is requested. + * + * @param menuEntryNumber The index of the menu item (from 1 to n) which is selected by the + * Cashier on the Sale Terminal. The value -1 indicates that the immediate upper level of the + * menu is requested. The value 0 indicates that the root of the menu is requested. + * @return the current {@code Input} instance, allowing for method chaining + */ + public Input menuEntryNumber(List menuEntryNumber) { + this.menuEntryNumber = menuEntryNumber; + isSetMenuEntryNumber = true; // mark as set + return this; + } + + public Input addMenuEntryNumberItem(Integer menuEntryNumberItem) { + if (this.menuEntryNumber == null) { + this.menuEntryNumber = new ArrayList<>(); + } + this.menuEntryNumber.add(menuEntryNumberItem); + return this; + } + + /** + * The index of the menu item (from 1 to n) which is selected by the Cashier on the Sale Terminal. + * The value -1 indicates that the immediate upper level of the menu is requested. The value 0 + * indicates that the root of the menu is requested. + * + * @return menuEntryNumber The index of the menu item (from 1 to n) which is selected by the + * Cashier on the Sale Terminal. The value -1 indicates that the immediate upper level of the + * menu is requested. The value 0 indicates that the root of the menu is requested. + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMenuEntryNumber() { + return menuEntryNumber; + } + + /** + * The index of the menu item (from 1 to n) which is selected by the Cashier on the Sale Terminal. + * The value -1 indicates that the immediate upper level of the menu is requested. The value 0 + * indicates that the root of the menu is requested. + * + * @param menuEntryNumber The index of the menu item (from 1 to n) which is selected by the + * Cashier on the Sale Terminal. The value -1 indicates that the immediate upper level of the + * menu is requested. The value 0 indicates that the root of the menu is requested. + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuEntryNumber(List menuEntryNumber) { + this.menuEntryNumber = menuEntryNumber; + isSetMenuEntryNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Input includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Input object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Input input = (Input) o; + return Objects.equals(this.inputCommand, input.inputCommand) + && Objects.equals(this.isSetInputCommand, input.isSetInputCommand) + && Objects.equals(this.confirmedFlag, input.confirmedFlag) + && Objects.equals(this.isSetConfirmedFlag, input.isSetConfirmedFlag) + && Objects.equals(this.functionKey, input.functionKey) + && Objects.equals(this.isSetFunctionKey, input.isSetFunctionKey) + && Objects.equals(this.textInput, input.textInput) + && Objects.equals(this.isSetTextInput, input.isSetTextInput) + && Objects.equals(this.digitInput, input.digitInput) + && Objects.equals(this.isSetDigitInput, input.isSetDigitInput) + && Objects.equals(this.password, input.password) + && Objects.equals(this.isSetPassword, input.isSetPassword) + && Objects.equals(this.menuEntryNumber, input.menuEntryNumber) + && Objects.equals(this.isSetMenuEntryNumber, input.isSetMenuEntryNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + inputCommand, + isSetInputCommand, + confirmedFlag, + isSetConfirmedFlag, + functionKey, + isSetFunctionKey, + textInput, + isSetTextInput, + digitInput, + isSetDigitInput, + password, + isSetPassword, + menuEntryNumber, + isSetMenuEntryNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Input {\n"); + sb.append(" inputCommand: ").append(toIndentedString(inputCommand)).append("\n"); + sb.append(" confirmedFlag: ").append(toIndentedString(confirmedFlag)).append("\n"); + sb.append(" functionKey: ").append(toIndentedString(functionKey)).append("\n"); + sb.append(" textInput: ").append(toIndentedString(textInput)).append("\n"); + sb.append(" digitInput: ").append(toIndentedString(digitInput)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" menuEntryNumber: ").append(toIndentedString(menuEntryNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetInputCommand) { + addIfNull(nulls, JSON_PROPERTY_INPUT_COMMAND, this.inputCommand); + } + if (isSetConfirmedFlag) { + addIfNull(nulls, JSON_PROPERTY_CONFIRMED_FLAG, this.confirmedFlag); + } + if (isSetFunctionKey) { + addIfNull(nulls, JSON_PROPERTY_FUNCTION_KEY, this.functionKey); + } + if (isSetTextInput) { + addIfNull(nulls, JSON_PROPERTY_TEXT_INPUT, this.textInput); + } + if (isSetDigitInput) { + addIfNull(nulls, JSON_PROPERTY_DIGIT_INPUT, this.digitInput); + } + if (isSetPassword) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD, this.password); + } + if (isSetMenuEntryNumber) { + addIfNull(nulls, JSON_PROPERTY_MENU_ENTRY_NUMBER, this.menuEntryNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of Input + * @throws JsonProcessingException if the JSON string is invalid with respect to Input + */ + public static Input fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Input.class); + } + + /** + * Convert an instance of Input to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InputCommandType.java b/src/main/java/com/adyen/model/tapi/InputCommandType.java new file mode 100644 index 000000000..d1e6bc48f --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InputCommandType.java @@ -0,0 +1,63 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets InputCommand */ +public enum InputCommandType { + DECIMAL_STRING("DecimalString"), + + DIGIT_STRING("DigitString"), + + GET_ANY_KEY("GetAnyKey"), + + GET_CONFIRMATION("GetConfirmation"), + + GET_FUNCTION_KEY("GetFunctionKey"), + + GET_MENU_ENTRY("GetMenuEntry"), + + PASSWORD("Password"), + + SITE_MANAGER("SiteManager"), + + TEXT_STRING("TextString"); + + private String value; + + InputCommandType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InputCommandType fromValue(String value) { + for (InputCommandType b : InputCommandType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InputData.java b/src/main/java/com/adyen/model/tapi/InputData.java new file mode 100644 index 000000000..fb05fe631 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InputData.java @@ -0,0 +1,1383 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** InputData */ +@JsonPropertyOrder({ + InputData.JSON_PROPERTY_DEVICE, + InputData.JSON_PROPERTY_INFO_QUALIFY, + InputData.JSON_PROPERTY_INPUT_COMMAND, + InputData.JSON_PROPERTY_NOTIFY_CARD_INPUT_FLAG, + InputData.JSON_PROPERTY_MAX_INPUT_TIME, + InputData.JSON_PROPERTY_IMMEDIATE_RESPONSE_FLAG, + InputData.JSON_PROPERTY_MIN_LENGTH, + InputData.JSON_PROPERTY_MAX_LENGTH, + InputData.JSON_PROPERTY_MAX_DECIMAL_LENGTH, + InputData.JSON_PROPERTY_WAIT_USER_VALIDATION_FLAG, + InputData.JSON_PROPERTY_DEFAULT_INPUT_STRING, + InputData.JSON_PROPERTY_DEFAULT_LAYOUT_STRING, + InputData.JSON_PROPERTY_STRING_MASK, + InputData.JSON_PROPERTY_FROM_RIGHT_TO_LEFT_FLAG, + InputData.JSON_PROPERTY_MASK_CHARACTERS_FLAG, + InputData.JSON_PROPERTY_BEEP_KEY_FLAG, + InputData.JSON_PROPERTY_GLOBAL_CORRECTION_FLAG, + InputData.JSON_PROPERTY_DISABLE_CANCEL_FLAG, + InputData.JSON_PROPERTY_DISABLE_CORRECT_FLAG, + InputData.JSON_PROPERTY_DISABLE_VALID_FLAG, + InputData.JSON_PROPERTY_MENU_BACK_FLAG +}) +public class InputData { + public static final String JSON_PROPERTY_DEVICE = "Device"; + private DeviceType device; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + + public static final String JSON_PROPERTY_INFO_QUALIFY = "InfoQualify"; + private InfoQualifyType infoQualify; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInfoQualify = false; + + public static final String JSON_PROPERTY_INPUT_COMMAND = "InputCommand"; + private InputCommandType inputCommand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputCommand = false; + + public static final String JSON_PROPERTY_NOTIFY_CARD_INPUT_FLAG = "NotifyCardInputFlag"; + private Boolean notifyCardInputFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotifyCardInputFlag = false; + + public static final String JSON_PROPERTY_MAX_INPUT_TIME = "MaxInputTime"; + private Integer maxInputTime; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxInputTime = false; + + public static final String JSON_PROPERTY_IMMEDIATE_RESPONSE_FLAG = "ImmediateResponseFlag"; + private Boolean immediateResponseFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetImmediateResponseFlag = false; + + public static final String JSON_PROPERTY_MIN_LENGTH = "MinLength"; + private Integer minLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinLength = false; + + public static final String JSON_PROPERTY_MAX_LENGTH = "MaxLength"; + private Integer maxLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxLength = false; + + public static final String JSON_PROPERTY_MAX_DECIMAL_LENGTH = "MaxDecimalLength"; + private Integer maxDecimalLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxDecimalLength = false; + + public static final String JSON_PROPERTY_WAIT_USER_VALIDATION_FLAG = "WaitUserValidationFlag"; + private Boolean waitUserValidationFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWaitUserValidationFlag = false; + + public static final String JSON_PROPERTY_DEFAULT_INPUT_STRING = "DefaultInputString"; + private String defaultInputString; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultInputString = false; + + public static final String JSON_PROPERTY_DEFAULT_LAYOUT_STRING = "DefaultLayoutString"; + private String defaultLayoutString; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultLayoutString = false; + + public static final String JSON_PROPERTY_STRING_MASK = "StringMask"; + private String stringMask; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStringMask = false; + + public static final String JSON_PROPERTY_FROM_RIGHT_TO_LEFT_FLAG = "FromRightToLeftFlag"; + private Boolean fromRightToLeftFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFromRightToLeftFlag = false; + + public static final String JSON_PROPERTY_MASK_CHARACTERS_FLAG = "MaskCharactersFlag"; + private Boolean maskCharactersFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskCharactersFlag = false; + + public static final String JSON_PROPERTY_BEEP_KEY_FLAG = "BeepKeyFlag"; + private Boolean beepKeyFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeepKeyFlag = false; + + public static final String JSON_PROPERTY_GLOBAL_CORRECTION_FLAG = "GlobalCorrectionFlag"; + private Boolean globalCorrectionFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGlobalCorrectionFlag = false; + + public static final String JSON_PROPERTY_DISABLE_CANCEL_FLAG = "DisableCancelFlag"; + private Boolean disableCancelFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisableCancelFlag = false; + + public static final String JSON_PROPERTY_DISABLE_CORRECT_FLAG = "DisableCorrectFlag"; + private Boolean disableCorrectFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisableCorrectFlag = false; + + public static final String JSON_PROPERTY_DISABLE_VALID_FLAG = "DisableValidFlag"; + private Boolean disableValidFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisableValidFlag = false; + + public static final String JSON_PROPERTY_MENU_BACK_FLAG = "MenuBackFlag"; + private Boolean menuBackFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMenuBackFlag = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InputData() {} + + /** + * Logical device located on a Sale Terminal or a POI Terminal, regarding the class of information + * to output (display, print or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, regarding the class + * of information to output (display, print or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData device(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + return this; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, regarding the class of information + * to output (display, print or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @return device Logical device located on a Sale Terminal or a POI Terminal, regarding the class + * of information to output (display, print or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceType getDevice() { + return device; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, regarding the class of information + * to output (display, print or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, regarding the class + * of information to output (display, print or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDevice(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + } + + /** + * Qualification of the information to send to an output logical device, to display or print to + * the Cashier or the Customer. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to send to an output logical device, to + * display or print to the Cashier or the Customer. Possible values: * **CustomerAssistance** + * * **Display** * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * + * **Sound** * **Status** * **Voucher** + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData infoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + return this; + } + + /** + * Qualification of the information to send to an output logical device, to display or print to + * the Cashier or the Customer. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @return infoQualify Qualification of the information to send to an output logical device, to + * display or print to the Cashier or the Customer. Possible values: * **CustomerAssistance** + * * **Display** * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * + * **Sound** * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Qualification of the information to send to an output logical device, to display or print to + * the Cashier or the Customer. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to send to an output logical device, to + * display or print to the Cashier or the Customer. Possible values: * **CustomerAssistance** + * * **Display** * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * + * **Sound** * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + } + + /** + * Type of requested input. Can be: **GetConfirmation**, **TextString**, **DigitString**, + * **DecimalString** or **GetMenuEntry**. Possible values: * **DecimalString** * **DigitString** * + * **GetAnyKey** * **GetConfirmation** * **GetFunctionKey** * **GetMenuEntry** * **Password** * + * **SiteManager** * **TextString** + * + * @param inputCommand Type of requested input. Can be: **GetConfirmation**, **TextString**, + * **DigitString**, **DecimalString** or **GetMenuEntry**. Possible values: * + * **DecimalString** * **DigitString** * **GetAnyKey** * **GetConfirmation** * + * **GetFunctionKey** * **GetMenuEntry** * **Password** * **SiteManager** * **TextString** + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData inputCommand(InputCommandType inputCommand) { + this.inputCommand = inputCommand; + isSetInputCommand = true; // mark as set + return this; + } + + /** + * Type of requested input. Can be: **GetConfirmation**, **TextString**, **DigitString**, + * **DecimalString** or **GetMenuEntry**. Possible values: * **DecimalString** * **DigitString** * + * **GetAnyKey** * **GetConfirmation** * **GetFunctionKey** * **GetMenuEntry** * **Password** * + * **SiteManager** * **TextString** + * + * @return inputCommand Type of requested input. Can be: **GetConfirmation**, **TextString**, + * **DigitString**, **DecimalString** or **GetMenuEntry**. Possible values: * + * **DecimalString** * **DigitString** * **GetAnyKey** * **GetConfirmation** * + * **GetFunctionKey** * **GetMenuEntry** * **Password** * **SiteManager** * **TextString** + */ + @JsonProperty(JSON_PROPERTY_INPUT_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputCommandType getInputCommand() { + return inputCommand; + } + + /** + * Type of requested input. Can be: **GetConfirmation**, **TextString**, **DigitString**, + * **DecimalString** or **GetMenuEntry**. Possible values: * **DecimalString** * **DigitString** * + * **GetAnyKey** * **GetConfirmation** * **GetFunctionKey** * **GetMenuEntry** * **Password** * + * **SiteManager** * **TextString** + * + * @param inputCommand Type of requested input. Can be: **GetConfirmation**, **TextString**, + * **DigitString**, **DecimalString** or **GetMenuEntry**. Possible values: * + * **DecimalString** * **DigitString** * **GetAnyKey** * **GetConfirmation** * + * **GetFunctionKey** * **GetMenuEntry** * **Password** * **SiteManager** * **TextString** + */ + @JsonProperty(JSON_PROPERTY_INPUT_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputCommand(InputCommandType inputCommand) { + this.inputCommand = inputCommand; + isSetInputCommand = true; // mark as set + } + + /** + * Request Notification of the card entered in the POI card reader. + * + * @param notifyCardInputFlag Request Notification of the card entered in the POI card reader. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData notifyCardInputFlag(Boolean notifyCardInputFlag) { + this.notifyCardInputFlag = notifyCardInputFlag; + isSetNotifyCardInputFlag = true; // mark as set + return this; + } + + /** + * Request Notification of the card entered in the POI card reader. + * + * @return notifyCardInputFlag Request Notification of the card entered in the POI card reader. + */ + @JsonProperty(JSON_PROPERTY_NOTIFY_CARD_INPUT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyCardInputFlag() { + return notifyCardInputFlag; + } + + /** + * Request Notification of the card entered in the POI card reader. + * + * @param notifyCardInputFlag Request Notification of the card entered in the POI card reader. + */ + @JsonProperty(JSON_PROPERTY_NOTIFY_CARD_INPUT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifyCardInputFlag(Boolean notifyCardInputFlag) { + this.notifyCardInputFlag = notifyCardInputFlag; + isSetNotifyCardInputFlag = true; // mark as set + } + + /** + * Maximum input time in seconds. Limits the time to answer to an Input request message. + * + * @param maxInputTime Maximum input time in seconds. Limits the time to answer to an Input + * request message. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData maxInputTime(Integer maxInputTime) { + this.maxInputTime = maxInputTime; + isSetMaxInputTime = true; // mark as set + return this; + } + + /** + * Maximum input time in seconds. Limits the time to answer to an Input request message. + * + * @return maxInputTime Maximum input time in seconds. Limits the time to answer to an Input + * request message. + */ + @JsonProperty(JSON_PROPERTY_MAX_INPUT_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxInputTime() { + return maxInputTime; + } + + /** + * Maximum input time in seconds. Limits the time to answer to an Input request message. + * + * @param maxInputTime Maximum input time in seconds. Limits the time to answer to an Input + * request message. + */ + @JsonProperty(JSON_PROPERTY_MAX_INPUT_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxInputTime(Integer maxInputTime) { + this.maxInputTime = maxInputTime; + isSetMaxInputTime = true; // mark as set + } + + /** + * Indicates whether to request an Immediate response to the message without waiting for the + * completion of the command. + * + * @param immediateResponseFlag Indicates whether to request an Immediate response to the message + * without waiting for the completion of the command. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData immediateResponseFlag(Boolean immediateResponseFlag) { + this.immediateResponseFlag = immediateResponseFlag; + isSetImmediateResponseFlag = true; // mark as set + return this; + } + + /** + * Indicates whether to request an Immediate response to the message without waiting for the + * completion of the command. + * + * @return immediateResponseFlag Indicates whether to request an Immediate response to the message + * without waiting for the completion of the command. + */ + @JsonProperty(JSON_PROPERTY_IMMEDIATE_RESPONSE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getImmediateResponseFlag() { + return immediateResponseFlag; + } + + /** + * Indicates whether to request an Immediate response to the message without waiting for the + * completion of the command. + * + * @param immediateResponseFlag Indicates whether to request an Immediate response to the message + * without waiting for the completion of the command. + */ + @JsonProperty(JSON_PROPERTY_IMMEDIATE_RESPONSE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImmediateResponseFlag(Boolean immediateResponseFlag) { + this.immediateResponseFlag = immediateResponseFlag; + isSetImmediateResponseFlag = true; // mark as set + } + + /** + * Minimum length of an entered string, or minimum number of entries that can be selected in a + * menu. + * + * @param minLength Minimum length of an entered string, or minimum number of entries that can be + * selected in a menu. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData minLength(Integer minLength) { + this.minLength = minLength; + isSetMinLength = true; // mark as set + return this; + } + + /** + * Minimum length of an entered string, or minimum number of entries that can be selected in a + * menu. + * + * @return minLength Minimum length of an entered string, or minimum number of entries that can be + * selected in a menu. + */ + @JsonProperty(JSON_PROPERTY_MIN_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinLength() { + return minLength; + } + + /** + * Minimum length of an entered string, or minimum number of entries that can be selected in a + * menu. + * + * @param minLength Minimum length of an entered string, or minimum number of entries that can be + * selected in a menu. + */ + @JsonProperty(JSON_PROPERTY_MIN_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinLength(Integer minLength) { + this.minLength = minLength; + isSetMinLength = true; // mark as set + } + + /** + * Maximum length of an entered string, or maximum number of entries that can be selected in a + * menu. + * + * @param maxLength Maximum length of an entered string, or maximum number of entries that can be + * selected in a menu. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData maxLength(Integer maxLength) { + this.maxLength = maxLength; + isSetMaxLength = true; // mark as set + return this; + } + + /** + * Maximum length of an entered string, or maximum number of entries that can be selected in a + * menu. + * + * @return maxLength Maximum length of an entered string, or maximum number of entries that can be + * selected in a menu. + */ + @JsonProperty(JSON_PROPERTY_MAX_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxLength() { + return maxLength; + } + + /** + * Maximum length of an entered string, or maximum number of entries that can be selected in a + * menu. + * + * @param maxLength Maximum length of an entered string, or maximum number of entries that can be + * selected in a menu. + */ + @JsonProperty(JSON_PROPERTY_MAX_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + isSetMaxLength = true; // mark as set + } + + /** + * Maximum input length of the decimal part (without decimal point). + * + * @param maxDecimalLength Maximum input length of the decimal part (without decimal point). + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData maxDecimalLength(Integer maxDecimalLength) { + this.maxDecimalLength = maxDecimalLength; + isSetMaxDecimalLength = true; // mark as set + return this; + } + + /** + * Maximum input length of the decimal part (without decimal point). + * + * @return maxDecimalLength Maximum input length of the decimal part (without decimal point). + */ + @JsonProperty(JSON_PROPERTY_MAX_DECIMAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxDecimalLength() { + return maxDecimalLength; + } + + /** + * Maximum input length of the decimal part (without decimal point). + * + * @param maxDecimalLength Maximum input length of the decimal part (without decimal point). + */ + @JsonProperty(JSON_PROPERTY_MAX_DECIMAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxDecimalLength(Integer maxDecimalLength) { + this.maxDecimalLength = maxDecimalLength; + isSetMaxDecimalLength = true; // mark as set + } + + /** + * Indicates that the user must confirm the entered characters, when the maximum allowed length is + * reached. During the processing of an Input command `TextString`, + * `DigitString` or `DecimalString` with `MaxLength` or + * `MaxDecimalLength` present in the request. + * + * @param waitUserValidationFlag Indicates that the user must confirm the entered characters, when + * the maximum allowed length is reached. During the processing of an Input command + * `TextString`, `DigitString` or `DecimalString` with + * `MaxLength` or `MaxDecimalLength` present in the request. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData waitUserValidationFlag(Boolean waitUserValidationFlag) { + this.waitUserValidationFlag = waitUserValidationFlag; + isSetWaitUserValidationFlag = true; // mark as set + return this; + } + + /** + * Indicates that the user must confirm the entered characters, when the maximum allowed length is + * reached. During the processing of an Input command `TextString`, + * `DigitString` or `DecimalString` with `MaxLength` or + * `MaxDecimalLength` present in the request. + * + * @return waitUserValidationFlag Indicates that the user must confirm the entered characters, + * when the maximum allowed length is reached. During the processing of an Input command + * `TextString`, `DigitString` or `DecimalString` with + * `MaxLength` or `MaxDecimalLength` present in the request. + */ + @JsonProperty(JSON_PROPERTY_WAIT_USER_VALIDATION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getWaitUserValidationFlag() { + return waitUserValidationFlag; + } + + /** + * Indicates that the user must confirm the entered characters, when the maximum allowed length is + * reached. During the processing of an Input command `TextString`, + * `DigitString` or `DecimalString` with `MaxLength` or + * `MaxDecimalLength` present in the request. + * + * @param waitUserValidationFlag Indicates that the user must confirm the entered characters, when + * the maximum allowed length is reached. During the processing of an Input command + * `TextString`, `DigitString` or `DecimalString` with + * `MaxLength` or `MaxDecimalLength` present in the request. + */ + @JsonProperty(JSON_PROPERTY_WAIT_USER_VALIDATION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWaitUserValidationFlag(Boolean waitUserValidationFlag) { + this.waitUserValidationFlag = waitUserValidationFlag; + isSetWaitUserValidationFlag = true; // mark as set + } + + /** + * Default string value for an input command. On the `TextString`, + * `DigitString` and `DecimalString` input commands: default string displayed + * on the input field before entering the string. In `GetConfirmation` input command: + * **Y** for yes, **N** for no. + * + * @param defaultInputString Default string value for an input command. On the + * `TextString`, `DigitString` and `DecimalString` input + * commands: default string displayed on the input field before entering the string. In + * `GetConfirmation` input command: **Y** for yes, **N** for no. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData defaultInputString(String defaultInputString) { + this.defaultInputString = defaultInputString; + isSetDefaultInputString = true; // mark as set + return this; + } + + /** + * Default string value for an input command. On the `TextString`, + * `DigitString` and `DecimalString` input commands: default string displayed + * on the input field before entering the string. In `GetConfirmation` input command: + * **Y** for yes, **N** for no. + * + * @return defaultInputString Default string value for an input command. On the + * `TextString`, `DigitString` and `DecimalString` input + * commands: default string displayed on the input field before entering the string. In + * `GetConfirmation` input command: **Y** for yes, **N** for no. + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_INPUT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultInputString() { + return defaultInputString; + } + + /** + * Default string value for an input command. On the `TextString`, + * `DigitString` and `DecimalString` input commands: default string displayed + * on the input field before entering the string. In `GetConfirmation` input command: + * **Y** for yes, **N** for no. + * + * @param defaultInputString Default string value for an input command. On the + * `TextString`, `DigitString` and `DecimalString` input + * commands: default string displayed on the input field before entering the string. In + * `GetConfirmation` input command: **Y** for yes, **N** for no. + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_INPUT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultInputString(String defaultInputString) { + this.defaultInputString = defaultInputString; + isSetDefaultInputString = true; // mark as set + } + + /** + * defaultLayoutString + * + * @param defaultLayoutString + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData defaultLayoutString(String defaultLayoutString) { + this.defaultLayoutString = defaultLayoutString; + isSetDefaultLayoutString = true; // mark as set + return this; + } + + /** + * Get defaultLayoutString + * + * @return defaultLayoutString + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_LAYOUT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultLayoutString() { + return defaultLayoutString; + } + + /** + * defaultLayoutString + * + * @param defaultLayoutString + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_LAYOUT_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultLayoutString(String defaultLayoutString) { + this.defaultLayoutString = defaultLayoutString; + isSetDefaultLayoutString = true; // mark as set + } + + /** + * String mask to get information requiring a specific format. For the processing of an Input + * command `TextString`, `DigitString` or `DecimalString`. Some + * information as date or plate number required to be entered with a certain format. + * + * @param stringMask String mask to get information requiring a specific format. For the + * processing of an Input command `TextString`, `DigitString` or + * `DecimalString`. Some information as date or plate number required to be entered + * with a certain format. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData stringMask(String stringMask) { + this.stringMask = stringMask; + isSetStringMask = true; // mark as set + return this; + } + + /** + * String mask to get information requiring a specific format. For the processing of an Input + * command `TextString`, `DigitString` or `DecimalString`. Some + * information as date or plate number required to be entered with a certain format. + * + * @return stringMask String mask to get information requiring a specific format. For the + * processing of an Input command `TextString`, `DigitString` or + * `DecimalString`. Some information as date or plate number required to be entered + * with a certain format. + */ + @JsonProperty(JSON_PROPERTY_STRING_MASK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStringMask() { + return stringMask; + } + + /** + * String mask to get information requiring a specific format. For the processing of an Input + * command `TextString`, `DigitString` or `DecimalString`. Some + * information as date or plate number required to be entered with a certain format. + * + * @param stringMask String mask to get information requiring a specific format. For the + * processing of an Input command `TextString`, `DigitString` or + * `DecimalString`. Some information as date or plate number required to be entered + * with a certain format. + */ + @JsonProperty(JSON_PROPERTY_STRING_MASK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStringMask(String stringMask) { + this.stringMask = stringMask; + isSetStringMask = true; // mark as set + } + + /** + * Indicates if the entered character has to be displayed from the right to the left of the + * display field. + * + * @param fromRightToLeftFlag Indicates if the entered character has to be displayed from the + * right to the left of the display field. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData fromRightToLeftFlag(Boolean fromRightToLeftFlag) { + this.fromRightToLeftFlag = fromRightToLeftFlag; + isSetFromRightToLeftFlag = true; // mark as set + return this; + } + + /** + * Indicates if the entered character has to be displayed from the right to the left of the + * display field. + * + * @return fromRightToLeftFlag Indicates if the entered character has to be displayed from the + * right to the left of the display field. + */ + @JsonProperty(JSON_PROPERTY_FROM_RIGHT_TO_LEFT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFromRightToLeftFlag() { + return fromRightToLeftFlag; + } + + /** + * Indicates if the entered character has to be displayed from the right to the left of the + * display field. + * + * @param fromRightToLeftFlag Indicates if the entered character has to be displayed from the + * right to the left of the display field. + */ + @JsonProperty(JSON_PROPERTY_FROM_RIGHT_TO_LEFT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFromRightToLeftFlag(Boolean fromRightToLeftFlag) { + this.fromRightToLeftFlag = fromRightToLeftFlag; + isSetFromRightToLeftFlag = true; // mark as set + } + + /** + * Indicates to mask the characters entered by the user (i.e. replacing in the display of the + * input, the entered character by a standard character as *). + * + * @param maskCharactersFlag Indicates to mask the characters entered by the user (i.e. replacing + * in the display of the input, the entered character by a standard character as *). + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData maskCharactersFlag(Boolean maskCharactersFlag) { + this.maskCharactersFlag = maskCharactersFlag; + isSetMaskCharactersFlag = true; // mark as set + return this; + } + + /** + * Indicates to mask the characters entered by the user (i.e. replacing in the display of the + * input, the entered character by a standard character as *). + * + * @return maskCharactersFlag Indicates to mask the characters entered by the user (i.e. replacing + * in the display of the input, the entered character by a standard character as *). + */ + @JsonProperty(JSON_PROPERTY_MASK_CHARACTERS_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMaskCharactersFlag() { + return maskCharactersFlag; + } + + /** + * Indicates to mask the characters entered by the user (i.e. replacing in the display of the + * input, the entered character by a standard character as *). + * + * @param maskCharactersFlag Indicates to mask the characters entered by the user (i.e. replacing + * in the display of the input, the entered character by a standard character as *). + */ + @JsonProperty(JSON_PROPERTY_MASK_CHARACTERS_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaskCharactersFlag(Boolean maskCharactersFlag) { + this.maskCharactersFlag = maskCharactersFlag; + isSetMaskCharactersFlag = true; // mark as set + } + + /** + * Indicates, when the user press a key, if a beep has to be generated (value True). + * + * @param beepKeyFlag Indicates, when the user press a key, if a beep has to be generated (value + * True). + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData beepKeyFlag(Boolean beepKeyFlag) { + this.beepKeyFlag = beepKeyFlag; + isSetBeepKeyFlag = true; // mark as set + return this; + } + + /** + * Indicates, when the user press a key, if a beep has to be generated (value True). + * + * @return beepKeyFlag Indicates, when the user press a key, if a beep has to be generated (value + * True). + */ + @JsonProperty(JSON_PROPERTY_BEEP_KEY_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBeepKeyFlag() { + return beepKeyFlag; + } + + /** + * Indicates, when the user press a key, if a beep has to be generated (value True). + * + * @param beepKeyFlag Indicates, when the user press a key, if a beep has to be generated (value + * True). + */ + @JsonProperty(JSON_PROPERTY_BEEP_KEY_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBeepKeyFlag(Boolean beepKeyFlag) { + this.beepKeyFlag = beepKeyFlag; + isSetBeepKeyFlag = true; // mark as set + } + + /** + * Indicates, when the user presses the Correct function key in an input entry, if all the entered + * characters are removed (value True) or only the last entered character if any (value False). + * + * @param globalCorrectionFlag Indicates, when the user presses the Correct function key in an + * input entry, if all the entered characters are removed (value True) or only the last + * entered character if any (value False). + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData globalCorrectionFlag(Boolean globalCorrectionFlag) { + this.globalCorrectionFlag = globalCorrectionFlag; + isSetGlobalCorrectionFlag = true; // mark as set + return this; + } + + /** + * Indicates, when the user presses the Correct function key in an input entry, if all the entered + * characters are removed (value True) or only the last entered character if any (value False). + * + * @return globalCorrectionFlag Indicates, when the user presses the Correct function key in an + * input entry, if all the entered characters are removed (value True) or only the last + * entered character if any (value False). + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_CORRECTION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getGlobalCorrectionFlag() { + return globalCorrectionFlag; + } + + /** + * Indicates, when the user presses the Correct function key in an input entry, if all the entered + * characters are removed (value True) or only the last entered character if any (value False). + * + * @param globalCorrectionFlag Indicates, when the user presses the Correct function key in an + * input entry, if all the entered characters are removed (value True) or only the last + * entered character if any (value False). + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_CORRECTION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGlobalCorrectionFlag(Boolean globalCorrectionFlag) { + this.globalCorrectionFlag = globalCorrectionFlag; + isSetGlobalCorrectionFlag = true; // mark as set + } + + /** + * Indicates if the Cancel function key has to be deactivated (value True). + * + * @param disableCancelFlag Indicates if the Cancel function key has to be deactivated (value + * True). + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData disableCancelFlag(Boolean disableCancelFlag) { + this.disableCancelFlag = disableCancelFlag; + isSetDisableCancelFlag = true; // mark as set + return this; + } + + /** + * Indicates if the Cancel function key has to be deactivated (value True). + * + * @return disableCancelFlag Indicates if the Cancel function key has to be deactivated (value + * True). + */ + @JsonProperty(JSON_PROPERTY_DISABLE_CANCEL_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableCancelFlag() { + return disableCancelFlag; + } + + /** + * Indicates if the Cancel function key has to be deactivated (value True). + * + * @param disableCancelFlag Indicates if the Cancel function key has to be deactivated (value + * True). + */ + @JsonProperty(JSON_PROPERTY_DISABLE_CANCEL_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableCancelFlag(Boolean disableCancelFlag) { + this.disableCancelFlag = disableCancelFlag; + isSetDisableCancelFlag = true; // mark as set + } + + /** + * Indicates if the Correct function key has to be deactivated (value True). During the processing + * of an Input command `GetConfirmation`, `SiteManager`, or + * `GetMenuEntry`. + * + * @param disableCorrectFlag Indicates if the Correct function key has to be deactivated (value + * True). During the processing of an Input command `GetConfirmation`, + * `SiteManager`, or `GetMenuEntry`. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData disableCorrectFlag(Boolean disableCorrectFlag) { + this.disableCorrectFlag = disableCorrectFlag; + isSetDisableCorrectFlag = true; // mark as set + return this; + } + + /** + * Indicates if the Correct function key has to be deactivated (value True). During the processing + * of an Input command `GetConfirmation`, `SiteManager`, or + * `GetMenuEntry`. + * + * @return disableCorrectFlag Indicates if the Correct function key has to be deactivated (value + * True). During the processing of an Input command `GetConfirmation`, + * `SiteManager`, or `GetMenuEntry`. + */ + @JsonProperty(JSON_PROPERTY_DISABLE_CORRECT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableCorrectFlag() { + return disableCorrectFlag; + } + + /** + * Indicates if the Correct function key has to be deactivated (value True). During the processing + * of an Input command `GetConfirmation`, `SiteManager`, or + * `GetMenuEntry`. + * + * @param disableCorrectFlag Indicates if the Correct function key has to be deactivated (value + * True). During the processing of an Input command `GetConfirmation`, + * `SiteManager`, or `GetMenuEntry`. + */ + @JsonProperty(JSON_PROPERTY_DISABLE_CORRECT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableCorrectFlag(Boolean disableCorrectFlag) { + this.disableCorrectFlag = disableCorrectFlag; + isSetDisableCorrectFlag = true; // mark as set + } + + /** + * Indicates if the Valid function key has to be deactivated (value True). During the processing + * of an Input command `GetConfirmation`, `SiteManager`, or + * `GetMenuEntry`. + * + * @param disableValidFlag Indicates if the Valid function key has to be deactivated (value True). + * During the processing of an Input command `GetConfirmation`, + * `SiteManager`, or `GetMenuEntry`. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData disableValidFlag(Boolean disableValidFlag) { + this.disableValidFlag = disableValidFlag; + isSetDisableValidFlag = true; // mark as set + return this; + } + + /** + * Indicates if the Valid function key has to be deactivated (value True). During the processing + * of an Input command `GetConfirmation`, `SiteManager`, or + * `GetMenuEntry`. + * + * @return disableValidFlag Indicates if the Valid function key has to be deactivated (value + * True). During the processing of an Input command `GetConfirmation`, + * `SiteManager`, or `GetMenuEntry`. + */ + @JsonProperty(JSON_PROPERTY_DISABLE_VALID_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisableValidFlag() { + return disableValidFlag; + } + + /** + * Indicates if the Valid function key has to be deactivated (value True). During the processing + * of an Input command `GetConfirmation`, `SiteManager`, or + * `GetMenuEntry`. + * + * @param disableValidFlag Indicates if the Valid function key has to be deactivated (value True). + * During the processing of an Input command `GetConfirmation`, + * `SiteManager`, or `GetMenuEntry`. + */ + @JsonProperty(JSON_PROPERTY_DISABLE_VALID_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableValidFlag(Boolean disableValidFlag) { + this.disableValidFlag = disableValidFlag; + isSetDisableValidFlag = true; // mark as set + } + + /** + * If it has the value True, it indicates that the Back function key (respectively Home function + * key) may be used to go back to the immediate upper level of the menu. If it has the value + * False, it indicates that the current menu level has no parent menu. + * + * @param menuBackFlag If it has the value True, it indicates that the Back function key + * (respectively Home function key) may be used to go back to the immediate upper level of the + * menu. If it has the value False, it indicates that the current menu level has no parent + * menu. + * @return the current {@code InputData} instance, allowing for method chaining + */ + public InputData menuBackFlag(Boolean menuBackFlag) { + this.menuBackFlag = menuBackFlag; + isSetMenuBackFlag = true; // mark as set + return this; + } + + /** + * If it has the value True, it indicates that the Back function key (respectively Home function + * key) may be used to go back to the immediate upper level of the menu. If it has the value + * False, it indicates that the current menu level has no parent menu. + * + * @return menuBackFlag If it has the value True, it indicates that the Back function key + * (respectively Home function key) may be used to go back to the immediate upper level of the + * menu. If it has the value False, it indicates that the current menu level has no parent + * menu. + */ + @JsonProperty(JSON_PROPERTY_MENU_BACK_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMenuBackFlag() { + return menuBackFlag; + } + + /** + * If it has the value True, it indicates that the Back function key (respectively Home function + * key) may be used to go back to the immediate upper level of the menu. If it has the value + * False, it indicates that the current menu level has no parent menu. + * + * @param menuBackFlag If it has the value True, it indicates that the Back function key + * (respectively Home function key) may be used to go back to the immediate upper level of the + * menu. If it has the value False, it indicates that the current menu level has no parent + * menu. + */ + @JsonProperty(JSON_PROPERTY_MENU_BACK_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuBackFlag(Boolean menuBackFlag) { + this.menuBackFlag = menuBackFlag; + isSetMenuBackFlag = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InputData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputData inputData = (InputData) o; + return Objects.equals(this.device, inputData.device) + && Objects.equals(this.isSetDevice, inputData.isSetDevice) + && Objects.equals(this.infoQualify, inputData.infoQualify) + && Objects.equals(this.isSetInfoQualify, inputData.isSetInfoQualify) + && Objects.equals(this.inputCommand, inputData.inputCommand) + && Objects.equals(this.isSetInputCommand, inputData.isSetInputCommand) + && Objects.equals(this.notifyCardInputFlag, inputData.notifyCardInputFlag) + && Objects.equals(this.isSetNotifyCardInputFlag, inputData.isSetNotifyCardInputFlag) + && Objects.equals(this.maxInputTime, inputData.maxInputTime) + && Objects.equals(this.isSetMaxInputTime, inputData.isSetMaxInputTime) + && Objects.equals(this.immediateResponseFlag, inputData.immediateResponseFlag) + && Objects.equals(this.isSetImmediateResponseFlag, inputData.isSetImmediateResponseFlag) + && Objects.equals(this.minLength, inputData.minLength) + && Objects.equals(this.isSetMinLength, inputData.isSetMinLength) + && Objects.equals(this.maxLength, inputData.maxLength) + && Objects.equals(this.isSetMaxLength, inputData.isSetMaxLength) + && Objects.equals(this.maxDecimalLength, inputData.maxDecimalLength) + && Objects.equals(this.isSetMaxDecimalLength, inputData.isSetMaxDecimalLength) + && Objects.equals(this.waitUserValidationFlag, inputData.waitUserValidationFlag) + && Objects.equals(this.isSetWaitUserValidationFlag, inputData.isSetWaitUserValidationFlag) + && Objects.equals(this.defaultInputString, inputData.defaultInputString) + && Objects.equals(this.isSetDefaultInputString, inputData.isSetDefaultInputString) + && Objects.equals(this.defaultLayoutString, inputData.defaultLayoutString) + && Objects.equals(this.isSetDefaultLayoutString, inputData.isSetDefaultLayoutString) + && Objects.equals(this.stringMask, inputData.stringMask) + && Objects.equals(this.isSetStringMask, inputData.isSetStringMask) + && Objects.equals(this.fromRightToLeftFlag, inputData.fromRightToLeftFlag) + && Objects.equals(this.isSetFromRightToLeftFlag, inputData.isSetFromRightToLeftFlag) + && Objects.equals(this.maskCharactersFlag, inputData.maskCharactersFlag) + && Objects.equals(this.isSetMaskCharactersFlag, inputData.isSetMaskCharactersFlag) + && Objects.equals(this.beepKeyFlag, inputData.beepKeyFlag) + && Objects.equals(this.isSetBeepKeyFlag, inputData.isSetBeepKeyFlag) + && Objects.equals(this.globalCorrectionFlag, inputData.globalCorrectionFlag) + && Objects.equals(this.isSetGlobalCorrectionFlag, inputData.isSetGlobalCorrectionFlag) + && Objects.equals(this.disableCancelFlag, inputData.disableCancelFlag) + && Objects.equals(this.isSetDisableCancelFlag, inputData.isSetDisableCancelFlag) + && Objects.equals(this.disableCorrectFlag, inputData.disableCorrectFlag) + && Objects.equals(this.isSetDisableCorrectFlag, inputData.isSetDisableCorrectFlag) + && Objects.equals(this.disableValidFlag, inputData.disableValidFlag) + && Objects.equals(this.isSetDisableValidFlag, inputData.isSetDisableValidFlag) + && Objects.equals(this.menuBackFlag, inputData.menuBackFlag) + && Objects.equals(this.isSetMenuBackFlag, inputData.isSetMenuBackFlag); + } + + @Override + public int hashCode() { + return Objects.hash( + device, + isSetDevice, + infoQualify, + isSetInfoQualify, + inputCommand, + isSetInputCommand, + notifyCardInputFlag, + isSetNotifyCardInputFlag, + maxInputTime, + isSetMaxInputTime, + immediateResponseFlag, + isSetImmediateResponseFlag, + minLength, + isSetMinLength, + maxLength, + isSetMaxLength, + maxDecimalLength, + isSetMaxDecimalLength, + waitUserValidationFlag, + isSetWaitUserValidationFlag, + defaultInputString, + isSetDefaultInputString, + defaultLayoutString, + isSetDefaultLayoutString, + stringMask, + isSetStringMask, + fromRightToLeftFlag, + isSetFromRightToLeftFlag, + maskCharactersFlag, + isSetMaskCharactersFlag, + beepKeyFlag, + isSetBeepKeyFlag, + globalCorrectionFlag, + isSetGlobalCorrectionFlag, + disableCancelFlag, + isSetDisableCancelFlag, + disableCorrectFlag, + isSetDisableCorrectFlag, + disableValidFlag, + isSetDisableValidFlag, + menuBackFlag, + isSetMenuBackFlag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputData {\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" infoQualify: ").append(toIndentedString(infoQualify)).append("\n"); + sb.append(" inputCommand: ").append(toIndentedString(inputCommand)).append("\n"); + sb.append(" notifyCardInputFlag: ") + .append(toIndentedString(notifyCardInputFlag)) + .append("\n"); + sb.append(" maxInputTime: ").append(toIndentedString(maxInputTime)).append("\n"); + sb.append(" immediateResponseFlag: ") + .append(toIndentedString(immediateResponseFlag)) + .append("\n"); + sb.append(" minLength: ").append(toIndentedString(minLength)).append("\n"); + sb.append(" maxLength: ").append(toIndentedString(maxLength)).append("\n"); + sb.append(" maxDecimalLength: ").append(toIndentedString(maxDecimalLength)).append("\n"); + sb.append(" waitUserValidationFlag: ") + .append(toIndentedString(waitUserValidationFlag)) + .append("\n"); + sb.append(" defaultInputString: ").append(toIndentedString(defaultInputString)).append("\n"); + sb.append(" defaultLayoutString: ") + .append(toIndentedString(defaultLayoutString)) + .append("\n"); + sb.append(" stringMask: ").append(toIndentedString(stringMask)).append("\n"); + sb.append(" fromRightToLeftFlag: ") + .append(toIndentedString(fromRightToLeftFlag)) + .append("\n"); + sb.append(" maskCharactersFlag: ").append(toIndentedString(maskCharactersFlag)).append("\n"); + sb.append(" beepKeyFlag: ").append(toIndentedString(beepKeyFlag)).append("\n"); + sb.append(" globalCorrectionFlag: ") + .append(toIndentedString(globalCorrectionFlag)) + .append("\n"); + sb.append(" disableCancelFlag: ").append(toIndentedString(disableCancelFlag)).append("\n"); + sb.append(" disableCorrectFlag: ").append(toIndentedString(disableCorrectFlag)).append("\n"); + sb.append(" disableValidFlag: ").append(toIndentedString(disableValidFlag)).append("\n"); + sb.append(" menuBackFlag: ").append(toIndentedString(menuBackFlag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetInfoQualify) { + addIfNull(nulls, JSON_PROPERTY_INFO_QUALIFY, this.infoQualify); + } + if (isSetInputCommand) { + addIfNull(nulls, JSON_PROPERTY_INPUT_COMMAND, this.inputCommand); + } + if (isSetNotifyCardInputFlag) { + addIfNull(nulls, JSON_PROPERTY_NOTIFY_CARD_INPUT_FLAG, this.notifyCardInputFlag); + } + if (isSetMaxInputTime) { + addIfNull(nulls, JSON_PROPERTY_MAX_INPUT_TIME, this.maxInputTime); + } + if (isSetImmediateResponseFlag) { + addIfNull(nulls, JSON_PROPERTY_IMMEDIATE_RESPONSE_FLAG, this.immediateResponseFlag); + } + if (isSetMinLength) { + addIfNull(nulls, JSON_PROPERTY_MIN_LENGTH, this.minLength); + } + if (isSetMaxLength) { + addIfNull(nulls, JSON_PROPERTY_MAX_LENGTH, this.maxLength); + } + if (isSetMaxDecimalLength) { + addIfNull(nulls, JSON_PROPERTY_MAX_DECIMAL_LENGTH, this.maxDecimalLength); + } + if (isSetWaitUserValidationFlag) { + addIfNull(nulls, JSON_PROPERTY_WAIT_USER_VALIDATION_FLAG, this.waitUserValidationFlag); + } + if (isSetDefaultInputString) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_INPUT_STRING, this.defaultInputString); + } + if (isSetDefaultLayoutString) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_LAYOUT_STRING, this.defaultLayoutString); + } + if (isSetStringMask) { + addIfNull(nulls, JSON_PROPERTY_STRING_MASK, this.stringMask); + } + if (isSetFromRightToLeftFlag) { + addIfNull(nulls, JSON_PROPERTY_FROM_RIGHT_TO_LEFT_FLAG, this.fromRightToLeftFlag); + } + if (isSetMaskCharactersFlag) { + addIfNull(nulls, JSON_PROPERTY_MASK_CHARACTERS_FLAG, this.maskCharactersFlag); + } + if (isSetBeepKeyFlag) { + addIfNull(nulls, JSON_PROPERTY_BEEP_KEY_FLAG, this.beepKeyFlag); + } + if (isSetGlobalCorrectionFlag) { + addIfNull(nulls, JSON_PROPERTY_GLOBAL_CORRECTION_FLAG, this.globalCorrectionFlag); + } + if (isSetDisableCancelFlag) { + addIfNull(nulls, JSON_PROPERTY_DISABLE_CANCEL_FLAG, this.disableCancelFlag); + } + if (isSetDisableCorrectFlag) { + addIfNull(nulls, JSON_PROPERTY_DISABLE_CORRECT_FLAG, this.disableCorrectFlag); + } + if (isSetDisableValidFlag) { + addIfNull(nulls, JSON_PROPERTY_DISABLE_VALID_FLAG, this.disableValidFlag); + } + if (isSetMenuBackFlag) { + addIfNull(nulls, JSON_PROPERTY_MENU_BACK_FLAG, this.menuBackFlag); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InputData given an JSON string + * + * @param jsonString JSON string + * @return An instance of InputData + * @throws JsonProcessingException if the JSON string is invalid with respect to InputData + */ + public static InputData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InputData.class); + } + + /** + * Convert an instance of InputData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InputRequest.java b/src/main/java/com/adyen/model/tapi/InputRequest.java new file mode 100644 index 000000000..f2ccb93c7 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InputRequest.java @@ -0,0 +1,247 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Content of the `InputRequest` message. It conveys the data to display and how to + * process it. In addition to the display on the Input Device, it might contain an operation (the + * `DisplayOutput` element) per Display Device type. + */ +@JsonPropertyOrder({ + InputRequest.JSON_PROPERTY_DISPLAY_OUTPUT, + InputRequest.JSON_PROPERTY_INPUT_DATA +}) +public class InputRequest { + public static final String JSON_PROPERTY_DISPLAY_OUTPUT = "DisplayOutput"; + private DisplayOutput displayOutput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayOutput = false; + + public static final String JSON_PROPERTY_INPUT_DATA = "InputData"; + private InputData inputData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InputRequest() {} + + /** + * Information to display and the way to process the display. + * + * @param displayOutput Information to display and the way to process the display. + * @return the current {@code InputRequest} instance, allowing for method chaining + */ + public InputRequest displayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + return this; + } + + /** + * Information to display and the way to process the display. + * + * @return displayOutput Information to display and the way to process the display. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Information to display and the way to process the display. + * + * @param displayOutput Information to display and the way to process the display. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + isSetDisplayOutput = true; // mark as set + } + + /** + * Information related to an Input request. It conveys the target input logical device, the type + * of input command, and possible minimum and maximum length of the input. In addition, if the + * requestor might require to receive an Event Notification if a card is inserted in a card + * reader, with the `NotifyCardInputFlag`. + * + * @param inputData Information related to an Input request. It conveys the target input logical + * device, the type of input command, and possible minimum and maximum length of the input. In + * addition, if the requestor might require to receive an Event Notification if a card is + * inserted in a card reader, with the `NotifyCardInputFlag`. + * @return the current {@code InputRequest} instance, allowing for method chaining + */ + public InputRequest inputData(InputData inputData) { + this.inputData = inputData; + isSetInputData = true; // mark as set + return this; + } + + /** + * Information related to an Input request. It conveys the target input logical device, the type + * of input command, and possible minimum and maximum length of the input. In addition, if the + * requestor might require to receive an Event Notification if a card is inserted in a card + * reader, with the `NotifyCardInputFlag`. + * + * @return inputData Information related to an Input request. It conveys the target input logical + * device, the type of input command, and possible minimum and maximum length of the input. In + * addition, if the requestor might require to receive an Event Notification if a card is + * inserted in a card reader, with the `NotifyCardInputFlag`. + */ + @JsonProperty(JSON_PROPERTY_INPUT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputData getInputData() { + return inputData; + } + + /** + * Information related to an Input request. It conveys the target input logical device, the type + * of input command, and possible minimum and maximum length of the input. In addition, if the + * requestor might require to receive an Event Notification if a card is inserted in a card + * reader, with the `NotifyCardInputFlag`. + * + * @param inputData Information related to an Input request. It conveys the target input logical + * device, the type of input command, and possible minimum and maximum length of the input. In + * addition, if the requestor might require to receive an Event Notification if a card is + * inserted in a card reader, with the `NotifyCardInputFlag`. + */ + @JsonProperty(JSON_PROPERTY_INPUT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputData(InputData inputData) { + this.inputData = inputData; + isSetInputData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InputRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputRequest inputRequest = (InputRequest) o; + return Objects.equals(this.displayOutput, inputRequest.displayOutput) + && Objects.equals(this.isSetDisplayOutput, inputRequest.isSetDisplayOutput) + && Objects.equals(this.inputData, inputRequest.inputData) + && Objects.equals(this.isSetInputData, inputRequest.isSetInputData); + } + + @Override + public int hashCode() { + return Objects.hash(displayOutput, isSetDisplayOutput, inputData, isSetInputData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputRequest {\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append(" inputData: ").append(toIndentedString(inputData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDisplayOutput) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_OUTPUT, this.displayOutput); + } + if (isSetInputData) { + addIfNull(nulls, JSON_PROPERTY_INPUT_DATA, this.inputData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InputRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InputRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to InputRequest + */ + public static InputRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InputRequest.class); + } + + /** + * Convert an instance of InputRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InputResponse.java b/src/main/java/com/adyen/model/tapi/InputResponse.java new file mode 100644 index 000000000..690585560 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InputResponse.java @@ -0,0 +1,234 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * It conveys the result of the input or the result of the outputs, parallel to the message request, + * except if response not required and absent. Content of the Input Response message. + */ +@JsonPropertyOrder({ + InputResponse.JSON_PROPERTY_OUTPUT_RESULT, + InputResponse.JSON_PROPERTY_INPUT_RESULT +}) +public class InputResponse { + public static final String JSON_PROPERTY_OUTPUT_RESULT = "OutputResult"; + private OutputResult outputResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputResult = false; + + public static final String JSON_PROPERTY_INPUT_RESULT = "InputResult"; + private InputResult inputResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InputResponse() {} + + /** + * Information related to the result the output (display, print, input). If DisplayOutput present + * in the request. + * + * @param outputResult Information related to the result the output (display, print, input). If + * DisplayOutput present in the request. + * @return the current {@code InputResponse} instance, allowing for method chaining + */ + public InputResponse outputResult(OutputResult outputResult) { + this.outputResult = outputResult; + isSetOutputResult = true; // mark as set + return this; + } + + /** + * Information related to the result the output (display, print, input). If DisplayOutput present + * in the request. + * + * @return outputResult Information related to the result the output (display, print, input). If + * DisplayOutput present in the request. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputResult getOutputResult() { + return outputResult; + } + + /** + * Information related to the result the output (display, print, input). If DisplayOutput present + * in the request. + * + * @param outputResult Information related to the result the output (display, print, input). If + * DisplayOutput present in the request. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputResult(OutputResult outputResult) { + this.outputResult = outputResult; + isSetOutputResult = true; // mark as set + } + + /** + * Contains the result and the content of the input. + * + * @param inputResult Contains the result and the content of the input. + * @return the current {@code InputResponse} instance, allowing for method chaining + */ + public InputResponse inputResult(InputResult inputResult) { + this.inputResult = inputResult; + isSetInputResult = true; // mark as set + return this; + } + + /** + * Contains the result and the content of the input. + * + * @return inputResult Contains the result and the content of the input. + */ + @JsonProperty(JSON_PROPERTY_INPUT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputResult getInputResult() { + return inputResult; + } + + /** + * Contains the result and the content of the input. + * + * @param inputResult Contains the result and the content of the input. + */ + @JsonProperty(JSON_PROPERTY_INPUT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputResult(InputResult inputResult) { + this.inputResult = inputResult; + isSetInputResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InputResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputResponse inputResponse = (InputResponse) o; + return Objects.equals(this.outputResult, inputResponse.outputResult) + && Objects.equals(this.isSetOutputResult, inputResponse.isSetOutputResult) + && Objects.equals(this.inputResult, inputResponse.inputResult) + && Objects.equals(this.isSetInputResult, inputResponse.isSetInputResult); + } + + @Override + public int hashCode() { + return Objects.hash(outputResult, isSetOutputResult, inputResult, isSetInputResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputResponse {\n"); + sb.append(" outputResult: ").append(toIndentedString(outputResult)).append("\n"); + sb.append(" inputResult: ").append(toIndentedString(inputResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOutputResult) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_RESULT, this.outputResult); + } + if (isSetInputResult) { + addIfNull(nulls, JSON_PROPERTY_INPUT_RESULT, this.inputResult); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InputResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of InputResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to InputResponse + */ + public static InputResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InputResponse.class); + } + + /** + * Convert an instance of InputResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InputResult.java b/src/main/java/com/adyen/model/tapi/InputResult.java new file mode 100644 index 000000000..1a9003cbb --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InputResult.java @@ -0,0 +1,365 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** InputResult */ +@JsonPropertyOrder({ + InputResult.JSON_PROPERTY_DEVICE, + InputResult.JSON_PROPERTY_INFO_QUALIFY, + InputResult.JSON_PROPERTY_RESPONSE, + InputResult.JSON_PROPERTY_INPUT +}) +public class InputResult { + public static final String JSON_PROPERTY_DEVICE = "Device"; + private DeviceType device; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + + public static final String JSON_PROPERTY_INFO_QUALIFY = "InfoQualify"; + private InfoQualifyType infoQualify; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInfoQualify = false; + + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_INPUT = "Input"; + private Input input; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InputResult() {} + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in terms of class of information + * to output (display, print or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, in terms of class of + * information to output (display, print or store), or input (keyboard) for the Cashier or the + * Customer. Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * @return the current {@code InputResult} instance, allowing for method chaining + */ + public InputResult device(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + return this; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in terms of class of information + * to output (display, print or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @return device Logical device located on a Sale Terminal or a POI Terminal, in terms of class + * of information to output (display, print or store), or input (keyboard) for the Cashier or + * the Customer. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceType getDevice() { + return device; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in terms of class of information + * to output (display, print or store), or input (keyboard) for the Cashier or the Customer. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, in terms of class of + * information to output (display, print or store), or input (keyboard) for the Cashier or the + * Customer. Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDevice(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + } + + /** + * Qualification of the information to send to an output logical device, to display or print to + * the Cashier or the Customer. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to send to an output logical device, to + * display or print to the Cashier or the Customer. Possible values: * **CustomerAssistance** + * * **Display** * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * + * **Sound** * **Status** * **Voucher** + * @return the current {@code InputResult} instance, allowing for method chaining + */ + public InputResult infoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + return this; + } + + /** + * Qualification of the information to send to an output logical device, to display or print to + * the Cashier or the Customer. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @return infoQualify Qualification of the information to send to an output logical device, to + * display or print to the Cashier or the Customer. Possible values: * **CustomerAssistance** + * * **Display** * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * + * **Sound** * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Qualification of the information to send to an output logical device, to display or print to + * the Cashier or the Customer. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to send to an output logical device, to + * display or print to the Cashier or the Customer. Possible values: * **CustomerAssistance** + * * **Display** * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * + * **Sound** * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + } + + /** + * response + * + * @param response + * @return the current {@code InputResult} instance, allowing for method chaining + */ + public InputResult response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Get response + * + * @return response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * response + * + * @param response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data entered by the user, related to the input command. + * + * @param input Data entered by the user, related to the input command. + * @return the current {@code InputResult} instance, allowing for method chaining + */ + public InputResult input(Input input) { + this.input = input; + isSetInput = true; // mark as set + return this; + } + + /** + * Data entered by the user, related to the input command. + * + * @return input Data entered by the user, related to the input command. + */ + @JsonProperty(JSON_PROPERTY_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Input getInput() { + return input; + } + + /** + * Data entered by the user, related to the input command. + * + * @param input Data entered by the user, related to the input command. + */ + @JsonProperty(JSON_PROPERTY_INPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInput(Input input) { + this.input = input; + isSetInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InputResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputResult inputResult = (InputResult) o; + return Objects.equals(this.device, inputResult.device) + && Objects.equals(this.isSetDevice, inputResult.isSetDevice) + && Objects.equals(this.infoQualify, inputResult.infoQualify) + && Objects.equals(this.isSetInfoQualify, inputResult.isSetInfoQualify) + && Objects.equals(this.response, inputResult.response) + && Objects.equals(this.isSetResponse, inputResult.isSetResponse) + && Objects.equals(this.input, inputResult.input) + && Objects.equals(this.isSetInput, inputResult.isSetInput); + } + + @Override + public int hashCode() { + return Objects.hash( + device, + isSetDevice, + infoQualify, + isSetInfoQualify, + response, + isSetResponse, + input, + isSetInput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputResult {\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" infoQualify: ").append(toIndentedString(infoQualify)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetInfoQualify) { + addIfNull(nulls, JSON_PROPERTY_INFO_QUALIFY, this.infoQualify); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetInput) { + addIfNull(nulls, JSON_PROPERTY_INPUT, this.input); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InputResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of InputResult + * @throws JsonProcessingException if the JSON string is invalid with respect to InputResult + */ + public static InputResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InputResult.class); + } + + /** + * Convert an instance of InputResult to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InputUpdate.java b/src/main/java/com/adyen/model/tapi/InputUpdate.java new file mode 100644 index 000000000..fa504b49b --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InputUpdate.java @@ -0,0 +1,493 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Definition: Content of the Input Update message. : It conveys update of the display of an Input + * request in progress. + */ +@JsonPropertyOrder({ + InputUpdate.JSON_PROPERTY_MESSAGE_REFERENCE, + InputUpdate.JSON_PROPERTY_OUTPUT_CONTENT, + InputUpdate.JSON_PROPERTY_MENU_ENTRY, + InputUpdate.JSON_PROPERTY_OUTPUT_SIGNATURE, + InputUpdate.JSON_PROPERTY_MIN_LENGTH, + InputUpdate.JSON_PROPERTY_MAX_LENGTH, + InputUpdate.JSON_PROPERTY_MAX_DECIMAL_LENGTH +}) +public class InputUpdate { + public static final String JSON_PROPERTY_MESSAGE_REFERENCE = "MessageReference"; + private MessageReference messageReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageReference = false; + + public static final String JSON_PROPERTY_OUTPUT_CONTENT = "OutputContent"; + private OutputContent outputContent; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputContent = false; + + public static final String JSON_PROPERTY_MENU_ENTRY = "MenuEntry"; + private List menuEntry; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMenuEntry = false; + + public static final String JSON_PROPERTY_OUTPUT_SIGNATURE = "OutputSignature"; + private byte[] outputSignature; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputSignature = false; + + public static final String JSON_PROPERTY_MIN_LENGTH = "MinLength"; + private Integer minLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinLength = false; + + public static final String JSON_PROPERTY_MAX_LENGTH = "MaxLength"; + private Integer maxLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxLength = false; + + public static final String JSON_PROPERTY_MAX_DECIMAL_LENGTH = "MaxDecimalLength"; + private Integer maxDecimalLength; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxDecimalLength = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InputUpdate() {} + + /** + * messageReference + * + * @param messageReference + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate messageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + return this; + } + + /** + * Get messageReference + * + * @return messageReference + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * messageReference + * + * @param messageReference + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + } + + /** + * outputContent + * + * @param outputContent + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate outputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + return this; + } + + /** + * Get outputContent + * + * @return outputContent + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * outputContent + * + * @param outputContent + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + } + + /** + * menuEntry + * + * @param menuEntry + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate menuEntry(List menuEntry) { + this.menuEntry = menuEntry; + isSetMenuEntry = true; // mark as set + return this; + } + + public InputUpdate addMenuEntryItem(MenuEntry menuEntryItem) { + if (this.menuEntry == null) { + this.menuEntry = new ArrayList<>(); + } + this.menuEntry.add(menuEntryItem); + return this; + } + + /** + * Get menuEntry + * + * @return menuEntry + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMenuEntry() { + return menuEntry; + } + + /** + * menuEntry + * + * @param menuEntry + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuEntry(List menuEntry) { + this.menuEntry = menuEntry; + isSetMenuEntry = true; // mark as set + } + + /** + * outputSignature + * + * @param outputSignature + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate outputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + isSetOutputSignature = true; // mark as set + return this; + } + + /** + * Get outputSignature + * + * @return outputSignature + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getOutputSignature() { + return outputSignature; + } + + /** + * outputSignature + * + * @param outputSignature + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + isSetOutputSignature = true; // mark as set + } + + /** + * minLength + * + * @param minLength + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate minLength(Integer minLength) { + this.minLength = minLength; + isSetMinLength = true; // mark as set + return this; + } + + /** + * Get minLength + * + * @return minLength + */ + @JsonProperty(JSON_PROPERTY_MIN_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMinLength() { + return minLength; + } + + /** + * minLength + * + * @param minLength + */ + @JsonProperty(JSON_PROPERTY_MIN_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinLength(Integer minLength) { + this.minLength = minLength; + isSetMinLength = true; // mark as set + } + + /** + * maxLength + * + * @param maxLength + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate maxLength(Integer maxLength) { + this.maxLength = maxLength; + isSetMaxLength = true; // mark as set + return this; + } + + /** + * Get maxLength + * + * @return maxLength + */ + @JsonProperty(JSON_PROPERTY_MAX_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxLength() { + return maxLength; + } + + /** + * maxLength + * + * @param maxLength + */ + @JsonProperty(JSON_PROPERTY_MAX_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + isSetMaxLength = true; // mark as set + } + + /** + * maxDecimalLength + * + * @param maxDecimalLength + * @return the current {@code InputUpdate} instance, allowing for method chaining + */ + public InputUpdate maxDecimalLength(Integer maxDecimalLength) { + this.maxDecimalLength = maxDecimalLength; + isSetMaxDecimalLength = true; // mark as set + return this; + } + + /** + * Get maxDecimalLength + * + * @return maxDecimalLength + */ + @JsonProperty(JSON_PROPERTY_MAX_DECIMAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaxDecimalLength() { + return maxDecimalLength; + } + + /** + * maxDecimalLength + * + * @param maxDecimalLength + */ + @JsonProperty(JSON_PROPERTY_MAX_DECIMAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxDecimalLength(Integer maxDecimalLength) { + this.maxDecimalLength = maxDecimalLength; + isSetMaxDecimalLength = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputUpdate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InputUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputUpdate inputUpdate = (InputUpdate) o; + return Objects.equals(this.messageReference, inputUpdate.messageReference) + && Objects.equals(this.isSetMessageReference, inputUpdate.isSetMessageReference) + && Objects.equals(this.outputContent, inputUpdate.outputContent) + && Objects.equals(this.isSetOutputContent, inputUpdate.isSetOutputContent) + && Objects.equals(this.menuEntry, inputUpdate.menuEntry) + && Objects.equals(this.isSetMenuEntry, inputUpdate.isSetMenuEntry) + && Arrays.equals(this.outputSignature, inputUpdate.outputSignature) + && Objects.equals(this.isSetOutputSignature, inputUpdate.isSetOutputSignature) + && Objects.equals(this.minLength, inputUpdate.minLength) + && Objects.equals(this.isSetMinLength, inputUpdate.isSetMinLength) + && Objects.equals(this.maxLength, inputUpdate.maxLength) + && Objects.equals(this.isSetMaxLength, inputUpdate.isSetMaxLength) + && Objects.equals(this.maxDecimalLength, inputUpdate.maxDecimalLength) + && Objects.equals(this.isSetMaxDecimalLength, inputUpdate.isSetMaxDecimalLength); + } + + @Override + public int hashCode() { + return Objects.hash( + messageReference, + isSetMessageReference, + outputContent, + isSetOutputContent, + menuEntry, + isSetMenuEntry, + Arrays.hashCode(outputSignature), + isSetOutputSignature, + minLength, + isSetMinLength, + maxLength, + isSetMaxLength, + maxDecimalLength, + isSetMaxDecimalLength); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputUpdate {\n"); + sb.append(" messageReference: ").append(toIndentedString(messageReference)).append("\n"); + sb.append(" outputContent: ").append(toIndentedString(outputContent)).append("\n"); + sb.append(" menuEntry: ").append(toIndentedString(menuEntry)).append("\n"); + sb.append(" outputSignature: ").append(toIndentedString(outputSignature)).append("\n"); + sb.append(" minLength: ").append(toIndentedString(minLength)).append("\n"); + sb.append(" maxLength: ").append(toIndentedString(maxLength)).append("\n"); + sb.append(" maxDecimalLength: ").append(toIndentedString(maxDecimalLength)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageReference) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_REFERENCE, this.messageReference); + } + if (isSetOutputContent) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_CONTENT, this.outputContent); + } + if (isSetMenuEntry) { + addIfNull(nulls, JSON_PROPERTY_MENU_ENTRY, this.menuEntry); + } + if (isSetOutputSignature) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_SIGNATURE, this.outputSignature); + } + if (isSetMinLength) { + addIfNull(nulls, JSON_PROPERTY_MIN_LENGTH, this.minLength); + } + if (isSetMaxLength) { + addIfNull(nulls, JSON_PROPERTY_MAX_LENGTH, this.maxLength); + } + if (isSetMaxDecimalLength) { + addIfNull(nulls, JSON_PROPERTY_MAX_DECIMAL_LENGTH, this.maxDecimalLength); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InputUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of InputUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to InputUpdate + */ + public static InputUpdate fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InputUpdate.class); + } + + /** + * Convert an instance of InputUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/Instalment.java b/src/main/java/com/adyen/model/tapi/Instalment.java new file mode 100644 index 000000000..ced4772c9 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/Instalment.java @@ -0,0 +1,664 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; + +/** Instalment */ +@JsonPropertyOrder({ + Instalment.JSON_PROPERTY_INSTALMENT_TYPE, + Instalment.JSON_PROPERTY_SEQUENCE_NUMBER, + Instalment.JSON_PROPERTY_PLAN_I_D, + Instalment.JSON_PROPERTY_PERIOD, + Instalment.JSON_PROPERTY_PERIOD_UNIT, + Instalment.JSON_PROPERTY_FIRST_PAYMENT_DATE, + Instalment.JSON_PROPERTY_TOTAL_NB_OF_PAYMENTS, + Instalment.JSON_PROPERTY_CUMULATIVE_AMOUNT, + Instalment.JSON_PROPERTY_FIRST_AMOUNT, + Instalment.JSON_PROPERTY_CHARGES +}) +public class Instalment { + public static final String JSON_PROPERTY_INSTALMENT_TYPE = "InstalmentType"; + private InstalmentType instalmentType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstalmentType = false; + + public static final String JSON_PROPERTY_SEQUENCE_NUMBER = "SequenceNumber"; + private Integer sequenceNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceNumber = false; + + public static final String JSON_PROPERTY_PLAN_I_D = "PlanID"; + private String planID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlanID = false; + + public static final String JSON_PROPERTY_PERIOD = "Period"; + private Integer period; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPeriod = false; + + public static final String JSON_PROPERTY_PERIOD_UNIT = "PeriodUnit"; + private PeriodUnit periodUnit; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPeriodUnit = false; + + public static final String JSON_PROPERTY_FIRST_PAYMENT_DATE = "FirstPaymentDate"; + private LocalDate firstPaymentDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstPaymentDate = false; + + public static final String JSON_PROPERTY_TOTAL_NB_OF_PAYMENTS = "TotalNbOfPayments"; + private Integer totalNbOfPayments; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalNbOfPayments = false; + + public static final String JSON_PROPERTY_CUMULATIVE_AMOUNT = "CumulativeAmount"; + private BigDecimal cumulativeAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCumulativeAmount = false; + + public static final String JSON_PROPERTY_FIRST_AMOUNT = "FirstAmount"; + private BigDecimal firstAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstAmount = false; + + public static final String JSON_PROPERTY_CHARGES = "Charges"; + private BigDecimal charges; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCharges = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Instalment() {} + + /** + * Type of instalment transaction. For requesting an instalment payment transaction. Possible + * values: * **DeferredInstalments** * **EqualInstalments** * **InequalInstalments** + * + * @param instalmentType Type of instalment transaction. For requesting an instalment payment + * transaction. Possible values: * **DeferredInstalments** * **EqualInstalments** * + * **InequalInstalments** + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment instalmentType(InstalmentType instalmentType) { + this.instalmentType = instalmentType; + isSetInstalmentType = true; // mark as set + return this; + } + + /** + * Type of instalment transaction. For requesting an instalment payment transaction. Possible + * values: * **DeferredInstalments** * **EqualInstalments** * **InequalInstalments** + * + * @return instalmentType Type of instalment transaction. For requesting an instalment payment + * transaction. Possible values: * **DeferredInstalments** * **EqualInstalments** * + * **InequalInstalments** + */ + @JsonProperty(JSON_PROPERTY_INSTALMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InstalmentType getInstalmentType() { + return instalmentType; + } + + /** + * Type of instalment transaction. For requesting an instalment payment transaction. Possible + * values: * **DeferredInstalments** * **EqualInstalments** * **InequalInstalments** + * + * @param instalmentType Type of instalment transaction. For requesting an instalment payment + * transaction. Possible values: * **DeferredInstalments** * **EqualInstalments** * + * **InequalInstalments** + */ + @JsonProperty(JSON_PROPERTY_INSTALMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstalmentType(InstalmentType instalmentType) { + this.instalmentType = instalmentType; + isSetInstalmentType = true; // mark as set + } + + /** + * Sequence number of the instalment. For an instalment payment transaction, number of the + * payment, from 1 to TotalNbOfPayments. + * + * @param sequenceNumber Sequence number of the instalment. For an instalment payment transaction, + * number of the payment, from 1 to TotalNbOfPayments. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment sequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set + return this; + } + + /** + * Sequence number of the instalment. For an instalment payment transaction, number of the + * payment, from 1 to TotalNbOfPayments. + * + * @return sequenceNumber Sequence number of the instalment. For an instalment payment + * transaction, number of the payment, from 1 to TotalNbOfPayments. + */ + @JsonProperty(JSON_PROPERTY_SEQUENCE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Sequence number of the instalment. For an instalment payment transaction, number of the + * payment, from 1 to TotalNbOfPayments. + * + * @param sequenceNumber Sequence number of the instalment. For an instalment payment transaction, + * number of the payment, from 1 to TotalNbOfPayments. + */ + @JsonProperty(JSON_PROPERTY_SEQUENCE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set + } + + /** + * Identification of an instalment plan. + * + * @param planID Identification of an instalment plan. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment planID(String planID) { + this.planID = planID; + isSetPlanID = true; // mark as set + return this; + } + + /** + * Identification of an instalment plan. + * + * @return planID Identification of an instalment plan. + */ + @JsonProperty(JSON_PROPERTY_PLAN_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlanID() { + return planID; + } + + /** + * Identification of an instalment plan. + * + * @param planID Identification of an instalment plan. + */ + @JsonProperty(JSON_PROPERTY_PLAN_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlanID(String planID) { + this.planID = planID; + isSetPlanID = true; // mark as set + } + + /** + * Period of time with defined unit of time. A period between 2 payment instalments. + * + * @param period Period of time with defined unit of time. A period between 2 payment instalments. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment period(Integer period) { + this.period = period; + isSetPeriod = true; // mark as set + return this; + } + + /** + * Period of time with defined unit of time. A period between 2 payment instalments. + * + * @return period Period of time with defined unit of time. A period between 2 payment + * instalments. + */ + @JsonProperty(JSON_PROPERTY_PERIOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPeriod() { + return period; + } + + /** + * Period of time with defined unit of time. A period between 2 payment instalments. + * + * @param period Period of time with defined unit of time. A period between 2 payment instalments. + */ + @JsonProperty(JSON_PROPERTY_PERIOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeriod(Integer period) { + this.period = period; + isSetPeriod = true; // mark as set + } + + /** + * Type of instalment transaction. Possible values: * **Annual** * **Daily** * **Monthly** * + * **Weekly** + * + * @param periodUnit Type of instalment transaction. Possible values: * **Annual** * **Daily** * + * **Monthly** * **Weekly** + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment periodUnit(PeriodUnit periodUnit) { + this.periodUnit = periodUnit; + isSetPeriodUnit = true; // mark as set + return this; + } + + /** + * Type of instalment transaction. Possible values: * **Annual** * **Daily** * **Monthly** * + * **Weekly** + * + * @return periodUnit Type of instalment transaction. Possible values: * **Annual** * **Daily** * + * **Monthly** * **Weekly** + */ + @JsonProperty(JSON_PROPERTY_PERIOD_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PeriodUnit getPeriodUnit() { + return periodUnit; + } + + /** + * Type of instalment transaction. Possible values: * **Annual** * **Daily** * **Monthly** * + * **Weekly** + * + * @param periodUnit Type of instalment transaction. Possible values: * **Annual** * **Daily** * + * **Monthly** * **Weekly** + */ + @JsonProperty(JSON_PROPERTY_PERIOD_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeriodUnit(PeriodUnit periodUnit) { + this.periodUnit = periodUnit; + isSetPeriodUnit = true; // mark as set + } + + /** + * First date of a payment. For instalment, the date of the first payments, if not immediate. + * + * @param firstPaymentDate First date of a payment. For instalment, the date of the first + * payments, if not immediate. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment firstPaymentDate(LocalDate firstPaymentDate) { + this.firstPaymentDate = firstPaymentDate; + isSetFirstPaymentDate = true; // mark as set + return this; + } + + /** + * First date of a payment. For instalment, the date of the first payments, if not immediate. + * + * @return firstPaymentDate First date of a payment. For instalment, the date of the first + * payments, if not immediate. + */ + @JsonProperty(JSON_PROPERTY_FIRST_PAYMENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocalDate getFirstPaymentDate() { + return firstPaymentDate; + } + + /** + * First date of a payment. For instalment, the date of the first payments, if not immediate. + * + * @param firstPaymentDate First date of a payment. For instalment, the date of the first + * payments, if not immediate. + */ + @JsonProperty(JSON_PROPERTY_FIRST_PAYMENT_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstPaymentDate(LocalDate firstPaymentDate) { + this.firstPaymentDate = firstPaymentDate; + isSetFirstPaymentDate = true; // mark as set + } + + /** + * Total number of payments. For instalment, the number of payments, including the first one. + * + * @param totalNbOfPayments Total number of payments. For instalment, the number of payments, + * including the first one. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment totalNbOfPayments(Integer totalNbOfPayments) { + this.totalNbOfPayments = totalNbOfPayments; + isSetTotalNbOfPayments = true; // mark as set + return this; + } + + /** + * Total number of payments. For instalment, the number of payments, including the first one. + * + * @return totalNbOfPayments Total number of payments. For instalment, the number of payments, + * including the first one. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_NB_OF_PAYMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalNbOfPayments() { + return totalNbOfPayments; + } + + /** + * Total number of payments. For instalment, the number of payments, including the first one. + * + * @param totalNbOfPayments Total number of payments. For instalment, the number of payments, + * including the first one. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_NB_OF_PAYMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalNbOfPayments(Integer totalNbOfPayments) { + this.totalNbOfPayments = totalNbOfPayments; + isSetTotalNbOfPayments = true; // mark as set + } + + /** + * Sum of a collection of amounts. Total amount of the payment instalments. + * + * @param cumulativeAmount Sum of a collection of amounts. Total amount of the payment + * instalments. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment cumulativeAmount(BigDecimal cumulativeAmount) { + this.cumulativeAmount = cumulativeAmount; + isSetCumulativeAmount = true; // mark as set + return this; + } + + /** + * Sum of a collection of amounts. Total amount of the payment instalments. minimum: 0.0 maximum: + * 99999999.999999 + * + * @return cumulativeAmount Sum of a collection of amounts. Total amount of the payment + * instalments. + */ + @JsonProperty(JSON_PROPERTY_CUMULATIVE_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCumulativeAmount() { + return cumulativeAmount; + } + + /** + * Sum of a collection of amounts. Total amount of the payment instalments. + * + * @param cumulativeAmount Sum of a collection of amounts. Total amount of the payment + * instalments. + */ + @JsonProperty(JSON_PROPERTY_CUMULATIVE_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCumulativeAmount(BigDecimal cumulativeAmount) { + this.cumulativeAmount = cumulativeAmount; + isSetCumulativeAmount = true; // mark as set + } + + /** + * First amount of the payment instalments. + * + * @param firstAmount First amount of the payment instalments. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment firstAmount(BigDecimal firstAmount) { + this.firstAmount = firstAmount; + isSetFirstAmount = true; // mark as set + return this; + } + + /** + * First amount of the payment instalments. minimum: 0.0 maximum: 99999999.999999 + * + * @return firstAmount First amount of the payment instalments. + */ + @JsonProperty(JSON_PROPERTY_FIRST_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getFirstAmount() { + return firstAmount; + } + + /** + * First amount of the payment instalments. + * + * @param firstAmount First amount of the payment instalments. + */ + @JsonProperty(JSON_PROPERTY_FIRST_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstAmount(BigDecimal firstAmount) { + this.firstAmount = firstAmount; + isSetFirstAmount = true; // mark as set + } + + /** + * Charges related to a transaction. Charge related to the payment instalments. + * + * @param charges Charges related to a transaction. Charge related to the payment instalments. + * @return the current {@code Instalment} instance, allowing for method chaining + */ + public Instalment charges(BigDecimal charges) { + this.charges = charges; + isSetCharges = true; // mark as set + return this; + } + + /** + * Charges related to a transaction. Charge related to the payment instalments. minimum: 0.0 + * maximum: 99999999.999999 + * + * @return charges Charges related to a transaction. Charge related to the payment instalments. + */ + @JsonProperty(JSON_PROPERTY_CHARGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCharges() { + return charges; + } + + /** + * Charges related to a transaction. Charge related to the payment instalments. + * + * @param charges Charges related to a transaction. Charge related to the payment instalments. + */ + @JsonProperty(JSON_PROPERTY_CHARGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCharges(BigDecimal charges) { + this.charges = charges; + isSetCharges = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Instalment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Instalment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Instalment instalment = (Instalment) o; + return Objects.equals(this.instalmentType, instalment.instalmentType) + && Objects.equals(this.isSetInstalmentType, instalment.isSetInstalmentType) + && Objects.equals(this.sequenceNumber, instalment.sequenceNumber) + && Objects.equals(this.isSetSequenceNumber, instalment.isSetSequenceNumber) + && Objects.equals(this.planID, instalment.planID) + && Objects.equals(this.isSetPlanID, instalment.isSetPlanID) + && Objects.equals(this.period, instalment.period) + && Objects.equals(this.isSetPeriod, instalment.isSetPeriod) + && Objects.equals(this.periodUnit, instalment.periodUnit) + && Objects.equals(this.isSetPeriodUnit, instalment.isSetPeriodUnit) + && Objects.equals(this.firstPaymentDate, instalment.firstPaymentDate) + && Objects.equals(this.isSetFirstPaymentDate, instalment.isSetFirstPaymentDate) + && Objects.equals(this.totalNbOfPayments, instalment.totalNbOfPayments) + && Objects.equals(this.isSetTotalNbOfPayments, instalment.isSetTotalNbOfPayments) + && Objects.equals(this.cumulativeAmount, instalment.cumulativeAmount) + && Objects.equals(this.isSetCumulativeAmount, instalment.isSetCumulativeAmount) + && Objects.equals(this.firstAmount, instalment.firstAmount) + && Objects.equals(this.isSetFirstAmount, instalment.isSetFirstAmount) + && Objects.equals(this.charges, instalment.charges) + && Objects.equals(this.isSetCharges, instalment.isSetCharges); + } + + @Override + public int hashCode() { + return Objects.hash( + instalmentType, + isSetInstalmentType, + sequenceNumber, + isSetSequenceNumber, + planID, + isSetPlanID, + period, + isSetPeriod, + periodUnit, + isSetPeriodUnit, + firstPaymentDate, + isSetFirstPaymentDate, + totalNbOfPayments, + isSetTotalNbOfPayments, + cumulativeAmount, + isSetCumulativeAmount, + firstAmount, + isSetFirstAmount, + charges, + isSetCharges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Instalment {\n"); + sb.append(" instalmentType: ").append(toIndentedString(instalmentType)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" planID: ").append(toIndentedString(planID)).append("\n"); + sb.append(" period: ").append(toIndentedString(period)).append("\n"); + sb.append(" periodUnit: ").append(toIndentedString(periodUnit)).append("\n"); + sb.append(" firstPaymentDate: ").append(toIndentedString(firstPaymentDate)).append("\n"); + sb.append(" totalNbOfPayments: ").append(toIndentedString(totalNbOfPayments)).append("\n"); + sb.append(" cumulativeAmount: ").append(toIndentedString(cumulativeAmount)).append("\n"); + sb.append(" firstAmount: ").append(toIndentedString(firstAmount)).append("\n"); + sb.append(" charges: ").append(toIndentedString(charges)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetInstalmentType) { + addIfNull(nulls, JSON_PROPERTY_INSTALMENT_TYPE, this.instalmentType); + } + if (isSetSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_NUMBER, this.sequenceNumber); + } + if (isSetPlanID) { + addIfNull(nulls, JSON_PROPERTY_PLAN_I_D, this.planID); + } + if (isSetPeriod) { + addIfNull(nulls, JSON_PROPERTY_PERIOD, this.period); + } + if (isSetPeriodUnit) { + addIfNull(nulls, JSON_PROPERTY_PERIOD_UNIT, this.periodUnit); + } + if (isSetFirstPaymentDate) { + addIfNull(nulls, JSON_PROPERTY_FIRST_PAYMENT_DATE, this.firstPaymentDate); + } + if (isSetTotalNbOfPayments) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_NB_OF_PAYMENTS, this.totalNbOfPayments); + } + if (isSetCumulativeAmount) { + addIfNull(nulls, JSON_PROPERTY_CUMULATIVE_AMOUNT, this.cumulativeAmount); + } + if (isSetFirstAmount) { + addIfNull(nulls, JSON_PROPERTY_FIRST_AMOUNT, this.firstAmount); + } + if (isSetCharges) { + addIfNull(nulls, JSON_PROPERTY_CHARGES, this.charges); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Instalment given an JSON string + * + * @param jsonString JSON string + * @return An instance of Instalment + * @throws JsonProcessingException if the JSON string is invalid with respect to Instalment + */ + public static Instalment fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Instalment.class); + } + + /** + * Convert an instance of Instalment to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/InstalmentType.java b/src/main/java/com/adyen/model/tapi/InstalmentType.java new file mode 100644 index 000000000..bc789dfeb --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/InstalmentType.java @@ -0,0 +1,54 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Type of instalment transaction. For requesting an instalment payment transaction. Possible + * values: * **DeferredInstalments** * **EqualInstalments** * **InequalInstalments** + */ +public enum InstalmentType { + DEFERRED_INSTALMENTS("DeferredInstalments"), + + EQUAL_INSTALMENTS("EqualInstalments"), + + INEQUAL_INSTALMENTS("InequalInstalments"); + + private String value; + + InstalmentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InstalmentType fromValue(String value) { + for (InstalmentType b : InstalmentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/JSON.java b/src/main/java/com/adyen/model/tapi/JSON.java new file mode 100644 index 000000000..c6d11b4e9 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/JSON.java @@ -0,0 +1,251 @@ +package com.adyen.model.tapi; + +import com.adyen.serializer.ByteArrayDeserializer; +import com.adyen.serializer.ByteArraySerializer; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.ext.ContextResolver; +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public class JSON implements ContextResolver { + private static ObjectMapper mapper; + + private JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, true); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.registerModule(new JavaTimeModule()); + // Custom ByteSerializer + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(byte[].class, new ByteArraySerializer()); + simpleModule.addDeserializer(byte[].class, new ByteArrayDeserializer()); + mapper.registerModule(simpleModule); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public static ObjectMapper getMapper() { + return mapper; + } + + /** + * Returns the target model class that should be used to deserialize the input data. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** Helper class to register the discriminator mappings. */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. This + * function can be invoked for anyOf/oneOf composed models with discriminator mappings. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + *

The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, so + * it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf( + Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** A map of discriminators for all model classes. */ + private static final Map, ClassDiscriminatorMapping> modelDiscriminators = + new HashMap, ClassDiscriminatorMapping>(); + + /** A map of oneOf/anyOf descendants for each model class. */ + private static final Map, Map> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator( + Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = + new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants( + Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoginRequest.java b/src/main/java/com/adyen/model/tapi/LoginRequest.java new file mode 100644 index 000000000..3f4e13364 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoginRequest.java @@ -0,0 +1,756 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * It conveys information related to the session (period between a Login and the following Logout) + * to process. Content of the `LoginRequest` message. + */ +@JsonPropertyOrder({ + LoginRequest.JSON_PROPERTY_DATE_TIME, + LoginRequest.JSON_PROPERTY_SALE_SOFTWARE, + LoginRequest.JSON_PROPERTY_SALE_TERMINAL_DATA, + LoginRequest.JSON_PROPERTY_TRAINING_MODE_FLAG, + LoginRequest.JSON_PROPERTY_OPERATOR_LANGUAGE, + LoginRequest.JSON_PROPERTY_OPERATOR_I_D, + LoginRequest.JSON_PROPERTY_SHIFT_NUMBER, + LoginRequest.JSON_PROPERTY_TOKEN_REQUESTED_TYPE, + LoginRequest.JSON_PROPERTY_CUSTOMER_ORDER_REQ, + LoginRequest.JSON_PROPERTY_PO_I_SERIAL_NUMBER +}) +public class LoginRequest { + public static final String JSON_PROPERTY_DATE_TIME = "DateTime"; + private OffsetDateTime dateTime; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateTime = false; + + public static final String JSON_PROPERTY_SALE_SOFTWARE = "SaleSoftware"; + private SaleSoftware saleSoftware; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleSoftware = false; + + public static final String JSON_PROPERTY_SALE_TERMINAL_DATA = "SaleTerminalData"; + private SaleTerminalData saleTerminalData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleTerminalData = false; + + public static final String JSON_PROPERTY_TRAINING_MODE_FLAG = "TrainingModeFlag"; + private Boolean trainingModeFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrainingModeFlag = false; + + public static final String JSON_PROPERTY_OPERATOR_LANGUAGE = "OperatorLanguage"; + private String operatorLanguage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperatorLanguage = false; + + public static final String JSON_PROPERTY_OPERATOR_I_D = "OperatorID"; + private String operatorID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperatorID = false; + + public static final String JSON_PROPERTY_SHIFT_NUMBER = "ShiftNumber"; + private String shiftNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShiftNumber = false; + + public static final String JSON_PROPERTY_TOKEN_REQUESTED_TYPE = "TokenRequestedType"; + private TokenRequestedType tokenRequestedType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestedType = false; + + /** Gets or Sets customerOrderReq */ + public enum CustomerOrderReqEnum { + BOTH(String.valueOf("Both")), + + CLOSED(String.valueOf("Closed")), + + OPEN(String.valueOf("Open")); + + private static final Logger LOG = Logger.getLogger(CustomerOrderReqEnum.class.getName()); + + private String value; + + CustomerOrderReqEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CustomerOrderReqEnum fromValue(String value) { + for (CustomerOrderReqEnum b : CustomerOrderReqEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "CustomerOrderReqEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(CustomerOrderReqEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_CUSTOMER_ORDER_REQ = "CustomerOrderReq"; + private List customerOrderReq; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerOrderReq = false; + + public static final String JSON_PROPERTY_PO_I_SERIAL_NUMBER = "POISerialNumber"; + private String poISerialNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoISerialNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoginRequest() {} + + /** + * Date and Time. In the Login request message, the Sale System gives its date and time to the POI + * System. In the Login response, the POI System gives its date and time to the Sale System. + * + * @param dateTime Date and Time. In the Login request message, the Sale System gives its date and + * time to the POI System. In the Login response, the POI System gives its date and time to + * the Sale System. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + isSetDateTime = true; // mark as set + return this; + } + + /** + * Date and Time. In the Login request message, the Sale System gives its date and time to the POI + * System. In the Login response, the POI System gives its date and time to the Sale System. + * + * @return dateTime Date and Time. In the Login request message, the Sale System gives its date + * and time to the POI System. In the Login response, the POI System gives its date and time + * to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Date and Time. In the Login request message, the Sale System gives its date and time to the POI + * System. In the Login response, the POI System gives its date and time to the Sale System. + * + * @param dateTime Date and Time. In the Login request message, the Sale System gives its date and + * time to the POI System. In the Login response, the POI System gives its date and time to + * the Sale System. + */ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + isSetDateTime = true; // mark as set + } + + /** + * Information related to the software of the Sale System which manages the Sale to POI protocol. + * + * @param saleSoftware Information related to the software of the Sale System which manages the + * Sale to POI protocol. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest saleSoftware(SaleSoftware saleSoftware) { + this.saleSoftware = saleSoftware; + isSetSaleSoftware = true; // mark as set + return this; + } + + /** + * Information related to the software of the Sale System which manages the Sale to POI protocol. + * + * @return saleSoftware Information related to the software of the Sale System which manages the + * Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleSoftware getSaleSoftware() { + return saleSoftware; + } + + /** + * Information related to the software of the Sale System which manages the Sale to POI protocol. + * + * @param saleSoftware Information related to the software of the Sale System which manages the + * Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleSoftware(SaleSoftware saleSoftware) { + this.saleSoftware = saleSoftware; + isSetSaleSoftware = true; // mark as set + } + + /** + * Information related to the software and hardware feature of the Sale Terminal. Present if the + * login involve a Sale Terminal. + * + * @param saleTerminalData Information related to the software and hardware feature of the Sale + * Terminal. Present if the login involve a Sale Terminal. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest saleTerminalData(SaleTerminalData saleTerminalData) { + this.saleTerminalData = saleTerminalData; + isSetSaleTerminalData = true; // mark as set + return this; + } + + /** + * Information related to the software and hardware feature of the Sale Terminal. Present if the + * login involve a Sale Terminal. + * + * @return saleTerminalData Information related to the software and hardware feature of the Sale + * Terminal. Present if the login involve a Sale Terminal. + */ + @JsonProperty(JSON_PROPERTY_SALE_TERMINAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleTerminalData getSaleTerminalData() { + return saleTerminalData; + } + + /** + * Information related to the software and hardware feature of the Sale Terminal. Present if the + * login involve a Sale Terminal. + * + * @param saleTerminalData Information related to the software and hardware feature of the Sale + * Terminal. Present if the login involve a Sale Terminal. + */ + @JsonProperty(JSON_PROPERTY_SALE_TERMINAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleTerminalData(SaleTerminalData saleTerminalData) { + this.saleTerminalData = saleTerminalData; + isSetSaleTerminalData = true; // mark as set + } + + /** + * Training mode. This flag indicates to the POI that the entire session will be not used to make + * real transaction, but is used for test of system or operator training. + * + * @param trainingModeFlag Training mode. This flag indicates to the POI that the entire session + * will be not used to make real transaction, but is used for test of system or operator + * training. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest trainingModeFlag(Boolean trainingModeFlag) { + this.trainingModeFlag = trainingModeFlag; + isSetTrainingModeFlag = true; // mark as set + return this; + } + + /** + * Training mode. This flag indicates to the POI that the entire session will be not used to make + * real transaction, but is used for test of system or operator training. + * + * @return trainingModeFlag Training mode. This flag indicates to the POI that the entire session + * will be not used to make real transaction, but is used for test of system or operator + * training. + */ + @JsonProperty(JSON_PROPERTY_TRAINING_MODE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTrainingModeFlag() { + return trainingModeFlag; + } + + /** + * Training mode. This flag indicates to the POI that the entire session will be not used to make + * real transaction, but is used for test of system or operator training. + * + * @param trainingModeFlag Training mode. This flag indicates to the POI that the entire session + * will be not used to make real transaction, but is used for test of system or operator + * training. + */ + @JsonProperty(JSON_PROPERTY_TRAINING_MODE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrainingModeFlag(Boolean trainingModeFlag) { + this.trainingModeFlag = trainingModeFlag; + isSetTrainingModeFlag = true; // mark as set + } + + /** + * Language of the Cashier or Operator. Default value for Device type displays. + * + * @param operatorLanguage Language of the Cashier or Operator. Default value for Device type + * displays. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest operatorLanguage(String operatorLanguage) { + this.operatorLanguage = operatorLanguage; + isSetOperatorLanguage = true; // mark as set + return this; + } + + /** + * Language of the Cashier or Operator. Default value for Device type displays. + * + * @return operatorLanguage Language of the Cashier or Operator. Default value for Device type + * displays. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatorLanguage() { + return operatorLanguage; + } + + /** + * Language of the Cashier or Operator. Default value for Device type displays. + * + * @param operatorLanguage Language of the Cashier or Operator. Default value for Device type + * displays. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatorLanguage(String operatorLanguage) { + this.operatorLanguage = operatorLanguage; + isSetOperatorLanguage = true; // mark as set + } + + /** + * Identification of the Cashier or Operator. Four conditions to send it: * The Sale System wants + * the POI to log it in the transaction log. * Because of reconciliation with total on OperatorID. + * * Because the POI needs it. * Acquirer or issuer need it. + * + * @param operatorID Identification of the Cashier or Operator. Four conditions to send it: * The + * Sale System wants the POI to log it in the transaction log. * Because of reconciliation + * with total on OperatorID. * Because the POI needs it. * Acquirer or issuer need it. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest operatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + return this; + } + + /** + * Identification of the Cashier or Operator. Four conditions to send it: * The Sale System wants + * the POI to log it in the transaction log. * Because of reconciliation with total on OperatorID. + * * Because the POI needs it. * Acquirer or issuer need it. + * + * @return operatorID Identification of the Cashier or Operator. Four conditions to send it: * The + * Sale System wants the POI to log it in the transaction log. * Because of reconciliation + * with total on OperatorID. * Because the POI needs it. * Acquirer or issuer need it. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatorID() { + return operatorID; + } + + /** + * Identification of the Cashier or Operator. Four conditions to send it: * The Sale System wants + * the POI to log it in the transaction log. * Because of reconciliation with total on OperatorID. + * * Because the POI needs it. * Acquirer or issuer need it. + * + * @param operatorID Identification of the Cashier or Operator. Four conditions to send it: * The + * Sale System wants the POI to log it in the transaction log. * Because of reconciliation + * with total on OperatorID. * Because the POI needs it. * Acquirer or issuer need it. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + } + + /** + * Shift number. Same as OperatorID. + * + * @param shiftNumber Shift number. Same as OperatorID. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest shiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + return this; + } + + /** + * Shift number. Same as OperatorID. + * + * @return shiftNumber Shift number. Same as OperatorID. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Shift number. Same as OperatorID. + * + * @param shiftNumber Shift number. Same as OperatorID. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @param tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest tokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + isSetTokenRequestedType = true; // mark as set + return this; + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @return tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUESTED_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TokenRequestedType getTokenRequestedType() { + return tokenRequestedType; + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @param tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUESTED_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + isSetTokenRequestedType = true; // mark as set + } + + /** + * List of customer order open, closed or both to be sent in the response messages. Possible + * values: * **Both** * **Closed** * **Open** + * + * @param customerOrderReq List of customer order open, closed or both to be sent in the response + * messages. Possible values: * **Both** * **Closed** * **Open** + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest customerOrderReq(List customerOrderReq) { + this.customerOrderReq = customerOrderReq; + isSetCustomerOrderReq = true; // mark as set + return this; + } + + public LoginRequest addCustomerOrderReqItem(CustomerOrderReqEnum customerOrderReqItem) { + if (this.customerOrderReq == null) { + this.customerOrderReq = new ArrayList<>(); + } + this.customerOrderReq.add(customerOrderReqItem); + return this; + } + + /** + * List of customer order open, closed or both to be sent in the response messages. Possible + * values: * **Both** * **Closed** * **Open** + * + * @return customerOrderReq List of customer order open, closed or both to be sent in the response + * messages. Possible values: * **Both** * **Closed** * **Open** + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_ORDER_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomerOrderReq() { + return customerOrderReq; + } + + /** + * List of customer order open, closed or both to be sent in the response messages. Possible + * values: * **Both** * **Closed** * **Open** + * + * @param customerOrderReq List of customer order open, closed or both to be sent in the response + * messages. Possible values: * **Both** * **Closed** * **Open** + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_ORDER_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerOrderReq(List customerOrderReq) { + this.customerOrderReq = customerOrderReq; + isSetCustomerOrderReq = true; // mark as set + } + + /** + * Serial number of a POI Terminal. If the login involve a POI Terminal and not the first Login to + * the POI System. + * + * @param poISerialNumber Serial number of a POI Terminal. If the login involve a POI Terminal and + * not the first Login to the POI System. + * @return the current {@code LoginRequest} instance, allowing for method chaining + */ + public LoginRequest poISerialNumber(String poISerialNumber) { + this.poISerialNumber = poISerialNumber; + isSetPoISerialNumber = true; // mark as set + return this; + } + + /** + * Serial number of a POI Terminal. If the login involve a POI Terminal and not the first Login to + * the POI System. + * + * @return poISerialNumber Serial number of a POI Terminal. If the login involve a POI Terminal + * and not the first Login to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPoISerialNumber() { + return poISerialNumber; + } + + /** + * Serial number of a POI Terminal. If the login involve a POI Terminal and not the first Login to + * the POI System. + * + * @param poISerialNumber Serial number of a POI Terminal. If the login involve a POI Terminal and + * not the first Login to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoISerialNumber(String poISerialNumber) { + this.poISerialNumber = poISerialNumber; + isSetPoISerialNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoginRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoginRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginRequest loginRequest = (LoginRequest) o; + return Objects.equals(this.dateTime, loginRequest.dateTime) + && Objects.equals(this.isSetDateTime, loginRequest.isSetDateTime) + && Objects.equals(this.saleSoftware, loginRequest.saleSoftware) + && Objects.equals(this.isSetSaleSoftware, loginRequest.isSetSaleSoftware) + && Objects.equals(this.saleTerminalData, loginRequest.saleTerminalData) + && Objects.equals(this.isSetSaleTerminalData, loginRequest.isSetSaleTerminalData) + && Objects.equals(this.trainingModeFlag, loginRequest.trainingModeFlag) + && Objects.equals(this.isSetTrainingModeFlag, loginRequest.isSetTrainingModeFlag) + && Objects.equals(this.operatorLanguage, loginRequest.operatorLanguage) + && Objects.equals(this.isSetOperatorLanguage, loginRequest.isSetOperatorLanguage) + && Objects.equals(this.operatorID, loginRequest.operatorID) + && Objects.equals(this.isSetOperatorID, loginRequest.isSetOperatorID) + && Objects.equals(this.shiftNumber, loginRequest.shiftNumber) + && Objects.equals(this.isSetShiftNumber, loginRequest.isSetShiftNumber) + && Objects.equals(this.tokenRequestedType, loginRequest.tokenRequestedType) + && Objects.equals(this.isSetTokenRequestedType, loginRequest.isSetTokenRequestedType) + && Objects.equals(this.customerOrderReq, loginRequest.customerOrderReq) + && Objects.equals(this.isSetCustomerOrderReq, loginRequest.isSetCustomerOrderReq) + && Objects.equals(this.poISerialNumber, loginRequest.poISerialNumber) + && Objects.equals(this.isSetPoISerialNumber, loginRequest.isSetPoISerialNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + dateTime, + isSetDateTime, + saleSoftware, + isSetSaleSoftware, + saleTerminalData, + isSetSaleTerminalData, + trainingModeFlag, + isSetTrainingModeFlag, + operatorLanguage, + isSetOperatorLanguage, + operatorID, + isSetOperatorID, + shiftNumber, + isSetShiftNumber, + tokenRequestedType, + isSetTokenRequestedType, + customerOrderReq, + isSetCustomerOrderReq, + poISerialNumber, + isSetPoISerialNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginRequest {\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" saleSoftware: ").append(toIndentedString(saleSoftware)).append("\n"); + sb.append(" saleTerminalData: ").append(toIndentedString(saleTerminalData)).append("\n"); + sb.append(" trainingModeFlag: ").append(toIndentedString(trainingModeFlag)).append("\n"); + sb.append(" operatorLanguage: ").append(toIndentedString(operatorLanguage)).append("\n"); + sb.append(" operatorID: ").append(toIndentedString(operatorID)).append("\n"); + sb.append(" shiftNumber: ").append(toIndentedString(shiftNumber)).append("\n"); + sb.append(" tokenRequestedType: ").append(toIndentedString(tokenRequestedType)).append("\n"); + sb.append(" customerOrderReq: ").append(toIndentedString(customerOrderReq)).append("\n"); + sb.append(" poISerialNumber: ").append(toIndentedString(poISerialNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDateTime) { + addIfNull(nulls, JSON_PROPERTY_DATE_TIME, this.dateTime); + } + if (isSetSaleSoftware) { + addIfNull(nulls, JSON_PROPERTY_SALE_SOFTWARE, this.saleSoftware); + } + if (isSetSaleTerminalData) { + addIfNull(nulls, JSON_PROPERTY_SALE_TERMINAL_DATA, this.saleTerminalData); + } + if (isSetTrainingModeFlag) { + addIfNull(nulls, JSON_PROPERTY_TRAINING_MODE_FLAG, this.trainingModeFlag); + } + if (isSetOperatorLanguage) { + addIfNull(nulls, JSON_PROPERTY_OPERATOR_LANGUAGE, this.operatorLanguage); + } + if (isSetOperatorID) { + addIfNull(nulls, JSON_PROPERTY_OPERATOR_I_D, this.operatorID); + } + if (isSetShiftNumber) { + addIfNull(nulls, JSON_PROPERTY_SHIFT_NUMBER, this.shiftNumber); + } + if (isSetTokenRequestedType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTED_TYPE, this.tokenRequestedType); + } + if (isSetCustomerOrderReq) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_ORDER_REQ, this.customerOrderReq); + } + if (isSetPoISerialNumber) { + addIfNull(nulls, JSON_PROPERTY_PO_I_SERIAL_NUMBER, this.poISerialNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoginRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to LoginRequest + */ + public static LoginRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoginRequest.class); + } + + /** + * Convert an instance of LoginRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoginResponse.java b/src/main/java/com/adyen/model/tapi/LoginResponse.java new file mode 100644 index 000000000..9770853ef --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoginResponse.java @@ -0,0 +1,284 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * It conveys Information related to the Login to process. Content of the Login Response message. + */ +@JsonPropertyOrder({ + LoginResponse.JSON_PROPERTY_RESPONSE, + LoginResponse.JSON_PROPERTY_PO_I_SYSTEM_DATA, + LoginResponse.JSON_PROPERTY_TOKEN_REQUEST_STATUS +}) +public class LoginResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_PO_I_SYSTEM_DATA = "POISystemData"; + private POISystemData poISystemData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoISystemData = false; + + public static final String JSON_PROPERTY_TOKEN_REQUEST_STATUS = "TokenRequestStatus"; + private Boolean tokenRequestStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoginResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code LoginResponse} instance, allowing for method chaining + */ + public LoginResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Information related to the POI System. Returned if the response result is Success. + * + * @param poISystemData Information related to the POI System. Returned if the response result is + * Success. + * @return the current {@code LoginResponse} instance, allowing for method chaining + */ + public LoginResponse poISystemData(POISystemData poISystemData) { + this.poISystemData = poISystemData; + isSetPoISystemData = true; // mark as set + return this; + } + + /** + * Information related to the POI System. Returned if the response result is Success. + * + * @return poISystemData Information related to the POI System. Returned if the response result is + * Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_SYSTEM_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POISystemData getPoISystemData() { + return poISystemData; + } + + /** + * Information related to the POI System. Returned if the response result is Success. + * + * @param poISystemData Information related to the POI System. Returned if the response result is + * Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_SYSTEM_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoISystemData(POISystemData poISystemData) { + this.poISystemData = poISystemData; + isSetPoISystemData = true; // mark as set + } + + /** + * If token is managed by the POI, the status of the token request. + * + * @param tokenRequestStatus If token is managed by the POI, the status of the token request. + * @return the current {@code LoginResponse} instance, allowing for method chaining + */ + public LoginResponse tokenRequestStatus(Boolean tokenRequestStatus) { + this.tokenRequestStatus = tokenRequestStatus; + isSetTokenRequestStatus = true; // mark as set + return this; + } + + /** + * If token is managed by the POI, the status of the token request. + * + * @return tokenRequestStatus If token is managed by the POI, the status of the token request. + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUEST_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTokenRequestStatus() { + return tokenRequestStatus; + } + + /** + * If token is managed by the POI, the status of the token request. + * + * @param tokenRequestStatus If token is managed by the POI, the status of the token request. + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUEST_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenRequestStatus(Boolean tokenRequestStatus) { + this.tokenRequestStatus = tokenRequestStatus; + isSetTokenRequestStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoginResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoginResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginResponse loginResponse = (LoginResponse) o; + return Objects.equals(this.response, loginResponse.response) + && Objects.equals(this.isSetResponse, loginResponse.isSetResponse) + && Objects.equals(this.poISystemData, loginResponse.poISystemData) + && Objects.equals(this.isSetPoISystemData, loginResponse.isSetPoISystemData) + && Objects.equals(this.tokenRequestStatus, loginResponse.tokenRequestStatus) + && Objects.equals(this.isSetTokenRequestStatus, loginResponse.isSetTokenRequestStatus); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + poISystemData, + isSetPoISystemData, + tokenRequestStatus, + isSetTokenRequestStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" poISystemData: ").append(toIndentedString(poISystemData)).append("\n"); + sb.append(" tokenRequestStatus: ").append(toIndentedString(tokenRequestStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetPoISystemData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_SYSTEM_DATA, this.poISystemData); + } + if (isSetTokenRequestStatus) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUEST_STATUS, this.tokenRequestStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoginResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to LoginResponse + */ + public static LoginResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoginResponse.class); + } + + /** + * Convert an instance of LoginResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LogoutRequest.java b/src/main/java/com/adyen/model/tapi/LogoutRequest.java new file mode 100644 index 000000000..5e878d841 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LogoutRequest.java @@ -0,0 +1,184 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Empty. Content of the Logout Request message. */ +@JsonPropertyOrder({LogoutRequest.JSON_PROPERTY_MAINTENANCE_ALLOWED}) +public class LogoutRequest { + public static final String JSON_PROPERTY_MAINTENANCE_ALLOWED = "MaintenanceAllowed"; + private Boolean maintenanceAllowed; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaintenanceAllowed = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LogoutRequest() {} + + /** + * Indicates that the POI terminal is able to or has to go to maintenance. Sent in the Logout + * Request to express that after closing the session, the POI may go to maintenance. + * + * @param maintenanceAllowed Indicates that the POI terminal is able to or has to go to + * maintenance. Sent in the Logout Request to express that after closing the session, the POI + * may go to maintenance. + * @return the current {@code LogoutRequest} instance, allowing for method chaining + */ + public LogoutRequest maintenanceAllowed(Boolean maintenanceAllowed) { + this.maintenanceAllowed = maintenanceAllowed; + isSetMaintenanceAllowed = true; // mark as set + return this; + } + + /** + * Indicates that the POI terminal is able to or has to go to maintenance. Sent in the Logout + * Request to express that after closing the session, the POI may go to maintenance. + * + * @return maintenanceAllowed Indicates that the POI terminal is able to or has to go to + * maintenance. Sent in the Logout Request to express that after closing the session, the POI + * may go to maintenance. + */ + @JsonProperty(JSON_PROPERTY_MAINTENANCE_ALLOWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMaintenanceAllowed() { + return maintenanceAllowed; + } + + /** + * Indicates that the POI terminal is able to or has to go to maintenance. Sent in the Logout + * Request to express that after closing the session, the POI may go to maintenance. + * + * @param maintenanceAllowed Indicates that the POI terminal is able to or has to go to + * maintenance. Sent in the Logout Request to express that after closing the session, the POI + * may go to maintenance. + */ + @JsonProperty(JSON_PROPERTY_MAINTENANCE_ALLOWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaintenanceAllowed(Boolean maintenanceAllowed) { + this.maintenanceAllowed = maintenanceAllowed; + isSetMaintenanceAllowed = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LogoutRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LogoutRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogoutRequest logoutRequest = (LogoutRequest) o; + return Objects.equals(this.maintenanceAllowed, logoutRequest.maintenanceAllowed) + && Objects.equals(this.isSetMaintenanceAllowed, logoutRequest.isSetMaintenanceAllowed); + } + + @Override + public int hashCode() { + return Objects.hash(maintenanceAllowed, isSetMaintenanceAllowed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogoutRequest {\n"); + sb.append(" maintenanceAllowed: ").append(toIndentedString(maintenanceAllowed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMaintenanceAllowed) { + addIfNull(nulls, JSON_PROPERTY_MAINTENANCE_ALLOWED, this.maintenanceAllowed); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LogoutRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of LogoutRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to LogoutRequest + */ + public static LogoutRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LogoutRequest.class); + } + + /** + * Convert an instance of LogoutRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LogoutResponse.java b/src/main/java/com/adyen/model/tapi/LogoutResponse.java new file mode 100644 index 000000000..1286e639a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LogoutResponse.java @@ -0,0 +1,175 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** It conveys the result of the Logout. Content of the Logout Response message. */ +@JsonPropertyOrder({LogoutResponse.JSON_PROPERTY_RESPONSE}) +public class LogoutResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LogoutResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code LogoutResponse} instance, allowing for method chaining + */ + public LogoutResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LogoutResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LogoutResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogoutResponse logoutResponse = (LogoutResponse) o; + return Objects.equals(this.response, logoutResponse.response) + && Objects.equals(this.isSetResponse, logoutResponse.isSetResponse); + } + + @Override + public int hashCode() { + return Objects.hash(response, isSetResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogoutResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LogoutResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of LogoutResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to LogoutResponse + */ + public static LogoutResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LogoutResponse.class); + } + + /** + * Convert an instance of LogoutResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyAccount.java b/src/main/java/com/adyen/model/tapi/LoyaltyAccount.java new file mode 100644 index 000000000..bb96f326a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyAccount.java @@ -0,0 +1,228 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * This data structure conveys the identification of the account and the associated loyalty brand. + * Data related to a loyalty account processed in the transaction. + */ +@JsonPropertyOrder({ + LoyaltyAccount.JSON_PROPERTY_LOYALTY_ACCOUNT_I_D, + LoyaltyAccount.JSON_PROPERTY_LOYALTY_BRAND +}) +public class LoyaltyAccount { + public static final String JSON_PROPERTY_LOYALTY_ACCOUNT_I_D = "LoyaltyAccountID"; + private LoyaltyAccountID loyaltyAccountID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAccountID = false; + + public static final String JSON_PROPERTY_LOYALTY_BRAND = "LoyaltyBrand"; + private String loyaltyBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyBrand = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyAccount() {} + + /** + * Identification of a Loyalty account. + * + * @param loyaltyAccountID Identification of a Loyalty account. + * @return the current {@code LoyaltyAccount} instance, allowing for method chaining + */ + public LoyaltyAccount loyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + isSetLoyaltyAccountID = true; // mark as set + return this; + } + + /** + * Identification of a Loyalty account. + * + * @return loyaltyAccountID Identification of a Loyalty account. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyAccountID getLoyaltyAccountID() { + return loyaltyAccountID; + } + + /** + * Identification of a Loyalty account. + * + * @param loyaltyAccountID Identification of a Loyalty account. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + isSetLoyaltyAccountID = true; // mark as set + } + + /** + * Identification of a Loyalty brand. If a card is analysed. + * + * @param loyaltyBrand Identification of a Loyalty brand. If a card is analysed. + * @return the current {@code LoyaltyAccount} instance, allowing for method chaining + */ + public LoyaltyAccount loyaltyBrand(String loyaltyBrand) { + this.loyaltyBrand = loyaltyBrand; + isSetLoyaltyBrand = true; // mark as set + return this; + } + + /** + * Identification of a Loyalty brand. If a card is analysed. + * + * @return loyaltyBrand Identification of a Loyalty brand. If a card is analysed. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLoyaltyBrand() { + return loyaltyBrand; + } + + /** + * Identification of a Loyalty brand. If a card is analysed. + * + * @param loyaltyBrand Identification of a Loyalty brand. If a card is analysed. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyBrand(String loyaltyBrand) { + this.loyaltyBrand = loyaltyBrand; + isSetLoyaltyBrand = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyAccount loyaltyAccount = (LoyaltyAccount) o; + return Objects.equals(this.loyaltyAccountID, loyaltyAccount.loyaltyAccountID) + && Objects.equals(this.isSetLoyaltyAccountID, loyaltyAccount.isSetLoyaltyAccountID) + && Objects.equals(this.loyaltyBrand, loyaltyAccount.loyaltyBrand) + && Objects.equals(this.isSetLoyaltyBrand, loyaltyAccount.isSetLoyaltyBrand); + } + + @Override + public int hashCode() { + return Objects.hash(loyaltyAccountID, isSetLoyaltyAccountID, loyaltyBrand, isSetLoyaltyBrand); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyAccount {\n"); + sb.append(" loyaltyAccountID: ").append(toIndentedString(loyaltyAccountID)).append("\n"); + sb.append(" loyaltyBrand: ").append(toIndentedString(loyaltyBrand)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLoyaltyAccountID) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACCOUNT_I_D, this.loyaltyAccountID); + } + if (isSetLoyaltyBrand) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_BRAND, this.loyaltyBrand); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyAccount + * @throws JsonProcessingException if the JSON string is invalid with respect to LoyaltyAccount + */ + public static LoyaltyAccount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyAccount.class); + } + + /** + * Convert an instance of LoyaltyAccount to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyAccountID.java b/src/main/java/com/adyen/model/tapi/LoyaltyAccountID.java new file mode 100644 index 000000000..3d8cc58e3 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyAccountID.java @@ -0,0 +1,448 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * Identification of a Loyalty account. In the Payment Request message, it allows to identify the + * loyalty account by the Sale Terminal instead of the POI Terminal (e.g. because the account + * identification is a bar-code read by the Cashier on a scanner device). + */ +@JsonPropertyOrder({ + LoyaltyAccountID.JSON_PROPERTY_ENTRY_MODE, + LoyaltyAccountID.JSON_PROPERTY_IDENTIFICATION_TYPE, + LoyaltyAccountID.JSON_PROPERTY_IDENTIFICATION_SUPPORT, + LoyaltyAccountID.JSON_PROPERTY_LOYALTY_I_D +}) +public class LoyaltyAccountID { + /** Gets or Sets entryMode */ + public enum EntryModeEnum { + CONTACTLESS(String.valueOf("Contactless")), + + FILE(String.valueOf("File")), + + ICC(String.valueOf("ICC")), + + KEYED(String.valueOf("Keyed")), + + MAG_STRIPE(String.valueOf("MagStripe")), + + MANUAL(String.valueOf("Manual")), + + MOBILE(String.valueOf("Mobile")), + + RFID(String.valueOf("RFID")), + + SCANNED(String.valueOf("Scanned")), + + SYNCHRONOUS_ICC(String.valueOf("SynchronousICC")), + + TAPPED(String.valueOf("Tapped")); + + private static final Logger LOG = Logger.getLogger(EntryModeEnum.class.getName()); + + private String value; + + EntryModeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EntryModeEnum fromValue(String value) { + for (EntryModeEnum b : EntryModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "EntryModeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(EntryModeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_ENTRY_MODE = "EntryMode"; + private List entryMode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntryMode = false; + + public static final String JSON_PROPERTY_IDENTIFICATION_TYPE = "IdentificationType"; + private IdentificationType identificationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationType = false; + + public static final String JSON_PROPERTY_IDENTIFICATION_SUPPORT = "IdentificationSupport"; + private IdentificationSupportType identificationSupport; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationSupport = false; + + public static final String JSON_PROPERTY_LOYALTY_I_D = "LoyaltyID"; + private String loyaltyID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyAccountID() {} + + /** + * entryMode + * + * @param entryMode + * @return the current {@code LoyaltyAccountID} instance, allowing for method chaining + */ + public LoyaltyAccountID entryMode(List entryMode) { + this.entryMode = entryMode; + isSetEntryMode = true; // mark as set + return this; + } + + public LoyaltyAccountID addEntryModeItem(EntryModeEnum entryModeItem) { + if (this.entryMode == null) { + this.entryMode = new ArrayList<>(); + } + this.entryMode.add(entryModeItem); + return this; + } + + /** + * Get entryMode + * + * @return entryMode + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEntryMode() { + return entryMode; + } + + /** + * entryMode + * + * @param entryMode + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntryMode(List entryMode) { + this.entryMode = entryMode; + isSetEntryMode = true; // mark as set + } + + /** + * Type of account identification. In a request message, it informs the POI System the type of the + * account or card identification, when provided by the Sale Terminal. (e.g. because the card + * information is a barcode read by the Cashier on a scanner device). In a response message, it + * informs the Sale System the type of the account or card identification. Possible values: * + * **AccountNumber** * **BarCode** * **ISOTrack2** * **PAN** * **PhoneNumber** + * + * @param identificationType Type of account identification. In a request message, it informs the + * POI System the type of the account or card identification, when provided by the Sale + * Terminal. (e.g. because the card information is a barcode read by the Cashier on a scanner + * device). In a response message, it informs the Sale System the type of the account or card + * identification. Possible values: * **AccountNumber** * **BarCode** * **ISOTrack2** * + * **PAN** * **PhoneNumber** + * @return the current {@code LoyaltyAccountID} instance, allowing for method chaining + */ + public LoyaltyAccountID identificationType(IdentificationType identificationType) { + this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set + return this; + } + + /** + * Type of account identification. In a request message, it informs the POI System the type of the + * account or card identification, when provided by the Sale Terminal. (e.g. because the card + * information is a barcode read by the Cashier on a scanner device). In a response message, it + * informs the Sale System the type of the account or card identification. Possible values: * + * **AccountNumber** * **BarCode** * **ISOTrack2** * **PAN** * **PhoneNumber** + * + * @return identificationType Type of account identification. In a request message, it informs the + * POI System the type of the account or card identification, when provided by the Sale + * Terminal. (e.g. because the card information is a barcode read by the Cashier on a scanner + * device). In a response message, it informs the Sale System the type of the account or card + * identification. Possible values: * **AccountNumber** * **BarCode** * **ISOTrack2** * + * **PAN** * **PhoneNumber** + */ + @JsonProperty(JSON_PROPERTY_IDENTIFICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IdentificationType getIdentificationType() { + return identificationType; + } + + /** + * Type of account identification. In a request message, it informs the POI System the type of the + * account or card identification, when provided by the Sale Terminal. (e.g. because the card + * information is a barcode read by the Cashier on a scanner device). In a response message, it + * informs the Sale System the type of the account or card identification. Possible values: * + * **AccountNumber** * **BarCode** * **ISOTrack2** * **PAN** * **PhoneNumber** + * + * @param identificationType Type of account identification. In a request message, it informs the + * POI System the type of the account or card identification, when provided by the Sale + * Terminal. (e.g. because the card information is a barcode read by the Cashier on a scanner + * device). In a response message, it informs the Sale System the type of the account or card + * identification. Possible values: * **AccountNumber** * **BarCode** * **ISOTrack2** * + * **PAN** * **PhoneNumber** + */ + @JsonProperty(JSON_PROPERTY_IDENTIFICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentificationType(IdentificationType identificationType) { + this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set + } + + /** + * Support of the loyalty account identification. Allows knowing where and how you have found the + * loyalty account identification. Possible values: * **HybridCard** * **LinkedCard** * + * **LoyaltyCard** * **NoCard** + * + * @param identificationSupport Support of the loyalty account identification. Allows knowing + * where and how you have found the loyalty account identification. Possible values: * + * **HybridCard** * **LinkedCard** * **LoyaltyCard** * **NoCard** + * @return the current {@code LoyaltyAccountID} instance, allowing for method chaining + */ + public LoyaltyAccountID identificationSupport(IdentificationSupportType identificationSupport) { + this.identificationSupport = identificationSupport; + isSetIdentificationSupport = true; // mark as set + return this; + } + + /** + * Support of the loyalty account identification. Allows knowing where and how you have found the + * loyalty account identification. Possible values: * **HybridCard** * **LinkedCard** * + * **LoyaltyCard** * **NoCard** + * + * @return identificationSupport Support of the loyalty account identification. Allows knowing + * where and how you have found the loyalty account identification. Possible values: * + * **HybridCard** * **LinkedCard** * **LoyaltyCard** * **NoCard** + */ + @JsonProperty(JSON_PROPERTY_IDENTIFICATION_SUPPORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IdentificationSupportType getIdentificationSupport() { + return identificationSupport; + } + + /** + * Support of the loyalty account identification. Allows knowing where and how you have found the + * loyalty account identification. Possible values: * **HybridCard** * **LinkedCard** * + * **LoyaltyCard** * **NoCard** + * + * @param identificationSupport Support of the loyalty account identification. Allows knowing + * where and how you have found the loyalty account identification. Possible values: * + * **HybridCard** * **LinkedCard** * **LoyaltyCard** * **NoCard** + */ + @JsonProperty(JSON_PROPERTY_IDENTIFICATION_SUPPORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentificationSupport(IdentificationSupportType identificationSupport) { + this.identificationSupport = identificationSupport; + isSetIdentificationSupport = true; // mark as set + } + + /** + * Loyalty account identification conforming to the IdentificationType. + * + * @param loyaltyID Loyalty account identification conforming to the IdentificationType. + * @return the current {@code LoyaltyAccountID} instance, allowing for method chaining + */ + public LoyaltyAccountID loyaltyID(String loyaltyID) { + this.loyaltyID = loyaltyID; + isSetLoyaltyID = true; // mark as set + return this; + } + + /** + * Loyalty account identification conforming to the IdentificationType. + * + * @return loyaltyID Loyalty account identification conforming to the IdentificationType. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLoyaltyID() { + return loyaltyID; + } + + /** + * Loyalty account identification conforming to the IdentificationType. + * + * @param loyaltyID Loyalty account identification conforming to the IdentificationType. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyID(String loyaltyID) { + this.loyaltyID = loyaltyID; + isSetLoyaltyID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyAccountID includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyAccountID object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyAccountID loyaltyAccountID = (LoyaltyAccountID) o; + return Objects.equals(this.entryMode, loyaltyAccountID.entryMode) + && Objects.equals(this.isSetEntryMode, loyaltyAccountID.isSetEntryMode) + && Objects.equals(this.identificationType, loyaltyAccountID.identificationType) + && Objects.equals(this.isSetIdentificationType, loyaltyAccountID.isSetIdentificationType) + && Objects.equals(this.identificationSupport, loyaltyAccountID.identificationSupport) + && Objects.equals( + this.isSetIdentificationSupport, loyaltyAccountID.isSetIdentificationSupport) + && Objects.equals(this.loyaltyID, loyaltyAccountID.loyaltyID) + && Objects.equals(this.isSetLoyaltyID, loyaltyAccountID.isSetLoyaltyID); + } + + @Override + public int hashCode() { + return Objects.hash( + entryMode, + isSetEntryMode, + identificationType, + isSetIdentificationType, + identificationSupport, + isSetIdentificationSupport, + loyaltyID, + isSetLoyaltyID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyAccountID {\n"); + sb.append(" entryMode: ").append(toIndentedString(entryMode)).append("\n"); + sb.append(" identificationType: ").append(toIndentedString(identificationType)).append("\n"); + sb.append(" identificationSupport: ") + .append(toIndentedString(identificationSupport)) + .append("\n"); + sb.append(" loyaltyID: ").append(toIndentedString(loyaltyID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntryMode) { + addIfNull(nulls, JSON_PROPERTY_ENTRY_MODE, this.entryMode); + } + if (isSetIdentificationType) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_TYPE, this.identificationType); + } + if (isSetIdentificationSupport) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_SUPPORT, this.identificationSupport); + } + if (isSetLoyaltyID) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_I_D, this.loyaltyID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyAccountID given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyAccountID + * @throws JsonProcessingException if the JSON string is invalid with respect to LoyaltyAccountID + */ + public static LoyaltyAccountID fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyAccountID.class); + } + + /** + * Convert an instance of LoyaltyAccountID to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyAccountReq.java b/src/main/java/com/adyen/model/tapi/LoyaltyAccountReq.java new file mode 100644 index 000000000..64c390baa --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyAccountReq.java @@ -0,0 +1,233 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** LoyaltyAccountReq */ +@JsonPropertyOrder({ + LoyaltyAccountReq.JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, + LoyaltyAccountReq.JSON_PROPERTY_LOYALTY_ACCOUNT_I_D +}) +public class LoyaltyAccountReq { + public static final String JSON_PROPERTY_CARD_ACQUISITION_REFERENCE = "CardAcquisitionReference"; + private TransactionIdentification cardAcquisitionReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionReference = false; + + public static final String JSON_PROPERTY_LOYALTY_ACCOUNT_I_D = "LoyaltyAccountID"; + private LoyaltyAccountID loyaltyAccountID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAccountID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyAccountReq() {} + + /** + * cardAcquisitionReference + * + * @param cardAcquisitionReference + * @return the current {@code LoyaltyAccountReq} instance, allowing for method chaining + */ + public LoyaltyAccountReq cardAcquisitionReference( + TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + return this; + } + + /** + * Get cardAcquisitionReference + * + * @return cardAcquisitionReference + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * cardAcquisitionReference + * + * @param cardAcquisitionReference + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + } + + /** + * loyaltyAccountID + * + * @param loyaltyAccountID + * @return the current {@code LoyaltyAccountReq} instance, allowing for method chaining + */ + public LoyaltyAccountReq loyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + isSetLoyaltyAccountID = true; // mark as set + return this; + } + + /** + * Get loyaltyAccountID + * + * @return loyaltyAccountID + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyAccountID getLoyaltyAccountID() { + return loyaltyAccountID; + } + + /** + * loyaltyAccountID + * + * @param loyaltyAccountID + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + isSetLoyaltyAccountID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyAccountReq includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyAccountReq object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyAccountReq loyaltyAccountReq = (LoyaltyAccountReq) o; + return Objects.equals(this.cardAcquisitionReference, loyaltyAccountReq.cardAcquisitionReference) + && Objects.equals( + this.isSetCardAcquisitionReference, loyaltyAccountReq.isSetCardAcquisitionReference) + && Objects.equals(this.loyaltyAccountID, loyaltyAccountReq.loyaltyAccountID) + && Objects.equals(this.isSetLoyaltyAccountID, loyaltyAccountReq.isSetLoyaltyAccountID); + } + + @Override + public int hashCode() { + return Objects.hash( + cardAcquisitionReference, + isSetCardAcquisitionReference, + loyaltyAccountID, + isSetLoyaltyAccountID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyAccountReq {\n"); + sb.append(" cardAcquisitionReference: ") + .append(toIndentedString(cardAcquisitionReference)) + .append("\n"); + sb.append(" loyaltyAccountID: ").append(toIndentedString(loyaltyAccountID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardAcquisitionReference) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, this.cardAcquisitionReference); + } + if (isSetLoyaltyAccountID) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACCOUNT_I_D, this.loyaltyAccountID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyAccountReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyAccountReq + * @throws JsonProcessingException if the JSON string is invalid with respect to LoyaltyAccountReq + */ + public static LoyaltyAccountReq fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyAccountReq.class); + } + + /** + * Convert an instance of LoyaltyAccountReq to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyAcquirerData.java b/src/main/java/com/adyen/model/tapi/LoyaltyAcquirerData.java new file mode 100644 index 000000000..dfd475876 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyAcquirerData.java @@ -0,0 +1,354 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** LoyaltyAcquirerData */ +@JsonPropertyOrder({ + LoyaltyAcquirerData.JSON_PROPERTY_LOYALTY_ACQUIRER_I_D, + LoyaltyAcquirerData.JSON_PROPERTY_APPROVAL_CODE, + LoyaltyAcquirerData.JSON_PROPERTY_LOYALTY_TRANSACTION_I_D, + LoyaltyAcquirerData.JSON_PROPERTY_HOST_RECONCILIATION_I_D +}) +public class LoyaltyAcquirerData { + public static final String JSON_PROPERTY_LOYALTY_ACQUIRER_I_D = "LoyaltyAcquirerID"; + private String loyaltyAcquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAcquirerID = false; + + public static final String JSON_PROPERTY_APPROVAL_CODE = "ApprovalCode"; + private String approvalCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApprovalCode = false; + + public static final String JSON_PROPERTY_LOYALTY_TRANSACTION_I_D = "LoyaltyTransactionID"; + private TransactionIdentification loyaltyTransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyTransactionID = false; + + public static final String JSON_PROPERTY_HOST_RECONCILIATION_I_D = "HostReconciliationID"; + private String hostReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostReconciliationID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyAcquirerData() {} + + /** + * Identification of the loyalty Acquirer. + * + * @param loyaltyAcquirerID Identification of the loyalty Acquirer. + * @return the current {@code LoyaltyAcquirerData} instance, allowing for method chaining + */ + public LoyaltyAcquirerData loyaltyAcquirerID(String loyaltyAcquirerID) { + this.loyaltyAcquirerID = loyaltyAcquirerID; + isSetLoyaltyAcquirerID = true; // mark as set + return this; + } + + /** + * Identification of the loyalty Acquirer. + * + * @return loyaltyAcquirerID Identification of the loyalty Acquirer. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLoyaltyAcquirerID() { + return loyaltyAcquirerID; + } + + /** + * Identification of the loyalty Acquirer. + * + * @param loyaltyAcquirerID Identification of the loyalty Acquirer. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAcquirerID(String loyaltyAcquirerID) { + this.loyaltyAcquirerID = loyaltyAcquirerID; + isSetLoyaltyAcquirerID = true; // mark as set + } + + /** + * Code assigned to a transaction approval by the Acquirer. Could be an identifier of the approved + * transaction for the Acquirer. This data element is conditional for the Loyalty Acquirers. Used + * in the PaymentRequest request for a referral. + * + * @param approvalCode Code assigned to a transaction approval by the Acquirer. Could be an + * identifier of the approved transaction for the Acquirer. This data element is conditional + * for the Loyalty Acquirers. Used in the PaymentRequest request for a referral. + * @return the current {@code LoyaltyAcquirerData} instance, allowing for method chaining + */ + public LoyaltyAcquirerData approvalCode(String approvalCode) { + this.approvalCode = approvalCode; + isSetApprovalCode = true; // mark as set + return this; + } + + /** + * Code assigned to a transaction approval by the Acquirer. Could be an identifier of the approved + * transaction for the Acquirer. This data element is conditional for the Loyalty Acquirers. Used + * in the PaymentRequest request for a referral. + * + * @return approvalCode Code assigned to a transaction approval by the Acquirer. Could be an + * identifier of the approved transaction for the Acquirer. This data element is conditional + * for the Loyalty Acquirers. Used in the PaymentRequest request for a referral. + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApprovalCode() { + return approvalCode; + } + + /** + * Code assigned to a transaction approval by the Acquirer. Could be an identifier of the approved + * transaction for the Acquirer. This data element is conditional for the Loyalty Acquirers. Used + * in the PaymentRequest request for a referral. + * + * @param approvalCode Code assigned to a transaction approval by the Acquirer. Could be an + * identifier of the approved transaction for the Acquirer. This data element is conditional + * for the Loyalty Acquirers. Used in the PaymentRequest request for a referral. + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApprovalCode(String approvalCode) { + this.approvalCode = approvalCode; + isSetApprovalCode = true; // mark as set + } + + /** + * loyaltyTransactionID + * + * @param loyaltyTransactionID + * @return the current {@code LoyaltyAcquirerData} instance, allowing for method chaining + */ + public LoyaltyAcquirerData loyaltyTransactionID(TransactionIdentification loyaltyTransactionID) { + this.loyaltyTransactionID = loyaltyTransactionID; + isSetLoyaltyTransactionID = true; // mark as set + return this; + } + + /** + * Get loyaltyTransactionID + * + * @return loyaltyTransactionID + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getLoyaltyTransactionID() { + return loyaltyTransactionID; + } + + /** + * loyaltyTransactionID + * + * @param loyaltyTransactionID + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyTransactionID(TransactionIdentification loyaltyTransactionID) { + this.loyaltyTransactionID = loyaltyTransactionID; + isSetLoyaltyTransactionID = true; // mark as set + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. Allows the assignment of + * a transaction to the Acquirer reconciliation (or batch). + * + * @param hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. Allows the assignment of a transaction to the Acquirer reconciliation (or batch). + * @return the current {@code LoyaltyAcquirerData} instance, allowing for method chaining + */ + public LoyaltyAcquirerData hostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + isSetHostReconciliationID = true; // mark as set + return this; + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. Allows the assignment of + * a transaction to the Acquirer reconciliation (or batch). + * + * @return hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. Allows the assignment of a transaction to the Acquirer reconciliation (or batch). + */ + @JsonProperty(JSON_PROPERTY_HOST_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHostReconciliationID() { + return hostReconciliationID; + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. Allows the assignment of + * a transaction to the Acquirer reconciliation (or batch). + * + * @param hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. Allows the assignment of a transaction to the Acquirer reconciliation (or batch). + */ + @JsonProperty(JSON_PROPERTY_HOST_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + isSetHostReconciliationID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyAcquirerData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyAcquirerData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyAcquirerData loyaltyAcquirerData = (LoyaltyAcquirerData) o; + return Objects.equals(this.loyaltyAcquirerID, loyaltyAcquirerData.loyaltyAcquirerID) + && Objects.equals(this.isSetLoyaltyAcquirerID, loyaltyAcquirerData.isSetLoyaltyAcquirerID) + && Objects.equals(this.approvalCode, loyaltyAcquirerData.approvalCode) + && Objects.equals(this.isSetApprovalCode, loyaltyAcquirerData.isSetApprovalCode) + && Objects.equals(this.loyaltyTransactionID, loyaltyAcquirerData.loyaltyTransactionID) + && Objects.equals( + this.isSetLoyaltyTransactionID, loyaltyAcquirerData.isSetLoyaltyTransactionID) + && Objects.equals(this.hostReconciliationID, loyaltyAcquirerData.hostReconciliationID) + && Objects.equals( + this.isSetHostReconciliationID, loyaltyAcquirerData.isSetHostReconciliationID); + } + + @Override + public int hashCode() { + return Objects.hash( + loyaltyAcquirerID, + isSetLoyaltyAcquirerID, + approvalCode, + isSetApprovalCode, + loyaltyTransactionID, + isSetLoyaltyTransactionID, + hostReconciliationID, + isSetHostReconciliationID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyAcquirerData {\n"); + sb.append(" loyaltyAcquirerID: ").append(toIndentedString(loyaltyAcquirerID)).append("\n"); + sb.append(" approvalCode: ").append(toIndentedString(approvalCode)).append("\n"); + sb.append(" loyaltyTransactionID: ") + .append(toIndentedString(loyaltyTransactionID)) + .append("\n"); + sb.append(" hostReconciliationID: ") + .append(toIndentedString(hostReconciliationID)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLoyaltyAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACQUIRER_I_D, this.loyaltyAcquirerID); + } + if (isSetApprovalCode) { + addIfNull(nulls, JSON_PROPERTY_APPROVAL_CODE, this.approvalCode); + } + if (isSetLoyaltyTransactionID) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_TRANSACTION_I_D, this.loyaltyTransactionID); + } + if (isSetHostReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_HOST_RECONCILIATION_I_D, this.hostReconciliationID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyAcquirerData given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyAcquirerData + * @throws JsonProcessingException if the JSON string is invalid with respect to + * LoyaltyAcquirerData + */ + public static LoyaltyAcquirerData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyAcquirerData.class); + } + + /** + * Convert an instance of LoyaltyAcquirerData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyData.java b/src/main/java/com/adyen/model/tapi/LoyaltyData.java new file mode 100644 index 000000000..3b1502d7a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyData.java @@ -0,0 +1,248 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * In the Payment, Loyalty or Balance Inquiry Request message, it allows the Sale Terminal to send + * the identification of the loyalty account or an awarded amount or an amount to redeem to the + * loyalty account. Data related to a Loyalty program or account. + */ +@JsonPropertyOrder({ + LoyaltyData.JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, + LoyaltyData.JSON_PROPERTY_LOYALTY_ACCOUNT_I_D +}) +public class LoyaltyData { + public static final String JSON_PROPERTY_CARD_ACQUISITION_REFERENCE = "CardAcquisitionReference"; + private TransactionIdentification cardAcquisitionReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionReference = false; + + public static final String JSON_PROPERTY_LOYALTY_ACCOUNT_I_D = "LoyaltyAccountID"; + private LoyaltyAccountID loyaltyAccountID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAccountID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyData() {} + + /** + * Reference to the last CardAcquisition, to use the same card. If the loyalty account ID comes + * from a previous CardAcquisition. + * + * @param cardAcquisitionReference Reference to the last CardAcquisition, to use the same card. If + * the loyalty account ID comes from a previous CardAcquisition. + * @return the current {@code LoyaltyData} instance, allowing for method chaining + */ + public LoyaltyData cardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + return this; + } + + /** + * Reference to the last CardAcquisition, to use the same card. If the loyalty account ID comes + * from a previous CardAcquisition. + * + * @return cardAcquisitionReference Reference to the last CardAcquisition, to use the same card. + * If the loyalty account ID comes from a previous CardAcquisition. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * Reference to the last CardAcquisition, to use the same card. If the loyalty account ID comes + * from a previous CardAcquisition. + * + * @param cardAcquisitionReference Reference to the last CardAcquisition, to use the same card. If + * the loyalty account ID comes from a previous CardAcquisition. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + } + + /** + * Identification of a Loyalty account. If loyalty identification of the loyalty account is + * realised by the Sale System. + * + * @param loyaltyAccountID Identification of a Loyalty account. If loyalty identification of the + * loyalty account is realised by the Sale System. + * @return the current {@code LoyaltyData} instance, allowing for method chaining + */ + public LoyaltyData loyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + isSetLoyaltyAccountID = true; // mark as set + return this; + } + + /** + * Identification of a Loyalty account. If loyalty identification of the loyalty account is + * realised by the Sale System. + * + * @return loyaltyAccountID Identification of a Loyalty account. If loyalty identification of the + * loyalty account is realised by the Sale System. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyAccountID getLoyaltyAccountID() { + return loyaltyAccountID; + } + + /** + * Identification of a Loyalty account. If loyalty identification of the loyalty account is + * realised by the Sale System. + * + * @param loyaltyAccountID Identification of a Loyalty account. If loyalty identification of the + * loyalty account is realised by the Sale System. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + isSetLoyaltyAccountID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyData loyaltyData = (LoyaltyData) o; + return Objects.equals(this.cardAcquisitionReference, loyaltyData.cardAcquisitionReference) + && Objects.equals( + this.isSetCardAcquisitionReference, loyaltyData.isSetCardAcquisitionReference) + && Objects.equals(this.loyaltyAccountID, loyaltyData.loyaltyAccountID) + && Objects.equals(this.isSetLoyaltyAccountID, loyaltyData.isSetLoyaltyAccountID); + } + + @Override + public int hashCode() { + return Objects.hash( + cardAcquisitionReference, + isSetCardAcquisitionReference, + loyaltyAccountID, + isSetLoyaltyAccountID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyData {\n"); + sb.append(" cardAcquisitionReference: ") + .append(toIndentedString(cardAcquisitionReference)) + .append("\n"); + sb.append(" loyaltyAccountID: ").append(toIndentedString(loyaltyAccountID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardAcquisitionReference) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, this.cardAcquisitionReference); + } + if (isSetLoyaltyAccountID) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACCOUNT_I_D, this.loyaltyAccountID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyData + * @throws JsonProcessingException if the JSON string is invalid with respect to LoyaltyData + */ + public static LoyaltyData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyData.class); + } + + /** + * Convert an instance of LoyaltyData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyHandlingType.java b/src/main/java/com/adyen/model/tapi/LoyaltyHandlingType.java new file mode 100644 index 000000000..9dbe06b97 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyHandlingType.java @@ -0,0 +1,55 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets LoyaltyHandling */ +public enum LoyaltyHandlingType { + ALLOWED("Allowed"), + + FORBIDDEN("Forbidden"), + + PROCESSED("Processed"), + + PROPOSED("Proposed"), + + REQUIRED("Required"); + + private String value; + + LoyaltyHandlingType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LoyaltyHandlingType fromValue(String value) { + for (LoyaltyHandlingType b : LoyaltyHandlingType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyResponse.java b/src/main/java/com/adyen/model/tapi/LoyaltyResponse.java new file mode 100644 index 000000000..fe2cbb850 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyResponse.java @@ -0,0 +1,403 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the Loyalty transaction processed by the POI System. Content of + * the Loyalty Response message. + */ +@JsonPropertyOrder({ + LoyaltyResponse.JSON_PROPERTY_RESPONSE, + LoyaltyResponse.JSON_PROPERTY_SALE_DATA, + LoyaltyResponse.JSON_PROPERTY_PO_I_DATA, + LoyaltyResponse.JSON_PROPERTY_LOYALTY_RESULT, + LoyaltyResponse.JSON_PROPERTY_PAYMENT_RECEIPT +}) +public class LoyaltyResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_PO_I_DATA = "POIData"; + private POIData poIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIData = false; + + public static final String JSON_PROPERTY_LOYALTY_RESULT = "LoyaltyResult"; + private List loyaltyResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyResult = false; + + public static final String JSON_PROPERTY_PAYMENT_RECEIPT = "PaymentReceipt"; + private List paymentReceipt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReceipt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code LoyaltyResponse} instance, allowing for method chaining + */ + public LoyaltyResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + * @return the current {@code LoyaltyResponse} instance, allowing for method chaining + */ + public LoyaltyResponse saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. + * + * @return saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + * @return the current {@code LoyaltyResponse} instance, allowing for method chaining + */ + public LoyaltyResponse poIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + return this; + } + + /** + * Data related to the POI System. + * + * @return poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIData getPoIData() { + return poIData; + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + } + + /** + * Data related to the result of a processed loyalty transaction. If loyalty account identified. + * + * @param loyaltyResult Data related to the result of a processed loyalty transaction. If loyalty + * account identified. + * @return the current {@code LoyaltyResponse} instance, allowing for method chaining + */ + public LoyaltyResponse loyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + isSetLoyaltyResult = true; // mark as set + return this; + } + + public LoyaltyResponse addLoyaltyResultItem(LoyaltyResult loyaltyResultItem) { + if (this.loyaltyResult == null) { + this.loyaltyResult = new ArrayList<>(); + } + this.loyaltyResult.add(loyaltyResultItem); + return this; + } + + /** + * Data related to the result of a processed loyalty transaction. If loyalty account identified. + * + * @return loyaltyResult Data related to the result of a processed loyalty transaction. If loyalty + * account identified. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLoyaltyResult() { + return loyaltyResult; + } + + /** + * Data related to the result of a processed loyalty transaction. If loyalty account identified. + * + * @param loyaltyResult Data related to the result of a processed loyalty transaction. If loyalty + * account identified. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + isSetLoyaltyResult = true; // mark as set + } + + /** + * paymentReceipt + * + * @param paymentReceipt + * @return the current {@code LoyaltyResponse} instance, allowing for method chaining + */ + public LoyaltyResponse paymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + return this; + } + + public LoyaltyResponse addPaymentReceiptItem(PaymentReceipt paymentReceiptItem) { + if (this.paymentReceipt == null) { + this.paymentReceipt = new ArrayList<>(); + } + this.paymentReceipt.add(paymentReceiptItem); + return this; + } + + /** + * Get paymentReceipt + * + * @return paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentReceipt() { + return paymentReceipt; + } + + /** + * paymentReceipt + * + * @param paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyResponse loyaltyResponse = (LoyaltyResponse) o; + return Objects.equals(this.response, loyaltyResponse.response) + && Objects.equals(this.isSetResponse, loyaltyResponse.isSetResponse) + && Objects.equals(this.saleData, loyaltyResponse.saleData) + && Objects.equals(this.isSetSaleData, loyaltyResponse.isSetSaleData) + && Objects.equals(this.poIData, loyaltyResponse.poIData) + && Objects.equals(this.isSetPoIData, loyaltyResponse.isSetPoIData) + && Objects.equals(this.loyaltyResult, loyaltyResponse.loyaltyResult) + && Objects.equals(this.isSetLoyaltyResult, loyaltyResponse.isSetLoyaltyResult) + && Objects.equals(this.paymentReceipt, loyaltyResponse.paymentReceipt) + && Objects.equals(this.isSetPaymentReceipt, loyaltyResponse.isSetPaymentReceipt); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + saleData, + isSetSaleData, + poIData, + isSetPoIData, + loyaltyResult, + isSetLoyaltyResult, + paymentReceipt, + isSetPaymentReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poIData: ").append(toIndentedString(poIData)).append("\n"); + sb.append(" loyaltyResult: ").append(toIndentedString(loyaltyResult)).append("\n"); + sb.append(" paymentReceipt: ").append(toIndentedString(paymentReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetPoIData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_DATA, this.poIData); + } + if (isSetLoyaltyResult) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_RESULT, this.loyaltyResult); + } + if (isSetPaymentReceipt) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RECEIPT, this.paymentReceipt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to LoyaltyResponse + */ + public static LoyaltyResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyResponse.class); + } + + /** + * Convert an instance of LoyaltyResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/LoyaltyResult.java b/src/main/java/com/adyen/model/tapi/LoyaltyResult.java new file mode 100644 index 000000000..6d660d476 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/LoyaltyResult.java @@ -0,0 +1,292 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** + * Data related to the result of a processed loyalty transaction. In the Message Response, the + * result of each loyalty brand transaction. + */ +@JsonPropertyOrder({ + LoyaltyResult.JSON_PROPERTY_LOYALTY_ACCOUNT, + LoyaltyResult.JSON_PROPERTY_CURRENT_BALANCE, + LoyaltyResult.JSON_PROPERTY_LOYALTY_ACQUIRER_DATA +}) +public class LoyaltyResult { + public static final String JSON_PROPERTY_LOYALTY_ACCOUNT = "LoyaltyAccount"; + private LoyaltyAccount loyaltyAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAccount = false; + + public static final String JSON_PROPERTY_CURRENT_BALANCE = "CurrentBalance"; + private BigDecimal currentBalance; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = false; + + public static final String JSON_PROPERTY_LOYALTY_ACQUIRER_DATA = "LoyaltyAcquirerData"; + private LoyaltyAcquirerData loyaltyAcquirerData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyAcquirerData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LoyaltyResult() {} + + /** + * Data related to a loyalty account processed in the transaction. + * + * @param loyaltyAccount Data related to a loyalty account processed in the transaction. + * @return the current {@code LoyaltyResult} instance, allowing for method chaining + */ + public LoyaltyResult loyaltyAccount(LoyaltyAccount loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + isSetLoyaltyAccount = true; // mark as set + return this; + } + + /** + * Data related to a loyalty account processed in the transaction. + * + * @return loyaltyAccount Data related to a loyalty account processed in the transaction. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyAccount getLoyaltyAccount() { + return loyaltyAccount; + } + + /** + * Data related to a loyalty account processed in the transaction. + * + * @param loyaltyAccount Data related to a loyalty account processed in the transaction. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAccount(LoyaltyAccount loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + isSetLoyaltyAccount = true; // mark as set + } + + /** + * Balance of an account. If known (provided by the card or an external host). + * + * @param currentBalance Balance of an account. If known (provided by the card or an external + * host). + * @return the current {@code LoyaltyResult} instance, allowing for method chaining + */ + public LoyaltyResult currentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set + return this; + } + + /** + * Balance of an account. If known (provided by the card or an external host). minimum: 0.0 + * maximum: 99999999.999999 + * + * @return currentBalance Balance of an account. If known (provided by the card or an external + * host). + */ + @JsonProperty(JSON_PROPERTY_CURRENT_BALANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * Balance of an account. If known (provided by the card or an external host). + * + * @param currentBalance Balance of an account. If known (provided by the card or an external + * host). + */ + @JsonProperty(JSON_PROPERTY_CURRENT_BALANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set + } + + /** + * Data related to the loyalty Acquirer during a loyalty transaction. If content not empty. + * + * @param loyaltyAcquirerData Data related to the loyalty Acquirer during a loyalty transaction. + * If content not empty. + * @return the current {@code LoyaltyResult} instance, allowing for method chaining + */ + public LoyaltyResult loyaltyAcquirerData(LoyaltyAcquirerData loyaltyAcquirerData) { + this.loyaltyAcquirerData = loyaltyAcquirerData; + isSetLoyaltyAcquirerData = true; // mark as set + return this; + } + + /** + * Data related to the loyalty Acquirer during a loyalty transaction. If content not empty. + * + * @return loyaltyAcquirerData Data related to the loyalty Acquirer during a loyalty transaction. + * If content not empty. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyAcquirerData getLoyaltyAcquirerData() { + return loyaltyAcquirerData; + } + + /** + * Data related to the loyalty Acquirer during a loyalty transaction. If content not empty. + * + * @param loyaltyAcquirerData Data related to the loyalty Acquirer during a loyalty transaction. + * If content not empty. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyAcquirerData(LoyaltyAcquirerData loyaltyAcquirerData) { + this.loyaltyAcquirerData = loyaltyAcquirerData; + isSetLoyaltyAcquirerData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LoyaltyResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LoyaltyResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoyaltyResult loyaltyResult = (LoyaltyResult) o; + return Objects.equals(this.loyaltyAccount, loyaltyResult.loyaltyAccount) + && Objects.equals(this.isSetLoyaltyAccount, loyaltyResult.isSetLoyaltyAccount) + && Objects.equals(this.currentBalance, loyaltyResult.currentBalance) + && Objects.equals(this.isSetCurrentBalance, loyaltyResult.isSetCurrentBalance) + && Objects.equals(this.loyaltyAcquirerData, loyaltyResult.loyaltyAcquirerData) + && Objects.equals(this.isSetLoyaltyAcquirerData, loyaltyResult.isSetLoyaltyAcquirerData); + } + + @Override + public int hashCode() { + return Objects.hash( + loyaltyAccount, + isSetLoyaltyAccount, + currentBalance, + isSetCurrentBalance, + loyaltyAcquirerData, + isSetLoyaltyAcquirerData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoyaltyResult {\n"); + sb.append(" loyaltyAccount: ").append(toIndentedString(loyaltyAccount)).append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" loyaltyAcquirerData: ") + .append(toIndentedString(loyaltyAcquirerData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLoyaltyAccount) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACCOUNT, this.loyaltyAccount); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + if (isSetLoyaltyAcquirerData) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_ACQUIRER_DATA, this.loyaltyAcquirerData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LoyaltyResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoyaltyResult + * @throws JsonProcessingException if the JSON string is invalid with respect to LoyaltyResult + */ + public static LoyaltyResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LoyaltyResult.class); + } + + /** + * Convert an instance of LoyaltyResult to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MenuEntry.java b/src/main/java/com/adyen/model/tapi/MenuEntry.java new file mode 100644 index 000000000..fdba4603e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MenuEntry.java @@ -0,0 +1,470 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * An entry of the menu to present to the Cashier. It conveys message text and parameters of the + * menu entry. This output data could be only provided for an input command, in order to choose an + * entry of the menu. + */ +@JsonPropertyOrder({ + MenuEntry.JSON_PROPERTY_MENU_ENTRY_TAG, + MenuEntry.JSON_PROPERTY_DEFAULT_SELECTED_FLAG, + MenuEntry.JSON_PROPERTY_OUTPUT_FORMAT, + MenuEntry.JSON_PROPERTY_PREDEFINED_CONTENT, + MenuEntry.JSON_PROPERTY_OUTPUT_TEXT, + MenuEntry.JSON_PROPERTY_OUTPUT_X_H_T_M_L +}) +public class MenuEntry { + public static final String JSON_PROPERTY_MENU_ENTRY_TAG = "MenuEntryTag"; + private MenuEntryTagType menuEntryTag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMenuEntryTag = false; + + public static final String JSON_PROPERTY_DEFAULT_SELECTED_FLAG = "DefaultSelectedFlag"; + private Boolean defaultSelectedFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultSelectedFlag = false; + + public static final String JSON_PROPERTY_OUTPUT_FORMAT = "OutputFormat"; + private OutputFormatType outputFormat; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputFormat = false; + + public static final String JSON_PROPERTY_PREDEFINED_CONTENT = "PredefinedContent"; + private PredefinedContent predefinedContent; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPredefinedContent = false; + + public static final String JSON_PROPERTY_OUTPUT_TEXT = "OutputText"; + private List outputText; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputText = false; + + public static final String JSON_PROPERTY_OUTPUT_X_H_T_M_L = "OutputXHTML"; + private byte[] outputXHTML; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputXHTML = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MenuEntry() {} + + /** + * Characteristics related to the selection of a menu entry. Possible values: * **NonSelectable** + * * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + * + * @param menuEntryTag Characteristics related to the selection of a menu entry. Possible values: + * * **NonSelectable** * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + * @return the current {@code MenuEntry} instance, allowing for method chaining + */ + public MenuEntry menuEntryTag(MenuEntryTagType menuEntryTag) { + this.menuEntryTag = menuEntryTag; + isSetMenuEntryTag = true; // mark as set + return this; + } + + /** + * Characteristics related to the selection of a menu entry. Possible values: * **NonSelectable** + * * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + * + * @return menuEntryTag Characteristics related to the selection of a menu entry. Possible values: + * * **NonSelectable** * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MenuEntryTagType getMenuEntryTag() { + return menuEntryTag; + } + + /** + * Characteristics related to the selection of a menu entry. Possible values: * **NonSelectable** + * * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + * + * @param menuEntryTag Characteristics related to the selection of a menu entry. Possible values: + * * **NonSelectable** * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + */ + @JsonProperty(JSON_PROPERTY_MENU_ENTRY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMenuEntryTag(MenuEntryTagType menuEntryTag) { + this.menuEntryTag = menuEntryTag; + isSetMenuEntryTag = true; // mark as set + } + + /** + * Selection of a menu entry to be displayed. In Input request message, it allows selection of one + * or several menu entries before any user action. + * + * @param defaultSelectedFlag Selection of a menu entry to be displayed. In Input request message, + * it allows selection of one or several menu entries before any user action. + * @return the current {@code MenuEntry} instance, allowing for method chaining + */ + public MenuEntry defaultSelectedFlag(Boolean defaultSelectedFlag) { + this.defaultSelectedFlag = defaultSelectedFlag; + isSetDefaultSelectedFlag = true; // mark as set + return this; + } + + /** + * Selection of a menu entry to be displayed. In Input request message, it allows selection of one + * or several menu entries before any user action. + * + * @return defaultSelectedFlag Selection of a menu entry to be displayed. In Input request + * message, it allows selection of one or several menu entries before any user action. + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_SELECTED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDefaultSelectedFlag() { + return defaultSelectedFlag; + } + + /** + * Selection of a menu entry to be displayed. In Input request message, it allows selection of one + * or several menu entries before any user action. + * + * @param defaultSelectedFlag Selection of a menu entry to be displayed. In Input request message, + * it allows selection of one or several menu entries before any user action. + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_SELECTED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSelectedFlag(Boolean defaultSelectedFlag) { + this.defaultSelectedFlag = defaultSelectedFlag; + isSetDefaultSelectedFlag = true; // mark as set + } + + /** + * Possible values: * **BarCode** * **MessageRef** * **Text** * **XHTML** + * + * @param outputFormat Possible values: * **BarCode** * **MessageRef** * **Text** * **XHTML** + * @return the current {@code MenuEntry} instance, allowing for method chaining + */ + public MenuEntry outputFormat(OutputFormatType outputFormat) { + this.outputFormat = outputFormat; + isSetOutputFormat = true; // mark as set + return this; + } + + /** + * Possible values: * **BarCode** * **MessageRef** * **Text** * **XHTML** + * + * @return outputFormat Possible values: * **BarCode** * **MessageRef** * **Text** * **XHTML** + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputFormatType getOutputFormat() { + return outputFormat; + } + + /** + * Possible values: * **BarCode** * **MessageRef** * **Text** * **XHTML** + * + * @param outputFormat Possible values: * **BarCode** * **MessageRef** * **Text** * **XHTML** + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputFormat(OutputFormatType outputFormat) { + this.outputFormat = outputFormat; + isSetOutputFormat = true; // mark as set + } + + /** + * predefinedContent + * + * @param predefinedContent + * @return the current {@code MenuEntry} instance, allowing for method chaining + */ + public MenuEntry predefinedContent(PredefinedContent predefinedContent) { + this.predefinedContent = predefinedContent; + isSetPredefinedContent = true; // mark as set + return this; + } + + /** + * Get predefinedContent + * + * @return predefinedContent + */ + @JsonProperty(JSON_PROPERTY_PREDEFINED_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PredefinedContent getPredefinedContent() { + return predefinedContent; + } + + /** + * predefinedContent + * + * @param predefinedContent + */ + @JsonProperty(JSON_PROPERTY_PREDEFINED_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPredefinedContent(PredefinedContent predefinedContent) { + this.predefinedContent = predefinedContent; + isSetPredefinedContent = true; // mark as set + } + + /** + * Content of text message to display or print. It conveys Information related to the content of + * the text message and its format. All the data elements related to the format of the text to + * display or print are parameters valid for the whole Text content. + * + * @param outputText Content of text message to display or print. It conveys Information related + * to the content of the text message and its format. All the data elements related to the + * format of the text to display or print are parameters valid for the whole Text content. + * @return the current {@code MenuEntry} instance, allowing for method chaining + */ + public MenuEntry outputText(List outputText) { + this.outputText = outputText; + isSetOutputText = true; // mark as set + return this; + } + + public MenuEntry addOutputTextItem(OutputText outputTextItem) { + if (this.outputText == null) { + this.outputText = new ArrayList<>(); + } + this.outputText.add(outputTextItem); + return this; + } + + /** + * Content of text message to display or print. It conveys Information related to the content of + * the text message and its format. All the data elements related to the format of the text to + * display or print are parameters valid for the whole Text content. + * + * @return outputText Content of text message to display or print. It conveys Information related + * to the content of the text message and its format. All the data elements related to the + * format of the text to display or print are parameters valid for the whole Text content. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOutputText() { + return outputText; + } + + /** + * Content of text message to display or print. It conveys Information related to the content of + * the text message and its format. All the data elements related to the format of the text to + * display or print are parameters valid for the whole Text content. + * + * @param outputText Content of text message to display or print. It conveys Information related + * to the content of the text message and its format. All the data elements related to the + * format of the text to display or print are parameters valid for the whole Text content. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputText(List outputText) { + this.outputText = outputText; + isSetOutputText = true; // mark as set + } + + /** + * XHTML document body containing the message to display or print. + * + * @param outputXHTML XHTML document body containing the message to display or print. + * @return the current {@code MenuEntry} instance, allowing for method chaining + */ + public MenuEntry outputXHTML(byte[] outputXHTML) { + this.outputXHTML = outputXHTML; + isSetOutputXHTML = true; // mark as set + return this; + } + + /** + * XHTML document body containing the message to display or print. + * + * @return outputXHTML XHTML document body containing the message to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_X_H_T_M_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getOutputXHTML() { + return outputXHTML; + } + + /** + * XHTML document body containing the message to display or print. + * + * @param outputXHTML XHTML document body containing the message to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_X_H_T_M_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputXHTML(byte[] outputXHTML) { + this.outputXHTML = outputXHTML; + isSetOutputXHTML = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MenuEntry includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MenuEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MenuEntry menuEntry = (MenuEntry) o; + return Objects.equals(this.menuEntryTag, menuEntry.menuEntryTag) + && Objects.equals(this.isSetMenuEntryTag, menuEntry.isSetMenuEntryTag) + && Objects.equals(this.defaultSelectedFlag, menuEntry.defaultSelectedFlag) + && Objects.equals(this.isSetDefaultSelectedFlag, menuEntry.isSetDefaultSelectedFlag) + && Objects.equals(this.outputFormat, menuEntry.outputFormat) + && Objects.equals(this.isSetOutputFormat, menuEntry.isSetOutputFormat) + && Objects.equals(this.predefinedContent, menuEntry.predefinedContent) + && Objects.equals(this.isSetPredefinedContent, menuEntry.isSetPredefinedContent) + && Objects.equals(this.outputText, menuEntry.outputText) + && Objects.equals(this.isSetOutputText, menuEntry.isSetOutputText) + && Arrays.equals(this.outputXHTML, menuEntry.outputXHTML) + && Objects.equals(this.isSetOutputXHTML, menuEntry.isSetOutputXHTML); + } + + @Override + public int hashCode() { + return Objects.hash( + menuEntryTag, + isSetMenuEntryTag, + defaultSelectedFlag, + isSetDefaultSelectedFlag, + outputFormat, + isSetOutputFormat, + predefinedContent, + isSetPredefinedContent, + outputText, + isSetOutputText, + Arrays.hashCode(outputXHTML), + isSetOutputXHTML); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MenuEntry {\n"); + sb.append(" menuEntryTag: ").append(toIndentedString(menuEntryTag)).append("\n"); + sb.append(" defaultSelectedFlag: ") + .append(toIndentedString(defaultSelectedFlag)) + .append("\n"); + sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).append("\n"); + sb.append(" predefinedContent: ").append(toIndentedString(predefinedContent)).append("\n"); + sb.append(" outputText: ").append(toIndentedString(outputText)).append("\n"); + sb.append(" outputXHTML: ").append(toIndentedString(outputXHTML)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMenuEntryTag) { + addIfNull(nulls, JSON_PROPERTY_MENU_ENTRY_TAG, this.menuEntryTag); + } + if (isSetDefaultSelectedFlag) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_SELECTED_FLAG, this.defaultSelectedFlag); + } + if (isSetOutputFormat) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_FORMAT, this.outputFormat); + } + if (isSetPredefinedContent) { + addIfNull(nulls, JSON_PROPERTY_PREDEFINED_CONTENT, this.predefinedContent); + } + if (isSetOutputText) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_TEXT, this.outputText); + } + if (isSetOutputXHTML) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_X_H_T_M_L, this.outputXHTML); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MenuEntry given an JSON string + * + * @param jsonString JSON string + * @return An instance of MenuEntry + * @throws JsonProcessingException if the JSON string is invalid with respect to MenuEntry + */ + public static MenuEntry fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MenuEntry.class); + } + + /** + * Convert an instance of MenuEntry to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MenuEntryTagType.java b/src/main/java/com/adyen/model/tapi/MenuEntryTagType.java new file mode 100644 index 000000000..7445385b9 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MenuEntryTagType.java @@ -0,0 +1,56 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Characteristics related to the selection of a menu entry. Possible values: * **NonSelectable** * + * **NonSelectableSubMenu** * **Selectable** * **SubMenu** + */ +public enum MenuEntryTagType { + NON_SELECTABLE("NonSelectable"), + + NON_SELECTABLE_SUB_MENU("NonSelectableSubMenu"), + + SELECTABLE("Selectable"), + + SUB_MENU("SubMenu"); + + private String value; + + MenuEntryTagType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MenuEntryTagType fromValue(String value) { + for (MenuEntryTagType b : MenuEntryTagType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MessageCategoryType.java b/src/main/java/com/adyen/model/tapi/MessageCategoryType.java new file mode 100644 index 000000000..133aafc34 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MessageCategoryType.java @@ -0,0 +1,87 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets MessageCategory */ +public enum MessageCategoryType { + ABORT("Abort"), + + ADMIN("Admin"), + + BALANCE_INQUIRY("BalanceInquiry"), + + CARD_ACQUISITION("CardAcquisition"), + + DIAGNOSIS("Diagnosis"), + + DISPLAY("Display"), + + ENABLE_SERVICE("EnableService"), + + EVENT("Event"), + + GET_TOTALS("GetTotals"), + + INPUT("Input"), + + INPUT_UPDATE("InputUpdate"), + + LOGIN("Login"), + + LOGOUT("Logout"), + + LOYALTY("Loyalty"), + + NONE("None"), + + PAYMENT("Payment"), + + PRINT("Print"), + + RECONCILIATION("Reconciliation"), + + REVERSAL("Reversal"), + + STORED_VALUE("StoredValue"), + + TRANSACTION_STATUS("TransactionStatus"); + + private String value; + + MessageCategoryType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessageCategoryType fromValue(String value) { + for (MessageCategoryType b : MessageCategoryType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MessageClassType.java b/src/main/java/com/adyen/model/tapi/MessageClassType.java new file mode 100644 index 000000000..265bab1e3 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MessageClassType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets MessageClass */ +public enum MessageClassType { + DEVICE("Device"), + + EVENT("Event"), + + SERVICE("Service"); + + private String value; + + MessageClassType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessageClassType fromValue(String value) { + for (MessageClassType b : MessageClassType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MessageHeader.java b/src/main/java/com/adyen/model/tapi/MessageHeader.java new file mode 100644 index 000000000..f0cf94d84 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MessageHeader.java @@ -0,0 +1,580 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Message header of the Sale to POI protocol message. It conveys Information related to the Sale to + * POI protocol management. + */ +@JsonPropertyOrder({ + MessageHeader.JSON_PROPERTY_PROTOCOL_VERSION, + MessageHeader.JSON_PROPERTY_MESSAGE_CLASS, + MessageHeader.JSON_PROPERTY_MESSAGE_CATEGORY, + MessageHeader.JSON_PROPERTY_MESSAGE_TYPE, + MessageHeader.JSON_PROPERTY_SERVICE_I_D, + MessageHeader.JSON_PROPERTY_DEVICE_I_D, + MessageHeader.JSON_PROPERTY_SALE_I_D, + MessageHeader.JSON_PROPERTY_P_O_I_I_D +}) +public class MessageHeader { + public static final String JSON_PROPERTY_PROTOCOL_VERSION = "ProtocolVersion"; + private String protocolVersion; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProtocolVersion = false; + + public static final String JSON_PROPERTY_MESSAGE_CLASS = "MessageClass"; + private MessageClassType messageClass; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageClass = false; + + public static final String JSON_PROPERTY_MESSAGE_CATEGORY = "MessageCategory"; + private MessageCategoryType messageCategory; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageCategory = false; + + public static final String JSON_PROPERTY_MESSAGE_TYPE = "MessageType"; + private MessageType messageType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageType = false; + + public static final String JSON_PROPERTY_SERVICE_I_D = "ServiceID"; + private String serviceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetServiceID = false; + + public static final String JSON_PROPERTY_DEVICE_I_D = "DeviceID"; + private String deviceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceID = false; + + public static final String JSON_PROPERTY_SALE_I_D = "SaleID"; + private String saleID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleID = false; + + public static final String JSON_PROPERTY_P_O_I_I_D = "POIID"; + private String POIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPOIID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MessageHeader() {} + + /** + * If MessageCategory is Login or Diagnosis. + * + * @param protocolVersion If MessageCategory is Login or Diagnosis. + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader protocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + isSetProtocolVersion = true; // mark as set + return this; + } + + /** + * If MessageCategory is Login or Diagnosis. + * + * @return protocolVersion If MessageCategory is Login or Diagnosis. + */ + @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtocolVersion() { + return protocolVersion; + } + + /** + * If MessageCategory is Login or Diagnosis. + * + * @param protocolVersion If MessageCategory is Login or Diagnosis. + */ + @JsonProperty(JSON_PROPERTY_PROTOCOL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + isSetProtocolVersion = true; // mark as set + } + + /** + * Class of the message. Possible values: * **Device** * **Event** * **Service** + * + * @param messageClass Class of the message. Possible values: * **Device** * **Event** * + * **Service** + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader messageClass(MessageClassType messageClass) { + this.messageClass = messageClass; + isSetMessageClass = true; // mark as set + return this; + } + + /** + * Class of the message. Possible values: * **Device** * **Event** * **Service** + * + * @return messageClass Class of the message. Possible values: * **Device** * **Event** * + * **Service** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageClassType getMessageClass() { + return messageClass; + } + + /** + * Class of the message. Possible values: * **Device** * **Event** * **Service** + * + * @param messageClass Class of the message. Possible values: * **Device** * **Event** * + * **Service** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageClass(MessageClassType messageClass) { + this.messageClass = messageClass; + isSetMessageClass = true; // mark as set + } + + /** + * Category of message. Possible values: * **Abort** * **Admin** * **BalanceInquiry** * **Batch** + * * **CardAcquisition** * **CardReaderInit** * **CardReaderPowerOff** * **Diagnosis** * + * **Display** * **EnableService** * **Event** * **GetTotals** * **Input** * **InputUpdate** * + * **Login** * **Logout** * **Loyalty** * **None** * **PIN** * **Payment** * **Print** * + * **Reconciliation** * **Reversal** * **Sound** * **StoredValue** * **TransactionStatus** * + * **Transmit** + * + * @param messageCategory Category of message. Possible values: * **Abort** * **Admin** * + * **BalanceInquiry** * **Batch** * **CardAcquisition** * **CardReaderInit** * + * **CardReaderPowerOff** * **Diagnosis** * **Display** * **EnableService** * **Event** * + * **GetTotals** * **Input** * **InputUpdate** * **Login** * **Logout** * **Loyalty** * + * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * **Reversal** * + * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader messageCategory(MessageCategoryType messageCategory) { + this.messageCategory = messageCategory; + isSetMessageCategory = true; // mark as set + return this; + } + + /** + * Category of message. Possible values: * **Abort** * **Admin** * **BalanceInquiry** * **Batch** + * * **CardAcquisition** * **CardReaderInit** * **CardReaderPowerOff** * **Diagnosis** * + * **Display** * **EnableService** * **Event** * **GetTotals** * **Input** * **InputUpdate** * + * **Login** * **Logout** * **Loyalty** * **None** * **PIN** * **Payment** * **Print** * + * **Reconciliation** * **Reversal** * **Sound** * **StoredValue** * **TransactionStatus** * + * **Transmit** + * + * @return messageCategory Category of message. Possible values: * **Abort** * **Admin** * + * **BalanceInquiry** * **Batch** * **CardAcquisition** * **CardReaderInit** * + * **CardReaderPowerOff** * **Diagnosis** * **Display** * **EnableService** * **Event** * + * **GetTotals** * **Input** * **InputUpdate** * **Login** * **Logout** * **Loyalty** * + * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * **Reversal** * + * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageCategoryType getMessageCategory() { + return messageCategory; + } + + /** + * Category of message. Possible values: * **Abort** * **Admin** * **BalanceInquiry** * **Batch** + * * **CardAcquisition** * **CardReaderInit** * **CardReaderPowerOff** * **Diagnosis** * + * **Display** * **EnableService** * **Event** * **GetTotals** * **Input** * **InputUpdate** * + * **Login** * **Logout** * **Loyalty** * **None** * **PIN** * **Payment** * **Print** * + * **Reconciliation** * **Reversal** * **Sound** * **StoredValue** * **TransactionStatus** * + * **Transmit** + * + * @param messageCategory Category of message. Possible values: * **Abort** * **Admin** * + * **BalanceInquiry** * **Batch** * **CardAcquisition** * **CardReaderInit** * + * **CardReaderPowerOff** * **Diagnosis** * **Display** * **EnableService** * **Event** * + * **GetTotals** * **Input** * **InputUpdate** * **Login** * **Logout** * **Loyalty** * + * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * **Reversal** * + * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageCategory(MessageCategoryType messageCategory) { + this.messageCategory = messageCategory; + isSetMessageCategory = true; // mark as set + } + + /** + * Type of message of the Sale to POI protocol. Possible values: * **Notification** * **Request** + * * **Response** + * + * @param messageType Type of message of the Sale to POI protocol. Possible values: * + * **Notification** * **Request** * **Response** + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader messageType(MessageType messageType) { + this.messageType = messageType; + isSetMessageType = true; // mark as set + return this; + } + + /** + * Type of message of the Sale to POI protocol. Possible values: * **Notification** * **Request** + * * **Response** + * + * @return messageType Type of message of the Sale to POI protocol. Possible values: * + * **Notification** * **Request** * **Response** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageType getMessageType() { + return messageType; + } + + /** + * Type of message of the Sale to POI protocol. Possible values: * **Notification** * **Request** + * * **Response** + * + * @param messageType Type of message of the Sale to POI protocol. Possible values: * + * **Notification** * **Request** * **Response** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageType(MessageType messageType) { + this.messageType = messageType; + isSetMessageType = true; // mark as set + } + + /** + * Identification of a message pair, which processes a transaction. Required if Service or Event + * MessageClass message or if Device MessageClass and request from POI or response from Sale. + * + * @param serviceID Identification of a message pair, which processes a transaction. Required if + * Service or Event MessageClass message or if Device MessageClass and request from POI or + * response from Sale. + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader serviceID(String serviceID) { + this.serviceID = serviceID; + isSetServiceID = true; // mark as set + return this; + } + + /** + * Identification of a message pair, which processes a transaction. Required if Service or Event + * MessageClass message or if Device MessageClass and request from POI or response from Sale. + * + * @return serviceID Identification of a message pair, which processes a transaction. Required if + * Service or Event MessageClass message or if Device MessageClass and request from POI or + * response from Sale. + */ + @JsonProperty(JSON_PROPERTY_SERVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceID() { + return serviceID; + } + + /** + * Identification of a message pair, which processes a transaction. Required if Service or Event + * MessageClass message or if Device MessageClass and request from POI or response from Sale. + * + * @param serviceID Identification of a message pair, which processes a transaction. Required if + * Service or Event MessageClass message or if Device MessageClass and request from POI or + * response from Sale. + */ + @JsonProperty(JSON_PROPERTY_SERVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceID(String serviceID) { + this.serviceID = serviceID; + isSetServiceID = true; // mark as set + } + + /** + * Identification of a device message pair. If Device MessageClass. + * + * @param deviceID Identification of a device message pair. If Device MessageClass. + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader deviceID(String deviceID) { + this.deviceID = deviceID; + isSetDeviceID = true; // mark as set + return this; + } + + /** + * Identification of a device message pair. If Device MessageClass. + * + * @return deviceID Identification of a device message pair. If Device MessageClass. + */ + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceID() { + return deviceID; + } + + /** + * Identification of a device message pair. If Device MessageClass. + * + * @param deviceID Identification of a device message pair. If Device MessageClass. + */ + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + isSetDeviceID = true; // mark as set + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader saleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + return this; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * + * @return saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleID() { + return saleID; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * @return the current {@code MessageHeader} instance, allowing for method chaining + */ + public MessageHeader POIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + return this; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * + * @return POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPOIID() { + return POIID; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPOIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MessageHeader includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MessageHeader object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageHeader messageHeader = (MessageHeader) o; + return Objects.equals(this.protocolVersion, messageHeader.protocolVersion) + && Objects.equals(this.isSetProtocolVersion, messageHeader.isSetProtocolVersion) + && Objects.equals(this.messageClass, messageHeader.messageClass) + && Objects.equals(this.isSetMessageClass, messageHeader.isSetMessageClass) + && Objects.equals(this.messageCategory, messageHeader.messageCategory) + && Objects.equals(this.isSetMessageCategory, messageHeader.isSetMessageCategory) + && Objects.equals(this.messageType, messageHeader.messageType) + && Objects.equals(this.isSetMessageType, messageHeader.isSetMessageType) + && Objects.equals(this.serviceID, messageHeader.serviceID) + && Objects.equals(this.isSetServiceID, messageHeader.isSetServiceID) + && Objects.equals(this.deviceID, messageHeader.deviceID) + && Objects.equals(this.isSetDeviceID, messageHeader.isSetDeviceID) + && Objects.equals(this.saleID, messageHeader.saleID) + && Objects.equals(this.isSetSaleID, messageHeader.isSetSaleID) + && Objects.equals(this.POIID, messageHeader.POIID) + && Objects.equals(this.isSetPOIID, messageHeader.isSetPOIID); + } + + @Override + public int hashCode() { + return Objects.hash( + protocolVersion, + isSetProtocolVersion, + messageClass, + isSetMessageClass, + messageCategory, + isSetMessageCategory, + messageType, + isSetMessageType, + serviceID, + isSetServiceID, + deviceID, + isSetDeviceID, + saleID, + isSetSaleID, + POIID, + isSetPOIID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageHeader {\n"); + sb.append(" protocolVersion: ").append(toIndentedString(protocolVersion)).append("\n"); + sb.append(" messageClass: ").append(toIndentedString(messageClass)).append("\n"); + sb.append(" messageCategory: ").append(toIndentedString(messageCategory)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" serviceID: ").append(toIndentedString(serviceID)).append("\n"); + sb.append(" deviceID: ").append(toIndentedString(deviceID)).append("\n"); + sb.append(" saleID: ").append(toIndentedString(saleID)).append("\n"); + sb.append(" POIID: ").append(toIndentedString(POIID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetProtocolVersion) { + addIfNull(nulls, JSON_PROPERTY_PROTOCOL_VERSION, this.protocolVersion); + } + if (isSetMessageClass) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_CLASS, this.messageClass); + } + if (isSetMessageCategory) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_CATEGORY, this.messageCategory); + } + if (isSetMessageType) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_TYPE, this.messageType); + } + if (isSetServiceID) { + addIfNull(nulls, JSON_PROPERTY_SERVICE_I_D, this.serviceID); + } + if (isSetDeviceID) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_I_D, this.deviceID); + } + if (isSetSaleID) { + addIfNull(nulls, JSON_PROPERTY_SALE_I_D, this.saleID); + } + if (isSetPOIID) { + addIfNull(nulls, JSON_PROPERTY_P_O_I_I_D, this.POIID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MessageHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of MessageHeader + * @throws JsonProcessingException if the JSON string is invalid with respect to MessageHeader + */ + public static MessageHeader fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MessageHeader.class); + } + + /** + * Convert an instance of MessageHeader to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MessageReference.java b/src/main/java/com/adyen/model/tapi/MessageReference.java new file mode 100644 index 000000000..302b79b55 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MessageReference.java @@ -0,0 +1,428 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Identification of a previous POI transaction. To abort a transaction in progress or to request + * the status of a transaction from which no response has been received. It identifies the message + * header of the message request to abort or request the status. + */ +@JsonPropertyOrder({ + MessageReference.JSON_PROPERTY_MESSAGE_CATEGORY, + MessageReference.JSON_PROPERTY_SERVICE_I_D, + MessageReference.JSON_PROPERTY_DEVICE_I_D, + MessageReference.JSON_PROPERTY_SALE_I_D, + MessageReference.JSON_PROPERTY_P_O_I_I_D +}) +public class MessageReference { + public static final String JSON_PROPERTY_MESSAGE_CATEGORY = "MessageCategory"; + private MessageCategoryType messageCategory; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageCategory = false; + + public static final String JSON_PROPERTY_SERVICE_I_D = "ServiceID"; + private String serviceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetServiceID = false; + + public static final String JSON_PROPERTY_DEVICE_I_D = "DeviceID"; + private String deviceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceID = false; + + public static final String JSON_PROPERTY_SALE_I_D = "SaleID"; + private String saleID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleID = false; + + public static final String JSON_PROPERTY_P_O_I_I_D = "POIID"; + private String POIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPOIID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MessageReference() {} + + /** + * Category of message. CardAcquisition, Display, Input, Loyalty, Payment, Print, CardReaderInit, + * CardReaderPowerOff. Possible values: * **Abort** * **Admin** * **BalanceInquiry** * **Batch** * + * **CardAcquisition** * **CardReaderInit** * **CardReaderPowerOff** * **Diagnosis** * **Display** + * * **EnableService** * **Event** * **GetTotals** * **Input** * **InputUpdate** * **Login** * + * **Logout** * **Loyalty** * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * + * **Reversal** * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + * + * @param messageCategory Category of message. CardAcquisition, Display, Input, Loyalty, Payment, + * Print, CardReaderInit, CardReaderPowerOff. Possible values: * **Abort** * **Admin** * + * **BalanceInquiry** * **Batch** * **CardAcquisition** * **CardReaderInit** * + * **CardReaderPowerOff** * **Diagnosis** * **Display** * **EnableService** * **Event** * + * **GetTotals** * **Input** * **InputUpdate** * **Login** * **Logout** * **Loyalty** * + * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * **Reversal** * + * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + * @return the current {@code MessageReference} instance, allowing for method chaining + */ + public MessageReference messageCategory(MessageCategoryType messageCategory) { + this.messageCategory = messageCategory; + isSetMessageCategory = true; // mark as set + return this; + } + + /** + * Category of message. CardAcquisition, Display, Input, Loyalty, Payment, Print, CardReaderInit, + * CardReaderPowerOff. Possible values: * **Abort** * **Admin** * **BalanceInquiry** * **Batch** * + * **CardAcquisition** * **CardReaderInit** * **CardReaderPowerOff** * **Diagnosis** * **Display** + * * **EnableService** * **Event** * **GetTotals** * **Input** * **InputUpdate** * **Login** * + * **Logout** * **Loyalty** * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * + * **Reversal** * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + * + * @return messageCategory Category of message. CardAcquisition, Display, Input, Loyalty, Payment, + * Print, CardReaderInit, CardReaderPowerOff. Possible values: * **Abort** * **Admin** * + * **BalanceInquiry** * **Batch** * **CardAcquisition** * **CardReaderInit** * + * **CardReaderPowerOff** * **Diagnosis** * **Display** * **EnableService** * **Event** * + * **GetTotals** * **Input** * **InputUpdate** * **Login** * **Logout** * **Loyalty** * + * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * **Reversal** * + * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageCategoryType getMessageCategory() { + return messageCategory; + } + + /** + * Category of message. CardAcquisition, Display, Input, Loyalty, Payment, Print, CardReaderInit, + * CardReaderPowerOff. Possible values: * **Abort** * **Admin** * **BalanceInquiry** * **Batch** * + * **CardAcquisition** * **CardReaderInit** * **CardReaderPowerOff** * **Diagnosis** * **Display** + * * **EnableService** * **Event** * **GetTotals** * **Input** * **InputUpdate** * **Login** * + * **Logout** * **Loyalty** * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * + * **Reversal** * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + * + * @param messageCategory Category of message. CardAcquisition, Display, Input, Loyalty, Payment, + * Print, CardReaderInit, CardReaderPowerOff. Possible values: * **Abort** * **Admin** * + * **BalanceInquiry** * **Batch** * **CardAcquisition** * **CardReaderInit** * + * **CardReaderPowerOff** * **Diagnosis** * **Display** * **EnableService** * **Event** * + * **GetTotals** * **Input** * **InputUpdate** * **Login** * **Logout** * **Loyalty** * + * **None** * **PIN** * **Payment** * **Print** * **Reconciliation** * **Reversal** * + * **Sound** * **StoredValue** * **TransactionStatus** * **Transmit** + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageCategory(MessageCategoryType messageCategory) { + this.messageCategory = messageCategory; + isSetMessageCategory = true; // mark as set + } + + /** + * Identification of a message pair, which processes a transaction. + * + * @param serviceID Identification of a message pair, which processes a transaction. + * @return the current {@code MessageReference} instance, allowing for method chaining + */ + public MessageReference serviceID(String serviceID) { + this.serviceID = serviceID; + isSetServiceID = true; // mark as set + return this; + } + + /** + * Identification of a message pair, which processes a transaction. + * + * @return serviceID Identification of a message pair, which processes a transaction. + */ + @JsonProperty(JSON_PROPERTY_SERVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceID() { + return serviceID; + } + + /** + * Identification of a message pair, which processes a transaction. + * + * @param serviceID Identification of a message pair, which processes a transaction. + */ + @JsonProperty(JSON_PROPERTY_SERVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceID(String serviceID) { + this.serviceID = serviceID; + isSetServiceID = true; // mark as set + } + + /** + * Identification of a device message pair. + * + * @param deviceID Identification of a device message pair. + * @return the current {@code MessageReference} instance, allowing for method chaining + */ + public MessageReference deviceID(String deviceID) { + this.deviceID = deviceID; + isSetDeviceID = true; // mark as set + return this; + } + + /** + * Identification of a device message pair. + * + * @return deviceID Identification of a device message pair. + */ + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeviceID() { + return deviceID; + } + + /** + * Identification of a device message pair. + * + * @param deviceID Identification of a device message pair. + */ + @JsonProperty(JSON_PROPERTY_DEVICE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + isSetDeviceID = true; // mark as set + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. default + * MessageHeader.SaleID. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * default MessageHeader.SaleID. + * @return the current {@code MessageReference} instance, allowing for method chaining + */ + public MessageReference saleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + return this; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. default + * MessageHeader.SaleID. + * + * @return saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * default MessageHeader.SaleID. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleID() { + return saleID; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. default + * MessageHeader.SaleID. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * default MessageHeader.SaleID. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. Default + * `MessageHeader.POIID`. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * Default `MessageHeader.POIID`. + * @return the current {@code MessageReference} instance, allowing for method chaining + */ + public MessageReference POIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + return this; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. Default + * `MessageHeader.POIID`. + * + * @return POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * Default `MessageHeader.POIID`. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPOIID() { + return POIID; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. Default + * `MessageHeader.POIID`. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * Default `MessageHeader.POIID`. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPOIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MessageReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MessageReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessageReference messageReference = (MessageReference) o; + return Objects.equals(this.messageCategory, messageReference.messageCategory) + && Objects.equals(this.isSetMessageCategory, messageReference.isSetMessageCategory) + && Objects.equals(this.serviceID, messageReference.serviceID) + && Objects.equals(this.isSetServiceID, messageReference.isSetServiceID) + && Objects.equals(this.deviceID, messageReference.deviceID) + && Objects.equals(this.isSetDeviceID, messageReference.isSetDeviceID) + && Objects.equals(this.saleID, messageReference.saleID) + && Objects.equals(this.isSetSaleID, messageReference.isSetSaleID) + && Objects.equals(this.POIID, messageReference.POIID) + && Objects.equals(this.isSetPOIID, messageReference.isSetPOIID); + } + + @Override + public int hashCode() { + return Objects.hash( + messageCategory, + isSetMessageCategory, + serviceID, + isSetServiceID, + deviceID, + isSetDeviceID, + saleID, + isSetSaleID, + POIID, + isSetPOIID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageReference {\n"); + sb.append(" messageCategory: ").append(toIndentedString(messageCategory)).append("\n"); + sb.append(" serviceID: ").append(toIndentedString(serviceID)).append("\n"); + sb.append(" deviceID: ").append(toIndentedString(deviceID)).append("\n"); + sb.append(" saleID: ").append(toIndentedString(saleID)).append("\n"); + sb.append(" POIID: ").append(toIndentedString(POIID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageCategory) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_CATEGORY, this.messageCategory); + } + if (isSetServiceID) { + addIfNull(nulls, JSON_PROPERTY_SERVICE_I_D, this.serviceID); + } + if (isSetDeviceID) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_I_D, this.deviceID); + } + if (isSetSaleID) { + addIfNull(nulls, JSON_PROPERTY_SALE_I_D, this.saleID); + } + if (isSetPOIID) { + addIfNull(nulls, JSON_PROPERTY_P_O_I_I_D, this.POIID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MessageReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of MessageReference + * @throws JsonProcessingException if the JSON string is invalid with respect to MessageReference + */ + public static MessageReference fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MessageReference.class); + } + + /** + * Convert an instance of MessageReference to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MessageType.java b/src/main/java/com/adyen/model/tapi/MessageType.java new file mode 100644 index 000000000..f6aab2916 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MessageType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets MessageType */ +public enum MessageType { + NOTIFICATION("Notification"), + + REQUEST("Request"), + + RESPONSE("Response"); + + private String value; + + MessageType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessageType fromValue(String value) { + for (MessageType b : MessageType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/MobileData.java b/src/main/java/com/adyen/model/tapi/MobileData.java new file mode 100644 index 000000000..8ef7129e2 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/MobileData.java @@ -0,0 +1,451 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Mobile phone is used as a payment instrument for the transaction. Information related to the + * mobile for the payment transaction. + */ +@JsonPropertyOrder({ + MobileData.JSON_PROPERTY_MOBILE_COUNTRY_CODE, + MobileData.JSON_PROPERTY_MOBILE_NETWORK_CODE, + MobileData.JSON_PROPERTY_MASKED_M_S_I_S_D_N, + MobileData.JSON_PROPERTY_GEOLOCATION, + MobileData.JSON_PROPERTY_PROTECTED_MOBILE_DATA, + MobileData.JSON_PROPERTY_SENSITIVE_MOBILE_DATA +}) +public class MobileData { + public static final String JSON_PROPERTY_MOBILE_COUNTRY_CODE = "MobileCountryCode"; + private Integer mobileCountryCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobileCountryCode = false; + + public static final String JSON_PROPERTY_MOBILE_NETWORK_CODE = "MobileNetworkCode"; + private Integer mobileNetworkCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobileNetworkCode = false; + + public static final String JSON_PROPERTY_MASKED_M_S_I_S_D_N = "MaskedMSISDN"; + private Integer maskedMSISDN; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskedMSISDN = false; + + public static final String JSON_PROPERTY_GEOLOCATION = "Geolocation"; + private Geolocation geolocation; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGeolocation = false; + + public static final String JSON_PROPERTY_PROTECTED_MOBILE_DATA = "ProtectedMobileData"; + private String protectedMobileData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProtectedMobileData = false; + + public static final String JSON_PROPERTY_SENSITIVE_MOBILE_DATA = "SensitiveMobileData"; + private SensitiveMobileData sensitiveMobileData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSensitiveMobileData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MobileData() {} + + /** + * Identifies the country of a mobile phone operator. If data available. + * + * @param mobileCountryCode Identifies the country of a mobile phone operator. If data available. + * @return the current {@code MobileData} instance, allowing for method chaining + */ + public MobileData mobileCountryCode(Integer mobileCountryCode) { + this.mobileCountryCode = mobileCountryCode; + isSetMobileCountryCode = true; // mark as set + return this; + } + + /** + * Identifies the country of a mobile phone operator. If data available. minimum: 3 maximum: 3 + * + * @return mobileCountryCode Identifies the country of a mobile phone operator. If data available. + */ + @JsonProperty(JSON_PROPERTY_MOBILE_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMobileCountryCode() { + return mobileCountryCode; + } + + /** + * Identifies the country of a mobile phone operator. If data available. + * + * @param mobileCountryCode Identifies the country of a mobile phone operator. If data available. + */ + @JsonProperty(JSON_PROPERTY_MOBILE_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMobileCountryCode(Integer mobileCountryCode) { + this.mobileCountryCode = mobileCountryCode; + isSetMobileCountryCode = true; // mark as set + } + + /** + * Identifies the mobile phone operator inside a country. If data available. + * + * @param mobileNetworkCode Identifies the mobile phone operator inside a country. If data + * available. + * @return the current {@code MobileData} instance, allowing for method chaining + */ + public MobileData mobileNetworkCode(Integer mobileNetworkCode) { + this.mobileNetworkCode = mobileNetworkCode; + isSetMobileNetworkCode = true; // mark as set + return this; + } + + /** + * Identifies the mobile phone operator inside a country. If data available. minimum: 2 maximum: 3 + * + * @return mobileNetworkCode Identifies the mobile phone operator inside a country. If data + * available. + */ + @JsonProperty(JSON_PROPERTY_MOBILE_NETWORK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMobileNetworkCode() { + return mobileNetworkCode; + } + + /** + * Identifies the mobile phone operator inside a country. If data available. + * + * @param mobileNetworkCode Identifies the mobile phone operator inside a country. If data + * available. + */ + @JsonProperty(JSON_PROPERTY_MOBILE_NETWORK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMobileNetworkCode(Integer mobileNetworkCode) { + this.mobileNetworkCode = mobileNetworkCode; + isSetMobileNetworkCode = true; // mark as set + } + + /** + * Masked Mobile Subscriber Integrated Service Digital Network. If data available. + * + * @param maskedMSISDN Masked Mobile Subscriber Integrated Service Digital Network. If data + * available. + * @return the current {@code MobileData} instance, allowing for method chaining + */ + public MobileData maskedMSISDN(Integer maskedMSISDN) { + this.maskedMSISDN = maskedMSISDN; + isSetMaskedMSISDN = true; // mark as set + return this; + } + + /** + * Masked Mobile Subscriber Integrated Service Digital Network. If data available. + * + * @return maskedMSISDN Masked Mobile Subscriber Integrated Service Digital Network. If data + * available. + */ + @JsonProperty(JSON_PROPERTY_MASKED_M_S_I_S_D_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaskedMSISDN() { + return maskedMSISDN; + } + + /** + * Masked Mobile Subscriber Integrated Service Digital Network. If data available. + * + * @param maskedMSISDN Masked Mobile Subscriber Integrated Service Digital Network. If data + * available. + */ + @JsonProperty(JSON_PROPERTY_MASKED_M_S_I_S_D_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaskedMSISDN(Integer maskedMSISDN) { + this.maskedMSISDN = maskedMSISDN; + isSetMaskedMSISDN = true; // mark as set + } + + /** + * Geographic location specified by geographic or UTM coordinates. If data available. + * + * @param geolocation Geographic location specified by geographic or UTM coordinates. If data + * available. + * @return the current {@code MobileData} instance, allowing for method chaining + */ + public MobileData geolocation(Geolocation geolocation) { + this.geolocation = geolocation; + isSetGeolocation = true; // mark as set + return this; + } + + /** + * Geographic location specified by geographic or UTM coordinates. If data available. + * + * @return geolocation Geographic location specified by geographic or UTM coordinates. If data + * available. + */ + @JsonProperty(JSON_PROPERTY_GEOLOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Geolocation getGeolocation() { + return geolocation; + } + + /** + * Geographic location specified by geographic or UTM coordinates. If data available. + * + * @param geolocation Geographic location specified by geographic or UTM coordinates. If data + * available. + */ + @JsonProperty(JSON_PROPERTY_GEOLOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGeolocation(Geolocation geolocation) { + this.geolocation = geolocation; + isSetGeolocation = true; // mark as set + } + + /** + * Sensitive information related to the mobile phone, protected by CMS. SensitiveMobileData. + * + * @param protectedMobileData Sensitive information related to the mobile phone, protected by CMS. + * SensitiveMobileData. + * @return the current {@code MobileData} instance, allowing for method chaining + */ + public MobileData protectedMobileData(String protectedMobileData) { + this.protectedMobileData = protectedMobileData; + isSetProtectedMobileData = true; // mark as set + return this; + } + + /** + * Sensitive information related to the mobile phone, protected by CMS. SensitiveMobileData. + * + * @return protectedMobileData Sensitive information related to the mobile phone, protected by + * CMS. SensitiveMobileData. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_MOBILE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtectedMobileData() { + return protectedMobileData; + } + + /** + * Sensitive information related to the mobile phone, protected by CMS. SensitiveMobileData. + * + * @param protectedMobileData Sensitive information related to the mobile phone, protected by CMS. + * SensitiveMobileData. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_MOBILE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtectedMobileData(String protectedMobileData) { + this.protectedMobileData = protectedMobileData; + isSetProtectedMobileData = true; // mark as set + } + + /** + * Sensitive information related to the mobile phone. If unprotected mobile data. + * + * @param sensitiveMobileData Sensitive information related to the mobile phone. If unprotected + * mobile data. + * @return the current {@code MobileData} instance, allowing for method chaining + */ + public MobileData sensitiveMobileData(SensitiveMobileData sensitiveMobileData) { + this.sensitiveMobileData = sensitiveMobileData; + isSetSensitiveMobileData = true; // mark as set + return this; + } + + /** + * Sensitive information related to the mobile phone. If unprotected mobile data. + * + * @return sensitiveMobileData Sensitive information related to the mobile phone. If unprotected + * mobile data. + */ + @JsonProperty(JSON_PROPERTY_SENSITIVE_MOBILE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SensitiveMobileData getSensitiveMobileData() { + return sensitiveMobileData; + } + + /** + * Sensitive information related to the mobile phone. If unprotected mobile data. + * + * @param sensitiveMobileData Sensitive information related to the mobile phone. If unprotected + * mobile data. + */ + @JsonProperty(JSON_PROPERTY_SENSITIVE_MOBILE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSensitiveMobileData(SensitiveMobileData sensitiveMobileData) { + this.sensitiveMobileData = sensitiveMobileData; + isSetSensitiveMobileData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MobileData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MobileData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MobileData mobileData = (MobileData) o; + return Objects.equals(this.mobileCountryCode, mobileData.mobileCountryCode) + && Objects.equals(this.isSetMobileCountryCode, mobileData.isSetMobileCountryCode) + && Objects.equals(this.mobileNetworkCode, mobileData.mobileNetworkCode) + && Objects.equals(this.isSetMobileNetworkCode, mobileData.isSetMobileNetworkCode) + && Objects.equals(this.maskedMSISDN, mobileData.maskedMSISDN) + && Objects.equals(this.isSetMaskedMSISDN, mobileData.isSetMaskedMSISDN) + && Objects.equals(this.geolocation, mobileData.geolocation) + && Objects.equals(this.isSetGeolocation, mobileData.isSetGeolocation) + && Objects.equals(this.protectedMobileData, mobileData.protectedMobileData) + && Objects.equals(this.isSetProtectedMobileData, mobileData.isSetProtectedMobileData) + && Objects.equals(this.sensitiveMobileData, mobileData.sensitiveMobileData) + && Objects.equals(this.isSetSensitiveMobileData, mobileData.isSetSensitiveMobileData); + } + + @Override + public int hashCode() { + return Objects.hash( + mobileCountryCode, + isSetMobileCountryCode, + mobileNetworkCode, + isSetMobileNetworkCode, + maskedMSISDN, + isSetMaskedMSISDN, + geolocation, + isSetGeolocation, + protectedMobileData, + isSetProtectedMobileData, + sensitiveMobileData, + isSetSensitiveMobileData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MobileData {\n"); + sb.append(" mobileCountryCode: ").append(toIndentedString(mobileCountryCode)).append("\n"); + sb.append(" mobileNetworkCode: ").append(toIndentedString(mobileNetworkCode)).append("\n"); + sb.append(" maskedMSISDN: ").append(toIndentedString(maskedMSISDN)).append("\n"); + sb.append(" geolocation: ").append(toIndentedString(geolocation)).append("\n"); + sb.append(" protectedMobileData: ") + .append(toIndentedString(protectedMobileData)) + .append("\n"); + sb.append(" sensitiveMobileData: ") + .append(toIndentedString(sensitiveMobileData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMobileCountryCode) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_COUNTRY_CODE, this.mobileCountryCode); + } + if (isSetMobileNetworkCode) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_NETWORK_CODE, this.mobileNetworkCode); + } + if (isSetMaskedMSISDN) { + addIfNull(nulls, JSON_PROPERTY_MASKED_M_S_I_S_D_N, this.maskedMSISDN); + } + if (isSetGeolocation) { + addIfNull(nulls, JSON_PROPERTY_GEOLOCATION, this.geolocation); + } + if (isSetProtectedMobileData) { + addIfNull(nulls, JSON_PROPERTY_PROTECTED_MOBILE_DATA, this.protectedMobileData); + } + if (isSetSensitiveMobileData) { + addIfNull(nulls, JSON_PROPERTY_SENSITIVE_MOBILE_DATA, this.sensitiveMobileData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MobileData given an JSON string + * + * @param jsonString JSON string + * @return An instance of MobileData + * @throws JsonProcessingException if the JSON string is invalid with respect to MobileData + */ + public static MobileData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MobileData.class); + } + + /** + * Convert an instance of MobileData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/OriginalPOITransaction.java b/src/main/java/com/adyen/model/tapi/OriginalPOITransaction.java new file mode 100644 index 000000000..7a8c99bed --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/OriginalPOITransaction.java @@ -0,0 +1,557 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** + * Identification of a previous POI transaction. In the Payment Request message, it allows using the + * card of a previous CardAcquisition or Payment request. + */ +@JsonPropertyOrder({ + OriginalPOITransaction.JSON_PROPERTY_SALE_I_D, + OriginalPOITransaction.JSON_PROPERTY_P_O_I_I_D, + OriginalPOITransaction.JSON_PROPERTY_PO_I_TRANSACTION_I_D, + OriginalPOITransaction.JSON_PROPERTY_REUSE_CARD_DATA_FLAG, + OriginalPOITransaction.JSON_PROPERTY_APPROVAL_CODE, + OriginalPOITransaction.JSON_PROPERTY_ACQUIRER_I_D, + OriginalPOITransaction.JSON_PROPERTY_AMOUNT_VALUE, + OriginalPOITransaction.JSON_PROPERTY_HOST_TRANSACTION_I_D +}) +public class OriginalPOITransaction { + public static final String JSON_PROPERTY_SALE_I_D = "SaleID"; + private String saleID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleID = false; + + public static final String JSON_PROPERTY_P_O_I_I_D = "POIID"; + private String POIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPOIID = false; + + public static final String JSON_PROPERTY_PO_I_TRANSACTION_I_D = "POITransactionID"; + private TransactionIdentification poITransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoITransactionID = false; + + public static final String JSON_PROPERTY_REUSE_CARD_DATA_FLAG = "ReuseCardDataFlag"; + private Boolean reuseCardDataFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReuseCardDataFlag = false; + + public static final String JSON_PROPERTY_APPROVAL_CODE = "ApprovalCode"; + private String approvalCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApprovalCode = false; + + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private Integer acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + public static final String JSON_PROPERTY_AMOUNT_VALUE = "AmountValue"; + private BigDecimal amountValue; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountValue = false; + + public static final String JSON_PROPERTY_HOST_TRANSACTION_I_D = "HostTransactionID"; + private TransactionIdentification hostTransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostTransactionID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OriginalPOITransaction() {} + + /** + * Identification of a Sale System for the NEXO SaletoPOI protocol. + * + * @param saleID Identification of a Sale System for the NEXO SaletoPOI protocol. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction saleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + return this; + } + + /** + * Identification of a Sale System for the NEXO SaletoPOI protocol. + * + * @return saleID Identification of a Sale System for the NEXO SaletoPOI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleID() { + return saleID; + } + + /** + * Identification of a Sale System for the NEXO SaletoPOI protocol. + * + * @param saleID Identification of a Sale System for the NEXO SaletoPOI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + } + + /** + * Identification of a payment terminal for the NEXO SaletoPOI protocol. If original transaction + * is coming from another POI. + * + * @param POIID Identification of a payment terminal for the NEXO SaletoPOI protocol. If original + * transaction is coming from another POI. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction POIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + return this; + } + + /** + * Identification of a payment terminal for the NEXO SaletoPOI protocol. If original transaction + * is coming from another POI. + * + * @return POIID Identification of a payment terminal for the NEXO SaletoPOI protocol. If original + * transaction is coming from another POI. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPOIID() { + return POIID; + } + + /** + * Identification of a payment terminal for the NEXO SaletoPOI protocol. If original transaction + * is coming from another POI. + * + * @param POIID Identification of a payment terminal for the NEXO SaletoPOI protocol. If original + * transaction is coming from another POI. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPOIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + } + + /** + * Unique identification of a POI transaction for a POI. Absent if SaleReferenceID is sufficient + * to identify the transaction. + * + * @param poITransactionID Unique identification of a POI transaction for a POI. Absent if + * SaleReferenceID is sufficient to identify the transaction. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction poITransactionID(TransactionIdentification poITransactionID) { + this.poITransactionID = poITransactionID; + isSetPoITransactionID = true; // mark as set + return this; + } + + /** + * Unique identification of a POI transaction for a POI. Absent if SaleReferenceID is sufficient + * to identify the transaction. + * + * @return poITransactionID Unique identification of a POI transaction for a POI. Absent if + * SaleReferenceID is sufficient to identify the transaction. + */ + @JsonProperty(JSON_PROPERTY_PO_I_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getPoITransactionID() { + return poITransactionID; + } + + /** + * Unique identification of a POI transaction for a POI. Absent if SaleReferenceID is sufficient + * to identify the transaction. + * + * @param poITransactionID Unique identification of a POI transaction for a POI. Absent if + * SaleReferenceID is sufficient to identify the transaction. + */ + @JsonProperty(JSON_PROPERTY_PO_I_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoITransactionID(TransactionIdentification poITransactionID) { + this.poITransactionID = poITransactionID; + isSetPoITransactionID = true; // mark as set + } + + /** + * Indicates if the card data has to be retrieved from a previous transaction. + * + * @param reuseCardDataFlag Indicates if the card data has to be retrieved from a previous + * transaction. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction reuseCardDataFlag(Boolean reuseCardDataFlag) { + this.reuseCardDataFlag = reuseCardDataFlag; + isSetReuseCardDataFlag = true; // mark as set + return this; + } + + /** + * Indicates if the card data has to be retrieved from a previous transaction. + * + * @return reuseCardDataFlag Indicates if the card data has to be retrieved from a previous + * transaction. + */ + @JsonProperty(JSON_PROPERTY_REUSE_CARD_DATA_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getReuseCardDataFlag() { + return reuseCardDataFlag; + } + + /** + * Indicates if the card data has to be retrieved from a previous transaction. + * + * @param reuseCardDataFlag Indicates if the card data has to be retrieved from a previous + * transaction. + */ + @JsonProperty(JSON_PROPERTY_REUSE_CARD_DATA_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReuseCardDataFlag(Boolean reuseCardDataFlag) { + this.reuseCardDataFlag = reuseCardDataFlag; + isSetReuseCardDataFlag = true; // mark as set + } + + /** + * Code assigned to a transaction approval by the Acquirer. If referral. + * + * @param approvalCode Code assigned to a transaction approval by the Acquirer. If referral. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction approvalCode(String approvalCode) { + this.approvalCode = approvalCode; + isSetApprovalCode = true; // mark as set + return this; + } + + /** + * Code assigned to a transaction approval by the Acquirer. If referral. + * + * @return approvalCode Code assigned to a transaction approval by the Acquirer. If referral. + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApprovalCode() { + return approvalCode; + } + + /** + * Code assigned to a transaction approval by the Acquirer. If referral. + * + * @param approvalCode Code assigned to a transaction approval by the Acquirer. If referral. + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApprovalCode(String approvalCode) { + this.approvalCode = approvalCode; + isSetApprovalCode = true; // mark as set + } + + /** + * Identification of the Acquirer. Restrict to the Acquirer if present. + * + * @param acquirerID Identification of the Acquirer. Restrict to the Acquirer if present. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction acquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + /** + * Identification of the Acquirer. Restrict to the Acquirer if present. + * + * @return acquirerID Identification of the Acquirer. Restrict to the Acquirer if present. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. Restrict to the Acquirer if present. + * + * @param acquirerID Identification of the Acquirer. Restrict to the Acquirer if present. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * Value of an amount. + * + * @param amountValue Value of an amount. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction amountValue(BigDecimal amountValue) { + this.amountValue = amountValue; + isSetAmountValue = true; // mark as set + return this; + } + + /** + * Value of an amount. minimum: 0.0 maximum: 99999999.999999 + * + * @return amountValue Value of an amount. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAmountValue() { + return amountValue; + } + + /** + * Value of an amount. + * + * @param amountValue Value of an amount. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmountValue(BigDecimal amountValue) { + this.amountValue = amountValue; + isSetAmountValue = true; // mark as set + } + + /** + * Identification of the transaction by the host in charge of the stored value transaction. If + * POITransactionID not present. + * + * @param hostTransactionID Identification of the transaction by the host in charge of the stored + * value transaction. If POITransactionID not present. + * @return the current {@code OriginalPOITransaction} instance, allowing for method chaining + */ + public OriginalPOITransaction hostTransactionID(TransactionIdentification hostTransactionID) { + this.hostTransactionID = hostTransactionID; + isSetHostTransactionID = true; // mark as set + return this; + } + + /** + * Identification of the transaction by the host in charge of the stored value transaction. If + * POITransactionID not present. + * + * @return hostTransactionID Identification of the transaction by the host in charge of the stored + * value transaction. If POITransactionID not present. + */ + @JsonProperty(JSON_PROPERTY_HOST_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getHostTransactionID() { + return hostTransactionID; + } + + /** + * Identification of the transaction by the host in charge of the stored value transaction. If + * POITransactionID not present. + * + * @param hostTransactionID Identification of the transaction by the host in charge of the stored + * value transaction. If POITransactionID not present. + */ + @JsonProperty(JSON_PROPERTY_HOST_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostTransactionID(TransactionIdentification hostTransactionID) { + this.hostTransactionID = hostTransactionID; + isSetHostTransactionID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OriginalPOITransaction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this OriginalPOITransaction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OriginalPOITransaction originalPOITransaction = (OriginalPOITransaction) o; + return Objects.equals(this.saleID, originalPOITransaction.saleID) + && Objects.equals(this.isSetSaleID, originalPOITransaction.isSetSaleID) + && Objects.equals(this.POIID, originalPOITransaction.POIID) + && Objects.equals(this.isSetPOIID, originalPOITransaction.isSetPOIID) + && Objects.equals(this.poITransactionID, originalPOITransaction.poITransactionID) + && Objects.equals(this.isSetPoITransactionID, originalPOITransaction.isSetPoITransactionID) + && Objects.equals(this.reuseCardDataFlag, originalPOITransaction.reuseCardDataFlag) + && Objects.equals( + this.isSetReuseCardDataFlag, originalPOITransaction.isSetReuseCardDataFlag) + && Objects.equals(this.approvalCode, originalPOITransaction.approvalCode) + && Objects.equals(this.isSetApprovalCode, originalPOITransaction.isSetApprovalCode) + && Objects.equals(this.acquirerID, originalPOITransaction.acquirerID) + && Objects.equals(this.isSetAcquirerID, originalPOITransaction.isSetAcquirerID) + && Objects.equals(this.amountValue, originalPOITransaction.amountValue) + && Objects.equals(this.isSetAmountValue, originalPOITransaction.isSetAmountValue) + && Objects.equals(this.hostTransactionID, originalPOITransaction.hostTransactionID) + && Objects.equals( + this.isSetHostTransactionID, originalPOITransaction.isSetHostTransactionID); + } + + @Override + public int hashCode() { + return Objects.hash( + saleID, + isSetSaleID, + POIID, + isSetPOIID, + poITransactionID, + isSetPoITransactionID, + reuseCardDataFlag, + isSetReuseCardDataFlag, + approvalCode, + isSetApprovalCode, + acquirerID, + isSetAcquirerID, + amountValue, + isSetAmountValue, + hostTransactionID, + isSetHostTransactionID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OriginalPOITransaction {\n"); + sb.append(" saleID: ").append(toIndentedString(saleID)).append("\n"); + sb.append(" POIID: ").append(toIndentedString(POIID)).append("\n"); + sb.append(" poITransactionID: ").append(toIndentedString(poITransactionID)).append("\n"); + sb.append(" reuseCardDataFlag: ").append(toIndentedString(reuseCardDataFlag)).append("\n"); + sb.append(" approvalCode: ").append(toIndentedString(approvalCode)).append("\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append(" amountValue: ").append(toIndentedString(amountValue)).append("\n"); + sb.append(" hostTransactionID: ").append(toIndentedString(hostTransactionID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleID) { + addIfNull(nulls, JSON_PROPERTY_SALE_I_D, this.saleID); + } + if (isSetPOIID) { + addIfNull(nulls, JSON_PROPERTY_P_O_I_I_D, this.POIID); + } + if (isSetPoITransactionID) { + addIfNull(nulls, JSON_PROPERTY_PO_I_TRANSACTION_I_D, this.poITransactionID); + } + if (isSetReuseCardDataFlag) { + addIfNull(nulls, JSON_PROPERTY_REUSE_CARD_DATA_FLAG, this.reuseCardDataFlag); + } + if (isSetApprovalCode) { + addIfNull(nulls, JSON_PROPERTY_APPROVAL_CODE, this.approvalCode); + } + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + if (isSetAmountValue) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_VALUE, this.amountValue); + } + if (isSetHostTransactionID) { + addIfNull(nulls, JSON_PROPERTY_HOST_TRANSACTION_I_D, this.hostTransactionID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of OriginalPOITransaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of OriginalPOITransaction + * @throws JsonProcessingException if the JSON string is invalid with respect to + * OriginalPOITransaction + */ + public static OriginalPOITransaction fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OriginalPOITransaction.class); + } + + /** + * Convert an instance of OriginalPOITransaction to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/OutputBarcode.java b/src/main/java/com/adyen/model/tapi/OutputBarcode.java new file mode 100644 index 000000000..9edb2f83a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/OutputBarcode.java @@ -0,0 +1,175 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** OutputBarcode */ +@JsonPropertyOrder({OutputBarcode.JSON_PROPERTY_BARCODE_VALUE}) +public class OutputBarcode { + public static final String JSON_PROPERTY_BARCODE_VALUE = "BarcodeValue"; + private String barcodeValue; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBarcodeValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OutputBarcode() {} + + /** + * Value with a Barcode coding. The barcode value to display or print. + * + * @param barcodeValue Value with a Barcode coding. The barcode value to display or print. + * @return the current {@code OutputBarcode} instance, allowing for method chaining + */ + public OutputBarcode barcodeValue(String barcodeValue) { + this.barcodeValue = barcodeValue; + isSetBarcodeValue = true; // mark as set + return this; + } + + /** + * Value with a Barcode coding. The barcode value to display or print. + * + * @return barcodeValue Value with a Barcode coding. The barcode value to display or print. + */ + @JsonProperty(JSON_PROPERTY_BARCODE_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBarcodeValue() { + return barcodeValue; + } + + /** + * Value with a Barcode coding. The barcode value to display or print. + * + * @param barcodeValue Value with a Barcode coding. The barcode value to display or print. + */ + @JsonProperty(JSON_PROPERTY_BARCODE_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBarcodeValue(String barcodeValue) { + this.barcodeValue = barcodeValue; + isSetBarcodeValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OutputBarcode includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this OutputBarcode object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutputBarcode outputBarcode = (OutputBarcode) o; + return Objects.equals(this.barcodeValue, outputBarcode.barcodeValue) + && Objects.equals(this.isSetBarcodeValue, outputBarcode.isSetBarcodeValue); + } + + @Override + public int hashCode() { + return Objects.hash(barcodeValue, isSetBarcodeValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutputBarcode {\n"); + sb.append(" barcodeValue: ").append(toIndentedString(barcodeValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBarcodeValue) { + addIfNull(nulls, JSON_PROPERTY_BARCODE_VALUE, this.barcodeValue); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of OutputBarcode given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutputBarcode + * @throws JsonProcessingException if the JSON string is invalid with respect to OutputBarcode + */ + public static OutputBarcode fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OutputBarcode.class); + } + + /** + * Convert an instance of OutputBarcode to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/OutputContent.java b/src/main/java/com/adyen/model/tapi/OutputContent.java new file mode 100644 index 000000000..6c6854d32 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/OutputContent.java @@ -0,0 +1,423 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** Content to display or print. This is a sequence of elements if they have different formats. */ +@JsonPropertyOrder({ + OutputContent.JSON_PROPERTY_OUTPUT_FORMAT, + OutputContent.JSON_PROPERTY_PREDEFINED_CONTENT, + OutputContent.JSON_PROPERTY_OUTPUT_TEXT, + OutputContent.JSON_PROPERTY_OUTPUT_X_H_T_M_L, + OutputContent.JSON_PROPERTY_OUTPUT_BARCODE +}) +public class OutputContent { + public static final String JSON_PROPERTY_OUTPUT_FORMAT = "OutputFormat"; + private OutputFormatType outputFormat; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputFormat = false; + + public static final String JSON_PROPERTY_PREDEFINED_CONTENT = "PredefinedContent"; + private PredefinedContent predefinedContent; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPredefinedContent = false; + + public static final String JSON_PROPERTY_OUTPUT_TEXT = "OutputText"; + private List outputText; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputText = false; + + public static final String JSON_PROPERTY_OUTPUT_X_H_T_M_L = "OutputXHTML"; + private byte[] outputXHTML; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputXHTML = false; + + public static final String JSON_PROPERTY_OUTPUT_BARCODE = "OutputBarcode"; + private OutputBarcode outputBarcode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputBarcode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OutputContent() {} + + /** + * Format of the content to display or print. Possible values: * **BarCode** * **MessageRef** * + * **Text** * **XHTML** + * + * @param outputFormat Format of the content to display or print. Possible values: * **BarCode** * + * **MessageRef** * **Text** * **XHTML** + * @return the current {@code OutputContent} instance, allowing for method chaining + */ + public OutputContent outputFormat(OutputFormatType outputFormat) { + this.outputFormat = outputFormat; + isSetOutputFormat = true; // mark as set + return this; + } + + /** + * Format of the content to display or print. Possible values: * **BarCode** * **MessageRef** * + * **Text** * **XHTML** + * + * @return outputFormat Format of the content to display or print. Possible values: * **BarCode** + * * **MessageRef** * **Text** * **XHTML** + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputFormatType getOutputFormat() { + return outputFormat; + } + + /** + * Format of the content to display or print. Possible values: * **BarCode** * **MessageRef** * + * **Text** * **XHTML** + * + * @param outputFormat Format of the content to display or print. Possible values: * **BarCode** * + * **MessageRef** * **Text** * **XHTML** + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputFormat(OutputFormatType outputFormat) { + this.outputFormat = outputFormat; + isSetOutputFormat = true; // mark as set + } + + /** + * Reference of a predefined message to display or print. Mandatory, if `OutputFormat` + * is MessageRef, not allowed otherwise. + * + * @param predefinedContent Reference of a predefined message to display or print. Mandatory, if + * `OutputFormat` is MessageRef, not allowed otherwise. + * @return the current {@code OutputContent} instance, allowing for method chaining + */ + public OutputContent predefinedContent(PredefinedContent predefinedContent) { + this.predefinedContent = predefinedContent; + isSetPredefinedContent = true; // mark as set + return this; + } + + /** + * Reference of a predefined message to display or print. Mandatory, if `OutputFormat` + * is MessageRef, not allowed otherwise. + * + * @return predefinedContent Reference of a predefined message to display or print. Mandatory, if + * `OutputFormat` is MessageRef, not allowed otherwise. + */ + @JsonProperty(JSON_PROPERTY_PREDEFINED_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PredefinedContent getPredefinedContent() { + return predefinedContent; + } + + /** + * Reference of a predefined message to display or print. Mandatory, if `OutputFormat` + * is MessageRef, not allowed otherwise. + * + * @param predefinedContent Reference of a predefined message to display or print. Mandatory, if + * `OutputFormat` is MessageRef, not allowed otherwise. + */ + @JsonProperty(JSON_PROPERTY_PREDEFINED_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPredefinedContent(PredefinedContent predefinedContent) { + this.predefinedContent = predefinedContent; + isSetPredefinedContent = true; // mark as set + } + + /** + * Content of text message to display or print. Mandatory, if `OutputFormat` is Text, + * not allowed otherwise. One instance of `OutputText` per shared format. + * + * @param outputText Content of text message to display or print. Mandatory, if + * `OutputFormat` is Text, not allowed otherwise. One instance of + * `OutputText` per shared format. + * @return the current {@code OutputContent} instance, allowing for method chaining + */ + public OutputContent outputText(List outputText) { + this.outputText = outputText; + isSetOutputText = true; // mark as set + return this; + } + + public OutputContent addOutputTextItem(OutputText outputTextItem) { + if (this.outputText == null) { + this.outputText = new ArrayList<>(); + } + this.outputText.add(outputTextItem); + return this; + } + + /** + * Content of text message to display or print. Mandatory, if `OutputFormat` is Text, + * not allowed otherwise. One instance of `OutputText` per shared format. + * + * @return outputText Content of text message to display or print. Mandatory, if + * `OutputFormat` is Text, not allowed otherwise. One instance of + * `OutputText` per shared format. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOutputText() { + return outputText; + } + + /** + * Content of text message to display or print. Mandatory, if `OutputFormat` is Text, + * not allowed otherwise. One instance of `OutputText` per shared format. + * + * @param outputText Content of text message to display or print. Mandatory, if + * `OutputFormat` is Text, not allowed otherwise. One instance of + * `OutputText` per shared format. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputText(List outputText) { + this.outputText = outputText; + isSetOutputText = true; // mark as set + } + + /** + * XHTML document body containing the message to display or print. Mandatory if + * `OutputFormat` is XHTML, not allowed otherwise. + * + * @param outputXHTML XHTML document body containing the message to display or print. Mandatory if + * `OutputFormat` is XHTML, not allowed otherwise. + * @return the current {@code OutputContent} instance, allowing for method chaining + */ + public OutputContent outputXHTML(byte[] outputXHTML) { + this.outputXHTML = outputXHTML; + isSetOutputXHTML = true; // mark as set + return this; + } + + /** + * XHTML document body containing the message to display or print. Mandatory if + * `OutputFormat` is XHTML, not allowed otherwise. + * + * @return outputXHTML XHTML document body containing the message to display or print. Mandatory + * if `OutputFormat` is XHTML, not allowed otherwise. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_X_H_T_M_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getOutputXHTML() { + return outputXHTML; + } + + /** + * XHTML document body containing the message to display or print. Mandatory if + * `OutputFormat` is XHTML, not allowed otherwise. + * + * @param outputXHTML XHTML document body containing the message to display or print. Mandatory if + * `OutputFormat` is XHTML, not allowed otherwise. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_X_H_T_M_L) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputXHTML(byte[] outputXHTML) { + this.outputXHTML = outputXHTML; + isSetOutputXHTML = true; // mark as set + } + + /** + * Barcode content to display or print. Mandatory if `OutputFormat` is Barcode, not + * allowed otherwise. + * + * @param outputBarcode Barcode content to display or print. Mandatory if `OutputFormat` + * is Barcode, not allowed otherwise. + * @return the current {@code OutputContent} instance, allowing for method chaining + */ + public OutputContent outputBarcode(OutputBarcode outputBarcode) { + this.outputBarcode = outputBarcode; + isSetOutputBarcode = true; // mark as set + return this; + } + + /** + * Barcode content to display or print. Mandatory if `OutputFormat` is Barcode, not + * allowed otherwise. + * + * @return outputBarcode Barcode content to display or print. Mandatory if + * `OutputFormat` is Barcode, not allowed otherwise. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_BARCODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputBarcode getOutputBarcode() { + return outputBarcode; + } + + /** + * Barcode content to display or print. Mandatory if `OutputFormat` is Barcode, not + * allowed otherwise. + * + * @param outputBarcode Barcode content to display or print. Mandatory if `OutputFormat` + * is Barcode, not allowed otherwise. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_BARCODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputBarcode(OutputBarcode outputBarcode) { + this.outputBarcode = outputBarcode; + isSetOutputBarcode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OutputContent includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this OutputContent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutputContent outputContent = (OutputContent) o; + return Objects.equals(this.outputFormat, outputContent.outputFormat) + && Objects.equals(this.isSetOutputFormat, outputContent.isSetOutputFormat) + && Objects.equals(this.predefinedContent, outputContent.predefinedContent) + && Objects.equals(this.isSetPredefinedContent, outputContent.isSetPredefinedContent) + && Objects.equals(this.outputText, outputContent.outputText) + && Objects.equals(this.isSetOutputText, outputContent.isSetOutputText) + && Arrays.equals(this.outputXHTML, outputContent.outputXHTML) + && Objects.equals(this.isSetOutputXHTML, outputContent.isSetOutputXHTML) + && Objects.equals(this.outputBarcode, outputContent.outputBarcode) + && Objects.equals(this.isSetOutputBarcode, outputContent.isSetOutputBarcode); + } + + @Override + public int hashCode() { + return Objects.hash( + outputFormat, + isSetOutputFormat, + predefinedContent, + isSetPredefinedContent, + outputText, + isSetOutputText, + Arrays.hashCode(outputXHTML), + isSetOutputXHTML, + outputBarcode, + isSetOutputBarcode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutputContent {\n"); + sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).append("\n"); + sb.append(" predefinedContent: ").append(toIndentedString(predefinedContent)).append("\n"); + sb.append(" outputText: ").append(toIndentedString(outputText)).append("\n"); + sb.append(" outputXHTML: ").append(toIndentedString(outputXHTML)).append("\n"); + sb.append(" outputBarcode: ").append(toIndentedString(outputBarcode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOutputFormat) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_FORMAT, this.outputFormat); + } + if (isSetPredefinedContent) { + addIfNull(nulls, JSON_PROPERTY_PREDEFINED_CONTENT, this.predefinedContent); + } + if (isSetOutputText) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_TEXT, this.outputText); + } + if (isSetOutputXHTML) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_X_H_T_M_L, this.outputXHTML); + } + if (isSetOutputBarcode) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_BARCODE, this.outputBarcode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of OutputContent given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutputContent + * @throws JsonProcessingException if the JSON string is invalid with respect to OutputContent + */ + public static OutputContent fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OutputContent.class); + } + + /** + * Convert an instance of OutputContent to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/OutputFormatType.java b/src/main/java/com/adyen/model/tapi/OutputFormatType.java new file mode 100644 index 000000000..5e44f1932 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/OutputFormatType.java @@ -0,0 +1,56 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Format of the content to display or print. Display or print device function. Possible values: * + * **BarCode** * **MessageRef** * **Text** * **XHTML** + */ +public enum OutputFormatType { + BAR_CODE("BarCode"), + + MESSAGE_REF("MessageRef"), + + TEXT("Text"), + + XHTML("XHTML"); + + private String value; + + OutputFormatType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OutputFormatType fromValue(String value) { + for (OutputFormatType b : OutputFormatType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/OutputResult.java b/src/main/java/com/adyen/model/tapi/OutputResult.java new file mode 100644 index 000000000..45e4dcf40 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/OutputResult.java @@ -0,0 +1,313 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * In the message response, it contains the result of the output, if required in the message + * request. Information related to the result the output (display, print, input). + */ +@JsonPropertyOrder({ + OutputResult.JSON_PROPERTY_DEVICE, + OutputResult.JSON_PROPERTY_INFO_QUALIFY, + OutputResult.JSON_PROPERTY_RESPONSE +}) +public class OutputResult { + public static final String JSON_PROPERTY_DEVICE = "Device"; + private DeviceType device; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + + public static final String JSON_PROPERTY_INFO_QUALIFY = "InfoQualify"; + private InfoQualifyType infoQualify; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInfoQualify = false; + + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OutputResult() {} + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to + * output (display, print or store), or input (keyboard) for the Cashier or the Customer. Copy. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, in term of class of + * information to output (display, print or store), or input (keyboard) for the Cashier or the + * Customer. Copy. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + * @return the current {@code OutputResult} instance, allowing for method chaining + */ + public OutputResult device(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + return this; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to + * output (display, print or store), or input (keyboard) for the Cashier or the Customer. Copy. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @return device Logical device located on a Sale Terminal or a POI Terminal, in term of class of + * information to output (display, print or store), or input (keyboard) for the Cashier or the + * Customer. Copy. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeviceType getDevice() { + return device; + } + + /** + * Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to + * output (display, print or store), or input (keyboard) for the Cashier or the Customer. Copy. + * Possible values: * **CashierDisplay** * **CashierInput** * **CustomerDisplay** * + * **CustomerInput** + * + * @param device Logical device located on a Sale Terminal or a POI Terminal, in term of class of + * information to output (display, print or store), or input (keyboard) for the Cashier or the + * Customer. Copy. Possible values: * **CashierDisplay** * **CashierInput** * + * **CustomerDisplay** * **CustomerInput** + */ + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDevice(DeviceType device) { + this.device = device; + isSetDevice = true; // mark as set + } + + /** + * Qualification of the information to sent to an output logical device, to display or print to + * the Cashier or the Customer. Copy. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to sent to an output logical device, to + * display or print to the Cashier or the Customer. Copy. Possible values: * + * **CustomerAssistance** * **Display** * **Document** * **Error** * **Input** * + * **POIReplication** * **Receipt** * **Sound** * **Status** * **Voucher** + * @return the current {@code OutputResult} instance, allowing for method chaining + */ + public OutputResult infoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + return this; + } + + /** + * Qualification of the information to sent to an output logical device, to display or print to + * the Cashier or the Customer. Copy. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @return infoQualify Qualification of the information to sent to an output logical device, to + * display or print to the Cashier or the Customer. Copy. Possible values: * + * **CustomerAssistance** * **Display** * **Document** * **Error** * **Input** * + * **POIReplication** * **Receipt** * **Sound** * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Qualification of the information to sent to an output logical device, to display or print to + * the Cashier or the Customer. Copy. Possible values: * **CustomerAssistance** * **Display** * + * **Document** * **Error** * **Input** * **POIReplication** * **Receipt** * **Sound** * + * **Status** * **Voucher** + * + * @param infoQualify Qualification of the information to sent to an output logical device, to + * display or print to the Cashier or the Customer. Copy. Possible values: * + * **CustomerAssistance** * **Display** * **Document** * **Error** * **Input** * + * **POIReplication** * **Receipt** * **Sound** * **Status** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_INFO_QUALIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + isSetInfoQualify = true; // mark as set + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code OutputResult} instance, allowing for method chaining + */ + public OutputResult response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OutputResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this OutputResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutputResult outputResult = (OutputResult) o; + return Objects.equals(this.device, outputResult.device) + && Objects.equals(this.isSetDevice, outputResult.isSetDevice) + && Objects.equals(this.infoQualify, outputResult.infoQualify) + && Objects.equals(this.isSetInfoQualify, outputResult.isSetInfoQualify) + && Objects.equals(this.response, outputResult.response) + && Objects.equals(this.isSetResponse, outputResult.isSetResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + device, isSetDevice, infoQualify, isSetInfoQualify, response, isSetResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutputResult {\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" infoQualify: ").append(toIndentedString(infoQualify)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetInfoQualify) { + addIfNull(nulls, JSON_PROPERTY_INFO_QUALIFY, this.infoQualify); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of OutputResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutputResult + * @throws JsonProcessingException if the JSON string is invalid with respect to OutputResult + */ + public static OutputResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OutputResult.class); + } + + /** + * Convert an instance of OutputResult to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/OutputText.java b/src/main/java/com/adyen/model/tapi/OutputText.java new file mode 100644 index 000000000..b27fa0817 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/OutputText.java @@ -0,0 +1,640 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Content of text message to display or print. It conveys information related to the content of the + * text message and its format. All the data elements related to the format of the text to display + * or print are parameters valid for the whole text content. + */ +@JsonPropertyOrder({ + OutputText.JSON_PROPERTY_TEXT, + OutputText.JSON_PROPERTY_CHARACTER_SET, + OutputText.JSON_PROPERTY_START_ROW, + OutputText.JSON_PROPERTY_START_COLUMN, + OutputText.JSON_PROPERTY_CHARACTER_WIDTH, + OutputText.JSON_PROPERTY_CHARACTER_HEIGHT, + OutputText.JSON_PROPERTY_CHARACTER_STYLE, + OutputText.JSON_PROPERTY_ALIGNMENT, + OutputText.JSON_PROPERTY_END_OF_LINE_FLAG +}) +public class OutputText { + public static final String JSON_PROPERTY_TEXT = "Text"; + private String text; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetText = false; + + public static final String JSON_PROPERTY_CHARACTER_SET = "CharacterSet"; + private Integer characterSet; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCharacterSet = false; + + public static final String JSON_PROPERTY_START_ROW = "StartRow"; + private Integer startRow; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartRow = false; + + public static final String JSON_PROPERTY_START_COLUMN = "StartColumn"; + private Integer startColumn; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartColumn = false; + + public static final String JSON_PROPERTY_CHARACTER_WIDTH = "CharacterWidth"; + private CharacterWidthType characterWidth; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCharacterWidth = false; + + public static final String JSON_PROPERTY_CHARACTER_HEIGHT = "CharacterHeight"; + private CharacterHeightType characterHeight; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCharacterHeight = false; + + public static final String JSON_PROPERTY_CHARACTER_STYLE = "CharacterStyle"; + private CharacterStyleType characterStyle; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCharacterStyle = false; + + public static final String JSON_PROPERTY_ALIGNMENT = "Alignment"; + private AlignmentType alignment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAlignment = false; + + public static final String JSON_PROPERTY_END_OF_LINE_FLAG = "EndOfLineFlag"; + private Boolean endOfLineFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndOfLineFlag = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OutputText() {} + + /** + * Content of text message to display, print or play. + * + * @param text Content of text message to display, print or play. + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText text(String text) { + this.text = text; + isSetText = true; // mark as set + return this; + } + + /** + * Content of text message to display, print or play. + * + * @return text Content of text message to display, print or play. + */ + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + /** + * Content of text message to display, print or play. + * + * @param text Content of text message to display, print or play. + */ + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setText(String text) { + this.text = text; + isSetText = true; // mark as set + } + + /** + * Character height of the text string to display or print. Absence of this data element means the + * characters have normal height. + * + * @param characterSet Character height of the text string to display or print. Absence of this + * data element means the characters have normal height. + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText characterSet(Integer characterSet) { + this.characterSet = characterSet; + isSetCharacterSet = true; // mark as set + return this; + } + + /** + * Character height of the text string to display or print. Absence of this data element means the + * characters have normal height. + * + * @return characterSet Character height of the text string to display or print. Absence of this + * data element means the characters have normal height. + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_SET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCharacterSet() { + return characterSet; + } + + /** + * Character height of the text string to display or print. Absence of this data element means the + * characters have normal height. + * + * @param characterSet Character height of the text string to display or print. Absence of this + * data element means the characters have normal height. + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_SET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCharacterSet(Integer characterSet) { + this.characterSet = characterSet; + isSetCharacterSet = true; // mark as set + } + + /** + * Row where the text string has to be displayed or printed. + * + * @param startRow Row where the text string has to be displayed or printed. + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText startRow(Integer startRow) { + this.startRow = startRow; + isSetStartRow = true; // mark as set + return this; + } + + /** + * Row where the text string has to be displayed or printed. minimum: 1 maximum: 500 + * + * @return startRow Row where the text string has to be displayed or printed. + */ + @JsonProperty(JSON_PROPERTY_START_ROW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartRow() { + return startRow; + } + + /** + * Row where the text string has to be displayed or printed. + * + * @param startRow Row where the text string has to be displayed or printed. + */ + @JsonProperty(JSON_PROPERTY_START_ROW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartRow(Integer startRow) { + this.startRow = startRow; + isSetStartRow = true; // mark as set + } + + /** + * Column where the text string has to be displayed or printed. + * + * @param startColumn Column where the text string has to be displayed or printed. + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText startColumn(Integer startColumn) { + this.startColumn = startColumn; + isSetStartColumn = true; // mark as set + return this; + } + + /** + * Column where the text string has to be displayed or printed. minimum: 1 maximum: 500 + * + * @return startColumn Column where the text string has to be displayed or printed. + */ + @JsonProperty(JSON_PROPERTY_START_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStartColumn() { + return startColumn; + } + + /** + * Column where the text string has to be displayed or printed. + * + * @param startColumn Column where the text string has to be displayed or printed. + */ + @JsonProperty(JSON_PROPERTY_START_COLUMN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartColumn(Integer startColumn) { + this.startColumn = startColumn; + isSetStartColumn = true; // mark as set + } + + /** + * Character width of the text string to display or print. Absence of this data element means the + * characters have normal width. Possible values: * **DoubleWidth** * **SingleWidth** + * + * @param characterWidth Character width of the text string to display or print. Absence of this + * data element means the characters have normal width. Possible values: * **DoubleWidth** * + * **SingleWidth** + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText characterWidth(CharacterWidthType characterWidth) { + this.characterWidth = characterWidth; + isSetCharacterWidth = true; // mark as set + return this; + } + + /** + * Character width of the text string to display or print. Absence of this data element means the + * characters have normal width. Possible values: * **DoubleWidth** * **SingleWidth** + * + * @return characterWidth Character width of the text string to display or print. Absence of this + * data element means the characters have normal width. Possible values: * **DoubleWidth** * + * **SingleWidth** + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CharacterWidthType getCharacterWidth() { + return characterWidth; + } + + /** + * Character width of the text string to display or print. Absence of this data element means the + * characters have normal width. Possible values: * **DoubleWidth** * **SingleWidth** + * + * @param characterWidth Character width of the text string to display or print. Absence of this + * data element means the characters have normal width. Possible values: * **DoubleWidth** * + * **SingleWidth** + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCharacterWidth(CharacterWidthType characterWidth) { + this.characterWidth = characterWidth; + isSetCharacterWidth = true; // mark as set + } + + /** + * Character height of the text string to display or print. Absence of this data element means the + * characters have normal height. Possible values: * **DoubleHeight** * **HalfHeight** * + * **SingleHeight** + * + * @param characterHeight Character height of the text string to display or print. Absence of this + * data element means the characters have normal height. Possible values: * **DoubleHeight** * + * **HalfHeight** * **SingleHeight** + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText characterHeight(CharacterHeightType characterHeight) { + this.characterHeight = characterHeight; + isSetCharacterHeight = true; // mark as set + return this; + } + + /** + * Character height of the text string to display or print. Absence of this data element means the + * characters have normal height. Possible values: * **DoubleHeight** * **HalfHeight** * + * **SingleHeight** + * + * @return characterHeight Character height of the text string to display or print. Absence of + * this data element means the characters have normal height. Possible values: * + * **DoubleHeight** * **HalfHeight** * **SingleHeight** + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CharacterHeightType getCharacterHeight() { + return characterHeight; + } + + /** + * Character height of the text string to display or print. Absence of this data element means the + * characters have normal height. Possible values: * **DoubleHeight** * **HalfHeight** * + * **SingleHeight** + * + * @param characterHeight Character height of the text string to display or print. Absence of this + * data element means the characters have normal height. Possible values: * **DoubleHeight** * + * **HalfHeight** * **SingleHeight** + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCharacterHeight(CharacterHeightType characterHeight) { + this.characterHeight = characterHeight; + isSetCharacterHeight = true; // mark as set + } + + /** + * Typographic style of the sequence of characters to display or print. Absence of this data + * element means the characters have normal style. Possible values: * **Bold** * **Italic** * + * **Normal** * **Underline** + * + * @param characterStyle Typographic style of the sequence of characters to display or print. + * Absence of this data element means the characters have normal style. Possible values: * + * **Bold** * **Italic** * **Normal** * **Underline** + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText characterStyle(CharacterStyleType characterStyle) { + this.characterStyle = characterStyle; + isSetCharacterStyle = true; // mark as set + return this; + } + + /** + * Typographic style of the sequence of characters to display or print. Absence of this data + * element means the characters have normal style. Possible values: * **Bold** * **Italic** * + * **Normal** * **Underline** + * + * @return characterStyle Typographic style of the sequence of characters to display or print. + * Absence of this data element means the characters have normal style. Possible values: * + * **Bold** * **Italic** * **Normal** * **Underline** + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_STYLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CharacterStyleType getCharacterStyle() { + return characterStyle; + } + + /** + * Typographic style of the sequence of characters to display or print. Absence of this data + * element means the characters have normal style. Possible values: * **Bold** * **Italic** * + * **Normal** * **Underline** + * + * @param characterStyle Typographic style of the sequence of characters to display or print. + * Absence of this data element means the characters have normal style. Possible values: * + * **Bold** * **Italic** * **Normal** * **Underline** + */ + @JsonProperty(JSON_PROPERTY_CHARACTER_STYLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCharacterStyle(CharacterStyleType characterStyle) { + this.characterStyle = characterStyle; + isSetCharacterStyle = true; // mark as set + } + + /** + * Alignment of the text string on the display line or print line. Absence of this data element + * means the characters have normal alignment. Possible values: * **Centred** * **Justified** * + * **Left** * **Right** + * + * @param alignment Alignment of the text string on the display line or print line. Absence of + * this data element means the characters have normal alignment. Possible values: * + * **Centred** * **Justified** * **Left** * **Right** + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText alignment(AlignmentType alignment) { + this.alignment = alignment; + isSetAlignment = true; // mark as set + return this; + } + + /** + * Alignment of the text string on the display line or print line. Absence of this data element + * means the characters have normal alignment. Possible values: * **Centred** * **Justified** * + * **Left** * **Right** + * + * @return alignment Alignment of the text string on the display line or print line. Absence of + * this data element means the characters have normal alignment. Possible values: * + * **Centred** * **Justified** * **Left** * **Right** + */ + @JsonProperty(JSON_PROPERTY_ALIGNMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AlignmentType getAlignment() { + return alignment; + } + + /** + * Alignment of the text string on the display line or print line. Absence of this data element + * means the characters have normal alignment. Possible values: * **Centred** * **Justified** * + * **Left** * **Right** + * + * @param alignment Alignment of the text string on the display line or print line. Absence of + * this data element means the characters have normal alignment. Possible values: * + * **Centred** * **Justified** * **Left** * **Right** + */ + @JsonProperty(JSON_PROPERTY_ALIGNMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlignment(AlignmentType alignment) { + this.alignment = alignment; + isSetAlignment = true; // mark as set + } + + /** + * Indicates if the text is at the end of a line. Allows the display or the print of a new line + * and a carry-over return characters after the formatted text. + * + * @param endOfLineFlag Indicates if the text is at the end of a line. Allows the display or the + * print of a new line and a carry-over return characters after the formatted text. + * @return the current {@code OutputText} instance, allowing for method chaining + */ + public OutputText endOfLineFlag(Boolean endOfLineFlag) { + this.endOfLineFlag = endOfLineFlag; + isSetEndOfLineFlag = true; // mark as set + return this; + } + + /** + * Indicates if the text is at the end of a line. Allows the display or the print of a new line + * and a carry-over return characters after the formatted text. + * + * @return endOfLineFlag Indicates if the text is at the end of a line. Allows the display or the + * print of a new line and a carry-over return characters after the formatted text. + */ + @JsonProperty(JSON_PROPERTY_END_OF_LINE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEndOfLineFlag() { + return endOfLineFlag; + } + + /** + * Indicates if the text is at the end of a line. Allows the display or the print of a new line + * and a carry-over return characters after the formatted text. + * + * @param endOfLineFlag Indicates if the text is at the end of a line. Allows the display or the + * print of a new line and a carry-over return characters after the formatted text. + */ + @JsonProperty(JSON_PROPERTY_END_OF_LINE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndOfLineFlag(Boolean endOfLineFlag) { + this.endOfLineFlag = endOfLineFlag; + isSetEndOfLineFlag = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OutputText includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this OutputText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutputText outputText = (OutputText) o; + return Objects.equals(this.text, outputText.text) + && Objects.equals(this.isSetText, outputText.isSetText) + && Objects.equals(this.characterSet, outputText.characterSet) + && Objects.equals(this.isSetCharacterSet, outputText.isSetCharacterSet) + && Objects.equals(this.startRow, outputText.startRow) + && Objects.equals(this.isSetStartRow, outputText.isSetStartRow) + && Objects.equals(this.startColumn, outputText.startColumn) + && Objects.equals(this.isSetStartColumn, outputText.isSetStartColumn) + && Objects.equals(this.characterWidth, outputText.characterWidth) + && Objects.equals(this.isSetCharacterWidth, outputText.isSetCharacterWidth) + && Objects.equals(this.characterHeight, outputText.characterHeight) + && Objects.equals(this.isSetCharacterHeight, outputText.isSetCharacterHeight) + && Objects.equals(this.characterStyle, outputText.characterStyle) + && Objects.equals(this.isSetCharacterStyle, outputText.isSetCharacterStyle) + && Objects.equals(this.alignment, outputText.alignment) + && Objects.equals(this.isSetAlignment, outputText.isSetAlignment) + && Objects.equals(this.endOfLineFlag, outputText.endOfLineFlag) + && Objects.equals(this.isSetEndOfLineFlag, outputText.isSetEndOfLineFlag); + } + + @Override + public int hashCode() { + return Objects.hash( + text, + isSetText, + characterSet, + isSetCharacterSet, + startRow, + isSetStartRow, + startColumn, + isSetStartColumn, + characterWidth, + isSetCharacterWidth, + characterHeight, + isSetCharacterHeight, + characterStyle, + isSetCharacterStyle, + alignment, + isSetAlignment, + endOfLineFlag, + isSetEndOfLineFlag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutputText {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" characterSet: ").append(toIndentedString(characterSet)).append("\n"); + sb.append(" startRow: ").append(toIndentedString(startRow)).append("\n"); + sb.append(" startColumn: ").append(toIndentedString(startColumn)).append("\n"); + sb.append(" characterWidth: ").append(toIndentedString(characterWidth)).append("\n"); + sb.append(" characterHeight: ").append(toIndentedString(characterHeight)).append("\n"); + sb.append(" characterStyle: ").append(toIndentedString(characterStyle)).append("\n"); + sb.append(" alignment: ").append(toIndentedString(alignment)).append("\n"); + sb.append(" endOfLineFlag: ").append(toIndentedString(endOfLineFlag)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetText) { + addIfNull(nulls, JSON_PROPERTY_TEXT, this.text); + } + if (isSetCharacterSet) { + addIfNull(nulls, JSON_PROPERTY_CHARACTER_SET, this.characterSet); + } + if (isSetStartRow) { + addIfNull(nulls, JSON_PROPERTY_START_ROW, this.startRow); + } + if (isSetStartColumn) { + addIfNull(nulls, JSON_PROPERTY_START_COLUMN, this.startColumn); + } + if (isSetCharacterWidth) { + addIfNull(nulls, JSON_PROPERTY_CHARACTER_WIDTH, this.characterWidth); + } + if (isSetCharacterHeight) { + addIfNull(nulls, JSON_PROPERTY_CHARACTER_HEIGHT, this.characterHeight); + } + if (isSetCharacterStyle) { + addIfNull(nulls, JSON_PROPERTY_CHARACTER_STYLE, this.characterStyle); + } + if (isSetAlignment) { + addIfNull(nulls, JSON_PROPERTY_ALIGNMENT, this.alignment); + } + if (isSetEndOfLineFlag) { + addIfNull(nulls, JSON_PROPERTY_END_OF_LINE_FLAG, this.endOfLineFlag); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of OutputText given an JSON string + * + * @param jsonString JSON string + * @return An instance of OutputText + * @throws JsonProcessingException if the JSON string is invalid with respect to OutputText + */ + public static OutputText fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OutputText.class); + } + + /** + * Convert an instance of OutputText to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PINFormatType.java b/src/main/java/com/adyen/model/tapi/PINFormatType.java new file mode 100644 index 000000000..561730e6b --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PINFormatType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets PINFormat */ +public enum PINFormatType { + ISO0("ISO0"), + + ISO1("ISO1"), + + ISO2("ISO2"), + + ISO3("ISO3"); + + private String value; + + PINFormatType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PINFormatType fromValue(String value) { + for (PINFormatType b : PINFormatType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PINRequestType.java b/src/main/java/com/adyen/model/tapi/PINRequestType.java new file mode 100644 index 000000000..4bf856e35 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PINRequestType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Type of PIN Service. Possible values: * **PINEnter** * **PINVerify** * **PINVerifyOnly** */ +public enum PINRequestType { + PIN_ENTER("PINEnter"), + + PIN_VERIFY("PINVerify"), + + PIN_VERIFY_ONLY("PINVerifyOnly"); + + private String value; + + PINRequestType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PINRequestType fromValue(String value) { + for (PINRequestType b : PINRequestType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/POIData.java b/src/main/java/com/adyen/model/tapi/POIData.java new file mode 100644 index 000000000..f5504bb1a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/POIData.java @@ -0,0 +1,233 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Data related to the POI System. In the Message Response, identification of the POI transaction. + */ +@JsonPropertyOrder({ + POIData.JSON_PROPERTY_PO_I_TRANSACTION_I_D, + POIData.JSON_PROPERTY_PO_I_RECONCILIATION_I_D +}) +public class POIData { + public static final String JSON_PROPERTY_PO_I_TRANSACTION_I_D = "POITransactionID"; + private TransactionIdentification poITransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoITransactionID = false; + + public static final String JSON_PROPERTY_PO_I_RECONCILIATION_I_D = "POIReconciliationID"; + private Integer poIReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIReconciliationID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public POIData() {} + + /** + * Unique identification of a POI transaction for a POI. + * + * @param poITransactionID Unique identification of a POI transaction for a POI. + * @return the current {@code POIData} instance, allowing for method chaining + */ + public POIData poITransactionID(TransactionIdentification poITransactionID) { + this.poITransactionID = poITransactionID; + isSetPoITransactionID = true; // mark as set + return this; + } + + /** + * Unique identification of a POI transaction for a POI. + * + * @return poITransactionID Unique identification of a POI transaction for a POI. + */ + @JsonProperty(JSON_PROPERTY_PO_I_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getPoITransactionID() { + return poITransactionID; + } + + /** + * Unique identification of a POI transaction for a POI. + * + * @param poITransactionID Unique identification of a POI transaction for a POI. + */ + @JsonProperty(JSON_PROPERTY_PO_I_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoITransactionID(TransactionIdentification poITransactionID) { + this.poITransactionID = poITransactionID; + isSetPoITransactionID = true; // mark as set + } + + /** + * Identification of the reconciliation period between Sale and POI. If Result is Success. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. If + * Result is Success. + * @return the current {@code POIData} instance, allowing for method chaining + */ + public POIData poIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + return this; + } + + /** + * Identification of the reconciliation period between Sale and POI. If Result is Success. + * + * @return poIReconciliationID Identification of the reconciliation period between Sale and POI. + * If Result is Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPoIReconciliationID() { + return poIReconciliationID; + } + + /** + * Identification of the reconciliation period between Sale and POI. If Result is Success. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. If + * Result is Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public POIData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this POIData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + POIData poIData = (POIData) o; + return Objects.equals(this.poITransactionID, poIData.poITransactionID) + && Objects.equals(this.isSetPoITransactionID, poIData.isSetPoITransactionID) + && Objects.equals(this.poIReconciliationID, poIData.poIReconciliationID) + && Objects.equals(this.isSetPoIReconciliationID, poIData.isSetPoIReconciliationID); + } + + @Override + public int hashCode() { + return Objects.hash( + poITransactionID, isSetPoITransactionID, poIReconciliationID, isSetPoIReconciliationID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class POIData {\n"); + sb.append(" poITransactionID: ").append(toIndentedString(poITransactionID)).append("\n"); + sb.append(" poIReconciliationID: ") + .append(toIndentedString(poIReconciliationID)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPoITransactionID) { + addIfNull(nulls, JSON_PROPERTY_PO_I_TRANSACTION_I_D, this.poITransactionID); + } + if (isSetPoIReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_PO_I_RECONCILIATION_I_D, this.poIReconciliationID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of POIData given an JSON string + * + * @param jsonString JSON string + * @return An instance of POIData + * @throws JsonProcessingException if the JSON string is invalid with respect to POIData + */ + public static POIData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, POIData.class); + } + + /** + * Convert an instance of POIData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/POISoftware.java b/src/main/java/com/adyen/model/tapi/POISoftware.java new file mode 100644 index 000000000..92e10ba58 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/POISoftware.java @@ -0,0 +1,366 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Information related to the software of the POI System which manages the Sale to POI protocol. In + * a session allows identifying the product features of a POI System. + */ +@JsonPropertyOrder({ + POISoftware.JSON_PROPERTY_MANUFACTURER_I_D, + POISoftware.JSON_PROPERTY_APPLICATION_NAME, + POISoftware.JSON_PROPERTY_SOFTWARE_VERSION, + POISoftware.JSON_PROPERTY_CERTIFICATION_CODE +}) +public class POISoftware { + public static final String JSON_PROPERTY_MANUFACTURER_I_D = "ManufacturerID"; + private String manufacturerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManufacturerID = false; + + public static final String JSON_PROPERTY_APPLICATION_NAME = "ApplicationName"; + private String applicationName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationName = false; + + public static final String JSON_PROPERTY_SOFTWARE_VERSION = "SoftwareVersion"; + private String softwareVersion; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSoftwareVersion = false; + + public static final String JSON_PROPERTY_CERTIFICATION_CODE = "CertificationCode"; + private String certificationCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCertificationCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public POISoftware() {} + + /** + * Identification of the Manufacturer. Sent in the Login Request (Response) to identify the Sale + * System (POI System) manufacturer during the session. + * + * @param manufacturerID Identification of the Manufacturer. Sent in the Login Request (Response) + * to identify the Sale System (POI System) manufacturer during the session. + * @return the current {@code POISoftware} instance, allowing for method chaining + */ + public POISoftware manufacturerID(String manufacturerID) { + this.manufacturerID = manufacturerID; + isSetManufacturerID = true; // mark as set + return this; + } + + /** + * Identification of the Manufacturer. Sent in the Login Request (Response) to identify the Sale + * System (POI System) manufacturer during the session. + * + * @return manufacturerID Identification of the Manufacturer. Sent in the Login Request (Response) + * to identify the Sale System (POI System) manufacturer during the session. + */ + @JsonProperty(JSON_PROPERTY_MANUFACTURER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturerID() { + return manufacturerID; + } + + /** + * Identification of the Manufacturer. Sent in the Login Request (Response) to identify the Sale + * System (POI System) manufacturer during the session. + * + * @param manufacturerID Identification of the Manufacturer. Sent in the Login Request (Response) + * to identify the Sale System (POI System) manufacturer during the session. + */ + @JsonProperty(JSON_PROPERTY_MANUFACTURER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManufacturerID(String manufacturerID) { + this.manufacturerID = manufacturerID; + isSetManufacturerID = true; // mark as set + } + + /** + * Name of the software product. Sent in the Login Request (Response) to identify the Sale System + * (POI System) product name during the session. + * + * @param applicationName Name of the software product. Sent in the Login Request (Response) to + * identify the Sale System (POI System) product name during the session. + * @return the current {@code POISoftware} instance, allowing for method chaining + */ + public POISoftware applicationName(String applicationName) { + this.applicationName = applicationName; + isSetApplicationName = true; // mark as set + return this; + } + + /** + * Name of the software product. Sent in the Login Request (Response) to identify the Sale System + * (POI System) product name during the session. + * + * @return applicationName Name of the software product. Sent in the Login Request (Response) to + * identify the Sale System (POI System) product name during the session. + */ + @JsonProperty(JSON_PROPERTY_APPLICATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApplicationName() { + return applicationName; + } + + /** + * Name of the software product. Sent in the Login Request (Response) to identify the Sale System + * (POI System) product name during the session. + * + * @param applicationName Name of the software product. Sent in the Login Request (Response) to + * identify the Sale System (POI System) product name during the session. + */ + @JsonProperty(JSON_PROPERTY_APPLICATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + isSetApplicationName = true; // mark as set + } + + /** + * Version of the software product. Sent in the Login Request (Response) to identify the version + * of the Sale System (POI System) product software during the session. + * + * @param softwareVersion Version of the software product. Sent in the Login Request (Response) to + * identify the version of the Sale System (POI System) product software during the session. + * @return the current {@code POISoftware} instance, allowing for method chaining + */ + public POISoftware softwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + isSetSoftwareVersion = true; // mark as set + return this; + } + + /** + * Version of the software product. Sent in the Login Request (Response) to identify the version + * of the Sale System (POI System) product software during the session. + * + * @return softwareVersion Version of the software product. Sent in the Login Request (Response) + * to identify the version of the Sale System (POI System) product software during the + * session. + */ + @JsonProperty(JSON_PROPERTY_SOFTWARE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSoftwareVersion() { + return softwareVersion; + } + + /** + * Version of the software product. Sent in the Login Request (Response) to identify the version + * of the Sale System (POI System) product software during the session. + * + * @param softwareVersion Version of the software product. Sent in the Login Request (Response) to + * identify the version of the Sale System (POI System) product software during the session. + */ + @JsonProperty(JSON_PROPERTY_SOFTWARE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + isSetSoftwareVersion = true; // mark as set + } + + /** + * Certification code of the software which manages the Sale to POI protocol. Sent in the Login + * Request (Response) to get the certification code of the Sale System (POI System) product + * software. This code can be a software checksum or any number associated with the software. + * + * @param certificationCode Certification code of the software which manages the Sale to POI + * protocol. Sent in the Login Request (Response) to get the certification code of the Sale + * System (POI System) product software. This code can be a software checksum or any number + * associated with the software. + * @return the current {@code POISoftware} instance, allowing for method chaining + */ + public POISoftware certificationCode(String certificationCode) { + this.certificationCode = certificationCode; + isSetCertificationCode = true; // mark as set + return this; + } + + /** + * Certification code of the software which manages the Sale to POI protocol. Sent in the Login + * Request (Response) to get the certification code of the Sale System (POI System) product + * software. This code can be a software checksum or any number associated with the software. + * + * @return certificationCode Certification code of the software which manages the Sale to POI + * protocol. Sent in the Login Request (Response) to get the certification code of the Sale + * System (POI System) product software. This code can be a software checksum or any number + * associated with the software. + */ + @JsonProperty(JSON_PROPERTY_CERTIFICATION_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCertificationCode() { + return certificationCode; + } + + /** + * Certification code of the software which manages the Sale to POI protocol. Sent in the Login + * Request (Response) to get the certification code of the Sale System (POI System) product + * software. This code can be a software checksum or any number associated with the software. + * + * @param certificationCode Certification code of the software which manages the Sale to POI + * protocol. Sent in the Login Request (Response) to get the certification code of the Sale + * System (POI System) product software. This code can be a software checksum or any number + * associated with the software. + */ + @JsonProperty(JSON_PROPERTY_CERTIFICATION_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCertificationCode(String certificationCode) { + this.certificationCode = certificationCode; + isSetCertificationCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public POISoftware includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this POISoftware object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + POISoftware poISoftware = (POISoftware) o; + return Objects.equals(this.manufacturerID, poISoftware.manufacturerID) + && Objects.equals(this.isSetManufacturerID, poISoftware.isSetManufacturerID) + && Objects.equals(this.applicationName, poISoftware.applicationName) + && Objects.equals(this.isSetApplicationName, poISoftware.isSetApplicationName) + && Objects.equals(this.softwareVersion, poISoftware.softwareVersion) + && Objects.equals(this.isSetSoftwareVersion, poISoftware.isSetSoftwareVersion) + && Objects.equals(this.certificationCode, poISoftware.certificationCode) + && Objects.equals(this.isSetCertificationCode, poISoftware.isSetCertificationCode); + } + + @Override + public int hashCode() { + return Objects.hash( + manufacturerID, + isSetManufacturerID, + applicationName, + isSetApplicationName, + softwareVersion, + isSetSoftwareVersion, + certificationCode, + isSetCertificationCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class POISoftware {\n"); + sb.append(" manufacturerID: ").append(toIndentedString(manufacturerID)).append("\n"); + sb.append(" applicationName: ").append(toIndentedString(applicationName)).append("\n"); + sb.append(" softwareVersion: ").append(toIndentedString(softwareVersion)).append("\n"); + sb.append(" certificationCode: ").append(toIndentedString(certificationCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetManufacturerID) { + addIfNull(nulls, JSON_PROPERTY_MANUFACTURER_I_D, this.manufacturerID); + } + if (isSetApplicationName) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_NAME, this.applicationName); + } + if (isSetSoftwareVersion) { + addIfNull(nulls, JSON_PROPERTY_SOFTWARE_VERSION, this.softwareVersion); + } + if (isSetCertificationCode) { + addIfNull(nulls, JSON_PROPERTY_CERTIFICATION_CODE, this.certificationCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of POISoftware given an JSON string + * + * @param jsonString JSON string + * @return An instance of POISoftware + * @throws JsonProcessingException if the JSON string is invalid with respect to POISoftware + */ + public static POISoftware fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, POISoftware.class); + } + + /** + * Convert an instance of POISoftware to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/POIStatus.java b/src/main/java/com/adyen/model/tapi/POIStatus.java new file mode 100644 index 000000000..73f7ae1ce --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/POIStatus.java @@ -0,0 +1,519 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Indicate the availability of the POI Terminal components. The data element is absent if the + * component is not part of the POI Terminal. State of a POI Terminal. + */ +@JsonPropertyOrder({ + POIStatus.JSON_PROPERTY_GLOBAL_STATUS, + POIStatus.JSON_PROPERTY_SECURITY_O_K_FLAG, + POIStatus.JSON_PROPERTY_PE_D_O_K_FLAG, + POIStatus.JSON_PROPERTY_CARD_READER_O_K_FLAG, + POIStatus.JSON_PROPERTY_PRINTER_STATUS, + POIStatus.JSON_PROPERTY_COMMUNICATION_O_K_FLAG, + POIStatus.JSON_PROPERTY_FRAUD_PREVENTION_FLAG +}) +public class POIStatus { + public static final String JSON_PROPERTY_GLOBAL_STATUS = "GlobalStatus"; + private GlobalStatusType globalStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGlobalStatus = false; + + public static final String JSON_PROPERTY_SECURITY_O_K_FLAG = "SecurityOKFlag"; + private Boolean securityOKFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSecurityOKFlag = false; + + public static final String JSON_PROPERTY_PE_D_O_K_FLAG = "PEDOKFlag"; + private Boolean peDOKFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPeDOKFlag = false; + + public static final String JSON_PROPERTY_CARD_READER_O_K_FLAG = "CardReaderOKFlag"; + private Boolean cardReaderOKFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardReaderOKFlag = false; + + public static final String JSON_PROPERTY_PRINTER_STATUS = "PrinterStatus"; + private PrinterStatusType printerStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrinterStatus = false; + + public static final String JSON_PROPERTY_COMMUNICATION_O_K_FLAG = "CommunicationOKFlag"; + private Boolean communicationOKFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCommunicationOKFlag = false; + + public static final String JSON_PROPERTY_FRAUD_PREVENTION_FLAG = "FraudPreventionFlag"; + private Boolean fraudPreventionFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudPreventionFlag = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public POIStatus() {} + + /** + * Global status of a POI Server or POI Terminal. Possible values: * **Busy** * **Maintenance** * + * **OK** * **Unreachable** + * + * @param globalStatus Global status of a POI Server or POI Terminal. Possible values: * **Busy** + * * **Maintenance** * **OK** * **Unreachable** + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus globalStatus(GlobalStatusType globalStatus) { + this.globalStatus = globalStatus; + isSetGlobalStatus = true; // mark as set + return this; + } + + /** + * Global status of a POI Server or POI Terminal. Possible values: * **Busy** * **Maintenance** * + * **OK** * **Unreachable** + * + * @return globalStatus Global status of a POI Server or POI Terminal. Possible values: * **Busy** + * * **Maintenance** * **OK** * **Unreachable** + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GlobalStatusType getGlobalStatus() { + return globalStatus; + } + + /** + * Global status of a POI Server or POI Terminal. Possible values: * **Busy** * **Maintenance** * + * **OK** * **Unreachable** + * + * @param globalStatus Global status of a POI Server or POI Terminal. Possible values: * **Busy** + * * **Maintenance** * **OK** * **Unreachable** + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGlobalStatus(GlobalStatusType globalStatus) { + this.globalStatus = globalStatus; + isSetGlobalStatus = true; // mark as set + } + + /** + * Indicates if the security module of the POI is working and usable. If security module present. + * + * @param securityOKFlag Indicates if the security module of the POI is working and usable. If + * security module present. + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus securityOKFlag(Boolean securityOKFlag) { + this.securityOKFlag = securityOKFlag; + isSetSecurityOKFlag = true; // mark as set + return this; + } + + /** + * Indicates if the security module of the POI is working and usable. If security module present. + * + * @return securityOKFlag Indicates if the security module of the POI is working and usable. If + * security module present. + */ + @JsonProperty(JSON_PROPERTY_SECURITY_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSecurityOKFlag() { + return securityOKFlag; + } + + /** + * Indicates if the security module of the POI is working and usable. If security module present. + * + * @param securityOKFlag Indicates if the security module of the POI is working and usable. If + * security module present. + */ + @JsonProperty(JSON_PROPERTY_SECURITY_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecurityOKFlag(Boolean securityOKFlag) { + this.securityOKFlag = securityOKFlag; + isSetSecurityOKFlag = true; // mark as set + } + + /** + * Indicates if the PED is working and usable. If PED present. + * + * @param peDOKFlag Indicates if the PED is working and usable. If PED present. + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus peDOKFlag(Boolean peDOKFlag) { + this.peDOKFlag = peDOKFlag; + isSetPeDOKFlag = true; // mark as set + return this; + } + + /** + * Indicates if the PED is working and usable. If PED present. + * + * @return peDOKFlag Indicates if the PED is working and usable. If PED present. + */ + @JsonProperty(JSON_PROPERTY_PE_D_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPeDOKFlag() { + return peDOKFlag; + } + + /** + * Indicates if the PED is working and usable. If PED present. + * + * @param peDOKFlag Indicates if the PED is working and usable. If PED present. + */ + @JsonProperty(JSON_PROPERTY_PE_D_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPeDOKFlag(Boolean peDOKFlag) { + this.peDOKFlag = peDOKFlag; + isSetPeDOKFlag = true; // mark as set + } + + /** + * Indicates if the card readers are working and usable. If card reader device present. + * + * @param cardReaderOKFlag Indicates if the card readers are working and usable. If card reader + * device present. + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus cardReaderOKFlag(Boolean cardReaderOKFlag) { + this.cardReaderOKFlag = cardReaderOKFlag; + isSetCardReaderOKFlag = true; // mark as set + return this; + } + + /** + * Indicates if the card readers are working and usable. If card reader device present. + * + * @return cardReaderOKFlag Indicates if the card readers are working and usable. If card reader + * device present. + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCardReaderOKFlag() { + return cardReaderOKFlag; + } + + /** + * Indicates if the card readers are working and usable. If card reader device present. + * + * @param cardReaderOKFlag Indicates if the card readers are working and usable. If card reader + * device present. + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardReaderOKFlag(Boolean cardReaderOKFlag) { + this.cardReaderOKFlag = cardReaderOKFlag; + isSetCardReaderOKFlag = true; // mark as set + } + + /** + * Possible values: * **NoPaper** * **OK** * **OutOfOrder** * **PaperJam** * **PaperLow** + * + * @param printerStatus Possible values: * **NoPaper** * **OK** * **OutOfOrder** * **PaperJam** * + * **PaperLow** + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus printerStatus(PrinterStatusType printerStatus) { + this.printerStatus = printerStatus; + isSetPrinterStatus = true; // mark as set + return this; + } + + /** + * Possible values: * **NoPaper** * **OK** * **OutOfOrder** * **PaperJam** * **PaperLow** + * + * @return printerStatus Possible values: * **NoPaper** * **OK** * **OutOfOrder** * **PaperJam** * + * **PaperLow** + */ + @JsonProperty(JSON_PROPERTY_PRINTER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PrinterStatusType getPrinterStatus() { + return printerStatus; + } + + /** + * Possible values: * **NoPaper** * **OK** * **OutOfOrder** * **PaperJam** * **PaperLow** + * + * @param printerStatus Possible values: * **NoPaper** * **OK** * **OutOfOrder** * **PaperJam** * + * **PaperLow** + */ + @JsonProperty(JSON_PROPERTY_PRINTER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrinterStatus(PrinterStatusType printerStatus) { + this.printerStatus = printerStatus; + isSetPrinterStatus = true; // mark as set + } + + /** + * Indicates if the communication infrastructure is working and usable. If communication + * infrastructure present. + * + * @param communicationOKFlag Indicates if the communication infrastructure is working and usable. + * If communication infrastructure present. + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus communicationOKFlag(Boolean communicationOKFlag) { + this.communicationOKFlag = communicationOKFlag; + isSetCommunicationOKFlag = true; // mark as set + return this; + } + + /** + * Indicates if the communication infrastructure is working and usable. If communication + * infrastructure present. + * + * @return communicationOKFlag Indicates if the communication infrastructure is working and + * usable. If communication infrastructure present. + */ + @JsonProperty(JSON_PROPERTY_COMMUNICATION_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCommunicationOKFlag() { + return communicationOKFlag; + } + + /** + * Indicates if the communication infrastructure is working and usable. If communication + * infrastructure present. + * + * @param communicationOKFlag Indicates if the communication infrastructure is working and usable. + * If communication infrastructure present. + */ + @JsonProperty(JSON_PROPERTY_COMMUNICATION_O_K_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommunicationOKFlag(Boolean communicationOKFlag) { + this.communicationOKFlag = communicationOKFlag; + isSetCommunicationOKFlag = true; // mark as set + } + + /** + * Indicates a suspicion of fraud by the POI System. Could be set to True by the POI system to + * notify to the Sale system and the Cashier that a suspicion of fraud had been detected on the + * POI as an unexpected reboot of the POI. + * + * @param fraudPreventionFlag Indicates a suspicion of fraud by the POI System. Could be set to + * True by the POI system to notify to the Sale system and the Cashier that a suspicion of + * fraud had been detected on the POI as an unexpected reboot of the POI. + * @return the current {@code POIStatus} instance, allowing for method chaining + */ + public POIStatus fraudPreventionFlag(Boolean fraudPreventionFlag) { + this.fraudPreventionFlag = fraudPreventionFlag; + isSetFraudPreventionFlag = true; // mark as set + return this; + } + + /** + * Indicates a suspicion of fraud by the POI System. Could be set to True by the POI system to + * notify to the Sale system and the Cashier that a suspicion of fraud had been detected on the + * POI as an unexpected reboot of the POI. + * + * @return fraudPreventionFlag Indicates a suspicion of fraud by the POI System. Could be set to + * True by the POI system to notify to the Sale system and the Cashier that a suspicion of + * fraud had been detected on the POI as an unexpected reboot of the POI. + */ + @JsonProperty(JSON_PROPERTY_FRAUD_PREVENTION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getFraudPreventionFlag() { + return fraudPreventionFlag; + } + + /** + * Indicates a suspicion of fraud by the POI System. Could be set to True by the POI system to + * notify to the Sale system and the Cashier that a suspicion of fraud had been detected on the + * POI as an unexpected reboot of the POI. + * + * @param fraudPreventionFlag Indicates a suspicion of fraud by the POI System. Could be set to + * True by the POI system to notify to the Sale system and the Cashier that a suspicion of + * fraud had been detected on the POI as an unexpected reboot of the POI. + */ + @JsonProperty(JSON_PROPERTY_FRAUD_PREVENTION_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFraudPreventionFlag(Boolean fraudPreventionFlag) { + this.fraudPreventionFlag = fraudPreventionFlag; + isSetFraudPreventionFlag = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public POIStatus includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this POIStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + POIStatus poIStatus = (POIStatus) o; + return Objects.equals(this.globalStatus, poIStatus.globalStatus) + && Objects.equals(this.isSetGlobalStatus, poIStatus.isSetGlobalStatus) + && Objects.equals(this.securityOKFlag, poIStatus.securityOKFlag) + && Objects.equals(this.isSetSecurityOKFlag, poIStatus.isSetSecurityOKFlag) + && Objects.equals(this.peDOKFlag, poIStatus.peDOKFlag) + && Objects.equals(this.isSetPeDOKFlag, poIStatus.isSetPeDOKFlag) + && Objects.equals(this.cardReaderOKFlag, poIStatus.cardReaderOKFlag) + && Objects.equals(this.isSetCardReaderOKFlag, poIStatus.isSetCardReaderOKFlag) + && Objects.equals(this.printerStatus, poIStatus.printerStatus) + && Objects.equals(this.isSetPrinterStatus, poIStatus.isSetPrinterStatus) + && Objects.equals(this.communicationOKFlag, poIStatus.communicationOKFlag) + && Objects.equals(this.isSetCommunicationOKFlag, poIStatus.isSetCommunicationOKFlag) + && Objects.equals(this.fraudPreventionFlag, poIStatus.fraudPreventionFlag) + && Objects.equals(this.isSetFraudPreventionFlag, poIStatus.isSetFraudPreventionFlag); + } + + @Override + public int hashCode() { + return Objects.hash( + globalStatus, + isSetGlobalStatus, + securityOKFlag, + isSetSecurityOKFlag, + peDOKFlag, + isSetPeDOKFlag, + cardReaderOKFlag, + isSetCardReaderOKFlag, + printerStatus, + isSetPrinterStatus, + communicationOKFlag, + isSetCommunicationOKFlag, + fraudPreventionFlag, + isSetFraudPreventionFlag); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class POIStatus {\n"); + sb.append(" globalStatus: ").append(toIndentedString(globalStatus)).append("\n"); + sb.append(" securityOKFlag: ").append(toIndentedString(securityOKFlag)).append("\n"); + sb.append(" peDOKFlag: ").append(toIndentedString(peDOKFlag)).append("\n"); + sb.append(" cardReaderOKFlag: ").append(toIndentedString(cardReaderOKFlag)).append("\n"); + sb.append(" printerStatus: ").append(toIndentedString(printerStatus)).append("\n"); + sb.append(" communicationOKFlag: ") + .append(toIndentedString(communicationOKFlag)) + .append("\n"); + sb.append(" fraudPreventionFlag: ") + .append(toIndentedString(fraudPreventionFlag)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetGlobalStatus) { + addIfNull(nulls, JSON_PROPERTY_GLOBAL_STATUS, this.globalStatus); + } + if (isSetSecurityOKFlag) { + addIfNull(nulls, JSON_PROPERTY_SECURITY_O_K_FLAG, this.securityOKFlag); + } + if (isSetPeDOKFlag) { + addIfNull(nulls, JSON_PROPERTY_PE_D_O_K_FLAG, this.peDOKFlag); + } + if (isSetCardReaderOKFlag) { + addIfNull(nulls, JSON_PROPERTY_CARD_READER_O_K_FLAG, this.cardReaderOKFlag); + } + if (isSetPrinterStatus) { + addIfNull(nulls, JSON_PROPERTY_PRINTER_STATUS, this.printerStatus); + } + if (isSetCommunicationOKFlag) { + addIfNull(nulls, JSON_PROPERTY_COMMUNICATION_O_K_FLAG, this.communicationOKFlag); + } + if (isSetFraudPreventionFlag) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_PREVENTION_FLAG, this.fraudPreventionFlag); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of POIStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of POIStatus + * @throws JsonProcessingException if the JSON string is invalid with respect to POIStatus + */ + public static POIStatus fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, POIStatus.class); + } + + /** + * Convert an instance of POIStatus to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/POISystemData.java b/src/main/java/com/adyen/model/tapi/POISystemData.java new file mode 100644 index 000000000..cacf8359e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/POISystemData.java @@ -0,0 +1,278 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; + +/** POISystemData */ +@JsonPropertyOrder({ + POISystemData.JSON_PROPERTY_DATE_TIME, + POISystemData.JSON_PROPERTY_PO_I_SOFTWARE, + POISystemData.JSON_PROPERTY_PO_I_STATUS +}) +public class POISystemData { + public static final String JSON_PROPERTY_DATE_TIME = "DateTime"; + private OffsetDateTime dateTime; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateTime = false; + + public static final String JSON_PROPERTY_PO_I_SOFTWARE = "POISoftware"; + private POISoftware poISoftware; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoISoftware = false; + + public static final String JSON_PROPERTY_PO_I_STATUS = "POIStatus"; + private POIStatus poIStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public POISystemData() {} + + /** + * Date and Time. In the response, the POI System gives its date and time to the Sale System. + * + * @param dateTime Date and Time. In the response, the POI System gives its date and time to the + * Sale System. + * @return the current {@code POISystemData} instance, allowing for method chaining + */ + public POISystemData dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + isSetDateTime = true; // mark as set + return this; + } + + /** + * Date and Time. In the response, the POI System gives its date and time to the Sale System. + * + * @return dateTime Date and Time. In the response, the POI System gives its date and time to the + * Sale System. + */ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Date and Time. In the response, the POI System gives its date and time to the Sale System. + * + * @param dateTime Date and Time. In the response, the POI System gives its date and time to the + * Sale System. + */ + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + isSetDateTime = true; // mark as set + } + + /** + * poISoftware + * + * @param poISoftware + * @return the current {@code POISystemData} instance, allowing for method chaining + */ + public POISystemData poISoftware(POISoftware poISoftware) { + this.poISoftware = poISoftware; + isSetPoISoftware = true; // mark as set + return this; + } + + /** + * Get poISoftware + * + * @return poISoftware + */ + @JsonProperty(JSON_PROPERTY_PO_I_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POISoftware getPoISoftware() { + return poISoftware; + } + + /** + * poISoftware + * + * @param poISoftware + */ + @JsonProperty(JSON_PROPERTY_PO_I_SOFTWARE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoISoftware(POISoftware poISoftware) { + this.poISoftware = poISoftware; + isSetPoISoftware = true; // mark as set + } + + /** + * poIStatus + * + * @param poIStatus + * @return the current {@code POISystemData} instance, allowing for method chaining + */ + public POISystemData poIStatus(POIStatus poIStatus) { + this.poIStatus = poIStatus; + isSetPoIStatus = true; // mark as set + return this; + } + + /** + * Get poIStatus + * + * @return poIStatus + */ + @JsonProperty(JSON_PROPERTY_PO_I_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIStatus getPoIStatus() { + return poIStatus; + } + + /** + * poIStatus + * + * @param poIStatus + */ + @JsonProperty(JSON_PROPERTY_PO_I_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIStatus(POIStatus poIStatus) { + this.poIStatus = poIStatus; + isSetPoIStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public POISystemData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this POISystemData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + POISystemData poISystemData = (POISystemData) o; + return Objects.equals(this.dateTime, poISystemData.dateTime) + && Objects.equals(this.isSetDateTime, poISystemData.isSetDateTime) + && Objects.equals(this.poISoftware, poISystemData.poISoftware) + && Objects.equals(this.isSetPoISoftware, poISystemData.isSetPoISoftware) + && Objects.equals(this.poIStatus, poISystemData.poIStatus) + && Objects.equals(this.isSetPoIStatus, poISystemData.isSetPoIStatus); + } + + @Override + public int hashCode() { + return Objects.hash( + dateTime, isSetDateTime, poISoftware, isSetPoISoftware, poIStatus, isSetPoIStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class POISystemData {\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" poISoftware: ").append(toIndentedString(poISoftware)).append("\n"); + sb.append(" poIStatus: ").append(toIndentedString(poIStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDateTime) { + addIfNull(nulls, JSON_PROPERTY_DATE_TIME, this.dateTime); + } + if (isSetPoISoftware) { + addIfNull(nulls, JSON_PROPERTY_PO_I_SOFTWARE, this.poISoftware); + } + if (isSetPoIStatus) { + addIfNull(nulls, JSON_PROPERTY_PO_I_STATUS, this.poIStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of POISystemData given an JSON string + * + * @param jsonString JSON string + * @return An instance of POISystemData + * @throws JsonProcessingException if the JSON string is invalid with respect to POISystemData + */ + public static POISystemData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, POISystemData.class); + } + + /** + * Convert an instance of POISystemData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentAccountReq.java b/src/main/java/com/adyen/model/tapi/PaymentAccountReq.java new file mode 100644 index 000000000..096a4531a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentAccountReq.java @@ -0,0 +1,301 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PaymentAccountReq */ +@JsonPropertyOrder({ + PaymentAccountReq.JSON_PROPERTY_ACCOUNT_TYPE, + PaymentAccountReq.JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, + PaymentAccountReq.JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA +}) +public class PaymentAccountReq { + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "AccountType"; + private AccountType accountType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + + public static final String JSON_PROPERTY_CARD_ACQUISITION_REFERENCE = "CardAcquisitionReference"; + private TransactionIdentification cardAcquisitionReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionReference = false; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA = "PaymentInstrumentData"; + private PaymentInstrumentData paymentInstrumentData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentAccountReq() {} + + /** + * Type of cardholder account used for the transaction. Allows a cardholder to select the type of + * account used for the transaction. Possible values: * **CardTotals** * **Checking** * + * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** * **Universal** + * + * @param accountType Type of cardholder account used for the transaction. Allows a cardholder to + * select the type of account used for the transaction. Possible values: * **CardTotals** * + * **Checking** * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** + * * **Universal** + * @return the current {@code PaymentAccountReq} instance, allowing for method chaining + */ + public PaymentAccountReq accountType(AccountType accountType) { + this.accountType = accountType; + isSetAccountType = true; // mark as set + return this; + } + + /** + * Type of cardholder account used for the transaction. Allows a cardholder to select the type of + * account used for the transaction. Possible values: * **CardTotals** * **Checking** * + * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** * **Universal** + * + * @return accountType Type of cardholder account used for the transaction. Allows a cardholder to + * select the type of account used for the transaction. Possible values: * **CardTotals** * + * **Checking** * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** + * * **Universal** + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccountType getAccountType() { + return accountType; + } + + /** + * Type of cardholder account used for the transaction. Allows a cardholder to select the type of + * account used for the transaction. Possible values: * **CardTotals** * **Checking** * + * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** * **Universal** + * + * @param accountType Type of cardholder account used for the transaction. Allows a cardholder to + * select the type of account used for the transaction. Possible values: * **CardTotals** * + * **Checking** * **CreditCard** * **Default** * **EpurseCard** * **Investment** * **Savings** + * * **Universal** + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountType(AccountType accountType) { + this.accountType = accountType; + isSetAccountType = true; // mark as set + } + + /** + * cardAcquisitionReference + * + * @param cardAcquisitionReference + * @return the current {@code PaymentAccountReq} instance, allowing for method chaining + */ + public PaymentAccountReq cardAcquisitionReference( + TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + return this; + } + + /** + * Get cardAcquisitionReference + * + * @return cardAcquisitionReference + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * cardAcquisitionReference + * + * @param cardAcquisitionReference + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + * @return the current {@code PaymentAccountReq} instance, allowing for method chaining + */ + public PaymentAccountReq paymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + return this; + } + + /** + * Get paymentInstrumentData + * + * @return paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAccountReq includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentAccountReq object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentAccountReq paymentAccountReq = (PaymentAccountReq) o; + return Objects.equals(this.accountType, paymentAccountReq.accountType) + && Objects.equals(this.isSetAccountType, paymentAccountReq.isSetAccountType) + && Objects.equals(this.cardAcquisitionReference, paymentAccountReq.cardAcquisitionReference) + && Objects.equals( + this.isSetCardAcquisitionReference, paymentAccountReq.isSetCardAcquisitionReference) + && Objects.equals(this.paymentInstrumentData, paymentAccountReq.paymentInstrumentData) + && Objects.equals( + this.isSetPaymentInstrumentData, paymentAccountReq.isSetPaymentInstrumentData); + } + + @Override + public int hashCode() { + return Objects.hash( + accountType, + isSetAccountType, + cardAcquisitionReference, + isSetCardAcquisitionReference, + paymentInstrumentData, + isSetPaymentInstrumentData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentAccountReq {\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" cardAcquisitionReference: ") + .append(toIndentedString(cardAcquisitionReference)) + .append("\n"); + sb.append(" paymentInstrumentData: ") + .append(toIndentedString(paymentInstrumentData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetCardAcquisitionReference) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, this.cardAcquisitionReference); + } + if (isSetPaymentInstrumentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, this.paymentInstrumentData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentAccountReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentAccountReq + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentAccountReq + */ + public static PaymentAccountReq fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentAccountReq.class); + } + + /** + * Convert an instance of PaymentAccountReq to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentAccountStatus.java b/src/main/java/com/adyen/model/tapi/PaymentAccountStatus.java new file mode 100644 index 000000000..217083c7e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentAccountStatus.java @@ -0,0 +1,338 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** PaymentAccountStatus */ +@JsonPropertyOrder({ + PaymentAccountStatus.JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, + PaymentAccountStatus.JSON_PROPERTY_CURRENT_BALANCE, + PaymentAccountStatus.JSON_PROPERTY_CURRENCY, + PaymentAccountStatus.JSON_PROPERTY_PAYMENT_ACQUIRER_DATA +}) +public class PaymentAccountStatus { + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA = "PaymentInstrumentData"; + private PaymentInstrumentData paymentInstrumentData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentData = false; + + public static final String JSON_PROPERTY_CURRENT_BALANCE = "CurrentBalance"; + private BigDecimal currentBalance; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = false; + + public static final String JSON_PROPERTY_CURRENCY = "Currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_PAYMENT_ACQUIRER_DATA = "PaymentAcquirerData"; + private PaymentAcquirerData paymentAcquirerData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAcquirerData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentAccountStatus() {} + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + * @return the current {@code PaymentAccountStatus} instance, allowing for method chaining + */ + public PaymentAccountStatus paymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + return this; + } + + /** + * Get paymentInstrumentData + * + * @return paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + } + + /** + * Balance of an account after processing of the transaction. + * + * @param currentBalance Balance of an account after processing of the transaction. + * @return the current {@code PaymentAccountStatus} instance, allowing for method chaining + */ + public PaymentAccountStatus currentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set + return this; + } + + /** + * Balance of an account after processing of the transaction. minimum: 0.0 maximum: + * 99999999.999999 + * + * @return currentBalance Balance of an account after processing of the transaction. + */ + @JsonProperty(JSON_PROPERTY_CURRENT_BALANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * Balance of an account after processing of the transaction. + * + * @param currentBalance Balance of an account after processing of the transaction. + */ + @JsonProperty(JSON_PROPERTY_CURRENT_BALANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + * @return the current {@code PaymentAccountStatus} instance, allowing for method chaining + */ + public PaymentAccountStatus currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. + * + * @return currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * paymentAcquirerData + * + * @param paymentAcquirerData + * @return the current {@code PaymentAccountStatus} instance, allowing for method chaining + */ + public PaymentAccountStatus paymentAcquirerData(PaymentAcquirerData paymentAcquirerData) { + this.paymentAcquirerData = paymentAcquirerData; + isSetPaymentAcquirerData = true; // mark as set + return this; + } + + /** + * Get paymentAcquirerData + * + * @return paymentAcquirerData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentAcquirerData getPaymentAcquirerData() { + return paymentAcquirerData; + } + + /** + * paymentAcquirerData + * + * @param paymentAcquirerData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentAcquirerData(PaymentAcquirerData paymentAcquirerData) { + this.paymentAcquirerData = paymentAcquirerData; + isSetPaymentAcquirerData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAccountStatus includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentAccountStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentAccountStatus paymentAccountStatus = (PaymentAccountStatus) o; + return Objects.equals(this.paymentInstrumentData, paymentAccountStatus.paymentInstrumentData) + && Objects.equals( + this.isSetPaymentInstrumentData, paymentAccountStatus.isSetPaymentInstrumentData) + && Objects.equals(this.currentBalance, paymentAccountStatus.currentBalance) + && Objects.equals(this.isSetCurrentBalance, paymentAccountStatus.isSetCurrentBalance) + && Objects.equals(this.currency, paymentAccountStatus.currency) + && Objects.equals(this.isSetCurrency, paymentAccountStatus.isSetCurrency) + && Objects.equals(this.paymentAcquirerData, paymentAccountStatus.paymentAcquirerData) + && Objects.equals( + this.isSetPaymentAcquirerData, paymentAccountStatus.isSetPaymentAcquirerData); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentInstrumentData, + isSetPaymentInstrumentData, + currentBalance, + isSetCurrentBalance, + currency, + isSetCurrency, + paymentAcquirerData, + isSetPaymentAcquirerData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentAccountStatus {\n"); + sb.append(" paymentInstrumentData: ") + .append(toIndentedString(paymentInstrumentData)) + .append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" paymentAcquirerData: ") + .append(toIndentedString(paymentAcquirerData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentInstrumentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, this.paymentInstrumentData); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetPaymentAcquirerData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACQUIRER_DATA, this.paymentAcquirerData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentAccountStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentAccountStatus + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PaymentAccountStatus + */ + public static PaymentAccountStatus fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentAccountStatus.class); + } + + /** + * Convert an instance of PaymentAccountStatus to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentAcquirerData.java b/src/main/java/com/adyen/model/tapi/PaymentAcquirerData.java new file mode 100644 index 000000000..c7c25d1f7 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentAcquirerData.java @@ -0,0 +1,452 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Data related to the response from the payment Acquirer. */ +@JsonPropertyOrder({ + PaymentAcquirerData.JSON_PROPERTY_ACQUIRER_I_D, + PaymentAcquirerData.JSON_PROPERTY_MERCHANT_I_D, + PaymentAcquirerData.JSON_PROPERTY_ACQUIRER_P_O_I_I_D, + PaymentAcquirerData.JSON_PROPERTY_ACQUIRER_TRANSACTION_I_D, + PaymentAcquirerData.JSON_PROPERTY_APPROVAL_CODE, + PaymentAcquirerData.JSON_PROPERTY_HOST_RECONCILIATION_I_D +}) +public class PaymentAcquirerData { + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private Integer acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + public static final String JSON_PROPERTY_MERCHANT_I_D = "MerchantID"; + private String merchantID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantID = false; + + public static final String JSON_PROPERTY_ACQUIRER_P_O_I_I_D = "AcquirerPOIID"; + private String acquirerPOIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerPOIID = false; + + public static final String JSON_PROPERTY_ACQUIRER_TRANSACTION_I_D = "AcquirerTransactionID"; + private TransactionIdentification acquirerTransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerTransactionID = false; + + public static final String JSON_PROPERTY_APPROVAL_CODE = "ApprovalCode"; + private String approvalCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApprovalCode = false; + + public static final String JSON_PROPERTY_HOST_RECONCILIATION_I_D = "HostReconciliationID"; + private String hostReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostReconciliationID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentAcquirerData() {} + + /** + * Identification of the Acquirer. Identification of the Acquirer when the POI System is + * multi-acquirer. + * + * @param acquirerID Identification of the Acquirer. Identification of the Acquirer when the POI + * System is multi-acquirer. + * @return the current {@code PaymentAcquirerData} instance, allowing for method chaining + */ + public PaymentAcquirerData acquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + /** + * Identification of the Acquirer. Identification of the Acquirer when the POI System is + * multi-acquirer. + * + * @return acquirerID Identification of the Acquirer. Identification of the Acquirer when the POI + * System is multi-acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. Identification of the Acquirer when the POI System is + * multi-acquirer. + * + * @param acquirerID Identification of the Acquirer. Identification of the Acquirer when the POI + * System is multi-acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * Identification of the Merchant for the Acquirer. + * + * @param merchantID Identification of the Merchant for the Acquirer. + * @return the current {@code PaymentAcquirerData} instance, allowing for method chaining + */ + public PaymentAcquirerData merchantID(String merchantID) { + this.merchantID = merchantID; + isSetMerchantID = true; // mark as set + return this; + } + + /** + * Identification of the Merchant for the Acquirer. + * + * @return merchantID Identification of the Merchant for the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantID() { + return merchantID; + } + + /** + * Identification of the Merchant for the Acquirer. + * + * @param merchantID Identification of the Merchant for the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantID(String merchantID) { + this.merchantID = merchantID; + isSetMerchantID = true; // mark as set + } + + /** + * Identification of the POI for the payment Acquirer. + * + * @param acquirerPOIID Identification of the POI for the payment Acquirer. + * @return the current {@code PaymentAcquirerData} instance, allowing for method chaining + */ + public PaymentAcquirerData acquirerPOIID(String acquirerPOIID) { + this.acquirerPOIID = acquirerPOIID; + isSetAcquirerPOIID = true; // mark as set + return this; + } + + /** + * Identification of the POI for the payment Acquirer. + * + * @return acquirerPOIID Identification of the POI for the payment Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcquirerPOIID() { + return acquirerPOIID; + } + + /** + * Identification of the POI for the payment Acquirer. + * + * @param acquirerPOIID Identification of the POI for the payment Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerPOIID(String acquirerPOIID) { + this.acquirerPOIID = acquirerPOIID; + isSetAcquirerPOIID = true; // mark as set + } + + /** + * Identification of the Transaction for the Acquirer. If provided by the Acquirer. + * + * @param acquirerTransactionID Identification of the Transaction for the Acquirer. If provided by + * the Acquirer. + * @return the current {@code PaymentAcquirerData} instance, allowing for method chaining + */ + public PaymentAcquirerData acquirerTransactionID( + TransactionIdentification acquirerTransactionID) { + this.acquirerTransactionID = acquirerTransactionID; + isSetAcquirerTransactionID = true; // mark as set + return this; + } + + /** + * Identification of the Transaction for the Acquirer. If provided by the Acquirer. + * + * @return acquirerTransactionID Identification of the Transaction for the Acquirer. If provided + * by the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getAcquirerTransactionID() { + return acquirerTransactionID; + } + + /** + * Identification of the Transaction for the Acquirer. If provided by the Acquirer. + * + * @param acquirerTransactionID Identification of the Transaction for the Acquirer. If provided by + * the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerTransactionID(TransactionIdentification acquirerTransactionID) { + this.acquirerTransactionID = acquirerTransactionID; + isSetAcquirerTransactionID = true; // mark as set + } + + /** + * Code assigned to a transaction approval by the Acquirer. If available. + * + * @param approvalCode Code assigned to a transaction approval by the Acquirer. If available. + * @return the current {@code PaymentAcquirerData} instance, allowing for method chaining + */ + public PaymentAcquirerData approvalCode(String approvalCode) { + this.approvalCode = approvalCode; + isSetApprovalCode = true; // mark as set + return this; + } + + /** + * Code assigned to a transaction approval by the Acquirer. If available. + * + * @return approvalCode Code assigned to a transaction approval by the Acquirer. If available. + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApprovalCode() { + return approvalCode; + } + + /** + * Code assigned to a transaction approval by the Acquirer. If available. + * + * @param approvalCode Code assigned to a transaction approval by the Acquirer. If available. + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApprovalCode(String approvalCode) { + this.approvalCode = approvalCode; + isSetApprovalCode = true; // mark as set + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. Allows the assignment of + * a transaction to the Acquirer reconciliation (or batch). + * + * @param hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. Allows the assignment of a transaction to the Acquirer reconciliation (or batch). + * @return the current {@code PaymentAcquirerData} instance, allowing for method chaining + */ + public PaymentAcquirerData hostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + isSetHostReconciliationID = true; // mark as set + return this; + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. Allows the assignment of + * a transaction to the Acquirer reconciliation (or batch). + * + * @return hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. Allows the assignment of a transaction to the Acquirer reconciliation (or batch). + */ + @JsonProperty(JSON_PROPERTY_HOST_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHostReconciliationID() { + return hostReconciliationID; + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. Allows the assignment of + * a transaction to the Acquirer reconciliation (or batch). + * + * @param hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. Allows the assignment of a transaction to the Acquirer reconciliation (or batch). + */ + @JsonProperty(JSON_PROPERTY_HOST_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + isSetHostReconciliationID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAcquirerData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentAcquirerData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentAcquirerData paymentAcquirerData = (PaymentAcquirerData) o; + return Objects.equals(this.acquirerID, paymentAcquirerData.acquirerID) + && Objects.equals(this.isSetAcquirerID, paymentAcquirerData.isSetAcquirerID) + && Objects.equals(this.merchantID, paymentAcquirerData.merchantID) + && Objects.equals(this.isSetMerchantID, paymentAcquirerData.isSetMerchantID) + && Objects.equals(this.acquirerPOIID, paymentAcquirerData.acquirerPOIID) + && Objects.equals(this.isSetAcquirerPOIID, paymentAcquirerData.isSetAcquirerPOIID) + && Objects.equals(this.acquirerTransactionID, paymentAcquirerData.acquirerTransactionID) + && Objects.equals( + this.isSetAcquirerTransactionID, paymentAcquirerData.isSetAcquirerTransactionID) + && Objects.equals(this.approvalCode, paymentAcquirerData.approvalCode) + && Objects.equals(this.isSetApprovalCode, paymentAcquirerData.isSetApprovalCode) + && Objects.equals(this.hostReconciliationID, paymentAcquirerData.hostReconciliationID) + && Objects.equals( + this.isSetHostReconciliationID, paymentAcquirerData.isSetHostReconciliationID); + } + + @Override + public int hashCode() { + return Objects.hash( + acquirerID, + isSetAcquirerID, + merchantID, + isSetMerchantID, + acquirerPOIID, + isSetAcquirerPOIID, + acquirerTransactionID, + isSetAcquirerTransactionID, + approvalCode, + isSetApprovalCode, + hostReconciliationID, + isSetHostReconciliationID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentAcquirerData {\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append(" merchantID: ").append(toIndentedString(merchantID)).append("\n"); + sb.append(" acquirerPOIID: ").append(toIndentedString(acquirerPOIID)).append("\n"); + sb.append(" acquirerTransactionID: ") + .append(toIndentedString(acquirerTransactionID)) + .append("\n"); + sb.append(" approvalCode: ").append(toIndentedString(approvalCode)).append("\n"); + sb.append(" hostReconciliationID: ") + .append(toIndentedString(hostReconciliationID)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + if (isSetMerchantID) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_I_D, this.merchantID); + } + if (isSetAcquirerPOIID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_P_O_I_I_D, this.acquirerPOIID); + } + if (isSetAcquirerTransactionID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_TRANSACTION_I_D, this.acquirerTransactionID); + } + if (isSetApprovalCode) { + addIfNull(nulls, JSON_PROPERTY_APPROVAL_CODE, this.approvalCode); + } + if (isSetHostReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_HOST_RECONCILIATION_I_D, this.hostReconciliationID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentAcquirerData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentAcquirerData + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PaymentAcquirerData + */ + public static PaymentAcquirerData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentAcquirerData.class); + } + + /** + * Convert an instance of PaymentAcquirerData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentData.java b/src/main/java/com/adyen/model/tapi/PaymentData.java new file mode 100644 index 000000000..9756b33a1 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentData.java @@ -0,0 +1,479 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.LocalDate; +import java.util.*; + +/** PaymentData */ +@JsonPropertyOrder({ + PaymentData.JSON_PROPERTY_PAYMENT_TYPE, + PaymentData.JSON_PROPERTY_SPLIT_PAYMENT_FLAG, + PaymentData.JSON_PROPERTY_REQUESTED_VALIDITY_DATE, + PaymentData.JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, + PaymentData.JSON_PROPERTY_INSTALMENT, + PaymentData.JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA +}) +public class PaymentData { + public static final String JSON_PROPERTY_PAYMENT_TYPE = "PaymentType"; + private PaymentType paymentType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentType = false; + + public static final String JSON_PROPERTY_SPLIT_PAYMENT_FLAG = "SplitPaymentFlag"; + private Boolean splitPaymentFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitPaymentFlag = false; + + public static final String JSON_PROPERTY_REQUESTED_VALIDITY_DATE = "RequestedValidityDate"; + private LocalDate requestedValidityDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedValidityDate = false; + + public static final String JSON_PROPERTY_CARD_ACQUISITION_REFERENCE = "CardAcquisitionReference"; + private TransactionIdentification cardAcquisitionReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionReference = false; + + public static final String JSON_PROPERTY_INSTALMENT = "Instalment"; + private Instalment instalment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstalment = false; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA = "PaymentInstrumentData"; + private PaymentInstrumentData paymentInstrumentData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentData() {} + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @param paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * @return the current {@code PaymentData} instance, allowing for method chaining + */ + public PaymentData paymentType(PaymentType paymentType) { + this.paymentType = paymentType; + isSetPaymentType = true; // mark as set + return this; + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @return paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentType getPaymentType() { + return paymentType; + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @param paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentType(PaymentType paymentType) { + this.paymentType = paymentType; + isSetPaymentType = true; // mark as set + } + + /** + * Indicates if the payment of the Sale transaction is split. Allows the POI to decline payment + * means that cannot accept split payment. + * + * @param splitPaymentFlag Indicates if the payment of the Sale transaction is split. Allows the + * POI to decline payment means that cannot accept split payment. + * @return the current {@code PaymentData} instance, allowing for method chaining + */ + public PaymentData splitPaymentFlag(Boolean splitPaymentFlag) { + this.splitPaymentFlag = splitPaymentFlag; + isSetSplitPaymentFlag = true; // mark as set + return this; + } + + /** + * Indicates if the payment of the Sale transaction is split. Allows the POI to decline payment + * means that cannot accept split payment. + * + * @return splitPaymentFlag Indicates if the payment of the Sale transaction is split. Allows the + * POI to decline payment means that cannot accept split payment. + */ + @JsonProperty(JSON_PROPERTY_SPLIT_PAYMENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSplitPaymentFlag() { + return splitPaymentFlag; + } + + /** + * Indicates if the payment of the Sale transaction is split. Allows the POI to decline payment + * means that cannot accept split payment. + * + * @param splitPaymentFlag Indicates if the payment of the Sale transaction is split. Allows the + * POI to decline payment means that cannot accept split payment. + */ + @JsonProperty(JSON_PROPERTY_SPLIT_PAYMENT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSplitPaymentFlag(Boolean splitPaymentFlag) { + this.splitPaymentFlag = splitPaymentFlag; + isSetSplitPaymentFlag = true; // mark as set + } + + /** + * Requested validity date for the reservation. Allows a specific period for the reservation + * according to the need of the Merchant for the first reservation and the reservation updates as + * well. + * + * @param requestedValidityDate Requested validity date for the reservation. Allows a specific + * period for the reservation according to the need of the Merchant for the first reservation + * and the reservation updates as well. + * @return the current {@code PaymentData} instance, allowing for method chaining + */ + public PaymentData requestedValidityDate(LocalDate requestedValidityDate) { + this.requestedValidityDate = requestedValidityDate; + isSetRequestedValidityDate = true; // mark as set + return this; + } + + /** + * Requested validity date for the reservation. Allows a specific period for the reservation + * according to the need of the Merchant for the first reservation and the reservation updates as + * well. + * + * @return requestedValidityDate Requested validity date for the reservation. Allows a specific + * period for the reservation according to the need of the Merchant for the first reservation + * and the reservation updates as well. + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_VALIDITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocalDate getRequestedValidityDate() { + return requestedValidityDate; + } + + /** + * Requested validity date for the reservation. Allows a specific period for the reservation + * according to the need of the Merchant for the first reservation and the reservation updates as + * well. + * + * @param requestedValidityDate Requested validity date for the reservation. Allows a specific + * period for the reservation according to the need of the Merchant for the first reservation + * and the reservation updates as well. + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_VALIDITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestedValidityDate(LocalDate requestedValidityDate) { + this.requestedValidityDate = requestedValidityDate; + isSetRequestedValidityDate = true; // mark as set + } + + /** + * cardAcquisitionReference + * + * @param cardAcquisitionReference + * @return the current {@code PaymentData} instance, allowing for method chaining + */ + public PaymentData cardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + return this; + } + + /** + * Get cardAcquisitionReference + * + * @return cardAcquisitionReference + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * cardAcquisitionReference + * + * @param cardAcquisitionReference + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + isSetCardAcquisitionReference = true; // mark as set + } + + /** + * Information related an instalment transaction. To request an instalment to the issuer, or to + * make individual instalments of a payment transaction. + * + * @param instalment Information related an instalment transaction. To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + * @return the current {@code PaymentData} instance, allowing for method chaining + */ + public PaymentData instalment(Instalment instalment) { + this.instalment = instalment; + isSetInstalment = true; // mark as set + return this; + } + + /** + * Information related an instalment transaction. To request an instalment to the issuer, or to + * make individual instalments of a payment transaction. + * + * @return instalment Information related an instalment transaction. To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + */ + @JsonProperty(JSON_PROPERTY_INSTALMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Instalment getInstalment() { + return instalment; + } + + /** + * Information related an instalment transaction. To request an instalment to the issuer, or to + * make individual instalments of a payment transaction. + * + * @param instalment Information related an instalment transaction. To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + */ + @JsonProperty(JSON_PROPERTY_INSTALMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstalment(Instalment instalment) { + this.instalment = instalment; + isSetInstalment = true; // mark as set + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + * @return the current {@code PaymentData} instance, allowing for method chaining + */ + public PaymentData paymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + return this; + } + + /** + * Get paymentInstrumentData + * + * @return paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentData paymentData = (PaymentData) o; + return Objects.equals(this.paymentType, paymentData.paymentType) + && Objects.equals(this.isSetPaymentType, paymentData.isSetPaymentType) + && Objects.equals(this.splitPaymentFlag, paymentData.splitPaymentFlag) + && Objects.equals(this.isSetSplitPaymentFlag, paymentData.isSetSplitPaymentFlag) + && Objects.equals(this.requestedValidityDate, paymentData.requestedValidityDate) + && Objects.equals(this.isSetRequestedValidityDate, paymentData.isSetRequestedValidityDate) + && Objects.equals(this.cardAcquisitionReference, paymentData.cardAcquisitionReference) + && Objects.equals( + this.isSetCardAcquisitionReference, paymentData.isSetCardAcquisitionReference) + && Objects.equals(this.instalment, paymentData.instalment) + && Objects.equals(this.isSetInstalment, paymentData.isSetInstalment) + && Objects.equals(this.paymentInstrumentData, paymentData.paymentInstrumentData) + && Objects.equals(this.isSetPaymentInstrumentData, paymentData.isSetPaymentInstrumentData); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentType, + isSetPaymentType, + splitPaymentFlag, + isSetSplitPaymentFlag, + requestedValidityDate, + isSetRequestedValidityDate, + cardAcquisitionReference, + isSetCardAcquisitionReference, + instalment, + isSetInstalment, + paymentInstrumentData, + isSetPaymentInstrumentData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentData {\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" splitPaymentFlag: ").append(toIndentedString(splitPaymentFlag)).append("\n"); + sb.append(" requestedValidityDate: ") + .append(toIndentedString(requestedValidityDate)) + .append("\n"); + sb.append(" cardAcquisitionReference: ") + .append(toIndentedString(cardAcquisitionReference)) + .append("\n"); + sb.append(" instalment: ").append(toIndentedString(instalment)).append("\n"); + sb.append(" paymentInstrumentData: ") + .append(toIndentedString(paymentInstrumentData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TYPE, this.paymentType); + } + if (isSetSplitPaymentFlag) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_PAYMENT_FLAG, this.splitPaymentFlag); + } + if (isSetRequestedValidityDate) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_VALIDITY_DATE, this.requestedValidityDate); + } + if (isSetCardAcquisitionReference) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_REFERENCE, this.cardAcquisitionReference); + } + if (isSetInstalment) { + addIfNull(nulls, JSON_PROPERTY_INSTALMENT, this.instalment); + } + if (isSetPaymentInstrumentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, this.paymentInstrumentData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentData + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentData + */ + public static PaymentData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentData.class); + } + + /** + * Convert an instance of PaymentData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentInstrumentData.java b/src/main/java/com/adyen/model/tapi/PaymentInstrumentData.java new file mode 100644 index 000000000..f29f97aa1 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentInstrumentData.java @@ -0,0 +1,470 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Data related to the instrument of payment for the transaction. Sent in the result of the payment + * transaction. For a card, it could also be sent in the `CardAcquisition` response, to be + * processed by the Sale System. + */ +@JsonPropertyOrder({ + PaymentInstrumentData.JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE, + PaymentInstrumentData.JSON_PROPERTY_PROTECTED_CARD_DATA, + PaymentInstrumentData.JSON_PROPERTY_CARD_DATA, + PaymentInstrumentData.JSON_PROPERTY_CHECK_DATA, + PaymentInstrumentData.JSON_PROPERTY_MOBILE_DATA, + PaymentInstrumentData.JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D +}) +public class PaymentInstrumentData { + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE = "PaymentInstrumentType"; + private PaymentInstrumentType paymentInstrumentType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentType = false; + + public static final String JSON_PROPERTY_PROTECTED_CARD_DATA = "ProtectedCardData"; + private String protectedCardData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProtectedCardData = false; + + public static final String JSON_PROPERTY_CARD_DATA = "CardData"; + private CardData cardData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardData = false; + + public static final String JSON_PROPERTY_CHECK_DATA = "CheckData"; + private CheckData checkData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckData = false; + + public static final String JSON_PROPERTY_MOBILE_DATA = "MobileData"; + private MobileData mobileData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobileData = false; + + public static final String JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D = "StoredValueAccountID"; + private StoredValueAccountID storedValueAccountID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueAccountID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentInstrumentData() {} + + /** + * Type of payment instrument. Possible values: * **Card** * **Cash** * **Check** * **Mobile** * + * **StoredValue** + * + * @param paymentInstrumentType Type of payment instrument. Possible values: * **Card** * **Cash** + * * **Check** * **Mobile** * **StoredValue** + * @return the current {@code PaymentInstrumentData} instance, allowing for method chaining + */ + public PaymentInstrumentData paymentInstrumentType(PaymentInstrumentType paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set + return this; + } + + /** + * Type of payment instrument. Possible values: * **Card** * **Cash** * **Check** * **Mobile** * + * **StoredValue** + * + * @return paymentInstrumentType Type of payment instrument. Possible values: * **Card** * + * **Cash** * **Check** * **Mobile** * **StoredValue** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentType getPaymentInstrumentType() { + return paymentInstrumentType; + } + + /** + * Type of payment instrument. Possible values: * **Card** * **Cash** * **Check** * **Mobile** * + * **StoredValue** + * + * @param paymentInstrumentType Type of payment instrument. Possible values: * **Card** * **Cash** + * * **Check** * **Mobile** * **StoredValue** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentType(PaymentInstrumentType paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set + } + + /** + * Sensitive information related to the payment card, protected by CMS. SensitiveCardData + * protected by CMS EnvelopedData. + * + * @param protectedCardData Sensitive information related to the payment card, protected by CMS. + * SensitiveCardData protected by CMS EnvelopedData. + * @return the current {@code PaymentInstrumentData} instance, allowing for method chaining + */ + public PaymentInstrumentData protectedCardData(String protectedCardData) { + this.protectedCardData = protectedCardData; + isSetProtectedCardData = true; // mark as set + return this; + } + + /** + * Sensitive information related to the payment card, protected by CMS. SensitiveCardData + * protected by CMS EnvelopedData. + * + * @return protectedCardData Sensitive information related to the payment card, protected by CMS. + * SensitiveCardData protected by CMS EnvelopedData. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtectedCardData() { + return protectedCardData; + } + + /** + * Sensitive information related to the payment card, protected by CMS. SensitiveCardData + * protected by CMS EnvelopedData. + * + * @param protectedCardData Sensitive information related to the payment card, protected by CMS. + * SensitiveCardData protected by CMS EnvelopedData. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtectedCardData(String protectedCardData) { + this.protectedCardData = protectedCardData; + isSetProtectedCardData = true; // mark as set + } + + /** + * Information related to the payment card used for the transaction. If PaymentInstrumentType is + * Card. + * + * @param cardData Information related to the payment card used for the transaction. If + * PaymentInstrumentType is Card. + * @return the current {@code PaymentInstrumentData} instance, allowing for method chaining + */ + public PaymentInstrumentData cardData(CardData cardData) { + this.cardData = cardData; + isSetCardData = true; // mark as set + return this; + } + + /** + * Information related to the payment card used for the transaction. If PaymentInstrumentType is + * Card. + * + * @return cardData Information related to the payment card used for the transaction. If + * PaymentInstrumentType is Card. + */ + @JsonProperty(JSON_PROPERTY_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardData getCardData() { + return cardData; + } + + /** + * Information related to the payment card used for the transaction. If PaymentInstrumentType is + * Card. + * + * @param cardData Information related to the payment card used for the transaction. If + * PaymentInstrumentType is Card. + */ + @JsonProperty(JSON_PROPERTY_CARD_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardData(CardData cardData) { + this.cardData = cardData; + isSetCardData = true; // mark as set + } + + /** + * Information related to the paper check used for the transaction. If PaymentInstrumentType is + * Check. + * + * @param checkData Information related to the paper check used for the transaction. If + * PaymentInstrumentType is Check. + * @return the current {@code PaymentInstrumentData} instance, allowing for method chaining + */ + public PaymentInstrumentData checkData(CheckData checkData) { + this.checkData = checkData; + isSetCheckData = true; // mark as set + return this; + } + + /** + * Information related to the paper check used for the transaction. If PaymentInstrumentType is + * Check. + * + * @return checkData Information related to the paper check used for the transaction. If + * PaymentInstrumentType is Check. + */ + @JsonProperty(JSON_PROPERTY_CHECK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckData getCheckData() { + return checkData; + } + + /** + * Information related to the paper check used for the transaction. If PaymentInstrumentType is + * Check. + * + * @param checkData Information related to the paper check used for the transaction. If + * PaymentInstrumentType is Check. + */ + @JsonProperty(JSON_PROPERTY_CHECK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCheckData(CheckData checkData) { + this.checkData = checkData; + isSetCheckData = true; // mark as set + } + + /** + * Information related to the mobile for the payment transaction. If PaymentInstrumentType is + * Mobile. + * + * @param mobileData Information related to the mobile for the payment transaction. If + * PaymentInstrumentType is Mobile. + * @return the current {@code PaymentInstrumentData} instance, allowing for method chaining + */ + public PaymentInstrumentData mobileData(MobileData mobileData) { + this.mobileData = mobileData; + isSetMobileData = true; // mark as set + return this; + } + + /** + * Information related to the mobile for the payment transaction. If PaymentInstrumentType is + * Mobile. + * + * @return mobileData Information related to the mobile for the payment transaction. If + * PaymentInstrumentType is Mobile. + */ + @JsonProperty(JSON_PROPERTY_MOBILE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MobileData getMobileData() { + return mobileData; + } + + /** + * Information related to the mobile for the payment transaction. If PaymentInstrumentType is + * Mobile. + * + * @param mobileData Information related to the mobile for the payment transaction. If + * PaymentInstrumentType is Mobile. + */ + @JsonProperty(JSON_PROPERTY_MOBILE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMobileData(MobileData mobileData) { + this.mobileData = mobileData; + isSetMobileData = true; // mark as set + } + + /** + * storedValueAccountID + * + * @param storedValueAccountID + * @return the current {@code PaymentInstrumentData} instance, allowing for method chaining + */ + public PaymentInstrumentData storedValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + isSetStoredValueAccountID = true; // mark as set + return this; + } + + /** + * Get storedValueAccountID + * + * @return storedValueAccountID + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueAccountID getStoredValueAccountID() { + return storedValueAccountID; + } + + /** + * storedValueAccountID + * + * @param storedValueAccountID + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + isSetStoredValueAccountID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentInstrumentData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInstrumentData paymentInstrumentData = (PaymentInstrumentData) o; + return Objects.equals(this.paymentInstrumentType, paymentInstrumentData.paymentInstrumentType) + && Objects.equals( + this.isSetPaymentInstrumentType, paymentInstrumentData.isSetPaymentInstrumentType) + && Objects.equals(this.protectedCardData, paymentInstrumentData.protectedCardData) + && Objects.equals(this.isSetProtectedCardData, paymentInstrumentData.isSetProtectedCardData) + && Objects.equals(this.cardData, paymentInstrumentData.cardData) + && Objects.equals(this.isSetCardData, paymentInstrumentData.isSetCardData) + && Objects.equals(this.checkData, paymentInstrumentData.checkData) + && Objects.equals(this.isSetCheckData, paymentInstrumentData.isSetCheckData) + && Objects.equals(this.mobileData, paymentInstrumentData.mobileData) + && Objects.equals(this.isSetMobileData, paymentInstrumentData.isSetMobileData) + && Objects.equals(this.storedValueAccountID, paymentInstrumentData.storedValueAccountID) + && Objects.equals( + this.isSetStoredValueAccountID, paymentInstrumentData.isSetStoredValueAccountID); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentInstrumentType, + isSetPaymentInstrumentType, + protectedCardData, + isSetProtectedCardData, + cardData, + isSetCardData, + checkData, + isSetCheckData, + mobileData, + isSetMobileData, + storedValueAccountID, + isSetStoredValueAccountID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrumentData {\n"); + sb.append(" paymentInstrumentType: ") + .append(toIndentedString(paymentInstrumentType)) + .append("\n"); + sb.append(" protectedCardData: ").append(toIndentedString(protectedCardData)).append("\n"); + sb.append(" cardData: ").append(toIndentedString(cardData)).append("\n"); + sb.append(" checkData: ").append(toIndentedString(checkData)).append("\n"); + sb.append(" mobileData: ").append(toIndentedString(mobileData)).append("\n"); + sb.append(" storedValueAccountID: ") + .append(toIndentedString(storedValueAccountID)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentInstrumentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE, this.paymentInstrumentType); + } + if (isSetProtectedCardData) { + addIfNull(nulls, JSON_PROPERTY_PROTECTED_CARD_DATA, this.protectedCardData); + } + if (isSetCardData) { + addIfNull(nulls, JSON_PROPERTY_CARD_DATA, this.cardData); + } + if (isSetCheckData) { + addIfNull(nulls, JSON_PROPERTY_CHECK_DATA, this.checkData); + } + if (isSetMobileData) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_DATA, this.mobileData); + } + if (isSetStoredValueAccountID) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D, this.storedValueAccountID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentInstrumentData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrumentData + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PaymentInstrumentData + */ + public static PaymentInstrumentData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentInstrumentData.class); + } + + /** + * Convert an instance of PaymentInstrumentData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentInstrumentType.java b/src/main/java/com/adyen/model/tapi/PaymentInstrumentType.java new file mode 100644 index 000000000..15e6185df --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentInstrumentType.java @@ -0,0 +1,55 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets PaymentInstrumentType */ +public enum PaymentInstrumentType { + CARD("Card"), + + CASH("Cash"), + + CHECK("Check"), + + MOBILE("Mobile"), + + STORED_VALUE("StoredValue"); + + private String value; + + PaymentInstrumentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PaymentInstrumentType fromValue(String value) { + for (PaymentInstrumentType b : PaymentInstrumentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentReceipt.java b/src/main/java/com/adyen/model/tapi/PaymentReceipt.java new file mode 100644 index 000000000..83d9b2765 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentReceipt.java @@ -0,0 +1,352 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Customer or Merchant payment receipt. If the payment receipts are printed by the Sale system and + * the POI or the Sale does not implement the Print exchange (Basic profile). + */ +@JsonPropertyOrder({ + PaymentReceipt.JSON_PROPERTY_DOCUMENT_QUALIFIER, + PaymentReceipt.JSON_PROPERTY_INTEGRATED_PRINT_FLAG, + PaymentReceipt.JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG, + PaymentReceipt.JSON_PROPERTY_OUTPUT_CONTENT +}) +public class PaymentReceipt { + public static final String JSON_PROPERTY_DOCUMENT_QUALIFIER = "DocumentQualifier"; + private DocumentQualifierType documentQualifier; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentQualifier = false; + + public static final String JSON_PROPERTY_INTEGRATED_PRINT_FLAG = "IntegratedPrintFlag"; + private Boolean integratedPrintFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIntegratedPrintFlag = false; + + public static final String JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG = "RequiredSignatureFlag"; + private Boolean requiredSignatureFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredSignatureFlag = false; + + public static final String JSON_PROPERTY_OUTPUT_CONTENT = "OutputContent"; + private OutputContent outputContent; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputContent = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentReceipt() {} + + /** + * Qualification of the document to print to the Cashier or the Customer. SaleReceipt or + * CashierReceipt. Possible values: * **CashierReceipt** * **CustomerReceipt** * **Document** * + * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * SaleReceipt or CashierReceipt. Possible values: * **CashierReceipt** * **CustomerReceipt** + * * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * @return the current {@code PaymentReceipt} instance, allowing for method chaining + */ + public PaymentReceipt documentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + return this; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. SaleReceipt or + * CashierReceipt. Possible values: * **CashierReceipt** * **CustomerReceipt** * **Document** * + * **Journal** * **SaleReceipt** * **Voucher** + * + * @return documentQualifier Qualification of the document to print to the Cashier or the + * Customer. SaleReceipt or CashierReceipt. Possible values: * **CashierReceipt** * + * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DocumentQualifierType getDocumentQualifier() { + return documentQualifier; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. SaleReceipt or + * CashierReceipt. Possible values: * **CashierReceipt** * **CustomerReceipt** * **Document** * + * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * SaleReceipt or CashierReceipt. Possible values: * **CashierReceipt** * **CustomerReceipt** + * * **Document** * **Journal** * **SaleReceipt** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + } + + /** + * Type of the print integrated to other prints. + * + * @param integratedPrintFlag Type of the print integrated to other prints. + * @return the current {@code PaymentReceipt} instance, allowing for method chaining + */ + public PaymentReceipt integratedPrintFlag(Boolean integratedPrintFlag) { + this.integratedPrintFlag = integratedPrintFlag; + isSetIntegratedPrintFlag = true; // mark as set + return this; + } + + /** + * Type of the print integrated to other prints. + * + * @return integratedPrintFlag Type of the print integrated to other prints. + */ + @JsonProperty(JSON_PROPERTY_INTEGRATED_PRINT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIntegratedPrintFlag() { + return integratedPrintFlag; + } + + /** + * Type of the print integrated to other prints. + * + * @param integratedPrintFlag Type of the print integrated to other prints. + */ + @JsonProperty(JSON_PROPERTY_INTEGRATED_PRINT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntegratedPrintFlag(Boolean integratedPrintFlag) { + this.integratedPrintFlag = integratedPrintFlag; + isSetIntegratedPrintFlag = true; // mark as set + } + + /** + * Indicate that the cardholder payment receipt requires a physical signature by the Customer. + * + * @param requiredSignatureFlag Indicate that the cardholder payment receipt requires a physical + * signature by the Customer. + * @return the current {@code PaymentReceipt} instance, allowing for method chaining + */ + public PaymentReceipt requiredSignatureFlag(Boolean requiredSignatureFlag) { + this.requiredSignatureFlag = requiredSignatureFlag; + isSetRequiredSignatureFlag = true; // mark as set + return this; + } + + /** + * Indicate that the cardholder payment receipt requires a physical signature by the Customer. + * + * @return requiredSignatureFlag Indicate that the cardholder payment receipt requires a physical + * signature by the Customer. + */ + @JsonProperty(JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiredSignatureFlag() { + return requiredSignatureFlag; + } + + /** + * Indicate that the cardholder payment receipt requires a physical signature by the Customer. + * + * @param requiredSignatureFlag Indicate that the cardholder payment receipt requires a physical + * signature by the Customer. + */ + @JsonProperty(JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiredSignatureFlag(Boolean requiredSignatureFlag) { + this.requiredSignatureFlag = requiredSignatureFlag; + isSetRequiredSignatureFlag = true; // mark as set + } + + /** + * Content to display or print. + * + * @param outputContent Content to display or print. + * @return the current {@code PaymentReceipt} instance, allowing for method chaining + */ + public PaymentReceipt outputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + return this; + } + + /** + * Content to display or print. + * + * @return outputContent Content to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Content to display or print. + * + * @param outputContent Content to display or print. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentReceipt includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentReceipt object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentReceipt paymentReceipt = (PaymentReceipt) o; + return Objects.equals(this.documentQualifier, paymentReceipt.documentQualifier) + && Objects.equals(this.isSetDocumentQualifier, paymentReceipt.isSetDocumentQualifier) + && Objects.equals(this.integratedPrintFlag, paymentReceipt.integratedPrintFlag) + && Objects.equals(this.isSetIntegratedPrintFlag, paymentReceipt.isSetIntegratedPrintFlag) + && Objects.equals(this.requiredSignatureFlag, paymentReceipt.requiredSignatureFlag) + && Objects.equals( + this.isSetRequiredSignatureFlag, paymentReceipt.isSetRequiredSignatureFlag) + && Objects.equals(this.outputContent, paymentReceipt.outputContent) + && Objects.equals(this.isSetOutputContent, paymentReceipt.isSetOutputContent); + } + + @Override + public int hashCode() { + return Objects.hash( + documentQualifier, + isSetDocumentQualifier, + integratedPrintFlag, + isSetIntegratedPrintFlag, + requiredSignatureFlag, + isSetRequiredSignatureFlag, + outputContent, + isSetOutputContent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentReceipt {\n"); + sb.append(" documentQualifier: ").append(toIndentedString(documentQualifier)).append("\n"); + sb.append(" integratedPrintFlag: ") + .append(toIndentedString(integratedPrintFlag)) + .append("\n"); + sb.append(" requiredSignatureFlag: ") + .append(toIndentedString(requiredSignatureFlag)) + .append("\n"); + sb.append(" outputContent: ").append(toIndentedString(outputContent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocumentQualifier) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_QUALIFIER, this.documentQualifier); + } + if (isSetIntegratedPrintFlag) { + addIfNull(nulls, JSON_PROPERTY_INTEGRATED_PRINT_FLAG, this.integratedPrintFlag); + } + if (isSetRequiredSignatureFlag) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG, this.requiredSignatureFlag); + } + if (isSetOutputContent) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_CONTENT, this.outputContent); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentReceipt + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentReceipt + */ + public static PaymentReceipt fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentReceipt.class); + } + + /** + * Convert an instance of PaymentReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentRequest.java b/src/main/java/com/adyen/model/tapi/PaymentRequest.java new file mode 100644 index 000000000..eb988d655 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentRequest.java @@ -0,0 +1,348 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * Request sent to terminal to initiate payment. It conveys Information related to the Payment + * transaction to process. Content of the `PaymentRequest` message. + */ +@JsonPropertyOrder({ + PaymentRequest.JSON_PROPERTY_SALE_DATA, + PaymentRequest.JSON_PROPERTY_PAYMENT_TRANSACTION, + PaymentRequest.JSON_PROPERTY_PAYMENT_DATA, + PaymentRequest.JSON_PROPERTY_LOYALTY_DATA +}) +public class PaymentRequest { + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_PAYMENT_TRANSACTION = "PaymentTransaction"; + private PaymentTransaction paymentTransaction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentTransaction = false; + + public static final String JSON_PROPERTY_PAYMENT_DATA = "PaymentData"; + private PaymentData paymentData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + + public static final String JSON_PROPERTY_LOYALTY_DATA = "LoyaltyData"; + private List loyaltyData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentRequest() {} + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + * @return the current {@code PaymentRequest} instance, allowing for method chaining + */ + public PaymentRequest saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. + * + * @return saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the payment and loyalty transaction. + * + * @param paymentTransaction Data related to the payment and loyalty transaction. + * @return the current {@code PaymentRequest} instance, allowing for method chaining + */ + public PaymentRequest paymentTransaction(PaymentTransaction paymentTransaction) { + this.paymentTransaction = paymentTransaction; + isSetPaymentTransaction = true; // mark as set + return this; + } + + /** + * Data related to the payment and loyalty transaction. + * + * @return paymentTransaction Data related to the payment and loyalty transaction. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentTransaction getPaymentTransaction() { + return paymentTransaction; + } + + /** + * Data related to the payment and loyalty transaction. + * + * @param paymentTransaction Data related to the payment and loyalty transaction. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentTransaction(PaymentTransaction paymentTransaction) { + this.paymentTransaction = paymentTransaction; + isSetPaymentTransaction = true; // mark as set + } + + /** + * Data related to the payment transaction. If one data element is present. + * + * @param paymentData Data related to the payment transaction. If one data element is present. + * @return the current {@code PaymentRequest} instance, allowing for method chaining + */ + public PaymentRequest paymentData(PaymentData paymentData) { + this.paymentData = paymentData; + isSetPaymentData = true; // mark as set + return this; + } + + /** + * Data related to the payment transaction. If one data element is present. + * + * @return paymentData Data related to the payment transaction. If one data element is present. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentData getPaymentData() { + return paymentData; + } + + /** + * Data related to the payment transaction. If one data element is present. + * + * @param paymentData Data related to the payment transaction. If one data element is present. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentData(PaymentData paymentData) { + this.paymentData = paymentData; + isSetPaymentData = true; // mark as set + } + + /** + * Data related to a Loyalty program or account. Loyalty cards used with the payment transaction + * and read by the Sale System. + * + * @param loyaltyData Data related to a Loyalty program or account. Loyalty cards used with the + * payment transaction and read by the Sale System. + * @return the current {@code PaymentRequest} instance, allowing for method chaining + */ + public PaymentRequest loyaltyData(List loyaltyData) { + this.loyaltyData = loyaltyData; + isSetLoyaltyData = true; // mark as set + return this; + } + + public PaymentRequest addLoyaltyDataItem(LoyaltyData loyaltyDataItem) { + if (this.loyaltyData == null) { + this.loyaltyData = new ArrayList<>(); + } + this.loyaltyData.add(loyaltyDataItem); + return this; + } + + /** + * Data related to a Loyalty program or account. Loyalty cards used with the payment transaction + * and read by the Sale System. + * + * @return loyaltyData Data related to a Loyalty program or account. Loyalty cards used with the + * payment transaction and read by the Sale System. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLoyaltyData() { + return loyaltyData; + } + + /** + * Data related to a Loyalty program or account. Loyalty cards used with the payment transaction + * and read by the Sale System. + * + * @param loyaltyData Data related to a Loyalty program or account. Loyalty cards used with the + * payment transaction and read by the Sale System. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyData(List loyaltyData) { + this.loyaltyData = loyaltyData; + isSetLoyaltyData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentRequest paymentRequest = (PaymentRequest) o; + return Objects.equals(this.saleData, paymentRequest.saleData) + && Objects.equals(this.isSetSaleData, paymentRequest.isSetSaleData) + && Objects.equals(this.paymentTransaction, paymentRequest.paymentTransaction) + && Objects.equals(this.isSetPaymentTransaction, paymentRequest.isSetPaymentTransaction) + && Objects.equals(this.paymentData, paymentRequest.paymentData) + && Objects.equals(this.isSetPaymentData, paymentRequest.isSetPaymentData) + && Objects.equals(this.loyaltyData, paymentRequest.loyaltyData) + && Objects.equals(this.isSetLoyaltyData, paymentRequest.isSetLoyaltyData); + } + + @Override + public int hashCode() { + return Objects.hash( + saleData, + isSetSaleData, + paymentTransaction, + isSetPaymentTransaction, + paymentData, + isSetPaymentData, + loyaltyData, + isSetLoyaltyData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentRequest {\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" paymentTransaction: ").append(toIndentedString(paymentTransaction)).append("\n"); + sb.append(" paymentData: ").append(toIndentedString(paymentData)).append("\n"); + sb.append(" loyaltyData: ").append(toIndentedString(loyaltyData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetPaymentTransaction) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TRANSACTION, this.paymentTransaction); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetLoyaltyData) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_DATA, this.loyaltyData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentRequest + */ + public static PaymentRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentRequest.class); + } + + /** + * Convert an instance of PaymentRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentResponse.java b/src/main/java/com/adyen/model/tapi/PaymentResponse.java new file mode 100644 index 000000000..1eed759bd --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentResponse.java @@ -0,0 +1,468 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the Payment transaction processed by the POI System. Content of + * the Payment Response message. + */ +@JsonPropertyOrder({ + PaymentResponse.JSON_PROPERTY_RESPONSE, + PaymentResponse.JSON_PROPERTY_SALE_DATA, + PaymentResponse.JSON_PROPERTY_PO_I_DATA, + PaymentResponse.JSON_PROPERTY_PAYMENT_RESULT, + PaymentResponse.JSON_PROPERTY_LOYALTY_RESULT, + PaymentResponse.JSON_PROPERTY_PAYMENT_RECEIPT +}) +public class PaymentResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_PO_I_DATA = "POIData"; + private POIData poIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIData = false; + + public static final String JSON_PROPERTY_PAYMENT_RESULT = "PaymentResult"; + private PaymentResult paymentResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentResult = false; + + public static final String JSON_PROPERTY_LOYALTY_RESULT = "LoyaltyResult"; + private List loyaltyResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyResult = false; + + public static final String JSON_PROPERTY_PAYMENT_RECEIPT = "PaymentReceipt"; + private List paymentReceipt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReceipt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data related to the Sale System. Copy. + * + * @param saleData Data related to the Sale System. Copy. + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. Copy. + * + * @return saleData Data related to the Sale System. Copy. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. Copy. + * + * @param saleData Data related to the Sale System. Copy. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse poIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + return this; + } + + /** + * Data related to the POI System. + * + * @return poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIData getPoIData() { + return poIData; + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + } + + /** + * Data related to the result of a processed payment transaction. If one data element is present. + * + * @param paymentResult Data related to the result of a processed payment transaction. If one data + * element is present. + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse paymentResult(PaymentResult paymentResult) { + this.paymentResult = paymentResult; + isSetPaymentResult = true; // mark as set + return this; + } + + /** + * Data related to the result of a processed payment transaction. If one data element is present. + * + * @return paymentResult Data related to the result of a processed payment transaction. If one + * data element is present. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentResult getPaymentResult() { + return paymentResult; + } + + /** + * Data related to the result of a processed payment transaction. If one data element is present. + * + * @param paymentResult Data related to the result of a processed payment transaction. If one data + * element is present. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentResult(PaymentResult paymentResult) { + this.paymentResult = paymentResult; + isSetPaymentResult = true; // mark as set + } + + /** + * Data related to the result of a processed loyalty transaction. Loyalty cards used with the + * payment transaction. + * + * @param loyaltyResult Data related to the result of a processed loyalty transaction. Loyalty + * cards used with the payment transaction. + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse loyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + isSetLoyaltyResult = true; // mark as set + return this; + } + + public PaymentResponse addLoyaltyResultItem(LoyaltyResult loyaltyResultItem) { + if (this.loyaltyResult == null) { + this.loyaltyResult = new ArrayList<>(); + } + this.loyaltyResult.add(loyaltyResultItem); + return this; + } + + /** + * Data related to the result of a processed loyalty transaction. Loyalty cards used with the + * payment transaction. + * + * @return loyaltyResult Data related to the result of a processed loyalty transaction. Loyalty + * cards used with the payment transaction. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLoyaltyResult() { + return loyaltyResult; + } + + /** + * Data related to the result of a processed loyalty transaction. Loyalty cards used with the + * payment transaction. + * + * @param loyaltyResult Data related to the result of a processed loyalty transaction. Loyalty + * cards used with the payment transaction. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + isSetLoyaltyResult = true; // mark as set + } + + /** + * Customer or Merchant payment receipt. If the payment receipts are printed by the Sale system + * and the POI or the Sale does not implement the Print exchange (Basic profile). + * + * @param paymentReceipt Customer or Merchant payment receipt. If the payment receipts are printed + * by the Sale system and the POI or the Sale does not implement the Print exchange (Basic + * profile). + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse paymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + return this; + } + + public PaymentResponse addPaymentReceiptItem(PaymentReceipt paymentReceiptItem) { + if (this.paymentReceipt == null) { + this.paymentReceipt = new ArrayList<>(); + } + this.paymentReceipt.add(paymentReceiptItem); + return this; + } + + /** + * Customer or Merchant payment receipt. If the payment receipts are printed by the Sale system + * and the POI or the Sale does not implement the Print exchange (Basic profile). + * + * @return paymentReceipt Customer or Merchant payment receipt. If the payment receipts are + * printed by the Sale system and the POI or the Sale does not implement the Print exchange + * (Basic profile). + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentReceipt() { + return paymentReceipt; + } + + /** + * Customer or Merchant payment receipt. If the payment receipts are printed by the Sale system + * and the POI or the Sale does not implement the Print exchange (Basic profile). + * + * @param paymentReceipt Customer or Merchant payment receipt. If the payment receipts are printed + * by the Sale system and the POI or the Sale does not implement the Print exchange (Basic + * profile). + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentResponse paymentResponse = (PaymentResponse) o; + return Objects.equals(this.response, paymentResponse.response) + && Objects.equals(this.isSetResponse, paymentResponse.isSetResponse) + && Objects.equals(this.saleData, paymentResponse.saleData) + && Objects.equals(this.isSetSaleData, paymentResponse.isSetSaleData) + && Objects.equals(this.poIData, paymentResponse.poIData) + && Objects.equals(this.isSetPoIData, paymentResponse.isSetPoIData) + && Objects.equals(this.paymentResult, paymentResponse.paymentResult) + && Objects.equals(this.isSetPaymentResult, paymentResponse.isSetPaymentResult) + && Objects.equals(this.loyaltyResult, paymentResponse.loyaltyResult) + && Objects.equals(this.isSetLoyaltyResult, paymentResponse.isSetLoyaltyResult) + && Objects.equals(this.paymentReceipt, paymentResponse.paymentReceipt) + && Objects.equals(this.isSetPaymentReceipt, paymentResponse.isSetPaymentReceipt); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + saleData, + isSetSaleData, + poIData, + isSetPoIData, + paymentResult, + isSetPaymentResult, + loyaltyResult, + isSetLoyaltyResult, + paymentReceipt, + isSetPaymentReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poIData: ").append(toIndentedString(poIData)).append("\n"); + sb.append(" paymentResult: ").append(toIndentedString(paymentResult)).append("\n"); + sb.append(" loyaltyResult: ").append(toIndentedString(loyaltyResult)).append("\n"); + sb.append(" paymentReceipt: ").append(toIndentedString(paymentReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetPoIData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_DATA, this.poIData); + } + if (isSetPaymentResult) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RESULT, this.paymentResult); + } + if (isSetLoyaltyResult) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_RESULT, this.loyaltyResult); + } + if (isSetPaymentReceipt) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RECEIPT, this.paymentReceipt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentResponse + */ + public static PaymentResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentResponse.class); + } + + /** + * Convert an instance of PaymentResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentResult.java b/src/main/java/com/adyen/model/tapi/PaymentResult.java new file mode 100644 index 000000000..ed4f6f839 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentResult.java @@ -0,0 +1,1035 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.LocalDate; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** PaymentResult */ +@JsonPropertyOrder({ + PaymentResult.JSON_PROPERTY_PAYMENT_TYPE, + PaymentResult.JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, + PaymentResult.JSON_PROPERTY_AMOUNTS_RESP, + PaymentResult.JSON_PROPERTY_INSTALMENT, + PaymentResult.JSON_PROPERTY_CURRENCY_CONVERSION, + PaymentResult.JSON_PROPERTY_MERCHANT_OVERRIDE_FLAG, + PaymentResult.JSON_PROPERTY_CAPTURED_SIGNATURE, + PaymentResult.JSON_PROPERTY_PROTECTED_SIGNATURE, + PaymentResult.JSON_PROPERTY_CUSTOMER_LANGUAGE, + PaymentResult.JSON_PROPERTY_ONLINE_FLAG, + PaymentResult.JSON_PROPERTY_AUTHENTICATION_METHOD, + PaymentResult.JSON_PROPERTY_VALIDITY_DATE, + PaymentResult.JSON_PROPERTY_PAYMENT_ACQUIRER_DATA +}) +public class PaymentResult { + public static final String JSON_PROPERTY_PAYMENT_TYPE = "PaymentType"; + private PaymentType paymentType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentType = false; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA = "PaymentInstrumentData"; + private PaymentInstrumentData paymentInstrumentData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentData = false; + + public static final String JSON_PROPERTY_AMOUNTS_RESP = "AmountsResp"; + private AmountsResp amountsResp; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountsResp = false; + + public static final String JSON_PROPERTY_INSTALMENT = "Instalment"; + private Instalment instalment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstalment = false; + + public static final String JSON_PROPERTY_CURRENCY_CONVERSION = "CurrencyConversion"; + private List currencyConversion; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrencyConversion = false; + + public static final String JSON_PROPERTY_MERCHANT_OVERRIDE_FLAG = "MerchantOverrideFlag"; + private Boolean merchantOverrideFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOverrideFlag = false; + + public static final String JSON_PROPERTY_CAPTURED_SIGNATURE = "CapturedSignature"; + private CapturedSignature capturedSignature; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapturedSignature = false; + + public static final String JSON_PROPERTY_PROTECTED_SIGNATURE = "ProtectedSignature"; + private String protectedSignature; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProtectedSignature = false; + + public static final String JSON_PROPERTY_CUSTOMER_LANGUAGE = "CustomerLanguage"; + private String customerLanguage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerLanguage = false; + + public static final String JSON_PROPERTY_ONLINE_FLAG = "OnlineFlag"; + private Boolean onlineFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnlineFlag = false; + + /** Gets or Sets authenticationMethod */ + public enum AuthenticationMethodEnum { + BYPASS(String.valueOf("Bypass")), + + MANUAL_VERIFICATION(String.valueOf("ManualVerification")), + + MERCHANT_AUTHENTICATION(String.valueOf("MerchantAuthentication")), + + OFFLINE_PIN(String.valueOf("OfflinePIN")), + + ONLINE_PIN(String.valueOf("OnlinePIN")), + + PAPER_SIGNATURE(String.valueOf("PaperSignature")), + + SECURE_CERTIFICATE(String.valueOf("SecureCertificate")), + + SECURE_NO_CERTIFICATE(String.valueOf("SecureNoCertificate")), + + SECURED_CHANNEL(String.valueOf("SecuredChannel")), + + SIGNATURE_CAPTURE(String.valueOf("SignatureCapture")), + + UNKNOWN_METHOD(String.valueOf("UnknownMethod")); + + private static final Logger LOG = Logger.getLogger(AuthenticationMethodEnum.class.getName()); + + private String value; + + AuthenticationMethodEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AuthenticationMethodEnum fromValue(String value) { + for (AuthenticationMethodEnum b : AuthenticationMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "AuthenticationMethodEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(AuthenticationMethodEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_AUTHENTICATION_METHOD = "AuthenticationMethod"; + private List authenticationMethod; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationMethod = false; + + public static final String JSON_PROPERTY_VALIDITY_DATE = "ValidityDate"; + private LocalDate validityDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidityDate = false; + + public static final String JSON_PROPERTY_PAYMENT_ACQUIRER_DATA = "PaymentAcquirerData"; + private PaymentAcquirerData paymentAcquirerData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAcquirerData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentResult() {} + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @param paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult paymentType(PaymentType paymentType) { + this.paymentType = paymentType; + isSetPaymentType = true; // mark as set + return this; + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @return paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentType getPaymentType() { + return paymentType; + } + + /** + * Type of payment transaction. Elements requested by the Sale System that are related to the + * payment only. Possible values: * **CashAdvance** * **CashDeposit** * **Completion** * + * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** * + * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + * + * @param paymentType Type of payment transaction. Elements requested by the Sale System that are + * related to the payment only. Possible values: * **CashAdvance** * **CashDeposit** * + * **Completion** * **FirstReservation** * **Instalment** * **IssuerInstalment** * **Normal** + * * **OneTimeReservation** * **PaidOut** * **Recurring** * **Refund** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentType(PaymentType paymentType) { + this.paymentType = paymentType; + isSetPaymentType = true; // mark as set + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult paymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + return this; + } + + /** + * Get paymentInstrumentData + * + * @return paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * paymentInstrumentData + * + * @param paymentInstrumentData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + isSetPaymentInstrumentData = true; // mark as set + } + + /** + * Various amounts related to the payment response from the POI System. Amounts approved by the + * POI and the Acquirer for the payment and loyalty transaction, containing: * The authorised + * amount to be paid. * The amount of the rebates. * The amount of financial fees. * The cash back + * part of the requested amount for a payment with cash back. * The tip part of the requested + * amount for a payment with tip. + * + * @param amountsResp Various amounts related to the payment response from the POI System. Amounts + * approved by the POI and the Acquirer for the payment and loyalty transaction, containing: * + * The authorised amount to be paid. * The amount of the rebates. * The amount of financial + * fees. * The cash back part of the requested amount for a payment with cash back. * The tip + * part of the requested amount for a payment with tip. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult amountsResp(AmountsResp amountsResp) { + this.amountsResp = amountsResp; + isSetAmountsResp = true; // mark as set + return this; + } + + /** + * Various amounts related to the payment response from the POI System. Amounts approved by the + * POI and the Acquirer for the payment and loyalty transaction, containing: * The authorised + * amount to be paid. * The amount of the rebates. * The amount of financial fees. * The cash back + * part of the requested amount for a payment with cash back. * The tip part of the requested + * amount for a payment with tip. + * + * @return amountsResp Various amounts related to the payment response from the POI System. + * Amounts approved by the POI and the Acquirer for the payment and loyalty transaction, + * containing: * The authorised amount to be paid. * The amount of the rebates. * The amount + * of financial fees. * The cash back part of the requested amount for a payment with cash + * back. * The tip part of the requested amount for a payment with tip. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS_RESP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AmountsResp getAmountsResp() { + return amountsResp; + } + + /** + * Various amounts related to the payment response from the POI System. Amounts approved by the + * POI and the Acquirer for the payment and loyalty transaction, containing: * The authorised + * amount to be paid. * The amount of the rebates. * The amount of financial fees. * The cash back + * part of the requested amount for a payment with cash back. * The tip part of the requested + * amount for a payment with tip. + * + * @param amountsResp Various amounts related to the payment response from the POI System. Amounts + * approved by the POI and the Acquirer for the payment and loyalty transaction, containing: * + * The authorised amount to be paid. * The amount of the rebates. * The amount of financial + * fees. * The cash back part of the requested amount for a payment with cash back. * The tip + * part of the requested amount for a payment with tip. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS_RESP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmountsResp(AmountsResp amountsResp) { + this.amountsResp = amountsResp; + isSetAmountsResp = true; // mark as set + } + + /** + * Information related an instalment transaction. To request an instalment to the issuer, or to + * make individual instalments of a payment transaction. + * + * @param instalment Information related an instalment transaction. To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult instalment(Instalment instalment) { + this.instalment = instalment; + isSetInstalment = true; // mark as set + return this; + } + + /** + * Information related an instalment transaction. To request an instalment to the issuer, or to + * make individual instalments of a payment transaction. + * + * @return instalment Information related an instalment transaction. To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + */ + @JsonProperty(JSON_PROPERTY_INSTALMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Instalment getInstalment() { + return instalment; + } + + /** + * Information related an instalment transaction. To request an instalment to the issuer, or to + * make individual instalments of a payment transaction. + * + * @param instalment Information related an instalment transaction. To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + */ + @JsonProperty(JSON_PROPERTY_INSTALMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstalment(Instalment instalment) { + this.instalment = instalment; + isSetInstalment = true; // mark as set + } + + /** + * Information related to a currency conversion. A currency conversion occurred in the payment, + * and the merchant needs to know information related to this conversion (e.g. to print on the + * sale receipt). + * + * @param currencyConversion Information related to a currency conversion. A currency conversion + * occurred in the payment, and the merchant needs to know information related to this + * conversion (e.g. to print on the sale receipt). + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult currencyConversion(List currencyConversion) { + this.currencyConversion = currencyConversion; + isSetCurrencyConversion = true; // mark as set + return this; + } + + public PaymentResult addCurrencyConversionItem(CurrencyConversion currencyConversionItem) { + if (this.currencyConversion == null) { + this.currencyConversion = new ArrayList<>(); + } + this.currencyConversion.add(currencyConversionItem); + return this; + } + + /** + * Information related to a currency conversion. A currency conversion occurred in the payment, + * and the merchant needs to know information related to this conversion (e.g. to print on the + * sale receipt). + * + * @return currencyConversion Information related to a currency conversion. A currency conversion + * occurred in the payment, and the merchant needs to know information related to this + * conversion (e.g. to print on the sale receipt). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY_CONVERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCurrencyConversion() { + return currencyConversion; + } + + /** + * Information related to a currency conversion. A currency conversion occurred in the payment, + * and the merchant needs to know information related to this conversion (e.g. to print on the + * sale receipt). + * + * @param currencyConversion Information related to a currency conversion. A currency conversion + * occurred in the payment, and the merchant needs to know information related to this + * conversion (e.g. to print on the sale receipt). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY_CONVERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrencyConversion(List currencyConversion) { + this.currencyConversion = currencyConversion; + isSetCurrencyConversion = true; // mark as set + } + + /** + * Indicates that the Merchant forced the result of the payment to successful. Allows the Sale + * System to be sure that the payment has been forced. + * + * @param merchantOverrideFlag Indicates that the Merchant forced the result of the payment to + * successful. Allows the Sale System to be sure that the payment has been forced. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult merchantOverrideFlag(Boolean merchantOverrideFlag) { + this.merchantOverrideFlag = merchantOverrideFlag; + isSetMerchantOverrideFlag = true; // mark as set + return this; + } + + /** + * Indicates that the Merchant forced the result of the payment to successful. Allows the Sale + * System to be sure that the payment has been forced. + * + * @return merchantOverrideFlag Indicates that the Merchant forced the result of the payment to + * successful. Allows the Sale System to be sure that the payment has been forced. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_OVERRIDE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMerchantOverrideFlag() { + return merchantOverrideFlag; + } + + /** + * Indicates that the Merchant forced the result of the payment to successful. Allows the Sale + * System to be sure that the payment has been forced. + * + * @param merchantOverrideFlag Indicates that the Merchant forced the result of the payment to + * successful. Allows the Sale System to be sure that the payment has been forced. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_OVERRIDE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantOverrideFlag(Boolean merchantOverrideFlag) { + this.merchantOverrideFlag = merchantOverrideFlag; + isSetMerchantOverrideFlag = true; // mark as set + } + + /** + * Numeric value of a handwritten signature. Contains the value of a handwritten signature, e.g. + * the signature of a cardholder on the merchant payment receipt. Only one format of the signature + * is allowed: * The size of the pad area where the signature is written, given with the maximum + * abscissa and ordinate values. * The sequence of coordinates where the pen changes direction or + * lift. + * + * @param capturedSignature Numeric value of a handwritten signature. Contains the value of a + * handwritten signature, e.g. the signature of a cardholder on the merchant payment receipt. + * Only one format of the signature is allowed: * The size of the pad area where the signature + * is written, given with the maximum abscissa and ordinate values. * The sequence of + * coordinates where the pen changes direction or lift. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult capturedSignature(CapturedSignature capturedSignature) { + this.capturedSignature = capturedSignature; + isSetCapturedSignature = true; // mark as set + return this; + } + + /** + * Numeric value of a handwritten signature. Contains the value of a handwritten signature, e.g. + * the signature of a cardholder on the merchant payment receipt. Only one format of the signature + * is allowed: * The size of the pad area where the signature is written, given with the maximum + * abscissa and ordinate values. * The sequence of coordinates where the pen changes direction or + * lift. + * + * @return capturedSignature Numeric value of a handwritten signature. Contains the value of a + * handwritten signature, e.g. the signature of a cardholder on the merchant payment receipt. + * Only one format of the signature is allowed: * The size of the pad area where the signature + * is written, given with the maximum abscissa and ordinate values. * The sequence of + * coordinates where the pen changes direction or lift. + */ + @JsonProperty(JSON_PROPERTY_CAPTURED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CapturedSignature getCapturedSignature() { + return capturedSignature; + } + + /** + * Numeric value of a handwritten signature. Contains the value of a handwritten signature, e.g. + * the signature of a cardholder on the merchant payment receipt. Only one format of the signature + * is allowed: * The size of the pad area where the signature is written, given with the maximum + * abscissa and ordinate values. * The sequence of coordinates where the pen changes direction or + * lift. + * + * @param capturedSignature Numeric value of a handwritten signature. Contains the value of a + * handwritten signature, e.g. the signature of a cardholder on the merchant payment receipt. + * Only one format of the signature is allowed: * The size of the pad area where the signature + * is written, given with the maximum abscissa and ordinate values. * The sequence of + * coordinates where the pen changes direction or lift. + */ + @JsonProperty(JSON_PROPERTY_CAPTURED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapturedSignature(CapturedSignature capturedSignature) { + this.capturedSignature = capturedSignature; + isSetCapturedSignature = true; // mark as set + } + + /** + * Numeric value of a handwritten signature. Contains the value of a handwritten signature, e.g. + * the signature of a cardholder on the merchant payment receipt. The format before encryption is + * the encoded data structure CapturedSignature. The data structure before encryption includes the + * start and end tags for an XML encoding, the identifier and length bytes for an ASN.1 encoding, + * and the complete member ProtectedSignature for a JSON encoding. + * + * @param protectedSignature Numeric value of a handwritten signature. Contains the value of a + * handwritten signature, e.g. the signature of a cardholder on the merchant payment receipt. + * The format before encryption is the encoded data structure CapturedSignature. The data + * structure before encryption includes the start and end tags for an XML encoding, the + * identifier and length bytes for an ASN.1 encoding, and the complete member + * ProtectedSignature for a JSON encoding. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult protectedSignature(String protectedSignature) { + this.protectedSignature = protectedSignature; + isSetProtectedSignature = true; // mark as set + return this; + } + + /** + * Numeric value of a handwritten signature. Contains the value of a handwritten signature, e.g. + * the signature of a cardholder on the merchant payment receipt. The format before encryption is + * the encoded data structure CapturedSignature. The data structure before encryption includes the + * start and end tags for an XML encoding, the identifier and length bytes for an ASN.1 encoding, + * and the complete member ProtectedSignature for a JSON encoding. + * + * @return protectedSignature Numeric value of a handwritten signature. Contains the value of a + * handwritten signature, e.g. the signature of a cardholder on the merchant payment receipt. + * The format before encryption is the encoded data structure CapturedSignature. The data + * structure before encryption includes the start and end tags for an XML encoding, the + * identifier and length bytes for an ASN.1 encoding, and the complete member + * ProtectedSignature for a JSON encoding. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProtectedSignature() { + return protectedSignature; + } + + /** + * Numeric value of a handwritten signature. Contains the value of a handwritten signature, e.g. + * the signature of a cardholder on the merchant payment receipt. The format before encryption is + * the encoded data structure CapturedSignature. The data structure before encryption includes the + * start and end tags for an XML encoding, the identifier and length bytes for an ASN.1 encoding, + * and the complete member ProtectedSignature for a JSON encoding. + * + * @param protectedSignature Numeric value of a handwritten signature. Contains the value of a + * handwritten signature, e.g. the signature of a cardholder on the merchant payment receipt. + * The format before encryption is the encoded data structure CapturedSignature. The data + * structure before encryption includes the start and end tags for an XML encoding, the + * identifier and length bytes for an ASN.1 encoding, and the complete member + * ProtectedSignature for a JSON encoding. + */ + @JsonProperty(JSON_PROPERTY_PROTECTED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtectedSignature(String protectedSignature) { + this.protectedSignature = protectedSignature; + isSetProtectedSignature = true; // mark as set + } + + /** + * The language of the customer that was used on the terminal screen or in text printed by the + * terminal. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @param customerLanguage The language of the customer that was used on the terminal screen or in + * text printed by the terminal. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult customerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + isSetCustomerLanguage = true; // mark as set + return this; + } + + /** + * The language of the customer that was used on the terminal screen or in text printed by the + * terminal. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @return customerLanguage The language of the customer that was used on the terminal screen or + * in text printed by the terminal. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * The language of the customer that was used on the terminal screen or in text printed by the + * terminal. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @param customerLanguage The language of the customer that was used on the terminal screen or in + * text printed by the terminal. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + isSetCustomerLanguage = true; // mark as set + } + + /** + * Indicate that the payment transaction processing has required the approval of a host. Allows + * the Sale System to know if the payment was online or offline. + * + * @param onlineFlag Indicate that the payment transaction processing has required the approval of + * a host. Allows the Sale System to know if the payment was online or offline. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult onlineFlag(Boolean onlineFlag) { + this.onlineFlag = onlineFlag; + isSetOnlineFlag = true; // mark as set + return this; + } + + /** + * Indicate that the payment transaction processing has required the approval of a host. Allows + * the Sale System to know if the payment was online or offline. + * + * @return onlineFlag Indicate that the payment transaction processing has required the approval + * of a host. Allows the Sale System to know if the payment was online or offline. + */ + @JsonProperty(JSON_PROPERTY_ONLINE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getOnlineFlag() { + return onlineFlag; + } + + /** + * Indicate that the payment transaction processing has required the approval of a host. Allows + * the Sale System to know if the payment was online or offline. + * + * @param onlineFlag Indicate that the payment transaction processing has required the approval of + * a host. Allows the Sale System to know if the payment was online or offline. + */ + @JsonProperty(JSON_PROPERTY_ONLINE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOnlineFlag(Boolean onlineFlag) { + this.onlineFlag = onlineFlag; + isSetOnlineFlag = true; // mark as set + } + + /** + * Method for customer authentication. Allows the Sale System informed about customer + * authentication for the payment transaction. Possible values: * **Bypass** * + * **ManualVerification** * **MerchantAuthentication** * **OfflinePIN** * **OnlinePIN** * + * **PaperSignature** * **SecureCertificate** * **SecureNoCertificate** * **SecuredChannel** * + * **SignatureCapture** * **UnknownMethod** + * + * @param authenticationMethod Method for customer authentication. Allows the Sale System informed + * about customer authentication for the payment transaction. Possible values: * **Bypass** * + * **ManualVerification** * **MerchantAuthentication** * **OfflinePIN** * **OnlinePIN** * + * **PaperSignature** * **SecureCertificate** * **SecureNoCertificate** * **SecuredChannel** * + * **SignatureCapture** * **UnknownMethod** + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult authenticationMethod(List authenticationMethod) { + this.authenticationMethod = authenticationMethod; + isSetAuthenticationMethod = true; // mark as set + return this; + } + + public PaymentResult addAuthenticationMethodItem( + AuthenticationMethodEnum authenticationMethodItem) { + if (this.authenticationMethod == null) { + this.authenticationMethod = new ArrayList<>(); + } + this.authenticationMethod.add(authenticationMethodItem); + return this; + } + + /** + * Method for customer authentication. Allows the Sale System informed about customer + * authentication for the payment transaction. Possible values: * **Bypass** * + * **ManualVerification** * **MerchantAuthentication** * **OfflinePIN** * **OnlinePIN** * + * **PaperSignature** * **SecureCertificate** * **SecureNoCertificate** * **SecuredChannel** * + * **SignatureCapture** * **UnknownMethod** + * + * @return authenticationMethod Method for customer authentication. Allows the Sale System + * informed about customer authentication for the payment transaction. Possible values: * + * **Bypass** * **ManualVerification** * **MerchantAuthentication** * **OfflinePIN** * + * **OnlinePIN** * **PaperSignature** * **SecureCertificate** * **SecureNoCertificate** * + * **SecuredChannel** * **SignatureCapture** * **UnknownMethod** + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAuthenticationMethod() { + return authenticationMethod; + } + + /** + * Method for customer authentication. Allows the Sale System informed about customer + * authentication for the payment transaction. Possible values: * **Bypass** * + * **ManualVerification** * **MerchantAuthentication** * **OfflinePIN** * **OnlinePIN** * + * **PaperSignature** * **SecureCertificate** * **SecureNoCertificate** * **SecuredChannel** * + * **SignatureCapture** * **UnknownMethod** + * + * @param authenticationMethod Method for customer authentication. Allows the Sale System informed + * about customer authentication for the payment transaction. Possible values: * **Bypass** * + * **ManualVerification** * **MerchantAuthentication** * **OfflinePIN** * **OnlinePIN** * + * **PaperSignature** * **SecureCertificate** * **SecureNoCertificate** * **SecuredChannel** * + * **SignatureCapture** * **UnknownMethod** + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticationMethod(List authenticationMethod) { + this.authenticationMethod = authenticationMethod; + isSetAuthenticationMethod = true; // mark as set + } + + /** + * End of the validity period for the reservation, for the first reservation, and the reservation + * updates as well. + * + * @param validityDate End of the validity period for the reservation, for the first reservation, + * and the reservation updates as well. + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult validityDate(LocalDate validityDate) { + this.validityDate = validityDate; + isSetValidityDate = true; // mark as set + return this; + } + + /** + * End of the validity period for the reservation, for the first reservation, and the reservation + * updates as well. + * + * @return validityDate End of the validity period for the reservation, for the first reservation, + * and the reservation updates as well. + */ + @JsonProperty(JSON_PROPERTY_VALIDITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocalDate getValidityDate() { + return validityDate; + } + + /** + * End of the validity period for the reservation, for the first reservation, and the reservation + * updates as well. + * + * @param validityDate End of the validity period for the reservation, for the first reservation, + * and the reservation updates as well. + */ + @JsonProperty(JSON_PROPERTY_VALIDITY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidityDate(LocalDate validityDate) { + this.validityDate = validityDate; + isSetValidityDate = true; // mark as set + } + + /** + * paymentAcquirerData + * + * @param paymentAcquirerData + * @return the current {@code PaymentResult} instance, allowing for method chaining + */ + public PaymentResult paymentAcquirerData(PaymentAcquirerData paymentAcquirerData) { + this.paymentAcquirerData = paymentAcquirerData; + isSetPaymentAcquirerData = true; // mark as set + return this; + } + + /** + * Get paymentAcquirerData + * + * @return paymentAcquirerData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentAcquirerData getPaymentAcquirerData() { + return paymentAcquirerData; + } + + /** + * paymentAcquirerData + * + * @param paymentAcquirerData + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentAcquirerData(PaymentAcquirerData paymentAcquirerData) { + this.paymentAcquirerData = paymentAcquirerData; + isSetPaymentAcquirerData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentResult paymentResult = (PaymentResult) o; + return Objects.equals(this.paymentType, paymentResult.paymentType) + && Objects.equals(this.isSetPaymentType, paymentResult.isSetPaymentType) + && Objects.equals(this.paymentInstrumentData, paymentResult.paymentInstrumentData) + && Objects.equals(this.isSetPaymentInstrumentData, paymentResult.isSetPaymentInstrumentData) + && Objects.equals(this.amountsResp, paymentResult.amountsResp) + && Objects.equals(this.isSetAmountsResp, paymentResult.isSetAmountsResp) + && Objects.equals(this.instalment, paymentResult.instalment) + && Objects.equals(this.isSetInstalment, paymentResult.isSetInstalment) + && Objects.equals(this.currencyConversion, paymentResult.currencyConversion) + && Objects.equals(this.isSetCurrencyConversion, paymentResult.isSetCurrencyConversion) + && Objects.equals(this.merchantOverrideFlag, paymentResult.merchantOverrideFlag) + && Objects.equals(this.isSetMerchantOverrideFlag, paymentResult.isSetMerchantOverrideFlag) + && Objects.equals(this.capturedSignature, paymentResult.capturedSignature) + && Objects.equals(this.isSetCapturedSignature, paymentResult.isSetCapturedSignature) + && Objects.equals(this.protectedSignature, paymentResult.protectedSignature) + && Objects.equals(this.isSetProtectedSignature, paymentResult.isSetProtectedSignature) + && Objects.equals(this.customerLanguage, paymentResult.customerLanguage) + && Objects.equals(this.isSetCustomerLanguage, paymentResult.isSetCustomerLanguage) + && Objects.equals(this.onlineFlag, paymentResult.onlineFlag) + && Objects.equals(this.isSetOnlineFlag, paymentResult.isSetOnlineFlag) + && Objects.equals(this.authenticationMethod, paymentResult.authenticationMethod) + && Objects.equals(this.isSetAuthenticationMethod, paymentResult.isSetAuthenticationMethod) + && Objects.equals(this.validityDate, paymentResult.validityDate) + && Objects.equals(this.isSetValidityDate, paymentResult.isSetValidityDate) + && Objects.equals(this.paymentAcquirerData, paymentResult.paymentAcquirerData) + && Objects.equals(this.isSetPaymentAcquirerData, paymentResult.isSetPaymentAcquirerData); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentType, + isSetPaymentType, + paymentInstrumentData, + isSetPaymentInstrumentData, + amountsResp, + isSetAmountsResp, + instalment, + isSetInstalment, + currencyConversion, + isSetCurrencyConversion, + merchantOverrideFlag, + isSetMerchantOverrideFlag, + capturedSignature, + isSetCapturedSignature, + protectedSignature, + isSetProtectedSignature, + customerLanguage, + isSetCustomerLanguage, + onlineFlag, + isSetOnlineFlag, + authenticationMethod, + isSetAuthenticationMethod, + validityDate, + isSetValidityDate, + paymentAcquirerData, + isSetPaymentAcquirerData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentResult {\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" paymentInstrumentData: ") + .append(toIndentedString(paymentInstrumentData)) + .append("\n"); + sb.append(" amountsResp: ").append(toIndentedString(amountsResp)).append("\n"); + sb.append(" instalment: ").append(toIndentedString(instalment)).append("\n"); + sb.append(" currencyConversion: ").append(toIndentedString(currencyConversion)).append("\n"); + sb.append(" merchantOverrideFlag: ") + .append(toIndentedString(merchantOverrideFlag)) + .append("\n"); + sb.append(" capturedSignature: ").append(toIndentedString(capturedSignature)).append("\n"); + sb.append(" protectedSignature: ").append(toIndentedString(protectedSignature)).append("\n"); + sb.append(" customerLanguage: ").append(toIndentedString(customerLanguage)).append("\n"); + sb.append(" onlineFlag: ").append(toIndentedString(onlineFlag)).append("\n"); + sb.append(" authenticationMethod: ") + .append(toIndentedString(authenticationMethod)) + .append("\n"); + sb.append(" validityDate: ").append(toIndentedString(validityDate)).append("\n"); + sb.append(" paymentAcquirerData: ") + .append(toIndentedString(paymentAcquirerData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TYPE, this.paymentType); + } + if (isSetPaymentInstrumentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_DATA, this.paymentInstrumentData); + } + if (isSetAmountsResp) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS_RESP, this.amountsResp); + } + if (isSetInstalment) { + addIfNull(nulls, JSON_PROPERTY_INSTALMENT, this.instalment); + } + if (isSetCurrencyConversion) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY_CONVERSION, this.currencyConversion); + } + if (isSetMerchantOverrideFlag) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_OVERRIDE_FLAG, this.merchantOverrideFlag); + } + if (isSetCapturedSignature) { + addIfNull(nulls, JSON_PROPERTY_CAPTURED_SIGNATURE, this.capturedSignature); + } + if (isSetProtectedSignature) { + addIfNull(nulls, JSON_PROPERTY_PROTECTED_SIGNATURE, this.protectedSignature); + } + if (isSetCustomerLanguage) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_LANGUAGE, this.customerLanguage); + } + if (isSetOnlineFlag) { + addIfNull(nulls, JSON_PROPERTY_ONLINE_FLAG, this.onlineFlag); + } + if (isSetAuthenticationMethod) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_METHOD, this.authenticationMethod); + } + if (isSetValidityDate) { + addIfNull(nulls, JSON_PROPERTY_VALIDITY_DATE, this.validityDate); + } + if (isSetPaymentAcquirerData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACQUIRER_DATA, this.paymentAcquirerData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentResult + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentResult + */ + public static PaymentResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentResult.class); + } + + /** + * Convert an instance of PaymentResult to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentToken.java b/src/main/java/com/adyen/model/tapi/PaymentToken.java new file mode 100644 index 000000000..cf7901154 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentToken.java @@ -0,0 +1,301 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; + +/** + * Surrogate of the PAN (Primary Account Number) of the payment card to identify the payment mean of + * the customer. It allows, for a merchant, to identify the customer. + */ +@JsonPropertyOrder({ + PaymentToken.JSON_PROPERTY_TOKEN_REQUESTED_TYPE, + PaymentToken.JSON_PROPERTY_TOKEN_VALUE, + PaymentToken.JSON_PROPERTY_EXPIRY_DATE_TIME +}) +public class PaymentToken { + public static final String JSON_PROPERTY_TOKEN_REQUESTED_TYPE = "TokenRequestedType"; + private TokenRequestedType tokenRequestedType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestedType = false; + + public static final String JSON_PROPERTY_TOKEN_VALUE = "TokenValue"; + private String tokenValue; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenValue = false; + + public static final String JSON_PROPERTY_EXPIRY_DATE_TIME = "ExpiryDateTime"; + private OffsetDateTime expiryDateTime; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryDateTime = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentToken() {} + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @param tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + * @return the current {@code PaymentToken} instance, allowing for method chaining + */ + public PaymentToken tokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + isSetTokenRequestedType = true; // mark as set + return this; + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @return tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUESTED_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TokenRequestedType getTokenRequestedType() { + return tokenRequestedType; + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @param tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUESTED_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + isSetTokenRequestedType = true; // mark as set + } + + /** + * Payment token replacing the PAN of the payment card to identify the payment mean of the + * customer. + * + * @param tokenValue Payment token replacing the PAN of the payment card to identify the payment + * mean of the customer. + * @return the current {@code PaymentToken} instance, allowing for method chaining + */ + public PaymentToken tokenValue(String tokenValue) { + this.tokenValue = tokenValue; + isSetTokenValue = true; // mark as set + return this; + } + + /** + * Payment token replacing the PAN of the payment card to identify the payment mean of the + * customer. + * + * @return tokenValue Payment token replacing the PAN of the payment card to identify the payment + * mean of the customer. + */ + @JsonProperty(JSON_PROPERTY_TOKEN_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenValue() { + return tokenValue; + } + + /** + * Payment token replacing the PAN of the payment card to identify the payment mean of the + * customer. + * + * @param tokenValue Payment token replacing the PAN of the payment card to identify the payment + * mean of the customer. + */ + @JsonProperty(JSON_PROPERTY_TOKEN_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenValue(String tokenValue) { + this.tokenValue = tokenValue; + isSetTokenValue = true; // mark as set + } + + /** + * Expiry date and time. Limits the validity of a payment token. + * + * @param expiryDateTime Expiry date and time. Limits the validity of a payment token. + * @return the current {@code PaymentToken} instance, allowing for method chaining + */ + public PaymentToken expiryDateTime(OffsetDateTime expiryDateTime) { + this.expiryDateTime = expiryDateTime; + isSetExpiryDateTime = true; // mark as set + return this; + } + + /** + * Expiry date and time. Limits the validity of a payment token. + * + * @return expiryDateTime Expiry date and time. Limits the validity of a payment token. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getExpiryDateTime() { + return expiryDateTime; + } + + /** + * Expiry date and time. Limits the validity of a payment token. + * + * @param expiryDateTime Expiry date and time. Limits the validity of a payment token. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryDateTime(OffsetDateTime expiryDateTime) { + this.expiryDateTime = expiryDateTime; + isSetExpiryDateTime = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentToken includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentToken object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentToken paymentToken = (PaymentToken) o; + return Objects.equals(this.tokenRequestedType, paymentToken.tokenRequestedType) + && Objects.equals(this.isSetTokenRequestedType, paymentToken.isSetTokenRequestedType) + && Objects.equals(this.tokenValue, paymentToken.tokenValue) + && Objects.equals(this.isSetTokenValue, paymentToken.isSetTokenValue) + && Objects.equals(this.expiryDateTime, paymentToken.expiryDateTime) + && Objects.equals(this.isSetExpiryDateTime, paymentToken.isSetExpiryDateTime); + } + + @Override + public int hashCode() { + return Objects.hash( + tokenRequestedType, + isSetTokenRequestedType, + tokenValue, + isSetTokenValue, + expiryDateTime, + isSetExpiryDateTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentToken {\n"); + sb.append(" tokenRequestedType: ").append(toIndentedString(tokenRequestedType)).append("\n"); + sb.append(" tokenValue: ").append(toIndentedString(tokenValue)).append("\n"); + sb.append(" expiryDateTime: ").append(toIndentedString(expiryDateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTokenRequestedType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTED_TYPE, this.tokenRequestedType); + } + if (isSetTokenValue) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_VALUE, this.tokenValue); + } + if (isSetExpiryDateTime) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE_TIME, this.expiryDateTime); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentToken + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentToken + */ + public static PaymentToken fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentToken.class); + } + + /** + * Convert an instance of PaymentToken to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentTotals.java b/src/main/java/com/adyen/model/tapi/PaymentTotals.java new file mode 100644 index 000000000..21e8b26a6 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentTotals.java @@ -0,0 +1,316 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** Totals of the payment transaction during the reconciliation period. */ +@JsonPropertyOrder({ + PaymentTotals.JSON_PROPERTY_TRANSACTION_TYPE, + PaymentTotals.JSON_PROPERTY_TRANSACTION_COUNT, + PaymentTotals.JSON_PROPERTY_TRANSACTION_AMOUNT +}) +public class PaymentTotals { + public static final String JSON_PROPERTY_TRANSACTION_TYPE = "TransactionType"; + private TransactionType transactionType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionType = false; + + public static final String JSON_PROPERTY_TRANSACTION_COUNT = "TransactionCount"; + private Integer transactionCount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionCount = false; + + public static final String JSON_PROPERTY_TRANSACTION_AMOUNT = "TransactionAmount"; + private BigDecimal transactionAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentTotals() {} + + /** + * Type of transaction for which totals are grouped. Debit, Credit, ReverseDebit, ReverseCredit, + * OneTimeReservation, CompletedDeffered, FirstReservation, UpdateReservation, + * CompletedReservation, CashAdvance. Possible values: * **Award** * **CashAdvance** * + * **CompletedDeffered** * **CompletedReservation** * **Credit** * **Debit** * **Declined** * + * **Failed** * **FirstReservation** * **IssuerInstalment** * **OneTimeReservation** * **Rebate** + * * **Redemption** * **ReverseAward** * **ReverseCredit** * **ReverseDebit** * **ReverseRebate** + * * **ReverseRedemption** * **UpdateReservation** + * + * @param transactionType Type of transaction for which totals are grouped. Debit, Credit, + * ReverseDebit, ReverseCredit, OneTimeReservation, CompletedDeffered, FirstReservation, + * UpdateReservation, CompletedReservation, CashAdvance. Possible values: * **Award** * + * **CashAdvance** * **CompletedDeffered** * **CompletedReservation** * **Credit** * **Debit** + * * **Declined** * **Failed** * **FirstReservation** * **IssuerInstalment** * + * **OneTimeReservation** * **Rebate** * **Redemption** * **ReverseAward** * **ReverseCredit** + * * **ReverseDebit** * **ReverseRebate** * **ReverseRedemption** * **UpdateReservation** + * @return the current {@code PaymentTotals} instance, allowing for method chaining + */ + public PaymentTotals transactionType(TransactionType transactionType) { + this.transactionType = transactionType; + isSetTransactionType = true; // mark as set + return this; + } + + /** + * Type of transaction for which totals are grouped. Debit, Credit, ReverseDebit, ReverseCredit, + * OneTimeReservation, CompletedDeffered, FirstReservation, UpdateReservation, + * CompletedReservation, CashAdvance. Possible values: * **Award** * **CashAdvance** * + * **CompletedDeffered** * **CompletedReservation** * **Credit** * **Debit** * **Declined** * + * **Failed** * **FirstReservation** * **IssuerInstalment** * **OneTimeReservation** * **Rebate** + * * **Redemption** * **ReverseAward** * **ReverseCredit** * **ReverseDebit** * **ReverseRebate** + * * **ReverseRedemption** * **UpdateReservation** + * + * @return transactionType Type of transaction for which totals are grouped. Debit, Credit, + * ReverseDebit, ReverseCredit, OneTimeReservation, CompletedDeffered, FirstReservation, + * UpdateReservation, CompletedReservation, CashAdvance. Possible values: * **Award** * + * **CashAdvance** * **CompletedDeffered** * **CompletedReservation** * **Credit** * **Debit** + * * **Declined** * **Failed** * **FirstReservation** * **IssuerInstalment** * + * **OneTimeReservation** * **Rebate** * **Redemption** * **ReverseAward** * **ReverseCredit** + * * **ReverseDebit** * **ReverseRebate** * **ReverseRedemption** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionType getTransactionType() { + return transactionType; + } + + /** + * Type of transaction for which totals are grouped. Debit, Credit, ReverseDebit, ReverseCredit, + * OneTimeReservation, CompletedDeffered, FirstReservation, UpdateReservation, + * CompletedReservation, CashAdvance. Possible values: * **Award** * **CashAdvance** * + * **CompletedDeffered** * **CompletedReservation** * **Credit** * **Debit** * **Declined** * + * **Failed** * **FirstReservation** * **IssuerInstalment** * **OneTimeReservation** * **Rebate** + * * **Redemption** * **ReverseAward** * **ReverseCredit** * **ReverseDebit** * **ReverseRebate** + * * **ReverseRedemption** * **UpdateReservation** + * + * @param transactionType Type of transaction for which totals are grouped. Debit, Credit, + * ReverseDebit, ReverseCredit, OneTimeReservation, CompletedDeffered, FirstReservation, + * UpdateReservation, CompletedReservation, CashAdvance. Possible values: * **Award** * + * **CashAdvance** * **CompletedDeffered** * **CompletedReservation** * **Credit** * **Debit** + * * **Declined** * **Failed** * **FirstReservation** * **IssuerInstalment** * + * **OneTimeReservation** * **Rebate** * **Redemption** * **ReverseAward** * **ReverseCredit** + * * **ReverseDebit** * **ReverseRebate** * **ReverseRedemption** * **UpdateReservation** + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionType(TransactionType transactionType) { + this.transactionType = transactionType; + isSetTransactionType = true; // mark as set + } + + /** + * Number of processed transaction during the period. + * + * @param transactionCount Number of processed transaction during the period. + * @return the current {@code PaymentTotals} instance, allowing for method chaining + */ + public PaymentTotals transactionCount(Integer transactionCount) { + this.transactionCount = transactionCount; + isSetTransactionCount = true; // mark as set + return this; + } + + /** + * Number of processed transaction during the period. + * + * @return transactionCount Number of processed transaction during the period. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTransactionCount() { + return transactionCount; + } + + /** + * Number of processed transaction during the period. + * + * @param transactionCount Number of processed transaction during the period. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionCount(Integer transactionCount) { + this.transactionCount = transactionCount; + isSetTransactionCount = true; // mark as set + } + + /** + * Sum of amount of processed transaction during the period. + * + * @param transactionAmount Sum of amount of processed transaction during the period. + * @return the current {@code PaymentTotals} instance, allowing for method chaining + */ + public PaymentTotals transactionAmount(BigDecimal transactionAmount) { + this.transactionAmount = transactionAmount; + isSetTransactionAmount = true; // mark as set + return this; + } + + /** + * Sum of amount of processed transaction during the period. minimum: 0.0 maximum: 99999999.999999 + * + * @return transactionAmount Sum of amount of processed transaction during the period. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getTransactionAmount() { + return transactionAmount; + } + + /** + * Sum of amount of processed transaction during the period. + * + * @param transactionAmount Sum of amount of processed transaction during the period. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionAmount(BigDecimal transactionAmount) { + this.transactionAmount = transactionAmount; + isSetTransactionAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentTotals includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentTotals object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentTotals paymentTotals = (PaymentTotals) o; + return Objects.equals(this.transactionType, paymentTotals.transactionType) + && Objects.equals(this.isSetTransactionType, paymentTotals.isSetTransactionType) + && Objects.equals(this.transactionCount, paymentTotals.transactionCount) + && Objects.equals(this.isSetTransactionCount, paymentTotals.isSetTransactionCount) + && Objects.equals(this.transactionAmount, paymentTotals.transactionAmount) + && Objects.equals(this.isSetTransactionAmount, paymentTotals.isSetTransactionAmount); + } + + @Override + public int hashCode() { + return Objects.hash( + transactionType, + isSetTransactionType, + transactionCount, + isSetTransactionCount, + transactionAmount, + isSetTransactionAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentTotals {\n"); + sb.append(" transactionType: ").append(toIndentedString(transactionType)).append("\n"); + sb.append(" transactionCount: ").append(toIndentedString(transactionCount)).append("\n"); + sb.append(" transactionAmount: ").append(toIndentedString(transactionAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransactionType) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_TYPE, this.transactionType); + } + if (isSetTransactionCount) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_COUNT, this.transactionCount); + } + if (isSetTransactionAmount) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_AMOUNT, this.transactionAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentTotals given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentTotals + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentTotals + */ + public static PaymentTotals fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentTotals.class); + } + + /** + * Convert an instance of PaymentTotals to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentTransaction.java b/src/main/java/com/adyen/model/tapi/PaymentTransaction.java new file mode 100644 index 000000000..228c26c02 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentTransaction.java @@ -0,0 +1,286 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PaymentTransaction */ +@JsonPropertyOrder({ + PaymentTransaction.JSON_PROPERTY_AMOUNTS_REQ, + PaymentTransaction.JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, + PaymentTransaction.JSON_PROPERTY_TRANSACTION_CONDITIONS +}) +public class PaymentTransaction { + public static final String JSON_PROPERTY_AMOUNTS_REQ = "AmountsReq"; + private AmountsReq amountsReq; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountsReq = false; + + public static final String JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION = "OriginalPOITransaction"; + private OriginalPOITransaction originalPOITransaction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalPOITransaction = false; + + public static final String JSON_PROPERTY_TRANSACTION_CONDITIONS = "TransactionConditions"; + private TransactionConditions transactionConditions; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionConditions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentTransaction() {} + + /** + * Various amounts related to the payment request from the Sale System. + * + * @param amountsReq Various amounts related to the payment request from the Sale System. + * @return the current {@code PaymentTransaction} instance, allowing for method chaining + */ + public PaymentTransaction amountsReq(AmountsReq amountsReq) { + this.amountsReq = amountsReq; + isSetAmountsReq = true; // mark as set + return this; + } + + /** + * Various amounts related to the payment request from the Sale System. + * + * @return amountsReq Various amounts related to the payment request from the Sale System. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AmountsReq getAmountsReq() { + return amountsReq; + } + + /** + * Various amounts related to the payment request from the Sale System. + * + * @param amountsReq Various amounts related to the payment request from the Sale System. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmountsReq(AmountsReq amountsReq) { + this.amountsReq = amountsReq; + isSetAmountsReq = true; // mark as set + } + + /** + * originalPOITransaction + * + * @param originalPOITransaction + * @return the current {@code PaymentTransaction} instance, allowing for method chaining + */ + public PaymentTransaction originalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + return this; + } + + /** + * Get originalPOITransaction + * + * @return originalPOITransaction + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * originalPOITransaction + * + * @param originalPOITransaction + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + } + + /** + * transactionConditions + * + * @param transactionConditions + * @return the current {@code PaymentTransaction} instance, allowing for method chaining + */ + public PaymentTransaction transactionConditions(TransactionConditions transactionConditions) { + this.transactionConditions = transactionConditions; + isSetTransactionConditions = true; // mark as set + return this; + } + + /** + * Get transactionConditions + * + * @return transactionConditions + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionConditions getTransactionConditions() { + return transactionConditions; + } + + /** + * transactionConditions + * + * @param transactionConditions + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionConditions(TransactionConditions transactionConditions) { + this.transactionConditions = transactionConditions; + isSetTransactionConditions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentTransaction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentTransaction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentTransaction paymentTransaction = (PaymentTransaction) o; + return Objects.equals(this.amountsReq, paymentTransaction.amountsReq) + && Objects.equals(this.isSetAmountsReq, paymentTransaction.isSetAmountsReq) + && Objects.equals(this.originalPOITransaction, paymentTransaction.originalPOITransaction) + && Objects.equals( + this.isSetOriginalPOITransaction, paymentTransaction.isSetOriginalPOITransaction) + && Objects.equals(this.transactionConditions, paymentTransaction.transactionConditions) + && Objects.equals( + this.isSetTransactionConditions, paymentTransaction.isSetTransactionConditions); + } + + @Override + public int hashCode() { + return Objects.hash( + amountsReq, + isSetAmountsReq, + originalPOITransaction, + isSetOriginalPOITransaction, + transactionConditions, + isSetTransactionConditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentTransaction {\n"); + sb.append(" amountsReq: ").append(toIndentedString(amountsReq)).append("\n"); + sb.append(" originalPOITransaction: ") + .append(toIndentedString(originalPOITransaction)) + .append("\n"); + sb.append(" transactionConditions: ") + .append(toIndentedString(transactionConditions)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmountsReq) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS_REQ, this.amountsReq); + } + if (isSetOriginalPOITransaction) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, this.originalPOITransaction); + } + if (isSetTransactionConditions) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_CONDITIONS, this.transactionConditions); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentTransaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentTransaction + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PaymentTransaction + */ + public static PaymentTransaction fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentTransaction.class); + } + + /** + * Convert an instance of PaymentTransaction to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PaymentType.java b/src/main/java/com/adyen/model/tapi/PaymentType.java new file mode 100644 index 000000000..ac1dbecd0 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PaymentType.java @@ -0,0 +1,69 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets PaymentType */ +public enum PaymentType { + CASH_ADVANCE("CashAdvance"), + + CASH_DEPOSIT("CashDeposit"), + + COMPLETION("Completion"), + + FIRST_RESERVATION("FirstReservation"), + + INSTALMENT("Instalment"), + + ISSUER_INSTALMENT("IssuerInstalment"), + + NORMAL("Normal"), + + ONE_TIME_RESERVATION("OneTimeReservation"), + + PAID_OUT("PaidOut"), + + RECURRING("Recurring"), + + REFUND("Refund"), + + UPDATE_RESERVATION("UpdateReservation"); + + private String value; + + PaymentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PaymentType fromValue(String value) { + for (PaymentType b : PaymentType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PerformedTransaction.java b/src/main/java/com/adyen/model/tapi/PerformedTransaction.java new file mode 100644 index 000000000..e9ff6ae27 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PerformedTransaction.java @@ -0,0 +1,441 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** PerformedTransaction */ +@JsonPropertyOrder({ + PerformedTransaction.JSON_PROPERTY_RESPONSE, + PerformedTransaction.JSON_PROPERTY_SALE_DATA, + PerformedTransaction.JSON_PROPERTY_PO_I_DATA, + PerformedTransaction.JSON_PROPERTY_PAYMENT_RESULT, + PerformedTransaction.JSON_PROPERTY_LOYALTY_RESULT, + PerformedTransaction.JSON_PROPERTY_REVERSED_AMOUNT +}) +public class PerformedTransaction { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_PO_I_DATA = "POIData"; + private POIData poIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIData = false; + + public static final String JSON_PROPERTY_PAYMENT_RESULT = "PaymentResult"; + private PaymentResult paymentResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentResult = false; + + public static final String JSON_PROPERTY_LOYALTY_RESULT = "LoyaltyResult"; + private List loyaltyResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyResult = false; + + public static final String JSON_PROPERTY_REVERSED_AMOUNT = "ReversedAmount"; + private BigDecimal reversedAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversedAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PerformedTransaction() {} + + /** + * response + * + * @param response + * @return the current {@code PerformedTransaction} instance, allowing for method chaining + */ + public PerformedTransaction response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Get response + * + * @return response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * response + * + * @param response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * saleData + * + * @param saleData + * @return the current {@code PerformedTransaction} instance, allowing for method chaining + */ + public PerformedTransaction saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Get saleData + * + * @return saleData + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * saleData + * + * @param saleData + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * poIData + * + * @param poIData + * @return the current {@code PerformedTransaction} instance, allowing for method chaining + */ + public PerformedTransaction poIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + return this; + } + + /** + * Get poIData + * + * @return poIData + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIData getPoIData() { + return poIData; + } + + /** + * poIData + * + * @param poIData + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + } + + /** + * paymentResult + * + * @param paymentResult + * @return the current {@code PerformedTransaction} instance, allowing for method chaining + */ + public PerformedTransaction paymentResult(PaymentResult paymentResult) { + this.paymentResult = paymentResult; + isSetPaymentResult = true; // mark as set + return this; + } + + /** + * Get paymentResult + * + * @return paymentResult + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentResult getPaymentResult() { + return paymentResult; + } + + /** + * paymentResult + * + * @param paymentResult + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentResult(PaymentResult paymentResult) { + this.paymentResult = paymentResult; + isSetPaymentResult = true; // mark as set + } + + /** + * loyaltyResult + * + * @param loyaltyResult + * @return the current {@code PerformedTransaction} instance, allowing for method chaining + */ + public PerformedTransaction loyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + isSetLoyaltyResult = true; // mark as set + return this; + } + + public PerformedTransaction addLoyaltyResultItem(LoyaltyResult loyaltyResultItem) { + if (this.loyaltyResult == null) { + this.loyaltyResult = new ArrayList<>(); + } + this.loyaltyResult.add(loyaltyResultItem); + return this; + } + + /** + * Get loyaltyResult + * + * @return loyaltyResult + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLoyaltyResult() { + return loyaltyResult; + } + + /** + * loyaltyResult + * + * @param loyaltyResult + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + isSetLoyaltyResult = true; // mark as set + } + + /** + * reversedAmount + * + * @param reversedAmount + * @return the current {@code PerformedTransaction} instance, allowing for method chaining + */ + public PerformedTransaction reversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + isSetReversedAmount = true; // mark as set + return this; + } + + /** + * Get reversedAmount minimum: 0.0 maximum: 99999999.999999 + * + * @return reversedAmount + */ + @JsonProperty(JSON_PROPERTY_REVERSED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getReversedAmount() { + return reversedAmount; + } + + /** + * reversedAmount + * + * @param reversedAmount + */ + @JsonProperty(JSON_PROPERTY_REVERSED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + isSetReversedAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PerformedTransaction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PerformedTransaction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformedTransaction performedTransaction = (PerformedTransaction) o; + return Objects.equals(this.response, performedTransaction.response) + && Objects.equals(this.isSetResponse, performedTransaction.isSetResponse) + && Objects.equals(this.saleData, performedTransaction.saleData) + && Objects.equals(this.isSetSaleData, performedTransaction.isSetSaleData) + && Objects.equals(this.poIData, performedTransaction.poIData) + && Objects.equals(this.isSetPoIData, performedTransaction.isSetPoIData) + && Objects.equals(this.paymentResult, performedTransaction.paymentResult) + && Objects.equals(this.isSetPaymentResult, performedTransaction.isSetPaymentResult) + && Objects.equals(this.loyaltyResult, performedTransaction.loyaltyResult) + && Objects.equals(this.isSetLoyaltyResult, performedTransaction.isSetLoyaltyResult) + && Objects.equals(this.reversedAmount, performedTransaction.reversedAmount) + && Objects.equals(this.isSetReversedAmount, performedTransaction.isSetReversedAmount); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + saleData, + isSetSaleData, + poIData, + isSetPoIData, + paymentResult, + isSetPaymentResult, + loyaltyResult, + isSetLoyaltyResult, + reversedAmount, + isSetReversedAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PerformedTransaction {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poIData: ").append(toIndentedString(poIData)).append("\n"); + sb.append(" paymentResult: ").append(toIndentedString(paymentResult)).append("\n"); + sb.append(" loyaltyResult: ").append(toIndentedString(loyaltyResult)).append("\n"); + sb.append(" reversedAmount: ").append(toIndentedString(reversedAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetPoIData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_DATA, this.poIData); + } + if (isSetPaymentResult) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RESULT, this.paymentResult); + } + if (isSetLoyaltyResult) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_RESULT, this.loyaltyResult); + } + if (isSetReversedAmount) { + addIfNull(nulls, JSON_PROPERTY_REVERSED_AMOUNT, this.reversedAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PerformedTransaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of PerformedTransaction + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PerformedTransaction + */ + public static PerformedTransaction fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PerformedTransaction.class); + } + + /** + * Convert an instance of PerformedTransaction to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PeriodUnit.java b/src/main/java/com/adyen/model/tapi/PeriodUnit.java new file mode 100644 index 000000000..e6305009f --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PeriodUnit.java @@ -0,0 +1,56 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Type of instalment transaction. Possible values: * **Annual** * **Daily** * **Monthly** * + * **Weekly** + */ +public enum PeriodUnit { + ANNUAL("Annual"), + + DAILY("Daily"), + + MONTHLY("Monthly"), + + WEEKLY("Weekly"); + + private String value; + + PeriodUnit(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PeriodUnit fromValue(String value) { + for (PeriodUnit b : PeriodUnit.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/Point.java b/src/main/java/com/adyen/model/tapi/Point.java new file mode 100644 index 000000000..92505444e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/Point.java @@ -0,0 +1,222 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Point */ +@JsonPropertyOrder({Point.JSON_PROPERTY_X, Point.JSON_PROPERTY_Y}) +public class Point { + public static final String JSON_PROPERTY_X = "X"; + private String X; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetX = false; + + public static final String JSON_PROPERTY_Y = "Y"; + private String Y; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetY = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Point() {} + + /** + * The hexadecimal value of the coordinates of a point on the abscissa. + * + * @param X The hexadecimal value of the coordinates of a point on the abscissa. + * @return the current {@code Point} instance, allowing for method chaining + */ + public Point X(String X) { + this.X = X; + isSetX = true; // mark as set + return this; + } + + /** + * The hexadecimal value of the coordinates of a point on the abscissa. + * + * @return X The hexadecimal value of the coordinates of a point on the abscissa. + */ + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getX() { + return X; + } + + /** + * The hexadecimal value of the coordinates of a point on the abscissa. + * + * @param X The hexadecimal value of the coordinates of a point on the abscissa. + */ + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(String X) { + this.X = X; + isSetX = true; // mark as set + } + + /** + * The hexadecimal value of the coordinates of a point on the ordinate. + * + * @param Y The hexadecimal value of the coordinates of a point on the ordinate. + * @return the current {@code Point} instance, allowing for method chaining + */ + public Point Y(String Y) { + this.Y = Y; + isSetY = true; // mark as set + return this; + } + + /** + * The hexadecimal value of the coordinates of a point on the ordinate. + * + * @return Y The hexadecimal value of the coordinates of a point on the ordinate. + */ + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getY() { + return Y; + } + + /** + * The hexadecimal value of the coordinates of a point on the ordinate. + * + * @param Y The hexadecimal value of the coordinates of a point on the ordinate. + */ + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(String Y) { + this.Y = Y; + isSetY = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Point includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Point object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Point point = (Point) o; + return Objects.equals(this.X, point.X) + && Objects.equals(this.isSetX, point.isSetX) + && Objects.equals(this.Y, point.Y) + && Objects.equals(this.isSetY, point.isSetY); + } + + @Override + public int hashCode() { + return Objects.hash(X, isSetX, Y, isSetY); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Point {\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetX) { + addIfNull(nulls, JSON_PROPERTY_X, this.X); + } + if (isSetY) { + addIfNull(nulls, JSON_PROPERTY_Y, this.Y); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Point given an JSON string + * + * @param jsonString JSON string + * @return An instance of Point + * @throws JsonProcessingException if the JSON string is invalid with respect to Point + */ + public static Point fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Point.class); + } + + /** + * Convert an instance of Point to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PredefinedContent.java b/src/main/java/com/adyen/model/tapi/PredefinedContent.java new file mode 100644 index 000000000..0bbf42a90 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PredefinedContent.java @@ -0,0 +1,228 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Reference of a predefined message to display or print. It conveys information related to the + * predefined message. + */ +@JsonPropertyOrder({ + PredefinedContent.JSON_PROPERTY_REFERENCE_I_D, + PredefinedContent.JSON_PROPERTY_LANGUAGE +}) +public class PredefinedContent { + public static final String JSON_PROPERTY_REFERENCE_I_D = "ReferenceID"; + private String referenceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceID = false; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + private String language; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PredefinedContent() {} + + /** + * Identification of a predefined message to display or print. + * + * @param referenceID Identification of a predefined message to display or print. + * @return the current {@code PredefinedContent} instance, allowing for method chaining + */ + public PredefinedContent referenceID(String referenceID) { + this.referenceID = referenceID; + isSetReferenceID = true; // mark as set + return this; + } + + /** + * Identification of a predefined message to display or print. + * + * @return referenceID Identification of a predefined message to display or print. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReferenceID() { + return referenceID; + } + + /** + * Identification of a predefined message to display or print. + * + * @param referenceID Identification of a predefined message to display or print. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceID(String referenceID) { + this.referenceID = referenceID; + isSetReferenceID = true; // mark as set + } + + /** + * Identification of a language. + * + * @param language Identification of a language. + * @return the current {@code PredefinedContent} instance, allowing for method chaining + */ + public PredefinedContent language(String language) { + this.language = language; + isSetLanguage = true; // mark as set + return this; + } + + /** + * Identification of a language. + * + * @return language Identification of a language. + */ + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + /** + * Identification of a language. + * + * @param language Identification of a language. + */ + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(String language) { + this.language = language; + isSetLanguage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PredefinedContent includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PredefinedContent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PredefinedContent predefinedContent = (PredefinedContent) o; + return Objects.equals(this.referenceID, predefinedContent.referenceID) + && Objects.equals(this.isSetReferenceID, predefinedContent.isSetReferenceID) + && Objects.equals(this.language, predefinedContent.language) + && Objects.equals(this.isSetLanguage, predefinedContent.isSetLanguage); + } + + @Override + public int hashCode() { + return Objects.hash(referenceID, isSetReferenceID, language, isSetLanguage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PredefinedContent {\n"); + sb.append(" referenceID: ").append(toIndentedString(referenceID)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReferenceID) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_I_D, this.referenceID); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PredefinedContent given an JSON string + * + * @param jsonString JSON string + * @return An instance of PredefinedContent + * @throws JsonProcessingException if the JSON string is invalid with respect to PredefinedContent + */ + public static PredefinedContent fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PredefinedContent.class); + } + + /** + * Convert an instance of PredefinedContent to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PrintOutput.java b/src/main/java/com/adyen/model/tapi/PrintOutput.java new file mode 100644 index 000000000..b5ee66c03 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PrintOutput.java @@ -0,0 +1,438 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PrintOutput */ +@JsonPropertyOrder({ + PrintOutput.JSON_PROPERTY_DOCUMENT_QUALIFIER, + PrintOutput.JSON_PROPERTY_RESPONSE_MODE, + PrintOutput.JSON_PROPERTY_INTEGRATED_PRINT_FLAG, + PrintOutput.JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG, + PrintOutput.JSON_PROPERTY_OUTPUT_CONTENT +}) +public class PrintOutput { + public static final String JSON_PROPERTY_DOCUMENT_QUALIFIER = "DocumentQualifier"; + private DocumentQualifierType documentQualifier; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentQualifier = false; + + public static final String JSON_PROPERTY_RESPONSE_MODE = "ResponseMode"; + private ResponseModeType responseMode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponseMode = false; + + public static final String JSON_PROPERTY_INTEGRATED_PRINT_FLAG = "IntegratedPrintFlag"; + private Boolean integratedPrintFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIntegratedPrintFlag = false; + + public static final String JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG = "RequiredSignatureFlag"; + private Boolean requiredSignatureFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredSignatureFlag = false; + + public static final String JSON_PROPERTY_OUTPUT_CONTENT = "OutputContent"; + private OutputContent outputContent; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutputContent = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PrintOutput() {} + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send information to a physical printer or to use the + * paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** * + * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * Allows the manager of the printer, Sale or POI Terminal, to send information to a physical + * printer or to use the paper type accordingly. Possible values: * **CashierReceipt** * + * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * @return the current {@code PrintOutput} instance, allowing for method chaining + */ + public PrintOutput documentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + return this; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send information to a physical printer or to use the + * paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** * + * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @return documentQualifier Qualification of the document to print to the Cashier or the + * Customer. Allows the manager of the printer, Sale or POI Terminal, to send information to a + * physical printer or to use the paper type accordingly. Possible values: * + * **CashierReceipt** * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * + * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DocumentQualifierType getDocumentQualifier() { + return documentQualifier; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send information to a physical printer or to use the + * paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** * + * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * Allows the manager of the printer, Sale or POI Terminal, to send information to a physical + * printer or to use the paper type accordingly. Possible values: * **CashierReceipt** * + * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + } + + /** + * Message response awaited by the initiator of the Request. Allows various types and + * synchronisation of requests for Print or Sound. Possible values: * **Immediate** * + * **NotRequired** * **PrintEnd** * **SoundEnd** + * + * @param responseMode Message response awaited by the initiator of the Request. Allows various + * types and synchronisation of requests for Print or Sound. Possible values: * **Immediate** + * * **NotRequired** * **PrintEnd** * **SoundEnd** + * @return the current {@code PrintOutput} instance, allowing for method chaining + */ + public PrintOutput responseMode(ResponseModeType responseMode) { + this.responseMode = responseMode; + isSetResponseMode = true; // mark as set + return this; + } + + /** + * Message response awaited by the initiator of the Request. Allows various types and + * synchronisation of requests for Print or Sound. Possible values: * **Immediate** * + * **NotRequired** * **PrintEnd** * **SoundEnd** + * + * @return responseMode Message response awaited by the initiator of the Request. Allows various + * types and synchronisation of requests for Print or Sound. Possible values: * **Immediate** + * * **NotRequired** * **PrintEnd** * **SoundEnd** + */ + @JsonProperty(JSON_PROPERTY_RESPONSE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResponseModeType getResponseMode() { + return responseMode; + } + + /** + * Message response awaited by the initiator of the Request. Allows various types and + * synchronisation of requests for Print or Sound. Possible values: * **Immediate** * + * **NotRequired** * **PrintEnd** * **SoundEnd** + * + * @param responseMode Message response awaited by the initiator of the Request. Allows various + * types and synchronisation of requests for Print or Sound. Possible values: * **Immediate** + * * **NotRequired** * **PrintEnd** * **SoundEnd** + */ + @JsonProperty(JSON_PROPERTY_RESPONSE_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseMode(ResponseModeType responseMode) { + this.responseMode = responseMode; + isSetResponseMode = true; // mark as set + } + + /** + * Type of the print integrated in other prints. Allows a separated printing (paper cut if + * available), or integration with the sale receipt or other print. If the printing is integrated, + * the response is always immediate, even if the `ResponseMode` is set to + * `PrintEnd`. + * + * @param integratedPrintFlag Type of the print integrated in other prints. Allows a separated + * printing (paper cut if available), or integration with the sale receipt or other print. If + * the printing is integrated, the response is always immediate, even if the + * `ResponseMode` is set to `PrintEnd`. + * @return the current {@code PrintOutput} instance, allowing for method chaining + */ + public PrintOutput integratedPrintFlag(Boolean integratedPrintFlag) { + this.integratedPrintFlag = integratedPrintFlag; + isSetIntegratedPrintFlag = true; // mark as set + return this; + } + + /** + * Type of the print integrated in other prints. Allows a separated printing (paper cut if + * available), or integration with the sale receipt or other print. If the printing is integrated, + * the response is always immediate, even if the `ResponseMode` is set to + * `PrintEnd`. + * + * @return integratedPrintFlag Type of the print integrated in other prints. Allows a separated + * printing (paper cut if available), or integration with the sale receipt or other print. If + * the printing is integrated, the response is always immediate, even if the + * `ResponseMode` is set to `PrintEnd`. + */ + @JsonProperty(JSON_PROPERTY_INTEGRATED_PRINT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIntegratedPrintFlag() { + return integratedPrintFlag; + } + + /** + * Type of the print integrated in other prints. Allows a separated printing (paper cut if + * available), or integration with the sale receipt or other print. If the printing is integrated, + * the response is always immediate, even if the `ResponseMode` is set to + * `PrintEnd`. + * + * @param integratedPrintFlag Type of the print integrated in other prints. Allows a separated + * printing (paper cut if available), or integration with the sale receipt or other print. If + * the printing is integrated, the response is always immediate, even if the + * `ResponseMode` is set to `PrintEnd`. + */ + @JsonProperty(JSON_PROPERTY_INTEGRATED_PRINT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntegratedPrintFlag(Boolean integratedPrintFlag) { + this.integratedPrintFlag = integratedPrintFlag; + isSetIntegratedPrintFlag = true; // mark as set + } + + /** + * Indicates that the cardholder payment receipt requires a physical signature by the Customer. + * + * @param requiredSignatureFlag Indicates that the cardholder payment receipt requires a physical + * signature by the Customer. + * @return the current {@code PrintOutput} instance, allowing for method chaining + */ + public PrintOutput requiredSignatureFlag(Boolean requiredSignatureFlag) { + this.requiredSignatureFlag = requiredSignatureFlag; + isSetRequiredSignatureFlag = true; // mark as set + return this; + } + + /** + * Indicates that the cardholder payment receipt requires a physical signature by the Customer. + * + * @return requiredSignatureFlag Indicates that the cardholder payment receipt requires a physical + * signature by the Customer. + */ + @JsonProperty(JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiredSignatureFlag() { + return requiredSignatureFlag; + } + + /** + * Indicates that the cardholder payment receipt requires a physical signature by the Customer. + * + * @param requiredSignatureFlag Indicates that the cardholder payment receipt requires a physical + * signature by the Customer. + */ + @JsonProperty(JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequiredSignatureFlag(Boolean requiredSignatureFlag) { + this.requiredSignatureFlag = requiredSignatureFlag; + isSetRequiredSignatureFlag = true; // mark as set + } + + /** + * Content to display or print. This is a sequence of elements if they have different formats. + * + * @param outputContent Content to display or print. This is a sequence of elements if they have + * different formats. + * @return the current {@code PrintOutput} instance, allowing for method chaining + */ + public PrintOutput outputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + return this; + } + + /** + * Content to display or print. This is a sequence of elements if they have different formats. + * + * @return outputContent Content to display or print. This is a sequence of elements if they have + * different formats. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Content to display or print. This is a sequence of elements if they have different formats. + * + * @param outputContent Content to display or print. This is a sequence of elements if they have + * different formats. + */ + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + isSetOutputContent = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PrintOutput includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PrintOutput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrintOutput printOutput = (PrintOutput) o; + return Objects.equals(this.documentQualifier, printOutput.documentQualifier) + && Objects.equals(this.isSetDocumentQualifier, printOutput.isSetDocumentQualifier) + && Objects.equals(this.responseMode, printOutput.responseMode) + && Objects.equals(this.isSetResponseMode, printOutput.isSetResponseMode) + && Objects.equals(this.integratedPrintFlag, printOutput.integratedPrintFlag) + && Objects.equals(this.isSetIntegratedPrintFlag, printOutput.isSetIntegratedPrintFlag) + && Objects.equals(this.requiredSignatureFlag, printOutput.requiredSignatureFlag) + && Objects.equals(this.isSetRequiredSignatureFlag, printOutput.isSetRequiredSignatureFlag) + && Objects.equals(this.outputContent, printOutput.outputContent) + && Objects.equals(this.isSetOutputContent, printOutput.isSetOutputContent); + } + + @Override + public int hashCode() { + return Objects.hash( + documentQualifier, + isSetDocumentQualifier, + responseMode, + isSetResponseMode, + integratedPrintFlag, + isSetIntegratedPrintFlag, + requiredSignatureFlag, + isSetRequiredSignatureFlag, + outputContent, + isSetOutputContent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrintOutput {\n"); + sb.append(" documentQualifier: ").append(toIndentedString(documentQualifier)).append("\n"); + sb.append(" responseMode: ").append(toIndentedString(responseMode)).append("\n"); + sb.append(" integratedPrintFlag: ") + .append(toIndentedString(integratedPrintFlag)) + .append("\n"); + sb.append(" requiredSignatureFlag: ") + .append(toIndentedString(requiredSignatureFlag)) + .append("\n"); + sb.append(" outputContent: ").append(toIndentedString(outputContent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocumentQualifier) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_QUALIFIER, this.documentQualifier); + } + if (isSetResponseMode) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE_MODE, this.responseMode); + } + if (isSetIntegratedPrintFlag) { + addIfNull(nulls, JSON_PROPERTY_INTEGRATED_PRINT_FLAG, this.integratedPrintFlag); + } + if (isSetRequiredSignatureFlag) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_SIGNATURE_FLAG, this.requiredSignatureFlag); + } + if (isSetOutputContent) { + addIfNull(nulls, JSON_PROPERTY_OUTPUT_CONTENT, this.outputContent); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PrintOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrintOutput + * @throws JsonProcessingException if the JSON string is invalid with respect to PrintOutput + */ + public static PrintOutput fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PrintOutput.class); + } + + /** + * Convert an instance of PrintOutput to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PrintRequest.java b/src/main/java/com/adyen/model/tapi/PrintRequest.java new file mode 100644 index 000000000..3cf5609e1 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PrintRequest.java @@ -0,0 +1,178 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Content of the Print Request message. It conveys the complete data to print and how to process + * the print. + */ +@JsonPropertyOrder({PrintRequest.JSON_PROPERTY_PRINT_OUTPUT}) +public class PrintRequest { + public static final String JSON_PROPERTY_PRINT_OUTPUT = "PrintOutput"; + private PrintOutput printOutput; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrintOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PrintRequest() {} + + /** + * Information to print and how to process it. + * + * @param printOutput Information to print and how to process it. + * @return the current {@code PrintRequest} instance, allowing for method chaining + */ + public PrintRequest printOutput(PrintOutput printOutput) { + this.printOutput = printOutput; + isSetPrintOutput = true; // mark as set + return this; + } + + /** + * Information to print and how to process it. + * + * @return printOutput Information to print and how to process it. + */ + @JsonProperty(JSON_PROPERTY_PRINT_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PrintOutput getPrintOutput() { + return printOutput; + } + + /** + * Information to print and how to process it. + * + * @param printOutput Information to print and how to process it. + */ + @JsonProperty(JSON_PROPERTY_PRINT_OUTPUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrintOutput(PrintOutput printOutput) { + this.printOutput = printOutput; + isSetPrintOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PrintRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PrintRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrintRequest printRequest = (PrintRequest) o; + return Objects.equals(this.printOutput, printRequest.printOutput) + && Objects.equals(this.isSetPrintOutput, printRequest.isSetPrintOutput); + } + + @Override + public int hashCode() { + return Objects.hash(printOutput, isSetPrintOutput); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrintRequest {\n"); + sb.append(" printOutput: ").append(toIndentedString(printOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPrintOutput) { + addIfNull(nulls, JSON_PROPERTY_PRINT_OUTPUT, this.printOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PrintRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrintRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to PrintRequest + */ + public static PrintRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PrintRequest.class); + } + + /** + * Convert an instance of PrintRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PrintResponse.java b/src/main/java/com/adyen/model/tapi/PrintResponse.java new file mode 100644 index 000000000..971867236 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PrintResponse.java @@ -0,0 +1,247 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * It conveys the result of the print, parallel to the message request, except if response not + * required and absent. Content of the Print Response message. + */ +@JsonPropertyOrder({ + PrintResponse.JSON_PROPERTY_DOCUMENT_QUALIFIER, + PrintResponse.JSON_PROPERTY_RESPONSE +}) +public class PrintResponse { + public static final String JSON_PROPERTY_DOCUMENT_QUALIFIER = "DocumentQualifier"; + private DocumentQualifierType documentQualifier; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentQualifier = false; + + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PrintResponse() {} + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send information to a physical printer or to use the + * paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** * + * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * Allows the manager of the printer, Sale or POI Terminal, to send information to a physical + * printer or to use the paper type accordingly. Possible values: * **CashierReceipt** * + * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * @return the current {@code PrintResponse} instance, allowing for method chaining + */ + public PrintResponse documentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + return this; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send information to a physical printer or to use the + * paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** * + * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @return documentQualifier Qualification of the document to print to the Cashier or the + * Customer. Allows the manager of the printer, Sale or POI Terminal, to send information to a + * physical printer or to use the paper type accordingly. Possible values: * + * **CashierReceipt** * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * + * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DocumentQualifierType getDocumentQualifier() { + return documentQualifier; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send information to a physical printer or to use the + * paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** * + * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * Allows the manager of the printer, Sale or POI Terminal, to send information to a physical + * printer or to use the paper type accordingly. Possible values: * **CashierReceipt** * + * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code PrintResponse} instance, allowing for method chaining + */ + public PrintResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PrintResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PrintResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrintResponse printResponse = (PrintResponse) o; + return Objects.equals(this.documentQualifier, printResponse.documentQualifier) + && Objects.equals(this.isSetDocumentQualifier, printResponse.isSetDocumentQualifier) + && Objects.equals(this.response, printResponse.response) + && Objects.equals(this.isSetResponse, printResponse.isSetResponse); + } + + @Override + public int hashCode() { + return Objects.hash(documentQualifier, isSetDocumentQualifier, response, isSetResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrintResponse {\n"); + sb.append(" documentQualifier: ").append(toIndentedString(documentQualifier)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocumentQualifier) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_QUALIFIER, this.documentQualifier); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PrintResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrintResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to PrintResponse + */ + public static PrintResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PrintResponse.class); + } + + /** + * Convert an instance of PrintResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/PrinterStatusType.java b/src/main/java/com/adyen/model/tapi/PrinterStatusType.java new file mode 100644 index 000000000..292487fa5 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/PrinterStatusType.java @@ -0,0 +1,58 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Indicates if the printer is working and usable. Possible values: * **NoPaper** * **OK** * + * **OutOfOrder** * **PaperJam** * **PaperLow** + */ +public enum PrinterStatusType { + NO_PAPER("NoPaper"), + + OK("OK"), + + OUT_OF_ORDER("OutOfOrder"), + + PAPER_JAM("PaperJam"), + + PAPER_LOW("PaperLow"); + + private String value; + + PrinterStatusType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PrinterStatusType fromValue(String value) { + for (PrinterStatusType b : PrinterStatusType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ReconciliationRequest.java b/src/main/java/com/adyen/model/tapi/ReconciliationRequest.java new file mode 100644 index 000000000..19ad8aac1 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ReconciliationRequest.java @@ -0,0 +1,321 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * Content of the Reconciliation Request message. It conveys Information related to the + * Reconciliation requested by the Sale System. + */ +@JsonPropertyOrder({ + ReconciliationRequest.JSON_PROPERTY_RECONCILIATION_TYPE, + ReconciliationRequest.JSON_PROPERTY_ACQUIRER_I_D, + ReconciliationRequest.JSON_PROPERTY_PO_I_RECONCILIATION_I_D +}) +public class ReconciliationRequest { + public static final String JSON_PROPERTY_RECONCILIATION_TYPE = "ReconciliationType"; + private ReconciliationType reconciliationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReconciliationType = false; + + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private List acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + public static final String JSON_PROPERTY_PO_I_RECONCILIATION_I_D = "POIReconciliationID"; + private Integer poIReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIReconciliationID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReconciliationRequest() {} + + /** + * Type of Reconciliation requested by the Sale to the POI. Possible values: * + * **AcquirerReconciliation** * **AcquirerSynchronisation** * **PreviousReconciliation** * + * **SaleReconciliation** + * + * @param reconciliationType Type of Reconciliation requested by the Sale to the POI. Possible + * values: * **AcquirerReconciliation** * **AcquirerSynchronisation** * + * **PreviousReconciliation** * **SaleReconciliation** + * @return the current {@code ReconciliationRequest} instance, allowing for method chaining + */ + public ReconciliationRequest reconciliationType(ReconciliationType reconciliationType) { + this.reconciliationType = reconciliationType; + isSetReconciliationType = true; // mark as set + return this; + } + + /** + * Type of Reconciliation requested by the Sale to the POI. Possible values: * + * **AcquirerReconciliation** * **AcquirerSynchronisation** * **PreviousReconciliation** * + * **SaleReconciliation** + * + * @return reconciliationType Type of Reconciliation requested by the Sale to the POI. Possible + * values: * **AcquirerReconciliation** * **AcquirerSynchronisation** * + * **PreviousReconciliation** * **SaleReconciliation** + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReconciliationType getReconciliationType() { + return reconciliationType; + } + + /** + * Type of Reconciliation requested by the Sale to the POI. Possible values: * + * **AcquirerReconciliation** * **AcquirerSynchronisation** * **PreviousReconciliation** * + * **SaleReconciliation** + * + * @param reconciliationType Type of Reconciliation requested by the Sale to the POI. Possible + * values: * **AcquirerReconciliation** * **AcquirerSynchronisation** * + * **PreviousReconciliation** * **SaleReconciliation** + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReconciliationType(ReconciliationType reconciliationType) { + this.reconciliationType = reconciliationType; + isSetReconciliationType = true; // mark as set + } + + /** + * Identification of the Acquirer. Could be present only if ReconciliationType is + * AcquirerReconciliation or AcquirerSynchronisation. + * + * @param acquirerID Identification of the Acquirer. Could be present only if ReconciliationType + * is AcquirerReconciliation or AcquirerSynchronisation. + * @return the current {@code ReconciliationRequest} instance, allowing for method chaining + */ + public ReconciliationRequest acquirerID(List acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + public ReconciliationRequest addAcquirerIDItem(Integer acquirerIDItem) { + if (this.acquirerID == null) { + this.acquirerID = new ArrayList<>(); + } + this.acquirerID.add(acquirerIDItem); + return this; + } + + /** + * Identification of the Acquirer. Could be present only if ReconciliationType is + * AcquirerReconciliation or AcquirerSynchronisation. + * + * @return acquirerID Identification of the Acquirer. Could be present only if ReconciliationType + * is AcquirerReconciliation or AcquirerSynchronisation. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. Could be present only if ReconciliationType is + * AcquirerReconciliation or AcquirerSynchronisation. + * + * @param acquirerID Identification of the Acquirer. Could be present only if ReconciliationType + * is AcquirerReconciliation or AcquirerSynchronisation. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(List acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * Identification of the reconciliation period between Sale and POI. Absent if ReconciliationType + * is not PreviousReconciliation. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. + * Absent if ReconciliationType is not PreviousReconciliation. + * @return the current {@code ReconciliationRequest} instance, allowing for method chaining + */ + public ReconciliationRequest poIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + return this; + } + + /** + * Identification of the reconciliation period between Sale and POI. Absent if ReconciliationType + * is not PreviousReconciliation. + * + * @return poIReconciliationID Identification of the reconciliation period between Sale and POI. + * Absent if ReconciliationType is not PreviousReconciliation. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPoIReconciliationID() { + return poIReconciliationID; + } + + /** + * Identification of the reconciliation period between Sale and POI. Absent if ReconciliationType + * is not PreviousReconciliation. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. + * Absent if ReconciliationType is not PreviousReconciliation. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReconciliationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReconciliationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReconciliationRequest reconciliationRequest = (ReconciliationRequest) o; + return Objects.equals(this.reconciliationType, reconciliationRequest.reconciliationType) + && Objects.equals( + this.isSetReconciliationType, reconciliationRequest.isSetReconciliationType) + && Objects.equals(this.acquirerID, reconciliationRequest.acquirerID) + && Objects.equals(this.isSetAcquirerID, reconciliationRequest.isSetAcquirerID) + && Objects.equals(this.poIReconciliationID, reconciliationRequest.poIReconciliationID) + && Objects.equals( + this.isSetPoIReconciliationID, reconciliationRequest.isSetPoIReconciliationID); + } + + @Override + public int hashCode() { + return Objects.hash( + reconciliationType, + isSetReconciliationType, + acquirerID, + isSetAcquirerID, + poIReconciliationID, + isSetPoIReconciliationID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReconciliationRequest {\n"); + sb.append(" reconciliationType: ").append(toIndentedString(reconciliationType)).append("\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append(" poIReconciliationID: ") + .append(toIndentedString(poIReconciliationID)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReconciliationType) { + addIfNull(nulls, JSON_PROPERTY_RECONCILIATION_TYPE, this.reconciliationType); + } + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + if (isSetPoIReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_PO_I_RECONCILIATION_I_D, this.poIReconciliationID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReconciliationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReconciliationRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ReconciliationRequest + */ + public static ReconciliationRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReconciliationRequest.class); + } + + /** + * Convert an instance of ReconciliationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ReconciliationResponse.java b/src/main/java/com/adyen/model/tapi/ReconciliationResponse.java new file mode 100644 index 000000000..d531c18f5 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ReconciliationResponse.java @@ -0,0 +1,369 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the Reconciliation transaction processed by the POI System. + * Content of the Reconciliation Response message. + */ +@JsonPropertyOrder({ + ReconciliationResponse.JSON_PROPERTY_RESPONSE, + ReconciliationResponse.JSON_PROPERTY_RECONCILIATION_TYPE, + ReconciliationResponse.JSON_PROPERTY_PO_I_RECONCILIATION_I_D, + ReconciliationResponse.JSON_PROPERTY_TRANSACTION_TOTALS +}) +public class ReconciliationResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_RECONCILIATION_TYPE = "ReconciliationType"; + private ReconciliationType reconciliationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReconciliationType = false; + + public static final String JSON_PROPERTY_PO_I_RECONCILIATION_I_D = "POIReconciliationID"; + private Integer poIReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIReconciliationID = false; + + public static final String JSON_PROPERTY_TRANSACTION_TOTALS = "TransactionTotals"; + private List transactionTotals; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionTotals = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReconciliationResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code ReconciliationResponse} instance, allowing for method chaining + */ + public ReconciliationResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Type of Reconciliation requested by the Sale to the POI. Possible values: * + * **AcquirerReconciliation** * **AcquirerSynchronisation** * **PreviousReconciliation** * + * **SaleReconciliation** + * + * @param reconciliationType Type of Reconciliation requested by the Sale to the POI. Possible + * values: * **AcquirerReconciliation** * **AcquirerSynchronisation** * + * **PreviousReconciliation** * **SaleReconciliation** + * @return the current {@code ReconciliationResponse} instance, allowing for method chaining + */ + public ReconciliationResponse reconciliationType(ReconciliationType reconciliationType) { + this.reconciliationType = reconciliationType; + isSetReconciliationType = true; // mark as set + return this; + } + + /** + * Type of Reconciliation requested by the Sale to the POI. Possible values: * + * **AcquirerReconciliation** * **AcquirerSynchronisation** * **PreviousReconciliation** * + * **SaleReconciliation** + * + * @return reconciliationType Type of Reconciliation requested by the Sale to the POI. Possible + * values: * **AcquirerReconciliation** * **AcquirerSynchronisation** * + * **PreviousReconciliation** * **SaleReconciliation** + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReconciliationType getReconciliationType() { + return reconciliationType; + } + + /** + * Type of Reconciliation requested by the Sale to the POI. Possible values: * + * **AcquirerReconciliation** * **AcquirerSynchronisation** * **PreviousReconciliation** * + * **SaleReconciliation** + * + * @param reconciliationType Type of Reconciliation requested by the Sale to the POI. Possible + * values: * **AcquirerReconciliation** * **AcquirerSynchronisation** * + * **PreviousReconciliation** * **SaleReconciliation** + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReconciliationType(ReconciliationType reconciliationType) { + this.reconciliationType = reconciliationType; + isSetReconciliationType = true; // mark as set + } + + /** + * Identification of the reconciliation period between Sale and POI. Absent if ReconciliationType + * is `AcquirerReconciliation`. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. + * Absent if ReconciliationType is `AcquirerReconciliation`. + * @return the current {@code ReconciliationResponse} instance, allowing for method chaining + */ + public ReconciliationResponse poIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + return this; + } + + /** + * Identification of the reconciliation period between Sale and POI. Absent if ReconciliationType + * is `AcquirerReconciliation`. + * + * @return poIReconciliationID Identification of the reconciliation period between Sale and POI. + * Absent if ReconciliationType is `AcquirerReconciliation`. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPoIReconciliationID() { + return poIReconciliationID; + } + + /** + * Identification of the reconciliation period between Sale and POI. Absent if ReconciliationType + * is `AcquirerReconciliation`. + * + * @param poIReconciliationID Identification of the reconciliation period between Sale and POI. + * Absent if ReconciliationType is `AcquirerReconciliation`. + */ + @JsonProperty(JSON_PROPERTY_PO_I_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIReconciliationID(Integer poIReconciliationID) { + this.poIReconciliationID = poIReconciliationID; + isSetPoIReconciliationID = true; // mark as set + } + + /** + * Result of the Sale to POI Reconciliation processing. If `Response.Result` is Success. + * + * @param transactionTotals Result of the Sale to POI Reconciliation processing. If + * `Response.Result` is Success. + * @return the current {@code ReconciliationResponse} instance, allowing for method chaining + */ + public ReconciliationResponse transactionTotals(List transactionTotals) { + this.transactionTotals = transactionTotals; + isSetTransactionTotals = true; // mark as set + return this; + } + + public ReconciliationResponse addTransactionTotalsItem(TransactionTotals transactionTotalsItem) { + if (this.transactionTotals == null) { + this.transactionTotals = new ArrayList<>(); + } + this.transactionTotals.add(transactionTotalsItem); + return this; + } + + /** + * Result of the Sale to POI Reconciliation processing. If `Response.Result` is Success. + * + * @return transactionTotals Result of the Sale to POI Reconciliation processing. If + * `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_TOTALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTransactionTotals() { + return transactionTotals; + } + + /** + * Result of the Sale to POI Reconciliation processing. If `Response.Result` is Success. + * + * @param transactionTotals Result of the Sale to POI Reconciliation processing. If + * `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_TOTALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionTotals(List transactionTotals) { + this.transactionTotals = transactionTotals; + isSetTransactionTotals = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReconciliationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReconciliationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReconciliationResponse reconciliationResponse = (ReconciliationResponse) o; + return Objects.equals(this.response, reconciliationResponse.response) + && Objects.equals(this.isSetResponse, reconciliationResponse.isSetResponse) + && Objects.equals(this.reconciliationType, reconciliationResponse.reconciliationType) + && Objects.equals( + this.isSetReconciliationType, reconciliationResponse.isSetReconciliationType) + && Objects.equals(this.poIReconciliationID, reconciliationResponse.poIReconciliationID) + && Objects.equals( + this.isSetPoIReconciliationID, reconciliationResponse.isSetPoIReconciliationID) + && Objects.equals(this.transactionTotals, reconciliationResponse.transactionTotals) + && Objects.equals( + this.isSetTransactionTotals, reconciliationResponse.isSetTransactionTotals); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + reconciliationType, + isSetReconciliationType, + poIReconciliationID, + isSetPoIReconciliationID, + transactionTotals, + isSetTransactionTotals); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReconciliationResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" reconciliationType: ").append(toIndentedString(reconciliationType)).append("\n"); + sb.append(" poIReconciliationID: ") + .append(toIndentedString(poIReconciliationID)) + .append("\n"); + sb.append(" transactionTotals: ").append(toIndentedString(transactionTotals)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetReconciliationType) { + addIfNull(nulls, JSON_PROPERTY_RECONCILIATION_TYPE, this.reconciliationType); + } + if (isSetPoIReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_PO_I_RECONCILIATION_I_D, this.poIReconciliationID); + } + if (isSetTransactionTotals) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_TOTALS, this.transactionTotals); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReconciliationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReconciliationResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ReconciliationResponse + */ + public static ReconciliationResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReconciliationResponse.class); + } + + /** + * Convert an instance of ReconciliationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ReconciliationType.java b/src/main/java/com/adyen/model/tapi/ReconciliationType.java new file mode 100644 index 000000000..32d66e482 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ReconciliationType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets ReconciliationType */ +public enum ReconciliationType { + ACQUIRER_RECONCILIATION("AcquirerReconciliation"), + + ACQUIRER_SYNCHRONISATION("AcquirerSynchronisation"), + + PREVIOUS_RECONCILIATION("PreviousReconciliation"), + + SALE_RECONCILIATION("SaleReconciliation"); + + private String value; + + ReconciliationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ReconciliationType fromValue(String value) { + for (ReconciliationType b : ReconciliationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/RepeatedMessageResponse.java b/src/main/java/com/adyen/model/tapi/RepeatedMessageResponse.java new file mode 100644 index 000000000..f64b7291a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/RepeatedMessageResponse.java @@ -0,0 +1,239 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** RepeatedMessageResponse */ +@JsonPropertyOrder({ + RepeatedMessageResponse.JSON_PROPERTY_MESSAGE_HEADER, + RepeatedMessageResponse.JSON_PROPERTY_REPEATED_RESPONSE_MESSAGE_BODY +}) +public class RepeatedMessageResponse { + public static final String JSON_PROPERTY_MESSAGE_HEADER = "MessageHeader"; + private MessageHeader messageHeader; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageHeader = false; + + public static final String JSON_PROPERTY_REPEATED_RESPONSE_MESSAGE_BODY = + "RepeatedResponseMessageBody"; + private RepeatedResponseMessageBody repeatedResponseMessageBody; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepeatedResponseMessageBody = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public RepeatedMessageResponse() {} + + /** + * messageHeader + * + * @param messageHeader + * @return the current {@code RepeatedMessageResponse} instance, allowing for method chaining + */ + public RepeatedMessageResponse messageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + isSetMessageHeader = true; // mark as set + return this; + } + + /** + * Get messageHeader + * + * @return messageHeader + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageHeader getMessageHeader() { + return messageHeader; + } + + /** + * messageHeader + * + * @param messageHeader + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + isSetMessageHeader = true; // mark as set + } + + /** + * repeatedResponseMessageBody + * + * @param repeatedResponseMessageBody + * @return the current {@code RepeatedMessageResponse} instance, allowing for method chaining + */ + public RepeatedMessageResponse repeatedResponseMessageBody( + RepeatedResponseMessageBody repeatedResponseMessageBody) { + this.repeatedResponseMessageBody = repeatedResponseMessageBody; + isSetRepeatedResponseMessageBody = true; // mark as set + return this; + } + + /** + * Get repeatedResponseMessageBody + * + * @return repeatedResponseMessageBody + */ + @JsonProperty(JSON_PROPERTY_REPEATED_RESPONSE_MESSAGE_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatedResponseMessageBody getRepeatedResponseMessageBody() { + return repeatedResponseMessageBody; + } + + /** + * repeatedResponseMessageBody + * + * @param repeatedResponseMessageBody + */ + @JsonProperty(JSON_PROPERTY_REPEATED_RESPONSE_MESSAGE_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatedResponseMessageBody( + RepeatedResponseMessageBody repeatedResponseMessageBody) { + this.repeatedResponseMessageBody = repeatedResponseMessageBody; + isSetRepeatedResponseMessageBody = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepeatedMessageResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this RepeatedMessageResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepeatedMessageResponse repeatedMessageResponse = (RepeatedMessageResponse) o; + return Objects.equals(this.messageHeader, repeatedMessageResponse.messageHeader) + && Objects.equals(this.isSetMessageHeader, repeatedMessageResponse.isSetMessageHeader) + && Objects.equals( + this.repeatedResponseMessageBody, repeatedMessageResponse.repeatedResponseMessageBody) + && Objects.equals( + this.isSetRepeatedResponseMessageBody, + repeatedMessageResponse.isSetRepeatedResponseMessageBody); + } + + @Override + public int hashCode() { + return Objects.hash( + messageHeader, + isSetMessageHeader, + repeatedResponseMessageBody, + isSetRepeatedResponseMessageBody); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepeatedMessageResponse {\n"); + sb.append(" messageHeader: ").append(toIndentedString(messageHeader)).append("\n"); + sb.append(" repeatedResponseMessageBody: ") + .append(toIndentedString(repeatedResponseMessageBody)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageHeader) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_HEADER, this.messageHeader); + } + if (isSetRepeatedResponseMessageBody) { + addIfNull( + nulls, JSON_PROPERTY_REPEATED_RESPONSE_MESSAGE_BODY, this.repeatedResponseMessageBody); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of RepeatedMessageResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepeatedMessageResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * RepeatedMessageResponse + */ + public static RepeatedMessageResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RepeatedMessageResponse.class); + } + + /** + * Convert an instance of RepeatedMessageResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/RepeatedResponseMessageBody.java b/src/main/java/com/adyen/model/tapi/RepeatedResponseMessageBody.java new file mode 100644 index 000000000..7530f98a9 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/RepeatedResponseMessageBody.java @@ -0,0 +1,449 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** RepeatedResponseMessageBody */ +@JsonPropertyOrder({ + RepeatedResponseMessageBody.JSON_PROPERTY_LOYALTY_RESPONSE, + RepeatedResponseMessageBody.JSON_PROPERTY_PAYMENT_RESPONSE, + RepeatedResponseMessageBody.JSON_PROPERTY_REVERSAL_RESPONSE, + RepeatedResponseMessageBody.JSON_PROPERTY_STORED_VALUE_RESPONSE, + RepeatedResponseMessageBody.JSON_PROPERTY_CARD_ACQUISITION_RESPONSE, + RepeatedResponseMessageBody.JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE +}) +public class RepeatedResponseMessageBody { + public static final String JSON_PROPERTY_LOYALTY_RESPONSE = "LoyaltyResponse"; + private LoyaltyResponse loyaltyResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyResponse = false; + + public static final String JSON_PROPERTY_PAYMENT_RESPONSE = "PaymentResponse"; + private PaymentResponse paymentResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentResponse = false; + + public static final String JSON_PROPERTY_REVERSAL_RESPONSE = "ReversalResponse"; + private ReversalResponse reversalResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversalResponse = false; + + public static final String JSON_PROPERTY_STORED_VALUE_RESPONSE = "StoredValueResponse"; + private StoredValueResponse storedValueResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueResponse = false; + + public static final String JSON_PROPERTY_CARD_ACQUISITION_RESPONSE = "CardAcquisitionResponse"; + private CardAcquisitionResponse cardAcquisitionResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionResponse = false; + + public static final String JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE = "CardReaderAPDUResponse"; + private CardReaderAPDUResponse cardReaderAPDUResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardReaderAPDUResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public RepeatedResponseMessageBody() {} + + /** + * loyaltyResponse + * + * @param loyaltyResponse + * @return the current {@code RepeatedResponseMessageBody} instance, allowing for method chaining + */ + public RepeatedResponseMessageBody loyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + isSetLoyaltyResponse = true; // mark as set + return this; + } + + /** + * Get loyaltyResponse + * + * @return loyaltyResponse + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyResponse getLoyaltyResponse() { + return loyaltyResponse; + } + + /** + * loyaltyResponse + * + * @param loyaltyResponse + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + isSetLoyaltyResponse = true; // mark as set + } + + /** + * paymentResponse + * + * @param paymentResponse + * @return the current {@code RepeatedResponseMessageBody} instance, allowing for method chaining + */ + public RepeatedResponseMessageBody paymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + isSetPaymentResponse = true; // mark as set + return this; + } + + /** + * Get paymentResponse + * + * @return paymentResponse + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentResponse getPaymentResponse() { + return paymentResponse; + } + + /** + * paymentResponse + * + * @param paymentResponse + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + isSetPaymentResponse = true; // mark as set + } + + /** + * reversalResponse + * + * @param reversalResponse + * @return the current {@code RepeatedResponseMessageBody} instance, allowing for method chaining + */ + public RepeatedResponseMessageBody reversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + isSetReversalResponse = true; // mark as set + return this; + } + + /** + * Get reversalResponse + * + * @return reversalResponse + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReversalResponse getReversalResponse() { + return reversalResponse; + } + + /** + * reversalResponse + * + * @param reversalResponse + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + isSetReversalResponse = true; // mark as set + } + + /** + * storedValueResponse + * + * @param storedValueResponse + * @return the current {@code RepeatedResponseMessageBody} instance, allowing for method chaining + */ + public RepeatedResponseMessageBody storedValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + isSetStoredValueResponse = true; // mark as set + return this; + } + + /** + * Get storedValueResponse + * + * @return storedValueResponse + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueResponse getStoredValueResponse() { + return storedValueResponse; + } + + /** + * storedValueResponse + * + * @param storedValueResponse + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + isSetStoredValueResponse = true; // mark as set + } + + /** + * cardAcquisitionResponse + * + * @param cardAcquisitionResponse + * @return the current {@code RepeatedResponseMessageBody} instance, allowing for method chaining + */ + public RepeatedResponseMessageBody cardAcquisitionResponse( + CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + isSetCardAcquisitionResponse = true; // mark as set + return this; + } + + /** + * Get cardAcquisitionResponse + * + * @return cardAcquisitionResponse + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardAcquisitionResponse getCardAcquisitionResponse() { + return cardAcquisitionResponse; + } + + /** + * cardAcquisitionResponse + * + * @param cardAcquisitionResponse + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionResponse(CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + isSetCardAcquisitionResponse = true; // mark as set + } + + /** + * cardReaderAPDUResponse + * + * @param cardReaderAPDUResponse + * @return the current {@code RepeatedResponseMessageBody} instance, allowing for method chaining + */ + public RepeatedResponseMessageBody cardReaderAPDUResponse( + CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + isSetCardReaderAPDUResponse = true; // mark as set + return this; + } + + /** + * Get cardReaderAPDUResponse + * + * @return cardReaderAPDUResponse + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardReaderAPDUResponse getCardReaderAPDUResponse() { + return cardReaderAPDUResponse; + } + + /** + * cardReaderAPDUResponse + * + * @param cardReaderAPDUResponse + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + isSetCardReaderAPDUResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepeatedResponseMessageBody includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this RepeatedResponseMessageBody object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepeatedResponseMessageBody repeatedResponseMessageBody = (RepeatedResponseMessageBody) o; + return Objects.equals(this.loyaltyResponse, repeatedResponseMessageBody.loyaltyResponse) + && Objects.equals( + this.isSetLoyaltyResponse, repeatedResponseMessageBody.isSetLoyaltyResponse) + && Objects.equals(this.paymentResponse, repeatedResponseMessageBody.paymentResponse) + && Objects.equals( + this.isSetPaymentResponse, repeatedResponseMessageBody.isSetPaymentResponse) + && Objects.equals(this.reversalResponse, repeatedResponseMessageBody.reversalResponse) + && Objects.equals( + this.isSetReversalResponse, repeatedResponseMessageBody.isSetReversalResponse) + && Objects.equals(this.storedValueResponse, repeatedResponseMessageBody.storedValueResponse) + && Objects.equals( + this.isSetStoredValueResponse, repeatedResponseMessageBody.isSetStoredValueResponse) + && Objects.equals( + this.cardAcquisitionResponse, repeatedResponseMessageBody.cardAcquisitionResponse) + && Objects.equals( + this.isSetCardAcquisitionResponse, + repeatedResponseMessageBody.isSetCardAcquisitionResponse) + && Objects.equals( + this.cardReaderAPDUResponse, repeatedResponseMessageBody.cardReaderAPDUResponse) + && Objects.equals( + this.isSetCardReaderAPDUResponse, + repeatedResponseMessageBody.isSetCardReaderAPDUResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + loyaltyResponse, + isSetLoyaltyResponse, + paymentResponse, + isSetPaymentResponse, + reversalResponse, + isSetReversalResponse, + storedValueResponse, + isSetStoredValueResponse, + cardAcquisitionResponse, + isSetCardAcquisitionResponse, + cardReaderAPDUResponse, + isSetCardReaderAPDUResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepeatedResponseMessageBody {\n"); + sb.append(" loyaltyResponse: ").append(toIndentedString(loyaltyResponse)).append("\n"); + sb.append(" paymentResponse: ").append(toIndentedString(paymentResponse)).append("\n"); + sb.append(" reversalResponse: ").append(toIndentedString(reversalResponse)).append("\n"); + sb.append(" storedValueResponse: ") + .append(toIndentedString(storedValueResponse)) + .append("\n"); + sb.append(" cardAcquisitionResponse: ") + .append(toIndentedString(cardAcquisitionResponse)) + .append("\n"); + sb.append(" cardReaderAPDUResponse: ") + .append(toIndentedString(cardReaderAPDUResponse)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLoyaltyResponse) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_RESPONSE, this.loyaltyResponse); + } + if (isSetPaymentResponse) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RESPONSE, this.paymentResponse); + } + if (isSetReversalResponse) { + addIfNull(nulls, JSON_PROPERTY_REVERSAL_RESPONSE, this.reversalResponse); + } + if (isSetStoredValueResponse) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_RESPONSE, this.storedValueResponse); + } + if (isSetCardAcquisitionResponse) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_RESPONSE, this.cardAcquisitionResponse); + } + if (isSetCardReaderAPDUResponse) { + addIfNull(nulls, JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE, this.cardReaderAPDUResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of RepeatedResponseMessageBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepeatedResponseMessageBody + * @throws JsonProcessingException if the JSON string is invalid with respect to + * RepeatedResponseMessageBody + */ + public static RepeatedResponseMessageBody fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RepeatedResponseMessageBody.class); + } + + /** + * Convert an instance of RepeatedResponseMessageBody to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/Response.java b/src/main/java/com/adyen/model/tapi/Response.java new file mode 100644 index 000000000..ef4417fbe --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/Response.java @@ -0,0 +1,324 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Result of a message request processing. If Result is Success, `ErrorCondition` is + * absent or not used in the processing of the message. In the other cases, the + * `ErrorCondition` has to be present and can refine the processing of the message + * response. `AdditionalResponse` gives more information about the success or the failure + * of the message request processing, for logging without real time involvements. + */ +@JsonPropertyOrder({ + Response.JSON_PROPERTY_RESULT, + Response.JSON_PROPERTY_ERROR_CONDITION, + Response.JSON_PROPERTY_ADDITIONAL_RESPONSE +}) +public class Response { + public static final String JSON_PROPERTY_RESULT = "Result"; + private ResultType result; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + public static final String JSON_PROPERTY_ERROR_CONDITION = "ErrorCondition"; + private ErrorConditionType errorCondition; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCondition = false; + + public static final String JSON_PROPERTY_ADDITIONAL_RESPONSE = "AdditionalResponse"; + private String additionalResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Response() {} + + /** + * Result of the processing of the message. Possible values: * **Failure** * **Partial** * + * **Success** + * + * @param result Result of the processing of the message. Possible values: * **Failure** * + * **Partial** * **Success** + * @return the current {@code Response} instance, allowing for method chaining + */ + public Response result(ResultType result) { + this.result = result; + isSetResult = true; // mark as set + return this; + } + + /** + * Result of the processing of the message. Possible values: * **Failure** * **Partial** * + * **Success** + * + * @return result Result of the processing of the message. Possible values: * **Failure** * + * **Partial** * **Success** + */ + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResultType getResult() { + return result; + } + + /** + * Result of the processing of the message. Possible values: * **Failure** * **Partial** * + * **Success** + * + * @param result Result of the processing of the message. Possible values: * **Failure** * + * **Partial** * **Success** + */ + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResult(ResultType result) { + this.result = result; + isSetResult = true; // mark as set + } + + /** + * Condition that has produced an error on the processing of a message request. Returned if Result + * is not Success. Possible values: * **Aborted** * **Busy** * **Cancel** * **DeviceOut** * + * **InProgress** * **InsertedCard** * **InvalidCard** * **LoggedOut** * **MessageFormat** * + * **NotAllowed** * **NotFound** * **PaymentRestriction** * **Refusal** * **UnavailableDevice** * + * **UnavailableService** * **UnreachableHost** * **WrongPIN** + * + * @param errorCondition Condition that has produced an error on the processing of a message + * request. Returned if Result is not Success. Possible values: * **Aborted** * **Busy** * + * **Cancel** * **DeviceOut** * **InProgress** * **InsertedCard** * **InvalidCard** * + * **LoggedOut** * **MessageFormat** * **NotAllowed** * **NotFound** * **PaymentRestriction** + * * **Refusal** * **UnavailableDevice** * **UnavailableService** * **UnreachableHost** * + * **WrongPIN** + * @return the current {@code Response} instance, allowing for method chaining + */ + public Response errorCondition(ErrorConditionType errorCondition) { + this.errorCondition = errorCondition; + isSetErrorCondition = true; // mark as set + return this; + } + + /** + * Condition that has produced an error on the processing of a message request. Returned if Result + * is not Success. Possible values: * **Aborted** * **Busy** * **Cancel** * **DeviceOut** * + * **InProgress** * **InsertedCard** * **InvalidCard** * **LoggedOut** * **MessageFormat** * + * **NotAllowed** * **NotFound** * **PaymentRestriction** * **Refusal** * **UnavailableDevice** * + * **UnavailableService** * **UnreachableHost** * **WrongPIN** + * + * @return errorCondition Condition that has produced an error on the processing of a message + * request. Returned if Result is not Success. Possible values: * **Aborted** * **Busy** * + * **Cancel** * **DeviceOut** * **InProgress** * **InsertedCard** * **InvalidCard** * + * **LoggedOut** * **MessageFormat** * **NotAllowed** * **NotFound** * **PaymentRestriction** + * * **Refusal** * **UnavailableDevice** * **UnavailableService** * **UnreachableHost** * + * **WrongPIN** + */ + @JsonProperty(JSON_PROPERTY_ERROR_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ErrorConditionType getErrorCondition() { + return errorCondition; + } + + /** + * Condition that has produced an error on the processing of a message request. Returned if Result + * is not Success. Possible values: * **Aborted** * **Busy** * **Cancel** * **DeviceOut** * + * **InProgress** * **InsertedCard** * **InvalidCard** * **LoggedOut** * **MessageFormat** * + * **NotAllowed** * **NotFound** * **PaymentRestriction** * **Refusal** * **UnavailableDevice** * + * **UnavailableService** * **UnreachableHost** * **WrongPIN** + * + * @param errorCondition Condition that has produced an error on the processing of a message + * request. Returned if Result is not Success. Possible values: * **Aborted** * **Busy** * + * **Cancel** * **DeviceOut** * **InProgress** * **InsertedCard** * **InvalidCard** * + * **LoggedOut** * **MessageFormat** * **NotAllowed** * **NotFound** * **PaymentRestriction** + * * **Refusal** * **UnavailableDevice** * **UnavailableService** * **UnreachableHost** * + * **WrongPIN** + */ + @JsonProperty(JSON_PROPERTY_ERROR_CONDITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCondition(ErrorConditionType errorCondition) { + this.errorCondition = errorCondition; + isSetErrorCondition = true; // mark as set + } + + /** + * Additional information related to processing status of a message request. If present, the POI + * logs it for further examination. + * + * @param additionalResponse Additional information related to processing status of a message + * request. If present, the POI logs it for further examination. + * @return the current {@code Response} instance, allowing for method chaining + */ + public Response additionalResponse(String additionalResponse) { + this.additionalResponse = additionalResponse; + isSetAdditionalResponse = true; // mark as set + return this; + } + + /** + * Additional information related to processing status of a message request. If present, the POI + * logs it for further examination. + * + * @return additionalResponse Additional information related to processing status of a message + * request. If present, the POI logs it for further examination. + */ + @JsonProperty(JSON_PROPERTY_ADDITIONAL_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAdditionalResponse() { + return additionalResponse; + } + + /** + * Additional information related to processing status of a message request. If present, the POI + * logs it for further examination. + * + * @param additionalResponse Additional information related to processing status of a message + * request. If present, the POI logs it for further examination. + */ + @JsonProperty(JSON_PROPERTY_ADDITIONAL_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalResponse(String additionalResponse) { + this.additionalResponse = additionalResponse; + isSetAdditionalResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Response includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Response object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Response response = (Response) o; + return Objects.equals(this.result, response.result) + && Objects.equals(this.isSetResult, response.isSetResult) + && Objects.equals(this.errorCondition, response.errorCondition) + && Objects.equals(this.isSetErrorCondition, response.isSetErrorCondition) + && Objects.equals(this.additionalResponse, response.additionalResponse) + && Objects.equals(this.isSetAdditionalResponse, response.isSetAdditionalResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + result, + isSetResult, + errorCondition, + isSetErrorCondition, + additionalResponse, + isSetAdditionalResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Response {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" errorCondition: ").append(toIndentedString(errorCondition)).append("\n"); + sb.append(" additionalResponse: ").append(toIndentedString(additionalResponse)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + if (isSetErrorCondition) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CONDITION, this.errorCondition); + } + if (isSetAdditionalResponse) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_RESPONSE, this.additionalResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Response + * @throws JsonProcessingException if the JSON string is invalid with respect to Response + */ + public static Response fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Response.class); + } + + /** + * Convert an instance of Response to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ResponseModeType.java b/src/main/java/com/adyen/model/tapi/ResponseModeType.java new file mode 100644 index 000000000..67949e640 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ResponseModeType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets ResponseMode */ +public enum ResponseModeType { + IMMEDIATE("Immediate"), + + NOT_REQUIRED("NotRequired"), + + PRINT_END("PrintEnd"), + + SOUND_END("SoundEnd"); + + private String value; + + ResponseModeType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ResponseModeType fromValue(String value) { + for (ResponseModeType b : ResponseModeType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ResultType.java b/src/main/java/com/adyen/model/tapi/ResultType.java new file mode 100644 index 000000000..f9860fec0 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ResultType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets Result */ +public enum ResultType { + FAILURE("Failure"), + + PARTIAL("Partial"), + + SUCCESS("Success"); + + private String value; + + ResultType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ResultType fromValue(String value) { + for (ResultType b : ResultType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ReversalReasonType.java b/src/main/java/com/adyen/model/tapi/ReversalReasonType.java new file mode 100644 index 000000000..6083dc2bc --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ReversalReasonType.java @@ -0,0 +1,56 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Reason of the payment or loyalty reversal. Possible values: * **CustCancel** * **Malfunction** * + * **MerchantCancel** * **Unable2Compl** + */ +public enum ReversalReasonType { + CUST_CANCEL("CustCancel"), + + MALFUNCTION("Malfunction"), + + MERCHANT_CANCEL("MerchantCancel"), + + UNABLE2_COMPL("Unable2Compl"); + + private String value; + + ReversalReasonType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ReversalReasonType fromValue(String value) { + for (ReversalReasonType b : ReversalReasonType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ReversalRequest.java b/src/main/java/com/adyen/model/tapi/ReversalRequest.java new file mode 100644 index 000000000..976a44015 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ReversalRequest.java @@ -0,0 +1,348 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** + * It conveys Information related to the reversal of a previous payment or a loyalty transaction. + * Content of the Reversal Request message. + */ +@JsonPropertyOrder({ + ReversalRequest.JSON_PROPERTY_SALE_DATA, + ReversalRequest.JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, + ReversalRequest.JSON_PROPERTY_REVERSED_AMOUNT, + ReversalRequest.JSON_PROPERTY_REVERSAL_REASON +}) +public class ReversalRequest { + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION = "OriginalPOITransaction"; + private OriginalPOITransaction originalPOITransaction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalPOITransaction = false; + + public static final String JSON_PROPERTY_REVERSED_AMOUNT = "ReversedAmount"; + private BigDecimal reversedAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversedAmount = false; + + public static final String JSON_PROPERTY_REVERSAL_REASON = "ReversalReason"; + private ReversalReasonType reversalReason; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReversalRequest() {} + + /** + * saleData + * + * @param saleData + * @return the current {@code ReversalRequest} instance, allowing for method chaining + */ + public ReversalRequest saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Get saleData + * + * @return saleData + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * saleData + * + * @param saleData + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Identification of a previous POI transaction. + * + * @param originalPOITransaction Identification of a previous POI transaction. + * @return the current {@code ReversalRequest} instance, allowing for method chaining + */ + public ReversalRequest originalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + return this; + } + + /** + * Identification of a previous POI transaction. + * + * @return originalPOITransaction Identification of a previous POI transaction. + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Identification of a previous POI transaction. + * + * @param originalPOITransaction Identification of a previous POI transaction. + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + } + + /** + * Amount of the payment or loyalty to reverse. ReversedAmount is implicitly equal to the + * AuthorizedAmount if absent. + * + * @param reversedAmount Amount of the payment or loyalty to reverse. ReversedAmount is implicitly + * equal to the AuthorizedAmount if absent. + * @return the current {@code ReversalRequest} instance, allowing for method chaining + */ + public ReversalRequest reversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + isSetReversedAmount = true; // mark as set + return this; + } + + /** + * Amount of the payment or loyalty to reverse. ReversedAmount is implicitly equal to the + * AuthorizedAmount if absent. minimum: 0.0 maximum: 99999999.999999 + * + * @return reversedAmount Amount of the payment or loyalty to reverse. ReversedAmount is + * implicitly equal to the AuthorizedAmount if absent. + */ + @JsonProperty(JSON_PROPERTY_REVERSED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getReversedAmount() { + return reversedAmount; + } + + /** + * Amount of the payment or loyalty to reverse. ReversedAmount is implicitly equal to the + * AuthorizedAmount if absent. + * + * @param reversedAmount Amount of the payment or loyalty to reverse. ReversedAmount is implicitly + * equal to the AuthorizedAmount if absent. + */ + @JsonProperty(JSON_PROPERTY_REVERSED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + isSetReversedAmount = true; // mark as set + } + + /** + * Reason of the payment or loyalty reversal. Possible values: * **CustCancel** * **Malfunction** + * * **MerchantCancel** * **Unable2Compl** + * + * @param reversalReason Reason of the payment or loyalty reversal. Possible values: * + * **CustCancel** * **Malfunction** * **MerchantCancel** * **Unable2Compl** + * @return the current {@code ReversalRequest} instance, allowing for method chaining + */ + public ReversalRequest reversalReason(ReversalReasonType reversalReason) { + this.reversalReason = reversalReason; + isSetReversalReason = true; // mark as set + return this; + } + + /** + * Reason of the payment or loyalty reversal. Possible values: * **CustCancel** * **Malfunction** + * * **MerchantCancel** * **Unable2Compl** + * + * @return reversalReason Reason of the payment or loyalty reversal. Possible values: * + * **CustCancel** * **Malfunction** * **MerchantCancel** * **Unable2Compl** + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReversalReasonType getReversalReason() { + return reversalReason; + } + + /** + * Reason of the payment or loyalty reversal. Possible values: * **CustCancel** * **Malfunction** + * * **MerchantCancel** * **Unable2Compl** + * + * @param reversalReason Reason of the payment or loyalty reversal. Possible values: * + * **CustCancel** * **Malfunction** * **MerchantCancel** * **Unable2Compl** + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversalReason(ReversalReasonType reversalReason) { + this.reversalReason = reversalReason; + isSetReversalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReversalRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReversalRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReversalRequest reversalRequest = (ReversalRequest) o; + return Objects.equals(this.saleData, reversalRequest.saleData) + && Objects.equals(this.isSetSaleData, reversalRequest.isSetSaleData) + && Objects.equals(this.originalPOITransaction, reversalRequest.originalPOITransaction) + && Objects.equals( + this.isSetOriginalPOITransaction, reversalRequest.isSetOriginalPOITransaction) + && Objects.equals(this.reversedAmount, reversalRequest.reversedAmount) + && Objects.equals(this.isSetReversedAmount, reversalRequest.isSetReversedAmount) + && Objects.equals(this.reversalReason, reversalRequest.reversalReason) + && Objects.equals(this.isSetReversalReason, reversalRequest.isSetReversalReason); + } + + @Override + public int hashCode() { + return Objects.hash( + saleData, + isSetSaleData, + originalPOITransaction, + isSetOriginalPOITransaction, + reversedAmount, + isSetReversedAmount, + reversalReason, + isSetReversalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReversalRequest {\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" originalPOITransaction: ") + .append(toIndentedString(originalPOITransaction)) + .append("\n"); + sb.append(" reversedAmount: ").append(toIndentedString(reversedAmount)).append("\n"); + sb.append(" reversalReason: ").append(toIndentedString(reversalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetOriginalPOITransaction) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, this.originalPOITransaction); + } + if (isSetReversedAmount) { + addIfNull(nulls, JSON_PROPERTY_REVERSED_AMOUNT, this.reversedAmount); + } + if (isSetReversalReason) { + addIfNull(nulls, JSON_PROPERTY_REVERSAL_REASON, this.reversalReason); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReversalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReversalRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to ReversalRequest + */ + public static ReversalRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReversalRequest.class); + } + + /** + * Convert an instance of ReversalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/ReversalResponse.java b/src/main/java/com/adyen/model/tapi/ReversalResponse.java new file mode 100644 index 000000000..bfcf9f1b2 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/ReversalResponse.java @@ -0,0 +1,396 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the reversal processed by the POI System. Content of the + * Reversal Response message. + */ +@JsonPropertyOrder({ + ReversalResponse.JSON_PROPERTY_RESPONSE, + ReversalResponse.JSON_PROPERTY_PO_I_DATA, + ReversalResponse.JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, + ReversalResponse.JSON_PROPERTY_REVERSED_AMOUNT, + ReversalResponse.JSON_PROPERTY_PAYMENT_RECEIPT +}) +public class ReversalResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_PO_I_DATA = "POIData"; + private POIData poIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIData = false; + + public static final String JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION = "OriginalPOITransaction"; + private OriginalPOITransaction originalPOITransaction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalPOITransaction = false; + + public static final String JSON_PROPERTY_REVERSED_AMOUNT = "ReversedAmount"; + private BigDecimal reversedAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversedAmount = false; + + public static final String JSON_PROPERTY_PAYMENT_RECEIPT = "PaymentReceipt"; + private List paymentReceipt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReceipt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReversalResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code ReversalResponse} instance, allowing for method chaining + */ + public ReversalResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data related to the POI System. If Result is Success. + * + * @param poIData Data related to the POI System. If Result is Success. + * @return the current {@code ReversalResponse} instance, allowing for method chaining + */ + public ReversalResponse poIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + return this; + } + + /** + * Data related to the POI System. If Result is Success. + * + * @return poIData Data related to the POI System. If Result is Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIData getPoIData() { + return poIData; + } + + /** + * Data related to the POI System. If Result is Success. + * + * @param poIData Data related to the POI System. If Result is Success. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + } + + /** + * originalPOITransaction + * + * @param originalPOITransaction + * @return the current {@code ReversalResponse} instance, allowing for method chaining + */ + public ReversalResponse originalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + return this; + } + + /** + * Get originalPOITransaction + * + * @return originalPOITransaction + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * originalPOITransaction + * + * @param originalPOITransaction + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + } + + /** + * Amount of the payment or loyalty to reverse. Copy. + * + * @param reversedAmount Amount of the payment or loyalty to reverse. Copy. + * @return the current {@code ReversalResponse} instance, allowing for method chaining + */ + public ReversalResponse reversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + isSetReversedAmount = true; // mark as set + return this; + } + + /** + * Amount of the payment or loyalty to reverse. Copy. minimum: 0.0 maximum: 99999999.999999 + * + * @return reversedAmount Amount of the payment or loyalty to reverse. Copy. + */ + @JsonProperty(JSON_PROPERTY_REVERSED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getReversedAmount() { + return reversedAmount; + } + + /** + * Amount of the payment or loyalty to reverse. Copy. + * + * @param reversedAmount Amount of the payment or loyalty to reverse. Copy. + */ + @JsonProperty(JSON_PROPERTY_REVERSED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + isSetReversedAmount = true; // mark as set + } + + /** + * paymentReceipt + * + * @param paymentReceipt + * @return the current {@code ReversalResponse} instance, allowing for method chaining + */ + public ReversalResponse paymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + return this; + } + + public ReversalResponse addPaymentReceiptItem(PaymentReceipt paymentReceiptItem) { + if (this.paymentReceipt == null) { + this.paymentReceipt = new ArrayList<>(); + } + this.paymentReceipt.add(paymentReceiptItem); + return this; + } + + /** + * Get paymentReceipt + * + * @return paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentReceipt() { + return paymentReceipt; + } + + /** + * paymentReceipt + * + * @param paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReversalResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReversalResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReversalResponse reversalResponse = (ReversalResponse) o; + return Objects.equals(this.response, reversalResponse.response) + && Objects.equals(this.isSetResponse, reversalResponse.isSetResponse) + && Objects.equals(this.poIData, reversalResponse.poIData) + && Objects.equals(this.isSetPoIData, reversalResponse.isSetPoIData) + && Objects.equals(this.originalPOITransaction, reversalResponse.originalPOITransaction) + && Objects.equals( + this.isSetOriginalPOITransaction, reversalResponse.isSetOriginalPOITransaction) + && Objects.equals(this.reversedAmount, reversalResponse.reversedAmount) + && Objects.equals(this.isSetReversedAmount, reversalResponse.isSetReversedAmount) + && Objects.equals(this.paymentReceipt, reversalResponse.paymentReceipt) + && Objects.equals(this.isSetPaymentReceipt, reversalResponse.isSetPaymentReceipt); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + poIData, + isSetPoIData, + originalPOITransaction, + isSetOriginalPOITransaction, + reversedAmount, + isSetReversedAmount, + paymentReceipt, + isSetPaymentReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReversalResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" poIData: ").append(toIndentedString(poIData)).append("\n"); + sb.append(" originalPOITransaction: ") + .append(toIndentedString(originalPOITransaction)) + .append("\n"); + sb.append(" reversedAmount: ").append(toIndentedString(reversedAmount)).append("\n"); + sb.append(" paymentReceipt: ").append(toIndentedString(paymentReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetPoIData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_DATA, this.poIData); + } + if (isSetOriginalPOITransaction) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, this.originalPOITransaction); + } + if (isSetReversedAmount) { + addIfNull(nulls, JSON_PROPERTY_REVERSED_AMOUNT, this.reversedAmount); + } + if (isSetPaymentReceipt) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RECEIPT, this.paymentReceipt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReversalResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReversalResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to ReversalResponse + */ + public static ReversalResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReversalResponse.class); + } + + /** + * Convert an instance of ReversalResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SaleData.java b/src/main/java/com/adyen/model/tapi/SaleData.java new file mode 100644 index 000000000..356c82cd9 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SaleData.java @@ -0,0 +1,825 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * Data associated with the Sale System, with a particular value during the processing of the + * payment by the POI, including the cards acquisition. + */ +@JsonPropertyOrder({ + SaleData.JSON_PROPERTY_OPERATOR_I_D, + SaleData.JSON_PROPERTY_OPERATOR_LANGUAGE, + SaleData.JSON_PROPERTY_SHIFT_NUMBER, + SaleData.JSON_PROPERTY_SALE_TRANSACTION_I_D, + SaleData.JSON_PROPERTY_SALE_REFERENCE_I_D, + SaleData.JSON_PROPERTY_SALE_TERMINAL_DATA, + SaleData.JSON_PROPERTY_TOKEN_REQUESTED_TYPE, + SaleData.JSON_PROPERTY_CUSTOMER_ORDER_I_D, + SaleData.JSON_PROPERTY_CUSTOMER_ORDER_REQ, + SaleData.JSON_PROPERTY_SALE_TO_P_O_I_DATA, + SaleData.JSON_PROPERTY_SALE_TO_ACQUIRER_DATA, + SaleData.JSON_PROPERTY_SALE_TO_ISSUER_DATA +}) +public class SaleData { + public static final String JSON_PROPERTY_OPERATOR_I_D = "OperatorID"; + private String operatorID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperatorID = false; + + public static final String JSON_PROPERTY_OPERATOR_LANGUAGE = "OperatorLanguage"; + private String operatorLanguage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperatorLanguage = false; + + public static final String JSON_PROPERTY_SHIFT_NUMBER = "ShiftNumber"; + private String shiftNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShiftNumber = false; + + public static final String JSON_PROPERTY_SALE_TRANSACTION_I_D = "SaleTransactionID"; + private TransactionIdentification saleTransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleTransactionID = false; + + public static final String JSON_PROPERTY_SALE_REFERENCE_I_D = "SaleReferenceID"; + private String saleReferenceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleReferenceID = false; + + public static final String JSON_PROPERTY_SALE_TERMINAL_DATA = "SaleTerminalData"; + private SaleTerminalData saleTerminalData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleTerminalData = false; + + public static final String JSON_PROPERTY_TOKEN_REQUESTED_TYPE = "TokenRequestedType"; + private TokenRequestedType tokenRequestedType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestedType = false; + + public static final String JSON_PROPERTY_CUSTOMER_ORDER_I_D = "CustomerOrderID"; + private String customerOrderID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerOrderID = false; + + /** Gets or Sets customerOrderReq */ + public enum CustomerOrderReqEnum { + BOTH(String.valueOf("Both")), + + CLOSED(String.valueOf("Closed")), + + OPEN(String.valueOf("Open")); + + private static final Logger LOG = Logger.getLogger(CustomerOrderReqEnum.class.getName()); + + private String value; + + CustomerOrderReqEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CustomerOrderReqEnum fromValue(String value) { + for (CustomerOrderReqEnum b : CustomerOrderReqEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "CustomerOrderReqEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(CustomerOrderReqEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_CUSTOMER_ORDER_REQ = "CustomerOrderReq"; + private List customerOrderReq; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerOrderReq = false; + + public static final String JSON_PROPERTY_SALE_TO_P_O_I_DATA = "SaleToPOIData"; + private String saleToPOIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleToPOIData = false; + + public static final String JSON_PROPERTY_SALE_TO_ACQUIRER_DATA = "SaleToAcquirerData"; + private String saleToAcquirerData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleToAcquirerData = false; + + public static final String JSON_PROPERTY_SALE_TO_ISSUER_DATA = "SaleToIssuerData"; + private SaleToIssuerData saleToIssuerData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleToIssuerData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SaleData() {} + + /** + * Identification of the Cashier or Operator. + * + * @param operatorID Identification of the Cashier or Operator. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData operatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + return this; + } + + /** + * Identification of the Cashier or Operator. + * + * @return operatorID Identification of the Cashier or Operator. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatorID() { + return operatorID; + } + + /** + * Identification of the Cashier or Operator. + * + * @param operatorID Identification of the Cashier or Operator. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + } + + /** + * Language of the Cashier or Operator. If different from the Login. + * + * @param operatorLanguage Language of the Cashier or Operator. If different from the Login. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData operatorLanguage(String operatorLanguage) { + this.operatorLanguage = operatorLanguage; + isSetOperatorLanguage = true; // mark as set + return this; + } + + /** + * Language of the Cashier or Operator. If different from the Login. + * + * @return operatorLanguage Language of the Cashier or Operator. If different from the Login. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatorLanguage() { + return operatorLanguage; + } + + /** + * Language of the Cashier or Operator. If different from the Login. + * + * @param operatorLanguage Language of the Cashier or Operator. If different from the Login. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatorLanguage(String operatorLanguage) { + this.operatorLanguage = operatorLanguage; + isSetOperatorLanguage = true; // mark as set + } + + /** + * Shift number. If different from the Login, see Login SaleData. + * + * @param shiftNumber Shift number. If different from the Login, see Login SaleData. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData shiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + return this; + } + + /** + * Shift number. If different from the Login, see Login SaleData. + * + * @return shiftNumber Shift number. If different from the Login, see Login SaleData. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Shift number. If different from the Login, see Login SaleData. + * + * @param shiftNumber Shift number. If different from the Login, see Login SaleData. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + } + + /** + * Identification of a Sale transaction. + * + * @param saleTransactionID Identification of a Sale transaction. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData saleTransactionID(TransactionIdentification saleTransactionID) { + this.saleTransactionID = saleTransactionID; + isSetSaleTransactionID = true; // mark as set + return this; + } + + /** + * Identification of a Sale transaction. + * + * @return saleTransactionID Identification of a Sale transaction. + */ + @JsonProperty(JSON_PROPERTY_SALE_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getSaleTransactionID() { + return saleTransactionID; + } + + /** + * Identification of a Sale transaction. + * + * @param saleTransactionID Identification of a Sale transaction. + */ + @JsonProperty(JSON_PROPERTY_SALE_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleTransactionID(TransactionIdentification saleTransactionID) { + this.saleTransactionID = saleTransactionID; + isSetSaleTransactionID = true; // mark as set + } + + /** + * Identification of a Sale global transaction for a sequence of related POI transactions. If + * payment reservation. + * + * @param saleReferenceID Identification of a Sale global transaction for a sequence of related + * POI transactions. If payment reservation. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData saleReferenceID(String saleReferenceID) { + this.saleReferenceID = saleReferenceID; + isSetSaleReferenceID = true; // mark as set + return this; + } + + /** + * Identification of a Sale global transaction for a sequence of related POI transactions. If + * payment reservation. + * + * @return saleReferenceID Identification of a Sale global transaction for a sequence of related + * POI transactions. If payment reservation. + */ + @JsonProperty(JSON_PROPERTY_SALE_REFERENCE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleReferenceID() { + return saleReferenceID; + } + + /** + * Identification of a Sale global transaction for a sequence of related POI transactions. If + * payment reservation. + * + * @param saleReferenceID Identification of a Sale global transaction for a sequence of related + * POI transactions. If payment reservation. + */ + @JsonProperty(JSON_PROPERTY_SALE_REFERENCE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleReferenceID(String saleReferenceID) { + this.saleReferenceID = saleReferenceID; + isSetSaleReferenceID = true; // mark as set + } + + /** + * Information related to the software and hardware features of the Sale Terminal. If content is + * not empty. + * + * @param saleTerminalData Information related to the software and hardware features of the Sale + * Terminal. If content is not empty. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData saleTerminalData(SaleTerminalData saleTerminalData) { + this.saleTerminalData = saleTerminalData; + isSetSaleTerminalData = true; // mark as set + return this; + } + + /** + * Information related to the software and hardware features of the Sale Terminal. If content is + * not empty. + * + * @return saleTerminalData Information related to the software and hardware features of the Sale + * Terminal. If content is not empty. + */ + @JsonProperty(JSON_PROPERTY_SALE_TERMINAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleTerminalData getSaleTerminalData() { + return saleTerminalData; + } + + /** + * Information related to the software and hardware features of the Sale Terminal. If content is + * not empty. + * + * @param saleTerminalData Information related to the software and hardware features of the Sale + * Terminal. If content is not empty. + */ + @JsonProperty(JSON_PROPERTY_SALE_TERMINAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleTerminalData(SaleTerminalData saleTerminalData) { + this.saleTerminalData = saleTerminalData; + isSetSaleTerminalData = true; // mark as set + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @param tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData tokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + isSetTokenRequestedType = true; // mark as set + return this; + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @return tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUESTED_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TokenRequestedType getTokenRequestedType() { + return tokenRequestedType; + } + + /** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. + * Possible values: * **Customer** * **Transaction** + * + * @param tokenRequestedType Type of token replacing the PAN of a payment card to identify the + * payment mean of the customer. It allows, for a merchant, to use a token for a transaction + * only or for a longer period. Possible values: * **Customer** * **Transaction** + */ + @JsonProperty(JSON_PROPERTY_TOKEN_REQUESTED_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + isSetTokenRequestedType = true; // mark as set + } + + /** + * Additional and optional identification of a customer order. + * + * @param customerOrderID Additional and optional identification of a customer order. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData customerOrderID(String customerOrderID) { + this.customerOrderID = customerOrderID; + isSetCustomerOrderID = true; // mark as set + return this; + } + + /** + * Additional and optional identification of a customer order. + * + * @return customerOrderID Additional and optional identification of a customer order. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_ORDER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomerOrderID() { + return customerOrderID; + } + + /** + * Additional and optional identification of a customer order. + * + * @param customerOrderID Additional and optional identification of a customer order. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_ORDER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerOrderID(String customerOrderID) { + this.customerOrderID = customerOrderID; + isSetCustomerOrderID = true; // mark as set + } + + /** + * List of customer order open, closed or both to be sent in the response messages. Possible + * values: * **Both** * **Closed** * **Open** + * + * @param customerOrderReq List of customer order open, closed or both to be sent in the response + * messages. Possible values: * **Both** * **Closed** * **Open** + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData customerOrderReq(List customerOrderReq) { + this.customerOrderReq = customerOrderReq; + isSetCustomerOrderReq = true; // mark as set + return this; + } + + public SaleData addCustomerOrderReqItem(CustomerOrderReqEnum customerOrderReqItem) { + if (this.customerOrderReq == null) { + this.customerOrderReq = new ArrayList<>(); + } + this.customerOrderReq.add(customerOrderReqItem); + return this; + } + + /** + * List of customer order open, closed or both to be sent in the response messages. Possible + * values: * **Both** * **Closed** * **Open** + * + * @return customerOrderReq List of customer order open, closed or both to be sent in the response + * messages. Possible values: * **Both** * **Closed** * **Open** + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_ORDER_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomerOrderReq() { + return customerOrderReq; + } + + /** + * List of customer order open, closed or both to be sent in the response messages. Possible + * values: * **Both** * **Closed** * **Open** + * + * @param customerOrderReq List of customer order open, closed or both to be sent in the response + * messages. Possible values: * **Both** * **Closed** * **Open** + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_ORDER_REQ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerOrderReq(List customerOrderReq) { + this.customerOrderReq = customerOrderReq; + isSetCustomerOrderReq = true; // mark as set + } + + /** + * Sale information intended for the POI. Stored with the transaction. + * + * @param saleToPOIData Sale information intended for the POI. Stored with the transaction. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData saleToPOIData(String saleToPOIData) { + this.saleToPOIData = saleToPOIData; + isSetSaleToPOIData = true; // mark as set + return this; + } + + /** + * Sale information intended for the POI. Stored with the transaction. + * + * @return saleToPOIData Sale information intended for the POI. Stored with the transaction. + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_P_O_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleToPOIData() { + return saleToPOIData; + } + + /** + * Sale information intended for the POI. Stored with the transaction. + * + * @param saleToPOIData Sale information intended for the POI. Stored with the transaction. + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_P_O_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleToPOIData(String saleToPOIData) { + this.saleToPOIData = saleToPOIData; + isSetSaleToPOIData = true; // mark as set + } + + /** + * Sale information intended for the Acquirer. Send to the Acquirer if present. + * + * @param saleToAcquirerData Sale information intended for the Acquirer. Send to the Acquirer if + * present. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData saleToAcquirerData(String saleToAcquirerData) { + this.saleToAcquirerData = saleToAcquirerData; + isSetSaleToAcquirerData = true; // mark as set + return this; + } + + /** + * Sale information intended for the Acquirer. Send to the Acquirer if present. + * + * @return saleToAcquirerData Sale information intended for the Acquirer. Send to the Acquirer if + * present. + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleToAcquirerData() { + return saleToAcquirerData; + } + + /** + * Sale information intended for the Acquirer. Send to the Acquirer if present. + * + * @param saleToAcquirerData Sale information intended for the Acquirer. Send to the Acquirer if + * present. + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_ACQUIRER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleToAcquirerData(String saleToAcquirerData) { + this.saleToAcquirerData = saleToAcquirerData; + isSetSaleToAcquirerData = true; // mark as set + } + + /** + * Sale information intended for the Issuer. Send to the Acquirer if present. + * + * @param saleToIssuerData Sale information intended for the Issuer. Send to the Acquirer if + * present. + * @return the current {@code SaleData} instance, allowing for method chaining + */ + public SaleData saleToIssuerData(SaleToIssuerData saleToIssuerData) { + this.saleToIssuerData = saleToIssuerData; + isSetSaleToIssuerData = true; // mark as set + return this; + } + + /** + * Sale information intended for the Issuer. Send to the Acquirer if present. + * + * @return saleToIssuerData Sale information intended for the Issuer. Send to the Acquirer if + * present. + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_ISSUER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleToIssuerData getSaleToIssuerData() { + return saleToIssuerData; + } + + /** + * Sale information intended for the Issuer. Send to the Acquirer if present. + * + * @param saleToIssuerData Sale information intended for the Issuer. Send to the Acquirer if + * present. + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_ISSUER_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleToIssuerData(SaleToIssuerData saleToIssuerData) { + this.saleToIssuerData = saleToIssuerData; + isSetSaleToIssuerData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SaleData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SaleData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleData saleData = (SaleData) o; + return Objects.equals(this.operatorID, saleData.operatorID) + && Objects.equals(this.isSetOperatorID, saleData.isSetOperatorID) + && Objects.equals(this.operatorLanguage, saleData.operatorLanguage) + && Objects.equals(this.isSetOperatorLanguage, saleData.isSetOperatorLanguage) + && Objects.equals(this.shiftNumber, saleData.shiftNumber) + && Objects.equals(this.isSetShiftNumber, saleData.isSetShiftNumber) + && Objects.equals(this.saleTransactionID, saleData.saleTransactionID) + && Objects.equals(this.isSetSaleTransactionID, saleData.isSetSaleTransactionID) + && Objects.equals(this.saleReferenceID, saleData.saleReferenceID) + && Objects.equals(this.isSetSaleReferenceID, saleData.isSetSaleReferenceID) + && Objects.equals(this.saleTerminalData, saleData.saleTerminalData) + && Objects.equals(this.isSetSaleTerminalData, saleData.isSetSaleTerminalData) + && Objects.equals(this.tokenRequestedType, saleData.tokenRequestedType) + && Objects.equals(this.isSetTokenRequestedType, saleData.isSetTokenRequestedType) + && Objects.equals(this.customerOrderID, saleData.customerOrderID) + && Objects.equals(this.isSetCustomerOrderID, saleData.isSetCustomerOrderID) + && Objects.equals(this.customerOrderReq, saleData.customerOrderReq) + && Objects.equals(this.isSetCustomerOrderReq, saleData.isSetCustomerOrderReq) + && Objects.equals(this.saleToPOIData, saleData.saleToPOIData) + && Objects.equals(this.isSetSaleToPOIData, saleData.isSetSaleToPOIData) + && Objects.equals(this.saleToAcquirerData, saleData.saleToAcquirerData) + && Objects.equals(this.isSetSaleToAcquirerData, saleData.isSetSaleToAcquirerData) + && Objects.equals(this.saleToIssuerData, saleData.saleToIssuerData) + && Objects.equals(this.isSetSaleToIssuerData, saleData.isSetSaleToIssuerData); + } + + @Override + public int hashCode() { + return Objects.hash( + operatorID, + isSetOperatorID, + operatorLanguage, + isSetOperatorLanguage, + shiftNumber, + isSetShiftNumber, + saleTransactionID, + isSetSaleTransactionID, + saleReferenceID, + isSetSaleReferenceID, + saleTerminalData, + isSetSaleTerminalData, + tokenRequestedType, + isSetTokenRequestedType, + customerOrderID, + isSetCustomerOrderID, + customerOrderReq, + isSetCustomerOrderReq, + saleToPOIData, + isSetSaleToPOIData, + saleToAcquirerData, + isSetSaleToAcquirerData, + saleToIssuerData, + isSetSaleToIssuerData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleData {\n"); + sb.append(" operatorID: ").append(toIndentedString(operatorID)).append("\n"); + sb.append(" operatorLanguage: ").append(toIndentedString(operatorLanguage)).append("\n"); + sb.append(" shiftNumber: ").append(toIndentedString(shiftNumber)).append("\n"); + sb.append(" saleTransactionID: ").append(toIndentedString(saleTransactionID)).append("\n"); + sb.append(" saleReferenceID: ").append(toIndentedString(saleReferenceID)).append("\n"); + sb.append(" saleTerminalData: ").append(toIndentedString(saleTerminalData)).append("\n"); + sb.append(" tokenRequestedType: ").append(toIndentedString(tokenRequestedType)).append("\n"); + sb.append(" customerOrderID: ").append(toIndentedString(customerOrderID)).append("\n"); + sb.append(" customerOrderReq: ").append(toIndentedString(customerOrderReq)).append("\n"); + sb.append(" saleToPOIData: ").append(toIndentedString(saleToPOIData)).append("\n"); + sb.append(" saleToAcquirerData: ").append(toIndentedString(saleToAcquirerData)).append("\n"); + sb.append(" saleToIssuerData: ").append(toIndentedString(saleToIssuerData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperatorID) { + addIfNull(nulls, JSON_PROPERTY_OPERATOR_I_D, this.operatorID); + } + if (isSetOperatorLanguage) { + addIfNull(nulls, JSON_PROPERTY_OPERATOR_LANGUAGE, this.operatorLanguage); + } + if (isSetShiftNumber) { + addIfNull(nulls, JSON_PROPERTY_SHIFT_NUMBER, this.shiftNumber); + } + if (isSetSaleTransactionID) { + addIfNull(nulls, JSON_PROPERTY_SALE_TRANSACTION_I_D, this.saleTransactionID); + } + if (isSetSaleReferenceID) { + addIfNull(nulls, JSON_PROPERTY_SALE_REFERENCE_I_D, this.saleReferenceID); + } + if (isSetSaleTerminalData) { + addIfNull(nulls, JSON_PROPERTY_SALE_TERMINAL_DATA, this.saleTerminalData); + } + if (isSetTokenRequestedType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTED_TYPE, this.tokenRequestedType); + } + if (isSetCustomerOrderID) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_ORDER_I_D, this.customerOrderID); + } + if (isSetCustomerOrderReq) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_ORDER_REQ, this.customerOrderReq); + } + if (isSetSaleToPOIData) { + addIfNull(nulls, JSON_PROPERTY_SALE_TO_P_O_I_DATA, this.saleToPOIData); + } + if (isSetSaleToAcquirerData) { + addIfNull(nulls, JSON_PROPERTY_SALE_TO_ACQUIRER_DATA, this.saleToAcquirerData); + } + if (isSetSaleToIssuerData) { + addIfNull(nulls, JSON_PROPERTY_SALE_TO_ISSUER_DATA, this.saleToIssuerData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SaleData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleData + * @throws JsonProcessingException if the JSON string is invalid with respect to SaleData + */ + public static SaleData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleData.class); + } + + /** + * Convert an instance of SaleData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SaleSoftware.java b/src/main/java/com/adyen/model/tapi/SaleSoftware.java new file mode 100644 index 000000000..8ab542a5e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SaleSoftware.java @@ -0,0 +1,335 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Information related to the software of the Sale System which manages the NEXO Sale to POI + * protocol. + */ +@JsonPropertyOrder({ + SaleSoftware.JSON_PROPERTY_MANUFACTURER_I_D, + SaleSoftware.JSON_PROPERTY_APPLICATION_NAME, + SaleSoftware.JSON_PROPERTY_SOFTWARE_VERSION, + SaleSoftware.JSON_PROPERTY_CERTIFICATION_CODE +}) +public class SaleSoftware { + public static final String JSON_PROPERTY_MANUFACTURER_I_D = "ManufacturerID"; + private String manufacturerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManufacturerID = false; + + public static final String JSON_PROPERTY_APPLICATION_NAME = "ApplicationName"; + private String applicationName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationName = false; + + public static final String JSON_PROPERTY_SOFTWARE_VERSION = "SoftwareVersion"; + private String softwareVersion; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSoftwareVersion = false; + + public static final String JSON_PROPERTY_CERTIFICATION_CODE = "CertificationCode"; + private String certificationCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCertificationCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SaleSoftware() {} + + /** + * Identification of the Manufacturer. + * + * @param manufacturerID Identification of the Manufacturer. + * @return the current {@code SaleSoftware} instance, allowing for method chaining + */ + public SaleSoftware manufacturerID(String manufacturerID) { + this.manufacturerID = manufacturerID; + isSetManufacturerID = true; // mark as set + return this; + } + + /** + * Identification of the Manufacturer. + * + * @return manufacturerID Identification of the Manufacturer. + */ + @JsonProperty(JSON_PROPERTY_MANUFACTURER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getManufacturerID() { + return manufacturerID; + } + + /** + * Identification of the Manufacturer. + * + * @param manufacturerID Identification of the Manufacturer. + */ + @JsonProperty(JSON_PROPERTY_MANUFACTURER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setManufacturerID(String manufacturerID) { + this.manufacturerID = manufacturerID; + isSetManufacturerID = true; // mark as set + } + + /** + * Name of the software product. + * + * @param applicationName Name of the software product. + * @return the current {@code SaleSoftware} instance, allowing for method chaining + */ + public SaleSoftware applicationName(String applicationName) { + this.applicationName = applicationName; + isSetApplicationName = true; // mark as set + return this; + } + + /** + * Name of the software product. + * + * @return applicationName Name of the software product. + */ + @JsonProperty(JSON_PROPERTY_APPLICATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApplicationName() { + return applicationName; + } + + /** + * Name of the software product. + * + * @param applicationName Name of the software product. + */ + @JsonProperty(JSON_PROPERTY_APPLICATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + isSetApplicationName = true; // mark as set + } + + /** + * Version of the software product. + * + * @param softwareVersion Version of the software product. + * @return the current {@code SaleSoftware} instance, allowing for method chaining + */ + public SaleSoftware softwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + isSetSoftwareVersion = true; // mark as set + return this; + } + + /** + * Version of the software product. + * + * @return softwareVersion Version of the software product. + */ + @JsonProperty(JSON_PROPERTY_SOFTWARE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSoftwareVersion() { + return softwareVersion; + } + + /** + * Version of the software product. + * + * @param softwareVersion Version of the software product. + */ + @JsonProperty(JSON_PROPERTY_SOFTWARE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + isSetSoftwareVersion = true; // mark as set + } + + /** + * Certification code of the software which manages the Sale to POI protocol. + * + * @param certificationCode Certification code of the software which manages the Sale to POI + * protocol. + * @return the current {@code SaleSoftware} instance, allowing for method chaining + */ + public SaleSoftware certificationCode(String certificationCode) { + this.certificationCode = certificationCode; + isSetCertificationCode = true; // mark as set + return this; + } + + /** + * Certification code of the software which manages the Sale to POI protocol. + * + * @return certificationCode Certification code of the software which manages the Sale to POI + * protocol. + */ + @JsonProperty(JSON_PROPERTY_CERTIFICATION_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCertificationCode() { + return certificationCode; + } + + /** + * Certification code of the software which manages the Sale to POI protocol. + * + * @param certificationCode Certification code of the software which manages the Sale to POI + * protocol. + */ + @JsonProperty(JSON_PROPERTY_CERTIFICATION_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCertificationCode(String certificationCode) { + this.certificationCode = certificationCode; + isSetCertificationCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SaleSoftware includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SaleSoftware object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleSoftware saleSoftware = (SaleSoftware) o; + return Objects.equals(this.manufacturerID, saleSoftware.manufacturerID) + && Objects.equals(this.isSetManufacturerID, saleSoftware.isSetManufacturerID) + && Objects.equals(this.applicationName, saleSoftware.applicationName) + && Objects.equals(this.isSetApplicationName, saleSoftware.isSetApplicationName) + && Objects.equals(this.softwareVersion, saleSoftware.softwareVersion) + && Objects.equals(this.isSetSoftwareVersion, saleSoftware.isSetSoftwareVersion) + && Objects.equals(this.certificationCode, saleSoftware.certificationCode) + && Objects.equals(this.isSetCertificationCode, saleSoftware.isSetCertificationCode); + } + + @Override + public int hashCode() { + return Objects.hash( + manufacturerID, + isSetManufacturerID, + applicationName, + isSetApplicationName, + softwareVersion, + isSetSoftwareVersion, + certificationCode, + isSetCertificationCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleSoftware {\n"); + sb.append(" manufacturerID: ").append(toIndentedString(manufacturerID)).append("\n"); + sb.append(" applicationName: ").append(toIndentedString(applicationName)).append("\n"); + sb.append(" softwareVersion: ").append(toIndentedString(softwareVersion)).append("\n"); + sb.append(" certificationCode: ").append(toIndentedString(certificationCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetManufacturerID) { + addIfNull(nulls, JSON_PROPERTY_MANUFACTURER_I_D, this.manufacturerID); + } + if (isSetApplicationName) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_NAME, this.applicationName); + } + if (isSetSoftwareVersion) { + addIfNull(nulls, JSON_PROPERTY_SOFTWARE_VERSION, this.softwareVersion); + } + if (isSetCertificationCode) { + addIfNull(nulls, JSON_PROPERTY_CERTIFICATION_CODE, this.certificationCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SaleSoftware given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleSoftware + * @throws JsonProcessingException if the JSON string is invalid with respect to SaleSoftware + */ + public static SaleSoftware fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleSoftware.class); + } + + /** + * Convert an instance of SaleSoftware to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SaleTerminalData.java b/src/main/java/com/adyen/model/tapi/SaleTerminalData.java new file mode 100644 index 000000000..13f69e0f8 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SaleTerminalData.java @@ -0,0 +1,192 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Information related to the software and hardware features of the Sale Terminal. Sent in the Login + * Request if a Sale Terminal is involved in the login. In other messages, sent when a logical + * device is out of order (SaleCapabilities) or when other data have changed or were missing in the + * Login. + */ +@JsonPropertyOrder({SaleTerminalData.JSON_PROPERTY_TOTALS_GROUP_I_D}) +public class SaleTerminalData { + public static final String JSON_PROPERTY_TOTALS_GROUP_I_D = "TotalsGroupID"; + private String totalsGroupID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroupID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SaleTerminalData() {} + + /** + * Identification of a group of transactions on a POI Terminal, having the same Sale features. + * Could be used to group POI for reconciliation or other purpose defined by the Sale System. The + * default value is assigned by the Login Request. + * + * @param totalsGroupID Identification of a group of transactions on a POI Terminal, having the + * same Sale features. Could be used to group POI for reconciliation or other purpose defined + * by the Sale System. The default value is assigned by the Login Request. + * @return the current {@code SaleTerminalData} instance, allowing for method chaining + */ + public SaleTerminalData totalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + isSetTotalsGroupID = true; // mark as set + return this; + } + + /** + * Identification of a group of transactions on a POI Terminal, having the same Sale features. + * Could be used to group POI for reconciliation or other purpose defined by the Sale System. The + * default value is assigned by the Login Request. + * + * @return totalsGroupID Identification of a group of transactions on a POI Terminal, having the + * same Sale features. Could be used to group POI for reconciliation or other purpose defined + * by the Sale System. The default value is assigned by the Login Request. + */ + @JsonProperty(JSON_PROPERTY_TOTALS_GROUP_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTotalsGroupID() { + return totalsGroupID; + } + + /** + * Identification of a group of transactions on a POI Terminal, having the same Sale features. + * Could be used to group POI for reconciliation or other purpose defined by the Sale System. The + * default value is assigned by the Login Request. + * + * @param totalsGroupID Identification of a group of transactions on a POI Terminal, having the + * same Sale features. Could be used to group POI for reconciliation or other purpose defined + * by the Sale System. The default value is assigned by the Login Request. + */ + @JsonProperty(JSON_PROPERTY_TOTALS_GROUP_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + isSetTotalsGroupID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SaleTerminalData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SaleTerminalData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleTerminalData saleTerminalData = (SaleTerminalData) o; + return Objects.equals(this.totalsGroupID, saleTerminalData.totalsGroupID) + && Objects.equals(this.isSetTotalsGroupID, saleTerminalData.isSetTotalsGroupID); + } + + @Override + public int hashCode() { + return Objects.hash(totalsGroupID, isSetTotalsGroupID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleTerminalData {\n"); + sb.append(" totalsGroupID: ").append(toIndentedString(totalsGroupID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTotalsGroupID) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP_I_D, this.totalsGroupID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SaleTerminalData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleTerminalData + * @throws JsonProcessingException if the JSON string is invalid with respect to SaleTerminalData + */ + public static SaleTerminalData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleTerminalData.class); + } + + /** + * Convert an instance of SaleTerminalData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SaleToIssuerData.java b/src/main/java/com/adyen/model/tapi/SaleToIssuerData.java new file mode 100644 index 000000000..b7eaf3510 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SaleToIssuerData.java @@ -0,0 +1,178 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Sale information intended for the Issuer. The POI System receives this information and sends it + * to the Acquirer for the Issuer without any change. + */ +@JsonPropertyOrder({SaleToIssuerData.JSON_PROPERTY_STATEMENT_REFERENCE}) +public class SaleToIssuerData { + public static final String JSON_PROPERTY_STATEMENT_REFERENCE = "StatementReference"; + private String statementReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatementReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SaleToIssuerData() {} + + /** + * Label to print on the bank statement. + * + * @param statementReference Label to print on the bank statement. + * @return the current {@code SaleToIssuerData} instance, allowing for method chaining + */ + public SaleToIssuerData statementReference(String statementReference) { + this.statementReference = statementReference; + isSetStatementReference = true; // mark as set + return this; + } + + /** + * Label to print on the bank statement. + * + * @return statementReference Label to print on the bank statement. + */ + @JsonProperty(JSON_PROPERTY_STATEMENT_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatementReference() { + return statementReference; + } + + /** + * Label to print on the bank statement. + * + * @param statementReference Label to print on the bank statement. + */ + @JsonProperty(JSON_PROPERTY_STATEMENT_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatementReference(String statementReference) { + this.statementReference = statementReference; + isSetStatementReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SaleToIssuerData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SaleToIssuerData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleToIssuerData saleToIssuerData = (SaleToIssuerData) o; + return Objects.equals(this.statementReference, saleToIssuerData.statementReference) + && Objects.equals(this.isSetStatementReference, saleToIssuerData.isSetStatementReference); + } + + @Override + public int hashCode() { + return Objects.hash(statementReference, isSetStatementReference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleToIssuerData {\n"); + sb.append(" statementReference: ").append(toIndentedString(statementReference)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatementReference) { + addIfNull(nulls, JSON_PROPERTY_STATEMENT_REFERENCE, this.statementReference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SaleToIssuerData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleToIssuerData + * @throws JsonProcessingException if the JSON string is invalid with respect to SaleToIssuerData + */ + public static SaleToIssuerData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleToIssuerData.class); + } + + /** + * Convert an instance of SaleToIssuerData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SaleToPOIRequest.java b/src/main/java/com/adyen/model/tapi/SaleToPOIRequest.java new file mode 100644 index 000000000..ff5dee99c --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SaleToPOIRequest.java @@ -0,0 +1,1201 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * The SaleToPOIRequest message pair is a container for the request message content. It contains a + * MessageHeader and a message body. + */ +@JsonPropertyOrder({ + SaleToPOIRequest.JSON_PROPERTY_MESSAGE_HEADER, + SaleToPOIRequest.JSON_PROPERTY_ABORT_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_BALANCE_INQUIRY_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_CARD_ACQUISITION_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_ADMIN_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_DIAGNOSIS_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_DISPLAY_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_ENABLE_SERVICE_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_EVENT_NOTIFICATION, + SaleToPOIRequest.JSON_PROPERTY_GET_TOTALS_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_INPUT_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_INPUT_UPDATE, + SaleToPOIRequest.JSON_PROPERTY_LOGIN_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_LOGOUT_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_PAYMENT_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_PRINT_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_CARD_READER_A_P_D_U_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_RECONCILIATION_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_REVERSAL_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_STORED_VALUE_REQUEST, + SaleToPOIRequest.JSON_PROPERTY_TRANSACTION_STATUS_REQUEST +}) +public class SaleToPOIRequest { + public static final String JSON_PROPERTY_MESSAGE_HEADER = "MessageHeader"; + private MessageHeader messageHeader; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageHeader = false; + + public static final String JSON_PROPERTY_ABORT_REQUEST = "AbortRequest"; + private AbortRequest abortRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAbortRequest = false; + + public static final String JSON_PROPERTY_BALANCE_INQUIRY_REQUEST = "BalanceInquiryRequest"; + private AbortRequest balanceInquiryRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceInquiryRequest = false; + + public static final String JSON_PROPERTY_CARD_ACQUISITION_REQUEST = "CardAcquisitionRequest"; + private CardAcquisitionRequest cardAcquisitionRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionRequest = false; + + public static final String JSON_PROPERTY_ADMIN_REQUEST = "AdminRequest"; + private AdminRequest adminRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdminRequest = false; + + public static final String JSON_PROPERTY_DIAGNOSIS_REQUEST = "DiagnosisRequest"; + private DiagnosisRequest diagnosisRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDiagnosisRequest = false; + + public static final String JSON_PROPERTY_DISPLAY_REQUEST = "DisplayRequest"; + private DisplayRequest displayRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayRequest = false; + + public static final String JSON_PROPERTY_ENABLE_SERVICE_REQUEST = "EnableServiceRequest"; + private EnableServiceRequest enableServiceRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableServiceRequest = false; + + public static final String JSON_PROPERTY_EVENT_NOTIFICATION = "EventNotification"; + private EventNotification eventNotification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventNotification = false; + + public static final String JSON_PROPERTY_GET_TOTALS_REQUEST = "GetTotalsRequest"; + private GetTotalsRequest getTotalsRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGetTotalsRequest = false; + + public static final String JSON_PROPERTY_INPUT_REQUEST = "InputRequest"; + private InputRequest inputRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputRequest = false; + + public static final String JSON_PROPERTY_INPUT_UPDATE = "InputUpdate"; + private InputUpdate inputUpdate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputUpdate = false; + + public static final String JSON_PROPERTY_LOGIN_REQUEST = "LoginRequest"; + private LoginRequest loginRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoginRequest = false; + + public static final String JSON_PROPERTY_LOGOUT_REQUEST = "LogoutRequest"; + private LogoutRequest logoutRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoutRequest = false; + + public static final String JSON_PROPERTY_PAYMENT_REQUEST = "PaymentRequest"; + private PaymentRequest paymentRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentRequest = false; + + public static final String JSON_PROPERTY_PRINT_REQUEST = "PrintRequest"; + private PrintRequest printRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrintRequest = false; + + public static final String JSON_PROPERTY_CARD_READER_A_P_D_U_REQUEST = "CardReaderAPDURequest"; + private CardReaderAPDURequest cardReaderAPDURequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardReaderAPDURequest = false; + + public static final String JSON_PROPERTY_RECONCILIATION_REQUEST = "ReconciliationRequest"; + private ReconciliationRequest reconciliationRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReconciliationRequest = false; + + public static final String JSON_PROPERTY_REVERSAL_REQUEST = "ReversalRequest"; + private ReversalRequest reversalRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversalRequest = false; + + public static final String JSON_PROPERTY_STORED_VALUE_REQUEST = "StoredValueRequest"; + private StoredValueRequest storedValueRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueRequest = false; + + public static final String JSON_PROPERTY_TRANSACTION_STATUS_REQUEST = "TransactionStatusRequest"; + private TransactionStatusRequest transactionStatusRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionStatusRequest = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SaleToPOIRequest() {} + + /** + * messageHeader + * + * @param messageHeader + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest messageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + isSetMessageHeader = true; // mark as set + return this; + } + + /** + * Get messageHeader + * + * @return messageHeader + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageHeader getMessageHeader() { + return messageHeader; + } + + /** + * messageHeader + * + * @param messageHeader + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + isSetMessageHeader = true; // mark as set + } + + /** + * Content of the Abort Request message. + * + * @param abortRequest Content of the Abort Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest abortRequest(AbortRequest abortRequest) { + this.abortRequest = abortRequest; + isSetAbortRequest = true; // mark as set + return this; + } + + /** + * Content of the Abort Request message. + * + * @return abortRequest Content of the Abort Request message. + */ + @JsonProperty(JSON_PROPERTY_ABORT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AbortRequest getAbortRequest() { + return abortRequest; + } + + /** + * Content of the Abort Request message. + * + * @param abortRequest Content of the Abort Request message. + */ + @JsonProperty(JSON_PROPERTY_ABORT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAbortRequest(AbortRequest abortRequest) { + this.abortRequest = abortRequest; + isSetAbortRequest = true; // mark as set + } + + /** + * Content of the Balance Inquiry Request message. + * + * @param balanceInquiryRequest Content of the Balance Inquiry Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest balanceInquiryRequest(AbortRequest balanceInquiryRequest) { + this.balanceInquiryRequest = balanceInquiryRequest; + isSetBalanceInquiryRequest = true; // mark as set + return this; + } + + /** + * Content of the Balance Inquiry Request message. + * + * @return balanceInquiryRequest Content of the Balance Inquiry Request message. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_INQUIRY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AbortRequest getBalanceInquiryRequest() { + return balanceInquiryRequest; + } + + /** + * Content of the Balance Inquiry Request message. + * + * @param balanceInquiryRequest Content of the Balance Inquiry Request message. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_INQUIRY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceInquiryRequest(AbortRequest balanceInquiryRequest) { + this.balanceInquiryRequest = balanceInquiryRequest; + isSetBalanceInquiryRequest = true; // mark as set + } + + /** + * Content of the Card Acquisition Request message. + * + * @param cardAcquisitionRequest Content of the Card Acquisition Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest cardAcquisitionRequest(CardAcquisitionRequest cardAcquisitionRequest) { + this.cardAcquisitionRequest = cardAcquisitionRequest; + isSetCardAcquisitionRequest = true; // mark as set + return this; + } + + /** + * Content of the Card Acquisition Request message. + * + * @return cardAcquisitionRequest Content of the Card Acquisition Request message. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardAcquisitionRequest getCardAcquisitionRequest() { + return cardAcquisitionRequest; + } + + /** + * Content of the Card Acquisition Request message. + * + * @param cardAcquisitionRequest Content of the Card Acquisition Request message. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionRequest(CardAcquisitionRequest cardAcquisitionRequest) { + this.cardAcquisitionRequest = cardAcquisitionRequest; + isSetCardAcquisitionRequest = true; // mark as set + } + + /** + * Content of the Admin Request message. + * + * @param adminRequest Content of the Admin Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest adminRequest(AdminRequest adminRequest) { + this.adminRequest = adminRequest; + isSetAdminRequest = true; // mark as set + return this; + } + + /** + * Content of the Admin Request message. + * + * @return adminRequest Content of the Admin Request message. + */ + @JsonProperty(JSON_PROPERTY_ADMIN_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AdminRequest getAdminRequest() { + return adminRequest; + } + + /** + * Content of the Admin Request message. + * + * @param adminRequest Content of the Admin Request message. + */ + @JsonProperty(JSON_PROPERTY_ADMIN_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdminRequest(AdminRequest adminRequest) { + this.adminRequest = adminRequest; + isSetAdminRequest = true; // mark as set + } + + /** + * Content of the Diagnosis Request message. + * + * @param diagnosisRequest Content of the Diagnosis Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest diagnosisRequest(DiagnosisRequest diagnosisRequest) { + this.diagnosisRequest = diagnosisRequest; + isSetDiagnosisRequest = true; // mark as set + return this; + } + + /** + * Content of the Diagnosis Request message. + * + * @return diagnosisRequest Content of the Diagnosis Request message. + */ + @JsonProperty(JSON_PROPERTY_DIAGNOSIS_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DiagnosisRequest getDiagnosisRequest() { + return diagnosisRequest; + } + + /** + * Content of the Diagnosis Request message. + * + * @param diagnosisRequest Content of the Diagnosis Request message. + */ + @JsonProperty(JSON_PROPERTY_DIAGNOSIS_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDiagnosisRequest(DiagnosisRequest diagnosisRequest) { + this.diagnosisRequest = diagnosisRequest; + isSetDiagnosisRequest = true; // mark as set + } + + /** + * Content of the Display Request message. + * + * @param displayRequest Content of the Display Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest displayRequest(DisplayRequest displayRequest) { + this.displayRequest = displayRequest; + isSetDisplayRequest = true; // mark as set + return this; + } + + /** + * Content of the Display Request message. + * + * @return displayRequest Content of the Display Request message. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayRequest getDisplayRequest() { + return displayRequest; + } + + /** + * Content of the Display Request message. + * + * @param displayRequest Content of the Display Request message. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayRequest(DisplayRequest displayRequest) { + this.displayRequest = displayRequest; + isSetDisplayRequest = true; // mark as set + } + + /** + * Content of the Enable Service Request message. + * + * @param enableServiceRequest Content of the Enable Service Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest enableServiceRequest(EnableServiceRequest enableServiceRequest) { + this.enableServiceRequest = enableServiceRequest; + isSetEnableServiceRequest = true; // mark as set + return this; + } + + /** + * Content of the Enable Service Request message. + * + * @return enableServiceRequest Content of the Enable Service Request message. + */ + @JsonProperty(JSON_PROPERTY_ENABLE_SERVICE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnableServiceRequest getEnableServiceRequest() { + return enableServiceRequest; + } + + /** + * Content of the Enable Service Request message. + * + * @param enableServiceRequest Content of the Enable Service Request message. + */ + @JsonProperty(JSON_PROPERTY_ENABLE_SERVICE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableServiceRequest(EnableServiceRequest enableServiceRequest) { + this.enableServiceRequest = enableServiceRequest; + isSetEnableServiceRequest = true; // mark as set + } + + /** + * Content of the EventNotification message. + * + * @param eventNotification Content of the EventNotification message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest eventNotification(EventNotification eventNotification) { + this.eventNotification = eventNotification; + isSetEventNotification = true; // mark as set + return this; + } + + /** + * Content of the EventNotification message. + * + * @return eventNotification Content of the EventNotification message. + */ + @JsonProperty(JSON_PROPERTY_EVENT_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventNotification getEventNotification() { + return eventNotification; + } + + /** + * Content of the EventNotification message. + * + * @param eventNotification Content of the EventNotification message. + */ + @JsonProperty(JSON_PROPERTY_EVENT_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventNotification(EventNotification eventNotification) { + this.eventNotification = eventNotification; + isSetEventNotification = true; // mark as set + } + + /** + * Content of the Get Totals Request message. + * + * @param getTotalsRequest Content of the Get Totals Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest getTotalsRequest(GetTotalsRequest getTotalsRequest) { + this.getTotalsRequest = getTotalsRequest; + isSetGetTotalsRequest = true; // mark as set + return this; + } + + /** + * Content of the Get Totals Request message. + * + * @return getTotalsRequest Content of the Get Totals Request message. + */ + @JsonProperty(JSON_PROPERTY_GET_TOTALS_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetTotalsRequest getGetTotalsRequest() { + return getTotalsRequest; + } + + /** + * Content of the Get Totals Request message. + * + * @param getTotalsRequest Content of the Get Totals Request message. + */ + @JsonProperty(JSON_PROPERTY_GET_TOTALS_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGetTotalsRequest(GetTotalsRequest getTotalsRequest) { + this.getTotalsRequest = getTotalsRequest; + isSetGetTotalsRequest = true; // mark as set + } + + /** + * Content of the Input Request message. + * + * @param inputRequest Content of the Input Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest inputRequest(InputRequest inputRequest) { + this.inputRequest = inputRequest; + isSetInputRequest = true; // mark as set + return this; + } + + /** + * Content of the Input Request message. + * + * @return inputRequest Content of the Input Request message. + */ + @JsonProperty(JSON_PROPERTY_INPUT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputRequest getInputRequest() { + return inputRequest; + } + + /** + * Content of the Input Request message. + * + * @param inputRequest Content of the Input Request message. + */ + @JsonProperty(JSON_PROPERTY_INPUT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputRequest(InputRequest inputRequest) { + this.inputRequest = inputRequest; + isSetInputRequest = true; // mark as set + } + + /** + * Content of the Input Update message. + * + * @param inputUpdate Content of the Input Update message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest inputUpdate(InputUpdate inputUpdate) { + this.inputUpdate = inputUpdate; + isSetInputUpdate = true; // mark as set + return this; + } + + /** + * Content of the Input Update message. + * + * @return inputUpdate Content of the Input Update message. + */ + @JsonProperty(JSON_PROPERTY_INPUT_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputUpdate getInputUpdate() { + return inputUpdate; + } + + /** + * Content of the Input Update message. + * + * @param inputUpdate Content of the Input Update message. + */ + @JsonProperty(JSON_PROPERTY_INPUT_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputUpdate(InputUpdate inputUpdate) { + this.inputUpdate = inputUpdate; + isSetInputUpdate = true; // mark as set + } + + /** + * Content of the Login Request message. + * + * @param loginRequest Content of the Login Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest loginRequest(LoginRequest loginRequest) { + this.loginRequest = loginRequest; + isSetLoginRequest = true; // mark as set + return this; + } + + /** + * Content of the Login Request message. + * + * @return loginRequest Content of the Login Request message. + */ + @JsonProperty(JSON_PROPERTY_LOGIN_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoginRequest getLoginRequest() { + return loginRequest; + } + + /** + * Content of the Login Request message. + * + * @param loginRequest Content of the Login Request message. + */ + @JsonProperty(JSON_PROPERTY_LOGIN_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoginRequest(LoginRequest loginRequest) { + this.loginRequest = loginRequest; + isSetLoginRequest = true; // mark as set + } + + /** + * Content of the Logout Request message. + * + * @param logoutRequest Content of the Logout Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest logoutRequest(LogoutRequest logoutRequest) { + this.logoutRequest = logoutRequest; + isSetLogoutRequest = true; // mark as set + return this; + } + + /** + * Content of the Logout Request message. + * + * @return logoutRequest Content of the Logout Request message. + */ + @JsonProperty(JSON_PROPERTY_LOGOUT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogoutRequest getLogoutRequest() { + return logoutRequest; + } + + /** + * Content of the Logout Request message. + * + * @param logoutRequest Content of the Logout Request message. + */ + @JsonProperty(JSON_PROPERTY_LOGOUT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoutRequest(LogoutRequest logoutRequest) { + this.logoutRequest = logoutRequest; + isSetLogoutRequest = true; // mark as set + } + + /** + * Content of the Payment Request message. + * + * @param paymentRequest Content of the Payment Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest paymentRequest(PaymentRequest paymentRequest) { + this.paymentRequest = paymentRequest; + isSetPaymentRequest = true; // mark as set + return this; + } + + /** + * Content of the Payment Request message. + * + * @return paymentRequest Content of the Payment Request message. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentRequest getPaymentRequest() { + return paymentRequest; + } + + /** + * Content of the Payment Request message. + * + * @param paymentRequest Content of the Payment Request message. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentRequest(PaymentRequest paymentRequest) { + this.paymentRequest = paymentRequest; + isSetPaymentRequest = true; // mark as set + } + + /** + * Content of the Print Request message. + * + * @param printRequest Content of the Print Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest printRequest(PrintRequest printRequest) { + this.printRequest = printRequest; + isSetPrintRequest = true; // mark as set + return this; + } + + /** + * Content of the Print Request message. + * + * @return printRequest Content of the Print Request message. + */ + @JsonProperty(JSON_PROPERTY_PRINT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PrintRequest getPrintRequest() { + return printRequest; + } + + /** + * Content of the Print Request message. + * + * @param printRequest Content of the Print Request message. + */ + @JsonProperty(JSON_PROPERTY_PRINT_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrintRequest(PrintRequest printRequest) { + this.printRequest = printRequest; + isSetPrintRequest = true; // mark as set + } + + /** + * Content of the Card Reader APDU Request message. + * + * @param cardReaderAPDURequest Content of the Card Reader APDU Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest cardReaderAPDURequest(CardReaderAPDURequest cardReaderAPDURequest) { + this.cardReaderAPDURequest = cardReaderAPDURequest; + isSetCardReaderAPDURequest = true; // mark as set + return this; + } + + /** + * Content of the Card Reader APDU Request message. + * + * @return cardReaderAPDURequest Content of the Card Reader APDU Request message. + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_A_P_D_U_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardReaderAPDURequest getCardReaderAPDURequest() { + return cardReaderAPDURequest; + } + + /** + * Content of the Card Reader APDU Request message. + * + * @param cardReaderAPDURequest Content of the Card Reader APDU Request message. + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_A_P_D_U_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardReaderAPDURequest(CardReaderAPDURequest cardReaderAPDURequest) { + this.cardReaderAPDURequest = cardReaderAPDURequest; + isSetCardReaderAPDURequest = true; // mark as set + } + + /** + * Content of the Reconciliation Request message. + * + * @param reconciliationRequest Content of the Reconciliation Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest reconciliationRequest(ReconciliationRequest reconciliationRequest) { + this.reconciliationRequest = reconciliationRequest; + isSetReconciliationRequest = true; // mark as set + return this; + } + + /** + * Content of the Reconciliation Request message. + * + * @return reconciliationRequest Content of the Reconciliation Request message. + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReconciliationRequest getReconciliationRequest() { + return reconciliationRequest; + } + + /** + * Content of the Reconciliation Request message. + * + * @param reconciliationRequest Content of the Reconciliation Request message. + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReconciliationRequest(ReconciliationRequest reconciliationRequest) { + this.reconciliationRequest = reconciliationRequest; + isSetReconciliationRequest = true; // mark as set + } + + /** + * Content of the Reversal Request message. + * + * @param reversalRequest Content of the Reversal Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest reversalRequest(ReversalRequest reversalRequest) { + this.reversalRequest = reversalRequest; + isSetReversalRequest = true; // mark as set + return this; + } + + /** + * Content of the Reversal Request message. + * + * @return reversalRequest Content of the Reversal Request message. + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReversalRequest getReversalRequest() { + return reversalRequest; + } + + /** + * Content of the Reversal Request message. + * + * @param reversalRequest Content of the Reversal Request message. + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversalRequest(ReversalRequest reversalRequest) { + this.reversalRequest = reversalRequest; + isSetReversalRequest = true; // mark as set + } + + /** + * Content of the Stored Value Request message. + * + * @param storedValueRequest Content of the Stored Value Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest storedValueRequest(StoredValueRequest storedValueRequest) { + this.storedValueRequest = storedValueRequest; + isSetStoredValueRequest = true; // mark as set + return this; + } + + /** + * Content of the Stored Value Request message. + * + * @return storedValueRequest Content of the Stored Value Request message. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueRequest getStoredValueRequest() { + return storedValueRequest; + } + + /** + * Content of the Stored Value Request message. + * + * @param storedValueRequest Content of the Stored Value Request message. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueRequest(StoredValueRequest storedValueRequest) { + this.storedValueRequest = storedValueRequest; + isSetStoredValueRequest = true; // mark as set + } + + /** + * Content of the TransactionStatus Request message. + * + * @param transactionStatusRequest Content of the TransactionStatus Request message. + * @return the current {@code SaleToPOIRequest} instance, allowing for method chaining + */ + public SaleToPOIRequest transactionStatusRequest( + TransactionStatusRequest transactionStatusRequest) { + this.transactionStatusRequest = transactionStatusRequest; + isSetTransactionStatusRequest = true; // mark as set + return this; + } + + /** + * Content of the TransactionStatus Request message. + * + * @return transactionStatusRequest Content of the TransactionStatus Request message. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_STATUS_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionStatusRequest getTransactionStatusRequest() { + return transactionStatusRequest; + } + + /** + * Content of the TransactionStatus Request message. + * + * @param transactionStatusRequest Content of the TransactionStatus Request message. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_STATUS_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionStatusRequest(TransactionStatusRequest transactionStatusRequest) { + this.transactionStatusRequest = transactionStatusRequest; + isSetTransactionStatusRequest = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SaleToPOIRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SaleToPOIRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleToPOIRequest saleToPOIRequest = (SaleToPOIRequest) o; + return Objects.equals(this.messageHeader, saleToPOIRequest.messageHeader) + && Objects.equals(this.isSetMessageHeader, saleToPOIRequest.isSetMessageHeader) + && Objects.equals(this.abortRequest, saleToPOIRequest.abortRequest) + && Objects.equals(this.isSetAbortRequest, saleToPOIRequest.isSetAbortRequest) + && Objects.equals(this.balanceInquiryRequest, saleToPOIRequest.balanceInquiryRequest) + && Objects.equals( + this.isSetBalanceInquiryRequest, saleToPOIRequest.isSetBalanceInquiryRequest) + && Objects.equals(this.cardAcquisitionRequest, saleToPOIRequest.cardAcquisitionRequest) + && Objects.equals( + this.isSetCardAcquisitionRequest, saleToPOIRequest.isSetCardAcquisitionRequest) + && Objects.equals(this.adminRequest, saleToPOIRequest.adminRequest) + && Objects.equals(this.isSetAdminRequest, saleToPOIRequest.isSetAdminRequest) + && Objects.equals(this.diagnosisRequest, saleToPOIRequest.diagnosisRequest) + && Objects.equals(this.isSetDiagnosisRequest, saleToPOIRequest.isSetDiagnosisRequest) + && Objects.equals(this.displayRequest, saleToPOIRequest.displayRequest) + && Objects.equals(this.isSetDisplayRequest, saleToPOIRequest.isSetDisplayRequest) + && Objects.equals(this.enableServiceRequest, saleToPOIRequest.enableServiceRequest) + && Objects.equals( + this.isSetEnableServiceRequest, saleToPOIRequest.isSetEnableServiceRequest) + && Objects.equals(this.eventNotification, saleToPOIRequest.eventNotification) + && Objects.equals(this.isSetEventNotification, saleToPOIRequest.isSetEventNotification) + && Objects.equals(this.getTotalsRequest, saleToPOIRequest.getTotalsRequest) + && Objects.equals(this.isSetGetTotalsRequest, saleToPOIRequest.isSetGetTotalsRequest) + && Objects.equals(this.inputRequest, saleToPOIRequest.inputRequest) + && Objects.equals(this.isSetInputRequest, saleToPOIRequest.isSetInputRequest) + && Objects.equals(this.inputUpdate, saleToPOIRequest.inputUpdate) + && Objects.equals(this.isSetInputUpdate, saleToPOIRequest.isSetInputUpdate) + && Objects.equals(this.loginRequest, saleToPOIRequest.loginRequest) + && Objects.equals(this.isSetLoginRequest, saleToPOIRequest.isSetLoginRequest) + && Objects.equals(this.logoutRequest, saleToPOIRequest.logoutRequest) + && Objects.equals(this.isSetLogoutRequest, saleToPOIRequest.isSetLogoutRequest) + && Objects.equals(this.paymentRequest, saleToPOIRequest.paymentRequest) + && Objects.equals(this.isSetPaymentRequest, saleToPOIRequest.isSetPaymentRequest) + && Objects.equals(this.printRequest, saleToPOIRequest.printRequest) + && Objects.equals(this.isSetPrintRequest, saleToPOIRequest.isSetPrintRequest) + && Objects.equals(this.cardReaderAPDURequest, saleToPOIRequest.cardReaderAPDURequest) + && Objects.equals( + this.isSetCardReaderAPDURequest, saleToPOIRequest.isSetCardReaderAPDURequest) + && Objects.equals(this.reconciliationRequest, saleToPOIRequest.reconciliationRequest) + && Objects.equals( + this.isSetReconciliationRequest, saleToPOIRequest.isSetReconciliationRequest) + && Objects.equals(this.reversalRequest, saleToPOIRequest.reversalRequest) + && Objects.equals(this.isSetReversalRequest, saleToPOIRequest.isSetReversalRequest) + && Objects.equals(this.storedValueRequest, saleToPOIRequest.storedValueRequest) + && Objects.equals(this.isSetStoredValueRequest, saleToPOIRequest.isSetStoredValueRequest) + && Objects.equals(this.transactionStatusRequest, saleToPOIRequest.transactionStatusRequest) + && Objects.equals( + this.isSetTransactionStatusRequest, saleToPOIRequest.isSetTransactionStatusRequest); + } + + @Override + public int hashCode() { + return Objects.hash( + messageHeader, + isSetMessageHeader, + abortRequest, + isSetAbortRequest, + balanceInquiryRequest, + isSetBalanceInquiryRequest, + cardAcquisitionRequest, + isSetCardAcquisitionRequest, + adminRequest, + isSetAdminRequest, + diagnosisRequest, + isSetDiagnosisRequest, + displayRequest, + isSetDisplayRequest, + enableServiceRequest, + isSetEnableServiceRequest, + eventNotification, + isSetEventNotification, + getTotalsRequest, + isSetGetTotalsRequest, + inputRequest, + isSetInputRequest, + inputUpdate, + isSetInputUpdate, + loginRequest, + isSetLoginRequest, + logoutRequest, + isSetLogoutRequest, + paymentRequest, + isSetPaymentRequest, + printRequest, + isSetPrintRequest, + cardReaderAPDURequest, + isSetCardReaderAPDURequest, + reconciliationRequest, + isSetReconciliationRequest, + reversalRequest, + isSetReversalRequest, + storedValueRequest, + isSetStoredValueRequest, + transactionStatusRequest, + isSetTransactionStatusRequest); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleToPOIRequest {\n"); + sb.append(" messageHeader: ").append(toIndentedString(messageHeader)).append("\n"); + sb.append(" abortRequest: ").append(toIndentedString(abortRequest)).append("\n"); + sb.append(" balanceInquiryRequest: ") + .append(toIndentedString(balanceInquiryRequest)) + .append("\n"); + sb.append(" cardAcquisitionRequest: ") + .append(toIndentedString(cardAcquisitionRequest)) + .append("\n"); + sb.append(" adminRequest: ").append(toIndentedString(adminRequest)).append("\n"); + sb.append(" diagnosisRequest: ").append(toIndentedString(diagnosisRequest)).append("\n"); + sb.append(" displayRequest: ").append(toIndentedString(displayRequest)).append("\n"); + sb.append(" enableServiceRequest: ") + .append(toIndentedString(enableServiceRequest)) + .append("\n"); + sb.append(" eventNotification: ").append(toIndentedString(eventNotification)).append("\n"); + sb.append(" getTotalsRequest: ").append(toIndentedString(getTotalsRequest)).append("\n"); + sb.append(" inputRequest: ").append(toIndentedString(inputRequest)).append("\n"); + sb.append(" inputUpdate: ").append(toIndentedString(inputUpdate)).append("\n"); + sb.append(" loginRequest: ").append(toIndentedString(loginRequest)).append("\n"); + sb.append(" logoutRequest: ").append(toIndentedString(logoutRequest)).append("\n"); + sb.append(" paymentRequest: ").append(toIndentedString(paymentRequest)).append("\n"); + sb.append(" printRequest: ").append(toIndentedString(printRequest)).append("\n"); + sb.append(" cardReaderAPDURequest: ") + .append(toIndentedString(cardReaderAPDURequest)) + .append("\n"); + sb.append(" reconciliationRequest: ") + .append(toIndentedString(reconciliationRequest)) + .append("\n"); + sb.append(" reversalRequest: ").append(toIndentedString(reversalRequest)).append("\n"); + sb.append(" storedValueRequest: ").append(toIndentedString(storedValueRequest)).append("\n"); + sb.append(" transactionStatusRequest: ") + .append(toIndentedString(transactionStatusRequest)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageHeader) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_HEADER, this.messageHeader); + } + if (isSetAbortRequest) { + addIfNull(nulls, JSON_PROPERTY_ABORT_REQUEST, this.abortRequest); + } + if (isSetBalanceInquiryRequest) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_INQUIRY_REQUEST, this.balanceInquiryRequest); + } + if (isSetCardAcquisitionRequest) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_REQUEST, this.cardAcquisitionRequest); + } + if (isSetAdminRequest) { + addIfNull(nulls, JSON_PROPERTY_ADMIN_REQUEST, this.adminRequest); + } + if (isSetDiagnosisRequest) { + addIfNull(nulls, JSON_PROPERTY_DIAGNOSIS_REQUEST, this.diagnosisRequest); + } + if (isSetDisplayRequest) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_REQUEST, this.displayRequest); + } + if (isSetEnableServiceRequest) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_SERVICE_REQUEST, this.enableServiceRequest); + } + if (isSetEventNotification) { + addIfNull(nulls, JSON_PROPERTY_EVENT_NOTIFICATION, this.eventNotification); + } + if (isSetGetTotalsRequest) { + addIfNull(nulls, JSON_PROPERTY_GET_TOTALS_REQUEST, this.getTotalsRequest); + } + if (isSetInputRequest) { + addIfNull(nulls, JSON_PROPERTY_INPUT_REQUEST, this.inputRequest); + } + if (isSetInputUpdate) { + addIfNull(nulls, JSON_PROPERTY_INPUT_UPDATE, this.inputUpdate); + } + if (isSetLoginRequest) { + addIfNull(nulls, JSON_PROPERTY_LOGIN_REQUEST, this.loginRequest); + } + if (isSetLogoutRequest) { + addIfNull(nulls, JSON_PROPERTY_LOGOUT_REQUEST, this.logoutRequest); + } + if (isSetPaymentRequest) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_REQUEST, this.paymentRequest); + } + if (isSetPrintRequest) { + addIfNull(nulls, JSON_PROPERTY_PRINT_REQUEST, this.printRequest); + } + if (isSetCardReaderAPDURequest) { + addIfNull(nulls, JSON_PROPERTY_CARD_READER_A_P_D_U_REQUEST, this.cardReaderAPDURequest); + } + if (isSetReconciliationRequest) { + addIfNull(nulls, JSON_PROPERTY_RECONCILIATION_REQUEST, this.reconciliationRequest); + } + if (isSetReversalRequest) { + addIfNull(nulls, JSON_PROPERTY_REVERSAL_REQUEST, this.reversalRequest); + } + if (isSetStoredValueRequest) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_REQUEST, this.storedValueRequest); + } + if (isSetTransactionStatusRequest) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_STATUS_REQUEST, this.transactionStatusRequest); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SaleToPOIRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleToPOIRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to SaleToPOIRequest + */ + public static SaleToPOIRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleToPOIRequest.class); + } + + /** + * Convert an instance of SaleToPOIRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SaleToPOIResponse.java b/src/main/java/com/adyen/model/tapi/SaleToPOIResponse.java new file mode 100644 index 000000000..9403753d1 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SaleToPOIResponse.java @@ -0,0 +1,1106 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * The SaleToPOIResponse message pair is a container for the response message content. It contains a + * MessageHeader and a message body. + */ +@JsonPropertyOrder({ + SaleToPOIResponse.JSON_PROPERTY_MESSAGE_HEADER, + SaleToPOIResponse.JSON_PROPERTY_BALANCE_INQUIRY_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_CARD_ACQUISITION_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_ADMIN_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_DIAGNOSIS_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_DISPLAY_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_ENABLE_SERVICE_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_GET_TOTALS_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_INPUT_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_LOGIN_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_LOGOUT_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_LOYALTY_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_PAYMENT_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_PRINT_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_RECONCILIATION_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_REVERSAL_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_STORED_VALUE_RESPONSE, + SaleToPOIResponse.JSON_PROPERTY_TRANSACTION_STATUS_RESPONSE +}) +public class SaleToPOIResponse { + public static final String JSON_PROPERTY_MESSAGE_HEADER = "MessageHeader"; + private MessageHeader messageHeader; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageHeader = false; + + public static final String JSON_PROPERTY_BALANCE_INQUIRY_RESPONSE = "BalanceInquiryResponse"; + private BalanceInquiryResponse balanceInquiryResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceInquiryResponse = false; + + public static final String JSON_PROPERTY_CARD_ACQUISITION_RESPONSE = "CardAcquisitionResponse"; + private CardAcquisitionResponse cardAcquisitionResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardAcquisitionResponse = false; + + public static final String JSON_PROPERTY_ADMIN_RESPONSE = "AdminResponse"; + private AdminResponse adminResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdminResponse = false; + + public static final String JSON_PROPERTY_DIAGNOSIS_RESPONSE = "DiagnosisResponse"; + private DiagnosisResponse diagnosisResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDiagnosisResponse = false; + + public static final String JSON_PROPERTY_DISPLAY_RESPONSE = "DisplayResponse"; + private DisplayResponse displayResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayResponse = false; + + public static final String JSON_PROPERTY_ENABLE_SERVICE_RESPONSE = "EnableServiceResponse"; + private EnableServiceResponse enableServiceResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableServiceResponse = false; + + public static final String JSON_PROPERTY_GET_TOTALS_RESPONSE = "GetTotalsResponse"; + private GetTotalsResponse getTotalsResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGetTotalsResponse = false; + + public static final String JSON_PROPERTY_INPUT_RESPONSE = "InputResponse"; + private InputResponse inputResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputResponse = false; + + public static final String JSON_PROPERTY_LOGIN_RESPONSE = "LoginResponse"; + private LoginResponse loginResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoginResponse = false; + + public static final String JSON_PROPERTY_LOGOUT_RESPONSE = "LogoutResponse"; + private LogoutResponse logoutResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoutResponse = false; + + public static final String JSON_PROPERTY_LOYALTY_RESPONSE = "LoyaltyResponse"; + private LoyaltyResponse loyaltyResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyResponse = false; + + public static final String JSON_PROPERTY_PAYMENT_RESPONSE = "PaymentResponse"; + private PaymentResponse paymentResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentResponse = false; + + public static final String JSON_PROPERTY_PRINT_RESPONSE = "PrintResponse"; + private PrintResponse printResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrintResponse = false; + + public static final String JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE = "CardReaderAPDUResponse"; + private CardReaderAPDUResponse cardReaderAPDUResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardReaderAPDUResponse = false; + + public static final String JSON_PROPERTY_RECONCILIATION_RESPONSE = "ReconciliationResponse"; + private ReconciliationResponse reconciliationResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReconciliationResponse = false; + + public static final String JSON_PROPERTY_REVERSAL_RESPONSE = "ReversalResponse"; + private ReversalResponse reversalResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReversalResponse = false; + + public static final String JSON_PROPERTY_STORED_VALUE_RESPONSE = "StoredValueResponse"; + private StoredValueResponse storedValueResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueResponse = false; + + public static final String JSON_PROPERTY_TRANSACTION_STATUS_RESPONSE = + "TransactionStatusResponse"; + private TransactionStatusResponse transactionStatusResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionStatusResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SaleToPOIResponse() {} + + /** + * messageHeader + * + * @param messageHeader + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse messageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + isSetMessageHeader = true; // mark as set + return this; + } + + /** + * Get messageHeader + * + * @return messageHeader + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageHeader getMessageHeader() { + return messageHeader; + } + + /** + * messageHeader + * + * @param messageHeader + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_HEADER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + isSetMessageHeader = true; // mark as set + } + + /** + * Content of the Balance Inquiry Response message. + * + * @param balanceInquiryResponse Content of the Balance Inquiry Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse balanceInquiryResponse(BalanceInquiryResponse balanceInquiryResponse) { + this.balanceInquiryResponse = balanceInquiryResponse; + isSetBalanceInquiryResponse = true; // mark as set + return this; + } + + /** + * Content of the Balance Inquiry Response message. + * + * @return balanceInquiryResponse Content of the Balance Inquiry Response message. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_INQUIRY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BalanceInquiryResponse getBalanceInquiryResponse() { + return balanceInquiryResponse; + } + + /** + * Content of the Balance Inquiry Response message. + * + * @param balanceInquiryResponse Content of the Balance Inquiry Response message. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_INQUIRY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceInquiryResponse(BalanceInquiryResponse balanceInquiryResponse) { + this.balanceInquiryResponse = balanceInquiryResponse; + isSetBalanceInquiryResponse = true; // mark as set + } + + /** + * Content of the Card Acquisition Response message. + * + * @param cardAcquisitionResponse Content of the Card Acquisition Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse cardAcquisitionResponse( + CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + isSetCardAcquisitionResponse = true; // mark as set + return this; + } + + /** + * Content of the Card Acquisition Response message. + * + * @return cardAcquisitionResponse Content of the Card Acquisition Response message. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardAcquisitionResponse getCardAcquisitionResponse() { + return cardAcquisitionResponse; + } + + /** + * Content of the Card Acquisition Response message. + * + * @param cardAcquisitionResponse Content of the Card Acquisition Response message. + */ + @JsonProperty(JSON_PROPERTY_CARD_ACQUISITION_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardAcquisitionResponse(CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + isSetCardAcquisitionResponse = true; // mark as set + } + + /** + * Content of the Admin Response message. + * + * @param adminResponse Content of the Admin Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse adminResponse(AdminResponse adminResponse) { + this.adminResponse = adminResponse; + isSetAdminResponse = true; // mark as set + return this; + } + + /** + * Content of the Admin Response message. + * + * @return adminResponse Content of the Admin Response message. + */ + @JsonProperty(JSON_PROPERTY_ADMIN_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AdminResponse getAdminResponse() { + return adminResponse; + } + + /** + * Content of the Admin Response message. + * + * @param adminResponse Content of the Admin Response message. + */ + @JsonProperty(JSON_PROPERTY_ADMIN_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdminResponse(AdminResponse adminResponse) { + this.adminResponse = adminResponse; + isSetAdminResponse = true; // mark as set + } + + /** + * Content of the Diagnosis Response message. + * + * @param diagnosisResponse Content of the Diagnosis Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse diagnosisResponse(DiagnosisResponse diagnosisResponse) { + this.diagnosisResponse = diagnosisResponse; + isSetDiagnosisResponse = true; // mark as set + return this; + } + + /** + * Content of the Diagnosis Response message. + * + * @return diagnosisResponse Content of the Diagnosis Response message. + */ + @JsonProperty(JSON_PROPERTY_DIAGNOSIS_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DiagnosisResponse getDiagnosisResponse() { + return diagnosisResponse; + } + + /** + * Content of the Diagnosis Response message. + * + * @param diagnosisResponse Content of the Diagnosis Response message. + */ + @JsonProperty(JSON_PROPERTY_DIAGNOSIS_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDiagnosisResponse(DiagnosisResponse diagnosisResponse) { + this.diagnosisResponse = diagnosisResponse; + isSetDiagnosisResponse = true; // mark as set + } + + /** + * Content of the Display Response message. + * + * @param displayResponse Content of the Display Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse displayResponse(DisplayResponse displayResponse) { + this.displayResponse = displayResponse; + isSetDisplayResponse = true; // mark as set + return this; + } + + /** + * Content of the Display Response message. + * + * @return displayResponse Content of the Display Response message. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayResponse getDisplayResponse() { + return displayResponse; + } + + /** + * Content of the Display Response message. + * + * @param displayResponse Content of the Display Response message. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayResponse(DisplayResponse displayResponse) { + this.displayResponse = displayResponse; + isSetDisplayResponse = true; // mark as set + } + + /** + * Content of the Enable Service Response message. + * + * @param enableServiceResponse Content of the Enable Service Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse enableServiceResponse(EnableServiceResponse enableServiceResponse) { + this.enableServiceResponse = enableServiceResponse; + isSetEnableServiceResponse = true; // mark as set + return this; + } + + /** + * Content of the Enable Service Response message. + * + * @return enableServiceResponse Content of the Enable Service Response message. + */ + @JsonProperty(JSON_PROPERTY_ENABLE_SERVICE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnableServiceResponse getEnableServiceResponse() { + return enableServiceResponse; + } + + /** + * Content of the Enable Service Response message. + * + * @param enableServiceResponse Content of the Enable Service Response message. + */ + @JsonProperty(JSON_PROPERTY_ENABLE_SERVICE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableServiceResponse(EnableServiceResponse enableServiceResponse) { + this.enableServiceResponse = enableServiceResponse; + isSetEnableServiceResponse = true; // mark as set + } + + /** + * Content of the Get Totals Response message. + * + * @param getTotalsResponse Content of the Get Totals Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse getTotalsResponse(GetTotalsResponse getTotalsResponse) { + this.getTotalsResponse = getTotalsResponse; + isSetGetTotalsResponse = true; // mark as set + return this; + } + + /** + * Content of the Get Totals Response message. + * + * @return getTotalsResponse Content of the Get Totals Response message. + */ + @JsonProperty(JSON_PROPERTY_GET_TOTALS_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetTotalsResponse getGetTotalsResponse() { + return getTotalsResponse; + } + + /** + * Content of the Get Totals Response message. + * + * @param getTotalsResponse Content of the Get Totals Response message. + */ + @JsonProperty(JSON_PROPERTY_GET_TOTALS_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGetTotalsResponse(GetTotalsResponse getTotalsResponse) { + this.getTotalsResponse = getTotalsResponse; + isSetGetTotalsResponse = true; // mark as set + } + + /** + * Content of the Input Response message. + * + * @param inputResponse Content of the Input Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse inputResponse(InputResponse inputResponse) { + this.inputResponse = inputResponse; + isSetInputResponse = true; // mark as set + return this; + } + + /** + * Content of the Input Response message. + * + * @return inputResponse Content of the Input Response message. + */ + @JsonProperty(JSON_PROPERTY_INPUT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputResponse getInputResponse() { + return inputResponse; + } + + /** + * Content of the Input Response message. + * + * @param inputResponse Content of the Input Response message. + */ + @JsonProperty(JSON_PROPERTY_INPUT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputResponse(InputResponse inputResponse) { + this.inputResponse = inputResponse; + isSetInputResponse = true; // mark as set + } + + /** + * Content of the Login Response message. + * + * @param loginResponse Content of the Login Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse loginResponse(LoginResponse loginResponse) { + this.loginResponse = loginResponse; + isSetLoginResponse = true; // mark as set + return this; + } + + /** + * Content of the Login Response message. + * + * @return loginResponse Content of the Login Response message. + */ + @JsonProperty(JSON_PROPERTY_LOGIN_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoginResponse getLoginResponse() { + return loginResponse; + } + + /** + * Content of the Login Response message. + * + * @param loginResponse Content of the Login Response message. + */ + @JsonProperty(JSON_PROPERTY_LOGIN_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoginResponse(LoginResponse loginResponse) { + this.loginResponse = loginResponse; + isSetLoginResponse = true; // mark as set + } + + /** + * Content of the Logout Response message. + * + * @param logoutResponse Content of the Logout Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse logoutResponse(LogoutResponse logoutResponse) { + this.logoutResponse = logoutResponse; + isSetLogoutResponse = true; // mark as set + return this; + } + + /** + * Content of the Logout Response message. + * + * @return logoutResponse Content of the Logout Response message. + */ + @JsonProperty(JSON_PROPERTY_LOGOUT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogoutResponse getLogoutResponse() { + return logoutResponse; + } + + /** + * Content of the Logout Response message. + * + * @param logoutResponse Content of the Logout Response message. + */ + @JsonProperty(JSON_PROPERTY_LOGOUT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoutResponse(LogoutResponse logoutResponse) { + this.logoutResponse = logoutResponse; + isSetLogoutResponse = true; // mark as set + } + + /** + * Content of the Loyalty Response message. + * + * @param loyaltyResponse Content of the Loyalty Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse loyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + isSetLoyaltyResponse = true; // mark as set + return this; + } + + /** + * Content of the Loyalty Response message. + * + * @return loyaltyResponse Content of the Loyalty Response message. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyResponse getLoyaltyResponse() { + return loyaltyResponse; + } + + /** + * Content of the Loyalty Response message. + * + * @param loyaltyResponse Content of the Loyalty Response message. + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + isSetLoyaltyResponse = true; // mark as set + } + + /** + * Content of the Payment Response message. + * + * @param paymentResponse Content of the Payment Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse paymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + isSetPaymentResponse = true; // mark as set + return this; + } + + /** + * Content of the Payment Response message. + * + * @return paymentResponse Content of the Payment Response message. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentResponse getPaymentResponse() { + return paymentResponse; + } + + /** + * Content of the Payment Response message. + * + * @param paymentResponse Content of the Payment Response message. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + isSetPaymentResponse = true; // mark as set + } + + /** + * Content of the Print Response message. + * + * @param printResponse Content of the Print Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse printResponse(PrintResponse printResponse) { + this.printResponse = printResponse; + isSetPrintResponse = true; // mark as set + return this; + } + + /** + * Content of the Print Response message. + * + * @return printResponse Content of the Print Response message. + */ + @JsonProperty(JSON_PROPERTY_PRINT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PrintResponse getPrintResponse() { + return printResponse; + } + + /** + * Content of the Print Response message. + * + * @param printResponse Content of the Print Response message. + */ + @JsonProperty(JSON_PROPERTY_PRINT_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrintResponse(PrintResponse printResponse) { + this.printResponse = printResponse; + isSetPrintResponse = true; // mark as set + } + + /** + * Content of the Card Reader APDU Response message. + * + * @param cardReaderAPDUResponse Content of the Card Reader APDU Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse cardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + isSetCardReaderAPDUResponse = true; // mark as set + return this; + } + + /** + * Content of the Card Reader APDU Response message. + * + * @return cardReaderAPDUResponse Content of the Card Reader APDU Response message. + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardReaderAPDUResponse getCardReaderAPDUResponse() { + return cardReaderAPDUResponse; + } + + /** + * Content of the Card Reader APDU Response message. + * + * @param cardReaderAPDUResponse Content of the Card Reader APDU Response message. + */ + @JsonProperty(JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + isSetCardReaderAPDUResponse = true; // mark as set + } + + /** + * Content of the Reconciliation Response message. + * + * @param reconciliationResponse Content of the Reconciliation Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse reconciliationResponse(ReconciliationResponse reconciliationResponse) { + this.reconciliationResponse = reconciliationResponse; + isSetReconciliationResponse = true; // mark as set + return this; + } + + /** + * Content of the Reconciliation Response message. + * + * @return reconciliationResponse Content of the Reconciliation Response message. + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReconciliationResponse getReconciliationResponse() { + return reconciliationResponse; + } + + /** + * Content of the Reconciliation Response message. + * + * @param reconciliationResponse Content of the Reconciliation Response message. + */ + @JsonProperty(JSON_PROPERTY_RECONCILIATION_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReconciliationResponse(ReconciliationResponse reconciliationResponse) { + this.reconciliationResponse = reconciliationResponse; + isSetReconciliationResponse = true; // mark as set + } + + /** + * Content of the Reversal Response message. + * + * @param reversalResponse Content of the Reversal Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse reversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + isSetReversalResponse = true; // mark as set + return this; + } + + /** + * Content of the Reversal Response message. + * + * @return reversalResponse Content of the Reversal Response message. + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReversalResponse getReversalResponse() { + return reversalResponse; + } + + /** + * Content of the Reversal Response message. + * + * @param reversalResponse Content of the Reversal Response message. + */ + @JsonProperty(JSON_PROPERTY_REVERSAL_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + isSetReversalResponse = true; // mark as set + } + + /** + * Content of the Stored Value Response message. + * + * @param storedValueResponse Content of the Stored Value Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse storedValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + isSetStoredValueResponse = true; // mark as set + return this; + } + + /** + * Content of the Stored Value Response message. + * + * @return storedValueResponse Content of the Stored Value Response message. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueResponse getStoredValueResponse() { + return storedValueResponse; + } + + /** + * Content of the Stored Value Response message. + * + * @param storedValueResponse Content of the Stored Value Response message. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + isSetStoredValueResponse = true; // mark as set + } + + /** + * Content of the TransactionStatus Response message. + * + * @param transactionStatusResponse Content of the TransactionStatus Response message. + * @return the current {@code SaleToPOIResponse} instance, allowing for method chaining + */ + public SaleToPOIResponse transactionStatusResponse( + TransactionStatusResponse transactionStatusResponse) { + this.transactionStatusResponse = transactionStatusResponse; + isSetTransactionStatusResponse = true; // mark as set + return this; + } + + /** + * Content of the TransactionStatus Response message. + * + * @return transactionStatusResponse Content of the TransactionStatus Response message. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_STATUS_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionStatusResponse getTransactionStatusResponse() { + return transactionStatusResponse; + } + + /** + * Content of the TransactionStatus Response message. + * + * @param transactionStatusResponse Content of the TransactionStatus Response message. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_STATUS_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionStatusResponse(TransactionStatusResponse transactionStatusResponse) { + this.transactionStatusResponse = transactionStatusResponse; + isSetTransactionStatusResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SaleToPOIResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SaleToPOIResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleToPOIResponse saleToPOIResponse = (SaleToPOIResponse) o; + return Objects.equals(this.messageHeader, saleToPOIResponse.messageHeader) + && Objects.equals(this.isSetMessageHeader, saleToPOIResponse.isSetMessageHeader) + && Objects.equals(this.balanceInquiryResponse, saleToPOIResponse.balanceInquiryResponse) + && Objects.equals( + this.isSetBalanceInquiryResponse, saleToPOIResponse.isSetBalanceInquiryResponse) + && Objects.equals(this.cardAcquisitionResponse, saleToPOIResponse.cardAcquisitionResponse) + && Objects.equals( + this.isSetCardAcquisitionResponse, saleToPOIResponse.isSetCardAcquisitionResponse) + && Objects.equals(this.adminResponse, saleToPOIResponse.adminResponse) + && Objects.equals(this.isSetAdminResponse, saleToPOIResponse.isSetAdminResponse) + && Objects.equals(this.diagnosisResponse, saleToPOIResponse.diagnosisResponse) + && Objects.equals(this.isSetDiagnosisResponse, saleToPOIResponse.isSetDiagnosisResponse) + && Objects.equals(this.displayResponse, saleToPOIResponse.displayResponse) + && Objects.equals(this.isSetDisplayResponse, saleToPOIResponse.isSetDisplayResponse) + && Objects.equals(this.enableServiceResponse, saleToPOIResponse.enableServiceResponse) + && Objects.equals( + this.isSetEnableServiceResponse, saleToPOIResponse.isSetEnableServiceResponse) + && Objects.equals(this.getTotalsResponse, saleToPOIResponse.getTotalsResponse) + && Objects.equals(this.isSetGetTotalsResponse, saleToPOIResponse.isSetGetTotalsResponse) + && Objects.equals(this.inputResponse, saleToPOIResponse.inputResponse) + && Objects.equals(this.isSetInputResponse, saleToPOIResponse.isSetInputResponse) + && Objects.equals(this.loginResponse, saleToPOIResponse.loginResponse) + && Objects.equals(this.isSetLoginResponse, saleToPOIResponse.isSetLoginResponse) + && Objects.equals(this.logoutResponse, saleToPOIResponse.logoutResponse) + && Objects.equals(this.isSetLogoutResponse, saleToPOIResponse.isSetLogoutResponse) + && Objects.equals(this.loyaltyResponse, saleToPOIResponse.loyaltyResponse) + && Objects.equals(this.isSetLoyaltyResponse, saleToPOIResponse.isSetLoyaltyResponse) + && Objects.equals(this.paymentResponse, saleToPOIResponse.paymentResponse) + && Objects.equals(this.isSetPaymentResponse, saleToPOIResponse.isSetPaymentResponse) + && Objects.equals(this.printResponse, saleToPOIResponse.printResponse) + && Objects.equals(this.isSetPrintResponse, saleToPOIResponse.isSetPrintResponse) + && Objects.equals(this.cardReaderAPDUResponse, saleToPOIResponse.cardReaderAPDUResponse) + && Objects.equals( + this.isSetCardReaderAPDUResponse, saleToPOIResponse.isSetCardReaderAPDUResponse) + && Objects.equals(this.reconciliationResponse, saleToPOIResponse.reconciliationResponse) + && Objects.equals( + this.isSetReconciliationResponse, saleToPOIResponse.isSetReconciliationResponse) + && Objects.equals(this.reversalResponse, saleToPOIResponse.reversalResponse) + && Objects.equals(this.isSetReversalResponse, saleToPOIResponse.isSetReversalResponse) + && Objects.equals(this.storedValueResponse, saleToPOIResponse.storedValueResponse) + && Objects.equals(this.isSetStoredValueResponse, saleToPOIResponse.isSetStoredValueResponse) + && Objects.equals( + this.transactionStatusResponse, saleToPOIResponse.transactionStatusResponse) + && Objects.equals( + this.isSetTransactionStatusResponse, saleToPOIResponse.isSetTransactionStatusResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + messageHeader, + isSetMessageHeader, + balanceInquiryResponse, + isSetBalanceInquiryResponse, + cardAcquisitionResponse, + isSetCardAcquisitionResponse, + adminResponse, + isSetAdminResponse, + diagnosisResponse, + isSetDiagnosisResponse, + displayResponse, + isSetDisplayResponse, + enableServiceResponse, + isSetEnableServiceResponse, + getTotalsResponse, + isSetGetTotalsResponse, + inputResponse, + isSetInputResponse, + loginResponse, + isSetLoginResponse, + logoutResponse, + isSetLogoutResponse, + loyaltyResponse, + isSetLoyaltyResponse, + paymentResponse, + isSetPaymentResponse, + printResponse, + isSetPrintResponse, + cardReaderAPDUResponse, + isSetCardReaderAPDUResponse, + reconciliationResponse, + isSetReconciliationResponse, + reversalResponse, + isSetReversalResponse, + storedValueResponse, + isSetStoredValueResponse, + transactionStatusResponse, + isSetTransactionStatusResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleToPOIResponse {\n"); + sb.append(" messageHeader: ").append(toIndentedString(messageHeader)).append("\n"); + sb.append(" balanceInquiryResponse: ") + .append(toIndentedString(balanceInquiryResponse)) + .append("\n"); + sb.append(" cardAcquisitionResponse: ") + .append(toIndentedString(cardAcquisitionResponse)) + .append("\n"); + sb.append(" adminResponse: ").append(toIndentedString(adminResponse)).append("\n"); + sb.append(" diagnosisResponse: ").append(toIndentedString(diagnosisResponse)).append("\n"); + sb.append(" displayResponse: ").append(toIndentedString(displayResponse)).append("\n"); + sb.append(" enableServiceResponse: ") + .append(toIndentedString(enableServiceResponse)) + .append("\n"); + sb.append(" getTotalsResponse: ").append(toIndentedString(getTotalsResponse)).append("\n"); + sb.append(" inputResponse: ").append(toIndentedString(inputResponse)).append("\n"); + sb.append(" loginResponse: ").append(toIndentedString(loginResponse)).append("\n"); + sb.append(" logoutResponse: ").append(toIndentedString(logoutResponse)).append("\n"); + sb.append(" loyaltyResponse: ").append(toIndentedString(loyaltyResponse)).append("\n"); + sb.append(" paymentResponse: ").append(toIndentedString(paymentResponse)).append("\n"); + sb.append(" printResponse: ").append(toIndentedString(printResponse)).append("\n"); + sb.append(" cardReaderAPDUResponse: ") + .append(toIndentedString(cardReaderAPDUResponse)) + .append("\n"); + sb.append(" reconciliationResponse: ") + .append(toIndentedString(reconciliationResponse)) + .append("\n"); + sb.append(" reversalResponse: ").append(toIndentedString(reversalResponse)).append("\n"); + sb.append(" storedValueResponse: ") + .append(toIndentedString(storedValueResponse)) + .append("\n"); + sb.append(" transactionStatusResponse: ") + .append(toIndentedString(transactionStatusResponse)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageHeader) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_HEADER, this.messageHeader); + } + if (isSetBalanceInquiryResponse) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_INQUIRY_RESPONSE, this.balanceInquiryResponse); + } + if (isSetCardAcquisitionResponse) { + addIfNull(nulls, JSON_PROPERTY_CARD_ACQUISITION_RESPONSE, this.cardAcquisitionResponse); + } + if (isSetAdminResponse) { + addIfNull(nulls, JSON_PROPERTY_ADMIN_RESPONSE, this.adminResponse); + } + if (isSetDiagnosisResponse) { + addIfNull(nulls, JSON_PROPERTY_DIAGNOSIS_RESPONSE, this.diagnosisResponse); + } + if (isSetDisplayResponse) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_RESPONSE, this.displayResponse); + } + if (isSetEnableServiceResponse) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_SERVICE_RESPONSE, this.enableServiceResponse); + } + if (isSetGetTotalsResponse) { + addIfNull(nulls, JSON_PROPERTY_GET_TOTALS_RESPONSE, this.getTotalsResponse); + } + if (isSetInputResponse) { + addIfNull(nulls, JSON_PROPERTY_INPUT_RESPONSE, this.inputResponse); + } + if (isSetLoginResponse) { + addIfNull(nulls, JSON_PROPERTY_LOGIN_RESPONSE, this.loginResponse); + } + if (isSetLogoutResponse) { + addIfNull(nulls, JSON_PROPERTY_LOGOUT_RESPONSE, this.logoutResponse); + } + if (isSetLoyaltyResponse) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_RESPONSE, this.loyaltyResponse); + } + if (isSetPaymentResponse) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RESPONSE, this.paymentResponse); + } + if (isSetPrintResponse) { + addIfNull(nulls, JSON_PROPERTY_PRINT_RESPONSE, this.printResponse); + } + if (isSetCardReaderAPDUResponse) { + addIfNull(nulls, JSON_PROPERTY_CARD_READER_A_P_D_U_RESPONSE, this.cardReaderAPDUResponse); + } + if (isSetReconciliationResponse) { + addIfNull(nulls, JSON_PROPERTY_RECONCILIATION_RESPONSE, this.reconciliationResponse); + } + if (isSetReversalResponse) { + addIfNull(nulls, JSON_PROPERTY_REVERSAL_RESPONSE, this.reversalResponse); + } + if (isSetStoredValueResponse) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_RESPONSE, this.storedValueResponse); + } + if (isSetTransactionStatusResponse) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_STATUS_RESPONSE, this.transactionStatusResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SaleToPOIResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleToPOIResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to SaleToPOIResponse + */ + public static SaleToPOIResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleToPOIResponse.class); + } + + /** + * Convert an instance of SaleToPOIResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SecurityTrailer.java b/src/main/java/com/adyen/model/tapi/SecurityTrailer.java new file mode 100644 index 000000000..83aca0c98 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SecurityTrailer.java @@ -0,0 +1,382 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; + +/** + * It contains information related to the security of the message. SecurityTrailer as used by Adyen. + */ +@JsonPropertyOrder({ + SecurityTrailer.JSON_PROPERTY_ADYEN_CRYPTO_VERSION, + SecurityTrailer.JSON_PROPERTY_KEY_IDENTIFIER, + SecurityTrailer.JSON_PROPERTY_KEY_VERSION, + SecurityTrailer.JSON_PROPERTY_NONCE, + SecurityTrailer.JSON_PROPERTY_HMAC +}) +public class SecurityTrailer { + public static final String JSON_PROPERTY_ADYEN_CRYPTO_VERSION = "AdyenCryptoVersion"; + private Integer adyenCryptoVersion; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdyenCryptoVersion = false; + + public static final String JSON_PROPERTY_KEY_IDENTIFIER = "KeyIdentifier"; + private String keyIdentifier; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKeyIdentifier = false; + + public static final String JSON_PROPERTY_KEY_VERSION = "KeyVersion"; + private Integer keyVersion; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKeyVersion = false; + + public static final String JSON_PROPERTY_NONCE = "Nonce"; + private byte[] nonce; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonce = false; + + public static final String JSON_PROPERTY_HMAC = "Hmac"; + private byte[] hmac; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHmac = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SecurityTrailer() {} + + /** + * adyenCryptoVersion + * + * @param adyenCryptoVersion + * @return the current {@code SecurityTrailer} instance, allowing for method chaining + */ + public SecurityTrailer adyenCryptoVersion(Integer adyenCryptoVersion) { + this.adyenCryptoVersion = adyenCryptoVersion; + isSetAdyenCryptoVersion = true; // mark as set + return this; + } + + /** + * Get adyenCryptoVersion + * + * @return adyenCryptoVersion + */ + @JsonProperty(JSON_PROPERTY_ADYEN_CRYPTO_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAdyenCryptoVersion() { + return adyenCryptoVersion; + } + + /** + * adyenCryptoVersion + * + * @param adyenCryptoVersion + */ + @JsonProperty(JSON_PROPERTY_ADYEN_CRYPTO_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdyenCryptoVersion(Integer adyenCryptoVersion) { + this.adyenCryptoVersion = adyenCryptoVersion; + isSetAdyenCryptoVersion = true; // mark as set + } + + /** + * keyIdentifier + * + * @param keyIdentifier + * @return the current {@code SecurityTrailer} instance, allowing for method chaining + */ + public SecurityTrailer keyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + isSetKeyIdentifier = true; // mark as set + return this; + } + + /** + * Get keyIdentifier + * + * @return keyIdentifier + */ + @JsonProperty(JSON_PROPERTY_KEY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKeyIdentifier() { + return keyIdentifier; + } + + /** + * keyIdentifier + * + * @param keyIdentifier + */ + @JsonProperty(JSON_PROPERTY_KEY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + isSetKeyIdentifier = true; // mark as set + } + + /** + * keyVersion + * + * @param keyVersion + * @return the current {@code SecurityTrailer} instance, allowing for method chaining + */ + public SecurityTrailer keyVersion(Integer keyVersion) { + this.keyVersion = keyVersion; + isSetKeyVersion = true; // mark as set + return this; + } + + /** + * Get keyVersion + * + * @return keyVersion + */ + @JsonProperty(JSON_PROPERTY_KEY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getKeyVersion() { + return keyVersion; + } + + /** + * keyVersion + * + * @param keyVersion + */ + @JsonProperty(JSON_PROPERTY_KEY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyVersion(Integer keyVersion) { + this.keyVersion = keyVersion; + isSetKeyVersion = true; // mark as set + } + + /** + * nonce + * + * @param nonce + * @return the current {@code SecurityTrailer} instance, allowing for method chaining + */ + public SecurityTrailer nonce(byte[] nonce) { + this.nonce = nonce; + isSetNonce = true; // mark as set + return this; + } + + /** + * Get nonce + * + * @return nonce + */ + @JsonProperty(JSON_PROPERTY_NONCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getNonce() { + return nonce; + } + + /** + * nonce + * + * @param nonce + */ + @JsonProperty(JSON_PROPERTY_NONCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNonce(byte[] nonce) { + this.nonce = nonce; + isSetNonce = true; // mark as set + } + + /** + * hmac + * + * @param hmac + * @return the current {@code SecurityTrailer} instance, allowing for method chaining + */ + public SecurityTrailer hmac(byte[] hmac) { + this.hmac = hmac; + isSetHmac = true; // mark as set + return this; + } + + /** + * Get hmac + * + * @return hmac + */ + @JsonProperty(JSON_PROPERTY_HMAC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public byte[] getHmac() { + return hmac; + } + + /** + * hmac + * + * @param hmac + */ + @JsonProperty(JSON_PROPERTY_HMAC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHmac(byte[] hmac) { + this.hmac = hmac; + isSetHmac = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SecurityTrailer includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SecurityTrailer object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityTrailer securityTrailer = (SecurityTrailer) o; + return Objects.equals(this.adyenCryptoVersion, securityTrailer.adyenCryptoVersion) + && Objects.equals(this.isSetAdyenCryptoVersion, securityTrailer.isSetAdyenCryptoVersion) + && Objects.equals(this.keyIdentifier, securityTrailer.keyIdentifier) + && Objects.equals(this.isSetKeyIdentifier, securityTrailer.isSetKeyIdentifier) + && Objects.equals(this.keyVersion, securityTrailer.keyVersion) + && Objects.equals(this.isSetKeyVersion, securityTrailer.isSetKeyVersion) + && Arrays.equals(this.nonce, securityTrailer.nonce) + && Objects.equals(this.isSetNonce, securityTrailer.isSetNonce) + && Arrays.equals(this.hmac, securityTrailer.hmac) + && Objects.equals(this.isSetHmac, securityTrailer.isSetHmac); + } + + @Override + public int hashCode() { + return Objects.hash( + adyenCryptoVersion, + isSetAdyenCryptoVersion, + keyIdentifier, + isSetKeyIdentifier, + keyVersion, + isSetKeyVersion, + Arrays.hashCode(nonce), + isSetNonce, + Arrays.hashCode(hmac), + isSetHmac); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityTrailer {\n"); + sb.append(" adyenCryptoVersion: ").append(toIndentedString(adyenCryptoVersion)).append("\n"); + sb.append(" keyIdentifier: ").append(toIndentedString(keyIdentifier)).append("\n"); + sb.append(" keyVersion: ").append(toIndentedString(keyVersion)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" hmac: ").append(toIndentedString(hmac)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdyenCryptoVersion) { + addIfNull(nulls, JSON_PROPERTY_ADYEN_CRYPTO_VERSION, this.adyenCryptoVersion); + } + if (isSetKeyIdentifier) { + addIfNull(nulls, JSON_PROPERTY_KEY_IDENTIFIER, this.keyIdentifier); + } + if (isSetKeyVersion) { + addIfNull(nulls, JSON_PROPERTY_KEY_VERSION, this.keyVersion); + } + if (isSetNonce) { + addIfNull(nulls, JSON_PROPERTY_NONCE, this.nonce); + } + if (isSetHmac) { + addIfNull(nulls, JSON_PROPERTY_HMAC, this.hmac); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SecurityTrailer given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityTrailer + * @throws JsonProcessingException if the JSON string is invalid with respect to SecurityTrailer + */ + public static SecurityTrailer fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SecurityTrailer.class); + } + + /** + * Convert an instance of SecurityTrailer to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SensitiveCardData.java b/src/main/java/com/adyen/model/tapi/SensitiveCardData.java new file mode 100644 index 000000000..a9953f3ab --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SensitiveCardData.java @@ -0,0 +1,349 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * This data structure could be CMS protected (EnvelopedData). In this case the data structure + * SensitiveCardData is replaced by the data structure ProtectedCardData of type + * ContentInformationType. When this data is protected, the exact content is unknown by the Sale + * System, and might include all the information which are required by an external backup POI Server + * to make a batch payment transaction in case of problem with the POI System. Sensitive information + * related to the payment card, entered or read by the Sale System. + */ +@JsonPropertyOrder({ + SensitiveCardData.JSON_PROPERTY_P_A_N, + SensitiveCardData.JSON_PROPERTY_CARD_SEQ_NUMB, + SensitiveCardData.JSON_PROPERTY_EXPIRY_DATE, + SensitiveCardData.JSON_PROPERTY_TRACK_DATA +}) +public class SensitiveCardData { + public static final String JSON_PROPERTY_P_A_N = "PAN"; + private Integer PAN; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPAN = false; + + public static final String JSON_PROPERTY_CARD_SEQ_NUMB = "CardSeqNumb"; + private Integer cardSeqNumb; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardSeqNumb = false; + + public static final String JSON_PROPERTY_EXPIRY_DATE = "ExpiryDate"; + private Integer expiryDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryDate = false; + + public static final String JSON_PROPERTY_TRACK_DATA = "TrackData"; + private List trackData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SensitiveCardData() {} + + /** + * Primary Account Number. + * + * @param PAN Primary Account Number. + * @return the current {@code SensitiveCardData} instance, allowing for method chaining + */ + public SensitiveCardData PAN(Integer PAN) { + this.PAN = PAN; + isSetPAN = true; // mark as set + return this; + } + + /** + * Primary Account Number. minimum: 8 maximum: 28 + * + * @return PAN Primary Account Number. + */ + @JsonProperty(JSON_PROPERTY_P_A_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPAN() { + return PAN; + } + + /** + * Primary Account Number. + * + * @param PAN Primary Account Number. + */ + @JsonProperty(JSON_PROPERTY_P_A_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPAN(Integer PAN) { + this.PAN = PAN; + isSetPAN = true; // mark as set + } + + /** + * Card Sequence Number. If EntryMode is File, Keyed, or Manual. + * + * @param cardSeqNumb Card Sequence Number. If EntryMode is File, Keyed, or Manual. + * @return the current {@code SensitiveCardData} instance, allowing for method chaining + */ + public SensitiveCardData cardSeqNumb(Integer cardSeqNumb) { + this.cardSeqNumb = cardSeqNumb; + isSetCardSeqNumb = true; // mark as set + return this; + } + + /** + * Card Sequence Number. If EntryMode is File, Keyed, or Manual. minimum: 2 maximum: 3 + * + * @return cardSeqNumb Card Sequence Number. If EntryMode is File, Keyed, or Manual. + */ + @JsonProperty(JSON_PROPERTY_CARD_SEQ_NUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCardSeqNumb() { + return cardSeqNumb; + } + + /** + * Card Sequence Number. If EntryMode is File, Keyed, or Manual. + * + * @param cardSeqNumb Card Sequence Number. If EntryMode is File, Keyed, or Manual. + */ + @JsonProperty(JSON_PROPERTY_CARD_SEQ_NUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardSeqNumb(Integer cardSeqNumb) { + this.cardSeqNumb = cardSeqNumb; + isSetCardSeqNumb = true; // mark as set + } + + /** + * Date after which the card cannot be used. If EntryMode is File. + * + * @param expiryDate Date after which the card cannot be used. If EntryMode is File. + * @return the current {@code SensitiveCardData} instance, allowing for method chaining + */ + public SensitiveCardData expiryDate(Integer expiryDate) { + this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set + return this; + } + + /** + * Date after which the card cannot be used. If EntryMode is File. minimum: 4 maximum: 4 + * + * @return expiryDate Date after which the card cannot be used. If EntryMode is File. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiryDate() { + return expiryDate; + } + + /** + * Date after which the card cannot be used. If EntryMode is File. + * + * @param expiryDate Date after which the card cannot be used. If EntryMode is File. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryDate(Integer expiryDate) { + this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set + } + + /** + * Magnetic track or magnetic ink characters line. If EntryMode is MagStripe or RFID . + * + * @param trackData Magnetic track or magnetic ink characters line. If EntryMode is MagStripe or + * RFID . + * @return the current {@code SensitiveCardData} instance, allowing for method chaining + */ + public SensitiveCardData trackData(List trackData) { + this.trackData = trackData; + isSetTrackData = true; // mark as set + return this; + } + + public SensitiveCardData addTrackDataItem(TrackData trackDataItem) { + if (this.trackData == null) { + this.trackData = new ArrayList<>(); + } + this.trackData.add(trackDataItem); + return this; + } + + /** + * Magnetic track or magnetic ink characters line. If EntryMode is MagStripe or RFID . + * + * @return trackData Magnetic track or magnetic ink characters line. If EntryMode is MagStripe or + * RFID . + */ + @JsonProperty(JSON_PROPERTY_TRACK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTrackData() { + return trackData; + } + + /** + * Magnetic track or magnetic ink characters line. If EntryMode is MagStripe or RFID . + * + * @param trackData Magnetic track or magnetic ink characters line. If EntryMode is MagStripe or + * RFID . + */ + @JsonProperty(JSON_PROPERTY_TRACK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrackData(List trackData) { + this.trackData = trackData; + isSetTrackData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SensitiveCardData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SensitiveCardData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SensitiveCardData sensitiveCardData = (SensitiveCardData) o; + return Objects.equals(this.PAN, sensitiveCardData.PAN) + && Objects.equals(this.isSetPAN, sensitiveCardData.isSetPAN) + && Objects.equals(this.cardSeqNumb, sensitiveCardData.cardSeqNumb) + && Objects.equals(this.isSetCardSeqNumb, sensitiveCardData.isSetCardSeqNumb) + && Objects.equals(this.expiryDate, sensitiveCardData.expiryDate) + && Objects.equals(this.isSetExpiryDate, sensitiveCardData.isSetExpiryDate) + && Objects.equals(this.trackData, sensitiveCardData.trackData) + && Objects.equals(this.isSetTrackData, sensitiveCardData.isSetTrackData); + } + + @Override + public int hashCode() { + return Objects.hash( + PAN, + isSetPAN, + cardSeqNumb, + isSetCardSeqNumb, + expiryDate, + isSetExpiryDate, + trackData, + isSetTrackData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SensitiveCardData {\n"); + sb.append(" PAN: ").append(toIndentedString(PAN)).append("\n"); + sb.append(" cardSeqNumb: ").append(toIndentedString(cardSeqNumb)).append("\n"); + sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n"); + sb.append(" trackData: ").append(toIndentedString(trackData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPAN) { + addIfNull(nulls, JSON_PROPERTY_P_A_N, this.PAN); + } + if (isSetCardSeqNumb) { + addIfNull(nulls, JSON_PROPERTY_CARD_SEQ_NUMB, this.cardSeqNumb); + } + if (isSetExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE, this.expiryDate); + } + if (isSetTrackData) { + addIfNull(nulls, JSON_PROPERTY_TRACK_DATA, this.trackData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SensitiveCardData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SensitiveCardData + * @throws JsonProcessingException if the JSON string is invalid with respect to SensitiveCardData + */ + public static SensitiveCardData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SensitiveCardData.class); + } + + /** + * Convert an instance of SensitiveCardData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SensitiveMobileData.java b/src/main/java/com/adyen/model/tapi/SensitiveMobileData.java new file mode 100644 index 000000000..cbb084ef3 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SensitiveMobileData.java @@ -0,0 +1,295 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** SensitiveMobileData */ +@JsonPropertyOrder({ + SensitiveMobileData.JSON_PROPERTY_M_S_I_S_D_N, + SensitiveMobileData.JSON_PROPERTY_I_M_S_I, + SensitiveMobileData.JSON_PROPERTY_I_M_E_I +}) +public class SensitiveMobileData { + public static final String JSON_PROPERTY_M_S_I_S_D_N = "MSISDN"; + private Integer MSISDN; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMSISDN = false; + + public static final String JSON_PROPERTY_I_M_S_I = "IMSI"; + private Integer IMSI; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIMSI = false; + + public static final String JSON_PROPERTY_I_M_E_I = "IMEI"; + private Integer IMEI; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIMEI = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SensitiveMobileData() {} + + /** + * Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number of the SIM + * card). Country, National Destination Code, and Subscriber Number. + * + * @param MSISDN Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number of + * the SIM card). Country, National Destination Code, and Subscriber Number. + * @return the current {@code SensitiveMobileData} instance, allowing for method chaining + */ + public SensitiveMobileData MSISDN(Integer MSISDN) { + this.MSISDN = MSISDN; + isSetMSISDN = true; // mark as set + return this; + } + + /** + * Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number of the SIM + * card). Country, National Destination Code, and Subscriber Number. + * + * @return MSISDN Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number + * of the SIM card). Country, National Destination Code, and Subscriber Number. + */ + @JsonProperty(JSON_PROPERTY_M_S_I_S_D_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMSISDN() { + return MSISDN; + } + + /** + * Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number of the SIM + * card). Country, National Destination Code, and Subscriber Number. + * + * @param MSISDN Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number of + * the SIM card). Country, National Destination Code, and Subscriber Number. + */ + @JsonProperty(JSON_PROPERTY_M_S_I_S_D_N) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMSISDN(Integer MSISDN) { + this.MSISDN = MSISDN; + isSetMSISDN = true; // mark as set + } + + /** + * International Mobile Subscriber Identity. Unique number associated with the mobile phone user, + * containing the Mobile Country Code (MCC), the Mobile Network Code (MNC), and the Mobile + * Identification Number (MSIN) + * + * @param IMSI International Mobile Subscriber Identity. Unique number associated with the mobile + * phone user, containing the Mobile Country Code (MCC), the Mobile Network Code (MNC), and + * the Mobile Identification Number (MSIN) + * @return the current {@code SensitiveMobileData} instance, allowing for method chaining + */ + public SensitiveMobileData IMSI(Integer IMSI) { + this.IMSI = IMSI; + isSetIMSI = true; // mark as set + return this; + } + + /** + * International Mobile Subscriber Identity. Unique number associated with the mobile phone user, + * containing the Mobile Country Code (MCC), the Mobile Network Code (MNC), and the Mobile + * Identification Number (MSIN) + * + * @return IMSI International Mobile Subscriber Identity. Unique number associated with the mobile + * phone user, containing the Mobile Country Code (MCC), the Mobile Network Code (MNC), and + * the Mobile Identification Number (MSIN) + */ + @JsonProperty(JSON_PROPERTY_I_M_S_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIMSI() { + return IMSI; + } + + /** + * International Mobile Subscriber Identity. Unique number associated with the mobile phone user, + * containing the Mobile Country Code (MCC), the Mobile Network Code (MNC), and the Mobile + * Identification Number (MSIN) + * + * @param IMSI International Mobile Subscriber Identity. Unique number associated with the mobile + * phone user, containing the Mobile Country Code (MCC), the Mobile Network Code (MNC), and + * the Mobile Identification Number (MSIN) + */ + @JsonProperty(JSON_PROPERTY_I_M_S_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIMSI(Integer IMSI) { + this.IMSI = IMSI; + isSetIMSI = true; // mark as set + } + + /** + * International Mobile Equipment Identity. Unique number associated with the mobile phone device. + * + * @param IMEI International Mobile Equipment Identity. Unique number associated with the mobile + * phone device. + * @return the current {@code SensitiveMobileData} instance, allowing for method chaining + */ + public SensitiveMobileData IMEI(Integer IMEI) { + this.IMEI = IMEI; + isSetIMEI = true; // mark as set + return this; + } + + /** + * International Mobile Equipment Identity. Unique number associated with the mobile phone device. + * + * @return IMEI International Mobile Equipment Identity. Unique number associated with the mobile + * phone device. + */ + @JsonProperty(JSON_PROPERTY_I_M_E_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIMEI() { + return IMEI; + } + + /** + * International Mobile Equipment Identity. Unique number associated with the mobile phone device. + * + * @param IMEI International Mobile Equipment Identity. Unique number associated with the mobile + * phone device. + */ + @JsonProperty(JSON_PROPERTY_I_M_E_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIMEI(Integer IMEI) { + this.IMEI = IMEI; + isSetIMEI = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SensitiveMobileData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SensitiveMobileData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SensitiveMobileData sensitiveMobileData = (SensitiveMobileData) o; + return Objects.equals(this.MSISDN, sensitiveMobileData.MSISDN) + && Objects.equals(this.isSetMSISDN, sensitiveMobileData.isSetMSISDN) + && Objects.equals(this.IMSI, sensitiveMobileData.IMSI) + && Objects.equals(this.isSetIMSI, sensitiveMobileData.isSetIMSI) + && Objects.equals(this.IMEI, sensitiveMobileData.IMEI) + && Objects.equals(this.isSetIMEI, sensitiveMobileData.isSetIMEI); + } + + @Override + public int hashCode() { + return Objects.hash(MSISDN, isSetMSISDN, IMSI, isSetIMSI, IMEI, isSetIMEI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SensitiveMobileData {\n"); + sb.append(" MSISDN: ").append(toIndentedString(MSISDN)).append("\n"); + sb.append(" IMSI: ").append(toIndentedString(IMSI)).append("\n"); + sb.append(" IMEI: ").append(toIndentedString(IMEI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMSISDN) { + addIfNull(nulls, JSON_PROPERTY_M_S_I_S_D_N, this.MSISDN); + } + if (isSetIMSI) { + addIfNull(nulls, JSON_PROPERTY_I_M_S_I, this.IMSI); + } + if (isSetIMEI) { + addIfNull(nulls, JSON_PROPERTY_I_M_E_I, this.IMEI); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SensitiveMobileData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SensitiveMobileData + * @throws JsonProcessingException if the JSON string is invalid with respect to + * SensitiveMobileData + */ + public static SensitiveMobileData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SensitiveMobileData.class); + } + + /** + * Convert an instance of SensitiveMobileData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SoundActionType.java b/src/main/java/com/adyen/model/tapi/SoundActionType.java new file mode 100644 index 000000000..8be7dfd1a --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SoundActionType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets SoundAction */ +public enum SoundActionType { + SET_DEFAULT_VOLUME("SetDefaultVolume"), + + START_SOUND("StartSound"), + + STOP_SOUND("StopSound"); + + private String value; + + SoundActionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SoundActionType fromValue(String value) { + for (SoundActionType b : SoundActionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SoundContent.java b/src/main/java/com/adyen/model/tapi/SoundContent.java new file mode 100644 index 000000000..47ecf741e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SoundContent.java @@ -0,0 +1,329 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** SoundContent */ +@JsonPropertyOrder({ + SoundContent.JSON_PROPERTY_SOUND_FORMAT, + SoundContent.JSON_PROPERTY_LANGUAGE, + SoundContent.JSON_PROPERTY_REFERENCE_I_D, + SoundContent.JSON_PROPERTY_TEXT +}) +public class SoundContent { + public static final String JSON_PROPERTY_SOUND_FORMAT = "SoundFormat"; + private SoundFormatType soundFormat; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSoundFormat = false; + + public static final String JSON_PROPERTY_LANGUAGE = "Language"; + private String language; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + + public static final String JSON_PROPERTY_REFERENCE_I_D = "ReferenceID"; + private String referenceID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceID = false; + + public static final String JSON_PROPERTY_TEXT = "Text"; + private String text; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetText = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SoundContent() {} + + /** + * Possible values: * **MessageRef** * **SoundRef** * **Text** + * + * @param soundFormat Possible values: * **MessageRef** * **SoundRef** * **Text** + * @return the current {@code SoundContent} instance, allowing for method chaining + */ + public SoundContent soundFormat(SoundFormatType soundFormat) { + this.soundFormat = soundFormat; + isSetSoundFormat = true; // mark as set + return this; + } + + /** + * Possible values: * **MessageRef** * **SoundRef** * **Text** + * + * @return soundFormat Possible values: * **MessageRef** * **SoundRef** * **Text** + */ + @JsonProperty(JSON_PROPERTY_SOUND_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SoundFormatType getSoundFormat() { + return soundFormat; + } + + /** + * Possible values: * **MessageRef** * **SoundRef** * **Text** + * + * @param soundFormat Possible values: * **MessageRef** * **SoundRef** * **Text** + */ + @JsonProperty(JSON_PROPERTY_SOUND_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSoundFormat(SoundFormatType soundFormat) { + this.soundFormat = soundFormat; + isSetSoundFormat = true; // mark as set + } + + /** + * language + * + * @param language + * @return the current {@code SoundContent} instance, allowing for method chaining + */ + public SoundContent language(String language) { + this.language = language; + isSetLanguage = true; // mark as set + return this; + } + + /** + * Get language + * + * @return language + */ + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + /** + * language + * + * @param language + */ + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguage(String language) { + this.language = language; + isSetLanguage = true; // mark as set + } + + /** + * referenceID + * + * @param referenceID + * @return the current {@code SoundContent} instance, allowing for method chaining + */ + public SoundContent referenceID(String referenceID) { + this.referenceID = referenceID; + isSetReferenceID = true; // mark as set + return this; + } + + /** + * Get referenceID + * + * @return referenceID + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReferenceID() { + return referenceID; + } + + /** + * referenceID + * + * @param referenceID + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceID(String referenceID) { + this.referenceID = referenceID; + isSetReferenceID = true; // mark as set + } + + /** + * text + * + * @param text + * @return the current {@code SoundContent} instance, allowing for method chaining + */ + public SoundContent text(String text) { + this.text = text; + isSetText = true; // mark as set + return this; + } + + /** + * Get text + * + * @return text + */ + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + /** + * text + * + * @param text + */ + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setText(String text) { + this.text = text; + isSetText = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SoundContent includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SoundContent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SoundContent soundContent = (SoundContent) o; + return Objects.equals(this.soundFormat, soundContent.soundFormat) + && Objects.equals(this.isSetSoundFormat, soundContent.isSetSoundFormat) + && Objects.equals(this.language, soundContent.language) + && Objects.equals(this.isSetLanguage, soundContent.isSetLanguage) + && Objects.equals(this.referenceID, soundContent.referenceID) + && Objects.equals(this.isSetReferenceID, soundContent.isSetReferenceID) + && Objects.equals(this.text, soundContent.text) + && Objects.equals(this.isSetText, soundContent.isSetText); + } + + @Override + public int hashCode() { + return Objects.hash( + soundFormat, + isSetSoundFormat, + language, + isSetLanguage, + referenceID, + isSetReferenceID, + text, + isSetText); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SoundContent {\n"); + sb.append(" soundFormat: ").append(toIndentedString(soundFormat)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" referenceID: ").append(toIndentedString(referenceID)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSoundFormat) { + addIfNull(nulls, JSON_PROPERTY_SOUND_FORMAT, this.soundFormat); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetReferenceID) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_I_D, this.referenceID); + } + if (isSetText) { + addIfNull(nulls, JSON_PROPERTY_TEXT, this.text); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SoundContent given an JSON string + * + * @param jsonString JSON string + * @return An instance of SoundContent + * @throws JsonProcessingException if the JSON string is invalid with respect to SoundContent + */ + public static SoundContent fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SoundContent.class); + } + + /** + * Convert an instance of SoundContent to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/SoundFormatType.java b/src/main/java/com/adyen/model/tapi/SoundFormatType.java new file mode 100644 index 000000000..a20340819 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/SoundFormatType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets SoundFormat */ +public enum SoundFormatType { + MESSAGE_REF("MessageRef"), + + SOUND_REF("SoundRef"), + + TEXT("Text"); + + private String value; + + SoundFormatType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SoundFormatType fromValue(String value) { + for (SoundFormatType b : SoundFormatType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueAccountID.java b/src/main/java/com/adyen/model/tapi/StoredValueAccountID.java new file mode 100644 index 000000000..487cde7a4 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueAccountID.java @@ -0,0 +1,627 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * Identification of the stored value account or the stored value card and the associated product + * sold by the Sale System for stored value requests. + */ +@JsonPropertyOrder({ + StoredValueAccountID.JSON_PROPERTY_STORED_VALUE_ACCOUNT_TYPE, + StoredValueAccountID.JSON_PROPERTY_STORED_VALUE_PROVIDER, + StoredValueAccountID.JSON_PROPERTY_OWNER_NAME, + StoredValueAccountID.JSON_PROPERTY_EXPIRY_DATE, + StoredValueAccountID.JSON_PROPERTY_ENTRY_MODE, + StoredValueAccountID.JSON_PROPERTY_IDENTIFICATION_TYPE, + StoredValueAccountID.JSON_PROPERTY_STORED_VALUE_I_D +}) +public class StoredValueAccountID { + public static final String JSON_PROPERTY_STORED_VALUE_ACCOUNT_TYPE = "StoredValueAccountType"; + private StoredValueAccountType storedValueAccountType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueAccountType = false; + + public static final String JSON_PROPERTY_STORED_VALUE_PROVIDER = "StoredValueProvider"; + private String storedValueProvider; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueProvider = false; + + public static final String JSON_PROPERTY_OWNER_NAME = "OwnerName"; + private String ownerName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + + public static final String JSON_PROPERTY_EXPIRY_DATE = "ExpiryDate"; + private Integer expiryDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryDate = false; + + /** Gets or Sets entryMode */ + public enum EntryModeEnum { + CONTACTLESS(String.valueOf("Contactless")), + + FILE(String.valueOf("File")), + + ICC(String.valueOf("ICC")), + + KEYED(String.valueOf("Keyed")), + + MAG_STRIPE(String.valueOf("MagStripe")), + + MANUAL(String.valueOf("Manual")), + + MOBILE(String.valueOf("Mobile")), + + RFID(String.valueOf("RFID")), + + SCANNED(String.valueOf("Scanned")), + + SYNCHRONOUS_ICC(String.valueOf("SynchronousICC")), + + TAPPED(String.valueOf("Tapped")); + + private static final Logger LOG = Logger.getLogger(EntryModeEnum.class.getName()); + + private String value; + + EntryModeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EntryModeEnum fromValue(String value) { + for (EntryModeEnum b : EntryModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "EntryModeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(EntryModeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_ENTRY_MODE = "EntryMode"; + private List entryMode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntryMode = false; + + public static final String JSON_PROPERTY_IDENTIFICATION_TYPE = "IdentificationType"; + private IdentificationType identificationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationType = false; + + public static final String JSON_PROPERTY_STORED_VALUE_I_D = "StoredValueID"; + private String storedValueID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public StoredValueAccountID() {} + + /** + * Type of stored value account. Allows the distinction of the stored value instrument to access + * the stored value account. Possible values: * **GiftCard** * **Other** * **PhoneCard** + * + * @param storedValueAccountType Type of stored value account. Allows the distinction of the + * stored value instrument to access the stored value account. Possible values: * **GiftCard** + * * **Other** * **PhoneCard** + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID storedValueAccountType( + StoredValueAccountType storedValueAccountType) { + this.storedValueAccountType = storedValueAccountType; + isSetStoredValueAccountType = true; // mark as set + return this; + } + + /** + * Type of stored value account. Allows the distinction of the stored value instrument to access + * the stored value account. Possible values: * **GiftCard** * **Other** * **PhoneCard** + * + * @return storedValueAccountType Type of stored value account. Allows the distinction of the + * stored value instrument to access the stored value account. Possible values: * **GiftCard** + * * **Other** * **PhoneCard** + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueAccountType getStoredValueAccountType() { + return storedValueAccountType; + } + + /** + * Type of stored value account. Allows the distinction of the stored value instrument to access + * the stored value account. Possible values: * **GiftCard** * **Other** * **PhoneCard** + * + * @param storedValueAccountType Type of stored value account. Allows the distinction of the + * stored value instrument to access the stored value account. Possible values: * **GiftCard** + * * **Other** * **PhoneCard** + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueAccountType(StoredValueAccountType storedValueAccountType) { + this.storedValueAccountType = storedValueAccountType; + isSetStoredValueAccountType = true; // mark as set + } + + /** + * Identification of the provider of the stored value account load/reload. When the ProductCode is + * not sufficient to identify the provider host which delivers the load or reload of the stored + * value account (for example if it contains the identification of the application.) + * + * @param storedValueProvider Identification of the provider of the stored value account + * load/reload. When the ProductCode is not sufficient to identify the provider host which + * delivers the load or reload of the stored value account (for example if it contains the + * identification of the application.) + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID storedValueProvider(String storedValueProvider) { + this.storedValueProvider = storedValueProvider; + isSetStoredValueProvider = true; // mark as set + return this; + } + + /** + * Identification of the provider of the stored value account load/reload. When the ProductCode is + * not sufficient to identify the provider host which delivers the load or reload of the stored + * value account (for example if it contains the identification of the application.) + * + * @return storedValueProvider Identification of the provider of the stored value account + * load/reload. When the ProductCode is not sufficient to identify the provider host which + * delivers the load or reload of the stored value account (for example if it contains the + * identification of the application.) + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredValueProvider() { + return storedValueProvider; + } + + /** + * Identification of the provider of the stored value account load/reload. When the ProductCode is + * not sufficient to identify the provider host which delivers the load or reload of the stored + * value account (for example if it contains the identification of the application.) + * + * @param storedValueProvider Identification of the provider of the stored value account + * load/reload. When the ProductCode is not sufficient to identify the provider host which + * delivers the load or reload of the stored value account (for example if it contains the + * identification of the application.) + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueProvider(String storedValueProvider) { + this.storedValueProvider = storedValueProvider; + isSetStoredValueProvider = true; // mark as set + } + + /** + * Name of the owner of a stored value account. + * + * @param ownerName Name of the owner of a stored value account. + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID ownerName(String ownerName) { + this.ownerName = ownerName; + isSetOwnerName = true; // mark as set + return this; + } + + /** + * Name of the owner of a stored value account. + * + * @return ownerName Name of the owner of a stored value account. + */ + @JsonProperty(JSON_PROPERTY_OWNER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOwnerName() { + return ownerName; + } + + /** + * Name of the owner of a stored value account. + * + * @param ownerName Name of the owner of a stored value account. + */ + @JsonProperty(JSON_PROPERTY_OWNER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + isSetOwnerName = true; // mark as set + } + + /** + * Date after which the card cannot be used. If EMV expiry date is present, it overrides Track2 + * information. Format is MMYY. + * + * @param expiryDate Date after which the card cannot be used. If EMV expiry date is present, it + * overrides Track2 information. Format is MMYY. + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID expiryDate(Integer expiryDate) { + this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set + return this; + } + + /** + * Date after which the card cannot be used. If EMV expiry date is present, it overrides Track2 + * information. Format is MMYY. minimum: 4 maximum: 4 + * + * @return expiryDate Date after which the card cannot be used. If EMV expiry date is present, it + * overrides Track2 information. Format is MMYY. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiryDate() { + return expiryDate; + } + + /** + * Date after which the card cannot be used. If EMV expiry date is present, it overrides Track2 + * information. Format is MMYY. + * + * @param expiryDate Date after which the card cannot be used. If EMV expiry date is present, it + * overrides Track2 information. Format is MMYY. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryDate(Integer expiryDate) { + this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set + } + + /** + * entryMode + * + * @param entryMode + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID entryMode(List entryMode) { + this.entryMode = entryMode; + isSetEntryMode = true; // mark as set + return this; + } + + public StoredValueAccountID addEntryModeItem(EntryModeEnum entryModeItem) { + if (this.entryMode == null) { + this.entryMode = new ArrayList<>(); + } + this.entryMode.add(entryModeItem); + return this; + } + + /** + * Get entryMode + * + * @return entryMode + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEntryMode() { + return entryMode; + } + + /** + * entryMode + * + * @param entryMode + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntryMode(List entryMode) { + this.entryMode = entryMode; + isSetEntryMode = true; // mark as set + } + + /** + * Type of account identification. In a request message, it informs the POI System the type of the + * account or card identification, when provided by the Sale Terminal. (e.g. because the card + * information is a barcode read by the Cashier on a scanner device). In a response message, it + * informs the Sale System the type of the account or card identification. Possible values: * + * **AccountNumber** * **BarCode** * **ISOTrack2** * **PAN** * **PhoneNumber** + * + * @param identificationType Type of account identification. In a request message, it informs the + * POI System the type of the account or card identification, when provided by the Sale + * Terminal. (e.g. because the card information is a barcode read by the Cashier on a scanner + * device). In a response message, it informs the Sale System the type of the account or card + * identification. Possible values: * **AccountNumber** * **BarCode** * **ISOTrack2** * + * **PAN** * **PhoneNumber** + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID identificationType(IdentificationType identificationType) { + this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set + return this; + } + + /** + * Type of account identification. In a request message, it informs the POI System the type of the + * account or card identification, when provided by the Sale Terminal. (e.g. because the card + * information is a barcode read by the Cashier on a scanner device). In a response message, it + * informs the Sale System the type of the account or card identification. Possible values: * + * **AccountNumber** * **BarCode** * **ISOTrack2** * **PAN** * **PhoneNumber** + * + * @return identificationType Type of account identification. In a request message, it informs the + * POI System the type of the account or card identification, when provided by the Sale + * Terminal. (e.g. because the card information is a barcode read by the Cashier on a scanner + * device). In a response message, it informs the Sale System the type of the account or card + * identification. Possible values: * **AccountNumber** * **BarCode** * **ISOTrack2** * + * **PAN** * **PhoneNumber** + */ + @JsonProperty(JSON_PROPERTY_IDENTIFICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IdentificationType getIdentificationType() { + return identificationType; + } + + /** + * Type of account identification. In a request message, it informs the POI System the type of the + * account or card identification, when provided by the Sale Terminal. (e.g. because the card + * information is a barcode read by the Cashier on a scanner device). In a response message, it + * informs the Sale System the type of the account or card identification. Possible values: * + * **AccountNumber** * **BarCode** * **ISOTrack2** * **PAN** * **PhoneNumber** + * + * @param identificationType Type of account identification. In a request message, it informs the + * POI System the type of the account or card identification, when provided by the Sale + * Terminal. (e.g. because the card information is a barcode read by the Cashier on a scanner + * device). In a response message, it informs the Sale System the type of the account or card + * identification. Possible values: * **AccountNumber** * **BarCode** * **ISOTrack2** * + * **PAN** * **PhoneNumber** + */ + @JsonProperty(JSON_PROPERTY_IDENTIFICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdentificationType(IdentificationType identificationType) { + this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set + } + + /** + * Stored value account identification. The identification of the stored value account conforming + * to the IdentificationType. + * + * @param storedValueID Stored value account identification. The identification of the stored + * value account conforming to the IdentificationType. + * @return the current {@code StoredValueAccountID} instance, allowing for method chaining + */ + public StoredValueAccountID storedValueID(String storedValueID) { + this.storedValueID = storedValueID; + isSetStoredValueID = true; // mark as set + return this; + } + + /** + * Stored value account identification. The identification of the stored value account conforming + * to the IdentificationType. + * + * @return storedValueID Stored value account identification. The identification of the stored + * value account conforming to the IdentificationType. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredValueID() { + return storedValueID; + } + + /** + * Stored value account identification. The identification of the stored value account conforming + * to the IdentificationType. + * + * @param storedValueID Stored value account identification. The identification of the stored + * value account conforming to the IdentificationType. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueID(String storedValueID) { + this.storedValueID = storedValueID; + isSetStoredValueID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueAccountID includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this StoredValueAccountID object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueAccountID storedValueAccountID = (StoredValueAccountID) o; + return Objects.equals(this.storedValueAccountType, storedValueAccountID.storedValueAccountType) + && Objects.equals( + this.isSetStoredValueAccountType, storedValueAccountID.isSetStoredValueAccountType) + && Objects.equals(this.storedValueProvider, storedValueAccountID.storedValueProvider) + && Objects.equals( + this.isSetStoredValueProvider, storedValueAccountID.isSetStoredValueProvider) + && Objects.equals(this.ownerName, storedValueAccountID.ownerName) + && Objects.equals(this.isSetOwnerName, storedValueAccountID.isSetOwnerName) + && Objects.equals(this.expiryDate, storedValueAccountID.expiryDate) + && Objects.equals(this.isSetExpiryDate, storedValueAccountID.isSetExpiryDate) + && Objects.equals(this.entryMode, storedValueAccountID.entryMode) + && Objects.equals(this.isSetEntryMode, storedValueAccountID.isSetEntryMode) + && Objects.equals(this.identificationType, storedValueAccountID.identificationType) + && Objects.equals( + this.isSetIdentificationType, storedValueAccountID.isSetIdentificationType) + && Objects.equals(this.storedValueID, storedValueAccountID.storedValueID) + && Objects.equals(this.isSetStoredValueID, storedValueAccountID.isSetStoredValueID); + } + + @Override + public int hashCode() { + return Objects.hash( + storedValueAccountType, + isSetStoredValueAccountType, + storedValueProvider, + isSetStoredValueProvider, + ownerName, + isSetOwnerName, + expiryDate, + isSetExpiryDate, + entryMode, + isSetEntryMode, + identificationType, + isSetIdentificationType, + storedValueID, + isSetStoredValueID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueAccountID {\n"); + sb.append(" storedValueAccountType: ") + .append(toIndentedString(storedValueAccountType)) + .append("\n"); + sb.append(" storedValueProvider: ") + .append(toIndentedString(storedValueProvider)) + .append("\n"); + sb.append(" ownerName: ").append(toIndentedString(ownerName)).append("\n"); + sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n"); + sb.append(" entryMode: ").append(toIndentedString(entryMode)).append("\n"); + sb.append(" identificationType: ").append(toIndentedString(identificationType)).append("\n"); + sb.append(" storedValueID: ").append(toIndentedString(storedValueID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStoredValueAccountType) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_ACCOUNT_TYPE, this.storedValueAccountType); + } + if (isSetStoredValueProvider) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_PROVIDER, this.storedValueProvider); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE, this.expiryDate); + } + if (isSetEntryMode) { + addIfNull(nulls, JSON_PROPERTY_ENTRY_MODE, this.entryMode); + } + if (isSetIdentificationType) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_TYPE, this.identificationType); + } + if (isSetStoredValueID) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_I_D, this.storedValueID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of StoredValueAccountID given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueAccountID + * @throws JsonProcessingException if the JSON string is invalid with respect to + * StoredValueAccountID + */ + public static StoredValueAccountID fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, StoredValueAccountID.class); + } + + /** + * Convert an instance of StoredValueAccountID to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueAccountStatus.java b/src/main/java/com/adyen/model/tapi/StoredValueAccountStatus.java new file mode 100644 index 000000000..87e51425d --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueAccountStatus.java @@ -0,0 +1,232 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** StoredValueAccountStatus */ +@JsonPropertyOrder({ + StoredValueAccountStatus.JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D, + StoredValueAccountStatus.JSON_PROPERTY_CURRENT_BALANCE +}) +public class StoredValueAccountStatus { + public static final String JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D = "StoredValueAccountID"; + private StoredValueAccountID storedValueAccountID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueAccountID = false; + + public static final String JSON_PROPERTY_CURRENT_BALANCE = "CurrentBalance"; + private BigDecimal currentBalance; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public StoredValueAccountStatus() {} + + /** + * storedValueAccountID + * + * @param storedValueAccountID + * @return the current {@code StoredValueAccountStatus} instance, allowing for method chaining + */ + public StoredValueAccountStatus storedValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + isSetStoredValueAccountID = true; // mark as set + return this; + } + + /** + * Get storedValueAccountID + * + * @return storedValueAccountID + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueAccountID getStoredValueAccountID() { + return storedValueAccountID; + } + + /** + * storedValueAccountID + * + * @param storedValueAccountID + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + isSetStoredValueAccountID = true; // mark as set + } + + /** + * If relevant and known. + * + * @param currentBalance If relevant and known. + * @return the current {@code StoredValueAccountStatus} instance, allowing for method chaining + */ + public StoredValueAccountStatus currentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set + return this; + } + + /** + * If relevant and known. minimum: 0.0 maximum: 99999999.999999 + * + * @return currentBalance If relevant and known. + */ + @JsonProperty(JSON_PROPERTY_CURRENT_BALANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * If relevant and known. + * + * @param currentBalance If relevant and known. + */ + @JsonProperty(JSON_PROPERTY_CURRENT_BALANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueAccountStatus includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this StoredValueAccountStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueAccountStatus storedValueAccountStatus = (StoredValueAccountStatus) o; + return Objects.equals(this.storedValueAccountID, storedValueAccountStatus.storedValueAccountID) + && Objects.equals( + this.isSetStoredValueAccountID, storedValueAccountStatus.isSetStoredValueAccountID) + && Objects.equals(this.currentBalance, storedValueAccountStatus.currentBalance) + && Objects.equals(this.isSetCurrentBalance, storedValueAccountStatus.isSetCurrentBalance); + } + + @Override + public int hashCode() { + return Objects.hash( + storedValueAccountID, isSetStoredValueAccountID, currentBalance, isSetCurrentBalance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueAccountStatus {\n"); + sb.append(" storedValueAccountID: ") + .append(toIndentedString(storedValueAccountID)) + .append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStoredValueAccountID) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D, this.storedValueAccountID); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of StoredValueAccountStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueAccountStatus + * @throws JsonProcessingException if the JSON string is invalid with respect to + * StoredValueAccountStatus + */ + public static StoredValueAccountStatus fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, StoredValueAccountStatus.class); + } + + /** + * Convert an instance of StoredValueAccountStatus to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueAccountType.java b/src/main/java/com/adyen/model/tapi/StoredValueAccountType.java new file mode 100644 index 000000000..065d8f00e --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueAccountType.java @@ -0,0 +1,51 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets StoredValueAccountType */ +public enum StoredValueAccountType { + GIFT_CARD("GiftCard"), + + OTHER("Other"), + + PHONE_CARD("PhoneCard"); + + private String value; + + StoredValueAccountType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StoredValueAccountType fromValue(String value) { + for (StoredValueAccountType b : StoredValueAccountType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueData.java b/src/main/java/com/adyen/model/tapi/StoredValueData.java new file mode 100644 index 000000000..f69920460 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueData.java @@ -0,0 +1,584 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** + * It contains: - the identification of the stored value accounts or the stored value cards, if + * provided by the Sale System, and - the associated products sold by the Sale System. Data related + * to the stored value card. + */ +@JsonPropertyOrder({ + StoredValueData.JSON_PROPERTY_STORED_VALUE_PROVIDER, + StoredValueData.JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE, + StoredValueData.JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D, + StoredValueData.JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, + StoredValueData.JSON_PROPERTY_PRODUCT_CODE, + StoredValueData.JSON_PROPERTY_EAN_UPC, + StoredValueData.JSON_PROPERTY_ITEM_AMOUNT, + StoredValueData.JSON_PROPERTY_CURRENCY +}) +public class StoredValueData { + public static final String JSON_PROPERTY_STORED_VALUE_PROVIDER = "StoredValueProvider"; + private String storedValueProvider; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueProvider = false; + + public static final String JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE = + "StoredValueTransactionType"; + private StoredValueTransactionType storedValueTransactionType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueTransactionType = false; + + public static final String JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D = "StoredValueAccountID"; + private StoredValueAccountID storedValueAccountID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueAccountID = false; + + public static final String JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION = "OriginalPOITransaction"; + private OriginalPOITransaction originalPOITransaction; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalPOITransaction = false; + + public static final String JSON_PROPERTY_PRODUCT_CODE = "ProductCode"; + private Integer productCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProductCode = false; + + public static final String JSON_PROPERTY_EAN_UPC = "EanUpc"; + private Integer eanUpc; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEanUpc = false; + + public static final String JSON_PROPERTY_ITEM_AMOUNT = "ItemAmount"; + private BigDecimal itemAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemAmount = false; + + public static final String JSON_PROPERTY_CURRENCY = "Currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public StoredValueData() {} + + /** + * Identification of the provider of the stored value account load/reload. If more than one + * provider to manage on the POI, and StoredValueAccountID absent. + * + * @param storedValueProvider Identification of the provider of the stored value account + * load/reload. If more than one provider to manage on the POI, and StoredValueAccountID + * absent. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData storedValueProvider(String storedValueProvider) { + this.storedValueProvider = storedValueProvider; + isSetStoredValueProvider = true; // mark as set + return this; + } + + /** + * Identification of the provider of the stored value account load/reload. If more than one + * provider to manage on the POI, and StoredValueAccountID absent. + * + * @return storedValueProvider Identification of the provider of the stored value account + * load/reload. If more than one provider to manage on the POI, and StoredValueAccountID + * absent. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredValueProvider() { + return storedValueProvider; + } + + /** + * Identification of the provider of the stored value account load/reload. If more than one + * provider to manage on the POI, and StoredValueAccountID absent. + * + * @param storedValueProvider Identification of the provider of the stored value account + * load/reload. If more than one provider to manage on the POI, and StoredValueAccountID + * absent. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueProvider(String storedValueProvider) { + this.storedValueProvider = storedValueProvider; + isSetStoredValueProvider = true; // mark as set + } + + /** + * Identification of operation to proceed on the stored value account or the stored value card. + * Possible values: * **Activate** * **Duplicate** * **Load** * **Reserve** * **Reverse** * + * **Unload** + * + * @param storedValueTransactionType Identification of operation to proceed on the stored value + * account or the stored value card. Possible values: * **Activate** * **Duplicate** * + * **Load** * **Reserve** * **Reverse** * **Unload** + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData storedValueTransactionType( + StoredValueTransactionType storedValueTransactionType) { + this.storedValueTransactionType = storedValueTransactionType; + isSetStoredValueTransactionType = true; // mark as set + return this; + } + + /** + * Identification of operation to proceed on the stored value account or the stored value card. + * Possible values: * **Activate** * **Duplicate** * **Load** * **Reserve** * **Reverse** * + * **Unload** + * + * @return storedValueTransactionType Identification of operation to proceed on the stored value + * account or the stored value card. Possible values: * **Activate** * **Duplicate** * + * **Load** * **Reserve** * **Reverse** * **Unload** + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueTransactionType getStoredValueTransactionType() { + return storedValueTransactionType; + } + + /** + * Identification of operation to proceed on the stored value account or the stored value card. + * Possible values: * **Activate** * **Duplicate** * **Load** * **Reserve** * **Reverse** * + * **Unload** + * + * @param storedValueTransactionType Identification of operation to proceed on the stored value + * account or the stored value card. Possible values: * **Activate** * **Duplicate** * + * **Load** * **Reserve** * **Reverse** * **Unload** + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueTransactionType(StoredValueTransactionType storedValueTransactionType) { + this.storedValueTransactionType = storedValueTransactionType; + isSetStoredValueTransactionType = true; // mark as set + } + + /** + * Identification of the stored value account or the stored value card. If the identification of + * the Stored Value account or card has been made by the Sale System before the request. + * + * @param storedValueAccountID Identification of the stored value account or the stored value + * card. If the identification of the Stored Value account or card has been made by the Sale + * System before the request. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData storedValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + isSetStoredValueAccountID = true; // mark as set + return this; + } + + /** + * Identification of the stored value account or the stored value card. If the identification of + * the Stored Value account or card has been made by the Sale System before the request. + * + * @return storedValueAccountID Identification of the stored value account or the stored value + * card. If the identification of the Stored Value account or card has been made by the Sale + * System before the request. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueAccountID getStoredValueAccountID() { + return storedValueAccountID; + } + + /** + * Identification of the stored value account or the stored value card. If the identification of + * the Stored Value account or card has been made by the Sale System before the request. + * + * @param storedValueAccountID Identification of the stored value account or the stored value + * card. If the identification of the Stored Value account or card has been made by the Sale + * System before the request. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + isSetStoredValueAccountID = true; // mark as set + } + + /** + * Identification of a previous POI transaction. If StoredValueTransactionType is Reverse or + * Duplicate. + * + * @param originalPOITransaction Identification of a previous POI transaction. If + * StoredValueTransactionType is Reverse or Duplicate. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData originalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + return this; + } + + /** + * Identification of a previous POI transaction. If StoredValueTransactionType is Reverse or + * Duplicate. + * + * @return originalPOITransaction Identification of a previous POI transaction. If + * StoredValueTransactionType is Reverse or Duplicate. + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Identification of a previous POI transaction. If StoredValueTransactionType is Reverse or + * Duplicate. + * + * @param originalPOITransaction Identification of a previous POI transaction. If + * StoredValueTransactionType is Reverse or Duplicate. + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + isSetOriginalPOITransaction = true; // mark as set + } + + /** + * Product code of item purchased with the transaction. + * + * @param productCode Product code of item purchased with the transaction. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData productCode(Integer productCode) { + this.productCode = productCode; + isSetProductCode = true; // mark as set + return this; + } + + /** + * Product code of item purchased with the transaction. minimum: 1 maximum: 20 + * + * @return productCode Product code of item purchased with the transaction. + */ + @JsonProperty(JSON_PROPERTY_PRODUCT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductCode() { + return productCode; + } + + /** + * Product code of item purchased with the transaction. + * + * @param productCode Product code of item purchased with the transaction. + */ + @JsonProperty(JSON_PROPERTY_PRODUCT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductCode(Integer productCode) { + this.productCode = productCode; + isSetProductCode = true; // mark as set + } + + /** + * Standard product code of item purchased with the transaction. + * + * @param eanUpc Standard product code of item purchased with the transaction. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData eanUpc(Integer eanUpc) { + this.eanUpc = eanUpc; + isSetEanUpc = true; // mark as set + return this; + } + + /** + * Standard product code of item purchased with the transaction. + * + * @return eanUpc Standard product code of item purchased with the transaction. + */ + @JsonProperty(JSON_PROPERTY_EAN_UPC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEanUpc() { + return eanUpc; + } + + /** + * Standard product code of item purchased with the transaction. + * + * @param eanUpc Standard product code of item purchased with the transaction. + */ + @JsonProperty(JSON_PROPERTY_EAN_UPC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEanUpc(Integer eanUpc) { + this.eanUpc = eanUpc; + isSetEanUpc = true; // mark as set + } + + /** + * Total amount of the item line. + * + * @param itemAmount Total amount of the item line. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData itemAmount(BigDecimal itemAmount) { + this.itemAmount = itemAmount; + isSetItemAmount = true; // mark as set + return this; + } + + /** + * Total amount of the item line. minimum: 0.0 maximum: 99999999.999999 + * + * @return itemAmount Total amount of the item line. + */ + @JsonProperty(JSON_PROPERTY_ITEM_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getItemAmount() { + return itemAmount; + } + + /** + * Total amount of the item line. + * + * @param itemAmount Total amount of the item line. + */ + @JsonProperty(JSON_PROPERTY_ITEM_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemAmount(BigDecimal itemAmount) { + this.itemAmount = itemAmount; + isSetItemAmount = true; // mark as set + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + * @return the current {@code StoredValueData} instance, allowing for method chaining + */ + public StoredValueData currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. + * + * @return currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * Currency of a monetary amount. + * + * @param currency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this StoredValueData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueData storedValueData = (StoredValueData) o; + return Objects.equals(this.storedValueProvider, storedValueData.storedValueProvider) + && Objects.equals(this.isSetStoredValueProvider, storedValueData.isSetStoredValueProvider) + && Objects.equals( + this.storedValueTransactionType, storedValueData.storedValueTransactionType) + && Objects.equals( + this.isSetStoredValueTransactionType, storedValueData.isSetStoredValueTransactionType) + && Objects.equals(this.storedValueAccountID, storedValueData.storedValueAccountID) + && Objects.equals(this.isSetStoredValueAccountID, storedValueData.isSetStoredValueAccountID) + && Objects.equals(this.originalPOITransaction, storedValueData.originalPOITransaction) + && Objects.equals( + this.isSetOriginalPOITransaction, storedValueData.isSetOriginalPOITransaction) + && Objects.equals(this.productCode, storedValueData.productCode) + && Objects.equals(this.isSetProductCode, storedValueData.isSetProductCode) + && Objects.equals(this.eanUpc, storedValueData.eanUpc) + && Objects.equals(this.isSetEanUpc, storedValueData.isSetEanUpc) + && Objects.equals(this.itemAmount, storedValueData.itemAmount) + && Objects.equals(this.isSetItemAmount, storedValueData.isSetItemAmount) + && Objects.equals(this.currency, storedValueData.currency) + && Objects.equals(this.isSetCurrency, storedValueData.isSetCurrency); + } + + @Override + public int hashCode() { + return Objects.hash( + storedValueProvider, + isSetStoredValueProvider, + storedValueTransactionType, + isSetStoredValueTransactionType, + storedValueAccountID, + isSetStoredValueAccountID, + originalPOITransaction, + isSetOriginalPOITransaction, + productCode, + isSetProductCode, + eanUpc, + isSetEanUpc, + itemAmount, + isSetItemAmount, + currency, + isSetCurrency); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueData {\n"); + sb.append(" storedValueProvider: ") + .append(toIndentedString(storedValueProvider)) + .append("\n"); + sb.append(" storedValueTransactionType: ") + .append(toIndentedString(storedValueTransactionType)) + .append("\n"); + sb.append(" storedValueAccountID: ") + .append(toIndentedString(storedValueAccountID)) + .append("\n"); + sb.append(" originalPOITransaction: ") + .append(toIndentedString(originalPOITransaction)) + .append("\n"); + sb.append(" productCode: ").append(toIndentedString(productCode)).append("\n"); + sb.append(" eanUpc: ").append(toIndentedString(eanUpc)).append("\n"); + sb.append(" itemAmount: ").append(toIndentedString(itemAmount)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStoredValueProvider) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_PROVIDER, this.storedValueProvider); + } + if (isSetStoredValueTransactionType) { + addIfNull( + nulls, JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE, this.storedValueTransactionType); + } + if (isSetStoredValueAccountID) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_ACCOUNT_I_D, this.storedValueAccountID); + } + if (isSetOriginalPOITransaction) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_P_O_I_TRANSACTION, this.originalPOITransaction); + } + if (isSetProductCode) { + addIfNull(nulls, JSON_PROPERTY_PRODUCT_CODE, this.productCode); + } + if (isSetEanUpc) { + addIfNull(nulls, JSON_PROPERTY_EAN_UPC, this.eanUpc); + } + if (isSetItemAmount) { + addIfNull(nulls, JSON_PROPERTY_ITEM_AMOUNT, this.itemAmount); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of StoredValueData given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueData + * @throws JsonProcessingException if the JSON string is invalid with respect to StoredValueData + */ + public static StoredValueData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, StoredValueData.class); + } + + /** + * Convert an instance of StoredValueData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueRequest.java b/src/main/java/com/adyen/model/tapi/StoredValueRequest.java new file mode 100644 index 000000000..a317cc860 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueRequest.java @@ -0,0 +1,239 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the Stored Value transaction to process. Content of the Stored + * Value Request message. + */ +@JsonPropertyOrder({ + StoredValueRequest.JSON_PROPERTY_SALE_DATA, + StoredValueRequest.JSON_PROPERTY_STORED_VALUE_DATA +}) +public class StoredValueRequest { + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_STORED_VALUE_DATA = "StoredValueData"; + private List storedValueData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public StoredValueRequest() {} + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + * @return the current {@code StoredValueRequest} instance, allowing for method chaining + */ + public StoredValueRequest saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. + * + * @return saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the stored value card. + * + * @param storedValueData Data related to the stored value card. + * @return the current {@code StoredValueRequest} instance, allowing for method chaining + */ + public StoredValueRequest storedValueData(List storedValueData) { + this.storedValueData = storedValueData; + isSetStoredValueData = true; // mark as set + return this; + } + + public StoredValueRequest addStoredValueDataItem(StoredValueData storedValueDataItem) { + if (this.storedValueData == null) { + this.storedValueData = new ArrayList<>(); + } + this.storedValueData.add(storedValueDataItem); + return this; + } + + /** + * Data related to the stored value card. + * + * @return storedValueData Data related to the stored value card. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoredValueData() { + return storedValueData; + } + + /** + * Data related to the stored value card. + * + * @param storedValueData Data related to the stored value card. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueData(List storedValueData) { + this.storedValueData = storedValueData; + isSetStoredValueData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this StoredValueRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueRequest storedValueRequest = (StoredValueRequest) o; + return Objects.equals(this.saleData, storedValueRequest.saleData) + && Objects.equals(this.isSetSaleData, storedValueRequest.isSetSaleData) + && Objects.equals(this.storedValueData, storedValueRequest.storedValueData) + && Objects.equals(this.isSetStoredValueData, storedValueRequest.isSetStoredValueData); + } + + @Override + public int hashCode() { + return Objects.hash(saleData, isSetSaleData, storedValueData, isSetStoredValueData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueRequest {\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" storedValueData: ").append(toIndentedString(storedValueData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetStoredValueData) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_DATA, this.storedValueData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of StoredValueRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * StoredValueRequest + */ + public static StoredValueRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, StoredValueRequest.class); + } + + /** + * Convert an instance of StoredValueRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueResponse.java b/src/main/java/com/adyen/model/tapi/StoredValueResponse.java new file mode 100644 index 000000000..60b6eeaf5 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueResponse.java @@ -0,0 +1,410 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * It conveys Information related to the Stored Value transaction processed by the POI System. + * Content of the Stored Value Response message. + */ +@JsonPropertyOrder({ + StoredValueResponse.JSON_PROPERTY_RESPONSE, + StoredValueResponse.JSON_PROPERTY_SALE_DATA, + StoredValueResponse.JSON_PROPERTY_PO_I_DATA, + StoredValueResponse.JSON_PROPERTY_STORED_VALUE_RESULT, + StoredValueResponse.JSON_PROPERTY_PAYMENT_RECEIPT +}) +public class StoredValueResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_SALE_DATA = "SaleData"; + private SaleData saleData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleData = false; + + public static final String JSON_PROPERTY_PO_I_DATA = "POIData"; + private POIData poIData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPoIData = false; + + public static final String JSON_PROPERTY_STORED_VALUE_RESULT = "StoredValueResult"; + private List storedValueResult; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueResult = false; + + public static final String JSON_PROPERTY_PAYMENT_RECEIPT = "PaymentReceipt"; + private List paymentReceipt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReceipt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public StoredValueResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code StoredValueResponse} instance, allowing for method chaining + */ + public StoredValueResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + * @return the current {@code StoredValueResponse} instance, allowing for method chaining + */ + public StoredValueResponse saleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + return this; + } + + /** + * Data related to the Sale System. + * + * @return saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleData getSaleData() { + return saleData; + } + + /** + * Data related to the Sale System. + * + * @param saleData Data related to the Sale System. + */ + @JsonProperty(JSON_PROPERTY_SALE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + isSetSaleData = true; // mark as set + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + * @return the current {@code StoredValueResponse} instance, allowing for method chaining + */ + public StoredValueResponse poIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + return this; + } + + /** + * Data related to the POI System. + * + * @return poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public POIData getPoIData() { + return poIData; + } + + /** + * Data related to the POI System. + * + * @param poIData Data related to the POI System. + */ + @JsonProperty(JSON_PROPERTY_PO_I_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoIData(POIData poIData) { + this.poIData = poIData; + isSetPoIData = true; // mark as set + } + + /** + * Result of loading/reloading a stored value card. If StoredValueResponse.Result is Success or + * Partial, one entry per StoredValueRequest.StoredValueData loaded or activated. + * + * @param storedValueResult Result of loading/reloading a stored value card. If + * StoredValueResponse.Result is Success or Partial, one entry per + * StoredValueRequest.StoredValueData loaded or activated. + * @return the current {@code StoredValueResponse} instance, allowing for method chaining + */ + public StoredValueResponse storedValueResult(List storedValueResult) { + this.storedValueResult = storedValueResult; + isSetStoredValueResult = true; // mark as set + return this; + } + + public StoredValueResponse addStoredValueResultItem(StoredValueResult storedValueResultItem) { + if (this.storedValueResult == null) { + this.storedValueResult = new ArrayList<>(); + } + this.storedValueResult.add(storedValueResultItem); + return this; + } + + /** + * Result of loading/reloading a stored value card. If StoredValueResponse.Result is Success or + * Partial, one entry per StoredValueRequest.StoredValueData loaded or activated. + * + * @return storedValueResult Result of loading/reloading a stored value card. If + * StoredValueResponse.Result is Success or Partial, one entry per + * StoredValueRequest.StoredValueData loaded or activated. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoredValueResult() { + return storedValueResult; + } + + /** + * Result of loading/reloading a stored value card. If StoredValueResponse.Result is Success or + * Partial, one entry per StoredValueRequest.StoredValueData loaded or activated. + * + * @param storedValueResult Result of loading/reloading a stored value card. If + * StoredValueResponse.Result is Success or Partial, one entry per + * StoredValueRequest.StoredValueData loaded or activated. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueResult(List storedValueResult) { + this.storedValueResult = storedValueResult; + isSetStoredValueResult = true; // mark as set + } + + /** + * paymentReceipt + * + * @param paymentReceipt + * @return the current {@code StoredValueResponse} instance, allowing for method chaining + */ + public StoredValueResponse paymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + return this; + } + + public StoredValueResponse addPaymentReceiptItem(PaymentReceipt paymentReceiptItem) { + if (this.paymentReceipt == null) { + this.paymentReceipt = new ArrayList<>(); + } + this.paymentReceipt.add(paymentReceiptItem); + return this; + } + + /** + * Get paymentReceipt + * + * @return paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentReceipt() { + return paymentReceipt; + } + + /** + * paymentReceipt + * + * @param paymentReceipt + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_RECEIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + isSetPaymentReceipt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this StoredValueResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueResponse storedValueResponse = (StoredValueResponse) o; + return Objects.equals(this.response, storedValueResponse.response) + && Objects.equals(this.isSetResponse, storedValueResponse.isSetResponse) + && Objects.equals(this.saleData, storedValueResponse.saleData) + && Objects.equals(this.isSetSaleData, storedValueResponse.isSetSaleData) + && Objects.equals(this.poIData, storedValueResponse.poIData) + && Objects.equals(this.isSetPoIData, storedValueResponse.isSetPoIData) + && Objects.equals(this.storedValueResult, storedValueResponse.storedValueResult) + && Objects.equals(this.isSetStoredValueResult, storedValueResponse.isSetStoredValueResult) + && Objects.equals(this.paymentReceipt, storedValueResponse.paymentReceipt) + && Objects.equals(this.isSetPaymentReceipt, storedValueResponse.isSetPaymentReceipt); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + saleData, + isSetSaleData, + poIData, + isSetPoIData, + storedValueResult, + isSetStoredValueResult, + paymentReceipt, + isSetPaymentReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poIData: ").append(toIndentedString(poIData)).append("\n"); + sb.append(" storedValueResult: ").append(toIndentedString(storedValueResult)).append("\n"); + sb.append(" paymentReceipt: ").append(toIndentedString(paymentReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetSaleData) { + addIfNull(nulls, JSON_PROPERTY_SALE_DATA, this.saleData); + } + if (isSetPoIData) { + addIfNull(nulls, JSON_PROPERTY_PO_I_DATA, this.poIData); + } + if (isSetStoredValueResult) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_RESULT, this.storedValueResult); + } + if (isSetPaymentReceipt) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_RECEIPT, this.paymentReceipt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of StoredValueResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * StoredValueResponse + */ + public static StoredValueResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, StoredValueResponse.class); + } + + /** + * Convert an instance of StoredValueResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueResult.java b/src/main/java/com/adyen/model/tapi/StoredValueResult.java new file mode 100644 index 000000000..e4441ef2d --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueResult.java @@ -0,0 +1,515 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.math.BigDecimal; +import java.util.*; + +/** + * For each stored value card loaded or reloaded, in the StoredValue response message. Result of + * loading/reloading a stored value card. + */ +@JsonPropertyOrder({ + StoredValueResult.JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE, + StoredValueResult.JSON_PROPERTY_PRODUCT_CODE, + StoredValueResult.JSON_PROPERTY_EAN_UPC, + StoredValueResult.JSON_PROPERTY_ITEM_AMOUNT, + StoredValueResult.JSON_PROPERTY_CURRENCY, + StoredValueResult.JSON_PROPERTY_STORED_VALUE_ACCOUNT_STATUS, + StoredValueResult.JSON_PROPERTY_HOST_TRANSACTION_I_D +}) +public class StoredValueResult { + public static final String JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE = + "StoredValueTransactionType"; + private StoredValueTransactionType storedValueTransactionType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueTransactionType = false; + + public static final String JSON_PROPERTY_PRODUCT_CODE = "ProductCode"; + private Integer productCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProductCode = false; + + public static final String JSON_PROPERTY_EAN_UPC = "EanUpc"; + private Integer eanUpc; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEanUpc = false; + + public static final String JSON_PROPERTY_ITEM_AMOUNT = "ItemAmount"; + private BigDecimal itemAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemAmount = false; + + public static final String JSON_PROPERTY_CURRENCY = "Currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_STORED_VALUE_ACCOUNT_STATUS = "StoredValueAccountStatus"; + private StoredValueAccountStatus storedValueAccountStatus; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredValueAccountStatus = false; + + public static final String JSON_PROPERTY_HOST_TRANSACTION_I_D = "HostTransactionID"; + private TransactionIdentification hostTransactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostTransactionID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public StoredValueResult() {} + + /** + * Identification of operation to proceed on the stored value account or the stored value card. + * Copy. Possible values: * **Activate** * **Duplicate** * **Load** * **Reserve** * **Reverse** * + * **Unload** + * + * @param storedValueTransactionType Identification of operation to proceed on the stored value + * account or the stored value card. Copy. Possible values: * **Activate** * **Duplicate** * + * **Load** * **Reserve** * **Reverse** * **Unload** + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult storedValueTransactionType( + StoredValueTransactionType storedValueTransactionType) { + this.storedValueTransactionType = storedValueTransactionType; + isSetStoredValueTransactionType = true; // mark as set + return this; + } + + /** + * Identification of operation to proceed on the stored value account or the stored value card. + * Copy. Possible values: * **Activate** * **Duplicate** * **Load** * **Reserve** * **Reverse** * + * **Unload** + * + * @return storedValueTransactionType Identification of operation to proceed on the stored value + * account or the stored value card. Copy. Possible values: * **Activate** * **Duplicate** * + * **Load** * **Reserve** * **Reverse** * **Unload** + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueTransactionType getStoredValueTransactionType() { + return storedValueTransactionType; + } + + /** + * Identification of operation to proceed on the stored value account or the stored value card. + * Copy. Possible values: * **Activate** * **Duplicate** * **Load** * **Reserve** * **Reverse** * + * **Unload** + * + * @param storedValueTransactionType Identification of operation to proceed on the stored value + * account or the stored value card. Copy. Possible values: * **Activate** * **Duplicate** * + * **Load** * **Reserve** * **Reverse** * **Unload** + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueTransactionType(StoredValueTransactionType storedValueTransactionType) { + this.storedValueTransactionType = storedValueTransactionType; + isSetStoredValueTransactionType = true; // mark as set + } + + /** + * Product code of item purchased with the transaction. Copy. + * + * @param productCode Product code of item purchased with the transaction. Copy. + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult productCode(Integer productCode) { + this.productCode = productCode; + isSetProductCode = true; // mark as set + return this; + } + + /** + * Product code of item purchased with the transaction. Copy. minimum: 1 maximum: 20 + * + * @return productCode Product code of item purchased with the transaction. Copy. + */ + @JsonProperty(JSON_PROPERTY_PRODUCT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getProductCode() { + return productCode; + } + + /** + * Product code of item purchased with the transaction. Copy. + * + * @param productCode Product code of item purchased with the transaction. Copy. + */ + @JsonProperty(JSON_PROPERTY_PRODUCT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductCode(Integer productCode) { + this.productCode = productCode; + isSetProductCode = true; // mark as set + } + + /** + * Standard product code of item purchased with the transaction. Copy. + * + * @param eanUpc Standard product code of item purchased with the transaction. Copy. + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult eanUpc(Integer eanUpc) { + this.eanUpc = eanUpc; + isSetEanUpc = true; // mark as set + return this; + } + + /** + * Standard product code of item purchased with the transaction. Copy. + * + * @return eanUpc Standard product code of item purchased with the transaction. Copy. + */ + @JsonProperty(JSON_PROPERTY_EAN_UPC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEanUpc() { + return eanUpc; + } + + /** + * Standard product code of item purchased with the transaction. Copy. + * + * @param eanUpc Standard product code of item purchased with the transaction. Copy. + */ + @JsonProperty(JSON_PROPERTY_EAN_UPC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEanUpc(Integer eanUpc) { + this.eanUpc = eanUpc; + isSetEanUpc = true; // mark as set + } + + /** + * Total amount of the item line. + * + * @param itemAmount Total amount of the item line. + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult itemAmount(BigDecimal itemAmount) { + this.itemAmount = itemAmount; + isSetItemAmount = true; // mark as set + return this; + } + + /** + * Total amount of the item line. minimum: 0.0 maximum: 99999999.999999 + * + * @return itemAmount Total amount of the item line. + */ + @JsonProperty(JSON_PROPERTY_ITEM_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getItemAmount() { + return itemAmount; + } + + /** + * Total amount of the item line. + * + * @param itemAmount Total amount of the item line. + */ + @JsonProperty(JSON_PROPERTY_ITEM_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemAmount(BigDecimal itemAmount) { + this.itemAmount = itemAmount; + isSetItemAmount = true; // mark as set + } + + /** + * Currency of a monetary amount. Copy. + * + * @param currency Currency of a monetary amount. Copy. + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. Copy. + * + * @return currency Currency of a monetary amount. Copy. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * Currency of a monetary amount. Copy. + * + * @param currency Currency of a monetary amount. Copy. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * Data related to the result of the stored value card transaction. + * + * @param storedValueAccountStatus Data related to the result of the stored value card + * transaction. + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult storedValueAccountStatus( + StoredValueAccountStatus storedValueAccountStatus) { + this.storedValueAccountStatus = storedValueAccountStatus; + isSetStoredValueAccountStatus = true; // mark as set + return this; + } + + /** + * Data related to the result of the stored value card transaction. + * + * @return storedValueAccountStatus Data related to the result of the stored value card + * transaction. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StoredValueAccountStatus getStoredValueAccountStatus() { + return storedValueAccountStatus; + } + + /** + * Data related to the result of the stored value card transaction. + * + * @param storedValueAccountStatus Data related to the result of the stored value card + * transaction. + */ + @JsonProperty(JSON_PROPERTY_STORED_VALUE_ACCOUNT_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredValueAccountStatus(StoredValueAccountStatus storedValueAccountStatus) { + this.storedValueAccountStatus = storedValueAccountStatus; + isSetStoredValueAccountStatus = true; // mark as set + } + + /** + * Identification of the transaction by the host in charge of the stored value transaction. If + * provided by the Host. + * + * @param hostTransactionID Identification of the transaction by the host in charge of the stored + * value transaction. If provided by the Host. + * @return the current {@code StoredValueResult} instance, allowing for method chaining + */ + public StoredValueResult hostTransactionID(TransactionIdentification hostTransactionID) { + this.hostTransactionID = hostTransactionID; + isSetHostTransactionID = true; // mark as set + return this; + } + + /** + * Identification of the transaction by the host in charge of the stored value transaction. If + * provided by the Host. + * + * @return hostTransactionID Identification of the transaction by the host in charge of the stored + * value transaction. If provided by the Host. + */ + @JsonProperty(JSON_PROPERTY_HOST_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionIdentification getHostTransactionID() { + return hostTransactionID; + } + + /** + * Identification of the transaction by the host in charge of the stored value transaction. If + * provided by the Host. + * + * @param hostTransactionID Identification of the transaction by the host in charge of the stored + * value transaction. If provided by the Host. + */ + @JsonProperty(JSON_PROPERTY_HOST_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostTransactionID(TransactionIdentification hostTransactionID) { + this.hostTransactionID = hostTransactionID; + isSetHostTransactionID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this StoredValueResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueResult storedValueResult = (StoredValueResult) o; + return Objects.equals( + this.storedValueTransactionType, storedValueResult.storedValueTransactionType) + && Objects.equals( + this.isSetStoredValueTransactionType, storedValueResult.isSetStoredValueTransactionType) + && Objects.equals(this.productCode, storedValueResult.productCode) + && Objects.equals(this.isSetProductCode, storedValueResult.isSetProductCode) + && Objects.equals(this.eanUpc, storedValueResult.eanUpc) + && Objects.equals(this.isSetEanUpc, storedValueResult.isSetEanUpc) + && Objects.equals(this.itemAmount, storedValueResult.itemAmount) + && Objects.equals(this.isSetItemAmount, storedValueResult.isSetItemAmount) + && Objects.equals(this.currency, storedValueResult.currency) + && Objects.equals(this.isSetCurrency, storedValueResult.isSetCurrency) + && Objects.equals(this.storedValueAccountStatus, storedValueResult.storedValueAccountStatus) + && Objects.equals( + this.isSetStoredValueAccountStatus, storedValueResult.isSetStoredValueAccountStatus) + && Objects.equals(this.hostTransactionID, storedValueResult.hostTransactionID) + && Objects.equals(this.isSetHostTransactionID, storedValueResult.isSetHostTransactionID); + } + + @Override + public int hashCode() { + return Objects.hash( + storedValueTransactionType, + isSetStoredValueTransactionType, + productCode, + isSetProductCode, + eanUpc, + isSetEanUpc, + itemAmount, + isSetItemAmount, + currency, + isSetCurrency, + storedValueAccountStatus, + isSetStoredValueAccountStatus, + hostTransactionID, + isSetHostTransactionID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueResult {\n"); + sb.append(" storedValueTransactionType: ") + .append(toIndentedString(storedValueTransactionType)) + .append("\n"); + sb.append(" productCode: ").append(toIndentedString(productCode)).append("\n"); + sb.append(" eanUpc: ").append(toIndentedString(eanUpc)).append("\n"); + sb.append(" itemAmount: ").append(toIndentedString(itemAmount)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" storedValueAccountStatus: ") + .append(toIndentedString(storedValueAccountStatus)) + .append("\n"); + sb.append(" hostTransactionID: ").append(toIndentedString(hostTransactionID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStoredValueTransactionType) { + addIfNull( + nulls, JSON_PROPERTY_STORED_VALUE_TRANSACTION_TYPE, this.storedValueTransactionType); + } + if (isSetProductCode) { + addIfNull(nulls, JSON_PROPERTY_PRODUCT_CODE, this.productCode); + } + if (isSetEanUpc) { + addIfNull(nulls, JSON_PROPERTY_EAN_UPC, this.eanUpc); + } + if (isSetItemAmount) { + addIfNull(nulls, JSON_PROPERTY_ITEM_AMOUNT, this.itemAmount); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetStoredValueAccountStatus) { + addIfNull(nulls, JSON_PROPERTY_STORED_VALUE_ACCOUNT_STATUS, this.storedValueAccountStatus); + } + if (isSetHostTransactionID) { + addIfNull(nulls, JSON_PROPERTY_HOST_TRANSACTION_I_D, this.hostTransactionID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of StoredValueResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueResult + * @throws JsonProcessingException if the JSON string is invalid with respect to StoredValueResult + */ + public static StoredValueResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, StoredValueResult.class); + } + + /** + * Convert an instance of StoredValueResult to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/StoredValueTransactionType.java b/src/main/java/com/adyen/model/tapi/StoredValueTransactionType.java new file mode 100644 index 000000000..7b784e89c --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/StoredValueTransactionType.java @@ -0,0 +1,57 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets StoredValueTransactionType */ +public enum StoredValueTransactionType { + ACTIVATE("Activate"), + + DUPLICATE("Duplicate"), + + LOAD("Load"), + + RESERVE("Reserve"), + + REVERSE("Reverse"), + + UNLOAD("Unload"); + + private String value; + + StoredValueTransactionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StoredValueTransactionType fromValue(String value) { + for (StoredValueTransactionType b : StoredValueTransactionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TerminalAPIRequest.java b/src/main/java/com/adyen/model/tapi/TerminalAPIRequest.java new file mode 100644 index 000000000..81b5cb692 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TerminalAPIRequest.java @@ -0,0 +1,176 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** The request payload of the Adyen Terminal API. */ +@JsonPropertyOrder({TerminalAPIRequest.JSON_PROPERTY_SALE_TO_P_O_I_REQUEST}) +public class TerminalAPIRequest { + public static final String JSON_PROPERTY_SALE_TO_P_O_I_REQUEST = "SaleToPOIRequest"; + private SaleToPOIRequest saleToPOIRequest; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleToPOIRequest = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TerminalAPIRequest() {} + + /** + * saleToPOIRequest + * + * @param saleToPOIRequest + * @return the current {@code TerminalAPIRequest} instance, allowing for method chaining + */ + public TerminalAPIRequest saleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + isSetSaleToPOIRequest = true; // mark as set + return this; + } + + /** + * Get saleToPOIRequest + * + * @return saleToPOIRequest + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_P_O_I_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * saleToPOIRequest + * + * @param saleToPOIRequest + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_P_O_I_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + isSetSaleToPOIRequest = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalAPIRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TerminalAPIRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TerminalAPIRequest terminalAPIRequest = (TerminalAPIRequest) o; + return Objects.equals(this.saleToPOIRequest, terminalAPIRequest.saleToPOIRequest) + && Objects.equals(this.isSetSaleToPOIRequest, terminalAPIRequest.isSetSaleToPOIRequest); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIRequest, isSetSaleToPOIRequest); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TerminalAPIRequest {\n"); + sb.append(" saleToPOIRequest: ").append(toIndentedString(saleToPOIRequest)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleToPOIRequest) { + addIfNull(nulls, JSON_PROPERTY_SALE_TO_P_O_I_REQUEST, this.saleToPOIRequest); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TerminalAPIRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TerminalAPIRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TerminalAPIRequest + */ + public static TerminalAPIRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TerminalAPIRequest.class); + } + + /** + * Convert an instance of TerminalAPIRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TerminalAPIResponse.java b/src/main/java/com/adyen/model/tapi/TerminalAPIResponse.java new file mode 100644 index 000000000..cd8beb794 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TerminalAPIResponse.java @@ -0,0 +1,176 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** The response payload of the Adyen Terminal API. */ +@JsonPropertyOrder({TerminalAPIResponse.JSON_PROPERTY_SALE_TO_P_O_I_RESPONSE}) +public class TerminalAPIResponse { + public static final String JSON_PROPERTY_SALE_TO_P_O_I_RESPONSE = "SaleToPOIResponse"; + private SaleToPOIResponse saleToPOIResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleToPOIResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TerminalAPIResponse() {} + + /** + * saleToPOIResponse + * + * @param saleToPOIResponse + * @return the current {@code TerminalAPIResponse} instance, allowing for method chaining + */ + public TerminalAPIResponse saleToPOIResponse(SaleToPOIResponse saleToPOIResponse) { + this.saleToPOIResponse = saleToPOIResponse; + isSetSaleToPOIResponse = true; // mark as set + return this; + } + + /** + * Get saleToPOIResponse + * + * @return saleToPOIResponse + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_P_O_I_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SaleToPOIResponse getSaleToPOIResponse() { + return saleToPOIResponse; + } + + /** + * saleToPOIResponse + * + * @param saleToPOIResponse + */ + @JsonProperty(JSON_PROPERTY_SALE_TO_P_O_I_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleToPOIResponse(SaleToPOIResponse saleToPOIResponse) { + this.saleToPOIResponse = saleToPOIResponse; + isSetSaleToPOIResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalAPIResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TerminalAPIResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TerminalAPIResponse terminalAPIResponse = (TerminalAPIResponse) o; + return Objects.equals(this.saleToPOIResponse, terminalAPIResponse.saleToPOIResponse) + && Objects.equals(this.isSetSaleToPOIResponse, terminalAPIResponse.isSetSaleToPOIResponse); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIResponse, isSetSaleToPOIResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TerminalAPIResponse {\n"); + sb.append(" saleToPOIResponse: ").append(toIndentedString(saleToPOIResponse)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSaleToPOIResponse) { + addIfNull(nulls, JSON_PROPERTY_SALE_TO_P_O_I_RESPONSE, this.saleToPOIResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TerminalAPIResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TerminalAPIResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TerminalAPIResponse + */ + public static TerminalAPIResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TerminalAPIResponse.class); + } + + /** + * Convert an instance of TerminalAPIResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TokenRequestedType.java b/src/main/java/com/adyen/model/tapi/TokenRequestedType.java new file mode 100644 index 000000000..985b98ad4 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TokenRequestedType.java @@ -0,0 +1,53 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Type of token replacing the PAN of a payment card to identify the payment mean of the customer. + * It allows, for a merchant, to use a token for a transaction only or for a longer period. Possible + * values: * **Customer** * **Transaction** + */ +public enum TokenRequestedType { + CUSTOMER("Customer"), + + TRANSACTION("Transaction"); + + private String value; + + TokenRequestedType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TokenRequestedType fromValue(String value) { + for (TokenRequestedType b : TokenRequestedType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TotalFilter.java b/src/main/java/com/adyen/model/tapi/TotalFilter.java new file mode 100644 index 000000000..f483461d8 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TotalFilter.java @@ -0,0 +1,385 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** TotalFilter */ +@JsonPropertyOrder({ + TotalFilter.JSON_PROPERTY_P_O_I_I_D, + TotalFilter.JSON_PROPERTY_SALE_I_D, + TotalFilter.JSON_PROPERTY_OPERATOR_I_D, + TotalFilter.JSON_PROPERTY_SHIFT_NUMBER, + TotalFilter.JSON_PROPERTY_TOTALS_GROUP_I_D +}) +public class TotalFilter { + public static final String JSON_PROPERTY_P_O_I_I_D = "POIID"; + private String POIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPOIID = false; + + public static final String JSON_PROPERTY_SALE_I_D = "SaleID"; + private String saleID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleID = false; + + public static final String JSON_PROPERTY_OPERATOR_I_D = "OperatorID"; + private String operatorID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperatorID = false; + + public static final String JSON_PROPERTY_SHIFT_NUMBER = "ShiftNumber"; + private String shiftNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShiftNumber = false; + + public static final String JSON_PROPERTY_TOTALS_GROUP_I_D = "TotalsGroupID"; + private String totalsGroupID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroupID = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TotalFilter() {} + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * @return the current {@code TotalFilter} instance, allowing for method chaining + */ + public TotalFilter POIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + return this; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * + * @return POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPOIID() { + return POIID; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPOIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * @return the current {@code TotalFilter} instance, allowing for method chaining + */ + public TotalFilter saleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + return this; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * + * @return saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleID() { + return saleID; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + } + + /** + * Identification of the Cashier or Operator. + * + * @param operatorID Identification of the Cashier or Operator. + * @return the current {@code TotalFilter} instance, allowing for method chaining + */ + public TotalFilter operatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + return this; + } + + /** + * Identification of the Cashier or Operator. + * + * @return operatorID Identification of the Cashier or Operator. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatorID() { + return operatorID; + } + + /** + * Identification of the Cashier or Operator. + * + * @param operatorID Identification of the Cashier or Operator. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + } + + /** + * Shift number. + * + * @param shiftNumber Shift number. + * @return the current {@code TotalFilter} instance, allowing for method chaining + */ + public TotalFilter shiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + return this; + } + + /** + * Shift number. + * + * @return shiftNumber Shift number. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Shift number. + * + * @param shiftNumber Shift number. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + } + + /** + * Sent if totals in the response have to be computed only for this particular value of + * TotalsGroupID. + * + * @param totalsGroupID Sent if totals in the response have to be computed only for this + * particular value of TotalsGroupID. + * @return the current {@code TotalFilter} instance, allowing for method chaining + */ + public TotalFilter totalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + isSetTotalsGroupID = true; // mark as set + return this; + } + + /** + * Sent if totals in the response have to be computed only for this particular value of + * TotalsGroupID. + * + * @return totalsGroupID Sent if totals in the response have to be computed only for this + * particular value of TotalsGroupID. + */ + @JsonProperty(JSON_PROPERTY_TOTALS_GROUP_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTotalsGroupID() { + return totalsGroupID; + } + + /** + * Sent if totals in the response have to be computed only for this particular value of + * TotalsGroupID. + * + * @param totalsGroupID Sent if totals in the response have to be computed only for this + * particular value of TotalsGroupID. + */ + @JsonProperty(JSON_PROPERTY_TOTALS_GROUP_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + isSetTotalsGroupID = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TotalFilter includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TotalFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TotalFilter totalFilter = (TotalFilter) o; + return Objects.equals(this.POIID, totalFilter.POIID) + && Objects.equals(this.isSetPOIID, totalFilter.isSetPOIID) + && Objects.equals(this.saleID, totalFilter.saleID) + && Objects.equals(this.isSetSaleID, totalFilter.isSetSaleID) + && Objects.equals(this.operatorID, totalFilter.operatorID) + && Objects.equals(this.isSetOperatorID, totalFilter.isSetOperatorID) + && Objects.equals(this.shiftNumber, totalFilter.shiftNumber) + && Objects.equals(this.isSetShiftNumber, totalFilter.isSetShiftNumber) + && Objects.equals(this.totalsGroupID, totalFilter.totalsGroupID) + && Objects.equals(this.isSetTotalsGroupID, totalFilter.isSetTotalsGroupID); + } + + @Override + public int hashCode() { + return Objects.hash( + POIID, + isSetPOIID, + saleID, + isSetSaleID, + operatorID, + isSetOperatorID, + shiftNumber, + isSetShiftNumber, + totalsGroupID, + isSetTotalsGroupID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TotalFilter {\n"); + sb.append(" POIID: ").append(toIndentedString(POIID)).append("\n"); + sb.append(" saleID: ").append(toIndentedString(saleID)).append("\n"); + sb.append(" operatorID: ").append(toIndentedString(operatorID)).append("\n"); + sb.append(" shiftNumber: ").append(toIndentedString(shiftNumber)).append("\n"); + sb.append(" totalsGroupID: ").append(toIndentedString(totalsGroupID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPOIID) { + addIfNull(nulls, JSON_PROPERTY_P_O_I_I_D, this.POIID); + } + if (isSetSaleID) { + addIfNull(nulls, JSON_PROPERTY_SALE_I_D, this.saleID); + } + if (isSetOperatorID) { + addIfNull(nulls, JSON_PROPERTY_OPERATOR_I_D, this.operatorID); + } + if (isSetShiftNumber) { + addIfNull(nulls, JSON_PROPERTY_SHIFT_NUMBER, this.shiftNumber); + } + if (isSetTotalsGroupID) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP_I_D, this.totalsGroupID); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TotalFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of TotalFilter + * @throws JsonProcessingException if the JSON string is invalid with respect to TotalFilter + */ + public static TotalFilter fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TotalFilter.class); + } + + /** + * Convert an instance of TotalFilter to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TrackData.java b/src/main/java/com/adyen/model/tapi/TrackData.java new file mode 100644 index 000000000..888bdc118 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TrackData.java @@ -0,0 +1,279 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Magnetic track or magnetic ink characters line. ISO 7813 - ISO 4909. Generic data structure for a + * card track, used when the magstripe card reader is located on the Sale Terminal, or for magstripe + * Card Reader device request. The data structure is also used to store the line at the bottom of a + * bank check. + */ +@JsonPropertyOrder({ + TrackData.JSON_PROPERTY_TRACK_NUMB, + TrackData.JSON_PROPERTY_TRACK_FORMAT, + TrackData.JSON_PROPERTY_TRACK_VALUE +}) +public class TrackData { + public static final String JSON_PROPERTY_TRACK_NUMB = "TrackNumb"; + private Integer trackNumb; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackNumb = false; + + public static final String JSON_PROPERTY_TRACK_FORMAT = "TrackFormat"; + private TrackFormatType trackFormat; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackFormat = false; + + public static final String JSON_PROPERTY_TRACK_VALUE = "TrackValue"; + private String trackValue; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TrackData() {} + + /** + * Card track number. + * + * @param trackNumb Card track number. + * @return the current {@code TrackData} instance, allowing for method chaining + */ + public TrackData trackNumb(Integer trackNumb) { + this.trackNumb = trackNumb; + isSetTrackNumb = true; // mark as set + return this; + } + + /** + * Card track number. minimum: 1 maximum: 3 + * + * @return trackNumb Card track number. + */ + @JsonProperty(JSON_PROPERTY_TRACK_NUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTrackNumb() { + return trackNumb; + } + + /** + * Card track number. + * + * @param trackNumb Card track number. + */ + @JsonProperty(JSON_PROPERTY_TRACK_NUMB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrackNumb(Integer trackNumb) { + this.trackNumb = trackNumb; + isSetTrackNumb = true; // mark as set + } + + /** + * Card track format. Possible values: * **AAMVA** * **ISO** + * + * @param trackFormat Card track format. Possible values: * **AAMVA** * **ISO** + * @return the current {@code TrackData} instance, allowing for method chaining + */ + public TrackData trackFormat(TrackFormatType trackFormat) { + this.trackFormat = trackFormat; + isSetTrackFormat = true; // mark as set + return this; + } + + /** + * Card track format. Possible values: * **AAMVA** * **ISO** + * + * @return trackFormat Card track format. Possible values: * **AAMVA** * **ISO** + */ + @JsonProperty(JSON_PROPERTY_TRACK_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TrackFormatType getTrackFormat() { + return trackFormat; + } + + /** + * Card track format. Possible values: * **AAMVA** * **ISO** + * + * @param trackFormat Card track format. Possible values: * **AAMVA** * **ISO** + */ + @JsonProperty(JSON_PROPERTY_TRACK_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrackFormat(TrackFormatType trackFormat) { + this.trackFormat = trackFormat; + isSetTrackFormat = true; // mark as set + } + + /** + * Card track content. + * + * @param trackValue Card track content. + * @return the current {@code TrackData} instance, allowing for method chaining + */ + public TrackData trackValue(String trackValue) { + this.trackValue = trackValue; + isSetTrackValue = true; // mark as set + return this; + } + + /** + * Card track content. + * + * @return trackValue Card track content. + */ + @JsonProperty(JSON_PROPERTY_TRACK_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTrackValue() { + return trackValue; + } + + /** + * Card track content. + * + * @param trackValue Card track content. + */ + @JsonProperty(JSON_PROPERTY_TRACK_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrackValue(String trackValue) { + this.trackValue = trackValue; + isSetTrackValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TrackData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TrackData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackData trackData = (TrackData) o; + return Objects.equals(this.trackNumb, trackData.trackNumb) + && Objects.equals(this.isSetTrackNumb, trackData.isSetTrackNumb) + && Objects.equals(this.trackFormat, trackData.trackFormat) + && Objects.equals(this.isSetTrackFormat, trackData.isSetTrackFormat) + && Objects.equals(this.trackValue, trackData.trackValue) + && Objects.equals(this.isSetTrackValue, trackData.isSetTrackValue); + } + + @Override + public int hashCode() { + return Objects.hash( + trackNumb, isSetTrackNumb, trackFormat, isSetTrackFormat, trackValue, isSetTrackValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackData {\n"); + sb.append(" trackNumb: ").append(toIndentedString(trackNumb)).append("\n"); + sb.append(" trackFormat: ").append(toIndentedString(trackFormat)).append("\n"); + sb.append(" trackValue: ").append(toIndentedString(trackValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTrackNumb) { + addIfNull(nulls, JSON_PROPERTY_TRACK_NUMB, this.trackNumb); + } + if (isSetTrackFormat) { + addIfNull(nulls, JSON_PROPERTY_TRACK_FORMAT, this.trackFormat); + } + if (isSetTrackValue) { + addIfNull(nulls, JSON_PROPERTY_TRACK_VALUE, this.trackValue); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TrackData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackData + * @throws JsonProcessingException if the JSON string is invalid with respect to TrackData + */ + public static TrackData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TrackData.class); + } + + /** + * Convert an instance of TrackData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TrackFormatType.java b/src/main/java/com/adyen/model/tapi/TrackFormatType.java new file mode 100644 index 000000000..9e9884896 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TrackFormatType.java @@ -0,0 +1,49 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Magnetic track or magnetic ink characters line. Possible values: * **AAMVA** * **ISO** */ +public enum TrackFormatType { + AAMVA("AAMVA"), + + ISO("ISO"); + + private String value; + + TrackFormatType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TrackFormatType fromValue(String value) { + for (TrackFormatType b : TrackFormatType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionActionType.java b/src/main/java/com/adyen/model/tapi/TransactionActionType.java new file mode 100644 index 000000000..c3fc01073 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionActionType.java @@ -0,0 +1,55 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** + * Action to realise on a transaction. In an `EnableService` request message: - Starts a + * transaction by a swipe-ahead mechanism, with the services which are enabled. - Aborts a + * swipe-ahead transaction or started by a `CardAcquisition`, and not followed by a + * service request from the Sale System to complete the transaction. Possible values: * + * **AbortTransaction** * **StartTransaction** + */ +public enum TransactionActionType { + ABORT_TRANSACTION("AbortTransaction"), + + START_TRANSACTION("StartTransaction"); + + private String value; + + TransactionActionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TransactionActionType fromValue(String value) { + for (TransactionActionType b : TransactionActionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionConditions.java b/src/main/java/com/adyen/model/tapi/TransactionConditions.java new file mode 100644 index 000000000..b83bbd6c8 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionConditions.java @@ -0,0 +1,735 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** Conditions on which the transaction must be processed. */ +@JsonPropertyOrder({ + TransactionConditions.JSON_PROPERTY_ALLOWED_PAYMENT_BRAND, + TransactionConditions.JSON_PROPERTY_ACQUIRER_I_D, + TransactionConditions.JSON_PROPERTY_DEBIT_PREFERRED_FLAG, + TransactionConditions.JSON_PROPERTY_ALLOWED_LOYALTY_BRAND, + TransactionConditions.JSON_PROPERTY_LOYALTY_HANDLING, + TransactionConditions.JSON_PROPERTY_CUSTOMER_LANGUAGE, + TransactionConditions.JSON_PROPERTY_FORCE_ONLINE_FLAG, + TransactionConditions.JSON_PROPERTY_FORCE_ENTRY_MODE, + TransactionConditions.JSON_PROPERTY_MERCHANT_CATEGORY_CODE +}) +public class TransactionConditions { + public static final String JSON_PROPERTY_ALLOWED_PAYMENT_BRAND = "AllowedPaymentBrand"; + private List allowedPaymentBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentBrand = false; + + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private List acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + public static final String JSON_PROPERTY_DEBIT_PREFERRED_FLAG = "DebitPreferredFlag"; + private Boolean debitPreferredFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDebitPreferredFlag = false; + + public static final String JSON_PROPERTY_ALLOWED_LOYALTY_BRAND = "AllowedLoyaltyBrand"; + private List allowedLoyaltyBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLoyaltyBrand = false; + + public static final String JSON_PROPERTY_LOYALTY_HANDLING = "LoyaltyHandling"; + private LoyaltyHandlingType loyaltyHandling; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoyaltyHandling = false; + + public static final String JSON_PROPERTY_CUSTOMER_LANGUAGE = "CustomerLanguage"; + private String customerLanguage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerLanguage = false; + + public static final String JSON_PROPERTY_FORCE_ONLINE_FLAG = "ForceOnlineFlag"; + private Boolean forceOnlineFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetForceOnlineFlag = false; + + /** Gets or Sets forceEntryMode */ + public enum ForceEntryModeEnum { + CHECK_READER(String.valueOf("CheckReader")), + + CONTACTLESS(String.valueOf("Contactless")), + + FILE(String.valueOf("File")), + + ICC(String.valueOf("ICC")), + + KEYED(String.valueOf("Keyed")), + + MAG_STRIPE(String.valueOf("MagStripe")), + + MANUAL(String.valueOf("Manual")), + + RFID(String.valueOf("RFID")), + + SCANNED(String.valueOf("Scanned")), + + SYNCHRONOUS_ICC(String.valueOf("SynchronousICC")), + + TAPPED(String.valueOf("Tapped")); + + private static final Logger LOG = Logger.getLogger(ForceEntryModeEnum.class.getName()); + + private String value; + + ForceEntryModeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ForceEntryModeEnum fromValue(String value) { + for (ForceEntryModeEnum b : ForceEntryModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "ForceEntryModeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ForceEntryModeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_FORCE_ENTRY_MODE = "ForceEntryMode"; + private List forceEntryMode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetForceEntryMode = false; + + public static final String JSON_PROPERTY_MERCHANT_CATEGORY_CODE = "MerchantCategoryCode"; + private String merchantCategoryCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantCategoryCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TransactionConditions() {} + + /** + * Payment brands accepted for this transaction. Card payment brands allowed by the Sale System + * for the payment transaction. Restrict brand if data sent. + * + * @param allowedPaymentBrand Payment brands accepted for this transaction. Card payment brands + * allowed by the Sale System for the payment transaction. Restrict brand if data sent. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions allowedPaymentBrand(List allowedPaymentBrand) { + this.allowedPaymentBrand = allowedPaymentBrand; + isSetAllowedPaymentBrand = true; // mark as set + return this; + } + + public TransactionConditions addAllowedPaymentBrandItem(String allowedPaymentBrandItem) { + if (this.allowedPaymentBrand == null) { + this.allowedPaymentBrand = new ArrayList<>(); + } + this.allowedPaymentBrand.add(allowedPaymentBrandItem); + return this; + } + + /** + * Payment brands accepted for this transaction. Card payment brands allowed by the Sale System + * for the payment transaction. Restrict brand if data sent. + * + * @return allowedPaymentBrand Payment brands accepted for this transaction. Card payment brands + * allowed by the Sale System for the payment transaction. Restrict brand if data sent. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowedPaymentBrand() { + return allowedPaymentBrand; + } + + /** + * Payment brands accepted for this transaction. Card payment brands allowed by the Sale System + * for the payment transaction. Restrict brand if data sent. + * + * @param allowedPaymentBrand Payment brands accepted for this transaction. Card payment brands + * allowed by the Sale System for the payment transaction. Restrict brand if data sent. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_PAYMENT_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedPaymentBrand(List allowedPaymentBrand) { + this.allowedPaymentBrand = allowedPaymentBrand; + isSetAllowedPaymentBrand = true; // mark as set + } + + /** + * Identification of the Acquirer. Restrict to these Acquirer if present. + * + * @param acquirerID Identification of the Acquirer. Restrict to these Acquirer if present. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions acquirerID(List acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + public TransactionConditions addAcquirerIDItem(Integer acquirerIDItem) { + if (this.acquirerID == null) { + this.acquirerID = new ArrayList<>(); + } + this.acquirerID.add(acquirerIDItem); + return this; + } + + /** + * Identification of the Acquirer. Restrict to these Acquirer if present. + * + * @return acquirerID Identification of the Acquirer. Restrict to these Acquirer if present. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. Restrict to these Acquirer if present. + * + * @param acquirerID Identification of the Acquirer. Restrict to these Acquirer if present. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(List acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * The preferred type of payment is a debit transaction rather than a credit transaction. + * + * @param debitPreferredFlag The preferred type of payment is a debit transaction rather than a + * credit transaction. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions debitPreferredFlag(Boolean debitPreferredFlag) { + this.debitPreferredFlag = debitPreferredFlag; + isSetDebitPreferredFlag = true; // mark as set + return this; + } + + /** + * The preferred type of payment is a debit transaction rather than a credit transaction. + * + * @return debitPreferredFlag The preferred type of payment is a debit transaction rather than a + * credit transaction. + */ + @JsonProperty(JSON_PROPERTY_DEBIT_PREFERRED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDebitPreferredFlag() { + return debitPreferredFlag; + } + + /** + * The preferred type of payment is a debit transaction rather than a credit transaction. + * + * @param debitPreferredFlag The preferred type of payment is a debit transaction rather than a + * credit transaction. + */ + @JsonProperty(JSON_PROPERTY_DEBIT_PREFERRED_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDebitPreferredFlag(Boolean debitPreferredFlag) { + this.debitPreferredFlag = debitPreferredFlag; + isSetDebitPreferredFlag = true; // mark as set + } + + /** + * Loyalty brands or programs allowed by the Sale System for the loyalty transaction. Restrict + * brand if data sent. + * + * @param allowedLoyaltyBrand Loyalty brands or programs allowed by the Sale System for the + * loyalty transaction. Restrict brand if data sent. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions allowedLoyaltyBrand(List allowedLoyaltyBrand) { + this.allowedLoyaltyBrand = allowedLoyaltyBrand; + isSetAllowedLoyaltyBrand = true; // mark as set + return this; + } + + public TransactionConditions addAllowedLoyaltyBrandItem(String allowedLoyaltyBrandItem) { + if (this.allowedLoyaltyBrand == null) { + this.allowedLoyaltyBrand = new ArrayList<>(); + } + this.allowedLoyaltyBrand.add(allowedLoyaltyBrandItem); + return this; + } + + /** + * Loyalty brands or programs allowed by the Sale System for the loyalty transaction. Restrict + * brand if data sent. + * + * @return allowedLoyaltyBrand Loyalty brands or programs allowed by the Sale System for the + * loyalty transaction. Restrict brand if data sent. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_LOYALTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAllowedLoyaltyBrand() { + return allowedLoyaltyBrand; + } + + /** + * Loyalty brands or programs allowed by the Sale System for the loyalty transaction. Restrict + * brand if data sent. + * + * @param allowedLoyaltyBrand Loyalty brands or programs allowed by the Sale System for the + * loyalty transaction. Restrict brand if data sent. + */ + @JsonProperty(JSON_PROPERTY_ALLOWED_LOYALTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedLoyaltyBrand(List allowedLoyaltyBrand) { + this.allowedLoyaltyBrand = allowedLoyaltyBrand; + isSetAllowedLoyaltyBrand = true; // mark as set + } + + /** + * Type of Loyalty processing requested by the Sale System. Possible values: * **Allowed** * + * **Forbidden** * **Processed** * **Proposed** * **Required** + * + * @param loyaltyHandling Type of Loyalty processing requested by the Sale System. Possible + * values: * **Allowed** * **Forbidden** * **Processed** * **Proposed** * **Required** + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions loyaltyHandling(LoyaltyHandlingType loyaltyHandling) { + this.loyaltyHandling = loyaltyHandling; + isSetLoyaltyHandling = true; // mark as set + return this; + } + + /** + * Type of Loyalty processing requested by the Sale System. Possible values: * **Allowed** * + * **Forbidden** * **Processed** * **Proposed** * **Required** + * + * @return loyaltyHandling Type of Loyalty processing requested by the Sale System. Possible + * values: * **Allowed** * **Forbidden** * **Processed** * **Proposed** * **Required** + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_HANDLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LoyaltyHandlingType getLoyaltyHandling() { + return loyaltyHandling; + } + + /** + * Type of Loyalty processing requested by the Sale System. Possible values: * **Allowed** * + * **Forbidden** * **Processed** * **Proposed** * **Required** + * + * @param loyaltyHandling Type of Loyalty processing requested by the Sale System. Possible + * values: * **Allowed** * **Forbidden** * **Processed** * **Proposed** * **Required** + */ + @JsonProperty(JSON_PROPERTY_LOYALTY_HANDLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLoyaltyHandling(LoyaltyHandlingType loyaltyHandling) { + this.loyaltyHandling = loyaltyHandling; + isSetLoyaltyHandling = true; // mark as set + } + + /** + * The language used on the terminal screen or in text printed by the terminal. Typical use case + * is setting the language on unattended terminals. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @param customerLanguage The language used on the terminal screen or in text printed by the + * terminal. Typical use case is setting the language on unattended terminals. Format: + * two-character [ISO 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) + * format. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions customerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + isSetCustomerLanguage = true; // mark as set + return this; + } + + /** + * The language used on the terminal screen or in text printed by the terminal. Typical use case + * is setting the language on unattended terminals. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @return customerLanguage The language used on the terminal screen or in text printed by the + * terminal. Typical use case is setting the language on unattended terminals. Format: + * two-character [ISO 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) + * format. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * The language used on the terminal screen or in text printed by the terminal. Typical use case + * is setting the language on unattended terminals. Format: two-character [ISO + * 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. + * + * @param customerLanguage The language used on the terminal screen or in text printed by the + * terminal. Typical use case is setting the language on unattended terminals. Format: + * two-character [ISO 639:2023](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) + * format. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + isSetCustomerLanguage = true; // mark as set + } + + /** + * Indicates if the Cashier requires POI forces online access to the Acquirer. Go online if data + * sent. + * + * @param forceOnlineFlag Indicates if the Cashier requires POI forces online access to the + * Acquirer. Go online if data sent. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions forceOnlineFlag(Boolean forceOnlineFlag) { + this.forceOnlineFlag = forceOnlineFlag; + isSetForceOnlineFlag = true; // mark as set + return this; + } + + /** + * Indicates if the Cashier requires POI forces online access to the Acquirer. Go online if data + * sent. + * + * @return forceOnlineFlag Indicates if the Cashier requires POI forces online access to the + * Acquirer. Go online if data sent. + */ + @JsonProperty(JSON_PROPERTY_FORCE_ONLINE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceOnlineFlag() { + return forceOnlineFlag; + } + + /** + * Indicates if the Cashier requires POI forces online access to the Acquirer. Go online if data + * sent. + * + * @param forceOnlineFlag Indicates if the Cashier requires POI forces online access to the + * Acquirer. Go online if data sent. + */ + @JsonProperty(JSON_PROPERTY_FORCE_ONLINE_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceOnlineFlag(Boolean forceOnlineFlag) { + this.forceOnlineFlag = forceOnlineFlag; + isSetForceOnlineFlag = true; // mark as set + } + + /** + * forceEntryMode + * + * @param forceEntryMode + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions forceEntryMode(List forceEntryMode) { + this.forceEntryMode = forceEntryMode; + isSetForceEntryMode = true; // mark as set + return this; + } + + public TransactionConditions addForceEntryModeItem(ForceEntryModeEnum forceEntryModeItem) { + if (this.forceEntryMode == null) { + this.forceEntryMode = new ArrayList<>(); + } + this.forceEntryMode.add(forceEntryModeItem); + return this; + } + + /** + * Get forceEntryMode + * + * @return forceEntryMode + */ + @JsonProperty(JSON_PROPERTY_FORCE_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getForceEntryMode() { + return forceEntryMode; + } + + /** + * forceEntryMode + * + * @param forceEntryMode + */ + @JsonProperty(JSON_PROPERTY_FORCE_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceEntryMode(List forceEntryMode) { + this.forceEntryMode = forceEntryMode; + isSetForceEntryMode = true; // mark as set + } + + /** + * The code which identifies the category of the transaction (MCC). The payment implies a specific + * MCC. + * + * @param merchantCategoryCode The code which identifies the category of the transaction (MCC). + * The payment implies a specific MCC. + * @return the current {@code TransactionConditions} instance, allowing for method chaining + */ + public TransactionConditions merchantCategoryCode(String merchantCategoryCode) { + this.merchantCategoryCode = merchantCategoryCode; + isSetMerchantCategoryCode = true; // mark as set + return this; + } + + /** + * The code which identifies the category of the transaction (MCC). The payment implies a specific + * MCC. + * + * @return merchantCategoryCode The code which identifies the category of the transaction (MCC). + * The payment implies a specific MCC. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_CATEGORY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantCategoryCode() { + return merchantCategoryCode; + } + + /** + * The code which identifies the category of the transaction (MCC). The payment implies a specific + * MCC. + * + * @param merchantCategoryCode The code which identifies the category of the transaction (MCC). + * The payment implies a specific MCC. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_CATEGORY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantCategoryCode(String merchantCategoryCode) { + this.merchantCategoryCode = merchantCategoryCode; + isSetMerchantCategoryCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionConditions includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TransactionConditions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionConditions transactionConditions = (TransactionConditions) o; + return Objects.equals(this.allowedPaymentBrand, transactionConditions.allowedPaymentBrand) + && Objects.equals( + this.isSetAllowedPaymentBrand, transactionConditions.isSetAllowedPaymentBrand) + && Objects.equals(this.acquirerID, transactionConditions.acquirerID) + && Objects.equals(this.isSetAcquirerID, transactionConditions.isSetAcquirerID) + && Objects.equals(this.debitPreferredFlag, transactionConditions.debitPreferredFlag) + && Objects.equals( + this.isSetDebitPreferredFlag, transactionConditions.isSetDebitPreferredFlag) + && Objects.equals(this.allowedLoyaltyBrand, transactionConditions.allowedLoyaltyBrand) + && Objects.equals( + this.isSetAllowedLoyaltyBrand, transactionConditions.isSetAllowedLoyaltyBrand) + && Objects.equals(this.loyaltyHandling, transactionConditions.loyaltyHandling) + && Objects.equals(this.isSetLoyaltyHandling, transactionConditions.isSetLoyaltyHandling) + && Objects.equals(this.customerLanguage, transactionConditions.customerLanguage) + && Objects.equals(this.isSetCustomerLanguage, transactionConditions.isSetCustomerLanguage) + && Objects.equals(this.forceOnlineFlag, transactionConditions.forceOnlineFlag) + && Objects.equals(this.isSetForceOnlineFlag, transactionConditions.isSetForceOnlineFlag) + && Objects.equals(this.forceEntryMode, transactionConditions.forceEntryMode) + && Objects.equals(this.isSetForceEntryMode, transactionConditions.isSetForceEntryMode) + && Objects.equals(this.merchantCategoryCode, transactionConditions.merchantCategoryCode) + && Objects.equals( + this.isSetMerchantCategoryCode, transactionConditions.isSetMerchantCategoryCode); + } + + @Override + public int hashCode() { + return Objects.hash( + allowedPaymentBrand, + isSetAllowedPaymentBrand, + acquirerID, + isSetAcquirerID, + debitPreferredFlag, + isSetDebitPreferredFlag, + allowedLoyaltyBrand, + isSetAllowedLoyaltyBrand, + loyaltyHandling, + isSetLoyaltyHandling, + customerLanguage, + isSetCustomerLanguage, + forceOnlineFlag, + isSetForceOnlineFlag, + forceEntryMode, + isSetForceEntryMode, + merchantCategoryCode, + isSetMerchantCategoryCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionConditions {\n"); + sb.append(" allowedPaymentBrand: ") + .append(toIndentedString(allowedPaymentBrand)) + .append("\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append(" debitPreferredFlag: ").append(toIndentedString(debitPreferredFlag)).append("\n"); + sb.append(" allowedLoyaltyBrand: ") + .append(toIndentedString(allowedLoyaltyBrand)) + .append("\n"); + sb.append(" loyaltyHandling: ").append(toIndentedString(loyaltyHandling)).append("\n"); + sb.append(" customerLanguage: ").append(toIndentedString(customerLanguage)).append("\n"); + sb.append(" forceOnlineFlag: ").append(toIndentedString(forceOnlineFlag)).append("\n"); + sb.append(" forceEntryMode: ").append(toIndentedString(forceEntryMode)).append("\n"); + sb.append(" merchantCategoryCode: ") + .append(toIndentedString(merchantCategoryCode)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowedPaymentBrand) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_BRAND, this.allowedPaymentBrand); + } + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + if (isSetDebitPreferredFlag) { + addIfNull(nulls, JSON_PROPERTY_DEBIT_PREFERRED_FLAG, this.debitPreferredFlag); + } + if (isSetAllowedLoyaltyBrand) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LOYALTY_BRAND, this.allowedLoyaltyBrand); + } + if (isSetLoyaltyHandling) { + addIfNull(nulls, JSON_PROPERTY_LOYALTY_HANDLING, this.loyaltyHandling); + } + if (isSetCustomerLanguage) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_LANGUAGE, this.customerLanguage); + } + if (isSetForceOnlineFlag) { + addIfNull(nulls, JSON_PROPERTY_FORCE_ONLINE_FLAG, this.forceOnlineFlag); + } + if (isSetForceEntryMode) { + addIfNull(nulls, JSON_PROPERTY_FORCE_ENTRY_MODE, this.forceEntryMode); + } + if (isSetMerchantCategoryCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_CATEGORY_CODE, this.merchantCategoryCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TransactionConditions given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionConditions + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionConditions + */ + public static TransactionConditions fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionConditions.class); + } + + /** + * Convert an instance of TransactionConditions to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionIdentification.java b/src/main/java/com/adyen/model/tapi/TransactionIdentification.java new file mode 100644 index 000000000..74f0fc8fe --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionIdentification.java @@ -0,0 +1,248 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; + +/** Identification of a transaction for the Sale System or the POI System. */ +@JsonPropertyOrder({ + TransactionIdentification.JSON_PROPERTY_TRANSACTION_I_D, + TransactionIdentification.JSON_PROPERTY_TIME_STAMP +}) +@JsonTypeName("TransactionIDType") +public class TransactionIdentification { + public static final String JSON_PROPERTY_TRANSACTION_I_D = "TransactionID"; + private String transactionID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionID = false; + + public static final String JSON_PROPERTY_TIME_STAMP = "TimeStamp"; + private OffsetDateTime timeStamp; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeStamp = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TransactionIdentification() {} + + /** + * Unique identification of a transaction to identify the transaction on the Sale System (e.g. + * ticket number), or the POI System. + * + * @param transactionID Unique identification of a transaction to identify the transaction on the + * Sale System (e.g. ticket number), or the POI System. + * @return the current {@code TransactionIdentification} instance, allowing for method chaining + */ + public TransactionIdentification transactionID(String transactionID) { + this.transactionID = transactionID; + isSetTransactionID = true; // mark as set + return this; + } + + /** + * Unique identification of a transaction to identify the transaction on the Sale System (e.g. + * ticket number), or the POI System. + * + * @return transactionID Unique identification of a transaction to identify the transaction on the + * Sale System (e.g. ticket number), or the POI System. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransactionID() { + return transactionID; + } + + /** + * Unique identification of a transaction to identify the transaction on the Sale System (e.g. + * ticket number), or the POI System. + * + * @param transactionID Unique identification of a transaction to identify the transaction on the + * Sale System (e.g. ticket number), or the POI System. + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionID(String transactionID) { + this.transactionID = transactionID; + isSetTransactionID = true; // mark as set + } + + /** + * Date and time of a transaction for the Sale System, the POI System or the Acquirer. Ensures the + * uniqueness of a transaction and indicates the time when the event occurs in the + * EventNotification message. + * + * @param timeStamp Date and time of a transaction for the Sale System, the POI System or the + * Acquirer. Ensures the uniqueness of a transaction and indicates the time when the event + * occurs in the EventNotification message. + * @return the current {@code TransactionIdentification} instance, allowing for method chaining + */ + public TransactionIdentification timeStamp(OffsetDateTime timeStamp) { + this.timeStamp = timeStamp; + isSetTimeStamp = true; // mark as set + return this; + } + + /** + * Date and time of a transaction for the Sale System, the POI System or the Acquirer. Ensures the + * uniqueness of a transaction and indicates the time when the event occurs in the + * EventNotification message. + * + * @return timeStamp Date and time of a transaction for the Sale System, the POI System or the + * Acquirer. Ensures the uniqueness of a transaction and indicates the time when the event + * occurs in the EventNotification message. + */ + @JsonProperty(JSON_PROPERTY_TIME_STAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getTimeStamp() { + return timeStamp; + } + + /** + * Date and time of a transaction for the Sale System, the POI System or the Acquirer. Ensures the + * uniqueness of a transaction and indicates the time when the event occurs in the + * EventNotification message. + * + * @param timeStamp Date and time of a transaction for the Sale System, the POI System or the + * Acquirer. Ensures the uniqueness of a transaction and indicates the time when the event + * occurs in the EventNotification message. + */ + @JsonProperty(JSON_PROPERTY_TIME_STAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeStamp(OffsetDateTime timeStamp) { + this.timeStamp = timeStamp; + isSetTimeStamp = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TransactionIDType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionIdentification transactionIDType = (TransactionIdentification) o; + return Objects.equals(this.transactionID, transactionIDType.transactionID) + && Objects.equals(this.isSetTransactionID, transactionIDType.isSetTransactionID) + && Objects.equals(this.timeStamp, transactionIDType.timeStamp) + && Objects.equals(this.isSetTimeStamp, transactionIDType.isSetTimeStamp); + } + + @Override + public int hashCode() { + return Objects.hash(transactionID, isSetTransactionID, timeStamp, isSetTimeStamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionIdentification {\n"); + sb.append(" transactionID: ").append(toIndentedString(transactionID)).append("\n"); + sb.append(" timeStamp: ").append(toIndentedString(timeStamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransactionID) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_I_D, this.transactionID); + } + if (isSetTimeStamp) { + addIfNull(nulls, JSON_PROPERTY_TIME_STAMP, this.timeStamp); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TransactionIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionIdentification + */ + public static TransactionIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionIdentification.class); + } + + /** + * Convert an instance of TransactionIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionStatusRequest.java b/src/main/java/com/adyen/model/tapi/TransactionStatusRequest.java new file mode 100644 index 000000000..76e25444c --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionStatusRequest.java @@ -0,0 +1,328 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * Content of the TransactionStatus Request message. It conveys Information requested for status of + * the last or current Payment, Loyalty or Reversal transaction. + */ +@JsonPropertyOrder({ + TransactionStatusRequest.JSON_PROPERTY_MESSAGE_REFERENCE, + TransactionStatusRequest.JSON_PROPERTY_RECEIPT_REPRINT_FLAG, + TransactionStatusRequest.JSON_PROPERTY_DOCUMENT_QUALIFIER +}) +public class TransactionStatusRequest { + public static final String JSON_PROPERTY_MESSAGE_REFERENCE = "MessageReference"; + private MessageReference messageReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageReference = false; + + public static final String JSON_PROPERTY_RECEIPT_REPRINT_FLAG = "ReceiptReprintFlag"; + private Boolean receiptReprintFlag; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceiptReprintFlag = false; + + public static final String JSON_PROPERTY_DOCUMENT_QUALIFIER = "DocumentQualifier"; + private List documentQualifier; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentQualifier = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TransactionStatusRequest() {} + + /** + * Identification of a previous POI transaction. Present if it contains any data. + * + * @param messageReference Identification of a previous POI transaction. Present if it contains + * any data. + * @return the current {@code TransactionStatusRequest} instance, allowing for method chaining + */ + public TransactionStatusRequest messageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + return this; + } + + /** + * Identification of a previous POI transaction. Present if it contains any data. + * + * @return messageReference Identification of a previous POI transaction. Present if it contains + * any data. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Identification of a previous POI transaction. Present if it contains any data. + * + * @param messageReference Identification of a previous POI transaction. Present if it contains + * any data. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + } + + /** + * Request to reprint the POI receipt(s). Allows reprinting a receipt with a + * `TransactionStatus` message + * + * @param receiptReprintFlag Request to reprint the POI receipt(s). Allows reprinting a receipt + * with a `TransactionStatus` message + * @return the current {@code TransactionStatusRequest} instance, allowing for method chaining + */ + public TransactionStatusRequest receiptReprintFlag(Boolean receiptReprintFlag) { + this.receiptReprintFlag = receiptReprintFlag; + isSetReceiptReprintFlag = true; // mark as set + return this; + } + + /** + * Request to reprint the POI receipt(s). Allows reprinting a receipt with a + * `TransactionStatus` message + * + * @return receiptReprintFlag Request to reprint the POI receipt(s). Allows reprinting a receipt + * with a `TransactionStatus` message + */ + @JsonProperty(JSON_PROPERTY_RECEIPT_REPRINT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getReceiptReprintFlag() { + return receiptReprintFlag; + } + + /** + * Request to reprint the POI receipt(s). Allows reprinting a receipt with a + * `TransactionStatus` message + * + * @param receiptReprintFlag Request to reprint the POI receipt(s). Allows reprinting a receipt + * with a `TransactionStatus` message + */ + @JsonProperty(JSON_PROPERTY_RECEIPT_REPRINT_FLAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReceiptReprintFlag(Boolean receiptReprintFlag) { + this.receiptReprintFlag = receiptReprintFlag; + isSetReceiptReprintFlag = true; // mark as set + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send the information to a particular physical printer or + * to use the paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** + * * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * Allows the manager of the printer, Sale or POI Terminal, to send the information to a + * particular physical printer or to use the paper type accordingly. Possible values: * + * **CashierReceipt** * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * + * **Voucher** + * @return the current {@code TransactionStatusRequest} instance, allowing for method chaining + */ + public TransactionStatusRequest documentQualifier(List documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + return this; + } + + public TransactionStatusRequest addDocumentQualifierItem( + DocumentQualifierType documentQualifierItem) { + if (this.documentQualifier == null) { + this.documentQualifier = new ArrayList<>(); + } + this.documentQualifier.add(documentQualifierItem); + return this; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send the information to a particular physical printer or + * to use the paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** + * * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @return documentQualifier Qualification of the document to print to the Cashier or the + * Customer. Allows the manager of the printer, Sale or POI Terminal, to send the information + * to a particular physical printer or to use the paper type accordingly. Possible values: * + * **CashierReceipt** * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * + * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDocumentQualifier() { + return documentQualifier; + } + + /** + * Qualification of the document to print to the Cashier or the Customer. Allows the manager of + * the printer, Sale or POI Terminal, to send the information to a particular physical printer or + * to use the paper type accordingly. Possible values: * **CashierReceipt** * **CustomerReceipt** + * * **Document** * **Journal** * **SaleReceipt** * **Voucher** + * + * @param documentQualifier Qualification of the document to print to the Cashier or the Customer. + * Allows the manager of the printer, Sale or POI Terminal, to send the information to a + * particular physical printer or to use the paper type accordingly. Possible values: * + * **CashierReceipt** * **CustomerReceipt** * **Document** * **Journal** * **SaleReceipt** * + * **Voucher** + */ + @JsonProperty(JSON_PROPERTY_DOCUMENT_QUALIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentQualifier(List documentQualifier) { + this.documentQualifier = documentQualifier; + isSetDocumentQualifier = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionStatusRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TransactionStatusRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionStatusRequest transactionStatusRequest = (TransactionStatusRequest) o; + return Objects.equals(this.messageReference, transactionStatusRequest.messageReference) + && Objects.equals( + this.isSetMessageReference, transactionStatusRequest.isSetMessageReference) + && Objects.equals(this.receiptReprintFlag, transactionStatusRequest.receiptReprintFlag) + && Objects.equals( + this.isSetReceiptReprintFlag, transactionStatusRequest.isSetReceiptReprintFlag) + && Objects.equals(this.documentQualifier, transactionStatusRequest.documentQualifier) + && Objects.equals( + this.isSetDocumentQualifier, transactionStatusRequest.isSetDocumentQualifier); + } + + @Override + public int hashCode() { + return Objects.hash( + messageReference, + isSetMessageReference, + receiptReprintFlag, + isSetReceiptReprintFlag, + documentQualifier, + isSetDocumentQualifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionStatusRequest {\n"); + sb.append(" messageReference: ").append(toIndentedString(messageReference)).append("\n"); + sb.append(" receiptReprintFlag: ").append(toIndentedString(receiptReprintFlag)).append("\n"); + sb.append(" documentQualifier: ").append(toIndentedString(documentQualifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessageReference) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_REFERENCE, this.messageReference); + } + if (isSetReceiptReprintFlag) { + addIfNull(nulls, JSON_PROPERTY_RECEIPT_REPRINT_FLAG, this.receiptReprintFlag); + } + if (isSetDocumentQualifier) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_QUALIFIER, this.documentQualifier); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TransactionStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionStatusRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionStatusRequest + */ + public static TransactionStatusRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionStatusRequest.class); + } + + /** + * Convert an instance of TransactionStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionStatusResponse.java b/src/main/java/com/adyen/model/tapi/TransactionStatusResponse.java new file mode 100644 index 000000000..57262d106 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionStatusResponse.java @@ -0,0 +1,297 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** + * Content of the TransactionStatus Response message. It conveys Information related to the status + * of the last or current Payment, Loyalty or Reversal transaction. + */ +@JsonPropertyOrder({ + TransactionStatusResponse.JSON_PROPERTY_RESPONSE, + TransactionStatusResponse.JSON_PROPERTY_MESSAGE_REFERENCE, + TransactionStatusResponse.JSON_PROPERTY_REPEATED_MESSAGE_RESPONSE +}) +public class TransactionStatusResponse { + public static final String JSON_PROPERTY_RESPONSE = "Response"; + private Response response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_MESSAGE_REFERENCE = "MessageReference"; + private MessageReference messageReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageReference = false; + + public static final String JSON_PROPERTY_REPEATED_MESSAGE_RESPONSE = "RepeatedMessageResponse"; + private RepeatedMessageResponse repeatedMessageResponse; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepeatedMessageResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TransactionStatusResponse() {} + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + * @return the current {@code TransactionStatusResponse} instance, allowing for method chaining + */ + public TransactionStatusResponse response(Response response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Result of a message request processing. + * + * @return response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Response getResponse() { + return response; + } + + /** + * Result of a message request processing. + * + * @param response Result of a message request processing. + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(Response response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Identification of a previous POI transaction. If `Response.Result` is Success. + * + * @param messageReference Identification of a previous POI transaction. If + * `Response.Result` is Success. + * @return the current {@code TransactionStatusResponse} instance, allowing for method chaining + */ + public TransactionStatusResponse messageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + return this; + } + + /** + * Identification of a previous POI transaction. If `Response.Result` is Success. + * + * @return messageReference Identification of a previous POI transaction. If + * `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Identification of a previous POI transaction. If `Response.Result` is Success. + * + * @param messageReference Identification of a previous POI transaction. If + * `Response.Result` is Success. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessageReference(MessageReference messageReference) { + this.messageReference = messageReference; + isSetMessageReference = true; // mark as set + } + + /** + * Content of the requested Message Response. If Result is Success (process completed). + * + * @param repeatedMessageResponse Content of the requested Message Response. If Result is Success + * (process completed). + * @return the current {@code TransactionStatusResponse} instance, allowing for method chaining + */ + public TransactionStatusResponse repeatedMessageResponse( + RepeatedMessageResponse repeatedMessageResponse) { + this.repeatedMessageResponse = repeatedMessageResponse; + isSetRepeatedMessageResponse = true; // mark as set + return this; + } + + /** + * Content of the requested Message Response. If Result is Success (process completed). + * + * @return repeatedMessageResponse Content of the requested Message Response. If Result is Success + * (process completed). + */ + @JsonProperty(JSON_PROPERTY_REPEATED_MESSAGE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepeatedMessageResponse getRepeatedMessageResponse() { + return repeatedMessageResponse; + } + + /** + * Content of the requested Message Response. If Result is Success (process completed). + * + * @param repeatedMessageResponse Content of the requested Message Response. If Result is Success + * (process completed). + */ + @JsonProperty(JSON_PROPERTY_REPEATED_MESSAGE_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepeatedMessageResponse(RepeatedMessageResponse repeatedMessageResponse) { + this.repeatedMessageResponse = repeatedMessageResponse; + isSetRepeatedMessageResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionStatusResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TransactionStatusResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionStatusResponse transactionStatusResponse = (TransactionStatusResponse) o; + return Objects.equals(this.response, transactionStatusResponse.response) + && Objects.equals(this.isSetResponse, transactionStatusResponse.isSetResponse) + && Objects.equals(this.messageReference, transactionStatusResponse.messageReference) + && Objects.equals( + this.isSetMessageReference, transactionStatusResponse.isSetMessageReference) + && Objects.equals( + this.repeatedMessageResponse, transactionStatusResponse.repeatedMessageResponse) + && Objects.equals( + this.isSetRepeatedMessageResponse, + transactionStatusResponse.isSetRepeatedMessageResponse); + } + + @Override + public int hashCode() { + return Objects.hash( + response, + isSetResponse, + messageReference, + isSetMessageReference, + repeatedMessageResponse, + isSetRepeatedMessageResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionStatusResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" messageReference: ").append(toIndentedString(messageReference)).append("\n"); + sb.append(" repeatedMessageResponse: ") + .append(toIndentedString(repeatedMessageResponse)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetMessageReference) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_REFERENCE, this.messageReference); + } + if (isSetRepeatedMessageResponse) { + addIfNull(nulls, JSON_PROPERTY_REPEATED_MESSAGE_RESPONSE, this.repeatedMessageResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TransactionStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionStatusResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionStatusResponse + */ + public static TransactionStatusResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionStatusResponse.class); + } + + /** + * Convert an instance of TransactionStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionTotals.java b/src/main/java/com/adyen/model/tapi/TransactionTotals.java new file mode 100644 index 000000000..3285bc7e6 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionTotals.java @@ -0,0 +1,741 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** + * If Result is Success, contains all the totals, classified as required by the Sale in the message + * request. At least, transaction totals are provided per Acquirer, Acquirer Settlement, and Card + * Brand. Result of the Sale to POI Reconciliation processing. + */ +@JsonPropertyOrder({ + TransactionTotals.JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE, + TransactionTotals.JSON_PROPERTY_ACQUIRER_I_D, + TransactionTotals.JSON_PROPERTY_HOST_RECONCILIATION_I_D, + TransactionTotals.JSON_PROPERTY_CARD_BRAND, + TransactionTotals.JSON_PROPERTY_P_O_I_I_D, + TransactionTotals.JSON_PROPERTY_SALE_I_D, + TransactionTotals.JSON_PROPERTY_OPERATOR_I_D, + TransactionTotals.JSON_PROPERTY_SHIFT_NUMBER, + TransactionTotals.JSON_PROPERTY_TOTALS_GROUP_I_D, + TransactionTotals.JSON_PROPERTY_PAYMENT_CURRENCY, + TransactionTotals.JSON_PROPERTY_PAYMENT_TOTALS +}) +public class TransactionTotals { + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE = "PaymentInstrumentType"; + private PaymentInstrumentType paymentInstrumentType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentType = false; + + public static final String JSON_PROPERTY_ACQUIRER_I_D = "AcquirerID"; + private Integer acquirerID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerID = false; + + public static final String JSON_PROPERTY_HOST_RECONCILIATION_I_D = "HostReconciliationID"; + private String hostReconciliationID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHostReconciliationID = false; + + public static final String JSON_PROPERTY_CARD_BRAND = "CardBrand"; + private String cardBrand; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardBrand = false; + + public static final String JSON_PROPERTY_P_O_I_I_D = "POIID"; + private String POIID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPOIID = false; + + public static final String JSON_PROPERTY_SALE_I_D = "SaleID"; + private String saleID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSaleID = false; + + public static final String JSON_PROPERTY_OPERATOR_I_D = "OperatorID"; + private String operatorID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperatorID = false; + + public static final String JSON_PROPERTY_SHIFT_NUMBER = "ShiftNumber"; + private String shiftNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShiftNumber = false; + + public static final String JSON_PROPERTY_TOTALS_GROUP_I_D = "TotalsGroupID"; + private String totalsGroupID; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroupID = false; + + public static final String JSON_PROPERTY_PAYMENT_CURRENCY = "PaymentCurrency"; + private String paymentCurrency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentCurrency = false; + + public static final String JSON_PROPERTY_PAYMENT_TOTALS = "PaymentTotals"; + private List paymentTotals; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentTotals = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TransactionTotals() {} + + /** + * Type of payment instrument. Possible values: * **Card** * **Cash** * **Check** * **Mobile** * + * **StoredValue** + * + * @param paymentInstrumentType Type of payment instrument. Possible values: * **Card** * **Cash** + * * **Check** * **Mobile** * **StoredValue** + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals paymentInstrumentType(PaymentInstrumentType paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set + return this; + } + + /** + * Type of payment instrument. Possible values: * **Card** * **Cash** * **Check** * **Mobile** * + * **StoredValue** + * + * @return paymentInstrumentType Type of payment instrument. Possible values: * **Card** * + * **Cash** * **Check** * **Mobile** * **StoredValue** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrumentType getPaymentInstrumentType() { + return paymentInstrumentType; + } + + /** + * Type of payment instrument. Possible values: * **Card** * **Cash** * **Check** * **Mobile** * + * **StoredValue** + * + * @param paymentInstrumentType Type of payment instrument. Possible values: * **Card** * **Cash** + * * **Check** * **Mobile** * **StoredValue** + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentType(PaymentInstrumentType paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set + } + + /** + * Identification of the Acquirer. + * + * @param acquirerID Identification of the Acquirer. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals acquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + return this; + } + + /** + * Identification of the Acquirer. + * + * @return acquirerID Identification of the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAcquirerID() { + return acquirerID; + } + + /** + * Identification of the Acquirer. + * + * @param acquirerID Identification of the Acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerID(Integer acquirerID) { + this.acquirerID = acquirerID; + isSetAcquirerID = true; // mark as set + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. + * + * @param hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals hostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + isSetHostReconciliationID = true; // mark as set + return this; + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. + * + * @return hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. + */ + @JsonProperty(JSON_PROPERTY_HOST_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHostReconciliationID() { + return hostReconciliationID; + } + + /** + * Identifier of a reconciliation period with a payment or loyalty host. + * + * @param hostReconciliationID Identifier of a reconciliation period with a payment or loyalty + * host. + */ + @JsonProperty(JSON_PROPERTY_HOST_RECONCILIATION_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + isSetHostReconciliationID = true; // mark as set + } + + /** + * Type of payment or loyalty card. If configured to present totals per card brand, and + * Response.Result is Success. + * + * @param cardBrand Type of payment or loyalty card. If configured to present totals per card + * brand, and Response.Result is Success. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals cardBrand(String cardBrand) { + this.cardBrand = cardBrand; + isSetCardBrand = true; // mark as set + return this; + } + + /** + * Type of payment or loyalty card. If configured to present totals per card brand, and + * Response.Result is Success. + * + * @return cardBrand Type of payment or loyalty card. If configured to present totals per card + * brand, and Response.Result is Success. + */ + @JsonProperty(JSON_PROPERTY_CARD_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCardBrand() { + return cardBrand; + } + + /** + * Type of payment or loyalty card. If configured to present totals per card brand, and + * Response.Result is Success. + * + * @param cardBrand Type of payment or loyalty card. If configured to present totals per card + * brand, and Response.Result is Success. + */ + @JsonProperty(JSON_PROPERTY_CARD_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardBrand(String cardBrand) { + this.cardBrand = cardBrand; + isSetCardBrand = true; // mark as set + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. Sent if + * requested in the message request. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * Sent if requested in the message request. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals POIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + return this; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. Sent if + * requested in the message request. + * + * @return POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPOIID() { + return POIID; + } + + /** + * Identification of a POI System or a POI Terminal for the Sale to POI protocol. Sent if + * requested in the message request. + * + * @param POIID Identification of a POI System or a POI Terminal for the Sale to POI protocol. + * Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_P_O_I_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPOIID(String POIID) { + this.POIID = POIID; + isSetPOIID = true; // mark as set + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. Sent if + * requested in the message request. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * Sent if requested in the message request. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals saleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + return this; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. Sent if + * requested in the message request. + * + * @return saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSaleID() { + return saleID; + } + + /** + * Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. Sent if + * requested in the message request. + * + * @param saleID Identification of a Sale System or a Sale Terminal for the Sale to POI protocol. + * Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_SALE_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSaleID(String saleID) { + this.saleID = saleID; + isSetSaleID = true; // mark as set + } + + /** + * Identification of the Cashier or Operator. Sent if requested in the message request. + * + * @param operatorID Identification of the Cashier or Operator. Sent if requested in the message + * request. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals operatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + return this; + } + + /** + * Identification of the Cashier or Operator. Sent if requested in the message request. + * + * @return operatorID Identification of the Cashier or Operator. Sent if requested in the message + * request. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperatorID() { + return operatorID; + } + + /** + * Identification of the Cashier or Operator. Sent if requested in the message request. + * + * @param operatorID Identification of the Cashier or Operator. Sent if requested in the message + * request. + */ + @JsonProperty(JSON_PROPERTY_OPERATOR_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperatorID(String operatorID) { + this.operatorID = operatorID; + isSetOperatorID = true; // mark as set + } + + /** + * Shift number. Sent if requested in the message request. + * + * @param shiftNumber Shift number. Sent if requested in the message request. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals shiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + return this; + } + + /** + * Shift number. Sent if requested in the message request. + * + * @return shiftNumber Shift number. Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Shift number. Sent if requested in the message request. + * + * @param shiftNumber Shift number. Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_SHIFT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + isSetShiftNumber = true; // mark as set + } + + /** + * Identification of a group of transaction on a POI Terminal, having the same Sale features. Sent + * if requested in the message request. + * + * @param totalsGroupID Identification of a group of transaction on a POI Terminal, having the + * same Sale features. Sent if requested in the message request. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals totalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + isSetTotalsGroupID = true; // mark as set + return this; + } + + /** + * Identification of a group of transaction on a POI Terminal, having the same Sale features. Sent + * if requested in the message request. + * + * @return totalsGroupID Identification of a group of transaction on a POI Terminal, having the + * same Sale features. Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_TOTALS_GROUP_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTotalsGroupID() { + return totalsGroupID; + } + + /** + * Identification of a group of transaction on a POI Terminal, having the same Sale features. Sent + * if requested in the message request. + * + * @param totalsGroupID Identification of a group of transaction on a POI Terminal, having the + * same Sale features. Sent if requested in the message request. + */ + @JsonProperty(JSON_PROPERTY_TOTALS_GROUP_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + isSetTotalsGroupID = true; // mark as set + } + + /** + * Currency of a monetary amount. + * + * @param paymentCurrency Currency of a monetary amount. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals paymentCurrency(String paymentCurrency) { + this.paymentCurrency = paymentCurrency; + isSetPaymentCurrency = true; // mark as set + return this; + } + + /** + * Currency of a monetary amount. + * + * @return paymentCurrency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPaymentCurrency() { + return paymentCurrency; + } + + /** + * Currency of a monetary amount. + * + * @param paymentCurrency Currency of a monetary amount. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentCurrency(String paymentCurrency) { + this.paymentCurrency = paymentCurrency; + isSetPaymentCurrency = true; // mark as set + } + + /** + * Totals of the payment transaction during the reconciliation period. If both + * `TransactionCount` and `TransactionAmount` are not equal to zero. + * + * @param paymentTotals Totals of the payment transaction during the reconciliation period. If + * both `TransactionCount` and `TransactionAmount` are not equal to zero. + * @return the current {@code TransactionTotals} instance, allowing for method chaining + */ + public TransactionTotals paymentTotals(List paymentTotals) { + this.paymentTotals = paymentTotals; + isSetPaymentTotals = true; // mark as set + return this; + } + + public TransactionTotals addPaymentTotalsItem(PaymentTotals paymentTotalsItem) { + if (this.paymentTotals == null) { + this.paymentTotals = new ArrayList<>(); + } + this.paymentTotals.add(paymentTotalsItem); + return this; + } + + /** + * Totals of the payment transaction during the reconciliation period. If both + * `TransactionCount` and `TransactionAmount` are not equal to zero. + * + * @return paymentTotals Totals of the payment transaction during the reconciliation period. If + * both `TransactionCount` and `TransactionAmount` are not equal to zero. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TOTALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPaymentTotals() { + return paymentTotals; + } + + /** + * Totals of the payment transaction during the reconciliation period. If both + * `TransactionCount` and `TransactionAmount` are not equal to zero. + * + * @param paymentTotals Totals of the payment transaction during the reconciliation period. If + * both `TransactionCount` and `TransactionAmount` are not equal to zero. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_TOTALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentTotals(List paymentTotals) { + this.paymentTotals = paymentTotals; + isSetPaymentTotals = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionTotals includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TransactionTotals object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionTotals transactionTotals = (TransactionTotals) o; + return Objects.equals(this.paymentInstrumentType, transactionTotals.paymentInstrumentType) + && Objects.equals( + this.isSetPaymentInstrumentType, transactionTotals.isSetPaymentInstrumentType) + && Objects.equals(this.acquirerID, transactionTotals.acquirerID) + && Objects.equals(this.isSetAcquirerID, transactionTotals.isSetAcquirerID) + && Objects.equals(this.hostReconciliationID, transactionTotals.hostReconciliationID) + && Objects.equals( + this.isSetHostReconciliationID, transactionTotals.isSetHostReconciliationID) + && Objects.equals(this.cardBrand, transactionTotals.cardBrand) + && Objects.equals(this.isSetCardBrand, transactionTotals.isSetCardBrand) + && Objects.equals(this.POIID, transactionTotals.POIID) + && Objects.equals(this.isSetPOIID, transactionTotals.isSetPOIID) + && Objects.equals(this.saleID, transactionTotals.saleID) + && Objects.equals(this.isSetSaleID, transactionTotals.isSetSaleID) + && Objects.equals(this.operatorID, transactionTotals.operatorID) + && Objects.equals(this.isSetOperatorID, transactionTotals.isSetOperatorID) + && Objects.equals(this.shiftNumber, transactionTotals.shiftNumber) + && Objects.equals(this.isSetShiftNumber, transactionTotals.isSetShiftNumber) + && Objects.equals(this.totalsGroupID, transactionTotals.totalsGroupID) + && Objects.equals(this.isSetTotalsGroupID, transactionTotals.isSetTotalsGroupID) + && Objects.equals(this.paymentCurrency, transactionTotals.paymentCurrency) + && Objects.equals(this.isSetPaymentCurrency, transactionTotals.isSetPaymentCurrency) + && Objects.equals(this.paymentTotals, transactionTotals.paymentTotals) + && Objects.equals(this.isSetPaymentTotals, transactionTotals.isSetPaymentTotals); + } + + @Override + public int hashCode() { + return Objects.hash( + paymentInstrumentType, + isSetPaymentInstrumentType, + acquirerID, + isSetAcquirerID, + hostReconciliationID, + isSetHostReconciliationID, + cardBrand, + isSetCardBrand, + POIID, + isSetPOIID, + saleID, + isSetSaleID, + operatorID, + isSetOperatorID, + shiftNumber, + isSetShiftNumber, + totalsGroupID, + isSetTotalsGroupID, + paymentCurrency, + isSetPaymentCurrency, + paymentTotals, + isSetPaymentTotals); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionTotals {\n"); + sb.append(" paymentInstrumentType: ") + .append(toIndentedString(paymentInstrumentType)) + .append("\n"); + sb.append(" acquirerID: ").append(toIndentedString(acquirerID)).append("\n"); + sb.append(" hostReconciliationID: ") + .append(toIndentedString(hostReconciliationID)) + .append("\n"); + sb.append(" cardBrand: ").append(toIndentedString(cardBrand)).append("\n"); + sb.append(" POIID: ").append(toIndentedString(POIID)).append("\n"); + sb.append(" saleID: ").append(toIndentedString(saleID)).append("\n"); + sb.append(" operatorID: ").append(toIndentedString(operatorID)).append("\n"); + sb.append(" shiftNumber: ").append(toIndentedString(shiftNumber)).append("\n"); + sb.append(" totalsGroupID: ").append(toIndentedString(totalsGroupID)).append("\n"); + sb.append(" paymentCurrency: ").append(toIndentedString(paymentCurrency)).append("\n"); + sb.append(" paymentTotals: ").append(toIndentedString(paymentTotals)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentInstrumentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE, this.paymentInstrumentType); + } + if (isSetAcquirerID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_I_D, this.acquirerID); + } + if (isSetHostReconciliationID) { + addIfNull(nulls, JSON_PROPERTY_HOST_RECONCILIATION_I_D, this.hostReconciliationID); + } + if (isSetCardBrand) { + addIfNull(nulls, JSON_PROPERTY_CARD_BRAND, this.cardBrand); + } + if (isSetPOIID) { + addIfNull(nulls, JSON_PROPERTY_P_O_I_I_D, this.POIID); + } + if (isSetSaleID) { + addIfNull(nulls, JSON_PROPERTY_SALE_I_D, this.saleID); + } + if (isSetOperatorID) { + addIfNull(nulls, JSON_PROPERTY_OPERATOR_I_D, this.operatorID); + } + if (isSetShiftNumber) { + addIfNull(nulls, JSON_PROPERTY_SHIFT_NUMBER, this.shiftNumber); + } + if (isSetTotalsGroupID) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP_I_D, this.totalsGroupID); + } + if (isSetPaymentCurrency) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_CURRENCY, this.paymentCurrency); + } + if (isSetPaymentTotals) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TOTALS, this.paymentTotals); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TransactionTotals given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionTotals + * @throws JsonProcessingException if the JSON string is invalid with respect to TransactionTotals + */ + public static TransactionTotals fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionTotals.class); + } + + /** + * Convert an instance of TransactionTotals to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TransactionType.java b/src/main/java/com/adyen/model/tapi/TransactionType.java new file mode 100644 index 000000000..33f5e8e22 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TransactionType.java @@ -0,0 +1,83 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets TransactionType */ +public enum TransactionType { + AWARD("Award"), + + CASH_ADVANCE("CashAdvance"), + + COMPLETED_DEFFERED("CompletedDeffered"), + + COMPLETED_RESERVATION("CompletedReservation"), + + CREDIT("Credit"), + + DEBIT("Debit"), + + DECLINED("Declined"), + + FAILED("Failed"), + + FIRST_RESERVATION("FirstReservation"), + + ISSUER_INSTALMENT("IssuerInstalment"), + + ONE_TIME_RESERVATION("OneTimeReservation"), + + REBATE("Rebate"), + + REDEMPTION("Redemption"), + + REVERSE_AWARD("ReverseAward"), + + REVERSE_CREDIT("ReverseCredit"), + + REVERSE_DEBIT("ReverseDebit"), + + REVERSE_REBATE("ReverseRebate"), + + REVERSE_REDEMPTION("ReverseRedemption"), + + UPDATE_RESERVATION("UpdateReservation"); + + private String value; + + TransactionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TransactionType fromValue(String value) { + for (TransactionType b : TransactionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/TypeCodeType.java b/src/main/java/com/adyen/model/tapi/TypeCodeType.java new file mode 100644 index 000000000..291f94890 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/TypeCodeType.java @@ -0,0 +1,49 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets TypeCode */ +public enum TypeCodeType { + COMPANY("Company"), + + PERSONAL("Personal"); + + private String value; + + TypeCodeType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeCodeType fromValue(String value) { + for (TypeCodeType b : TypeCodeType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/tapi/UTMCoordinates.java b/src/main/java/com/adyen/model/tapi/UTMCoordinates.java new file mode 100644 index 000000000..d890b1754 --- /dev/null +++ b/src/main/java/com/adyen/model/tapi/UTMCoordinates.java @@ -0,0 +1,280 @@ +/* + * Adyen Terminal API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.tapi; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** UTMCoordinates */ +@JsonPropertyOrder({ + UTMCoordinates.JSON_PROPERTY_UT_M_ZONE, + UTMCoordinates.JSON_PROPERTY_UT_M_EASTWARD, + UTMCoordinates.JSON_PROPERTY_UT_M_NORTHWARD +}) +public class UTMCoordinates { + public static final String JSON_PROPERTY_UT_M_ZONE = "UTMZone"; + private String utMZone; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUtMZone = false; + + public static final String JSON_PROPERTY_UT_M_EASTWARD = "UTMEastward"; + private String utMEastward; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUtMEastward = false; + + public static final String JSON_PROPERTY_UT_M_NORTHWARD = "UTMNorthward"; + private String utMNorthward; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUtMNorthward = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public UTMCoordinates() {} + + /** + * UTM grid zone combination of the longitude zone (1 to 60) and the latitude band (C to X, + * excluding I and O). + * + * @param utMZone UTM grid zone combination of the longitude zone (1 to 60) and the latitude band + * (C to X, excluding I and O). + * @return the current {@code UTMCoordinates} instance, allowing for method chaining + */ + public UTMCoordinates utMZone(String utMZone) { + this.utMZone = utMZone; + isSetUtMZone = true; // mark as set + return this; + } + + /** + * UTM grid zone combination of the longitude zone (1 to 60) and the latitude band (C to X, + * excluding I and O). + * + * @return utMZone UTM grid zone combination of the longitude zone (1 to 60) and the latitude band + * (C to X, excluding I and O). + */ + @JsonProperty(JSON_PROPERTY_UT_M_ZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUtMZone() { + return utMZone; + } + + /** + * UTM grid zone combination of the longitude zone (1 to 60) and the latitude band (C to X, + * excluding I and O). + * + * @param utMZone UTM grid zone combination of the longitude zone (1 to 60) and the latitude band + * (C to X, excluding I and O). + */ + @JsonProperty(JSON_PROPERTY_UT_M_ZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUtMZone(String utMZone) { + this.utMZone = utMZone; + isSetUtMZone = true; // mark as set + } + + /** + * X-coordinate of the Universal Transverse Mercator coordinate system. + * + * @param utMEastward X-coordinate of the Universal Transverse Mercator coordinate system. + * @return the current {@code UTMCoordinates} instance, allowing for method chaining + */ + public UTMCoordinates utMEastward(String utMEastward) { + this.utMEastward = utMEastward; + isSetUtMEastward = true; // mark as set + return this; + } + + /** + * X-coordinate of the Universal Transverse Mercator coordinate system. + * + * @return utMEastward X-coordinate of the Universal Transverse Mercator coordinate system. + */ + @JsonProperty(JSON_PROPERTY_UT_M_EASTWARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUtMEastward() { + return utMEastward; + } + + /** + * X-coordinate of the Universal Transverse Mercator coordinate system. + * + * @param utMEastward X-coordinate of the Universal Transverse Mercator coordinate system. + */ + @JsonProperty(JSON_PROPERTY_UT_M_EASTWARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUtMEastward(String utMEastward) { + this.utMEastward = utMEastward; + isSetUtMEastward = true; // mark as set + } + + /** + * Y-coordinate of the Universal Transverse Mercator coordinate system. + * + * @param utMNorthward Y-coordinate of the Universal Transverse Mercator coordinate system. + * @return the current {@code UTMCoordinates} instance, allowing for method chaining + */ + public UTMCoordinates utMNorthward(String utMNorthward) { + this.utMNorthward = utMNorthward; + isSetUtMNorthward = true; // mark as set + return this; + } + + /** + * Y-coordinate of the Universal Transverse Mercator coordinate system. + * + * @return utMNorthward Y-coordinate of the Universal Transverse Mercator coordinate system. + */ + @JsonProperty(JSON_PROPERTY_UT_M_NORTHWARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUtMNorthward() { + return utMNorthward; + } + + /** + * Y-coordinate of the Universal Transverse Mercator coordinate system. + * + * @param utMNorthward Y-coordinate of the Universal Transverse Mercator coordinate system. + */ + @JsonProperty(JSON_PROPERTY_UT_M_NORTHWARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUtMNorthward(String utMNorthward) { + this.utMNorthward = utMNorthward; + isSetUtMNorthward = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UTMCoordinates includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this UTMCoordinates object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UTMCoordinates utMCoordinates = (UTMCoordinates) o; + return Objects.equals(this.utMZone, utMCoordinates.utMZone) + && Objects.equals(this.isSetUtMZone, utMCoordinates.isSetUtMZone) + && Objects.equals(this.utMEastward, utMCoordinates.utMEastward) + && Objects.equals(this.isSetUtMEastward, utMCoordinates.isSetUtMEastward) + && Objects.equals(this.utMNorthward, utMCoordinates.utMNorthward) + && Objects.equals(this.isSetUtMNorthward, utMCoordinates.isSetUtMNorthward); + } + + @Override + public int hashCode() { + return Objects.hash( + utMZone, isSetUtMZone, utMEastward, isSetUtMEastward, utMNorthward, isSetUtMNorthward); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UTMCoordinates {\n"); + sb.append(" utMZone: ").append(toIndentedString(utMZone)).append("\n"); + sb.append(" utMEastward: ").append(toIndentedString(utMEastward)).append("\n"); + sb.append(" utMNorthward: ").append(toIndentedString(utMNorthward)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetUtMZone) { + addIfNull(nulls, JSON_PROPERTY_UT_M_ZONE, this.utMZone); + } + if (isSetUtMEastward) { + addIfNull(nulls, JSON_PROPERTY_UT_M_EASTWARD, this.utMEastward); + } + if (isSetUtMNorthward) { + addIfNull(nulls, JSON_PROPERTY_UT_M_NORTHWARD, this.utMNorthward); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of UTMCoordinates given an JSON string + * + * @param jsonString JSON string + * @return An instance of UTMCoordinates + * @throws JsonProcessingException if the JSON string is invalid with respect to UTMCoordinates + */ + public static UTMCoordinates fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, UTMCoordinates.class); + } + + /** + * Convert an instance of UTMCoordinates to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} From 500044e4cc8b579d2408fb3ef9e2fc5761d3a1fd Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 27 Mar 2026 10:35:01 +0100 Subject: [PATCH 2/4] Include additional models --- .../CloudDeviceApiAsyncResponse.java | 91 +++++++++++++ .../clouddevice/CloudDeviceApiRequest.java | 94 ++++++++++++++ .../clouddevice/CloudDeviceApiResponse.java | 122 ++++++++++++++++++ .../clouddevice/ConnectedDevicesResponse.java | 89 +++++++++++++ .../adyen/model/clouddevice/DeviceStatus.java | 58 +++++++++ .../clouddevice/DeviceStatusResponse.java | 92 +++++++++++++ 6 files changed, 546 insertions(+) create mode 100644 src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java create mode 100644 src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java create mode 100644 src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java create mode 100644 src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java create mode 100644 src/main/java/com/adyen/model/clouddevice/DeviceStatus.java create mode 100644 src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java new file mode 100644 index 000000000..32b8d04b3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java @@ -0,0 +1,91 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.adyen.model.tapi.SaleToPOIRequest; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Objects; + +/** + * Response of the /async endpoint. When successful the `results` contains `ok` In case of failure + * the `saleToPOIRequest` contains the EventNotification details + */ +public class CloudDeviceApiAsyncResponse { + @JsonProperty("result") + private String result; + @JsonProperty("saleToPOIRequest") + private SaleToPOIRequest saleToPOIRequest; + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + /** + * Gets sale to POI request. + * + * @return the sale to POI request + */ + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets sale to POI request. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiAsyncResponse response = (CloudDeviceApiAsyncResponse) o; + return Objects.equals(result, response.result) + && Objects.equals(saleToPOIRequest, response.saleToPOIRequest); + } + + @Override + public int hashCode() { + return Objects.hash(result, saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiAsyncResponse{" + + "result=" + + result + + ", saleToPOIRequest=" + + saleToPOIRequest + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java new file mode 100644 index 000000000..77149199c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java @@ -0,0 +1,94 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.adyen.model.tapi.JSON; +import com.adyen.model.tapi.SaleToPOIRequest; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** CloudDeviceApiRequest */ +public class CloudDeviceApiRequest { + @JsonProperty("SaleToPOIRequest") + private SaleToPOIRequest saleToPOIRequest; + + /** + * Gets saleToPOIRequest. + * + * @return the sale to POI request + */ + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets saleToPOIRequest. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiRequest that = (CloudDeviceApiRequest) o; + return Objects.equals(saleToPOIRequest, that.saleToPOIRequest); + } + + /** + * Create an instance of CloudDeviceApiRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiRequest + */ + public static CloudDeviceApiRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiRequest.class); + } + + /** + * Convert an instance of CloudDeviceApiRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiRequest{" + "saleToPOIRequest=" + saleToPOIRequest + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java new file mode 100644 index 000000000..392342d58 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java @@ -0,0 +1,122 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.adyen.model.tapi.JSON; +import com.adyen.model.tapi.SaleToPOIRequest; +import com.adyen.model.tapi.SaleToPOIResponse; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** CloudDeviceApiResponse */ +public class CloudDeviceApiResponse { + @JsonProperty("SaleToPOIResponse") + private SaleToPOIResponse saleToPOIResponse; + + @JsonProperty("SaleToPOIRequest") + private SaleToPOIRequest saleToPOIRequest; + + /** + * Gets sale to POI request. + * + * @return the sale to POI request + */ + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets sale to POI request. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + /** + * Gets sale to POI response. + * + * @return the sale to POI response + */ + public SaleToPOIResponse getSaleToPOIResponse() { + return saleToPOIResponse; + } + + /** + * Sets sale to POI response. + * + * @param saleToPOIResponse the sale to POI response + */ + public void setSaleToPOIResponse(SaleToPOIResponse saleToPOIResponse) { + this.saleToPOIResponse = saleToPOIResponse; + } + + /** + * Create an instance of CloudDeviceApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiResponse + */ + public static CloudDeviceApiResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiResponse.class); + } + + /** + * Convert an instance of CloudDeviceApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiResponse response = (CloudDeviceApiResponse) o; + return Objects.equals(saleToPOIResponse, response.saleToPOIResponse) + && Objects.equals(saleToPOIRequest, response.saleToPOIRequest); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIResponse, saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiResponse{" + + "saleToPOIResponse=" + + saleToPOIResponse + + ", saleToPOIRequest=" + + saleToPOIRequest + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java b/src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java new file mode 100644 index 000000000..5331abf17 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java @@ -0,0 +1,89 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.adyen.model.tapi.JSON; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.List; +import java.util.Objects; + +/** ConnectedDevicesResponse */ +public class ConnectedDevicesResponse { + @JsonProperty("uniqueDeviceIds") + private List uniqueDeviceIds = null; + + public List getUniqueDeviceIds() { + return uniqueDeviceIds; + } + + public void setUniqueDeviceIds(List uniqueDeviceIds) { + this.uniqueDeviceIds = uniqueDeviceIds; + } + + /** + * Create an instance of ConnectedDevicesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectedDevicesResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ConnectedDevicesResponse + */ + public static ConnectedDevicesResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ConnectedDevicesResponse.class); + } + + /** + * Convert an instance of ConnectedDevicesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectedDevicesResponse that = (ConnectedDevicesResponse) o; + return Objects.equals(uniqueDeviceIds, that.uniqueDeviceIds); + } + + @Override + public int hashCode() { + return Objects.hash(uniqueDeviceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("ConnectedDevicesResponse{"); + sb.append("uniqueDeviceIds=").append(uniqueDeviceIds); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceStatus.java b/src/main/java/com/adyen/model/clouddevice/DeviceStatus.java new file mode 100644 index 000000000..7618b29ed --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DeviceStatus.java @@ -0,0 +1,58 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** DeviceStatus */ +public enum DeviceStatus { + ONLINE("ONLINE"), + OFFLINE("OFFLINE"); + + private final String value; + + DeviceStatus(String v) { + value = v; + } + + /** + * Returns the string representation of the DeviceStatus. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates an DeviceStatus from a string value. + * + * @param v the string value + * @return the corresponding DeviceStatus + */ + @JsonCreator + public static DeviceStatus fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java new file mode 100644 index 000000000..bacb57ccb --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java @@ -0,0 +1,92 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.adyen.model.tapi.JSON; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** DeviceStatusResponse */ +public class DeviceStatusResponse { + @JsonProperty("deviceId") + private String deviceId; + @JsonProperty("status") + private DeviceStatus status; + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public DeviceStatus getStatus() { + return status; + } + + public void setStatus(DeviceStatus status) { + this.status = status; + } + + /** + * Create an instance of DeviceStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeviceStatus + * @throws JsonProcessingException if the JSON string is invalid with respect to DeviceStatus + */ + public static DeviceStatusResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DeviceStatusResponse.class); + } + + /** + * Convert an instance of DeviceStatus to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceStatusResponse that = (DeviceStatusResponse) o; + return Objects.equals(deviceId, that.deviceId) && status == that.status; + } + + @Override + public int hashCode() { + return Objects.hash(deviceId, status); + } + + @Override + public String toString() { + return "DeviceStatusResponse{" + "deviceId='" + deviceId + '\'' + ", status=" + status + '}'; + } +} From c8cb39a6b7e4d2bc28957df63bff94146afce73a Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 27 Mar 2026 10:35:15 +0100 Subject: [PATCH 3/4] Add service and tests --- .../CloudDeviceApiAsyncResponse.java | 2 +- .../clouddevice/DeviceStatusResponse.java | 1 + .../service/clouddevice/CloudDeviceApi.java | 214 ++++++++++++ .../clouddevice/CloudDeviceApiTest.java | 208 +++++++++++ .../mocks/clouddevice/connected-devices.json | 6 + .../clouddevice/payment-async-error.json | 20 ++ .../clouddevice/payment-async-success.json | 1 + .../clouddevice/payment-sync-success.json | 330 ++++++++++++++++++ .../mocks/clouddevice/status-device.json | 4 + 9 files changed, 785 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java create mode 100644 src/test/java/com/adyen/service/clouddevice/CloudDeviceApiTest.java create mode 100644 src/test/resources/mocks/clouddevice/connected-devices.json create mode 100644 src/test/resources/mocks/clouddevice/payment-async-error.json create mode 100644 src/test/resources/mocks/clouddevice/payment-async-success.json create mode 100644 src/test/resources/mocks/clouddevice/payment-sync-success.json create mode 100644 src/test/resources/mocks/clouddevice/status-device.json diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java index 32b8d04b3..5c020131f 100644 --- a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java @@ -22,7 +22,6 @@ import com.adyen.model.tapi.SaleToPOIRequest; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.Objects; /** @@ -32,6 +31,7 @@ public class CloudDeviceApiAsyncResponse { @JsonProperty("result") private String result; + @JsonProperty("saleToPOIRequest") private SaleToPOIRequest saleToPOIRequest; diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java index bacb57ccb..c20d9739c 100644 --- a/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java +++ b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java @@ -29,6 +29,7 @@ public class DeviceStatusResponse { @JsonProperty("deviceId") private String deviceId; + @JsonProperty("status") private DeviceStatus status; diff --git a/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java b/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java new file mode 100644 index 000000000..9944698db --- /dev/null +++ b/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java @@ -0,0 +1,214 @@ +package com.adyen.service.clouddevice; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.clouddevice.*; +import com.adyen.model.clouddevice.CloudDeviceApiAsyncResponse; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class CloudDeviceApi extends Service { + + public static final String API_VERSION = "1"; + + protected String baseURL; + + /** + * CloudDeviceApi constructor in {@link com.adyen.service.clouddevice package}. + * + * @param client {@link Client } (required) + */ + public CloudDeviceApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://device-api-test.adyen.com/v1"); + } + + /** + * CloudDeviceApi constructor in {@link com.adyen.service.clouddevice package}. Please use this + * constructor only if you would like to pass along your own url for routing or testing purposes. + * The latest API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public CloudDeviceApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Send a synchronous payment request. + * + * @param merchantAccount The unique identifier of the merchant account + * @param deviceId The unique identifier of the payment device that you send this request to (must + * match POIID in the MessageHeader). + * @param cloudDeviceApiRequest The request to send. + * @return instance of CloudDeviceApiResponse + * @throws ApiException when an error occurs + */ + public CloudDeviceApiResponse sync( + String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest) + throws ApiException, IOException { + + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + if (cloudDeviceApiRequest.getSaleToPOIRequest() == null + || cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader() == null) { + throw new IllegalArgumentException( + "cloudDeviceApiRequest must contain a SaleToPOIRequest with a MessageHeader"); + } + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(deviceId); + + String requestBody = cloudDeviceApiRequest.toJson(); + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/sync", null); + String response = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); + + return CloudDeviceApiResponse.fromJson(response); + } + + /** + * Send an asynchronous payment request. + * + * @param merchantAccount The unique identifier of the merchant account + * @param deviceId The unique identifier of the device that you send this request to (must match + * POIID in the MessageHeader). + * @param cloudDeviceApiRequest The request to send. + * @return instance of CloudDeviceApiAsyncResponse wrapping the response (success or an + * EventNotification with error details) + * @throws ApiException when an error occurs + */ + public CloudDeviceApiAsyncResponse async( + String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest) + throws ApiException, IOException { + + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + if (cloudDeviceApiRequest.getSaleToPOIRequest() == null + || cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader() == null) { + throw new IllegalArgumentException( + "cloudDeviceApiRequest must contain a SaleToPOIRequest with a MessageHeader"); + } + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(deviceId); + + String requestBody = cloudDeviceApiRequest.toJson(); + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/async", null); + String response = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); + + CloudDeviceApiAsyncResponse cloudDeviceApiAsyncResponse = new CloudDeviceApiAsyncResponse(); + + // Define response based on the outcome + if ("ok".equalsIgnoreCase(response.trim())) { + cloudDeviceApiAsyncResponse.setResult(response.trim()); + } else { + CloudDeviceApiResponse errorResponse = CloudDeviceApiResponse.fromJson(response); + cloudDeviceApiAsyncResponse.setSaleToPOIRequest(errorResponse.getSaleToPOIRequest()); + } + + return cloudDeviceApiAsyncResponse; + } + + /** + * Get a list of connected devices for a merchant account. + * + * @param merchantAccount The unique identifier of the merchant account. + * @return An instance of ConnectedDevicesResponse. + * @throws ApiException when an error occurs + */ + public ConnectedDevicesResponse getConnectedDevices(String merchantAccount) + throws ApiException, IOException { + return getConnectedDevices(merchantAccount, null); + } + + /** + * Get a list of connected devices for a merchant account and store. + * + * @param merchantAccount The unique identifier of the merchant account. + * @param store The unique identifier of the store. + * @return An instance of ConnectedDevicesResponse. + * @throws ApiException when an error occurs + */ + public ConnectedDevicesResponse getConnectedDevices(String merchantAccount, String store) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + Map queryParams = null; + if (store != null) { + queryParams = new HashMap<>(); + queryParams.put("store", store); + } + + Resource resource = + new Resource(this, this.baseURL + "/merchants/{merchantAccount}/connectedDevices", null); + String response = + resource.request(null, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); + + return ConnectedDevicesResponse.fromJson(response); + } + + /** + * Get the status of a device. + * + * @param merchantAccount The unique identifier of the merchant account. + * @param deviceId The unique identifier of the device. + * @return An instance of DeviceStatus. + * @throws ApiException when an error occurs + */ + public DeviceStatusResponse getDeviceStatus(String merchantAccount, String deviceId) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/status", null); + String response = resource.request(null, null, ApiConstants.HttpMethod.GET, pathParams, null); + + return DeviceStatusResponse.fromJson(response); + } +} diff --git a/src/test/java/com/adyen/service/clouddevice/CloudDeviceApiTest.java b/src/test/java/com/adyen/service/clouddevice/CloudDeviceApiTest.java new file mode 100644 index 000000000..a79859458 --- /dev/null +++ b/src/test/java/com/adyen/service/clouddevice/CloudDeviceApiTest.java @@ -0,0 +1,208 @@ +package com.adyen.service.clouddevice; + +import static org.mockito.Mockito.verify; + +import com.adyen.BaseTest; +import com.adyen.Client; +import com.adyen.constants.ApiConstants; +import com.adyen.model.clouddevice.*; +import com.adyen.model.tapi.*; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class CloudDeviceApiTest extends BaseTest { + + @Test + public void sendSync() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-sync-success.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + var response = cloudDeviceApi.sync("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + + Assertions.assertNotNull(response); + Assertions.assertNotNull(response.getSaleToPOIResponse()); + Assertions.assertNotNull(response.getSaleToPOIResponse().getMessageHeader()); + Assertions.assertEquals( + "P400Plus-123456789", response.getSaleToPOIResponse().getMessageHeader().getPOIID()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/P400Plus-123456789/sync", + cloudDeviceApiRequest.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + public void sendAsync() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-async-success.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + var response = cloudDeviceApi.async("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + + Assertions.assertNotNull(response); + Assertions.assertEquals("ok", response.getResult()); + Assertions.assertNull(response.getSaleToPOIRequest()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/P400Plus-123456789/async", + cloudDeviceApiRequest.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + public void sendAsyncReturningError() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-async-error.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + var response = cloudDeviceApi.async("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + + Assertions.assertNotNull(response); + Assertions.assertNull(response.getResult()); + Assertions.assertNotNull(response.getSaleToPOIRequest()); + + Assertions.assertEquals( + EventToNotifyType.REJECT, + response.getSaleToPOIRequest().getEventNotification().getEventToNotify()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/P400Plus-123456789/async", + cloudDeviceApiRequest.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + public void getConnectedDevices() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/connected-devices.json"); + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + ConnectedDevicesResponse response = cloudDeviceApi.getConnectedDevices("myMerchant"); + + Assertions.assertNotNull(response); + Assertions.assertEquals(2, response.getUniqueDeviceIds().size()); + Assertions.assertEquals("P400Plus-123456789", response.getUniqueDeviceIds().get(0)); + Assertions.assertEquals("V400m-123456789", response.getUniqueDeviceIds().get(1)); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/connectedDevices", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + public void getConnectedDevicesWithStore() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/connected-devices.json"); + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + ConnectedDevicesResponse response = cloudDeviceApi.getConnectedDevices("myMerchant", "myStore"); + + Assertions.assertNotNull(response); + Assertions.assertEquals(2, response.getUniqueDeviceIds().size()); + Assertions.assertEquals("P400Plus-123456789", response.getUniqueDeviceIds().get(0)); + Assertions.assertEquals("V400m-123456789", response.getUniqueDeviceIds().get(1)); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/connectedDevices", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + Map.of("store", "myStore")); + } + + @Test + public void getDeviceStatus() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/status-device.json"); + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + DeviceStatusResponse response = + cloudDeviceApi.getDeviceStatus("myMerchant", "AMS1-000168242800763"); + + Assertions.assertNotNull(response); + Assertions.assertEquals("AMS1-000168242800763", response.getDeviceId()); + Assertions.assertEquals(DeviceStatus.ONLINE, response.getStatus()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/AMS1-000168242800763/status", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + protected CloudDeviceApiRequest createCloudDeviceAPIPaymentRequest() { + SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + + MessageHeader messageHeader = new MessageHeader(); + messageHeader.setProtocolVersion("3.0"); + messageHeader.setMessageClass(MessageClassType.SERVICE); + messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); + messageHeader.setMessageType(MessageType.REQUEST); + messageHeader.setSaleID("001"); + messageHeader.setServiceID("001"); + messageHeader.setPOIID("P400Plus-123456789"); + + saleToPOIRequest.setMessageHeader(messageHeader); + + PaymentRequest paymentRequest = new PaymentRequest(); + + SaleData saleData = new SaleData(); + TransactionIdentification transactionIdentification = new TransactionIdentification(); + transactionIdentification.setTransactionID("001"); + OffsetDateTime timestamp = OffsetDateTime.now(ZoneOffset.UTC); + transactionIdentification.setTimeStamp(timestamp); + saleData.setSaleTransactionID(transactionIdentification); + + PaymentTransaction paymentTransaction = new PaymentTransaction(); + AmountsReq amountsReq = new AmountsReq(); + amountsReq.setCurrency("EUR"); + amountsReq.setRequestedAmount(BigDecimal.ONE); + paymentTransaction.setAmountsReq(amountsReq); + + paymentRequest.setSaleData(saleData); + paymentRequest.setPaymentTransaction(paymentTransaction); + + saleToPOIRequest.setPaymentRequest(paymentRequest); + + CloudDeviceApiRequest cloudDeviceApiRequest = new CloudDeviceApiRequest(); + cloudDeviceApiRequest.setSaleToPOIRequest(saleToPOIRequest); + + return cloudDeviceApiRequest; + } +} diff --git a/src/test/resources/mocks/clouddevice/connected-devices.json b/src/test/resources/mocks/clouddevice/connected-devices.json new file mode 100644 index 000000000..1b46d7c29 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/connected-devices.json @@ -0,0 +1,6 @@ +{ + "uniqueDeviceIds": [ + "P400Plus-123456789", + "V400m-123456789" + ] +} \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-async-error.json b/src/test/resources/mocks/clouddevice/payment-async-error.json new file mode 100644 index 000000000..d1b92d279 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-async-error.json @@ -0,0 +1,20 @@ +{ + "SaleToPOIRequest": { + "EventNotification": { + "EventToNotify": "Reject", + "EventDetails": "message=Did+not+receive+a+response+from+the+POI.", + "RejectedMessage": "ewoi...0KfQo=", + "TimeStamp": "2020-03-31T10:28:39.515Z" + }, + "MessageHeader": { + "DeviceID": "666568147", + "MessageCategory": "Event", + "MessageClass": "Event", + "MessageType": "Notification", + "POIID": "P400Plus-123456789", + "ProtocolVersion": "3.0", + "SaleID": "saleid-4c32759faaa7", + "ServiceID": "31122609" + } + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-async-success.json b/src/test/resources/mocks/clouddevice/payment-async-success.json new file mode 100644 index 000000000..b5754e203 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-async-success.json @@ -0,0 +1 @@ +ok \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-sync-success.json b/src/test/resources/mocks/clouddevice/payment-sync-success.json new file mode 100644 index 000000000..637405767 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-sync-success.json @@ -0,0 +1,330 @@ +{ + "SaleToPOIResponse": { + "PaymentResponse": { + "POIData": { + "POITransactionID": { + "TimeStamp": "2019-04-29T00:00:00.000Z", + "TransactionID": "4r7i001556529591000.8515565295894301" + }, + "POIReconciliationID": "1000" + }, + "SaleData": { + "SaleTransactionID": { + "TimeStamp": "2019-04-29T00:00:00.000Z", + "TransactionID": "001" + } + }, + "PaymentReceipt": [ + { + "RequiredSignatureFlag": false, + "DocumentQualifier": "CashierReceipt", + "OutputContent": { + "OutputFormat": "Text", + "OutputText": [ + { + "CharacterStyle": "Bold", + "Text": "key=header1", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "key=header2", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=MERCHANT%20COPY&key=merchantTitle", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Date&value=29%2f04%2f19&key=txdate", + "EndOfLineFlag": true + }, + { + "Text": "name=Time&value=10%3a19%3a51&key=txtime", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a3511&key=pan", + "EndOfLineFlag": true + }, + { + "Text": "name=Pref.%20name&value=MCC%20351%20v1%202&key=preferredName", + "EndOfLineFlag": true + }, + { + "Text": "name=Card%20type&value=mc&key=cardType", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20method&value=mc&key=paymentMethod", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20variant&value=mc&key=paymentMethodVariant", + "EndOfLineFlag": true + }, + { + "Text": "name=Entry%20mode&value=Contactless%20swipe&key=posEntryMode", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=AID&value=A0000000041010&key=aid", + "EndOfLineFlag": true + }, + { + "Text": "name=MID&value=1000&key=mid", + "EndOfLineFlag": true + }, + { + "Text": "name=TID&value=P400Plus-275039202&key=tid", + "EndOfLineFlag": true + }, + { + "Text": "name=PTID&value=75039202&key=ptid", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Auth.%20code&value=123456&key=authCode", + "EndOfLineFlag": true + }, + { + "Text": "name=Tender&value=4r7i001556529591000&key=txRef", + "EndOfLineFlag": true + }, + { + "Text": "name=Reference&value=003&key=mref", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Type&value=GOODS_SERVICES&key=txtype", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=TOTAL&value=%e2%82%ac%c2%a01.00&key=totalAmount", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=APPROVED&key=approved", + "EndOfLineFlag": true + } + ] + } + }, + { + "RequiredSignatureFlag": false, + "DocumentQualifier": "CustomerReceipt", + "OutputContent": { + "OutputFormat": "Text", + "OutputText": [ + { + "CharacterStyle": "Bold", + "Text": "key=header1", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "key=header2", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=CARDHOLDER%20COPY&key=cardholderHeader", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Date&value=29%2f04%2f19&key=txdate", + "EndOfLineFlag": true + }, + { + "Text": "name=Time&value=10%3a19%3a51&key=txtime", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a3511&key=pan", + "EndOfLineFlag": true + }, + { + "Text": "name=Pref.%20name&value=MCC%20351%20v1%202&key=preferredName", + "EndOfLineFlag": true + }, + { + "Text": "name=Card%20type&value=mc&key=cardType", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20method&value=mc&key=paymentMethod", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20variant&value=mc&key=paymentMethodVariant", + "EndOfLineFlag": true + }, + { + "Text": "name=Entry%20mode&value=Contactless%20swipe&key=posEntryMode", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=AID&value=A0000000041010&key=aid", + "EndOfLineFlag": true + }, + { + "Text": "name=MID&value=1000&key=mid", + "EndOfLineFlag": true + }, + { + "Text": "name=TID&value=P400Plus-275039202&key=tid", + "EndOfLineFlag": true + }, + { + "Text": "name=PTID&value=75039202&key=ptid", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Auth.%20code&value=123456&key=authCode", + "EndOfLineFlag": true + }, + { + "Text": "name=Tender&value=4r7i001556529591000&key=txRef", + "EndOfLineFlag": true + }, + { + "Text": "name=Reference&value=003&key=mref", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Type&value=GOODS_SERVICES&key=txtype", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=TOTAL&value=%e2%82%ac%c2%a01.00&key=totalAmount", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=APPROVED&key=approved", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Please%20retain%20for%20your%20records&key=retain", + "EndOfLineFlag": true + }, + { + "Text": "name=Thank%20you&key=thanks", + "EndOfLineFlag": true + } + ] + } + } + ], + "PaymentResult": { + "OnlineFlag": true, + "PaymentAcquirerData": { + "AcquirerPOIID": "P400Plus-123456789", + "ApprovalCode": "123456", + "AcquirerTransactionID": { + "TimeStamp": "2019-04-29T09:19:51.000Z", + "TransactionID": "8515565295894301" + }, + "MerchantID": "TestMerchant" + }, + "CurrencyConversion": [ + { + "ConvertedAmount": { + "AmountValue": 48.32, + "Currency": "EUR" + }, + "CustomerApprovedFlag": true, + "Markup": 3, + "Rate": 0.035 + } + ], + "PaymentInstrumentData": { + "CardData": { + "EntryMode": [ + "Tapped" + ], + "PaymentBrand": "mc", + "MaskedPan": "411111 **** 1111", + "SensitiveCardData": { + "ExpiryDate": "1225" + } + }, + "PaymentInstrumentType": "Card" + }, + "AmountsResp": { + "AuthorizedAmount": 1, + "Currency": "EUR" + } + }, + "Response": { + "Result": "Success", + "AdditionalResponse": "tid=75039202&AID=A0000000041010&transactionType=GOODS_SERVICES&backendGiftcardIndicator=false&expiryYear=2025&acquirerAccountCode=TestPmmAcquirerAccount&alias=M900978995070104&posOriginalAmountCurrency=EUR&giftcardIndicator=false&authorisedAmountValue=100&pspReference=8515565295894301&paymentMethodVariant=mc&cardHolderName=N%2fA&refusalReasonRaw=APPROVED&authorisationMid=1000&expiryDate=12%2f2025&applicationPreferredName=MCC%20351%20v1%202&acquirerCode=TestPmmAcquirer&txtime=10%3a19%3a51&iso8601TxDate=2019-04-29T09%3a19%3a51.0000000%2b0000&cardType=mc&posOriginalAmountValue=100&offline=false&aliasType=Default&txdate=29-04-2019&paymentMethod=mc&cvcResult=0%20Unknown&avsResult=0%20Unknown&mid=1000&merchantReference=003&transactionReferenceNumber=8515565295894301&expiryMonth=12&cardSummary=3511&posTotalAmountValue=100&posAuthAmountCurrency=EUR&cardHolderVerificationMethodResults=3F0300&authCode=123456&shopperCountry=NL&posEntryMode=CLESS_SWIPE&cardScheme=mc&cardBin=541333&posAuthAmountValue=100" + } + }, + "MessageHeader": { + "ProtocolVersion": "3.0", + "SaleID": "001", + "MessageClass": "Service", + "MessageCategory": "Payment", + "ServiceID": "1234567890", + "POIID": "P400Plus-123456789", + "MessageType": "Response" + } + } +} diff --git a/src/test/resources/mocks/clouddevice/status-device.json b/src/test/resources/mocks/clouddevice/status-device.json new file mode 100644 index 000000000..fc23716f2 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/status-device.json @@ -0,0 +1,4 @@ +{ + "deviceId": "AMS1-000168242800763", + "status": "ONLINE" +} \ No newline at end of file From 23952fe548ff20c3794a3c553673b73ad54e958c Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 27 Mar 2026 11:23:14 +0100 Subject: [PATCH 4/4] Correct errors --- .../CloudDeviceApiAsyncResponse.java | 28 +++++++++++++++++-- .../clouddevice/DeviceStatusResponse.java | 4 +-- .../service/clouddevice/CloudDeviceApi.java | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java index 5c020131f..df75367cb 100644 --- a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java @@ -20,8 +20,10 @@ */ package com.adyen.model.clouddevice; +import com.adyen.model.tapi.JSON; import com.adyen.model.tapi.SaleToPOIRequest; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; import java.util.Objects; /** @@ -29,10 +31,10 @@ * the `saleToPOIRequest` contains the EventNotification details */ public class CloudDeviceApiAsyncResponse { - @JsonProperty("result") + @JsonProperty("Result") private String result; - @JsonProperty("saleToPOIRequest") + @JsonProperty("SaleToPOIRequest") private SaleToPOIRequest saleToPOIRequest; public String getResult() { @@ -74,6 +76,28 @@ public boolean equals(Object o) { && Objects.equals(saleToPOIRequest, response.saleToPOIRequest); } + /** + * Create an instance of CloudDeviceApiAsyncResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiAsyncResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiAsyncResponse + */ + public static CloudDeviceApiAsyncResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiAsyncResponse.class); + } + + /** + * Convert an instance of CloudDeviceApiAsyncResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + @Override public int hashCode() { return Objects.hash(result, saleToPOIRequest); diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java index c20d9739c..86fe878e6 100644 --- a/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java +++ b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java @@ -50,7 +50,7 @@ public void setStatus(DeviceStatus status) { } /** - * Create an instance of DeviceStatus given an JSON string + * Create an instance of DeviceStatusResponse given an JSON string * * @param jsonString JSON string * @return An instance of DeviceStatus @@ -61,7 +61,7 @@ public static DeviceStatusResponse fromJson(String jsonString) throws JsonProces } /** - * Convert an instance of DeviceStatus to an JSON string + * Convert an instance of DeviceStatusResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java b/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java index 9944698db..94021ce9e 100644 --- a/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java +++ b/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java @@ -130,7 +130,7 @@ public CloudDeviceApiAsyncResponse async( if ("ok".equalsIgnoreCase(response.trim())) { cloudDeviceApiAsyncResponse.setResult(response.trim()); } else { - CloudDeviceApiResponse errorResponse = CloudDeviceApiResponse.fromJson(response); + CloudDeviceApiAsyncResponse errorResponse = CloudDeviceApiAsyncResponse.fromJson(response); cloudDeviceApiAsyncResponse.setSaleToPOIRequest(errorResponse.getSaleToPOIRequest()); }