Merge pull request #57 from danilopopeye/feature/implement-AddUserToGroups-parameters

add parameters to `AddUserToGroups` method
This commit is contained in:
George Fleury
2020-08-10 14:58:52 +02:00
committed by GitHub
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