Skip to content

Commit

Permalink
Add file info method to retrieve all file info (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
opaliukh authored Oct 14, 2024
1 parent 26260fc commit 1cb0cfb
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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();
}
Original file line number Diff line number Diff line change
@@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -410,6 +412,9 @@ CompletableFuture<Result<CompleteUploadExternalResponse, SlackError>> completeUp
CompletableFuture<Result<FilesSharedPublicUrlResponse, SlackError>> shareFilePublically(
FilesSharedPublicUrlParams params
);
CompletableFuture<Result<FilesInfoResponse, SlackError>> getFileInfo(
FilesInfoParams request
);

// emoji
CompletableFuture<Result<EmojiListResponse, SlackError>> listEmoji();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1436,6 +1438,13 @@ public CompletableFuture<Result<FilesSharedPublicUrlResponse, SlackError>> share
);
}

@Override
public CompletableFuture<Result<FilesInfoResponse, SlackError>> getFileInfo(
FilesInfoParams request
) {
return postSlackCommand(SlackMethods.files_info, request, FilesInfoResponse.class);
}

@Override
public Iterable<CompletableFuture<Result<List<SlackGroup>, SlackError>>> listGroups(
GroupsListParams filter
Expand Down

0 comments on commit 1cb0cfb

Please sign in to comment.