Skip to content

Commit aab21c0

Browse files
authored
Merge pull request #4 from ReSMS-dev/feat/SMS-116_standardize_sdk
SMS-116: standardize sdk
2 parents 623bd62 + 4d9afac commit aab21c0

File tree

4 files changed

+1
-36
lines changed

4 files changed

+1
-36
lines changed

src/main/java/dev/resms/core/net/HttpMethod.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
public enum HttpMethod {
55
GET,
66
POST,
7-
DELETE,
87
}

src/main/java/dev/resms/services/otp/Otp.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
import dev.resms.core.service.BaseService;
77
import dev.resms.services.otp.model.CreateOtpOptions;
88
import dev.resms.services.otp.model.CreateOtpResponse;
9-
import dev.resms.services.otp.model.DeleteOtpResponse;
109
import dev.resms.services.otp.model.VerifyOtpOptions;
1110
import dev.resms.services.otp.model.VerifyOtpResponse;
1211

1312
public class Otp extends BaseService {
1413
private static final String CREATE_OTP_PATH = "/otp";
1514
private static final String VERIFY_OTP_PATH = "/otp/verify";
16-
private static final String DELETE_OTP_PATH = "/otp";
1715

1816
/**
1917
* Constructs an instance of the {@code Otp} class.
@@ -65,25 +63,4 @@ public VerifyOtpResponse verify(VerifyOtpOptions verifyOtpOptions) throws ReSMSE
6563

6664
return reSMSMapper.fromJson(response.getBody(), VerifyOtpResponse.class);
6765
}
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-
}
8966
}

src/main/java/dev/resms/services/otp/model/DeleteOtpResponse.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/java/dev/resms/services/sms/Sms.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import dev.resms.services.sms.validator.SendSmsOptionsValidator;
1010

1111
public class Sms extends BaseService {
12-
private static final String SEND_SMS_PATH = "/sms/send";
12+
private static final String SEND_SMS_PATH = "/sms";
1313

1414
/**
1515
* Constructs an instance of the {@code Sms} class.

0 commit comments

Comments
 (0)