From c2ab422b6eb68df291769e83c34255927e4a4177 Mon Sep 17 00:00:00 2001 From: CHOPP3D <64507146+Chopped4Life@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:41:33 +0000 Subject: [PATCH 1/3] Resolved issue Group ID and Service prov id not needed. Only auto_attendant_id Changed doc string to reflect --- odins_spear/methods/put.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/odins_spear/methods/put.py b/odins_spear/methods/put.py index 5bbd722..e159eb0 100644 --- a/odins_spear/methods/put.py +++ b/odins_spear/methods/put.py @@ -91,18 +91,13 @@ def auto_attendants_status(self, auto_attendant_user_ids: list, return self.requester.put(endpoint, data=data) - - - def auto_attendant(self, service_provider_id: str, group_id, - auto_attendant_user_id: str, updates: dict): + def auto_attendant(self, auto_attendant_id: str, updates: dict): """Updates a single target Auto Attendant. Note: Needs the service instance profile to use this method. Args: - service_provider_id (str): Service Provider ID where Group is hosted. - group_id (str): Group ID where target Auto Attendant is located. - auto_attendant_user_id (str): Target Auto Attendant User ID. + auto_attendant_id (str): Target Auto Attendant User ID. updates (dict): Updates to be applied to Auto Attendant. Returns: @@ -111,12 +106,10 @@ def auto_attendant(self, service_provider_id: str, group_id, endpoint = "/groups/auto-attendants" - updates["serviceProviderId"] = service_provider_id - updates["groupId"] = group_id - updates["serviceUserId"] = auto_attendant_user_id + updates["serviceUserId"] = auto_attendant_id return self.requester.put(endpoint, data=updates) - + def auto_attendant_submenu(self, auto_attendant_user_id: str, submenu_id: str, updates: dict): From c0407da848d6e6e79f272640be5bb2e15dc4dccf Mon Sep 17 00:00:00 2001 From: CHOPP3D <64507146+Chopped4Life@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:32:16 +0000 Subject: [PATCH 2/3] Updated code 2 Updated put.aa to add if statement. Readded group id and service provi id This will now add serviceinstanceprofile to code if not found in updates payload --- odins_spear/methods/put.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/odins_spear/methods/put.py b/odins_spear/methods/put.py index e159eb0..21ec0f9 100644 --- a/odins_spear/methods/put.py +++ b/odins_spear/methods/put.py @@ -91,13 +91,15 @@ def auto_attendants_status(self, auto_attendant_user_ids: list, return self.requester.put(endpoint, data=data) - def auto_attendant(self, auto_attendant_id: str, updates: dict): + def auto_attendant(self, service_provider_id: str, group_id, auto_attendant_user_id: str, updates: dict): """Updates a single target Auto Attendant. Note: Needs the service instance profile to use this method. Args: - auto_attendant_id (str): Target Auto Attendant User ID. + service_provider_id (str): Service Provider ID where Group is hosted. + group_id (str): Group ID where target Auto Attendant is located. + auto_attendant_user_id (str): Target Auto Attendant User ID. updates (dict): Updates to be applied to Auto Attendant. Returns: @@ -106,7 +108,10 @@ def auto_attendant(self, auto_attendant_id: str, updates: dict): endpoint = "/groups/auto-attendants" - updates["serviceUserId"] = auto_attendant_id + if 'serviceInstanceProfile' not in updates: + updates.setdefault('serviceInstanceProfile', {}) + + updates["serviceUserId"] = auto_attendant_user_id return self.requester.put(endpoint, data=updates) From b822327e847be446ac7ab65438bef9d588d6f0f8 Mon Sep 17 00:00:00 2001 From: CHOPP3D <64507146+Chopped4Life@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:35:39 +0000 Subject: [PATCH 3/3] Update put.py --- odins_spear/methods/put.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odins_spear/methods/put.py b/odins_spear/methods/put.py index 21ec0f9..33c9b6b 100644 --- a/odins_spear/methods/put.py +++ b/odins_spear/methods/put.py @@ -111,6 +111,8 @@ def auto_attendant(self, service_provider_id: str, group_id, auto_attendant_user if 'serviceInstanceProfile' not in updates: updates.setdefault('serviceInstanceProfile', {}) + updates["serviceProviderId"] = service_provider_id + updates["groupId"] = group_id updates["serviceUserId"] = auto_attendant_user_id return self.requester.put(endpoint, data=updates)