Add default values to optional fields in SampleUpdate

This commit is contained in:
GotthardG
2025-01-09 22:51:26 +01:00
parent ac38bc3bb6
commit 0f6759e417
4 changed files with 213 additions and 64 deletions

View File

@ -3506,8 +3506,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-09T19:33:01.143326Z",
"start_time": "2025-01-09T19:33:01.128023Z"
"end_time": "2025-01-09T19:41:14.264895Z",
"start_time": "2025-01-09T19:41:14.245643Z"
}
},
"cell_type": "code",
@ -3518,9 +3518,9 @@
" api_instance = aareDBclient.SamplesApi(api_client)\n",
"\n",
" # Define the sample ID and event payload using the expected model\n",
" sample_id = 260\n",
" sample_id = 261\n",
" event_payload = SampleEventCreate(\n",
" event_type=\"Unmounted\" # Replace with actual event type if different\n",
" event_type=\"Failed\" # Replace with actual event type if different\n",
" )\n",
"\n",
" try:\n",
@ -3543,7 +3543,7 @@
"text": [
"The response of post_sample_event:\n",
"\n",
"SampleEventResponse(id=417, sample_id=260, event_type='Unmounted', timestamp=datetime.datetime(2025, 1, 9, 20, 33, 1))\n"
"SampleEventResponse(id=418, sample_id=261, event_type='Failed', timestamp=datetime.datetime(2025, 1, 9, 20, 41, 14))\n"
]
},
{
@ -3555,13 +3555,13 @@
]
}
],
"execution_count": 67
"execution_count": 70
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-09T19:33:04.470152Z",
"start_time": "2025-01-09T19:33:04.454152Z"
"end_time": "2025-01-09T19:41:23.052434Z",
"start_time": "2025-01-09T19:41:23.036108Z"
}
},
"cell_type": "code",
@ -3573,7 +3573,7 @@
"\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(260)\n",
" last_event_response = api_instance.get_last_sample_event_samples_samples_sample_id_events_last_get(261)\n",
" print(\"The response of get_last_sample_event:\\n\")\n",
" pprint(last_event_response)\n",
"\n",
@ -3588,7 +3588,7 @@
"text": [
"The response of get_last_sample_event:\n",
"\n",
"SampleEventResponse(id=417, sample_id=260, event_type='Unmounted', timestamp=datetime.datetime(2025, 1, 9, 20, 33, 1))\n"
"SampleEventResponse(id=418, sample_id=261, event_type='Failed', timestamp=datetime.datetime(2025, 1, 9, 20, 41, 14))\n"
]
},
{
@ -3600,7 +3600,7 @@
]
}
],
"execution_count": 68
"execution_count": 71
}
],
"metadata": {