Skip to content

Commit da6b5f8

Browse files
committed
Adding get_by_name to Teams() and BusinessUnit()
1 parent 1950f72 commit da6b5f8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

veracode_api_py/identity.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ def delete(self,user_guid: UUID):
149149
return APIHelper()._rest_request(uri,"DELETE")
150150

151151
class Teams():
152+
def get_by_name(self, team_name, all_for_org=False):
153+
#Gets a list of teams matching a team_name using the Veracode Identity API
154+
request_params = {'page': 0}
155+
request_params.update({'team_name': parse.quote(team_name)})
156+
if all_for_org:
157+
request_params.update({'all_for_org': True})
158+
return APIHelper()._rest_paged_request("api/authn/v2/teams","GET","teams",request_params)
159+
160+
152161
def get_all(self, all_for_org=False):
153162
#Gets a list of teams using the Veracode Identity API
154163
if all_for_org:
@@ -208,6 +217,11 @@ def delete(self, team_guid: UUID):
208217
class BusinessUnits():
209218
base_uri = "api/authn/v2/business_units"
210219

220+
def get_by_name(self, bu_name):
221+
#Gets a list of business units matching a bu_name using the Veracode Identity API
222+
request_params = {'bu_name': parse.quote(bu_name), 'page': 0}
223+
return APIHelper()._rest_paged_request(self.base_uri,"GET","business_units",request_params)
224+
211225
def get_all(self):
212226
request_params = {'page': 0}
213227
return APIHelper()._rest_paged_request(self.base_uri,"GET","business_units",request_params)

0 commit comments

Comments
 (0)