From 26506c2a414c0087f43406b7b9a3857a2bb44f13 Mon Sep 17 00:00:00 2001 From: Roman Strobl Date: Thu, 28 Nov 2024 12:49:59 +0800 Subject: [PATCH] Remove redundant parameters --- .../request/OperationApproveRequest.java | 12 +++++------ .../model/request/OperationCancelRequest.java | 4 ++-- .../model/request/OperationClaimRequest.java | 4 ++-- .../model/request/OperationCreateRequest.java | 20 +++++++++---------- .../model/request/OperationDetailRequest.java | 2 +- .../model/request/OperationExtIdRequest.java | 4 ++-- .../request/OperationFailApprovalRequest.java | 4 ++-- .../request/OperationListForUserRequest.java | 6 +++--- .../model/request/OperationRejectRequest.java | 8 ++++---- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationApproveRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationApproveRequest.java index bcc932a5f..3ea28d2de 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationApproveRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationApproveRequest.java @@ -37,27 +37,27 @@ @Data public class OperationApproveRequest { - @Schema(description = "The identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the operation") @NotBlank(message = "Operation ID must not be empty when approving operation") private String operationId; - @Schema(description = "The identifier of the user", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the user") @NotBlank(message = "User ID must not be empty when approving operation") private String userId; - @Schema(description = "The identifier of the application", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the application") @NotBlank(message = "Application ID must not be empty when approving operation") private String applicationId; - @Schema(description = "Operation data to approve", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "Operation data to approve") @NotBlank(message = "Data must not be empty when approving operation") private String data; - @Schema(description = "PowerAuth signature type", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "PowerAuth signature type") @NotNull(message = "Signature type must not be null when approving operation") private SignatureType signatureType; - @Schema(description = "Additional data associated with the operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Additional data associated with the operation") @JsonSetter(nulls = Nulls.SKIP) private final Map additionalData = new LinkedHashMap<>(); diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCancelRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCancelRequest.java index 76bb18f05..c3608b1e5 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCancelRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCancelRequest.java @@ -36,11 +36,11 @@ @Data public class OperationCancelRequest { - @Schema(description = "The identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the operation") @NotBlank(message = "Operation ID must not be empty when cancelling operation") private String operationId; - @Schema(description = "Additional data associated with the operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Additional data associated with the operation") @JsonSetter(nulls = Nulls.SKIP) private final Map additionalData = new LinkedHashMap<>(); diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationClaimRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationClaimRequest.java index 35721885a..b178f72f7 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationClaimRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationClaimRequest.java @@ -33,14 +33,14 @@ public class OperationClaimRequest { /** * Operation identifier. */ - @Schema(description = "The identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the operation") @NotBlank(message = "Operation ID must not be empty when requesting operation claim") private String operationId; /** * User identifier of the user who is claiming the operation. */ - @Schema(description = "The identifier of the user", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the user") @NotBlank(message = "User ID must not be empty when requesting operation claim") private String userId; diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCreateRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCreateRequest.java index 08bf008c6..b9aa22421 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCreateRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationCreateRequest.java @@ -11,40 +11,40 @@ @Data public class OperationCreateRequest { - @Schema(description = "The identifier of the user", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "The identifier of the user") @Size(min = 1, message = "User ID must not be empty when creating operation") private String userId; - @Schema(description = "List of associated applications", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "List of associated applications") @NotNull(message = "Application ID list must not be null when creating operation") @Size(min = 1, message = "Application ID list must not be empty when creating operation") private List applications = new ArrayList<>(); - @Schema(description = "Activation flag associated with the operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Activation flag associated with the operation") private String activationFlag; - @Schema(description = "Name of the template used for creating the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "Name of the template used for creating the operation") @NotBlank(message = "Template name must not be empty when creating operation") private String templateName; - @Schema(description = "Timestamp of when the operation will expire, overrides expiration period from operation template", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Timestamp of when the operation will expire, overrides expiration period from operation template") private Date timestampExpires; - @Schema(description = "External identifier of the operation, i.e., ID from transaction system", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "External identifier of the operation, i.e., ID from transaction system") private String externalId; - @Schema(description = "Parameters of the operation, will be filled to the operation data", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Parameters of the operation, will be filled to the operation data") @JsonSetter(nulls = Nulls.SKIP) private final Map parameters = new LinkedHashMap<>(); - @Schema(description = "Additional data associated with the operation to initialize the operation context", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Additional data associated with the operation to initialize the operation context") @JsonSetter(nulls = Nulls.SKIP) private Map additionalData = new LinkedHashMap<>(); - @Schema(description = "Whether proximity check should be used, overrides configuration from operation template", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Whether proximity check should be used, overrides configuration from operation template") private Boolean proximityCheckEnabled; - @Schema(description = "Activation ID. It is possible to specify a single device (otherwise all user's activations are taken into account).", requiredMode = Schema.RequiredMode.NOT_REQUIRED, maxLength = 37) + @Schema(description = "Activation ID. It is possible to specify a single device (otherwise all user's activations are taken into account).") @Size(max = 37, message = "Activation ID must not exceed 37 characters when creating operation") private String activationId; } diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationDetailRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationDetailRequest.java index 8614a3fc9..d303f5da1 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationDetailRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationDetailRequest.java @@ -30,7 +30,7 @@ @Data public class OperationDetailRequest { - @Schema(description = "The identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the operation") @NotBlank(message = "Operation ID must not be empty when requesting operation detail") private String operationId; diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationExtIdRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationExtIdRequest.java index 2036fd54f..a27540b04 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationExtIdRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationExtIdRequest.java @@ -33,11 +33,11 @@ @Data public class OperationExtIdRequest { - @Schema(description = "External identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "External identifier of the operation") @NotBlank(message = "External ID must not be empty when requesting operation lookup by external ID") private String externalId; - @Schema(description = "Associated application identifiers", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "Associated application identifiers") @NotNull(message = "Application ID list must not be null when requesting operation lookup by external ID") @Size(min = 1, message = "Application ID list must not be empty when requesting operation lookup by external ID") private List applications = new ArrayList<>(); diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationFailApprovalRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationFailApprovalRequest.java index acee00b3e..3f6cf3716 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationFailApprovalRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationFailApprovalRequest.java @@ -35,11 +35,11 @@ @Data public class OperationFailApprovalRequest { - @Schema(description = "The identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the operation") @NotBlank(message = "Operation ID must not be empty when requesting operation approval failure") private String operationId; - @Schema(description = "Additional data associated with the operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Additional data associated with the operation") @JsonSetter(nulls = Nulls.SKIP) private final Map additionalData = new LinkedHashMap<>(); diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationListForUserRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationListForUserRequest.java index fd504b59f..216db2e5b 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationListForUserRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationListForUserRequest.java @@ -36,11 +36,11 @@ @Data public class OperationListForUserRequest { - @Schema(description = "The identifier of the user", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the user") @NotBlank(message = "User ID must not be empty when requesting operation list") private String userId; - @Schema(description = "Associated application identifiers", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "Associated application identifiers") @NotNull(message = "Application ID list must not be null when requesting operation list") @Size(min = 1, message = "Application ID list must not be empty when requesting operation list") private List applications = new ArrayList<>(); @@ -51,7 +51,7 @@ public class OperationListForUserRequest { @Min(1) private Integer pageSize; - @Schema(description = "The identifier of the activation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "The identifier of the activation") private String activationId; } diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationRejectRequest.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationRejectRequest.java index 8a9128e14..1b1dcd0a7 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationRejectRequest.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/request/OperationRejectRequest.java @@ -35,19 +35,19 @@ @Data public class OperationRejectRequest { - @Schema(description = "The identifier of the operation", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the operation") @NotBlank(message = "Operation ID must not be empty when rejecting operation") private String operationId; - @Schema(description = "The identifier of the user", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the user") @NotBlank(message = "User ID must not be empty when rejecting operation") private String userId; - @Schema(description = "The identifier of the application", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "The identifier of the application") @NotBlank(message = "Application ID must not be empty when rejecting operation") private String applicationId; - @Schema(description = "Additional data associated with the operation", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Schema(description = "Additional data associated with the operation") @JsonSetter(nulls = Nulls.SKIP) private final Map additionalData = new LinkedHashMap<>();