Add SetTellPositionRequest schema and minor cleanup.

Added a new `SetTellPositionRequest` schema in `schemas.py` to support bulk updates of TELL positions. Commented out redundant metadata operations in `main.py` and cleaned up unused content in the test notebook for better readability.
This commit is contained in:
GotthardG
2025-02-04 14:43:59 +01:00
parent fef9b1c618
commit 780ba1959f
4 changed files with 553 additions and 380 deletions

View File

@ -6,8 +6,8 @@
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2025-01-30T11:29:38.703954Z",
"start_time": "2025-01-30T11:29:38.307050Z"
"end_time": "2025-02-04T12:17:43.144287Z",
"start_time": "2025-02-04T12:17:43.141596Z"
}
},
"source": [
@ -47,13 +47,13 @@
]
}
],
"execution_count": 1
"execution_count": 22
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-30T11:07:14.795059Z",
"start_time": "2025-01-30T11:07:14.783786Z"
"end_time": "2025-02-03T08:48:55.604554Z",
"start_time": "2025-02-03T08:48:55.583427Z"
}
},
"cell_type": "code",
@ -92,32 +92,24 @@
"id": "45cc7ab6d4589711",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Exception when calling ShipmentsApi->fetch_shipments_shipments_get: (404)\n",
"Reason: Not Found\n",
"HTTP response headers: HTTPHeaderDict({'date': 'Thu, 30 Jan 2025 11:07:14 GMT', 'server': 'uvicorn', 'content-length': '22', 'content-type': 'application/json'})\n",
"HTTP response body: {\"detail\":\"Not Found\"}\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n",
" warnings.warn(\n"
"ename": "AttributeError",
"evalue": "'ShipmentsApi' object has no attribute 'fetch_shipments_shipments_get'",
"output_type": "error",
"traceback": [
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[0;31mAttributeError\u001B[0m Traceback (most recent call last)",
"Cell \u001B[0;32mIn[3], line 12\u001B[0m\n\u001B[1;32m 8\u001B[0m api_instance \u001B[38;5;241m=\u001B[39m aareDBclient\u001B[38;5;241m.\u001B[39mShipmentsApi(api_client)\n\u001B[1;32m 10\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 11\u001B[0m \u001B[38;5;66;03m# Fetch all shipments\u001B[39;00m\n\u001B[0;32m---> 12\u001B[0m all_shipments_response \u001B[38;5;241m=\u001B[39m \u001B[43mapi_instance\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mfetch_shipments_shipments_get\u001B[49m()\n\u001B[1;32m 14\u001B[0m \u001B[38;5;66;03m# Print shipment names and their associated puck names\u001B[39;00m\n\u001B[1;32m 15\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m shipment \u001B[38;5;129;01min\u001B[39;00m all_shipments_response:\n",
"\u001B[0;31mAttributeError\u001B[0m: 'ShipmentsApi' object has no attribute 'fetch_shipments_shipments_get'"
]
}
],
"execution_count": 6
"execution_count": 3
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-17T14:14:30.201369Z",
"start_time": "2025-01-17T14:14:30.175577Z"
"end_time": "2025-02-03T22:26:47.957072Z",
"start_time": "2025-02-03T22:26:47.935362Z"
}
},
"cell_type": "code",
@ -132,7 +124,7 @@
" try:\n",
" # Create payload using the required model\n",
" logistics_event_create = LogisticsEventCreate(\n",
" dewar_qr_code='15e3dbe05e78ee83',\n",
" dewar_qr_code='923db239427869be',\n",
" location_qr_code='A2-X06SA',\n",
" transaction_type='incoming',\n",
" timestamp=date.today() # Adjust if the API expects datetime\n",
@ -150,7 +142,7 @@
" try:\n",
" # Create payload using the required model\n",
" logistics_event_create = LogisticsEventCreate(\n",
" dewar_qr_code='15e3dbe05e78ee83',\n",
" dewar_qr_code='923db239427869be',\n",
" location_qr_code='A2-X06SA',\n",
" transaction_type='refill',\n",
" timestamp=date.today() # Adjust if the API expects datetime\n",
@ -168,7 +160,7 @@
" try:\n",
" # Create payload using the required model\n",
" logistics_event_create = LogisticsEventCreate(\n",
" dewar_qr_code='15e3dbe05e78ee83',\n",
" dewar_qr_code='923db239427869be',\n",
" location_qr_code='X06DA-Beamline',\n",
" transaction_type='beamline',\n",
" timestamp=date.today() # Adjust if the API expects datetime\n",
@ -189,7 +181,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"API Response: {'message': 'Status updated successfully'}\n",
"Exception when calling LogisticsApi->scan_dewar_logistics_dewar_scan_post: (400)\n",
"Reason: Bad Request\n",
"HTTP response headers: HTTPHeaderDict({'date': 'Mon, 03 Feb 2025 22:26:47 GMT', 'server': 'uvicorn', 'content-length': '47', 'content-type': 'application/json'})\n",
"HTTP response body: {\"detail\":\"Slot not found or already occupied\"}\n",
"\n",
"API Response: {'message': 'Status updated successfully'}\n",
"API Response: {'message': 'Status updated successfully'}\n"
]
@ -207,13 +203,13 @@
]
}
],
"execution_count": 45
"execution_count": 4
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-30T11:35:20.036682Z",
"start_time": "2025-01-30T11:35:20.018284Z"
"end_time": "2025-02-04T13:40:09.144335Z",
"start_time": "2025-02-04T13:40:09.125904Z"
}
},
"cell_type": "code",
@ -242,13 +238,13 @@
"text": [
"The response of PucksApi->get_pucks_by_slot_pucks_slot_slot_identifier_get:\n",
"\n",
"[PuckWithTellPosition(id=1, puck_name='PUCK-001', puck_type='Unipuck', puck_location_in_dewar=1, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=2, puck_name='PUCK002', puck_type='Unipuck', puck_location_in_dewar=2, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=3, puck_name='PUCK003', puck_type='Unipuck', puck_location_in_dewar=3, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=4, puck_name='PUCK004', puck_type='Unipuck', puck_location_in_dewar=4, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=5, puck_name='PUCK005', puck_type='Unipuck', puck_location_in_dewar=5, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=6, puck_name='PUCK006', puck_type='Unipuck', puck_location_in_dewar=6, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=7, puck_name='PUCK007', puck_type='Unipuck', puck_location_in_dewar=7, dewar_id=1, dewar_name='Dewar One', pgroup='p20001', samples=None, tell_position=None)]\n"
"[PuckWithTellPosition(id=38, puck_name='PSIMX074', puck_type='unipuck', puck_location_in_dewar=1, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=39, puck_name='PSIMX080', puck_type='unipuck', puck_location_in_dewar=2, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=40, puck_name='PSIMX081', puck_type='unipuck', puck_location_in_dewar=3, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=41, puck_name='PSIMX084', puck_type='unipuck', puck_location_in_dewar=4, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=42, puck_name='PSIMX104', puck_type='unipuck', puck_location_in_dewar=5, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=43, puck_name='PSIMX107', puck_type='unipuck', puck_location_in_dewar=6, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None),\n",
" PuckWithTellPosition(id=44, puck_name='PSIMX117', puck_type='unipuck', puck_location_in_dewar=7, dewar_id=7, dewar_name='31012025', pgroup='p20001', samples=None, tell_position=None)]\n"
]
},
{
@ -260,40 +256,57 @@
]
}
],
"execution_count": 5
"execution_count": 52
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-30T12:30:46.242711Z",
"start_time": "2025-01-30T12:30:46.215343Z"
"end_time": "2025-02-04T13:40:49.933951Z",
"start_time": "2025-02-04T13:40:49.910479Z"
}
},
"cell_type": "code",
"source": [
"from aareDBclient import SetTellPosition\n",
"\n",
"# Attribute a puck to a position in the TELL dewar\n",
"from aareDBclient import SetTellPosition, SetTellPositionRequest\n",
"\n",
"with aareDBclient.ApiClient(configuration) as api_client:\n",
" # Create an instance of the API class\n",
" api_instance = aareDBclient.PucksApi(api_client)\n",
" get_pucks_at_beamline = aareDBclient.PucksApi(api_client)\n",
"\n",
" # This part is commented but will be used to attribute a puck to a position of the TELL\n",
" # Define the puck ID and payload\n",
"\n",
" payload = [SetTellPosition(puck_name='PUCK006', segment='A', puck_in_segment=2),SetTellPosition(puck_name='PUCK005', segment='C', puck_in_segment=3)]\n",
" #payload = []\n",
" # Payload with SetTellPosition objects\n",
" payload = SetTellPositionRequest(\n",
" tell=\"X06DA\",\n",
" pucks=[\n",
" SetTellPosition(puck_name='PSIMX074', segment='B', puck_in_segment=1),\n",
" SetTellPosition(puck_name='PSIMX080', segment='B', puck_in_segment=2),\n",
" SetTellPosition(puck_name='PSIMX081', segment='C', puck_in_segment=3),\n",
" SetTellPosition(puck_name='PSIMX084', segment='C', puck_in_segment=4),\n",
" SetTellPosition(puck_name='PSIMX104', segment='E', puck_in_segment=5),\n",
" SetTellPosition(puck_name='PSIMX107', segment='E', puck_in_segment=1),\n",
" SetTellPosition(puck_name='PSIMX117', segment='F', puck_in_segment=2),\n",
" ]\n",
" #pucks=[\n",
" # SetTellPosition(puck_name='PSIMX074', segment='F', puck_in_segment=1),\n",
" # SetTellPosition(puck_name='PSIMX080', segment='F', puck_in_segment=2),\n",
" # SetTellPosition(puck_name='PSIMX081', segment='F', puck_in_segment=3),\n",
" # SetTellPosition(puck_name='PSIMX084', segment='F', puck_in_segment=4),\n",
" # SetTellPosition(puck_name='PSIMX107', segment='A', puck_in_segment=1),\n",
" # SetTellPosition(puck_name='PSIMX117', segment='A', puck_in_segment=2),\n",
" #]\n",
" #pucks = []\n",
" )\n",
"\n",
" # Call the PUT method to update the tell_position\n",
" try:\n",
" # Call the PUT method to update the tell_position\n",
" api_response = api_instance.set_tell_positions_pucks_set_tell_positions_put(payload)\n",
" api_response = api_instance.set_tell_positions_pucks_set_tell_positions_put(\n",
" set_tell_position_request=payload\n",
" ) # Pass the entire payload as a single parameter\n",
"\n",
" print(\"The response of PucksApi->pucks_puck_id_tell_position_put:\\n\")\n",
" pprint(api_response)\n",
"\n",
" except ApiException as e:\n",
" print(\"Exception when calling PucksApi->pucks_puck_id_tell_position_put: %s\\n\" % e)"
" except Exception as e:\n",
" print(f\"Exception when calling PucksApi: {e}\")\n"
],
"id": "d52d12287dd63299",
"outputs": [
@ -303,16 +316,48 @@
"text": [
"The response of PucksApi->pucks_puck_id_tell_position_put:\n",
"\n",
"[{'message': 'The tell_position was updated successfully.',\n",
" 'new_position': 'A2',\n",
"[{'message': 'Tell position updated successfully.',\n",
" 'new_position': 'B1',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PUCK006',\n",
" 'status': 'updated'},\n",
" {'message': 'The tell_position was updated successfully.',\n",
" 'puck_name': 'PSIMX074',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'},\n",
" {'message': 'Tell position updated successfully.',\n",
" 'new_position': 'B2',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PSIMX080',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'},\n",
" {'message': 'Tell position updated successfully.',\n",
" 'new_position': 'C3',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PUCK005',\n",
" 'status': 'updated'}]\n"
" 'puck_name': 'PSIMX081',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'},\n",
" {'message': 'Tell position updated successfully.',\n",
" 'new_position': 'C4',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PSIMX084',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'},\n",
" {'message': 'Tell position updated successfully.',\n",
" 'new_position': 'E5',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PSIMX104',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'},\n",
" {'message': 'Tell position updated successfully.',\n",
" 'new_position': 'E1',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PSIMX107',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'},\n",
" {'message': 'Tell position updated successfully.',\n",
" 'new_position': 'F2',\n",
" 'previous_position': None,\n",
" 'puck_name': 'PSIMX117',\n",
" 'status': 'updated',\n",
" 'tell': 'X06DA'}]\n"
]
},
{
@ -324,13 +369,13 @@
]
}
],
"execution_count": 8
"execution_count": 55
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-30T12:35:40.734188Z",
"start_time": "2025-01-30T12:35:40.679071Z"
"end_time": "2025-02-04T13:36:46.598976Z",
"start_time": "2025-02-04T13:36:46.568865Z"
}
},
"cell_type": "code",
@ -359,11 +404,11 @@
" print(f\"Puck ID: {p.id}, Puck Name: {p.puck_name}\")\n",
"\n",
" # Check if the puck has any samples\n",
" if hasattr(p, 'samples') and p.samples: # Ensure 'samples' attribute exists and is not empty\n",
" for sample in p.samples:\n",
" print(f\" Sample ID: {sample.id}, Sample Name: {sample.sample_name}\")\n",
" else:\n",
" print(\" No samples found in this puck.\")\n",
" #if hasattr(p, 'samples') and p.samples: # Ensure 'samples' attribute exists and is not empty\n",
" # for sample in p.samples:\n",
" # print(f\" Sample ID: {sample.id}, Sample Name: {sample.sample_name}, Position: {sample.position}, Mount count: {sample.mount_count}\")\n",
" #else:\n",
" # print(\" No samples found in this puck.\")\n",
"\n",
" except ApiException as e:\n",
" print(\"Exception when calling PucksApi->get_all_pucks_in_tell: %s\\n\" % e)"
@ -374,28 +419,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Puck ID: 6, Puck Name: PUCK006\n",
" Sample ID: 28, Sample Name: Sample028\n",
" Sample ID: 29, Sample Name: Sample029\n",
" Sample ID: 30, Sample Name: Sample030\n",
" Sample ID: 31, Sample Name: Sample031\n",
" Sample ID: 32, Sample Name: Sample032\n",
" Sample ID: 33, Sample Name: Sample033\n",
" Sample ID: 34, Sample Name: Sample034\n",
" Sample ID: 35, Sample Name: Sample035\n",
" Sample ID: 36, Sample Name: Sample036\n",
" Sample ID: 37, Sample Name: Sample037\n",
" Sample ID: 38, Sample Name: Sample038\n",
" Sample ID: 39, Sample Name: Sample039\n",
" Sample ID: 40, Sample Name: Sample040\n",
"Puck ID: 5, Puck Name: PUCK005\n",
" Sample ID: 21, Sample Name: Sample021\n",
" Sample ID: 22, Sample Name: Sample022\n",
" Sample ID: 23, Sample Name: Sample023\n",
" Sample ID: 24, Sample Name: Sample024\n",
" Sample ID: 25, Sample Name: Sample025\n",
" Sample ID: 26, Sample Name: Sample026\n",
" Sample ID: 27, Sample Name: Sample027\n"
"Puck ID: 31, Puck Name: PSIMX074\n",
"Puck ID: 32, Puck Name: PSIMX080\n",
"Puck ID: 33, Puck Name: PSIMX081\n",
"Puck ID: 34, Puck Name: PSIMX084\n",
"Puck ID: 36, Puck Name: PSIMX107\n",
"Puck ID: 37, Puck Name: PSIMX117\n"
]
},
{
@ -407,13 +436,13 @@
]
}
],
"execution_count": 10
"execution_count": 49
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-30T12:36:50.600728Z",
"start_time": "2025-01-30T12:36:50.581752Z"
"end_time": "2025-01-31T13:46:18.354067Z",
"start_time": "2025-01-31T13:46:18.332891Z"
}
},
"cell_type": "code",
@ -429,8 +458,8 @@
" try:\n",
" # Define the payload with only `event_type`\n",
" sample_event_create = SampleEventCreate(\n",
" sample_id=27,\n",
" event_type=\"Unmounted\" # Valid event type\n",
" sample_id=28,\n",
" event_type=\"Mounted\" # Valid event type\n",
" )\n",
"\n",
" # Debug the payload before sending\n",
@ -439,12 +468,15 @@
"\n",
" # Call the API\n",
" api_response = api_instance.create_sample_event_samples_samples_sample_id_events_post(\n",
" sample_id=27, # Ensure this matches a valid sample ID in the database\n",
" sample_id=28, # Ensure this matches a valid sample ID in the database\n",
" sample_event_create=sample_event_create\n",
" )\n",
"\n",
" print(\"API response:\")\n",
" pprint(api_response)\n",
" #pprint(api_response)\n",
"\n",
" for p in api_response:\n",
" print(p)\n",
"\n",
" except ApiException as e:\n",
" print(\"Exception when calling post_sample_event:\")\n",
@ -459,9 +491,21 @@
"output_type": "stream",
"text": [
"Payload being sent to API:\n",
"{\"event_type\":\"Unmounted\"}\n",
"{\"event_type\":\"Mounted\"}\n",
"API response:\n",
"Sample(id=27, sample_name='Sample027', position=15, puck_id=5, crystalname=None, proteinname=None, positioninpuck=None, priority=None, comments=None, data_collection_parameters=None, events=[SampleEventResponse(id=406, sample_id=27, event_type='Mounted', timestamp=datetime.datetime(2025, 1, 30, 13, 36, 34)), SampleEventResponse(id=407, sample_id=27, event_type='Unmounted', timestamp=datetime.datetime(2025, 1, 30, 13, 36, 51))], mount_count=1, unmount_count=1)\n"
"('id', 28)\n",
"('sample_name', 'Sample028')\n",
"('position', 1)\n",
"('puck_id', 6)\n",
"('crystalname', None)\n",
"('proteinname', None)\n",
"('positioninpuck', None)\n",
"('priority', None)\n",
"('comments', None)\n",
"('data_collection_parameters', None)\n",
"('events', [SampleEventResponse(id=37, sample_id=28, event_type='Mounted', timestamp=datetime.datetime(2025, 1, 29, 14, 3)), SampleEventResponse(id=38, sample_id=28, event_type='Unmounted', timestamp=datetime.datetime(2025, 1, 29, 14, 3, 50)), SampleEventResponse(id=408, sample_id=28, event_type='Mounted', timestamp=datetime.datetime(2025, 1, 31, 13, 10, 3)), SampleEventResponse(id=409, sample_id=28, event_type='Unmounted', timestamp=datetime.datetime(2025, 1, 31, 13, 12, 35)), SampleEventResponse(id=410, sample_id=28, event_type='Mounted', timestamp=datetime.datetime(2025, 1, 31, 13, 16, 55)), SampleEventResponse(id=411, sample_id=28, event_type='Unmounted', timestamp=datetime.datetime(2025, 1, 31, 13, 17, 8)), SampleEventResponse(id=412, sample_id=28, event_type='Mounted', timestamp=datetime.datetime(2025, 1, 31, 14, 46, 18))])\n",
"('mount_count', 4)\n",
"('unmount_count', 3)\n"
]
},
{
@ -473,25 +517,25 @@
]
}
],
"execution_count": 13
"execution_count": 11
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-30T12:37:14.520342Z",
"start_time": "2025-01-30T12:37:14.508460Z"
"end_time": "2025-01-31T12:06:44.184990Z",
"start_time": "2025-01-31T12:06:44.174766Z"
}
},
"cell_type": "code",
"source": [
"\n",
"### not working\n",
"with aareDBclient.ApiClient(configuration) as api_client:\n",
" # Create an instance of the Samples API class\n",
" api_instance = aareDBclient.SamplesApi(api_client)\n",
"\n",
" try:\n",
" # Get the last sample event\n",
" last_event_response = api_instance.get_last_sample_event_samples_samples_sample_id_events_last_get(14)\n",
" last_event_response = api_instance.get_last_sample_event_samples_samples_sample_id_events_last_get(27)\n",
" print(\"The response of get_last_sample_event:\\n\")\n",
" pprint(last_event_response)\n",
"\n",
@ -507,12 +551,12 @@
"traceback": [
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[0;31mAttributeError\u001B[0m Traceback (most recent call last)",
"Cell \u001B[0;32mIn[14], line 7\u001B[0m\n\u001B[1;32m 3\u001B[0m api_instance \u001B[38;5;241m=\u001B[39m aareDBclient\u001B[38;5;241m.\u001B[39mSamplesApi(api_client)\n\u001B[1;32m 5\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 6\u001B[0m \u001B[38;5;66;03m# Get the last sample event\u001B[39;00m\n\u001B[0;32m----> 7\u001B[0m last_event_response \u001B[38;5;241m=\u001B[39m \u001B[43mapi_instance\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_last_sample_event_samples_samples_sample_id_events_last_get\u001B[49m(\u001B[38;5;241m14\u001B[39m)\n\u001B[1;32m 8\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe response of get_last_sample_event:\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m 9\u001B[0m pprint(last_event_response)\n",
"Cell \u001B[0;32mIn[6], line 7\u001B[0m\n\u001B[1;32m 3\u001B[0m api_instance \u001B[38;5;241m=\u001B[39m aareDBclient\u001B[38;5;241m.\u001B[39mSamplesApi(api_client)\n\u001B[1;32m 5\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m 6\u001B[0m \u001B[38;5;66;03m# Get the last sample event\u001B[39;00m\n\u001B[0;32m----> 7\u001B[0m last_event_response \u001B[38;5;241m=\u001B[39m \u001B[43mapi_instance\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_last_sample_event_samples_samples_sample_id_events_last_get\u001B[49m(\u001B[38;5;241m27\u001B[39m)\n\u001B[1;32m 8\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe response of get_last_sample_event:\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n\u001B[1;32m 9\u001B[0m pprint(last_event_response)\n",
"\u001B[0;31mAttributeError\u001B[0m: 'SamplesApi' object has no attribute 'get_last_sample_event_samples_samples_sample_id_events_last_get'"
]
}
],
"execution_count": 14
"execution_count": 6
},
{
"metadata": {