mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-03 08:27:44 +00:00
Update vendor (#1560)
This commit is contained in:
144
vendor/github.com/slack-go/slack/audit.go
generated
vendored
Normal file
144
vendor/github.com/slack-go/slack/audit.go
generated
vendored
Normal file
@ -0,0 +1,144 @@
|
||||
package slack
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type AuditLogResponse struct {
|
||||
Entries []AuditEntry `json:"entries"`
|
||||
SlackResponse
|
||||
}
|
||||
|
||||
type AuditEntry struct {
|
||||
ID string `json:"id"`
|
||||
DateCreate int `json:"date_create"`
|
||||
Action string `json:"action"`
|
||||
Actor struct {
|
||||
Type string `json:"type"`
|
||||
User AuditUser `json:"user"`
|
||||
} `json:"actor"`
|
||||
Entity struct {
|
||||
Type string `json:"type"`
|
||||
// Only one of the below will be completed, based on the value of Type a user, a channel, a file, an app, a workspace, or an enterprise
|
||||
User AuditUser `json:"user"`
|
||||
Channel AuditChannel `json:"channel"`
|
||||
File AuditFile `json:"file"`
|
||||
App AuditApp `json:"app"`
|
||||
Workspace AuditWorkspace `json:"workspace"`
|
||||
Enterprise AuditEnterprise `json:"enterprise"`
|
||||
} `json:"entity"`
|
||||
Context struct {
|
||||
Location struct {
|
||||
Type string `json:"type"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Domain string `json:"domain"`
|
||||
} `json:"location"`
|
||||
UA string `json:"ua"`
|
||||
IPAddress string `json:"ip_address"`
|
||||
} `json:"context"`
|
||||
}
|
||||
|
||||
type AuditUser struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Team string `json:"team"`
|
||||
}
|
||||
|
||||
type AuditChannel struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Privacy string `json:"privacy"`
|
||||
IsShared bool `json:"is_shared"`
|
||||
IsOrgShared bool `json:"is_org_shared"`
|
||||
}
|
||||
|
||||
type AuditFile struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Filetype string `json:"filetype"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type AuditApp struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
IsDistributed bool `json:"is_distributed"`
|
||||
IsDirectoryApproved bool `json:"is_directory_approved"`
|
||||
IsWorkflowApp bool `json:"is_workflow_app"`
|
||||
Scopes []string `json:"scopes"`
|
||||
}
|
||||
|
||||
type AuditWorkspace struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Domain string `json:"domain"`
|
||||
}
|
||||
|
||||
type AuditEnterprise struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Domain string `json:"domain"`
|
||||
}
|
||||
|
||||
// AuditLogParameters contains all the parameters necessary (including the optional ones) for a GetAuditLogs() request
|
||||
type AuditLogParameters struct {
|
||||
Limit int
|
||||
Cursor string
|
||||
Latest int
|
||||
Oldest int
|
||||
Action string
|
||||
Actor string
|
||||
Entity string
|
||||
}
|
||||
|
||||
func (api *Client) auditLogsRequest(ctx context.Context, path string, values url.Values) (*AuditLogResponse, error) {
|
||||
response := &AuditLogResponse{}
|
||||
err := api.getMethod(ctx, path, api.token, values, response)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return response, response.Err()
|
||||
}
|
||||
|
||||
// GetAuditLogs retrieves a page of audit entires according to the parameters given
|
||||
func (api *Client) GetAuditLogs(params AuditLogParameters) (entries []AuditEntry, nextCursor string, err error) {
|
||||
return api.GetAuditLogsContext(context.Background(), params)
|
||||
}
|
||||
|
||||
// GetAuditLogsContext retrieves a page of audit entries according to the parameters given with a custom context
|
||||
func (api *Client) GetAuditLogsContext(ctx context.Context, params AuditLogParameters) (entries []AuditEntry, nextCursor string, err error) {
|
||||
values := url.Values{
|
||||
"token": {api.token},
|
||||
}
|
||||
if params.Limit != 0 {
|
||||
values.Add("count", strconv.Itoa(params.Limit))
|
||||
}
|
||||
if params.Oldest != 0 {
|
||||
values.Add("oldest", strconv.Itoa(params.Oldest))
|
||||
}
|
||||
if params.Latest != 0 {
|
||||
values.Add("latest", strconv.Itoa(params.Latest))
|
||||
}
|
||||
if params.Cursor != "" {
|
||||
values.Add("cursor", params.Cursor)
|
||||
}
|
||||
if params.Action != "" {
|
||||
values.Add("action", params.Action)
|
||||
}
|
||||
if params.Actor != "" {
|
||||
values.Add("actor", params.Actor)
|
||||
}
|
||||
if params.Entity != "" {
|
||||
values.Add("entity", params.Entity)
|
||||
}
|
||||
|
||||
response, err := api.auditLogsRequest(ctx, "audit/v1/logs", values)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
return response.Entries, response.ResponseMetadata.Cursor, response.Err()
|
||||
}
|
4
vendor/github.com/slack-go/slack/conversation.go
generated
vendored
4
vendor/github.com/slack-go/slack/conversation.go
generated
vendored
@ -458,6 +458,7 @@ type GetConversationsParameters struct {
|
||||
ExcludeArchived bool
|
||||
Limit int
|
||||
Types []string
|
||||
TeamID string
|
||||
}
|
||||
|
||||
// GetConversations returns the list of channels in a Slack team
|
||||
@ -482,6 +483,9 @@ func (api *Client) GetConversationsContext(ctx context.Context, params *GetConve
|
||||
if params.ExcludeArchived {
|
||||
values.Add("exclude_archived", strconv.FormatBool(params.ExcludeArchived))
|
||||
}
|
||||
if params.TeamID != "" {
|
||||
values.Add("team_id", params.TeamID)
|
||||
}
|
||||
|
||||
response := struct {
|
||||
Channels []Channel `json:"channels"`
|
||||
|
14
vendor/github.com/slack-go/slack/dialog_select.go
generated
vendored
14
vendor/github.com/slack-go/slack/dialog_select.go
generated
vendored
@ -54,6 +54,20 @@ func NewStaticSelectDialogInput(name, label string, options []DialogSelectOption
|
||||
}
|
||||
}
|
||||
|
||||
// NewExternalSelectDialogInput constructor for a `external` datasource menu input
|
||||
func NewExternalSelectDialogInput(name, label string, options []DialogSelectOption) *DialogInputSelect {
|
||||
return &DialogInputSelect{
|
||||
DialogInput: DialogInput{
|
||||
Type: InputTypeSelect,
|
||||
Name: name,
|
||||
Label: label,
|
||||
Optional: true,
|
||||
},
|
||||
DataSource: DialogDataSourceExternal,
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGroupedSelectDialogInput creates grouped options select input for Dialogs.
|
||||
func NewGroupedSelectDialogInput(name, label string, options []DialogOptionGroup) *DialogInputSelect {
|
||||
return &DialogInputSelect{
|
||||
|
1
vendor/github.com/slack-go/slack/interactions.go
generated
vendored
1
vendor/github.com/slack-go/slack/interactions.go
generated
vendored
@ -121,6 +121,7 @@ type Container struct {
|
||||
Type string `json:"type"`
|
||||
ViewID string `json:"view_id"`
|
||||
MessageTs string `json:"message_ts"`
|
||||
ThreadTs string `json:"thread_ts,omitempty"`
|
||||
AttachmentID json.Number `json:"attachment_id"`
|
||||
ChannelID string `json:"channel_id"`
|
||||
IsEphemeral bool `json:"is_ephemeral"`
|
||||
|
Reference in New Issue
Block a user