Update dependencies and build to go1.22 (#2113)

* Update dependencies and build to go1.22

* Fix api changes wrt to dependencies

* Update golangci config
This commit is contained in:
Wim
2024-05-23 23:44:31 +02:00
committed by GitHub
parent 56e7bd01ca
commit 2f33fe86f5
1556 changed files with 3279522 additions and 1924375 deletions

View File

@@ -62,6 +62,10 @@ func (api *Client) CreateUserGroupContext(ctx context.Context, userGroup UserGro
"name": {userGroup.Name},
}
if userGroup.TeamID != "" {
values["team_id"] = []string{userGroup.TeamID}
}
if userGroup.Handle != "" {
values["handle"] = []string{userGroup.Handle}
}
@@ -122,6 +126,12 @@ func (api *Client) EnableUserGroupContext(ctx context.Context, userGroup string)
// GetUserGroupsOption options for the GetUserGroups method call.
type GetUserGroupsOption func(*GetUserGroupsParams)
func GetUserGroupsOptionWithTeamID(teamID string) GetUserGroupsOption {
return func(params *GetUserGroupsParams) {
params.TeamID = teamID
}
}
// GetUserGroupsOptionIncludeCount include the number of users in each User Group (default: false)
func GetUserGroupsOptionIncludeCount(b bool) GetUserGroupsOption {
return func(params *GetUserGroupsParams) {
@@ -145,6 +155,7 @@ func GetUserGroupsOptionIncludeUsers(b bool) GetUserGroupsOption {
// GetUserGroupsParams contains arguments for GetUserGroups method call
type GetUserGroupsParams struct {
TeamID string
IncludeCount bool
IncludeDisabled bool
IncludeUsers bool
@@ -166,6 +177,9 @@ func (api *Client) GetUserGroupsContext(ctx context.Context, options ...GetUserG
values := url.Values{
"token": {api.token},
}
if params.TeamID != "" {
values.Add("team_id", params.TeamID)
}
if params.IncludeCount {
values.Add("include_count", "true")
}