diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java index f0339f21..88dbd0ff 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java @@ -8,6 +8,9 @@ package com.microsoft.bot.schema; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -18,6 +21,7 @@ import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneId; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,18 +41,22 @@ public class Activity { * The {@link ActivityTypes} of the activity. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; /** * Contains an ID that uniquely identifies the activity on the channel. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format. */ @JsonProperty(value = "timestamp") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm'Z'", timezone = "UTC") private OffsetDateTime timestamp; /** @@ -56,6 +64,8 @@ public class Activity { * For example, 2016-09-23T13:07:49.4714686-07:00. */ @JsonProperty(value = "localTimestamp") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm'Z'") private OffsetDateTime localTimestamp; /** @@ -63,6 +73,7 @@ public class Activity { * For example, America/Los_Angeles. */ @JsonProperty(value = "localTimezone") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String localTimezone; /** @@ -71,36 +82,42 @@ public class Activity { * that asserts the identity of the callers (e.g. tokens). */ @JsonProperty(value = "callerId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String callerId; /** * Contains the URL that specifies the channel's service endpoint. Set by the channel. */ @JsonProperty(value = "serviceUrl") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String serviceUrl; /** * Contains an ID that uniquely identifies the channel. Set by the channel. */ @JsonProperty(value = "channelId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String channelId; /** * Identifies the sender of the message. */ @JsonProperty(value = "from") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ChannelAccount from; /** * Identifies the conversation to which the activity belongs. */ @JsonProperty(value = "conversation") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ConversationAccount conversation; /** * Identifies the recipient of the message. */ @JsonProperty(value = "recipient") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ChannelAccount recipient; /** @@ -108,48 +125,56 @@ public class Activity { * 'markdown', 'plain', 'xml'. */ @JsonProperty(value = "textFormat") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private TextFormatTypes textFormat; /** * The layout hint for multiple attachments. Default: list. */ @JsonProperty(value = "attachmentLayout") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private AttachmentLayoutTypes attachmentLayout; /** * The collection of members added to the conversation. */ @JsonProperty(value = "membersAdded") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List membersAdded; /** * The collection of members removed from the conversation. */ @JsonProperty(value = "membersRemoved") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List membersRemoved; /** * The collection of reactions added to the conversation. */ @JsonProperty(value = "reactionsAdded") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List reactionsAdded; /** * The collection of reactions removed from the conversation. */ @JsonProperty(value = "reactionsRemoved") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List reactionsRemoved; /** * The updated topic name of the conversation. */ @JsonProperty(value = "topicName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String topicName; /** * Indicates whether the prior history of the channel is disclosed. */ @JsonProperty(value = "historyDisclosed") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean historyDisclosed; /** @@ -160,18 +185,21 @@ public class Activity { * The locale name can also correspond to a valid BCP-47 language tag. */ @JsonProperty(value = "locale") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String locale; /** * The text content of the message. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * The text to speak. */ @JsonProperty(value = "speak") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String speak; /** @@ -179,94 +207,110 @@ public class Activity { * is delivered to the client. */ @JsonProperty(value = "inputHint") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private InputHints inputHint; /** * The text to display if the channel cannot render cards. */ @JsonProperty(value = "summary") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String summary; /** * The suggested actions for the activity. */ @JsonProperty(value = "suggestedActions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private SuggestedActions suggestedActions; /** * Attachments. */ @JsonProperty(value = "attachments") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List attachments; /** * Represents the entities that were mentioned in the message. */ @JsonProperty(value = "entities") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List entities; /** * Contains channel-specific content. */ @JsonProperty(value = "channelData") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object channelData; /** * Indicates whether the recipient of a contactRelationUpdate was added or removed from the sender's contact list. */ @JsonProperty(value = "action") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String action; /** * Contains the ID of the message to which this message is a reply. */ @JsonProperty(value = "replyToId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String replyToId; /** * A descriptive label for the activity. */ @JsonProperty(value = "label") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String label; /** * The type of the activity's value object. */ @JsonProperty(value = "valueType") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String valueType; /** * A value that is associated with the activity. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object value; /** * The name of the operation associated with an invoke or event activity. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** * A reference to another conversation or activity. */ @JsonProperty(value = "relatesTo") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ConversationReference relatesTo; /** * The a code for endOfConversation activities that indicates why the conversation ended. */ @JsonProperty(value = "code") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private EndOfConversationCodes code; /** * The time at which the activity should be considered to be expired and should not be presented to the recipient. */ @JsonProperty(value = "expiration") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private LocalDateTime expiration; /** * The importance of the activity. */ @JsonProperty(value = "importance") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String importance; /** @@ -275,18 +319,21 @@ public class Activity { * The default delivery mode is \"default\". */ @JsonProperty(value = "deliveryMode") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String deliveryMode; /** * List of phrases and references that speech and language priming systems should listen for. */ @JsonProperty(value = "listenFor") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List listenFor; /** * The collection of text fragments to highlight when the activity contains a ReplyToId value. */ @JsonProperty(value = "textHighlights") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List textHighlights; /** @@ -1228,7 +1275,12 @@ public class Activity { * * @return The array of mentions; or an empty array, if none are found. */ + @JsonIgnore public List getMentions() { + if (this.getEntities() == null) { + return Collections.emptyList(); + } + return this.getEntities().stream() .filter(entity -> entity.getType().equalsIgnoreCase("mention")) .map(entity -> entity.getAs(Mention.class)) @@ -1275,6 +1327,7 @@ public class Activity { * Creates a {@link ConversationReference} based on this activity. * @return A conversation reference for the conversation that contains this activity. */ + @JsonIgnore public ConversationReference getConversationReference() { return new ConversationReference() {{ setActivityId(Activity.this.getId()); @@ -1292,6 +1345,7 @@ public class Activity { * @param reply ResourceResponse returned from sendActivity. * @return A ConversationReference that can be stored and used later to delete or update the activity. */ + @JsonIgnore public ConversationReference getReplyConversationReference(ResourceResponse reply) { ConversationReference reference = getConversationReference(); reference.setActivityId(reply.getId()); diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AnimationCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AnimationCard.java index 8198d49b..a065bae5 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AnimationCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AnimationCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,24 +19,28 @@ public class AnimationCard { * Title of this card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of this card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text of this card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Thumbnail placeholder. */ @JsonProperty(value = "image") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ThumbnailUrl image; /** @@ -43,24 +48,28 @@ public class AnimationCard { * format of the same content. */ @JsonProperty(value = "media") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List media; /** * Actions on this card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** * This content may be shared with others (default:true). */ @JsonProperty(value = "shareable") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean shareable; /** * Should the client loop playback at end of content (default:true). */ @JsonProperty(value = "autoloop") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean autoloop; /** @@ -75,6 +84,7 @@ public class AnimationCard { * and "4:3". */ @JsonProperty(value = "aspect") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String aspect; /** @@ -82,12 +92,14 @@ public class AnimationCard { * an ISO 8601 Duration field. */ @JsonProperty(value = "duration") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String duration; /** * Supplementary parameter for this card. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object value; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Attachment.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Attachment.java index 074422b9..ae09c33a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Attachment.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Attachment.java @@ -8,6 +8,7 @@ package com.microsoft.bot.schema; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; @@ -25,30 +26,35 @@ public class Attachment { * mimetype/Contenttype for the file. */ @JsonProperty(value = "contentType") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String contentType; /** * Content Url. */ @JsonProperty(value = "contentUrl") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String contentUrl; /** * Embedded content. */ @JsonProperty(value = "content") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object content; /** * (OPTIONAL) The name of the attachment. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** * (OPTIONAL) Thumbnail associated with attachment. */ @JsonProperty(value = "thumbnailUrl") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String thumbnailUrl; /** * Holds the overflow properties that aren't first class diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentData.java index a0950bce..5cc544dd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentData.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentData.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,24 +17,28 @@ public class AttachmentData { * Content-Type of the attachment. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; /** * Name of the attachment. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** * Attachment content. */ @JsonProperty(value = "originalBase64") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private byte[] originalBase64; /** * Attachment thumbnail. */ @JsonProperty(value = "thumbnailBase64") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private byte[] thumbnailBase64; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentInfo.java index 5dac1f9e..d8091f76 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentInfo.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,18 +19,21 @@ public class AttachmentInfo { * Name of the attachment. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** * ContentType of the attachment. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; /** * attachment views. */ @JsonProperty(value = "views") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List views; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentView.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentView.java index 0a08e491..887c567b 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentView.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AttachmentView.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,12 +17,14 @@ public class AttachmentView { * Id of the attachment. */ @JsonProperty(value = "viewId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String viewId; /** * Size of the attachment. */ @JsonProperty(value = "size") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Integer size; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AudioCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AudioCard.java index 8641062f..21bc21e2 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AudioCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/AudioCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,24 +19,28 @@ public class AudioCard { * Title of this card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of this card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text of this card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Thumbnail placeholder. */ @JsonProperty(value = "image") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ThumbnailUrl image; /** @@ -43,24 +48,28 @@ public class AudioCard { * alternative format of the same content. */ @JsonProperty(value = "media") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List media; /** * Actions on this card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** * This content may be shared with others (default:true). */ @JsonProperty(value = "shareable") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean shareable; /** * Should the client loop playback at end of content (default:true). */ @JsonProperty(value = "autoloop") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean autoloop; /** @@ -68,6 +77,7 @@ public class AudioCard { * (default:true). */ @JsonProperty(value = "autostart") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean autostart; /** @@ -75,6 +85,7 @@ public class AudioCard { * and "4:3". */ @JsonProperty(value = "aspect") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String aspect; /** @@ -82,12 +93,14 @@ public class AudioCard { * ISO 8601 Duration field. */ @JsonProperty(value = "duration") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String duration; /** * Supplementary parameter for this card. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object value; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/BasicCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/BasicCard.java index 11256c0c..8d5db312 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/BasicCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/BasicCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,36 +19,42 @@ public class BasicCard { * Title of the card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of the card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text for the card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Array of images for the card. */ @JsonProperty(value = "images") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List images; /** * Set of actions applicable to the current card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** * This action will be activated when user taps on the card itself. */ @JsonProperty(value = "tap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardAction tap; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardAction.java index d8a84ee5..824ad302 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardAction.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -18,30 +19,35 @@ public class CardAction { * 'downloadFile', 'signin', 'call', 'payment', 'messageBack'. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ActionTypes type; /** * Text description which appears on the button. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Image URL which will appear on the button, next to text label. */ @JsonProperty(value = "image") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String image; /** * Text for this action. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * (Optional) text to display in the chat feed if the button is clicked. */ @JsonProperty(value = "displayText") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String displayText; /** @@ -49,12 +55,14 @@ public class CardAction { * the ActionType. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object value; /** * Channel-specific data associated with this action. */ @JsonProperty(value = "channelData") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object channelData; public static CardAction clone(CardAction cardAction) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardImage.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardImage.java index 46c100c8..310c7c95 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardImage.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/CardImage.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,18 +17,21 @@ public class CardImage { * URL thumbnail image for major content property. */ @JsonProperty(value = "url") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String url; /** * Image description intended for screen readers. */ @JsonProperty(value = "alt") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String alt; /** * Action assigned to specific Attachment. */ @JsonProperty(value = "tap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardAction tap; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ChannelAccount.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ChannelAccount.java index 7934546b..d80b7330 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ChannelAccount.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ChannelAccount.java @@ -8,6 +8,7 @@ package com.microsoft.bot.schema; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; @@ -26,18 +27,21 @@ public class ChannelAccount { * or @joesmith or 123456). */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Display friendly name. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** * This account's object ID within Azure Active Directory (AAD). */ @JsonProperty(value = "aadObjectId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String aadObjectId; /** @@ -45,6 +49,7 @@ public class ChannelAccount { * Possible values include: 'user', 'bot'. */ @JsonProperty(value = "role") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private RoleTypes role; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationAccount.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationAccount.java index 6d99452e..ffe1468c 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationAccount.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationAccount.java @@ -8,6 +8,7 @@ package com.microsoft.bot.schema; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; @@ -30,12 +31,14 @@ public class ConversationAccount { * between conversation types. */ @JsonProperty(value = "conversationType") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String conversationType; /** * This conversation's tenant ID. */ @JsonProperty(value = "tenantId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String tenantId; /** @@ -43,18 +46,21 @@ public class ConversationAccount { * or @joesmith or 123456). */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Display friendly name. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** * This account's object ID within Azure Active Directory (AAD). */ @JsonProperty(value = "aadObjectId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String aadObjectId; /** @@ -62,6 +68,7 @@ public class ConversationAccount { * Possible values include: 'user', 'bot'. */ @JsonProperty(value = "role") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private RoleTypes role; public ConversationAccount() { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationMembers.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationMembers.java index 475c8c73..df21d33d 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationMembers.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationMembers.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,12 +19,14 @@ public class ConversationMembers { * Conversation ID. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * List of members in this conversation. */ @JsonProperty(value = "members") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List members; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationParameters.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationParameters.java index 2856e3ed..7e0a1605 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationParameters.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationParameters.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -24,24 +25,28 @@ public class ConversationParameters { * The bot address for this conversation. */ @JsonProperty(value = "bot") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ChannelAccount bot; /** * Members to add to the conversation. */ @JsonProperty(value = "members") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List members; /** * (Optional) Topic of the conversation (if supported by the channel). */ @JsonProperty(value = "topicName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String topicName; /** * (Optional) The tenant ID in which the conversation should be created. */ @JsonProperty(value = "tenantId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String tenantId; /** @@ -49,12 +54,14 @@ public class ConversationParameters { * intial message to the conversation. */ @JsonProperty(value = "activity") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Activity activity; /** * Channel specific payload for creating the conversation. */ @JsonProperty(value = "channelData") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object channelData; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationReference.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationReference.java index c532b66e..515ef543 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationReference.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationReference.java @@ -8,6 +8,7 @@ package com.microsoft.bot.schema; import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -18,30 +19,35 @@ public class ConversationReference { * (Optional) ID of the activity to refer to. */ @JsonProperty(value = "activityId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String activityId; /** * (Optional) User participating in this conversation. */ @JsonProperty(value = "user") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ChannelAccount user; /** * Bot participating in this conversation. */ @JsonProperty(value = "bot") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ChannelAccount bot; /** * Conversation reference. */ @JsonProperty(value = "conversation") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ConversationAccount conversation; /** * Channel ID. */ @JsonProperty(value = "channelId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String channelId; /** @@ -49,6 +55,7 @@ public class ConversationReference { * may be performed. */ @JsonProperty(value = "serviceUrl") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String serviceUrl; public static ConversationReference clone(ConversationReference conversationReference) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationResourceResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationResourceResponse.java index 749a352c..9b72d5df 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationResourceResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationResourceResponse.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,6 +17,7 @@ public class ConversationResourceResponse { * ID of the Activity (if sent). */ @JsonProperty(value = "activityId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String activityId; /** @@ -23,12 +25,14 @@ public class ConversationResourceResponse { * performed. */ @JsonProperty(value = "serviceUrl") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String serviceUrl; /** * Id of the resource. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationsResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationsResult.java index c2faa0d0..03854721 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationsResult.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ConversationsResult.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,12 +19,14 @@ public class ConversationsResult { * Paging token. */ @JsonProperty(value = "continuationToken") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String continuationToken; /** * List of conversations. */ @JsonProperty(value = "conversations") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List conversations; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Entity.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Entity.java index 5d2c5bd9..3b4d9d27 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Entity.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Entity.java @@ -8,6 +8,7 @@ package com.microsoft.bot.schema; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -24,7 +25,12 @@ import java.util.stream.Collectors; * Metadata object pertaining to an activity. */ public class Entity { - private ObjectMapper objectMapper = new ObjectMapper(); + private static ObjectMapper objectMapper; + + static { + objectMapper = new ObjectMapper(); + objectMapper.findAndRegisterModules(); + } /** */ @@ -34,6 +40,7 @@ public class Entity { * Type of this entity (RFC 3987 IRI). */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; public static Entity clone(Entity entity) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Error.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Error.java index 66bec01a..08c0fb35 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Error.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Error.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,18 +17,21 @@ public class Error { * Error code. */ @JsonProperty(value = "code") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String code; /** * Error message. */ @JsonProperty(value = "message") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String message; /** * Error from inner http call */ @JsonProperty(value = "innerHttpError") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private InnerHttpError innerHttpError; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ErrorResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ErrorResponse.java index 5057d699..64809df6 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ErrorResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ErrorResponse.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -20,6 +21,7 @@ public class ErrorResponse { * Error message. */ @JsonProperty(value = "error") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Error error; public ErrorResponse(Error withError) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Fact.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Fact.java index f2c6dab0..2896488f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Fact.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Fact.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -19,12 +20,14 @@ public class Fact { * The key for this Fact. */ @JsonProperty(value = "key") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String key; /** * The value for this Fact. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String value; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/GeoCoordinates.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/GeoCoordinates.java index 35303476..7fed25f8 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/GeoCoordinates.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/GeoCoordinates.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -37,12 +38,14 @@ public class GeoCoordinates implements EntitySerialization { * The type of the thing. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; /** * The name of the thing. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; public GeoCoordinates() { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/HeroCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/HeroCard.java index f7d5d715..c5e712a0 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/HeroCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/HeroCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,36 +19,42 @@ public class HeroCard { * Title of the card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of the card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text for the card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Array of images for the card. */ @JsonProperty(value = "images") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List images; /** * Set of actions applicable to the current card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** * This action will be activated when user taps on the card itself. */ @JsonProperty(value = "tap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardAction tap; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/InnerHttpError.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/InnerHttpError.java index d9cf2598..3f6cbecd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/InnerHttpError.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/InnerHttpError.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,12 +17,14 @@ public class InnerHttpError { * HttpStatusCode from failed request. */ @JsonProperty(value = "statusCode") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private int statusCode; /** * Body from failed request. */ @JsonProperty(value = "body") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object body; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaCard.java index a414259d..f4a30565 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,36 +19,42 @@ public class MediaCard { * Title of this card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of this card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text of this card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Thumbnail placeholder. */ @JsonProperty(value = "image") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ThumbnailUrl image; /** * Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. */ @JsonProperty(value = "media") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List media; /** * Actions on this card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** @@ -74,6 +81,7 @@ public class MediaCard { * and "4:3". */ @JsonProperty(value = "aspect") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String aspect; /** @@ -81,12 +89,14 @@ public class MediaCard { * Formatted as an ISO 8601 Duration field. */ @JsonProperty(value = "duration") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String duration; /** * Supplementary parameter for this card. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object value; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaEventValue.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaEventValue.java index 1d427029..585ab973 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaEventValue.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaEventValue.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -17,6 +18,7 @@ public class MediaEventValue { * originated this event. */ @JsonProperty(value = "cardValue") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object cardValue; public MediaEventValue(Object withCardValue) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaUrl.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaUrl.java index 2442498d..24bd5594 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaUrl.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MediaUrl.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,6 +17,7 @@ public class MediaUrl { * Url for the media. */ @JsonProperty(value = "url") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String url; /** @@ -23,6 +25,7 @@ public class MediaUrl { * objects from each other. */ @JsonProperty(value = "profile") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String profile; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Mention.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Mention.java index 7d30195d..184ec9a9 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Mention.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Mention.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,18 +17,21 @@ public class Mention implements EntitySerialization { * The mentioned user. */ @JsonProperty(value = "mentioned") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ChannelAccount mentioned; /** * Sub Text which represents the mention (can be null or empty). */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Type of this entity (RFC 3987 IRI). */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; public Mention() { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MessageReaction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MessageReaction.java index 22f93b59..ef1ac22f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MessageReaction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MessageReaction.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; @@ -20,6 +21,7 @@ public class MessageReaction { * Message reaction type. Possible values include: 'like', 'plusOne'. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; public static MessageReaction clone(MessageReaction messageReaction) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MicrosoftPayMethodData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MicrosoftPayMethodData.java index 3c5bdcc6..7627ea8f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MicrosoftPayMethodData.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/MicrosoftPayMethodData.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,18 +19,21 @@ public class MicrosoftPayMethodData { * Microsoft Pay Merchant ID. */ @JsonProperty(value = "merchantId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String merchantId; /** * Supported payment networks (e.g., "visa" and "mastercard"). */ @JsonProperty(value = "supportedNetworks") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List supportedNetworks; /** * Supported payment types (e.g., "credit"). */ @JsonProperty(value = "supportedTypes") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List supportedTypes; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/OAuthCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/OAuthCard.java index 64c310ce..7ac3d3d4 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/OAuthCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/OAuthCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,18 +19,21 @@ public class OAuthCard { * Text for signin request. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * The name of the registered connection. */ @JsonProperty(value = "connectionName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String connectionName; /** * Action to use to perform signin. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PagedMembersResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PagedMembersResult.java index 250ea7af..8ccd942a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PagedMembersResult.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PagedMembersResult.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,12 +17,14 @@ import java.util.List; public class PagedMembersResult { @JsonProperty(value = "continuationToken") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String continuationToken; /** * List of members in this conversation. */ @JsonProperty(value = "members") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List members; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentAddress.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentAddress.java index 2a087c65..a8101989 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentAddress.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentAddress.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -19,6 +20,7 @@ public class PaymentAddress { * example, US, GB, CN, or JP. */ @JsonProperty(value = "country") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String country; /** @@ -27,6 +29,7 @@ public class PaymentAddress { * delivery route, descriptive instructions, or a post office box number. */ @JsonProperty(value = "addressLine") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List addressLine; /** @@ -34,12 +37,14 @@ public class PaymentAddress { * example, this can be a state, a province, an oblast, or a prefecture. */ @JsonProperty(value = "region") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String region; /** * This is the city/town portion of the address. */ @JsonProperty(value = "city") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String city; /** @@ -48,18 +53,21 @@ public class PaymentAddress { * localities. */ @JsonProperty(value = "dependentLocality") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String dependentLocality; /** * This is the postal code or ZIP code, also known as PIN code in India. */ @JsonProperty(value = "postalCode") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String postalCode; /** * This is the sorting code as used in, for example, France. */ @JsonProperty(value = "sortingCode") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String sortingCode; /** @@ -68,24 +76,28 @@ public class PaymentAddress { * for display. */ @JsonProperty(value = "languageCode") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String languageCode; /** * This is the organization, firm, company, or institution at this address. */ @JsonProperty(value = "organization") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String organization; /** * This is the name of the recipient or contact person. */ @JsonProperty(value = "recipient") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String recipient; /** * This is the phone number of the recipient or contact person. */ @JsonProperty(value = "phone") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String phone; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentCurrencyAmount.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentCurrencyAmount.java index acc93107..c0c00d2a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentCurrencyAmount.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentCurrencyAmount.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,18 +17,21 @@ public class PaymentCurrencyAmount { * A currency identifier. */ @JsonProperty(value = "currency") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String currency; /** * Decimal monetary value. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String value; /** * Currency system. */ @JsonProperty(value = "currencySystem") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String currencySystem; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetails.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetails.java index ace1d575..85b1f15a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetails.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetails.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,6 +19,7 @@ public class PaymentDetails { * Contains the total amount of the payment request. */ @JsonProperty(value = "total") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentItem total; /** @@ -25,6 +27,7 @@ public class PaymentDetails { * display. */ @JsonProperty(value = "displayItems") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List displayItems; /** @@ -32,18 +35,21 @@ public class PaymentDetails { * choose from. */ @JsonProperty(value = "shippingOptions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List shippingOptions; /** * Contains modifiers for particular payment method identifiers. */ @JsonProperty(value = "modifiers") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List modifiers; /** * Error description. */ @JsonProperty(value = "error") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String error; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetailsModifier.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetailsModifier.java index b5ddd1f9..014e6e1a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetailsModifier.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentDetailsModifier.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -19,6 +20,7 @@ public class PaymentDetailsModifier { * Contains a sequence of payment method identifiers. */ @JsonProperty(value = "supportedMethods") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List supportedMethods; /** @@ -26,6 +28,7 @@ public class PaymentDetailsModifier { * for the payment method identifiers in the supportedMethods field. */ @JsonProperty(value = "total") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentItem total; /** @@ -34,6 +37,7 @@ public class PaymentDetailsModifier { * identifiers in the supportedMethods field. */ @JsonProperty(value = "additionalDisplayItems") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List additionalDisplayItems; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentItem.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentItem.java index f4768aa2..dd3392c0 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentItem.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentItem.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,12 +17,14 @@ public class PaymentItem { * Human-readable description of the item. */ @JsonProperty(value = "label") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String label; /** * Monetary amount for the item. */ @JsonProperty(value = "amount") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentCurrencyAmount amount; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentMethodData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentMethodData.java index b63df41c..463a5f33 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentMethodData.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentMethodData.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -20,6 +21,7 @@ public class PaymentMethodData { * payment methods that the merchant web site accepts. */ @JsonProperty(value = "supportedMethods") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List supportedMethods; /** @@ -27,6 +29,7 @@ public class PaymentMethodData { * be needed by the supported payment methods. */ @JsonProperty(value = "data") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object data; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentOptions.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentOptions.java index e06db961..b888882f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentOptions.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentOptions.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -17,6 +18,7 @@ public class PaymentOptions { * name as part of the payment request. */ @JsonProperty(value = "requestPayerName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean requestPayerName; /** @@ -24,6 +26,7 @@ public class PaymentOptions { * email address as part of the payment request. */ @JsonProperty(value = "requestPayerEmail") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean requestPayerEmail; /** @@ -31,6 +34,7 @@ public class PaymentOptions { * phone number as part of the payment request. */ @JsonProperty(value = "requestPayerPhone") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean requestPayerPhone; /** @@ -38,6 +42,7 @@ public class PaymentOptions { * address as part of the payment request. */ @JsonProperty(value = "requestShipping") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean requestShipping; /** @@ -46,6 +51,7 @@ public class PaymentOptions { * gathering the shipping address. */ @JsonProperty(value = "shippingType") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String shippingType; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequest.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequest.java index cfdc6c32..abade6d2 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequest.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequest.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,30 +19,35 @@ public class PaymentRequest { * ID of this payment request. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Allowed payment methods for this request. */ @JsonProperty(value = "methodData") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List methodData; /** * Details for this request. */ @JsonProperty(value = "details") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentDetails details; /** * Provides information about the options desired for the payment request. */ @JsonProperty(value = "options") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentOptions options; /** * Expiration for this request, in ISO 8601 duration format (e.g., 'P1D'). */ @JsonProperty(value = "expires") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String expires; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestComplete.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestComplete.java index 253a2299..3b87dfcf 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestComplete.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestComplete.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,18 +17,21 @@ public class PaymentRequestComplete { * Payment request ID. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Initial payment request. */ @JsonProperty(value = "paymentRequest") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentRequest paymentRequest; /** * Corresponding payment response. */ @JsonProperty(value = "paymentResponse") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentResponse paymentResponse; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestCompleteResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestCompleteResult.java index 293127c7..e61bf643 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestCompleteResult.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestCompleteResult.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,6 +17,7 @@ public class PaymentRequestCompleteResult { * Result of the payment request completion. */ @JsonProperty(value = "result") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String result; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdate.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdate.java index de091e0b..c9259038 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdate.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdate.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,24 +17,28 @@ public class PaymentRequestUpdate { * ID for the payment request to update. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Update payment details. */ @JsonProperty(value = "details") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentDetails details; /** * Updated shipping address. */ @JsonProperty(value = "shippingAddress") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentAddress shippingAddress; /** * Updated shipping options. */ @JsonProperty(value = "shippingOption") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String shippingOption; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdateResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdateResult.java index 3fa22fc8..7fd0c8ee 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdateResult.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentRequestUpdateResult.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,6 +17,7 @@ public class PaymentRequestUpdateResult { * Update payment details. */ @JsonProperty(value = "details") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentDetails details; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentResponse.java index 104baf1d..2a56166c 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentResponse.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -18,6 +19,7 @@ public class PaymentResponse { * selected to fulfil the transaction. */ @JsonProperty(value = "methodName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String methodName; /** @@ -26,6 +28,7 @@ public class PaymentResponse { * successful fund transfer. */ @JsonProperty(value = "details") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object details; /** @@ -34,6 +37,7 @@ public class PaymentResponse { * and final shipping address chosen by the user. */ @JsonProperty(value = "shippingAddress") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentAddress shippingAddress; /** @@ -42,6 +46,7 @@ public class PaymentResponse { * attribute of the selected shipping option. */ @JsonProperty(value = "shippingOption") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String shippingOption; /** @@ -50,6 +55,7 @@ public class PaymentResponse { * email address chosen by the user. */ @JsonProperty(value = "payerEmail") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String payerEmail; /** @@ -58,6 +64,7 @@ public class PaymentResponse { * phone number chosen by the user. */ @JsonProperty(value = "payerPhone") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String payerPhone; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentShippingOption.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentShippingOption.java index 06df2964..df81769d 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentShippingOption.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/PaymentShippingOption.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,24 +17,28 @@ public class PaymentShippingOption { * String identifier used to reference this PaymentShippingOption. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** * Human-readable description of the item. */ @JsonProperty(value = "label") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String label; /** * Contains the monetary amount for the item. */ @JsonProperty(value = "amount") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private PaymentCurrencyAmount amount; /** * Indicates whether this is the default selected PaymentShippingOption. */ @JsonProperty(value = "selected") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean selected; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Place.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Place.java index c38971be..aac64b44 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Place.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Place.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -17,6 +18,7 @@ public class Place implements EntitySerialization { * `PostalAddress`). */ @JsonProperty(value = "address") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object address; /** @@ -24,6 +26,7 @@ public class Place implements EntitySerialization { * `GeoCoordinates` or `GeoShape`). */ @JsonProperty(value = "geo") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object geo; /** @@ -31,18 +34,21 @@ public class Place implements EntitySerialization { * `Map`). */ @JsonProperty(value = "hasMap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object hasMap; /** * The type of the thing. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; /** * The name of the thing. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; public Place() { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptCard.java index 8c8c5298..e4f756fe 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,48 +19,56 @@ public class ReceiptCard { * Title of the card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Array of Fact objects. */ @JsonProperty(value = "facts") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List facts; /** * Array of Receipt Items. */ @JsonProperty(value = "items") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List items; /** * This action will be activated when user taps on the card. */ @JsonProperty(value = "tap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardAction tap; /** * Total amount of money paid (or to be paid). */ @JsonProperty(value = "total") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String total; /** * Total amount of tax paid (or to be paid). */ @JsonProperty(value = "tax") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String tax; /** * Total amount of VAT paid (or to be paid). */ @JsonProperty(value = "vat") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String vat; /** * Set of actions applicable to the current card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptItem.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptItem.java index fb52f7df..9412db6f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptItem.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ReceiptItem.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,6 +17,7 @@ public class ReceiptItem { * Title of the Card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** @@ -23,6 +25,7 @@ public class ReceiptItem { * styling only. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** @@ -30,30 +33,35 @@ public class ReceiptItem { * styling only. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Image. */ @JsonProperty(value = "image") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardImage image; /** * Amount with currency. */ @JsonProperty(value = "price") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String price; /** * Number of items of given kind. */ @JsonProperty(value = "quantity") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String quantity; /** * This action will be activated when user taps on the Item bubble. */ @JsonProperty(value = "tap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardAction tap; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ResourceResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ResourceResponse.java index 48408a21..0d7c5f4e 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ResourceResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ResourceResponse.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,9 +17,10 @@ public class ResourceResponse { * Id of the resource. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; - public ResourceResponse(){ + public ResourceResponse() { } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SemanticAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SemanticAction.java index d8a9ace8..575a312a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SemanticAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SemanticAction.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -18,12 +19,14 @@ public class SemanticAction { * Entities associated with this action. */ @JsonProperty(value = "entities") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Map entities; /** * ID of this action. */ @JsonProperty(value = "id") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String id; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SigninCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SigninCard.java index 784705a7..94602edd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SigninCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SigninCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,12 +19,14 @@ public class SigninCard { * Text for signin request. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Action to use to perform signin. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SuggestedActions.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SuggestedActions.java index 81771b5a..0abff784 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SuggestedActions.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/SuggestedActions.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; @@ -23,12 +24,14 @@ public class SuggestedActions { * activity. */ @JsonProperty(value = "to") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List to; /** * Actions that can be shown to the user. */ @JsonProperty(value = "actions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List actions; public static SuggestedActions clone(SuggestedActions suggestedActions) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TextHighlight.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TextHighlight.java index 11a7ce9d..bc7123fe 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TextHighlight.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TextHighlight.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,12 +17,14 @@ public class TextHighlight { * Defines the snippet of text to highlight. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Occurrence of the text field within the referenced text, if multiple exist. */ @JsonProperty(value = "occurence") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Integer occurence; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Thing.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Thing.java index 2e14d9d8..8eab6412 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Thing.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Thing.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,12 +17,14 @@ public class Thing { * The type of the thing. */ @JsonProperty(value = "type") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String type; /** * The name of the thing. */ @JsonProperty(value = "name") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String name; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailCard.java index 684c88a6..e9f904dd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,36 +19,42 @@ public class ThumbnailCard { * Title of the card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of the card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text for the card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Array of images for the card. */ @JsonProperty(value = "images") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List images; /** * Set of actions applicable to the current card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** * This action will be activated when user taps on the card itself. */ @JsonProperty(value = "tap") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private CardAction tap; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailUrl.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailUrl.java index 7c115c0f..eed690a8 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailUrl.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ThumbnailUrl.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,12 +17,14 @@ public class ThumbnailUrl { * URL pointing to the thumbnail to use for media content. */ @JsonProperty(value = "url") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String url; /** * HTML alt text to include on this thumbnail image. */ @JsonProperty(value = "alt") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String alt; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java index eda81768..f763560b 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,24 +17,28 @@ public class TokenExchangeState { * The bot's registered application ID */ @JsonProperty("msAppId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String msAppId; /** * The connection name that was used */ @JsonProperty(value = "connectionName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String connectionName; /** * A reference to the conversation */ @JsonProperty(value = "conversation") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ConversationReference conversation; /** * The URL of the bot messaging endpoint */ @JsonProperty("botUrl") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String botUrl; public String getConnectionName() { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenRequest.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenRequest.java index ed763e1d..dd027f43 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenRequest.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenRequest.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -18,12 +19,14 @@ public class TokenRequest { * The provider to request a user token from. */ @JsonProperty(value = "provider") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String provider; /** * A collection of settings for the specific provider for this request. */ @JsonProperty(value = "settings") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Map settings; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenResponse.java index 47cac46e..48530502 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenResponse.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -16,24 +17,28 @@ public class TokenResponse { * The channelId of the TokenResponse. */ @JsonProperty(value = "channelId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String channelId; /** * The connection name. */ @JsonProperty(value = "connectionName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String connectionName; /** * The user token. */ @JsonProperty(value = "token") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String token; /** * Expiration for the token, in ISO 8601 format (e.g. "2007-04-05T14:30Z"). */ @JsonProperty(value = "expiration") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String expiration; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenStatus.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenStatus.java index ec910895..6c840e56 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenStatus.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/TokenStatus.java @@ -3,6 +3,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -12,25 +13,29 @@ public class TokenStatus { /** * The channelId of the token status pertains to. */ - @JsonProperty + @JsonProperty(value = "channelId") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String channelId; /** * The name of the connection the token status pertains to. */ - @JsonProperty + @JsonProperty(value = "connectionName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String connectionName; /** * True if a token is stored for this ConnectionName. */ - @JsonProperty + @JsonProperty(value = "hasToken") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean hasToken; /** * The display name of the service provider for which this Token belongs to. */ - @JsonProperty + @JsonProperty(value = "serviceProviderDisplayName") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String serviceProviderDisplayName; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Transcript.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Transcript.java index 7cc78005..954297df 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Transcript.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Transcript.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,6 +19,7 @@ public class Transcript { * List of members in this conversation. */ @JsonProperty(value = "activities") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List activities; /** diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/VideoCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/VideoCard.java index eb0136a0..f5913f38 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/VideoCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/VideoCard.java @@ -6,6 +6,7 @@ package com.microsoft.bot.schema; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,48 +19,56 @@ public class VideoCard { * Title of this card. */ @JsonProperty(value = "title") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String title; /** * Subtitle of this card. */ @JsonProperty(value = "subtitle") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String subtitle; /** * Text of this card. */ @JsonProperty(value = "text") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String text; /** * Thumbnail placeholder. */ @JsonProperty(value = "image") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private ThumbnailUrl image; /** * Media URLs for this card. When this field contains more than one URL, each URL is an alternative format of the same content. */ @JsonProperty(value = "media") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List media; /** * Actions on this card. */ @JsonProperty(value = "buttons") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List buttons; /** * This content may be shared with others (default:true). */ @JsonProperty(value = "shareable") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean shareable; /** * Should the client loop playback at end of content (default:true). */ @JsonProperty(value = "autoloop") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean autoloop; /** @@ -67,6 +76,7 @@ public class VideoCard { * (default:true). */ @JsonProperty(value = "autostart") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private boolean autostart; /** @@ -74,6 +84,7 @@ public class VideoCard { * and "4:3". */ @JsonProperty(value = "aspect") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String aspect; /** @@ -81,12 +92,14 @@ public class VideoCard { * Formatted as an ISO 8601 Duration field. */ @JsonProperty(value = "duration") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String duration; /** * Supplementary parameter for this card. */ @JsonProperty(value = "value") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private Object value; /**