Skip to content

Commit

Permalink
Update users.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shijl0925 committed May 19, 2023
1 parent 87932f6 commit 05f78a1
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions sonarqube/community/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@
from sonarqube.utils.common import GET, POST


class SonarQubeUsers(RestClient):
"""
SonarQube users Operations
"""

class SonarQubeBaseUsers(RestClient):
MAX_SEARCH_NUM = 200

def __init__(self, **kwargs):
"""
:param kwargs:
"""
super(SonarQubeUsers, self).__init__(**kwargs)
super(SonarQubeBaseUsers, self).__init__(**kwargs)

def get(self, login):
result = self.search_users(q=login)
Expand All @@ -39,16 +35,6 @@ def get(self, login):
if user["login"] == login:
return user

@POST(API_USERS_ANONYMIZE_ENDPOINT)
def anonymize_deactivated_user(self, login):
"""
SINCE 9.7
Anonymize a deactivated user.
:param login: User login
:return: request response
"""

@GET(API_USERS_SEARCH_ENDPOINT)
def search_users(self, q=None, p=None, ps=None):
"""
Expand All @@ -61,6 +47,22 @@ def search_users(self, q=None, p=None, ps=None):
:return:
"""


class SonarQubeUsers(SonarQubeBaseUsers):
"""
SonarQube users Operations
"""

@POST(API_USERS_ANONYMIZE_ENDPOINT)
def anonymize_deactivated_user(self, login):
"""
SINCE 9.7
Anonymize a deactivated user.
:param login: User login
:return: request response
"""

def create_user(
self, login, name, email=None, password=None, local="true", scmAccount=None
):
Expand Down

0 comments on commit 05f78a1

Please sign in to comment.