Skip to content

Commit

Permalink
commenting put requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Prescott committed Jan 26, 2024
1 parent 0a139ef commit 394b7c0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
3 changes: 2 additions & 1 deletion odins_spear/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ class AOInvalidData(OAError):
"""

def __str__(self) -> str:
return f"Data invalid or incomplete, please check data passed to method is correct."
return f"Data invalid or incomplete, please check data passed to method is correct."

32 changes: 26 additions & 6 deletions odins_spear/methods/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def auto_attendants_status(self, auto_attendant_user_ids: list, status: bool =Tr
which will be applied to list of AAs. Defaults to True.
Returns:
None: This function does not return any specific value.
None: This method does not return any specific value.
"""

endpoint = f"/groups/auto-attendants/status"
Expand All @@ -60,7 +60,7 @@ def auto_attendant(self, service_provider_id: str, group_id, auto_attendant_user
updates (dict): _description_
Returns:
_type_: _description_
JSON Data: This method returns json representation of AA updated.
"""

endpoint = f"/groups/auto-attendants"
Expand All @@ -73,13 +73,23 @@ def auto_attendant(self, service_provider_id: str, group_id, auto_attendant_user


def auto_attendant_submenu(self, auto_attendant_user_id: str, submenu_id: str, updates: dict):
"""This method allows you to update the configuration of the submenus for your AAs
Args:
auto_attendant_user_id (str): Service user ID of your auto attendant.
submenu_id (str): Service user ID of your submenu
updates (dict): Updates your applying to your submenu.
Returns:
None: This method does not return any specific value.
"""


endpoint = f"/groups/auto-attendants/submenus"

updates["serviceUserId"] = auto_attendant_user_id,
updates["submenuId"] = submenu_id

self.request.put(endpoint, data=updates)
return self.request.put(endpoint, data=updates)


#AUTOMATIC CALLBACK
Expand All @@ -97,15 +107,25 @@ def auto_attendant_submenu(self, auto_attendant_user_id: str, submenu_id: str, u
#CALL CENTER

def group_call_centers_status(self, call_center_user_ids: list, status: bool =True):

"""Updates a list of call centers (CC) status to either active or inactive.
Args:
call_center_user_ids(list): List of service user IDs (CC IDs), the status given will be applied to these.
status (bool): Boolean value of True (Activate) or False (Deactivate) which will be applied to list of AAs.
Returns:
None: This method does not return any specific value.
"""

endpoint = f"/groups/call-centers/status"

data = {
"instances": [{'serviceUserId': call_center_user_id, 'isActive': status}
for call_center_user_id in call_center_user_ids]
}

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


def group_call_center(self, call_center_user_id: str, updates: dict):
Expand Down Expand Up @@ -324,7 +344,7 @@ def group_hunt_groups_status(self, service_user_ids: list, status: bool =True):
for service_user_id in service_user_ids]
}

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


def group_hunt_group(self, service_provider_id: str, group_id, service_user_id: str, updates: dict):
Expand Down

0 comments on commit 394b7c0

Please sign in to comment.