From f1757670f1f1e63825520d296c6db9c425798e14 Mon Sep 17 00:00:00 2001 From: Jordan Prescott Date: Thu, 27 Jun 2024 11:30:52 +0100 Subject: [PATCH 1/3] increasing capacities at sp and grp level working --- odins_spear/methods/put.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/odins_spear/methods/put.py b/odins_spear/methods/put.py index 0d50559..763524a 100644 --- a/odins_spear/methods/put.py +++ b/odins_spear/methods/put.py @@ -1106,7 +1106,7 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, updates: di return self.requester.put(endpoint, data=updates) - def service_providers_trunk_group_call_capacity(self, service_provider_id: str, updates: dict): + def service_providers_trunk_group_call_capacity(self, service_provider_id: str, max_active_calls: int, bursting_max_active_calls: int =None): """ Updates the max active calls and the bursting max active calls for the given service provider. @@ -1119,10 +1119,16 @@ def service_providers_trunk_group_call_capacity(self, service_provider_id: str, """ endpoint = "/service-providers/trunk-groups/call-capacity" + + data = { + "maxActiveCalls": max_active_calls, + "serviceProviderId": service_provider_id + } + + if bursting_max_active_calls: + data["burstingMaxActiveCalls"] = bursting_max_active_calls - updates["serviceProviderId"] = service_provider_id - - return self.requester.put(endpoint, data=updates) + return self.requester.put(endpoint, data=data) #TWO STAGE DIALING #USERS From 059e18d25d71bd4093cb69943567dc7acc3042ac Mon Sep 17 00:00:00 2001 From: Jordan Prescott Date: Fri, 28 Jun 2024 15:03:35 +0100 Subject: [PATCH 2/3] fixes found in recreation of EVA --- odins_spear/methods/post.py | 29 +++++++++++++++++++++++------ odins_spear/methods/put.py | 6 +++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/odins_spear/methods/post.py b/odins_spear/methods/post.py index 39251a7..058b4cb 100644 --- a/odins_spear/methods/post.py +++ b/odins_spear/methods/post.py @@ -303,8 +303,6 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, service_user payload["noAnswerNumberOfRings"] = no_answer_number_of_rings payload["forwardTimeoutSeconds"] = forward_timeout_seconds - payload["agents"] = [{'userId': agent_id} for agent_id in agents] - if 'serviceInstanceProfile' not in payload: payload.setdefault('serviceInstanceProfile', {}) @@ -456,19 +454,38 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_name: #TWO STAGE DIALING #USERS - def user(self, user): + def user(self, service_provider_id: str, group_id: str, user_id: str, first_name: str, last_name: str, + extension: str, web_auth_password: str, payload: dict ={}): """_summary_ Args: - user (_type_): _description_ + service_provider_id (str): _description_ + group_id (str): _description_ + user_id (str): _description_ + first_name (str): _description_ + last_name (str): _description_ + extension (str): _description_ + web_auth_password (str): _description_ + payload (dict, optional): _description_. Defaults to {}. Returns: _type_: _description_ """ - endpoint = "users" + endpoint = "/users" + + payload["callingLineIdFirstName"] = first_name if not payload["callingLineIdFirstName"] else payload["callingLineIdFirstName"] + payload["callingLineIdLastName"] = last_name if not payload["callingLineIdLastName"] else payload["callingLineIdLastName"] + + payload["serviceProviderId"] = service_provider_id + payload["groupId"] = group_id + payload["userId"] = user_id + payload["firstName"] = first_name + payload["lastName"] = last_name + payload["extension"] = extension + payload["password"] = web_auth_password - return self.requester.post(endpoint, data=user) + return self.requester.post(endpoint, data=payload) #USER CUSTOM RINGBACK #VIDEO ADD ON diff --git a/odins_spear/methods/put.py b/odins_spear/methods/put.py index 763524a..a923403 100644 --- a/odins_spear/methods/put.py +++ b/odins_spear/methods/put.py @@ -1151,9 +1151,9 @@ def user(self, service_provider_id: str, group_id, user_id: str, updates: dict): endpoint = "/users" - updates["serviceProviderId"] = [service_provider_id] - updates["groupId"] = [group_id] - updates["userId"] = [user_id] + updates["serviceProviderId"] = service_provider_id + updates["groupId"] = group_id + updates["userId"] = user_id return self.requester.put(endpoint, data=updates) From dc59ee9a7f1593ee0d932c0d406f23f2c920e6db Mon Sep 17 00:00:00 2001 From: Jordan Prescott Date: Tue, 2 Jul 2024 10:46:44 +0100 Subject: [PATCH 3/3] added docstring to post.user() --- odins_spear/methods/post.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/odins_spear/methods/post.py b/odins_spear/methods/post.py index 058b4cb..ad39ca0 100644 --- a/odins_spear/methods/post.py +++ b/odins_spear/methods/post.py @@ -455,21 +455,21 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_name: #USERS def user(self, service_provider_id: str, group_id: str, user_id: str, first_name: str, last_name: str, - extension: str, web_auth_password: str, payload: dict ={}): + extension: str, web_auth_password: str, payload: dict): """_summary_ Args: - service_provider_id (str): _description_ - group_id (str): _description_ - user_id (str): _description_ - first_name (str): _description_ - last_name (str): _description_ - extension (str): _description_ - web_auth_password (str): _description_ - payload (dict, optional): _description_. Defaults to {}. + service_provider_id (str): Service provider ID where Group is loctaed. + group_id (str): Group ID where new user will be built. + user_id (str): Complete User ID including group domain of new user. + first_name (str): First name of new user. + last_name (str): Last name of new user. + extension (str): Extension numebr of new user. + web_auth_password (str): Web authentication password. Note get.password_generate() can be used to get this. + payload (dict): User configuration. Returns: - _type_: _description_ + Dict: New user entity. """ endpoint = "/users"