Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call update/remove Slack message methods without as_user param for V2 bot token #224

Merged
merged 2 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.immutables.value.Value.Default;
import org.immutables.value.Value.Immutable;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
Expand All @@ -13,6 +14,7 @@
@HubSpotStyle
@JsonNaming(SnakeCaseStrategy.class)
public abstract class AbstractChatDeleteParams implements HasChannel {

@Override
@JsonProperty("channel")
public abstract String getChannelId();
Expand All @@ -21,6 +23,7 @@ public abstract class AbstractChatDeleteParams implements HasChannel {
public abstract String getMessageToDeleteTs();

@Default
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonProperty("as_user")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current solution is 👍 but I wonder what do you think about annotating this property with @JsonInclude(Include.NON_DEFAULT)? This annotation says that if the value is the default we won't be serializing the property.

Copy link
Contributor Author

@zmarushchak-hs zmarushchak-hs Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, didn't know about this annotation.

public boolean getAsUser() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public interface ChatUpdateMessageParamsIF extends MessageParams {

String getTs();

@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonProperty("as_user")
Optional<Boolean> getAsUser();

Expand Down