All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.slack.api.methods.request.chat.ChatUnfurlRequest Maven / Gradle / Ivy

There is a newer version: 1.39.0
Show newest version
package com.slack.api.methods.request.chat;

import com.slack.api.methods.SlackApiRequest;
import com.slack.api.model.Action;
import com.slack.api.model.Field;
import com.slack.api.model.block.LayoutBlock;
import com.slack.api.model.block.composition.PlainTextObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * https://api.slack.com/methods/chat.unfurl
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChatUnfurlRequest implements SlackApiRequest {

    /**
     * Authentication token. Requires scope: `links:write`
     */
    private String token;

    /**
     * Provide a simply-formatted string to send as an ephemeral message to the user
     * as invitation to authenticate further and enable full unfurling behavior
     */
    private String userAuthMessage;

    private String rawUserAuthBlocks;

    /**
     * Provide an array of blocks to send as an ephemeral message to the user
     * as invitation to authenticate further and enable full unfurling behavior
     */
    private List userAuthBlocks;

    /**
     * Set to `true` or `1` to indicate the user must install your Slack app to trigger unfurls for this domain
     */
    private boolean userAuthRequired;

    /**
     * Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling.
     * Value should be properly URL-encoded.
     */
    private String userAuthUrl;

    /**
     * URL-encoded JSON map with keys set to URLs featured in the message, pointing to their unfurl message attachments.
     */
    private String rawUnfurls;

    private Map unfurls;

    /**
     * Timestamp of the message to add unfurl behavior to.
     */
    private String ts;

    /**
     * Channel ID of the message
     */
    private String channel;

    // https://api.slack.com/changelog/2021-08-changes-to-unfurls
    private String unfurlId;

    // https://api.slack.com/changelog/2021-08-changes-to-unfurls
    private String source;

    // https://api.slack.com/docs/message-link-unfurling#unfurls_parameter
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class UnfurlDetail {

        private String text;

        // attachments: https://api.slack.com/docs/message-attachments
        private String callbackId;
        private String attachmentType;
        private String fallback;
        private String color;
        private String url;
        private String title;
        private String titleLink;
        private String imageUrl;
        private String authorName;
        private String authorIcon;
        private String authorLink;
        private List actions;
        private List fields;

        // blocks: https://api.slack.com/reference/block-kit/blocks
        private List blocks;
        // preview: https://api.slack.com/methods/chat.unfurl#markdown
        private UnfurlDetailPreview preview;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class UnfurlDetailPreview {
        private PlainTextObject title;
        private PlainTextObject subtitle;
        private String iconUrl;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy