Update dependencies (#2180)
* Update dependencies * Fix whatsmeow API changes
This commit is contained in:
41
vendor/github.com/slack-go/slack/remotefiles.go
generated
vendored
41
vendor/github.com/slack-go/slack/remotefiles.go
generated
vendored
@@ -97,14 +97,13 @@ func (api *Client) remoteFileRequest(ctx context.Context, path string, values ur
|
||||
}
|
||||
|
||||
// AddRemoteFile adds a remote file. Unlike regular files, remote files must be explicitly shared.
|
||||
// For more details:
|
||||
// https://api.slack.com/methods/files.remote.add
|
||||
// For more details see the AddRemoteFileContext documentation.
|
||||
func (api *Client) AddRemoteFile(params RemoteFileParameters) (*RemoteFile, error) {
|
||||
return api.AddRemoteFileContext(context.Background(), params)
|
||||
}
|
||||
|
||||
// AddRemoteFileContext adds a remote file and setting a custom context
|
||||
// For more details see the AddRemoteFile documentation.
|
||||
// Slack API docs: https://api.slack.com/methods/files.remote.add
|
||||
func (api *Client) AddRemoteFileContext(ctx context.Context, params RemoteFileParameters) (remotefile *RemoteFile, err error) {
|
||||
if params.ExternalID == "" || params.ExternalURL == "" || params.Title == "" {
|
||||
return nil, ErrParametersMissing
|
||||
@@ -138,14 +137,13 @@ func (api *Client) AddRemoteFileContext(ctx context.Context, params RemoteFilePa
|
||||
}
|
||||
|
||||
// ListRemoteFiles retrieves all remote files according to the parameters given. Uses cursor based pagination.
|
||||
// For more details:
|
||||
// https://api.slack.com/methods/files.remote.list
|
||||
// For more details see the ListRemoteFilesContext documentation.
|
||||
func (api *Client) ListRemoteFiles(params ListRemoteFilesParameters) ([]RemoteFile, error) {
|
||||
return api.ListRemoteFilesContext(context.Background(), params)
|
||||
}
|
||||
|
||||
// ListRemoteFilesContext retrieves all remote files according to the parameters given with a custom context. Uses cursor based pagination.
|
||||
// For more details see the ListRemoteFiles documentation.
|
||||
// Slack API docs: https://api.slack.com/methods/files.remote.list
|
||||
func (api *Client) ListRemoteFilesContext(ctx context.Context, params ListRemoteFilesParameters) ([]RemoteFile, error) {
|
||||
values := url.Values{
|
||||
"token": {api.token},
|
||||
@@ -177,14 +175,13 @@ func (api *Client) ListRemoteFilesContext(ctx context.Context, params ListRemote
|
||||
}
|
||||
|
||||
// GetRemoteFileInfo retrieves the complete remote file information.
|
||||
// For more details:
|
||||
// https://api.slack.com/methods/files.remote.info
|
||||
// For more details see the GetRemoteFileInfoContext documentation.
|
||||
func (api *Client) GetRemoteFileInfo(externalID, fileID string) (remotefile *RemoteFile, err error) {
|
||||
return api.GetRemoteFileInfoContext(context.Background(), externalID, fileID)
|
||||
}
|
||||
|
||||
// GetRemoteFileInfoContext retrieves the complete remote file information given with a custom context.
|
||||
// For more details see the GetRemoteFileInfo documentation.
|
||||
// Slack API docs: https://api.slack.com/methods/files.remote.info
|
||||
func (api *Client) GetRemoteFileInfoContext(ctx context.Context, externalID, fileID string) (remotefile *RemoteFile, err error) {
|
||||
if fileID == "" && externalID == "" {
|
||||
return nil, fmt.Errorf("either externalID or fileID is required")
|
||||
@@ -208,15 +205,14 @@ func (api *Client) GetRemoteFileInfoContext(ctx context.Context, externalID, fil
|
||||
return &response.RemoteFile, err
|
||||
}
|
||||
|
||||
// ShareRemoteFile shares a remote file to channels
|
||||
// For more details:
|
||||
// https://api.slack.com/methods/files.remote.share
|
||||
// ShareRemoteFile shares a remote file to channels.
|
||||
// For more details see the ShareRemoteFileContext documentation.
|
||||
func (api *Client) ShareRemoteFile(channels []string, externalID, fileID string) (file *RemoteFile, err error) {
|
||||
return api.ShareRemoteFileContext(context.Background(), channels, externalID, fileID)
|
||||
}
|
||||
|
||||
// ShareRemoteFileContext shares a remote file to channels with a custom context.
|
||||
// For more details see the ShareRemoteFile documentation.
|
||||
// Slack API docs: https://api.slack.com/methods/files.remote.share
|
||||
func (api *Client) ShareRemoteFileContext(ctx context.Context, channels []string, externalID, fileID string) (file *RemoteFile, err error) {
|
||||
if channels == nil || len(channels) == 0 {
|
||||
return nil, ErrParametersMissing
|
||||
@@ -241,20 +237,17 @@ func (api *Client) ShareRemoteFileContext(ctx context.Context, channels []string
|
||||
return &response.RemoteFile, err
|
||||
}
|
||||
|
||||
// UpdateRemoteFile updates a remote file
|
||||
// For more details:
|
||||
// https://api.slack.com/methods/files.remote.update
|
||||
// UpdateRemoteFile updates a remote file.
|
||||
// For more details see the UpdateRemoteFileContext documentation.
|
||||
func (api *Client) UpdateRemoteFile(fileID string, params RemoteFileParameters) (remotefile *RemoteFile, err error) {
|
||||
return api.UpdateRemoteFileContext(context.Background(), fileID, params)
|
||||
}
|
||||
|
||||
// UpdateRemoteFileContext updates a remote file with a custom context
|
||||
// For more details see the UpdateRemoteFile documentation.
|
||||
// UpdateRemoteFileContext updates a remote file with a custom context.
|
||||
// Slack API docs: https://api.slack.com/methods/files.remote.update
|
||||
func (api *Client) UpdateRemoteFileContext(ctx context.Context, fileID string, params RemoteFileParameters) (remotefile *RemoteFile, err error) {
|
||||
response := &remoteFileResponseFull{}
|
||||
values := url.Values{
|
||||
"token": {api.token},
|
||||
}
|
||||
values := url.Values{}
|
||||
if fileID != "" {
|
||||
values.Add("file", fileID)
|
||||
}
|
||||
@@ -276,6 +269,7 @@ func (api *Client) UpdateRemoteFileContext(ctx context.Context, fileID string, p
|
||||
if params.PreviewImageReader != nil {
|
||||
err = postWithMultipartResponse(ctx, api.httpclient, api.endpoint+"files.remote.update", "preview.png", "preview_image", api.token, values, params.PreviewImageReader, response, api)
|
||||
} else {
|
||||
values.Add("token", api.token)
|
||||
response, err = api.remoteFileRequest(ctx, "files.remote.update", values)
|
||||
}
|
||||
|
||||
@@ -287,14 +281,13 @@ func (api *Client) UpdateRemoteFileContext(ctx context.Context, fileID string, p
|
||||
}
|
||||
|
||||
// RemoveRemoteFile removes a remote file.
|
||||
// For more details:
|
||||
// https://api.slack.com/methods/files.remote.remove
|
||||
// For more information see the RemoveRemoteFileContext documentation.
|
||||
func (api *Client) RemoveRemoteFile(externalID, fileID string) (err error) {
|
||||
return api.RemoveRemoteFileContext(context.Background(), externalID, fileID)
|
||||
}
|
||||
|
||||
// RemoveRemoteFileContext removes a remote file with a custom context
|
||||
// For more information see the RemoveRemoteFiles documentation.
|
||||
// Slack API docs: https://api.slack.com/methods/files.remote.remove
|
||||
func (api *Client) RemoveRemoteFileContext(ctx context.Context, externalID, fileID string) (err error) {
|
||||
if fileID == "" && externalID == "" {
|
||||
return fmt.Errorf("either externalID or fileID is required")
|
||||
|
||||
Reference in New Issue
Block a user