Skip to content

Commit

Permalink
Merge branch 'master' into SMS-7107
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsin-plivo authored Oct 18, 2024
2 parents 4e8ed57 + 986f8cb commit a0e2636
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 29 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
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.2
5.45.3

0 comments on commit a0e2636

Please sign in to comment.