From f8f4d543344aaab41938614a2e6b937b1679ffbb Mon Sep 17 00:00:00 2001 From: Nico Melone Date: Wed, 11 Dec 2024 16:36:37 -0600 Subject: [PATCH] changed users --- Code Snippets/addNewUsers.ipynb | 63 +++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/Code Snippets/addNewUsers.ipynb b/Code Snippets/addNewUsers.ipynb index 1785083..899d66b 100644 --- a/Code Snippets/addNewUsers.ipynb +++ b/Code Snippets/addNewUsers.ipynb @@ -22,9 +22,9 @@ "url = \"https://hp.henrypump.cloud\"\n", "username = \"nmelone@henry-pump.com\"\n", "password = \"gzU6$26v42mU%3jDzTJf\"\n", - "userIdToCopy = \"\"\n", - "entity_group_id=\"b7a04da0-54d8-11ef-8d66-9bbb0351be2a\"\n", - "default_dashboard = \"a8ce80b0-54ee-11ef-aa15-a127638e3a77\"" + "userIdToCopy = \"e23d1840-7e8c-11ee-b973-b3cdc1f2a19a\"\n", + "entity_group_id=\"4d43b400-b25d-11ef-861c-8dbe77c636e1\"\n", + "default_dashboard = \"b10eeab0-b274-11ef-861c-8dbe77c636e1\"" ] }, { @@ -34,8 +34,12 @@ "outputs": [], "source": [ "data = [\n", - " \"Taylor Schafer - taylor@aermotorwindmill.com - 3257167602\",\n", - " \"Conner Scrivner - conner@aermotorwindmill.com - 4329349131\"\n", + " \"Ben Brewster - ben@rrigwater.com - 325-260-3330\",\n", + " \"Mark Vandresar - mark@rrigenergy.com - 814-462-8899\",\n", + " \"Zack Roybal - zack@rrigenergy.com - 432-813-5307\",\n", + " \"Corey Leedy - corey@rrigenergy.com - 325-864-3272\",\n", + " \"Parker Handlin - parker@rrigenergy.com - 817-201-1558\",\n", + " \"Chris Johnson - chris@rrigenergy.com - 601-831-0401\",\n", " ]" ] }, @@ -128,7 +132,19 @@ "cell_type": "code", "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'dict' object has no attribute 'replace'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "Input \u001b[0;32mIn [8]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m userIdToCopy:\n\u001b[1;32m 5\u001b[0m templateUser \u001b[38;5;241m=\u001b[39m copyUser(userIdToCopy\u001b[38;5;241m=\u001b[39muserIdToCopy, rest_client\u001b[38;5;241m=\u001b[39mrest_client)\n\u001b[0;32m----> 6\u001b[0m templateUser[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124madditionalInfo\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m ast\u001b[38;5;241m.\u001b[39mliteral_eval(\u001b[43mtemplateUser\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43madditional_info\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreplace\u001b[49m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mdel\u001b[39;00m templateUser[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124madditional_info\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", + "\u001b[0;31mAttributeError\u001b[0m: 'dict' object has no attribute 'replace'" + ] + } + ], "source": [ "with RestClientPE(base_url=url) as rest_client:\n", " try:\n", @@ -168,6 +184,41 @@ " except ApiException as e:\n", " print(e)" ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'customer_id': {'id': '4d4058a0-b25d-11ef-861c-8dbe77c636e1',\n", + " 'entity_type': 'CUSTOMER'},\n", + " 'email': 'n_melone@hotmail.com',\n", + " 'authority': 'CUSTOMER_USER',\n", + " 'first_name': 'N',\n", + " 'last_name': 'Melone',\n", + " 'phone': '+15732019537',\n", + " 'name': 'n_melone@hotmail.com',\n", + " 'additional_info': {'description': '',\n", + " 'defaultDashboardId': 'b10eeab0-b274-11ef-861c-8dbe77c636e1',\n", + " 'defaultDashboardFullscreen': False,\n", + " 'homeDashboardId': 'b10eeab0-b274-11ef-861c-8dbe77c636e1',\n", + " 'homeDashboardHideToolbar': False,\n", + " 'userCredentialsEnabled': True,\n", + " 'failedLoginAttempts': 2,\n", + " 'lastLoginTs': 1706115931097}}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "templateUser" + ] } ], "metadata": {