summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/team.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-09-07 22:46:58 +0200
committerGitHub <noreply@github.com>2019-09-07 22:46:58 +0200
commita3bee01e0af3394c19360b98fd2db1b647f49299 (patch)
treeffc5778361d55d592a718354a37c9251e75fc7f6 /vendor/github.com/nlopes/slack/team.go
parent1dc93ec4f001edd01daccbe408767d4878be25a3 (diff)
downloadmatterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.gz
matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.bz2
matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.zip
Update dependencies (#886)
Diffstat (limited to 'vendor/github.com/nlopes/slack/team.go')
-rw-r--r--vendor/github.com/nlopes/slack/team.go22
1 files changed, 12 insertions, 10 deletions
diff --git a/vendor/github.com/nlopes/slack/team.go b/vendor/github.com/nlopes/slack/team.go
index 1892cf5f..029e2b5b 100644
--- a/vendor/github.com/nlopes/slack/team.go
+++ b/vendor/github.com/nlopes/slack/team.go
@@ -66,9 +66,9 @@ func NewAccessLogParameters() AccessLogParameters {
}
}
-func teamRequest(ctx context.Context, client httpClient, path string, values url.Values, d debug) (*TeamResponse, error) {
+func (api *Client) teamRequest(ctx context.Context, path string, values url.Values) (*TeamResponse, error) {
response := &TeamResponse{}
- err := postSlackMethod(ctx, client, path, values, response, d)
+ err := api.postMethod(ctx, path, values, response)
if err != nil {
return nil, err
}
@@ -76,9 +76,9 @@ func teamRequest(ctx context.Context, client httpClient, path string, values url
return response, response.Err()
}
-func billableInfoRequest(ctx context.Context, client httpClient, path string, values url.Values, d debug) (map[string]BillingActive, error) {
+func (api *Client) billableInfoRequest(ctx context.Context, path string, values url.Values) (map[string]BillingActive, error) {
response := &BillableInfoResponse{}
- err := postSlackMethod(ctx, client, path, values, response, d)
+ err := api.postMethod(ctx, path, values, response)
if err != nil {
return nil, err
}
@@ -86,9 +86,9 @@ func billableInfoRequest(ctx context.Context, client httpClient, path string, va
return response.BillableInfo, response.Err()
}
-func accessLogsRequest(ctx context.Context, client httpClient, path string, values url.Values, d debug) (*LoginResponse, error) {
+func (api *Client) accessLogsRequest(ctx context.Context, path string, values url.Values) (*LoginResponse, error) {
response := &LoginResponse{}
- err := postSlackMethod(ctx, client, path, values, response, d)
+ err := api.postMethod(ctx, path, values, response)
if err != nil {
return nil, err
}
@@ -106,7 +106,7 @@ func (api *Client) GetTeamInfoContext(ctx context.Context) (*TeamInfo, error) {
"token": {api.token},
}
- response, err := teamRequest(ctx, api.httpclient, "team.info", values, api)
+ response, err := api.teamRequest(ctx, "team.info", values)
if err != nil {
return nil, err
}
@@ -130,24 +130,26 @@ func (api *Client) GetAccessLogsContext(ctx context.Context, params AccessLogPar
values.Add("page", strconv.Itoa(params.Page))
}
- response, err := accessLogsRequest(ctx, api.httpclient, "team.accessLogs", values, api)
+ response, err := api.accessLogsRequest(ctx, "team.accessLogs", values)
if err != nil {
return nil, nil, err
}
return response.Logins, &response.Paging, nil
}
+// GetBillableInfo ...
func (api *Client) GetBillableInfo(user string) (map[string]BillingActive, error) {
return api.GetBillableInfoContext(context.Background(), user)
}
+// GetBillableInfoContext ...
func (api *Client) GetBillableInfoContext(ctx context.Context, user string) (map[string]BillingActive, error) {
values := url.Values{
"token": {api.token},
"user": {user},
}
- return billableInfoRequest(ctx, api.httpclient, "team.billableInfo", values, api)
+ return api.billableInfoRequest(ctx, "team.billableInfo", values)
}
// GetBillableInfoForTeam returns the billing_active status of all users on the team.
@@ -161,5 +163,5 @@ func (api *Client) GetBillableInfoForTeamContext(ctx context.Context) (map[strin
"token": {api.token},
}
- return billableInfoRequest(ctx, api.httpclient, "team.billableInfo", values, api)
+ return api.billableInfoRequest(ctx, "team.billableInfo", values)
}