diff --git a/slack-base/src/main/java/com/hubspot/slack/client/methods/params/files/FilesInfoParamsIF.java b/slack-base/src/main/java/com/hubspot/slack/client/methods/params/files/FilesInfoParamsIF.java new file mode 100644 index 00000000..9eb7f6e5 --- /dev/null +++ b/slack-base/src/main/java/com/hubspot/slack/client/methods/params/files/FilesInfoParamsIF.java @@ -0,0 +1,15 @@ +package com.hubspot.slack.client.methods.params.files; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import com.hubspot.immutables.style.HubSpotStyle; +import org.immutables.value.Value.Immutable; + +@Immutable +@HubSpotStyle +@JsonNaming(SnakeCaseStrategy.class) +public interface FilesInfoParamsIF { + @JsonProperty("file") + String fileId(); +} diff --git a/slack-base/src/main/java/com/hubspot/slack/client/models/response/files/FilesInfoResponseIF.java b/slack-base/src/main/java/com/hubspot/slack/client/models/response/files/FilesInfoResponseIF.java new file mode 100644 index 00000000..8439ef25 --- /dev/null +++ b/slack-base/src/main/java/com/hubspot/slack/client/models/response/files/FilesInfoResponseIF.java @@ -0,0 +1,15 @@ +package com.hubspot.slack.client.models.response.files; + +import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; +import com.fasterxml.jackson.databind.annotation.JsonNaming; +import com.hubspot.immutables.style.HubSpotStyle; +import com.hubspot.slack.client.models.files.SlackFile; +import com.hubspot.slack.client.models.response.SlackResponse; +import org.immutables.value.Value.Immutable; + +@Immutable +@HubSpotStyle +@JsonNaming(SnakeCaseStrategy.class) +public interface FilesInfoResponseIF extends SlackResponse { + SlackFile getFile(); +} diff --git a/slack-java-client/src/main/java/com/hubspot/slack/client/SlackClient.java b/slack-java-client/src/main/java/com/hubspot/slack/client/SlackClient.java index 0332b4a7..e656c0ae 100644 --- a/slack-java-client/src/main/java/com/hubspot/slack/client/SlackClient.java +++ b/slack-java-client/src/main/java/com/hubspot/slack/client/SlackClient.java @@ -49,6 +49,7 @@ import com.hubspot.slack.client.methods.params.dnd.DndInfoParams; import com.hubspot.slack.client.methods.params.dnd.DndSetSnoozeParams; import com.hubspot.slack.client.methods.params.files.CompleteUploadExternalParams; +import com.hubspot.slack.client.methods.params.files.FilesInfoParams; import com.hubspot.slack.client.methods.params.files.FilesSharedPublicUrlParams; import com.hubspot.slack.client.methods.params.files.FilesUploadParams; import com.hubspot.slack.client.methods.params.files.GetUploadUrlExternalParams; @@ -120,6 +121,7 @@ import com.hubspot.slack.client.models.response.dnd.DndSnoozeResponse; import com.hubspot.slack.client.models.response.emoji.EmojiListResponse; import com.hubspot.slack.client.models.response.files.CompleteUploadExternalResponse; +import com.hubspot.slack.client.models.response.files.FilesInfoResponse; import com.hubspot.slack.client.models.response.files.FilesSharedPublicUrlResponse; import com.hubspot.slack.client.models.response.files.FilesUploadResponse; import com.hubspot.slack.client.models.response.files.GetUploadUrlExternalResponse; @@ -410,6 +412,9 @@ CompletableFuture> completeUp CompletableFuture> shareFilePublically( FilesSharedPublicUrlParams params ); + CompletableFuture> getFileInfo( + FilesInfoParams request + ); // emoji CompletableFuture> listEmoji(); diff --git a/slack-java-client/src/main/java/com/hubspot/slack/client/SlackWebClient.java b/slack-java-client/src/main/java/com/hubspot/slack/client/SlackWebClient.java index c4a90b80..cc192e83 100644 --- a/slack-java-client/src/main/java/com/hubspot/slack/client/SlackWebClient.java +++ b/slack-java-client/src/main/java/com/hubspot/slack/client/SlackWebClient.java @@ -80,6 +80,7 @@ import com.hubspot.slack.client.methods.params.dnd.DndInfoParams; import com.hubspot.slack.client.methods.params.dnd.DndSetSnoozeParams; import com.hubspot.slack.client.methods.params.files.CompleteUploadExternalParams; +import com.hubspot.slack.client.methods.params.files.FilesInfoParams; import com.hubspot.slack.client.methods.params.files.FilesSharedPublicUrlParams; import com.hubspot.slack.client.methods.params.files.FilesUploadParams; import com.hubspot.slack.client.methods.params.files.GetUploadUrlExternalParams; @@ -157,6 +158,7 @@ import com.hubspot.slack.client.models.response.dnd.DndSnoozeResponse; import com.hubspot.slack.client.models.response.emoji.EmojiListResponse; import com.hubspot.slack.client.models.response.files.CompleteUploadExternalResponse; +import com.hubspot.slack.client.models.response.files.FilesInfoResponse; import com.hubspot.slack.client.models.response.files.FilesSharedPublicUrlResponse; import com.hubspot.slack.client.models.response.files.FilesUploadResponse; import com.hubspot.slack.client.models.response.files.GetUploadUrlExternalResponse; @@ -1436,6 +1438,13 @@ public CompletableFuture> share ); } + @Override + public CompletableFuture> getFileInfo( + FilesInfoParams request + ) { + return postSlackCommand(SlackMethods.files_info, request, FilesInfoResponse.class); + } + @Override public Iterable, SlackError>>> listGroups( GroupsListParams filter