mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-07-17 02:57:31 -05:00
Merge pull request #57 from danilopopeye/feature/implement-AddUserToGroups-parameters
add parameters to `AddUserToGroups` method
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user