add parameters to AddUserToGroups method

This commit is contained in:
Danilo Gonçalves
2020-08-07 20:15:53 -03:00
parent a1f7d4e0d6
commit 90ff150627
2 changed files with 11 additions and 5 deletions

View File

@ -128,7 +128,7 @@ func (a *DefaultApiService) AddUserToGroup() (*APIResponse, error) {
Add a user to one or more groups. <p> The authenticated user must have the <strong>ADMIN</strong> permission to call this resource.
@return */
func (a *DefaultApiService) AddUserToGroups() (*APIResponse, error) {
func (a *DefaultApiService) AddUserToGroups(name string, groups []string) (*APIResponse, error) {
var (
localVarHTTPMethod = strings.ToUpper("Post")
localVarPostBody interface{}
@ -136,6 +136,11 @@ func (a *DefaultApiService) AddUserToGroups() (*APIResponse, error) {
localVarFileBytes []byte
)
localVarPostBody = map[string]interface{}{
"user": name,
"groups": groups,
}
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/api/1.0/admin/users/add-groups"
@ -175,7 +180,7 @@ func (a *DefaultApiService) AddUserToGroups() (*APIResponse, error) {
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
}
return NewBitbucketAPIResponse(localVarHTTPResponse)
return NewAPIResponse(localVarHTTPResponse), nil
}
/* DefaultApiService