Update dependencies (#886)

This commit is contained in:
Wim
2019-09-07 22:46:58 +02:00
committed by GitHub
parent 1dc93ec4f0
commit a3bee01e0a
145 changed files with 24283 additions and 16572 deletions

View File

@@ -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)
}