Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

99 add all hunt group methods #106

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -891,6 +891,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 @@ -27,8 +27,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