Class ChatPostMessageParams

All Implemented Interfaces:
HasChannel, MessageParams

@Generated(from="AbstractChatPostMessageParams", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ChatPostMessageParams extends AbstractChatPostMessageParams
Immutable implementation of AbstractChatPostMessageParams.

Use the builder to create immutable instances: ChatPostMessageParams.builder().

  • Method Details

    • getAttachments

      public List<Attachment> getAttachments()
      Returns:
      The value of the attachments attribute
    • getBlocks

      public List<Block> getBlocks()
      Returns:
      The value of the blocks attribute
    • getChannelId

      public String getChannelId()
      Specified by:
      getChannelId in interface HasChannel
      Specified by:
      getChannelId in class AbstractChatMessageParams
      Returns:
      The value of the channelId attribute
    • getText

      public Optional<String> getText()
      Specified by:
      getText in interface MessageParams
      Specified by:
      getText in class AbstractChatMessageParams
      Returns:
      The value of the text attribute
    • getThreadTs

      public Optional<String> getThreadTs()
      Specified by:
      getThreadTs in class AbstractChatMessageParams
      Returns:
      The value of the threadTs attribute
    • getUsername

      public Optional<String> getUsername()
      Specified by:
      getUsername in class AbstractChatMessageParams
      Returns:
      The value of the username attribute
    • getAsUser

      public Optional<Boolean> getAsUser()
      Specified by:
      getAsUser in class AbstractChatMessageParams
      Returns:
      The value of the asUser attribute
    • getIconEmoji

      public Optional<String> getIconEmoji()
      Specified by:
      getIconEmoji in class AbstractChatMessageParams
      Returns:
      The value of the iconEmoji attribute
    • getIconUrl

      public Optional<String> getIconUrl()
      Specified by:
      getIconUrl in class AbstractChatMessageParams
      Returns:
      The value of the iconUrl attribute
    • getLinkNames

      public Optional<Boolean> getLinkNames()
      Specified by:
      getLinkNames in class AbstractChatMessageParams
      Returns:
      The value of the linkNames attribute
    • getUnfurlLinks

      public Optional<Boolean> getUnfurlLinks()
      Specified by:
      getUnfurlLinks in class AbstractChatMessageParams
      Returns:
      The value of the unfurlLinks attribute
    • getUnfurlMedia

      public Optional<Boolean> getUnfurlMedia()
      Specified by:
      getUnfurlMedia in class AbstractChatMessageParams
      Returns:
      The value of the unfurlMedia attribute
    • getReplyBroadcast

      public Optional<Boolean> getReplyBroadcast()
      Specified by:
      getReplyBroadcast in class AbstractChatMessageParams
      Returns:
      The value of the replyBroadcast attribute
    • withAttachments

      public final ChatPostMessageParams withAttachments(Attachment... elements)
      Copy the current immutable object with elements that replace the content of attachments.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAttachments

      public final ChatPostMessageParams withAttachments(Iterable<? extends Attachment> elements)
      Copy the current immutable object with elements that replace the content of attachments. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of attachments elements to set
      Returns:
      A modified copy or this if not changed
    • withBlocks

      public final ChatPostMessageParams withBlocks(Block... elements)
      Copy the current immutable object with elements that replace the content of blocks.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBlocks

      public final ChatPostMessageParams withBlocks(Iterable<? extends Block> elements)
      Copy the current immutable object with elements that replace the content of blocks. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of blocks elements to set
      Returns:
      A modified copy or this if not changed
    • withChannelId

      public final ChatPostMessageParams withChannelId(String value)
      Copy the current immutable object by setting a value for the channelId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for channelId
      Returns:
      A modified copy or the this object
    • withText

      public final ChatPostMessageParams withText(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional text attribute.
      Parameters:
      value - The value for text, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withText

      public final ChatPostMessageParams withText(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the text attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for text
      Returns:
      A modified copy or this if not changed
    • withThreadTs

      public final ChatPostMessageParams withThreadTs(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional threadTs attribute.
      Parameters:
      value - The value for threadTs, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withThreadTs

      public final ChatPostMessageParams withThreadTs(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the threadTs attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for threadTs
      Returns:
      A modified copy or this if not changed
    • withUsername

      public final ChatPostMessageParams withUsername(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional username attribute.
      Parameters:
      value - The value for username, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withUsername

      public final ChatPostMessageParams withUsername(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the username attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for username
      Returns:
      A modified copy or this if not changed
    • withAsUser

      public final ChatPostMessageParams withAsUser(@Nullable Boolean value)
      Copy the current immutable object by setting a present value for the optional asUser attribute.
      Parameters:
      value - The value for asUser, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withAsUser

      public final ChatPostMessageParams withAsUser(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the asUser attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for asUser
      Returns:
      A modified copy or this if not changed
    • withIconEmoji

      public final ChatPostMessageParams withIconEmoji(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional iconEmoji attribute.
      Parameters:
      value - The value for iconEmoji, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withIconEmoji

      public final ChatPostMessageParams withIconEmoji(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the iconEmoji attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for iconEmoji
      Returns:
      A modified copy or this if not changed
    • withIconUrl

      public final ChatPostMessageParams withIconUrl(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional iconUrl attribute.
      Parameters:
      value - The value for iconUrl, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withIconUrl

      public final ChatPostMessageParams withIconUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the iconUrl attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for iconUrl
      Returns:
      A modified copy or this if not changed
    • withLinkNames

      public final ChatPostMessageParams withLinkNames(@Nullable Boolean value)
      Copy the current immutable object by setting a present value for the optional linkNames attribute.
      Parameters:
      value - The value for linkNames, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withLinkNames

      public final ChatPostMessageParams withLinkNames(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the linkNames attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for linkNames
      Returns:
      A modified copy or this if not changed
    • withUnfurlLinks

      public final ChatPostMessageParams withUnfurlLinks(@Nullable Boolean value)
      Copy the current immutable object by setting a present value for the optional unfurlLinks attribute.
      Parameters:
      value - The value for unfurlLinks, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withUnfurlLinks

      public final ChatPostMessageParams withUnfurlLinks(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the unfurlLinks attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for unfurlLinks
      Returns:
      A modified copy or this if not changed
    • withUnfurlMedia

      public final ChatPostMessageParams withUnfurlMedia(@Nullable Boolean value)
      Copy the current immutable object by setting a present value for the optional unfurlMedia attribute.
      Parameters:
      value - The value for unfurlMedia, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withUnfurlMedia

      public final ChatPostMessageParams withUnfurlMedia(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the unfurlMedia attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for unfurlMedia
      Returns:
      A modified copy or this if not changed
    • withReplyBroadcast

      public final ChatPostMessageParams withReplyBroadcast(@Nullable Boolean value)
      Copy the current immutable object by setting a present value for the optional replyBroadcast attribute.
      Parameters:
      value - The value for replyBroadcast, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withReplyBroadcast

      public final ChatPostMessageParams withReplyBroadcast(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the replyBroadcast attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for replyBroadcast
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ChatPostMessageParams that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: attachments, blocks, channelId, text, threadTs, username, asUser, iconEmoji, iconUrl, linkNames, unfurlLinks, unfurlMedia, replyBroadcast.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ChatPostMessageParams with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ChatPostMessageParams copyOf(AbstractChatPostMessageParams instance)
      Creates an immutable copy of a AbstractChatPostMessageParams value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable ChatPostMessageParams instance
    • builder

      public static ChatPostMessageParams.Builder builder()
      Creates a builder for ChatPostMessageParams.
       ChatPostMessageParams.builder()
          .addAttachments|addAllAttachments(com.hubspot.slack.client.models.Attachment) // attachments elements
          .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) // blocks elements
          .setChannelId(String) // required channelId
          .setText(Optional<String>) // optional text
          .setThreadTs(Optional<String>) // optional threadTs
          .setUsername(Optional<String>) // optional username
          .setAsUser(Optional<Boolean>) // optional asUser
          .setIconEmoji(Optional<String>) // optional iconEmoji
          .setIconUrl(Optional<String>) // optional iconUrl
          .setLinkNames(Optional<Boolean>) // optional linkNames
          .setUnfurlLinks(Optional<Boolean>) // optional unfurlLinks
          .setUnfurlMedia(Optional<Boolean>) // optional unfurlMedia
          .setReplyBroadcast(Optional<Boolean>) // optional replyBroadcast
          .build();
       
      Returns:
      A new ChatPostMessageParams builder