Skip to content

Commit

Permalink
99 add all hunt group methods (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
LivCurtis authored Aug 28, 2024
1 parent b8d81a0 commit b68e8df
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
22 changes: 22 additions & 0 deletions odins_spear/methods/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,28 @@ def service_provider_dns(self, service_provider_id: str, start_of_range_number:
#HOTELING GUEST
#HOTELING HOST
#HUNT GROUPS

def group_hunt_group(self, service_user_id: str):

"""Deletes the specified hunt group.
Args:
service_user_id (str): The service user ID of the hunt group to be deleted.
Returns:
Dict: Profile of the deleted hunt group.
"""

endpoint = "/groups/hunt-groups"

params = {
"serviceUserId": service_user_id
}

return self.requester.delete(endpoint, params=params)


#IN CALL SERVICE ACTIVATION
#INSTANT GROUP CALL
#INTEGRATED IMP
Expand Down
21 changes: 21 additions & 0 deletions odins_spear/methods/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,27 @@ def group_hunt_group_user(self, service_provider_id, group_id, user_id):
}

return self.requester.get(endpoint, params=params)

def group_hunt_groups_available_users(self, service_provider_id: str, group_id: str):

"""Returns a list of all users within the service provider that are available to be assigned to a hunt group in the specified group.
Args:
service_provider_id (str): Target Service Provider ID
group_id (str): Target Group ID
Returns:
List: available users (dict)
"""

endpoint = "/groups/hunt-groups/users"

params = {
"serviceProviderId": service_provider_id,
"groupId": group_id
}

return self.requester.get(endpoint, params=params)


#IN CALL SERVICE ACTIVATION
Expand Down
24 changes: 24 additions & 0 deletions odins_spear/methods/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,30 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, service_user
payload["serviceInstanceProfile"]["extension"] = extension

return self.requester.post(endpoint, data=payload)


def group_hunt_groups_remove_user(self, service_provider_id: str, group_id: str, user_id: str):

"""Removes the specified user from all hunt groups in which it currently exists.
Args:
service_provider_id (str): The service provider ID in which the target user exists.
group_id (str): The group ID where the user exists.
user_id (str): The User ID of the user that is to be removed from the hunt group(s).
Returns:
List: Service user ID's (str) of the hunt groups from which the specified user has been removed.
"""

endpoint = "/groups/hunt-groups/removeUser"

data = {
"serviceProviderId": service_provider_id,
"groupId": group_id,
"userId": user_id
}

return self.requester.post(endpoint, data=data)

#IN CALL SERVICE ACTIVATION
#INSTANT GROUP CALL
Expand Down
4 changes: 2 additions & 2 deletions odins_spear/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def put(self, endpoint, data=None):
return self._request(requests.put, endpoint, data)


def delete(self, endpoint, data=None):
return self._request(requests.delete, endpoint, data)
def delete(self, endpoint, data=None, params=None):
return self._request(requests.delete, endpoint, data, params)


def _request(self, method, endpoint, data=None, params=None):
Expand Down

0 comments on commit b68e8df

Please sign in to comment.