Skip to content

Commit 629f571

Browse files
committed
Pull request #6: Release v2.5.0
Merge in SDK/java_telesign from developer to master * commit '7082240bbe808df2db5f2862808d41bc2b754556': Applied suggestion Updating PATCH documentation Updating version Updating changelog Adding patch method
2 parents 22d4b94 + 7082240 commit 629f571

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.5.0](http://central.maven.org/maven2/com/telesign/telesign/2.5.0/) - 2025-05-06
2+
- 2025-06-03
3+
- Added patch method to RestClient.
4+
15
## [2.4.0](http://central.maven.org/maven2/com/telesign/telesign/2.4.0/) - 2025-05-06
26
- 2025-05-06
37
- Added tracking to requests.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group 'com.telesign'
11-
version '2.4.0'
11+
version '2.5.0'
1212

1313
sourceCompatibility = JavaVersion.VERSION_1_8
1414
targetCompatibility = JavaVersion.VERSION_1_8
@@ -93,7 +93,7 @@ if (System.getenv('TRAVIS') == null) {
9393

9494
groupId = 'com.telesign'
9595
artifactId = 'telesign'
96-
version = '2.3.1'
96+
version = '2.5.0'
9797

9898
pom {
9999
name = 'Telesign SDK'

src/main/java/com/telesign/RestClient.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class RestClient {
3030

3131
public static final String URL_FORM_ENCODED_CONTENT_TYPE = "application/x-www-form-urlencoded";
3232
public static final String JSON_CONTENT_TYPE = "application/json";
33+
public static final String AUTH_BASIC = "Basic";
3334

3435
protected String customerId;
3536
protected String apiKey;
@@ -363,6 +364,25 @@ public TelesignResponse put(String resource, Map<String, String> params)
363364
return this.execute("PUT", resource, params, URL_FORM_ENCODED_CONTENT_TYPE, null);
364365
}
365366

367+
/**
368+
* Generic TeleSign REST API PATCH handler.
369+
*
370+
* @param resource
371+
* The partial resource URI to perform the request against.
372+
* @param params
373+
* Params to perform the PATCH request with.
374+
* @param contentType
375+
* Appication/json, www-url ....
376+
* @param authMethod
377+
* Basic, Digest ...
378+
* @return The TelesignResponse for the request.
379+
*/
380+
public TelesignResponse patch(String resource, Map<String, String> params, String contentType, String authMethod)
381+
throws IOException, GeneralSecurityException {
382+
383+
return this.execute("PATCH", resource, params, contentType, authMethod);
384+
}
385+
366386
/**
367387
* Generic TeleSign REST API DELETE handler.
368388
*
@@ -445,7 +465,7 @@ private TelesignResponse execute(String methodName, String resource, Map<String,
445465

446466
RequestBody requestBody = null;
447467
String requestParams = "";
448-
if (methodName.equals("POST") || methodName.equals("PUT")) {
468+
if (methodName.equals("POST") || methodName.equals("PUT") || methodName.equals("PATCH")) {
449469
requestBody = this.createRequestBody(params, contentType);
450470
if (requestBody != null) {
451471
Buffer buffer = new Buffer();

0 commit comments

Comments
 (0)