|
6 | 6 | import dev.resms.core.service.BaseService; |
7 | 7 | import dev.resms.services.otp.model.CreateOtpOptions; |
8 | 8 | import dev.resms.services.otp.model.CreateOtpResponse; |
9 | | -import dev.resms.services.otp.model.DeleteOtpResponse; |
10 | 9 | import dev.resms.services.otp.model.VerifyOtpOptions; |
11 | 10 | import dev.resms.services.otp.model.VerifyOtpResponse; |
12 | 11 |
|
13 | 12 | public class Otp extends BaseService { |
14 | 13 | private static final String CREATE_OTP_PATH = "/otp"; |
15 | 14 | private static final String VERIFY_OTP_PATH = "/otp/verify"; |
16 | | - private static final String DELETE_OTP_PATH = "/otp"; |
17 | 15 |
|
18 | 16 | /** |
19 | 17 | * Constructs an instance of the {@code Otp} class. |
@@ -65,25 +63,4 @@ public VerifyOtpResponse verify(VerifyOtpOptions verifyOtpOptions) throws ReSMSE |
65 | 63 |
|
66 | 64 | return reSMSMapper.fromJson(response.getBody(), VerifyOtpResponse.class); |
67 | 65 | } |
68 | | - |
69 | | - /** |
70 | | - * Delete an OTP based on its id |
71 | | - * |
72 | | - * @param otpId The id of the OTP to delete. |
73 | | - * @return The response indicating the status of the OTP deletion. |
74 | | - * @throws ReSMSException If an error occurs while deleting the OTP. |
75 | | - */ |
76 | | - public DeleteOtpResponse delete(String otpId) throws ReSMSException { |
77 | | - String payload = "{\"otpId\": \"" + otpId + "\"}"; |
78 | | - |
79 | | - AbstractHttpResponse<String> response = |
80 | | - super.httpClient.perform(DELETE_OTP_PATH, apiKey, HttpMethod.DELETE, payload); |
81 | | - |
82 | | - if (!response.isSuccessful()) { |
83 | | - throw new ReSMSException( |
84 | | - "Failed to create otp: " + response.getCode() + " " + response.getBody()); |
85 | | - } |
86 | | - |
87 | | - return reSMSMapper.fromJson(response.getBody(), DeleteOtpResponse.class); |
88 | | - } |
89 | 66 | } |
0 commit comments