Skip to content

Commit

Permalink
Updated post.user (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
LivCurtis authored Jul 26, 2024
1 parent 59c88c0 commit 77ecefe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions odins_spear/methods/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,16 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_name:

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_
"""
Creates a new user in the specified group with the configuration defined in the payload.
Args:
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.
extension (str): Extension number of new user.
web_auth_password (str): Web authentication password. Note get.password_generate() can be used to get this.
payload (dict): User configuration.
Expand All @@ -458,8 +459,8 @@ def user(self, service_provider_id: str, group_id: str, user_id: str, first_name

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["callingLineIdFirstName"] = first_name if not payload.get("callingLineIdFirstName") else payload["callingLineIdFirstName"]
payload["callingLineIdLastName"] = last_name if not payload.get("callingLineIdLastName") else payload["callingLineIdLastName"]

payload["serviceProviderId"] = service_provider_id
payload["groupId"] = group_id
Expand Down

0 comments on commit 77ecefe

Please sign in to comment.