Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated post.user #75

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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