diff --git a/CHANGELOG.md b/CHANGELOG.md index 174d3c8a..53f588a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ **Feature - Import Campaign API** - Import Campaign API + +## [5.38.3](https://github.com/plivo/plivo-java/tree/v5.38.3) (2024-02-28) +**Feature - Log Redaction Enhancement** +- Added log attribute in GET and List MDR response +- Change log field from bool to string in send SMS + ## [5.38.2](https://github.com/plivo/plivo-java/tree/v5.38.2) (2024-01-15) **Feature - Made meta object consistent for List Powerpacks, List Media, List Numbers, List Shortcodes, List Tollfree API** - Made meta object consistent in API response diff --git a/src/main/java/com/plivo/api/models/message/Message.java b/src/main/java/com/plivo/api/models/message/Message.java index 801b88f1..27d572a7 100644 --- a/src/main/java/com/plivo/api/models/message/Message.java +++ b/src/main/java/com/plivo/api/models/message/Message.java @@ -33,6 +33,7 @@ public class Message extends BaseResource { private String conversationID; private String conversationOrigin; private String conversationExpirationTimestamp; + private String log; public static MessageCreator creator(String source, String destination) { return new MessageCreator(source, destination); @@ -174,6 +175,10 @@ public String getConversationOrigin() { public String getConversationExpirationTimestamp() { return conversationExpirationTimestamp; } + + public String getLog() { + return log; + } @Override public String getId() { diff --git a/src/main/java/com/plivo/api/models/message/MessageCreator.java b/src/main/java/com/plivo/api/models/message/MessageCreator.java index bba863a1..76c265ea 100644 --- a/src/main/java/com/plivo/api/models/message/MessageCreator.java +++ b/src/main/java/com/plivo/api/models/message/MessageCreator.java @@ -27,7 +27,7 @@ public class MessageCreator extends Creator < MessageCreateResponse > { private MessageType type = null; private URL url = null; private String method = "POST"; - private Boolean log = null; + private String log = "true"; private Boolean trackable = null; private String[] media_urls = null; private String[] media_ids = null; @@ -135,7 +135,7 @@ public String method() { return this.method; } - public Boolean log() { + public String log() { return this.log; } @@ -191,8 +191,14 @@ public MessageCreator method(final String method) { * @param log If set to false, the content of this message will not be logged on the Plivo * infrastructure and the dst value will be masked */ - public MessageCreator log(final Boolean log) { - this.log = log; + public MessageCreator log(final Object log) { + if (log instanceof Boolean) { + this.log = ((Boolean) log).toString(); + } else if (log instanceof String) { + this.log = (String) log; + } else { + throw new IllegalArgumentException("Invalid log value. Expected boolean or string."); + } return this; }