From 2082904dee608db47d9b6b08b8e71bc92841870a Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Thu, 27 Jun 2024 11:43:29 +0100 Subject: [PATCH 1/7] Update group_call_centers & group_call_center Updated docstrings for call center functions --- odins_spear/methods/get.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index 0cc3071..8881d11 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -74,6 +74,15 @@ def auto_attendant(self, service_user_id): # CALL CENTER def group_call_centers(self, service_provider_id: str, group_id: str): + """Fetches a list of a groups active Call Centers. + + Args: + service_provider_id (str): Target Service Provider + group_id (str): Target Group ID + + Returns: + Dict: List of Call Centres and their settings. + """ endpoint = f"/groups/call-centers?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -81,6 +90,14 @@ def group_call_centers(self, service_provider_id: str, group_id: str): def group_call_center(self, service_user_id: str): + """Fetches a list of a Call Center's settings and profile. + + Args: + service_user_id (str): Target Call Center's UserID + + Returns: + Dict: List of the Call Center's settings and profile + """ endpoint = f"/groups/call-centers?serviceUserId={service_user_id}" From caf32eff0df6b7d8603951c98d1b05acd548cdb3 Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Thu, 27 Jun 2024 15:03:33 +0100 Subject: [PATCH 2/7] Updated user_call_center, group_call_center_bounced_calls, group_call_center_forced_forwarding Updated Docstrings for the following functions --- odins_spear/methods/get.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index 8881d11..4c73808 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -74,7 +74,7 @@ def auto_attendant(self, service_user_id): # CALL CENTER def group_call_centers(self, service_provider_id: str, group_id: str): - """Fetches a list of a groups active Call Centers. + """Fetches a list of a groups active Call Centers in a group. Args: service_provider_id (str): Target Service Provider @@ -93,7 +93,7 @@ def group_call_center(self, service_user_id: str): """Fetches a list of a Call Center's settings and profile. Args: - service_user_id (str): Target Call Center's UserID + service_user_id (str): Target Call Center's ID Returns: Dict: List of the Call Center's settings and profile @@ -105,13 +105,30 @@ def group_call_center(self, service_user_id: str): def user_call_center(self, user_id: str): + """Fetches a list of call centers the specified user is currently associated with. + + Args: + user_id (str): Target User ID + + Returns: + Dict: List of the User's associated Call Centers. + """ endpoint = f"/users/call-center?userId={user_id}" return self.requester.get(endpoint) + def group_call_center_bounced_calls(self, service_user_id: str): + """Fetches the amount of Rings before a call is Bounced from the Call Center + + Args: + service_user_id (str): Target Call Center ID + + Returns: + Dict: Amount of Rings before a call is Bounced + """ endpoint = f"/groups/call-centers/bounced-calls?serviceUserId={service_user_id}" @@ -119,6 +136,14 @@ def group_call_center_bounced_calls(self, service_user_id: str): def group_call_center_forced_forwarding(self, service_user_id: str): + """Fetches the Forwarding Number if a Call Center is set to Forward Calls + + Args: + service_user_id (str): Target Call Center ID + + Returns: + Dict: Number to be Forwarded to, alongside any Audio Messages. + """ endpoint = f"/groups/call-centers/forced-forwarding?serviceUserId={service_user_id}" From 811e55ac8b0a2fd614483aa8a7894c10aa61277e Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Thu, 27 Jun 2024 15:47:45 +0100 Subject: [PATCH 3/7] Updated group_call_center_overflow Provided dostrings --- odins_spear/methods/get.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index 4c73808..e8508d2 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -151,6 +151,13 @@ def group_call_center_forced_forwarding(self, service_user_id: str): def group_call_center_overflow(self, service_user_id): + """Fetches the number that a user is directed to when all call center agents are busy on the phone. + Args: + service_user_id (str): Target Call Center ID + + Returns: + Dict: Number to be Forwarded to, alongside any Audio Messages. + """ endpoint = f"/groups/call-centers/overflow?serviceUserId={service_user_id}" From 268c7c9fd4c206a70c0c5488e79c4bb51ec4734d Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Tue, 2 Jul 2024 11:06:38 +0100 Subject: [PATCH 4/7] Updated forwarding funcs Also rewrote a few as they were hard to understand --- odins_spear/methods/get.py | 104 ++++++++++++++++++++++++++++++++++--- 1 file changed, 97 insertions(+), 7 deletions(-) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index e8508d2..f53d1d6 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -74,10 +74,10 @@ def auto_attendant(self, service_user_id): # CALL CENTER def group_call_centers(self, service_provider_id: str, group_id: str): - """Fetches a list of a groups active Call Centers in a group. + """Retrieves a list of active call centers within a specified group, along with their settings. Args: - service_provider_id (str): Target Service Provider + service_provider_id (str): Target Service Provider where group is hosted group_id (str): Target Group ID Returns: @@ -90,7 +90,7 @@ def group_call_centers(self, service_provider_id: str, group_id: str): def group_call_center(self, service_user_id: str): - """Fetches a list of a Call Center's settings and profile. + """Retrieves a list of a Call Center's settings and profile. Args: service_user_id (str): Target Call Center's ID @@ -105,7 +105,7 @@ def group_call_center(self, service_user_id: str): def user_call_center(self, user_id: str): - """Fetches a list of call centers the specified user is currently associated with. + """Retrieves a list of call centers that the specified user is currently associated with. Args: user_id (str): Target User ID @@ -121,7 +121,7 @@ def user_call_center(self, user_id: str): def group_call_center_bounced_calls(self, service_user_id: str): - """Fetches the amount of Rings before a call is Bounced from the Call Center + """Retrieves the number of rings before a call is bounced from the specified call center. Args: service_user_id (str): Target Call Center ID @@ -136,7 +136,7 @@ def group_call_center_bounced_calls(self, service_user_id: str): def group_call_center_forced_forwarding(self, service_user_id: str): - """Fetches the Forwarding Number if a Call Center is set to Forward Calls + """Retrieves the forwarding number for a call center if it is set to forward calls, along with any associated audio messages. Args: service_user_id (str): Target Call Center ID @@ -151,7 +151,8 @@ def group_call_center_forced_forwarding(self, service_user_id: str): def group_call_center_overflow(self, service_user_id): - """Fetches the number that a user is directed to when all call center agents are busy on the phone. + """Retrieves the forwarding number for a user when all call center agents are busy, along with any associated audio messages. + Args: service_user_id (str): Target Call Center ID @@ -165,6 +166,14 @@ def group_call_center_overflow(self, service_user_id): def group_call_center_stranded_calls(self, service_user_id): + """Retrieves the forwarding number for a user when a call center doesn't answer, along with any associated audio messages. + + Args: + service_user_id (str): Target Call Center ID + + Returns: + Dict: Number to be Forwarded to, alongside any Audio Messages. + """ endpoint = f"/groups/call-centers/stranded-calls?serviceUserId={service_user_id}" @@ -172,6 +181,14 @@ def group_call_center_stranded_calls(self, service_user_id): def group_call_center_stranded_calls_unavailable(self, service_user_id): + """Retrieves the forwarding number for a user when a call center doesn't answer, along with the count of agents with an unavailable code in the call center. + + Args: + service_user_id (str): Target Call Center ID + + Returns: + Dict: Number to be Forwarded to, and Agents with an Unavailable Code set. + """ endpoint = f"/groups/call-centers/stranded-calls-unavailable?serviceUserId={service_user_id}" @@ -181,6 +198,15 @@ def group_call_center_stranded_calls_unavailable(self, service_user_id): # CALL FORWARDING ALWAYS def user_call_forwarding_always(self, user_id: str): + + """Retrieves the Forwarding Always status for the specified User. + + Args: + user_id (str): Target User ID + + Returns: + Dict: Forwarding enabled status, and the Number to be Forwarded to. + """ endpoint = f"/users/call-forwarding-always?userId={user_id}" @@ -188,6 +214,16 @@ def user_call_forwarding_always(self, user_id: str): def bulk_call_forwarding_always(self, service_provider_id: str, group_id: str): + + """Retrieves the Forwarding Always status for all users within a specified group. + + Args: + service_provider_id (str): Target Service Provider where group is hosted + group_id (str): Target Group ID + + Returns: + List: Forwarding enabled status, the Number to be Forwarded to, and User information. + """ endpoint = f"/users/call-forwarding-always/bulk?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -197,6 +233,14 @@ def bulk_call_forwarding_always(self, service_provider_id: str, group_id: str): # CALL FORWARDING BUSY def user_call_forwarding_busy(self, user_id: str): + """Retrieves the Forwarding Not Reachable status for the specified user. + + Args: + user_id (str): Target User ID + + Returns: + Dict: Forwarding enabled status, and the Number to be Forwarded to. + """ endpoint = f"/users/call-forwarding-busy?userId={user_id}" @@ -204,6 +248,16 @@ def user_call_forwarding_busy(self, user_id: str): def bulk_call_forwarding_busy(self, service_provider_id: str, group_id: str): + """Retrieves the Forwarding Busy status for all users within a specified group. + + Args: + service_provider_id (str): Target Service Provider where group is hosted + group_id (str): Target Group ID + + + Returns: + List: Forwarding enabled status, the Number to be Forwarded to, and User information. + """ endpoint = f"/users/call-forwarding-busy/bulk?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -213,6 +267,14 @@ def bulk_call_forwarding_busy(self, service_provider_id: str, group_id: str): # CALL FORWARDING NO ANSWER def user_call_forwarding_no_answer(self, user_id: str): + """Retrieves the Forwarding No Answer status for the specified user + + Args: + user_id (str): Target User ID + + Returns: + Dict: Forwarding enabled status, and the Number to be Forwarded to. + """ endpoint = f"/users/call-forwarding-no-answer?userId={user_id}" @@ -220,6 +282,16 @@ def user_call_forwarding_no_answer(self, user_id: str): def bulk_call_forwarding_no_answer(self, service_provider_id: str, group_id: str): + """Retrieves the Forwarding No Answer status for all users within a specified group. + + Args: + service_provider_id (str): Target Service Provider where group is hosted + group_id (str): Target Group ID + + + Returns: + List: Forwarding enabled status, the Number to be Forwarded to, and User information. + """ endpoint = f"/users/call-forwarding-no-answer/bulk?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -229,6 +301,14 @@ def bulk_call_forwarding_no_answer(self, service_provider_id: str, group_id: str # CALL FORWARDING NOT REACHABLE def user_call_forwarding_not_reachable(self, user_id: str): + """Retrieves the Forwarding Not Reachable status for the specified user + + Args: + user_id (str): Target User ID + + Returns: + Dict: Forwarding enabled status, and the Number to be Forwarded to. + """ endpoint = f"/users/call-forwarding-not-reachable?userId={user_id}" @@ -236,6 +316,16 @@ def user_call_forwarding_not_reachable(self, user_id: str): def bulk_call_forwarding_not_reachable(self, service_provider_id: str, group_id: str): + """Retrieves the Forwarding Not Reachable status for all users within a specified group. + + Args: + service_provider_id (str): Target Service Provider where group is hosted + group_id (str): Target Group ID + + + Returns: + List: Forwarding enabled status, the Number to be Forwarded to, and User information. + """ endpoint = f"/users/call-forwarding-not-reachable/bulk?serviceProviderId={service_provider_id}&groupId={group_id}" From ca8d8ad798852f0a9b07acb5c0b73c0619c56007 Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Fri, 5 Jul 2024 16:39:39 +0100 Subject: [PATCH 5/7] Finished get.py Updated rest of call forwarding functions --- odins_spear/methods/get.py | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index f53d1d6..2dcd812 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -81,7 +81,7 @@ def group_call_centers(self, service_provider_id: str, group_id: str): group_id (str): Target Group ID Returns: - Dict: List of Call Centres and their settings. + Dict: List of Call Centers and their settings. """ endpoint = f"/groups/call-centers?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -335,6 +335,14 @@ def bulk_call_forwarding_not_reachable(self, service_provider_id: str, group_id: # CALL FORWARDING SELECTIVE def user_call_forwarding_selective(self, user_id: str): + """Retrieves the Forwarding Selective status for a specified User, alongside the criteria. + + Args: + user_id (str): Target User ID + + Returns: + Dict: Forwarding enabled status and the Forwarding criteria. + """ endpoint = f"/users/call-forwarding-selective?userId={user_id}" @@ -342,6 +350,14 @@ def user_call_forwarding_selective(self, user_id: str): def user_call_forwarding_selective_criterias(self, user_id: str): + """Retrieves the Forwarding Selective status for a specified User, alongside the criteria's assigned. + + Args: + user_id (str): Target User ID + + Returns: + Dict: Forwarding enabled status and the Forwarding criteria's names and settings. + """ endpoint = f"/users/call-forwarding-selective/criteria?userId={user_id}" @@ -349,6 +365,15 @@ def user_call_forwarding_selective_criterias(self, user_id: str): def user_call_forwarding_selective_criteria(self, user_id: str, criteria_name: str): + """Retrieves the Forwarding Selective status for a specified User, alongside the specified Criteria + + Args: + user_id (str): Target User ID + criteria_name (str): Target Criteria Name + + Returns: + Dict: Forwarding enabled status and the specified Criterias Settings. + """ endpoint = f"/users/call-forwarding-selective/criteria?criteriaName={criteria_name}&userId={user_id}" @@ -359,6 +384,16 @@ def user_call_forwarding_selective_criteria(self, user_id: str, criteria_name: s # CALL PICKUP def call_pickup_group_user(self, service_provider_id, group_id, user_id): + """Retrieves Pickup Group information for the specified user. + + Args: + service_provider_id (str): Target Service Provider ID + group_id (str): The Target Group ID the user is apart of. + user_id (str): Target User ID + + Returns: + Dict: Specified users pickup group, and the users within that group. + """ endpoint = f"/groups/call-pickup/user?serviceProviderId={service_provider_id}&groupId={group_id}&userId={user_id}" From 4ac084a03e621b7f3775c18a5367e30edb3ebee7 Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Fri, 5 Jul 2024 17:15:57 +0100 Subject: [PATCH 6/7] Updated Hunt Groups --- odins_spear/methods/get.py | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index 2dcd812..0d7ed14 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -650,6 +650,14 @@ def user_do_not_disturb(self, user_id: str): # GROUPS def groups(self, service_provider_id: str): + """Returns the specificied Service Provider's Groups. + + Args: + service_provider_id (str): Target Service Provider ID + + Returns: + List: List of groups and their Names, alongside groupID's and userLimits. + """ endpoint = f"/groups?serviceProviderId={service_provider_id}" @@ -657,6 +665,15 @@ def groups(self, service_provider_id: str): def group(self, service_provider_id, group_id): + """Returns the specificied Group's settings and information. + + Args: + service_provider_id (str): Target Service Provider ID + group_id (str): Target Group ID + + Returns: + Dict: Returns information about the specified group, such as the DID, userCount and Domain. + """ endpoint = f"/groups?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -668,18 +685,45 @@ def group(self, service_provider_id, group_id): # HUNT GROUPS def group_hunt_groups(self, service_provider_id, group_id): + """Returns a list of all the Hunt Groups within the specified Group. + + Args: + service_provider_id (str): Target Service Provider ID + group_id (str): Target Group ID + + Returns: + List: Returns a list of every Hunt Group within a Group, alongside their extension and name. + """ endpoint = f"/groups/hunt-groups?serviceProviderId={service_provider_id}&groupId={group_id}" return self.requester.get(endpoint) def group_hunt_group(self, service_user_id): + """Returns information about the specified Hunt Group. + + Args: + service_user_id (str): UserID of the target Hunt Group. + + Returns: + Dict: Returns the specified Hunt Groups settings and information, such as group policies, agents, and extension. + """ endpoint = f"/groups/hunt-groups?serviceUserId={service_user_id}" return self.requester.get(endpoint) def group_hunt_group_user(self, service_provider_id, group_id, user_id): + """Returns the Hunt Group's the specified User is apart of. + + Args: + service_provider_id (str): Target Service Provider ID + group_id (str): Target Group ID + user_id (str): Target User ID + + Returns: + List: Returns the Hunt Group's a user is within, alongside their settings within that Hunt Group. + """ endpoint = f"/groups/hunt-groups/user?serviceProviderId={service_provider_id}&groupId={group_id}&userId={user_id}" @@ -871,6 +915,15 @@ def user_report(self, user_id: str): # SCHEDULES def group_schedules(self, service_provider_id: str, group_id: str): + """ Retrieves the Business Schedules for the specified group. + + Args: + service_provider_id (str): Target Service Provider ID + group_id (str): Target Group ID + + Returns: + List: List of all the groups schedules, including Name, Type and Level. + """ endpoint = f"/groups/schedules?serviceProviderId={service_provider_id}&groupId={group_id}" @@ -878,6 +931,15 @@ def group_schedules(self, service_provider_id: str, group_id: str): def group_events(self, service_provider_id: str, group_id: str, name: str, type: str): + """ Retrieves the Business Schedules for the specified group. + + Args: + service_provider_id (str): Target Service Provider ID + group_id (str): Target Group ID + + Returns: + List: List of all the groups schedules, including Name, Type and Level. + """ endpoint = f"/groups/events?serviceProviderId={service_provider_id}&groupId={group_id}&name={name}&type={type}" From c8e057dbdf42a69781ef5b37475167055a38d978 Mon Sep 17 00:00:00 2001 From: Malkin0xb Date: Mon, 8 Jul 2024 11:55:27 +0100 Subject: [PATCH 7/7] Finished get.py --- odins_spear/methods/get.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/odins_spear/methods/get.py b/odins_spear/methods/get.py index 0d7ed14..569da73 100644 --- a/odins_spear/methods/get.py +++ b/odins_spear/methods/get.py @@ -931,14 +931,16 @@ def group_schedules(self, service_provider_id: str, group_id: str): def group_events(self, service_provider_id: str, group_id: str, name: str, type: str): - """ Retrieves the Business Schedules for the specified group. + """ Retrieves the Business Schedule's Events for the specified group. Args: service_provider_id (str): Target Service Provider ID group_id (str): Target Group ID + name (str): Name of the target Busisness Schedule + type (str): The type of the Business Schedule (Time, Holiday) Returns: - List: List of all the groups schedules, including Name, Type and Level. + List: List of each Business Schedule Event, including startTime and endTime. """ endpoint = f"/groups/events?serviceProviderId={service_provider_id}&groupId={group_id}&name={name}&type={type}"