diff --git a/CHANGELOG.md b/CHANGELOG.md index 380f63bc..0294bf57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,14 @@ # Change Log -## [5.45.2](https://github.com/plivo/plivo-java/tree/v5.45.2)(2024-10-16) +## [5.45.3](https://github.com/plivo/plivo-java/tree/v5.45.3)(2024-10-16) **Feature - fraudCheck param in Create, Get and List Session** - Support for the `fraud_check` parameter in sms verify session request - Added support for `fraud_check` in GET and LIST verify session +## [5.45.2](https://github.com/plivo/plivo-java/tree/v5.45.2) (2024-10-14) +**Feature - Fix all null returning params in MMS API Responses** +- Fix MMS API parameters returning NULL and match response with Public APIs +- Change in Code Snippet for List Media using Message UUID + ## [5.45.1](https://github.com/plivo/plivo-java/tree/v5.45.1) (2024-10-10) **Feature - Dtmf param in Create, Get and List Session** - Support for the `dtmf` parameter in voice verify session request diff --git a/src/main/java/com/plivo/api/PlivoAPIService.java b/src/main/java/com/plivo/api/PlivoAPIService.java index 9e20dca4..69fa15de 100644 --- a/src/main/java/com/plivo/api/PlivoAPIService.java +++ b/src/main/java/com/plivo/api/PlivoAPIService.java @@ -216,9 +216,9 @@ Call> messageList(@Path("authId") String authId, Call messageGet(@Path("authId") String authId, @Path("id") String id); @GET("Account/{authId}/Message/{id}/Media/") - Call> mmsMediaList(@Path("authId") String authId, @Path("id") String id); + Call> mmsMediaList(@Path("authId") String authId, @Path("id") String id, @QueryMap Map mediaListRequest); - @GET("Account/{authId}/Message/{id}/Media/{media_id}/") + @GET("Account/{authId}/Message/{id}/Media/{media_id}/") Call mmsMediaGet(@Path("authId") String authId, @Path("id") String id, @Path("media_id") String media_id); @DELETE("Account/{authId}/Message/{id}/Media/") diff --git a/src/main/java/com/plivo/api/models/media/Media.java b/src/main/java/com/plivo/api/models/media/Media.java index 3b78b1ef..504172d4 100644 --- a/src/main/java/com/plivo/api/models/media/Media.java +++ b/src/main/java/com/plivo/api/models/media/Media.java @@ -3,6 +3,7 @@ import com.plivo.api.exceptions.ResourceNotFoundException; import com.plivo.api.models.base.BaseResource; + public class Media extends BaseResource { private String mediaId; @@ -10,17 +11,14 @@ public class Media extends BaseResource { private String contentType; private int size; private String uploadTime; + private String mediaUrl; private String url; - private String status; - private int statusCode; - public static MediaUploader creator( String[] fileNames) throws ResourceNotFoundException { return new MediaUploader(fileNames); } - public static MediaGetter getter(String id) { return new MediaGetter(id); } @@ -28,6 +26,7 @@ public static MediaGetter getter(String id) { public static MediaLister lister() { return new MediaLister(); } + public String getMediaId() { return mediaId; @@ -49,16 +48,12 @@ public String getUploadTime() { return uploadTime; } - public String getUrl() { - return url; + public String getMediaUrl() { + return mediaUrl; } - public String getStatus() { - return status; - } - - public int getStatusCode() { - return statusCode; + public String getUrl() { + return url; } @Override diff --git a/src/main/java/com/plivo/api/models/media/MediaLister.java b/src/main/java/com/plivo/api/models/media/MediaLister.java index cbd75019..600b1c92 100644 --- a/src/main/java/com/plivo/api/models/media/MediaLister.java +++ b/src/main/java/com/plivo/api/models/media/MediaLister.java @@ -2,7 +2,7 @@ import com.plivo.api.models.base.ListResponse; import com.plivo.api.models.base.Lister; -import com.plivo.api.models.media.Media; + import retrofit2.Call; public class MediaLister extends Lister { diff --git a/src/main/java/com/plivo/api/models/media/MediaResponse.java b/src/main/java/com/plivo/api/models/media/MediaResponse.java index d0d1af60..602da97d 100644 --- a/src/main/java/com/plivo/api/models/media/MediaResponse.java +++ b/src/main/java/com/plivo/api/models/media/MediaResponse.java @@ -1,13 +1,14 @@ package com.plivo.api.models.media; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.plivo.api.models.base.BaseResponse; import java.util.List; + public class MediaResponse extends BaseResponse { private List objects; - public List getObjects() { return objects; } diff --git a/src/main/java/com/plivo/api/models/message/MmsMedia.java b/src/main/java/com/plivo/api/models/message/MmsMedia.java index b5ce40ca..5bdd0c5c 100644 --- a/src/main/java/com/plivo/api/models/message/MmsMedia.java +++ b/src/main/java/com/plivo/api/models/message/MmsMedia.java @@ -1,33 +1,51 @@ package com.plivo.api.models.message; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.plivo.api.models.base.BaseResource; +@JsonIgnoreProperties(value = {"id"}) +@JsonInclude(JsonInclude.Include.NON_NULL) public class MmsMedia extends BaseResource { - private String content_type; - private String media_id; - private String media_url; - private String message_uuid; - private long size; + private String mediaId; + private String fileName; + private String contentType; + private long size; + private String uploadTime; + private String mediaUrl; + private String messageUuid; + + public static MmsMediaLister listMedia(String message_uuid) { + return new MmsMediaLister(message_uuid); + } public String getContentType() { - return content_type; + return contentType; } public String getMediaId() { - return media_id; + return mediaId; } public String getMediaUrl() { - return media_url; + return mediaUrl; } public String getMessageUuid() { - return message_uuid; + return messageUuid; } public long getSize() { return size; } + + public String getFileName() { + return fileName; + } + + public String getUploadTime() { + return uploadTime; + } @Override public String getId() { diff --git a/src/main/java/com/plivo/api/models/message/MmsMediaLister.java b/src/main/java/com/plivo/api/models/message/MmsMediaLister.java index cc61ddd9..70064dc4 100644 --- a/src/main/java/com/plivo/api/models/message/MmsMediaLister.java +++ b/src/main/java/com/plivo/api/models/message/MmsMediaLister.java @@ -1,11 +1,11 @@ package com.plivo.api.models.message; import com.plivo.api.models.base.ListResponse; - import com.plivo.api.models.base.Lister; import retrofit2.Call; public class MmsMediaLister extends Lister { + private String id; public MmsMediaLister(String id) { @@ -14,6 +14,6 @@ public MmsMediaLister(String id) { @Override protected Call> obtainCall() { - return client().getApiService().mmsMediaList(client().getAuthId(), id); + return client().getApiService().mmsMediaList(client().getAuthId(), id, toMap()); } } \ No newline at end of file diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index 7eedc2d5..d581d07b 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.45.2 \ No newline at end of file +5.45.3