Skip to content

Commit

Permalink
Merge pull request #290 from plivo/SMS-7112
Browse files Browse the repository at this point in the history
SMS-7112: Fix for MMS API Responses
  • Loading branch information
renoldthomas-plivo authored Oct 17, 2024
2 parents 81636d9 + ba5123f commit 986f8cb
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Change Log
## [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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Plivo Java SDK makes it simpler to integrate communications into your Java a

### To Install Stable release

You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.45.1/plivo-java-5.45.1.jar).
You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.45.2/plivo-java-5.45.2.jar).


If you are using Maven, use the following XML to include the Plivo SDK as a dependency.
Expand All @@ -19,13 +19,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe
<dependency>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.45.1</version>
<version>5.45.2</version>
</dependency>
```

If you are using Gradle, use the following line in your dependencies.
```
compile 'com.plivo:plivo-java:5.45.1'
compile 'com.plivo:plivo-java:5.45.2'
```

### To Install Beta release
Expand Down
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Written manually.

version=5.45.1
version=5.45.2
groupId=com.plivo
artifactId=plivo-java

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.45.1</version>
<version>5.45.2</version>
<name>plivo-java</name>
<description>A Java SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML</description>
<licenses>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/plivo/api/PlivoAPIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ Call<ListResponse<Message>> messageList(@Path("authId") String authId,
Call<Message> messageGet(@Path("authId") String authId, @Path("id") String id);

@GET("Account/{authId}/Message/{id}/Media/")
Call<ListResponse<MmsMedia>> mmsMediaList(@Path("authId") String authId, @Path("id") String id);
Call<ListResponse<MmsMedia>> mmsMediaList(@Path("authId") String authId, @Path("id") String id, @QueryMap Map<String, Object> mediaListRequest);

@GET("Account/{authId}/Message/{id}/Media/{media_id}/")
@GET("Account/{authId}/Message/{id}/Media/{media_id}/")
Call<MmsMedia> mmsMediaGet(@Path("authId") String authId, @Path("id") String id, @Path("media_id") String media_id);

@DELETE("Account/{authId}/Message/{id}/Media/")
Expand Down
19 changes: 7 additions & 12 deletions src/main/java/com/plivo/api/models/media/Media.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,30 @@
import com.plivo.api.exceptions.ResourceNotFoundException;
import com.plivo.api.models.base.BaseResource;


public class Media extends BaseResource {

private String mediaId;
private String fileName;
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);
}

public static MediaLister lister() {
return new MediaLister();
}


public String getMediaId() {
return mediaId;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/plivo/api/models/media/MediaLister.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Media> {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/plivo/api/models/media/MediaResponse.java
Original file line number Diff line number Diff line change
@@ -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<MediaUploadResponse> objects;


public List<MediaUploadResponse> getObjects() {
return objects;
}
Expand Down
36 changes: 27 additions & 9 deletions src/main/java/com/plivo/api/models/message/MmsMedia.java
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<MmsMedia> {

private String id;

public MmsMediaLister(String id) {
Expand All @@ -14,6 +14,6 @@ public MmsMediaLister(String id) {

@Override
protected Call<ListResponse<MmsMedia>> obtainCall() {
return client().getApiService().mmsMediaList(client().getAuthId(), id);
return client().getApiService().mmsMediaList(client().getAuthId(), id, toMap());
}
}
2 changes: 1 addition & 1 deletion src/main/resources/com/plivo/api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.45.1
5.45.2

0 comments on commit 986f8cb

Please sign in to comment.