From 49b30ea2f2f80294627be681eab9df8c816fc6d0 Mon Sep 17 00:00:00 2001 From: timonrieger Date: Mon, 4 May 2026 17:22:50 +0200 Subject: [PATCH] gen client --- mobile/openapi/.openapi-generator/VERSION | 2 +- mobile/openapi/README.md | 2 +- mobile/openapi/lib/api.dart | 3 +- mobile/openapi/lib/api_client.dart | 6 +- mobile/openapi/lib/api_helper.dart | 3 + .../lib/model/activity_create_dto.dart | 16 ++- .../lib/model/activity_response_dto.dart | 21 +++- .../activity_statistics_response_dto.dart | 12 +- mobile/openapi/lib/model/add_users_dto.dart | 10 +- .../model/admin_onboarding_update_dto.dart | 10 +- .../openapi/lib/model/album_response_dto.dart | 39 +++++- .../model/album_statistics_response_dto.dart | 14 ++- .../openapi/lib/model/album_user_add_dto.dart | 12 +- .../lib/model/album_user_create_dto.dart | 12 +- .../lib/model/album_user_response_dto.dart | 12 +- .../lib/model/albums_add_assets_dto.dart | 12 +- .../model/albums_add_assets_response_dto.dart | 12 +- mobile/openapi/lib/model/albums_response.dart | 10 +- mobile/openapi/lib/model/albums_update.dart | 10 +- .../openapi/lib/model/api_key_create_dto.dart | 12 +- .../model/api_key_create_response_dto.dart | 12 +- .../lib/model/api_key_response_dto.dart | 18 ++- .../openapi/lib/model/api_key_update_dto.dart | 10 +- .../lib/model/asset_bulk_delete_dto.dart | 12 +- .../lib/model/asset_bulk_update_dto.dart | 30 +++-- .../model/asset_bulk_upload_check_dto.dart | 10 +- .../model/asset_bulk_upload_check_item.dart | 12 +- .../asset_bulk_upload_check_response_dto.dart | 10 +- .../model/asset_bulk_upload_check_result.dart | 18 ++- mobile/openapi/lib/model/asset_copy_dto.dart | 12 +- .../lib/model/asset_edit_action_item_dto.dart | 12 +- ...asset_edit_action_item_dto_parameters.dart | 20 ++- .../asset_edit_action_item_response_dto.dart | 14 ++- .../lib/model/asset_edits_create_dto.dart | 10 +- .../lib/model/asset_edits_response_dto.dart | 12 +- .../lib/model/asset_face_create_dto.dart | 24 +++- .../lib/model/asset_face_delete_dto.dart | 10 +- .../lib/model/asset_face_response_dto.dart | 27 +++- .../lib/model/asset_face_update_dto.dart | 10 +- .../lib/model/asset_face_update_item.dart | 12 +- ...sset_face_without_person_response_dto.dart | 24 +++- mobile/openapi/lib/model/asset_ids_dto.dart | 10 +- .../lib/model/asset_ids_response_dto.dart | 14 ++- mobile/openapi/lib/model/asset_jobs_dto.dart | 12 +- .../lib/model/asset_media_response_dto.dart | 12 +- .../model/asset_metadata_bulk_delete_dto.dart | 10 +- .../asset_metadata_bulk_delete_item_dto.dart | 12 +- .../asset_metadata_bulk_response_dto.dart | 16 ++- .../model/asset_metadata_bulk_upsert_dto.dart | 10 +- .../asset_metadata_bulk_upsert_item_dto.dart | 14 ++- .../model/asset_metadata_response_dto.dart | 14 ++- .../lib/model/asset_metadata_upsert_dto.dart | 10 +- .../model/asset_metadata_upsert_item_dto.dart | 12 +- .../lib/model/asset_ocr_response_dto.dart | 54 ++++++-- .../openapi/lib/model/asset_response_dto.dart | 72 +++++++++-- .../lib/model/asset_stack_response_dto.dart | 14 ++- .../lib/model/asset_stats_response_dto.dart | 14 ++- .../lib/model/auth_status_response_dto.dart | 18 ++- mobile/openapi/lib/model/avatar_update.dart | 10 +- .../lib/model/bulk_id_response_dto.dart | 16 ++- mobile/openapi/lib/model/bulk_ids_dto.dart | 10 +- mobile/openapi/lib/model/cast_response.dart | 10 +- mobile/openapi/lib/model/cast_update.dart | 10 +- .../lib/model/change_password_dto.dart | 12 +- mobile/openapi/lib/model/clip_config.dart | 12 +- .../model/contributor_count_response_dto.dart | 12 +- .../openapi/lib/model/create_album_dto.dart | 12 +- .../openapi/lib/model/create_library_dto.dart | 12 +- .../create_profile_image_response_dto.dart | 14 ++- mobile/openapi/lib/model/crop_parameters.dart | 16 ++- .../lib/model/database_backup_config.dart | 14 ++- .../lib/model/database_backup_delete_dto.dart | 10 +- .../lib/model/database_backup_dto.dart | 14 ++- .../database_backup_list_response_dto.dart | 10 +- .../lib/model/download_archive_dto.dart | 12 +- .../lib/model/download_archive_info.dart | 12 +- .../openapi/lib/model/download_info_dto.dart | 14 ++- .../openapi/lib/model/download_response.dart | 12 +- .../lib/model/download_response_dto.dart | 12 +- mobile/openapi/lib/model/download_update.dart | 12 +- .../lib/model/duplicate_detection_config.dart | 14 ++- .../lib/model/duplicate_resolve_dto.dart | 10 +- .../model/duplicate_resolve_group_dto.dart | 14 ++- .../lib/model/duplicate_response_dto.dart | 14 ++- .../model/email_notifications_response.dart | 14 ++- .../lib/model/email_notifications_update.dart | 14 ++- .../openapi/lib/model/exif_response_dto.dart | 52 ++++---- mobile/openapi/lib/model/face_dto.dart | 10 +- .../lib/model/facial_recognition_config.dart | 22 +++- .../openapi/lib/model/folders_response.dart | 12 +- mobile/openapi/lib/model/folders_update.dart | 12 +- mobile/openapi/lib/model/job_create_dto.dart | 10 +- .../openapi/lib/model/job_settings_dto.dart | 10 +- .../lib/model/library_response_dto.dart | 27 +++- .../lib/model/library_stats_response_dto.dart | 16 ++- mobile/openapi/lib/model/license_key_dto.dart | 12 +- .../lib/model/login_credential_dto.dart | 12 +- .../openapi/lib/model/login_response_dto.dart | 24 +++- .../lib/model/logout_response_dto.dart | 12 +- ...hine_learning_availability_checks_dto.dart | 14 ++- .../lib/model/maintenance_auth_dto.dart | 10 +- ...intenance_detect_install_response_dto.dart | 10 +- ...nce_detect_install_storage_folder_dto.dart | 16 ++- .../lib/model/maintenance_login_dto.dart | 10 +- .../maintenance_status_response_dto.dart | 18 ++- .../lib/model/map_marker_response_dto.dart | 27 +++- .../map_reverse_geocode_response_dto.dart | 17 ++- .../openapi/lib/model/memories_response.dart | 12 +- mobile/openapi/lib/model/memories_update.dart | 12 +- .../openapi/lib/model/memory_create_dto.dart | 22 +++- .../lib/model/memory_response_dto.dart | 34 ++++- .../model/memory_statistics_response_dto.dart | 10 +- .../openapi/lib/model/memory_update_dto.dart | 14 ++- .../openapi/lib/model/merge_person_dto.dart | 10 +- .../lib/model/metadata_search_dto.dart | 88 +++++++------ .../openapi/lib/model/mirror_parameters.dart | 10 +- .../lib/model/notification_create_dto.dart | 20 ++- .../model/notification_delete_all_dto.dart | 10 +- .../openapi/lib/model/notification_dto.dart | 22 +++- .../model/notification_update_all_dto.dart | 12 +- .../lib/model/notification_update_dto.dart | 10 +- .../model/o_auth_authorize_response_dto.dart | 10 +- .../lib/model/o_auth_callback_dto.dart | 14 ++- .../openapi/lib/model/o_auth_config_dto.dart | 14 ++- .../o_auth_token_endpoint_auth_method.dart | 12 +- mobile/openapi/lib/model/ocr_config.dart | 22 +++- mobile/openapi/lib/model/on_this_day_dto.dart | 10 +- mobile/openapi/lib/model/onboarding_dto.dart | 10 +- .../lib/model/onboarding_response_dto.dart | 10 +- .../openapi/lib/model/partner_create_dto.dart | 10 +- .../openapi/lib/model/partner_direction.dart | 12 +- .../lib/model/partner_response_dto.dart | 22 +++- .../openapi/lib/model/partner_update_dto.dart | 10 +- mobile/openapi/lib/model/people_response.dart | 12 +- .../lib/model/people_response_dto.dart | 16 ++- mobile/openapi/lib/model/people_update.dart | 12 +- .../openapi/lib/model/people_update_dto.dart | 10 +- .../openapi/lib/model/people_update_item.dart | 22 ++-- .../openapi/lib/model/person_create_dto.dart | 18 ++- .../lib/model/person_response_dto.dart | 25 +++- .../model/person_statistics_response_dto.dart | 10 +- .../openapi/lib/model/person_update_dto.dart | 20 +-- .../model/person_with_faces_response_dto.dart | 27 +++- .../lib/model/pin_code_change_dto.dart | 14 ++- .../openapi/lib/model/pin_code_reset_dto.dart | 12 +- .../openapi/lib/model/pin_code_setup_dto.dart | 10 +- .../lib/model/places_response_dto.dart | 18 ++- .../lib/model/plugin_action_response_dto.dart | 23 +++- .../lib/model/plugin_filter_response_dto.dart | 23 +++- .../openapi/lib/model/plugin_json_schema.dart | 14 ++- .../model/plugin_json_schema_property.dart | 18 ++- ...schema_property_additional_properties.dart | 18 ++- .../lib/model/plugin_response_dto.dart | 28 ++++- .../model/plugin_trigger_response_dto.dart | 12 +- .../openapi/lib/model/purchase_response.dart | 12 +- mobile/openapi/lib/model/purchase_update.dart | 12 +- .../openapi/lib/model/queue_command_dto.dart | 12 +- .../openapi/lib/model/queue_delete_dto.dart | 10 +- .../lib/model/queue_job_response_dto.dart | 16 ++- .../openapi/lib/model/queue_response_dto.dart | 14 ++- .../lib/model/queue_response_legacy_dto.dart | 12 +- .../lib/model/queue_statistics_dto.dart | 20 ++- .../lib/model/queue_status_legacy_dto.dart | 12 +- .../openapi/lib/model/queue_update_dto.dart | 10 +- .../lib/model/queues_response_legacy_dto.dart | 44 ++++++- .../openapi/lib/model/random_search_dto.dart | 68 +++++----- .../openapi/lib/model/ratings_response.dart | 10 +- mobile/openapi/lib/model/ratings_update.dart | 10 +- .../reverse_geocoding_state_response_dto.dart | 14 ++- .../openapi/lib/model/rotate_parameters.dart | 10 +- .../lib/model/search_album_response_dto.dart | 16 ++- .../lib/model/search_asset_response_dto.dart | 19 ++- .../lib/model/search_explore_item.dart | 12 +- .../model/search_explore_response_dto.dart | 12 +- .../search_facet_count_response_dto.dart | 12 +- .../lib/model/search_facet_response_dto.dart | 12 +- .../lib/model/search_response_dto.dart | 12 +- .../model/search_statistics_response_dto.dart | 10 +- .../lib/model/server_about_response_dto.dart | 50 +++++--- .../lib/model/server_apk_links_dto.dart | 16 ++- .../openapi/lib/model/server_config_dto.dart | 30 ++++- .../lib/model/server_features_dto.dart | 38 +++++- .../server_media_types_response_dto.dart | 14 ++- .../lib/model/server_ping_response.dart | 10 +- .../lib/model/server_stats_response_dto.dart | 20 ++- .../model/server_storage_response_dto.dart | 24 +++- .../server_version_history_response_dto.dart | 14 ++- .../model/server_version_response_dto.dart | 14 ++- .../openapi/lib/model/session_create_dto.dart | 14 ++- .../model/session_create_response_dto.dart | 29 ++++- .../lib/model/session_response_dto.dart | 27 +++- .../openapi/lib/model/session_unlock_dto.dart | 12 +- .../openapi/lib/model/session_update_dto.dart | 10 +- .../lib/model/set_maintenance_mode_dto.dart | 12 +- .../lib/model/shared_link_create_dto.dart | 22 ++-- .../lib/model/shared_link_edit_dto.dart | 116 +++++++++-------- .../lib/model/shared_link_login_dto.dart | 10 +- .../lib/model/shared_link_response_dto.dart | 40 +++++- .../lib/model/shared_links_response.dart | 12 +- .../lib/model/shared_links_update.dart | 12 +- mobile/openapi/lib/model/sign_up_dto.dart | 14 ++- .../openapi/lib/model/smart_search_dto.dart | 72 ++++++----- .../openapi/lib/model/stack_create_dto.dart | 10 +- .../openapi/lib/model/stack_response_dto.dart | 14 ++- .../openapi/lib/model/stack_update_dto.dart | 10 +- .../lib/model/statistics_search_dto.dart | 60 +++++---- .../lib/model/sync_ack_delete_dto.dart | 8 +- mobile/openapi/lib/model/sync_ack_dto.dart | 12 +- .../openapi/lib/model/sync_ack_set_dto.dart | 10 +- .../lib/model/sync_album_delete_v1.dart | 10 +- .../model/sync_album_to_asset_delete_v1.dart | 12 +- .../lib/model/sync_album_to_asset_v1.dart | 12 +- .../lib/model/sync_album_user_delete_v1.dart | 12 +- .../openapi/lib/model/sync_album_user_v1.dart | 14 ++- mobile/openapi/lib/model/sync_album_v1.dart | 27 +++- mobile/openapi/lib/model/sync_album_v2.dart | 25 +++- .../lib/model/sync_asset_delete_v1.dart | 10 +- .../lib/model/sync_asset_edit_delete_v1.dart | 10 +- .../openapi/lib/model/sync_asset_edit_v1.dart | 18 ++- .../openapi/lib/model/sync_asset_exif_v1.dart | 92 +++++++++----- .../lib/model/sync_asset_face_delete_v1.dart | 10 +- .../openapi/lib/model/sync_asset_face_v1.dart | 29 ++++- .../openapi/lib/model/sync_asset_face_v2.dart | 34 ++++- .../model/sync_asset_metadata_delete_v1.dart | 12 +- .../lib/model/sync_asset_metadata_v1.dart | 14 ++- mobile/openapi/lib/model/sync_asset_v1.dart | 57 +++++++-- mobile/openapi/lib/model/sync_asset_v2.dart | 57 +++++++-- .../openapi/lib/model/sync_auth_user_v1.dart | 38 +++++- .../model/sync_memory_asset_delete_v1.dart | 12 +- .../lib/model/sync_memory_asset_v1.dart | 12 +- .../lib/model/sync_memory_delete_v1.dart | 10 +- mobile/openapi/lib/model/sync_memory_v1.dart | 36 +++++- .../lib/model/sync_partner_delete_v1.dart | 12 +- mobile/openapi/lib/model/sync_partner_v1.dart | 14 ++- .../lib/model/sync_person_delete_v1.dart | 10 +- mobile/openapi/lib/model/sync_person_v1.dart | 31 ++++- .../lib/model/sync_stack_delete_v1.dart | 10 +- mobile/openapi/lib/model/sync_stack_v1.dart | 18 ++- mobile/openapi/lib/model/sync_stream_dto.dart | 12 +- .../lib/model/sync_user_delete_v1.dart | 10 +- .../model/sync_user_metadata_delete_v1.dart | 12 +- .../lib/model/sync_user_metadata_v1.dart | 14 ++- mobile/openapi/lib/model/sync_user_v1.dart | 23 +++- .../lib/model/system_config_backups_dto.dart | 10 +- .../openapi/lib/model/system_config_dto.dart | 50 +++++++- .../lib/model/system_config_f_fmpeg_dto.dart | 50 +++++++- .../lib/model/system_config_faces_dto.dart | 10 +- ...m_config_generated_fullsize_image_dto.dart | 16 ++- .../system_config_generated_image_dto.dart | 16 ++- .../lib/model/system_config_image_dto.dart | 18 ++- .../lib/model/system_config_job_dto.dart | 36 +++++- .../lib/model/system_config_library_dto.dart | 12 +- .../model/system_config_library_scan_dto.dart | 12 +- .../system_config_library_watch_dto.dart | 10 +- .../lib/model/system_config_logging_dto.dart | 12 +- .../system_config_machine_learning_dto.dart | 22 +++- .../lib/model/system_config_map_dto.dart | 14 ++- .../lib/model/system_config_metadata_dto.dart | 10 +- .../system_config_new_version_check_dto.dart | 10 +- .../system_config_nightly_tasks_dto.dart | 20 ++- .../system_config_notifications_dto.dart | 10 +- .../lib/model/system_config_o_auth_dto.dart | 51 +++++++- .../system_config_password_login_dto.dart | 10 +- .../system_config_reverse_geocoding_dto.dart | 10 +- .../lib/model/system_config_server_dto.dart | 14 ++- .../lib/model/system_config_smtp_dto.dart | 16 ++- .../system_config_smtp_transport_dto.dart | 20 ++- .../system_config_storage_template_dto.dart | 14 ++- .../system_config_template_emails_dto.dart | 14 ++- ...em_config_template_storage_option_dto.dart | 24 +++- .../model/system_config_templates_dto.dart | 10 +- .../lib/model/system_config_theme_dto.dart | 10 +- .../lib/model/system_config_trash_dto.dart | 12 +- .../lib/model/system_config_user_dto.dart | 10 +- .../lib/model/tag_bulk_assets_dto.dart | 12 +- .../model/tag_bulk_assets_response_dto.dart | 10 +- mobile/openapi/lib/model/tag_create_dto.dart | 14 ++- .../openapi/lib/model/tag_response_dto.dart | 22 +++- mobile/openapi/lib/model/tag_update_dto.dart | 10 +- mobile/openapi/lib/model/tag_upsert_dto.dart | 10 +- mobile/openapi/lib/model/tags_response.dart | 12 +- mobile/openapi/lib/model/tags_update.dart | 12 +- mobile/openapi/lib/model/template_dto.dart | 10 +- .../lib/model/template_response_dto.dart | 12 +- .../lib/model/test_email_response_dto.dart | 10 +- .../model/time_bucket_asset_response_dto.dart | 38 +++++- .../lib/model/time_buckets_response_dto.dart | 12 +- .../openapi/lib/model/trash_response_dto.dart | 10 +- .../openapi/lib/model/update_album_dto.dart | 73 +++++------ .../lib/model/update_album_user_dto.dart | 10 +- .../openapi/lib/model/update_asset_dto.dart | 24 ++-- .../openapi/lib/model/update_library_dto.dart | 10 +- .../openapi/lib/model/usage_by_user_dto.dart | 25 +++- .../lib/model/user_admin_create_dto.dart | 28 +++-- .../lib/model/user_admin_delete_dto.dart | 10 +- .../lib/model/user_admin_response_dto.dart | 47 ++++++- .../lib/model/user_admin_update_dto.dart | 26 ++-- mobile/openapi/lib/model/user_license.dart | 14 ++- .../model/user_preferences_response_dto.dart | 30 ++++- .../model/user_preferences_update_dto.dart | 32 +++-- .../openapi/lib/model/user_response_dto.dart | 20 ++- .../openapi/lib/model/user_update_me_dto.dart | 16 ++- .../validate_access_token_response_dto.dart | 10 +- .../lib/model/validate_library_dto.dart | 8 +- ...date_library_import_path_response_dto.dart | 14 ++- .../model/validate_library_response_dto.dart | 8 +- .../version_check_state_response_dto.dart | 14 ++- .../lib/model/workflow_action_item_dto.dart | 10 +- .../model/workflow_action_response_dto.dart | 19 ++- .../lib/model/workflow_create_dto.dart | 20 ++- .../lib/model/workflow_filter_item_dto.dart | 10 +- .../model/workflow_filter_response_dto.dart | 19 ++- .../lib/model/workflow_response_dto.dart | 27 +++- .../lib/model/workflow_update_dto.dart | 16 ++- mobile/openapi/lib/optional.dart | 119 ++++++++++++++++++ 315 files changed, 4724 insertions(+), 930 deletions(-) create mode 100644 mobile/openapi/lib/optional.dart diff --git a/mobile/openapi/.openapi-generator/VERSION b/mobile/openapi/.openapi-generator/VERSION index 09a6d30847..696eaac5ce 100644 --- a/mobile/openapi/.openapi-generator/VERSION +++ b/mobile/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -7.8.0 +7.22.0 diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 92c76b5b28..453b0e67c3 100644 --- a/mobile/openapi/README.md +++ b/mobile/openapi/README.md @@ -4,7 +4,7 @@ Immich API This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.7.5 -- Generator version: 7.8.0 +- Generator version: 7.22.0 - Build package: org.openapitools.codegen.languages.DartClientCodegen ## Requirements diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index fc554b4970..3efe1ad8c7 100644 --- a/mobile/openapi/lib/api.dart +++ b/mobile/openapi/lib/api.dart @@ -15,8 +15,6 @@ import 'dart:convert'; import 'dart:io'; import 'package:collection/collection.dart'; -import 'package:flutter/foundation.dart'; -import 'package:immich_mobile/utils/openapi_patching.dart'; import 'package:http/http.dart'; import 'package:intl/intl.dart'; import 'package:meta/meta.dart'; @@ -29,6 +27,7 @@ part 'auth/api_key_auth.dart'; part 'auth/oauth.dart'; part 'auth/http_basic_auth.dart'; part 'auth/http_bearer_auth.dart'; +part 'optional.dart'; part 'api/api_keys_api.dart'; part 'api/activities_api.dart'; diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index bb006fdd65..66ac12c94b 100644 --- a/mobile/openapi/lib/api_client.dart +++ b/mobile/openapi/lib/api_client.dart @@ -143,19 +143,19 @@ class ApiClient { ); } - Future deserializeAsync(String value, String targetType, {bool growable = false,}) => + Future deserializeAsync(String value, String targetType, {bool growable = false,}) async => // ignore: deprecated_member_use_from_same_package deserialize(value, targetType, growable: growable); @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') - Future deserialize(String value, String targetType, {bool growable = false,}) async { + dynamic deserialize(String value, String targetType, {bool growable = false,}) { // Remove all spaces. Necessary for regular expressions as well. targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments // If the expected target type is String, nothing to do... return targetType == 'String' ? value - : fromJson(await compute((String j) => json.decode(j), value), targetType, growable: growable); + : fromJson(json.decode(value), targetType, growable: growable); } // ignore: deprecated_member_use_from_same_package diff --git a/mobile/openapi/lib/api_helper.dart b/mobile/openapi/lib/api_helper.dart index 3b36b23d6c..bb1b919920 100644 --- a/mobile/openapi/lib/api_helper.dart +++ b/mobile/openapi/lib/api_helper.dart @@ -220,6 +220,9 @@ Future _decodeBodyBytes(Response response) async { /// Returns a valid [T] value found at the specified Map [key], null otherwise. T? mapValueOfType(dynamic map, String key) { final dynamic value = map is Map ? map[key] : null; + if (T == double && value is int) { + return value.toDouble() as T; + } return value is T ? value : null; } diff --git a/mobile/openapi/lib/model/activity_create_dto.dart b/mobile/openapi/lib/model/activity_create_dto.dart index bc220e64ce..8d93f84ec7 100644 --- a/mobile/openapi/lib/model/activity_create_dto.dart +++ b/mobile/openapi/lib/model/activity_create_dto.dart @@ -66,12 +66,12 @@ class ActivityCreateDto { if (this.assetId != null) { json[r'assetId'] = this.assetId; } else { - // json[r'assetId'] = null; + json[r'assetId'] = null; } if (this.comment != null) { json[r'comment'] = this.comment; } else { - // json[r'comment'] = null; + json[r'comment'] = null; } json[r'type'] = this.type; return json; @@ -81,10 +81,20 @@ class ActivityCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ActivityCreateDto? fromJson(dynamic value) { - upgradeDto(value, "ActivityCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumId'), 'Required key "ActivityCreateDto[albumId]" is missing from JSON.'); + assert(json[r'albumId'] != null, 'Required key "ActivityCreateDto[albumId]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "ActivityCreateDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "ActivityCreateDto[type]" has a null value in JSON.'); + return true; + }()); + return ActivityCreateDto( albumId: mapValueOfType(json, r'albumId')!, assetId: mapValueOfType(json, r'assetId'), diff --git a/mobile/openapi/lib/model/activity_response_dto.dart b/mobile/openapi/lib/model/activity_response_dto.dart index 1b0e279ab7..cc47aef889 100644 --- a/mobile/openapi/lib/model/activity_response_dto.dart +++ b/mobile/openapi/lib/model/activity_response_dto.dart @@ -64,12 +64,12 @@ class ActivityResponseDto { if (this.assetId != null) { json[r'assetId'] = this.assetId; } else { - // json[r'assetId'] = null; + json[r'assetId'] = null; } if (this.comment != null) { json[r'comment'] = this.comment; } else { - // json[r'comment'] = null; + json[r'comment'] = null; } json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdAt.millisecondsSinceEpoch @@ -84,10 +84,25 @@ class ActivityResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ActivityResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ActivityResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "ActivityResponseDto[assetId]" is missing from JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "ActivityResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "ActivityResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "ActivityResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "ActivityResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "ActivityResponseDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "ActivityResponseDto[type]" has a null value in JSON.'); + assert(json.containsKey(r'user'), 'Required key "ActivityResponseDto[user]" is missing from JSON.'); + assert(json[r'user'] != null, 'Required key "ActivityResponseDto[user]" has a null value in JSON.'); + return true; + }()); + return ActivityResponseDto( assetId: mapValueOfType(json, r'assetId'), comment: mapValueOfType(json, r'comment'), diff --git a/mobile/openapi/lib/model/activity_statistics_response_dto.dart b/mobile/openapi/lib/model/activity_statistics_response_dto.dart index d9ac019ee2..3dfd8af1f6 100644 --- a/mobile/openapi/lib/model/activity_statistics_response_dto.dart +++ b/mobile/openapi/lib/model/activity_statistics_response_dto.dart @@ -54,10 +54,20 @@ class ActivityStatisticsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ActivityStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ActivityStatisticsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'comments'), 'Required key "ActivityStatisticsResponseDto[comments]" is missing from JSON.'); + assert(json[r'comments'] != null, 'Required key "ActivityStatisticsResponseDto[comments]" has a null value in JSON.'); + assert(json.containsKey(r'likes'), 'Required key "ActivityStatisticsResponseDto[likes]" is missing from JSON.'); + assert(json[r'likes'] != null, 'Required key "ActivityStatisticsResponseDto[likes]" has a null value in JSON.'); + return true; + }()); + return ActivityStatisticsResponseDto( comments: mapValueOfType(json, r'comments')!, likes: mapValueOfType(json, r'likes')!, diff --git a/mobile/openapi/lib/model/add_users_dto.dart b/mobile/openapi/lib/model/add_users_dto.dart index 1dad234811..077b03fe00 100644 --- a/mobile/openapi/lib/model/add_users_dto.dart +++ b/mobile/openapi/lib/model/add_users_dto.dart @@ -41,10 +41,18 @@ class AddUsersDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AddUsersDto? fromJson(dynamic value) { - upgradeDto(value, "AddUsersDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumUsers'), 'Required key "AddUsersDto[albumUsers]" is missing from JSON.'); + assert(json[r'albumUsers'] != null, 'Required key "AddUsersDto[albumUsers]" has a null value in JSON.'); + return true; + }()); + return AddUsersDto( albumUsers: AlbumUserAddDto.listFromJson(json[r'albumUsers']), ); diff --git a/mobile/openapi/lib/model/admin_onboarding_update_dto.dart b/mobile/openapi/lib/model/admin_onboarding_update_dto.dart index 6daba2a796..5a5b81ee2f 100644 --- a/mobile/openapi/lib/model/admin_onboarding_update_dto.dart +++ b/mobile/openapi/lib/model/admin_onboarding_update_dto.dart @@ -41,10 +41,18 @@ class AdminOnboardingUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AdminOnboardingUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "AdminOnboardingUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'isOnboarded'), 'Required key "AdminOnboardingUpdateDto[isOnboarded]" is missing from JSON.'); + assert(json[r'isOnboarded'] != null, 'Required key "AdminOnboardingUpdateDto[isOnboarded]" has a null value in JSON.'); + return true; + }()); + return AdminOnboardingUpdateDto( isOnboarded: mapValueOfType(json, r'isOnboarded')!, ); diff --git a/mobile/openapi/lib/model/album_response_dto.dart b/mobile/openapi/lib/model/album_response_dto.dart index fd90f23e3a..a47e3d85a5 100644 --- a/mobile/openapi/lib/model/album_response_dto.dart +++ b/mobile/openapi/lib/model/album_response_dto.dart @@ -152,7 +152,7 @@ class AlbumResponseDto { if (this.albumThumbnailAssetId != null) { json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; } else { - // json[r'albumThumbnailAssetId'] = null; + json[r'albumThumbnailAssetId'] = null; } json[r'albumUsers'] = this.albumUsers; json[r'assetCount'] = this.assetCount; @@ -162,7 +162,7 @@ class AlbumResponseDto { if (this.endDate != null) { json[r'endDate'] = this.endDate!.toUtc().toIso8601String(); } else { - // json[r'endDate'] = null; + json[r'endDate'] = null; } json[r'hasSharedLink'] = this.hasSharedLink; json[r'id'] = this.id; @@ -170,18 +170,18 @@ class AlbumResponseDto { if (this.lastModifiedAssetTimestamp != null) { json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String(); } else { - // json[r'lastModifiedAssetTimestamp'] = null; + json[r'lastModifiedAssetTimestamp'] = null; } if (this.order != null) { json[r'order'] = this.order; } else { - // json[r'order'] = null; + json[r'order'] = null; } json[r'shared'] = this.shared; if (this.startDate != null) { json[r'startDate'] = this.startDate!.toUtc().toIso8601String(); } else { - // json[r'startDate'] = null; + json[r'startDate'] = null; } json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); return json; @@ -191,10 +191,37 @@ class AlbumResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumName'), 'Required key "AlbumResponseDto[albumName]" is missing from JSON.'); + assert(json[r'albumName'] != null, 'Required key "AlbumResponseDto[albumName]" has a null value in JSON.'); + assert(json.containsKey(r'albumThumbnailAssetId'), 'Required key "AlbumResponseDto[albumThumbnailAssetId]" is missing from JSON.'); + assert(json.containsKey(r'albumUsers'), 'Required key "AlbumResponseDto[albumUsers]" is missing from JSON.'); + assert(json[r'albumUsers'] != null, 'Required key "AlbumResponseDto[albumUsers]" has a null value in JSON.'); + assert(json.containsKey(r'assetCount'), 'Required key "AlbumResponseDto[assetCount]" is missing from JSON.'); + assert(json[r'assetCount'] != null, 'Required key "AlbumResponseDto[assetCount]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "AlbumResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "AlbumResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'description'), 'Required key "AlbumResponseDto[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "AlbumResponseDto[description]" has a null value in JSON.'); + assert(json.containsKey(r'hasSharedLink'), 'Required key "AlbumResponseDto[hasSharedLink]" is missing from JSON.'); + assert(json[r'hasSharedLink'] != null, 'Required key "AlbumResponseDto[hasSharedLink]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AlbumResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AlbumResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isActivityEnabled'), 'Required key "AlbumResponseDto[isActivityEnabled]" is missing from JSON.'); + assert(json[r'isActivityEnabled'] != null, 'Required key "AlbumResponseDto[isActivityEnabled]" has a null value in JSON.'); + assert(json.containsKey(r'shared'), 'Required key "AlbumResponseDto[shared]" is missing from JSON.'); + assert(json[r'shared'] != null, 'Required key "AlbumResponseDto[shared]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "AlbumResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "AlbumResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return AlbumResponseDto( albumName: mapValueOfType(json, r'albumName')!, albumThumbnailAssetId: mapValueOfType(json, r'albumThumbnailAssetId'), diff --git a/mobile/openapi/lib/model/album_statistics_response_dto.dart b/mobile/openapi/lib/model/album_statistics_response_dto.dart index 0f440d572d..dc09576f8f 100644 --- a/mobile/openapi/lib/model/album_statistics_response_dto.dart +++ b/mobile/openapi/lib/model/album_statistics_response_dto.dart @@ -64,10 +64,22 @@ class AlbumStatisticsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumStatisticsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'notShared'), 'Required key "AlbumStatisticsResponseDto[notShared]" is missing from JSON.'); + assert(json[r'notShared'] != null, 'Required key "AlbumStatisticsResponseDto[notShared]" has a null value in JSON.'); + assert(json.containsKey(r'owned'), 'Required key "AlbumStatisticsResponseDto[owned]" is missing from JSON.'); + assert(json[r'owned'] != null, 'Required key "AlbumStatisticsResponseDto[owned]" has a null value in JSON.'); + assert(json.containsKey(r'shared'), 'Required key "AlbumStatisticsResponseDto[shared]" is missing from JSON.'); + assert(json[r'shared'] != null, 'Required key "AlbumStatisticsResponseDto[shared]" has a null value in JSON.'); + return true; + }()); + return AlbumStatisticsResponseDto( notShared: mapValueOfType(json, r'notShared')!, owned: mapValueOfType(json, r'owned')!, diff --git a/mobile/openapi/lib/model/album_user_add_dto.dart b/mobile/openapi/lib/model/album_user_add_dto.dart index ee457905bd..3ba88812a4 100644 --- a/mobile/openapi/lib/model/album_user_add_dto.dart +++ b/mobile/openapi/lib/model/album_user_add_dto.dart @@ -47,7 +47,7 @@ class AlbumUserAddDto { if (this.role != null) { json[r'role'] = this.role; } else { - // json[r'role'] = null; + json[r'role'] = null; } json[r'userId'] = this.userId; return json; @@ -57,10 +57,18 @@ class AlbumUserAddDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumUserAddDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumUserAddDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'userId'), 'Required key "AlbumUserAddDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "AlbumUserAddDto[userId]" has a null value in JSON.'); + return true; + }()); + return AlbumUserAddDto( role: AlbumUserRole.fromJson(json[r'role']), userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/album_user_create_dto.dart b/mobile/openapi/lib/model/album_user_create_dto.dart index 26aa35ae78..e366794b0b 100644 --- a/mobile/openapi/lib/model/album_user_create_dto.dart +++ b/mobile/openapi/lib/model/album_user_create_dto.dart @@ -47,10 +47,20 @@ class AlbumUserCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumUserCreateDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumUserCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'role'), 'Required key "AlbumUserCreateDto[role]" is missing from JSON.'); + assert(json[r'role'] != null, 'Required key "AlbumUserCreateDto[role]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "AlbumUserCreateDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "AlbumUserCreateDto[userId]" has a null value in JSON.'); + return true; + }()); + return AlbumUserCreateDto( role: AlbumUserRole.fromJson(json[r'role'])!, userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/album_user_response_dto.dart b/mobile/openapi/lib/model/album_user_response_dto.dart index bbae03fba7..86ba20651f 100644 --- a/mobile/openapi/lib/model/album_user_response_dto.dart +++ b/mobile/openapi/lib/model/album_user_response_dto.dart @@ -46,10 +46,20 @@ class AlbumUserResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumUserResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumUserResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'role'), 'Required key "AlbumUserResponseDto[role]" is missing from JSON.'); + assert(json[r'role'] != null, 'Required key "AlbumUserResponseDto[role]" has a null value in JSON.'); + assert(json.containsKey(r'user'), 'Required key "AlbumUserResponseDto[user]" is missing from JSON.'); + assert(json[r'user'] != null, 'Required key "AlbumUserResponseDto[user]" has a null value in JSON.'); + return true; + }()); + return AlbumUserResponseDto( role: AlbumUserRole.fromJson(json[r'role'])!, user: UserResponseDto.fromJson(json[r'user'])!, diff --git a/mobile/openapi/lib/model/albums_add_assets_dto.dart b/mobile/openapi/lib/model/albums_add_assets_dto.dart index d6aa3db1c1..64f02a766a 100644 --- a/mobile/openapi/lib/model/albums_add_assets_dto.dart +++ b/mobile/openapi/lib/model/albums_add_assets_dto.dart @@ -48,10 +48,20 @@ class AlbumsAddAssetsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumsAddAssetsDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumsAddAssetsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumIds'), 'Required key "AlbumsAddAssetsDto[albumIds]" is missing from JSON.'); + assert(json[r'albumIds'] != null, 'Required key "AlbumsAddAssetsDto[albumIds]" has a null value in JSON.'); + assert(json.containsKey(r'assetIds'), 'Required key "AlbumsAddAssetsDto[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "AlbumsAddAssetsDto[assetIds]" has a null value in JSON.'); + return true; + }()); + return AlbumsAddAssetsDto( albumIds: json[r'albumIds'] is Iterable ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/albums_add_assets_response_dto.dart b/mobile/openapi/lib/model/albums_add_assets_response_dto.dart index 99e679222e..cd41c4e1ec 100644 --- a/mobile/openapi/lib/model/albums_add_assets_response_dto.dart +++ b/mobile/openapi/lib/model/albums_add_assets_response_dto.dart @@ -47,7 +47,7 @@ class AlbumsAddAssetsResponseDto { if (this.error != null) { json[r'error'] = this.error; } else { - // json[r'error'] = null; + json[r'error'] = null; } json[r'success'] = this.success; return json; @@ -57,10 +57,18 @@ class AlbumsAddAssetsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumsAddAssetsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AlbumsAddAssetsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'success'), 'Required key "AlbumsAddAssetsResponseDto[success]" is missing from JSON.'); + assert(json[r'success'] != null, 'Required key "AlbumsAddAssetsResponseDto[success]" has a null value in JSON.'); + return true; + }()); + return AlbumsAddAssetsResponseDto( error: BulkIdErrorReason.fromJson(json[r'error']), success: mapValueOfType(json, r'success')!, diff --git a/mobile/openapi/lib/model/albums_response.dart b/mobile/openapi/lib/model/albums_response.dart index def205de90..042d634028 100644 --- a/mobile/openapi/lib/model/albums_response.dart +++ b/mobile/openapi/lib/model/albums_response.dart @@ -40,10 +40,18 @@ class AlbumsResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumsResponse? fromJson(dynamic value) { - upgradeDto(value, "AlbumsResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'defaultAssetOrder'), 'Required key "AlbumsResponse[defaultAssetOrder]" is missing from JSON.'); + assert(json[r'defaultAssetOrder'] != null, 'Required key "AlbumsResponse[defaultAssetOrder]" has a null value in JSON.'); + return true; + }()); + return AlbumsResponse( defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder'])!, ); diff --git a/mobile/openapi/lib/model/albums_update.dart b/mobile/openapi/lib/model/albums_update.dart index d61b5c1398..22ea04fff4 100644 --- a/mobile/openapi/lib/model/albums_update.dart +++ b/mobile/openapi/lib/model/albums_update.dart @@ -41,7 +41,7 @@ class AlbumsUpdate { if (this.defaultAssetOrder != null) { json[r'defaultAssetOrder'] = this.defaultAssetOrder; } else { - // json[r'defaultAssetOrder'] = null; + json[r'defaultAssetOrder'] = null; } return json; } @@ -50,10 +50,16 @@ class AlbumsUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AlbumsUpdate? fromJson(dynamic value) { - upgradeDto(value, "AlbumsUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return AlbumsUpdate( defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder']), ); diff --git a/mobile/openapi/lib/model/api_key_create_dto.dart b/mobile/openapi/lib/model/api_key_create_dto.dart index 6d3ffc1eb1..f1c76964bb 100644 --- a/mobile/openapi/lib/model/api_key_create_dto.dart +++ b/mobile/openapi/lib/model/api_key_create_dto.dart @@ -48,7 +48,7 @@ class ApiKeyCreateDto { if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } json[r'permissions'] = this.permissions; return json; @@ -58,10 +58,18 @@ class ApiKeyCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ApiKeyCreateDto? fromJson(dynamic value) { - upgradeDto(value, "ApiKeyCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'permissions'), 'Required key "ApiKeyCreateDto[permissions]" is missing from JSON.'); + assert(json[r'permissions'] != null, 'Required key "ApiKeyCreateDto[permissions]" has a null value in JSON.'); + return true; + }()); + return ApiKeyCreateDto( name: mapValueOfType(json, r'name'), permissions: Permission.listFromJson(json[r'permissions']), diff --git a/mobile/openapi/lib/model/api_key_create_response_dto.dart b/mobile/openapi/lib/model/api_key_create_response_dto.dart index 77b19ebfd2..a2259b8ff7 100644 --- a/mobile/openapi/lib/model/api_key_create_response_dto.dart +++ b/mobile/openapi/lib/model/api_key_create_response_dto.dart @@ -47,10 +47,20 @@ class ApiKeyCreateResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ApiKeyCreateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ApiKeyCreateResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'apiKey'), 'Required key "ApiKeyCreateResponseDto[apiKey]" is missing from JSON.'); + assert(json[r'apiKey'] != null, 'Required key "ApiKeyCreateResponseDto[apiKey]" has a null value in JSON.'); + assert(json.containsKey(r'secret'), 'Required key "ApiKeyCreateResponseDto[secret]" is missing from JSON.'); + assert(json[r'secret'] != null, 'Required key "ApiKeyCreateResponseDto[secret]" has a null value in JSON.'); + return true; + }()); + return ApiKeyCreateResponseDto( apiKey: ApiKeyResponseDto.fromJson(json[r'apiKey'])!, secret: mapValueOfType(json, r'secret')!, diff --git a/mobile/openapi/lib/model/api_key_response_dto.dart b/mobile/openapi/lib/model/api_key_response_dto.dart index 79099188a3..f0601dd916 100644 --- a/mobile/openapi/lib/model/api_key_response_dto.dart +++ b/mobile/openapi/lib/model/api_key_response_dto.dart @@ -73,10 +73,26 @@ class ApiKeyResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ApiKeyResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ApiKeyResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "ApiKeyResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "ApiKeyResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "ApiKeyResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "ApiKeyResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "ApiKeyResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "ApiKeyResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'permissions'), 'Required key "ApiKeyResponseDto[permissions]" is missing from JSON.'); + assert(json[r'permissions'] != null, 'Required key "ApiKeyResponseDto[permissions]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "ApiKeyResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "ApiKeyResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return ApiKeyResponseDto( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/api_key_update_dto.dart b/mobile/openapi/lib/model/api_key_update_dto.dart index c8df4be654..c589377a31 100644 --- a/mobile/openapi/lib/model/api_key_update_dto.dart +++ b/mobile/openapi/lib/model/api_key_update_dto.dart @@ -48,7 +48,7 @@ class ApiKeyUpdateDto { if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } json[r'permissions'] = this.permissions; return json; @@ -58,10 +58,16 @@ class ApiKeyUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ApiKeyUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "ApiKeyUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return ApiKeyUpdateDto( name: mapValueOfType(json, r'name'), permissions: Permission.listFromJson(json[r'permissions']), diff --git a/mobile/openapi/lib/model/asset_bulk_delete_dto.dart b/mobile/openapi/lib/model/asset_bulk_delete_dto.dart index 055ef16015..9f44a02846 100644 --- a/mobile/openapi/lib/model/asset_bulk_delete_dto.dart +++ b/mobile/openapi/lib/model/asset_bulk_delete_dto.dart @@ -48,7 +48,7 @@ class AssetBulkDeleteDto { if (this.force != null) { json[r'force'] = this.force; } else { - // json[r'force'] = null; + json[r'force'] = null; } json[r'ids'] = this.ids; return json; @@ -58,10 +58,18 @@ class AssetBulkDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetBulkDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ids'), 'Required key "AssetBulkDeleteDto[ids]" is missing from JSON.'); + assert(json[r'ids'] != null, 'Required key "AssetBulkDeleteDto[ids]" has a null value in JSON.'); + return true; + }()); + return AssetBulkDeleteDto( force: mapValueOfType(json, r'force'), ids: json[r'ids'] is Iterable diff --git a/mobile/openapi/lib/model/asset_bulk_update_dto.dart b/mobile/openapi/lib/model/asset_bulk_update_dto.dart index f85026f054..e60792de0c 100644 --- a/mobile/openapi/lib/model/asset_bulk_update_dto.dart +++ b/mobile/openapi/lib/model/asset_bulk_update_dto.dart @@ -155,53 +155,53 @@ class AssetBulkUpdateDto { if (this.dateTimeOriginal != null) { json[r'dateTimeOriginal'] = this.dateTimeOriginal; } else { - // json[r'dateTimeOriginal'] = null; + json[r'dateTimeOriginal'] = null; } if (this.dateTimeRelative != null) { json[r'dateTimeRelative'] = this.dateTimeRelative; } else { - // json[r'dateTimeRelative'] = null; + json[r'dateTimeRelative'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.duplicateId != null) { json[r'duplicateId'] = this.duplicateId; } else { - // json[r'duplicateId'] = null; + json[r'duplicateId'] = null; } json[r'ids'] = this.ids; if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.latitude != null) { json[r'latitude'] = this.latitude; } else { - // json[r'latitude'] = null; + json[r'latitude'] = null; } if (this.longitude != null) { json[r'longitude'] = this.longitude; } else { - // json[r'longitude'] = null; + json[r'longitude'] = null; } if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.timeZone != null) { json[r'timeZone'] = this.timeZone; } else { - // json[r'timeZone'] = null; + json[r'timeZone'] = null; } if (this.visibility != null) { json[r'visibility'] = this.visibility; } else { - // json[r'visibility'] = null; + json[r'visibility'] = null; } return json; } @@ -210,10 +210,18 @@ class AssetBulkUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetBulkUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ids'), 'Required key "AssetBulkUpdateDto[ids]" is missing from JSON.'); + assert(json[r'ids'] != null, 'Required key "AssetBulkUpdateDto[ids]" has a null value in JSON.'); + return true; + }()); + return AssetBulkUpdateDto( dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), dateTimeRelative: mapValueOfType(json, r'dateTimeRelative'), diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart index 66f46795e8..4fee524392 100644 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart +++ b/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart @@ -41,10 +41,18 @@ class AssetBulkUploadCheckDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetBulkUploadCheckDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assets'), 'Required key "AssetBulkUploadCheckDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "AssetBulkUploadCheckDto[assets]" has a null value in JSON.'); + return true; + }()); + return AssetBulkUploadCheckDto( assets: AssetBulkUploadCheckItem.listFromJson(json[r'assets']), ); diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart index 65f81926e3..b93655644e 100644 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart +++ b/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart @@ -48,10 +48,20 @@ class AssetBulkUploadCheckItem { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetBulkUploadCheckItem? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckItem"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'checksum'), 'Required key "AssetBulkUploadCheckItem[checksum]" is missing from JSON.'); + assert(json[r'checksum'] != null, 'Required key "AssetBulkUploadCheckItem[checksum]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetBulkUploadCheckItem[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetBulkUploadCheckItem[id]" has a null value in JSON.'); + return true; + }()); + return AssetBulkUploadCheckItem( checksum: mapValueOfType(json, r'checksum')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart index b37bb0de8a..f646261ad7 100644 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart +++ b/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart @@ -41,10 +41,18 @@ class AssetBulkUploadCheckResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetBulkUploadCheckResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'results'), 'Required key "AssetBulkUploadCheckResponseDto[results]" is missing from JSON.'); + assert(json[r'results'] != null, 'Required key "AssetBulkUploadCheckResponseDto[results]" has a null value in JSON.'); + return true; + }()); + return AssetBulkUploadCheckResponseDto( results: AssetBulkUploadCheckResult.listFromJson(json[r'results']), ); diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart index bf3ee8e244..584e2b32d5 100644 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart +++ b/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart @@ -77,18 +77,18 @@ class AssetBulkUploadCheckResult { if (this.assetId != null) { json[r'assetId'] = this.assetId; } else { - // json[r'assetId'] = null; + json[r'assetId'] = null; } json[r'id'] = this.id; if (this.isTrashed != null) { json[r'isTrashed'] = this.isTrashed; } else { - // json[r'isTrashed'] = null; + json[r'isTrashed'] = null; } if (this.reason != null) { json[r'reason'] = this.reason; } else { - // json[r'reason'] = null; + json[r'reason'] = null; } return json; } @@ -97,10 +97,20 @@ class AssetBulkUploadCheckResult { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetBulkUploadCheckResult? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckResult"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'action'), 'Required key "AssetBulkUploadCheckResult[action]" is missing from JSON.'); + assert(json[r'action'] != null, 'Required key "AssetBulkUploadCheckResult[action]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetBulkUploadCheckResult[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetBulkUploadCheckResult[id]" has a null value in JSON.'); + return true; + }()); + return AssetBulkUploadCheckResult( action: AssetUploadAction.fromJson(json[r'action'])!, assetId: mapValueOfType(json, r'assetId'), diff --git a/mobile/openapi/lib/model/asset_copy_dto.dart b/mobile/openapi/lib/model/asset_copy_dto.dart index 2e68c5c113..c813589b51 100644 --- a/mobile/openapi/lib/model/asset_copy_dto.dart +++ b/mobile/openapi/lib/model/asset_copy_dto.dart @@ -83,10 +83,20 @@ class AssetCopyDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetCopyDto? fromJson(dynamic value) { - upgradeDto(value, "AssetCopyDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'sourceId'), 'Required key "AssetCopyDto[sourceId]" is missing from JSON.'); + assert(json[r'sourceId'] != null, 'Required key "AssetCopyDto[sourceId]" has a null value in JSON.'); + assert(json.containsKey(r'targetId'), 'Required key "AssetCopyDto[targetId]" is missing from JSON.'); + assert(json[r'targetId'] != null, 'Required key "AssetCopyDto[targetId]" has a null value in JSON.'); + return true; + }()); + return AssetCopyDto( albums: mapValueOfType(json, r'albums') ?? true, favorite: mapValueOfType(json, r'favorite') ?? true, diff --git a/mobile/openapi/lib/model/asset_edit_action_item_dto.dart b/mobile/openapi/lib/model/asset_edit_action_item_dto.dart index 1b19612bf3..115d64fbe8 100644 --- a/mobile/openapi/lib/model/asset_edit_action_item_dto.dart +++ b/mobile/openapi/lib/model/asset_edit_action_item_dto.dart @@ -46,10 +46,20 @@ class AssetEditActionItemDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetEditActionItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionItemDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'action'), 'Required key "AssetEditActionItemDto[action]" is missing from JSON.'); + assert(json[r'action'] != null, 'Required key "AssetEditActionItemDto[action]" has a null value in JSON.'); + assert(json.containsKey(r'parameters'), 'Required key "AssetEditActionItemDto[parameters]" is missing from JSON.'); + assert(json[r'parameters'] != null, 'Required key "AssetEditActionItemDto[parameters]" has a null value in JSON.'); + return true; + }()); + return AssetEditActionItemDto( action: AssetEditAction.fromJson(json[r'action'])!, parameters: json[r'parameters'], diff --git a/mobile/openapi/lib/model/asset_edit_action_item_dto_parameters.dart b/mobile/openapi/lib/model/asset_edit_action_item_dto_parameters.dart index 6f2811e89d..b7a0a71139 100644 --- a/mobile/openapi/lib/model/asset_edit_action_item_dto_parameters.dart +++ b/mobile/openapi/lib/model/asset_edit_action_item_dto_parameters.dart @@ -87,10 +87,28 @@ class AssetEditActionItemDtoParameters { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetEditActionItemDtoParameters? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionItemDtoParameters"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'height'), 'Required key "AssetEditActionItemDtoParameters[height]" is missing from JSON.'); + assert(json[r'height'] != null, 'Required key "AssetEditActionItemDtoParameters[height]" has a null value in JSON.'); + assert(json.containsKey(r'width'), 'Required key "AssetEditActionItemDtoParameters[width]" is missing from JSON.'); + assert(json[r'width'] != null, 'Required key "AssetEditActionItemDtoParameters[width]" has a null value in JSON.'); + assert(json.containsKey(r'x'), 'Required key "AssetEditActionItemDtoParameters[x]" is missing from JSON.'); + assert(json[r'x'] != null, 'Required key "AssetEditActionItemDtoParameters[x]" has a null value in JSON.'); + assert(json.containsKey(r'y'), 'Required key "AssetEditActionItemDtoParameters[y]" is missing from JSON.'); + assert(json[r'y'] != null, 'Required key "AssetEditActionItemDtoParameters[y]" has a null value in JSON.'); + assert(json.containsKey(r'angle'), 'Required key "AssetEditActionItemDtoParameters[angle]" is missing from JSON.'); + assert(json[r'angle'] != null, 'Required key "AssetEditActionItemDtoParameters[angle]" has a null value in JSON.'); + assert(json.containsKey(r'axis'), 'Required key "AssetEditActionItemDtoParameters[axis]" is missing from JSON.'); + assert(json[r'axis'] != null, 'Required key "AssetEditActionItemDtoParameters[axis]" has a null value in JSON.'); + return true; + }()); + return AssetEditActionItemDtoParameters( height: mapValueOfType(json, r'height')!, width: mapValueOfType(json, r'width')!, diff --git a/mobile/openapi/lib/model/asset_edit_action_item_response_dto.dart b/mobile/openapi/lib/model/asset_edit_action_item_response_dto.dart index 3315fe8579..facc84fddb 100644 --- a/mobile/openapi/lib/model/asset_edit_action_item_response_dto.dart +++ b/mobile/openapi/lib/model/asset_edit_action_item_response_dto.dart @@ -53,10 +53,22 @@ class AssetEditActionItemResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetEditActionItemResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionItemResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'action'), 'Required key "AssetEditActionItemResponseDto[action]" is missing from JSON.'); + assert(json[r'action'] != null, 'Required key "AssetEditActionItemResponseDto[action]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetEditActionItemResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetEditActionItemResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'parameters'), 'Required key "AssetEditActionItemResponseDto[parameters]" is missing from JSON.'); + assert(json[r'parameters'] != null, 'Required key "AssetEditActionItemResponseDto[parameters]" has a null value in JSON.'); + return true; + }()); + return AssetEditActionItemResponseDto( action: AssetEditAction.fromJson(json[r'action'])!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/asset_edits_create_dto.dart b/mobile/openapi/lib/model/asset_edits_create_dto.dart index 9f6fc66904..eb7c41946a 100644 --- a/mobile/openapi/lib/model/asset_edits_create_dto.dart +++ b/mobile/openapi/lib/model/asset_edits_create_dto.dart @@ -41,10 +41,18 @@ class AssetEditsCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetEditsCreateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetEditsCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'edits'), 'Required key "AssetEditsCreateDto[edits]" is missing from JSON.'); + assert(json[r'edits'] != null, 'Required key "AssetEditsCreateDto[edits]" has a null value in JSON.'); + return true; + }()); + return AssetEditsCreateDto( edits: AssetEditActionItemDto.listFromJson(json[r'edits']), ); diff --git a/mobile/openapi/lib/model/asset_edits_response_dto.dart b/mobile/openapi/lib/model/asset_edits_response_dto.dart index 322b4c0a4c..ab4807652a 100644 --- a/mobile/openapi/lib/model/asset_edits_response_dto.dart +++ b/mobile/openapi/lib/model/asset_edits_response_dto.dart @@ -48,10 +48,20 @@ class AssetEditsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetEditsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetEditsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetEditsResponseDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetEditsResponseDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'edits'), 'Required key "AssetEditsResponseDto[edits]" is missing from JSON.'); + assert(json[r'edits'] != null, 'Required key "AssetEditsResponseDto[edits]" has a null value in JSON.'); + return true; + }()); + return AssetEditsResponseDto( assetId: mapValueOfType(json, r'assetId')!, edits: AssetEditActionItemResponseDto.listFromJson(json[r'edits']), diff --git a/mobile/openapi/lib/model/asset_face_create_dto.dart b/mobile/openapi/lib/model/asset_face_create_dto.dart index 29c28175cd..3a3326eb17 100644 --- a/mobile/openapi/lib/model/asset_face_create_dto.dart +++ b/mobile/openapi/lib/model/asset_face_create_dto.dart @@ -108,10 +108,32 @@ class AssetFaceCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetFaceCreateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetFaceCreateDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetFaceCreateDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'height'), 'Required key "AssetFaceCreateDto[height]" is missing from JSON.'); + assert(json[r'height'] != null, 'Required key "AssetFaceCreateDto[height]" has a null value in JSON.'); + assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceCreateDto[imageHeight]" is missing from JSON.'); + assert(json[r'imageHeight'] != null, 'Required key "AssetFaceCreateDto[imageHeight]" has a null value in JSON.'); + assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceCreateDto[imageWidth]" is missing from JSON.'); + assert(json[r'imageWidth'] != null, 'Required key "AssetFaceCreateDto[imageWidth]" has a null value in JSON.'); + assert(json.containsKey(r'personId'), 'Required key "AssetFaceCreateDto[personId]" is missing from JSON.'); + assert(json[r'personId'] != null, 'Required key "AssetFaceCreateDto[personId]" has a null value in JSON.'); + assert(json.containsKey(r'width'), 'Required key "AssetFaceCreateDto[width]" is missing from JSON.'); + assert(json[r'width'] != null, 'Required key "AssetFaceCreateDto[width]" has a null value in JSON.'); + assert(json.containsKey(r'x'), 'Required key "AssetFaceCreateDto[x]" is missing from JSON.'); + assert(json[r'x'] != null, 'Required key "AssetFaceCreateDto[x]" has a null value in JSON.'); + assert(json.containsKey(r'y'), 'Required key "AssetFaceCreateDto[y]" is missing from JSON.'); + assert(json[r'y'] != null, 'Required key "AssetFaceCreateDto[y]" has a null value in JSON.'); + return true; + }()); + return AssetFaceCreateDto( assetId: mapValueOfType(json, r'assetId')!, height: mapValueOfType(json, r'height')!, diff --git a/mobile/openapi/lib/model/asset_face_delete_dto.dart b/mobile/openapi/lib/model/asset_face_delete_dto.dart index a1f3731bea..25998942c1 100644 --- a/mobile/openapi/lib/model/asset_face_delete_dto.dart +++ b/mobile/openapi/lib/model/asset_face_delete_dto.dart @@ -41,10 +41,18 @@ class AssetFaceDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetFaceDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'force'), 'Required key "AssetFaceDeleteDto[force]" is missing from JSON.'); + assert(json[r'force'] != null, 'Required key "AssetFaceDeleteDto[force]" has a null value in JSON.'); + return true; + }()); + return AssetFaceDeleteDto( force: mapValueOfType(json, r'force')!, ); diff --git a/mobile/openapi/lib/model/asset_face_response_dto.dart b/mobile/openapi/lib/model/asset_face_response_dto.dart index 21b86dfe4e..8a17a6f8c7 100644 --- a/mobile/openapi/lib/model/asset_face_response_dto.dart +++ b/mobile/openapi/lib/model/asset_face_response_dto.dart @@ -113,12 +113,12 @@ class AssetFaceResponseDto { if (this.person != null) { json[r'person'] = this.person; } else { - // json[r'person'] = null; + json[r'person'] = null; } if (this.sourceType != null) { json[r'sourceType'] = this.sourceType; } else { - // json[r'sourceType'] = null; + json[r'sourceType'] = null; } return json; } @@ -127,10 +127,31 @@ class AssetFaceResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetFaceResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'boundingBoxX1'), 'Required key "AssetFaceResponseDto[boundingBoxX1]" is missing from JSON.'); + assert(json[r'boundingBoxX1'] != null, 'Required key "AssetFaceResponseDto[boundingBoxX1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxX2'), 'Required key "AssetFaceResponseDto[boundingBoxX2]" is missing from JSON.'); + assert(json[r'boundingBoxX2'] != null, 'Required key "AssetFaceResponseDto[boundingBoxX2]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY1'), 'Required key "AssetFaceResponseDto[boundingBoxY1]" is missing from JSON.'); + assert(json[r'boundingBoxY1'] != null, 'Required key "AssetFaceResponseDto[boundingBoxY1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY2'), 'Required key "AssetFaceResponseDto[boundingBoxY2]" is missing from JSON.'); + assert(json[r'boundingBoxY2'] != null, 'Required key "AssetFaceResponseDto[boundingBoxY2]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetFaceResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetFaceResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceResponseDto[imageHeight]" is missing from JSON.'); + assert(json[r'imageHeight'] != null, 'Required key "AssetFaceResponseDto[imageHeight]" has a null value in JSON.'); + assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceResponseDto[imageWidth]" is missing from JSON.'); + assert(json[r'imageWidth'] != null, 'Required key "AssetFaceResponseDto[imageWidth]" has a null value in JSON.'); + assert(json.containsKey(r'person'), 'Required key "AssetFaceResponseDto[person]" is missing from JSON.'); + return true; + }()); + return AssetFaceResponseDto( boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, boundingBoxX2: mapValueOfType(json, r'boundingBoxX2')!, diff --git a/mobile/openapi/lib/model/asset_face_update_dto.dart b/mobile/openapi/lib/model/asset_face_update_dto.dart index 1027627552..eda399b0ef 100644 --- a/mobile/openapi/lib/model/asset_face_update_dto.dart +++ b/mobile/openapi/lib/model/asset_face_update_dto.dart @@ -41,10 +41,18 @@ class AssetFaceUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetFaceUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'data'), 'Required key "AssetFaceUpdateDto[data]" is missing from JSON.'); + assert(json[r'data'] != null, 'Required key "AssetFaceUpdateDto[data]" has a null value in JSON.'); + return true; + }()); + return AssetFaceUpdateDto( data: AssetFaceUpdateItem.listFromJson(json[r'data']), ); diff --git a/mobile/openapi/lib/model/asset_face_update_item.dart b/mobile/openapi/lib/model/asset_face_update_item.dart index a81b21e139..96db409983 100644 --- a/mobile/openapi/lib/model/asset_face_update_item.dart +++ b/mobile/openapi/lib/model/asset_face_update_item.dart @@ -48,10 +48,20 @@ class AssetFaceUpdateItem { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetFaceUpdateItem? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceUpdateItem"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetFaceUpdateItem[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetFaceUpdateItem[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'personId'), 'Required key "AssetFaceUpdateItem[personId]" is missing from JSON.'); + assert(json[r'personId'] != null, 'Required key "AssetFaceUpdateItem[personId]" has a null value in JSON.'); + return true; + }()); + return AssetFaceUpdateItem( assetId: mapValueOfType(json, r'assetId')!, personId: mapValueOfType(json, r'personId')!, diff --git a/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart b/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart index 4a4a2a658e..a633952b6b 100644 --- a/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart +++ b/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart @@ -108,7 +108,7 @@ class AssetFaceWithoutPersonResponseDto { if (this.sourceType != null) { json[r'sourceType'] = this.sourceType; } else { - // json[r'sourceType'] = null; + json[r'sourceType'] = null; } return json; } @@ -117,10 +117,30 @@ class AssetFaceWithoutPersonResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetFaceWithoutPersonResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceWithoutPersonResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'boundingBoxX1'), 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxX1]" is missing from JSON.'); + assert(json[r'boundingBoxX1'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxX1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxX2'), 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxX2]" is missing from JSON.'); + assert(json[r'boundingBoxX2'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxX2]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY1'), 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxY1]" is missing from JSON.'); + assert(json[r'boundingBoxY1'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxY1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY2'), 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxY2]" is missing from JSON.'); + assert(json[r'boundingBoxY2'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[boundingBoxY2]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetFaceWithoutPersonResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceWithoutPersonResponseDto[imageHeight]" is missing from JSON.'); + assert(json[r'imageHeight'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[imageHeight]" has a null value in JSON.'); + assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceWithoutPersonResponseDto[imageWidth]" is missing from JSON.'); + assert(json[r'imageWidth'] != null, 'Required key "AssetFaceWithoutPersonResponseDto[imageWidth]" has a null value in JSON.'); + return true; + }()); + return AssetFaceWithoutPersonResponseDto( boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, boundingBoxX2: mapValueOfType(json, r'boundingBoxX2')!, diff --git a/mobile/openapi/lib/model/asset_ids_dto.dart b/mobile/openapi/lib/model/asset_ids_dto.dart index 85e5cc3aee..f6f5d6499d 100644 --- a/mobile/openapi/lib/model/asset_ids_dto.dart +++ b/mobile/openapi/lib/model/asset_ids_dto.dart @@ -41,10 +41,18 @@ class AssetIdsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetIdsDto? fromJson(dynamic value) { - upgradeDto(value, "AssetIdsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetIds'), 'Required key "AssetIdsDto[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "AssetIdsDto[assetIds]" has a null value in JSON.'); + return true; + }()); + return AssetIdsDto( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/asset_ids_response_dto.dart b/mobile/openapi/lib/model/asset_ids_response_dto.dart index cafe1b21b9..f2a39cc795 100644 --- a/mobile/openapi/lib/model/asset_ids_response_dto.dart +++ b/mobile/openapi/lib/model/asset_ids_response_dto.dart @@ -54,7 +54,7 @@ class AssetIdsResponseDto { if (this.error != null) { json[r'error'] = this.error; } else { - // json[r'error'] = null; + json[r'error'] = null; } json[r'success'] = this.success; return json; @@ -64,10 +64,20 @@ class AssetIdsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetIdsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetIdsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetIdsResponseDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetIdsResponseDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'success'), 'Required key "AssetIdsResponseDto[success]" is missing from JSON.'); + assert(json[r'success'] != null, 'Required key "AssetIdsResponseDto[success]" has a null value in JSON.'); + return true; + }()); + return AssetIdsResponseDto( assetId: mapValueOfType(json, r'assetId')!, error: AssetIdErrorReason.fromJson(json[r'error']), diff --git a/mobile/openapi/lib/model/asset_jobs_dto.dart b/mobile/openapi/lib/model/asset_jobs_dto.dart index 5085e3820c..b42d7ccab1 100644 --- a/mobile/openapi/lib/model/asset_jobs_dto.dart +++ b/mobile/openapi/lib/model/asset_jobs_dto.dart @@ -47,10 +47,20 @@ class AssetJobsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetJobsDto? fromJson(dynamic value) { - upgradeDto(value, "AssetJobsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetIds'), 'Required key "AssetJobsDto[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "AssetJobsDto[assetIds]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "AssetJobsDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "AssetJobsDto[name]" has a null value in JSON.'); + return true; + }()); + return AssetJobsDto( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/asset_media_response_dto.dart b/mobile/openapi/lib/model/asset_media_response_dto.dart index 6dc5cd3c92..1f37804239 100644 --- a/mobile/openapi/lib/model/asset_media_response_dto.dart +++ b/mobile/openapi/lib/model/asset_media_response_dto.dart @@ -47,10 +47,20 @@ class AssetMediaResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMediaResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMediaResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'id'), 'Required key "AssetMediaResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetMediaResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'status'), 'Required key "AssetMediaResponseDto[status]" is missing from JSON.'); + assert(json[r'status'] != null, 'Required key "AssetMediaResponseDto[status]" has a null value in JSON.'); + return true; + }()); + return AssetMediaResponseDto( id: mapValueOfType(json, r'id')!, status: AssetMediaStatus.fromJson(json[r'status'])!, diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart index 6376ebc531..ce52ffa83e 100644 --- a/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart @@ -41,10 +41,18 @@ class AssetMetadataBulkDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataBulkDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'items'), 'Required key "AssetMetadataBulkDeleteDto[items]" is missing from JSON.'); + assert(json[r'items'] != null, 'Required key "AssetMetadataBulkDeleteDto[items]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataBulkDeleteDto( items: AssetMetadataBulkDeleteItemDto.listFromJson(json[r'items']), ); diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart index 90417b79e0..aec8766633 100644 --- a/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart @@ -48,10 +48,20 @@ class AssetMetadataBulkDeleteItemDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataBulkDeleteItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkDeleteItemDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkDeleteItemDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkDeleteItemDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkDeleteItemDto[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "AssetMetadataBulkDeleteItemDto[key]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataBulkDeleteItemDto( assetId: mapValueOfType(json, r'assetId')!, key: mapValueOfType(json, r'key')!, diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart index 3e16ed8721..1b46cc0e9f 100644 --- a/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart @@ -64,10 +64,24 @@ class AssetMetadataBulkResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataBulkResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkResponseDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkResponseDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkResponseDto[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "AssetMetadataBulkResponseDto[key]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "AssetMetadataBulkResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "AssetMetadataBulkResponseDto[updatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "AssetMetadataBulkResponseDto[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "AssetMetadataBulkResponseDto[value]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataBulkResponseDto( assetId: mapValueOfType(json, r'assetId')!, key: mapValueOfType(json, r'key')!, diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart index a5e770b02a..d09b8e67da 100644 --- a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart @@ -41,10 +41,18 @@ class AssetMetadataBulkUpsertDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataBulkUpsertDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkUpsertDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'items'), 'Required key "AssetMetadataBulkUpsertDto[items]" is missing from JSON.'); + assert(json[r'items'] != null, 'Required key "AssetMetadataBulkUpsertDto[items]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataBulkUpsertDto( items: AssetMetadataBulkUpsertItemDto.listFromJson(json[r'items']), ); diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart index e4eab08bf1..f948f66f1b 100644 --- a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart @@ -55,10 +55,22 @@ class AssetMetadataBulkUpsertItemDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataBulkUpsertItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkUpsertItemDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkUpsertItemDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkUpsertItemDto[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[key]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "AssetMetadataBulkUpsertItemDto[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[value]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataBulkUpsertItemDto( assetId: mapValueOfType(json, r'assetId')!, key: mapValueOfType(json, r'key')!, diff --git a/mobile/openapi/lib/model/asset_metadata_response_dto.dart b/mobile/openapi/lib/model/asset_metadata_response_dto.dart index d3562f5a48..51266e4bdb 100644 --- a/mobile/openapi/lib/model/asset_metadata_response_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_response_dto.dart @@ -57,10 +57,22 @@ class AssetMetadataResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'key'), 'Required key "AssetMetadataResponseDto[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "AssetMetadataResponseDto[key]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "AssetMetadataResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "AssetMetadataResponseDto[updatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "AssetMetadataResponseDto[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "AssetMetadataResponseDto[value]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataResponseDto( key: mapValueOfType(json, r'key')!, updatedAt: mapDateTime(json, r'updatedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, diff --git a/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart b/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart index b1473d4826..c8a00e34b7 100644 --- a/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart @@ -41,10 +41,18 @@ class AssetMetadataUpsertDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataUpsertDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataUpsertDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'items'), 'Required key "AssetMetadataUpsertDto[items]" is missing from JSON.'); + assert(json[r'items'] != null, 'Required key "AssetMetadataUpsertDto[items]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataUpsertDto( items: AssetMetadataUpsertItemDto.listFromJson(json[r'items']), ); diff --git a/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart b/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart index 70de1941f3..93f51ff907 100644 --- a/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart +++ b/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart @@ -48,10 +48,20 @@ class AssetMetadataUpsertItemDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetMetadataUpsertItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataUpsertItemDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'key'), 'Required key "AssetMetadataUpsertItemDto[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "AssetMetadataUpsertItemDto[key]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "AssetMetadataUpsertItemDto[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "AssetMetadataUpsertItemDto[value]" has a null value in JSON.'); + return true; + }()); + return AssetMetadataUpsertItemDto( key: mapValueOfType(json, r'key')!, value: mapCastOfType(json, r'value')!, diff --git a/mobile/openapi/lib/model/asset_ocr_response_dto.dart b/mobile/openapi/lib/model/asset_ocr_response_dto.dart index c7937c6eb2..a1372eecd9 100644 --- a/mobile/openapi/lib/model/asset_ocr_response_dto.dart +++ b/mobile/openapi/lib/model/asset_ocr_response_dto.dart @@ -123,24 +123,56 @@ class AssetOcrResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetOcrResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetOcrResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "AssetOcrResponseDto[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "AssetOcrResponseDto[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'boxScore'), 'Required key "AssetOcrResponseDto[boxScore]" is missing from JSON.'); + assert(json[r'boxScore'] != null, 'Required key "AssetOcrResponseDto[boxScore]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetOcrResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetOcrResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'text'), 'Required key "AssetOcrResponseDto[text]" is missing from JSON.'); + assert(json[r'text'] != null, 'Required key "AssetOcrResponseDto[text]" has a null value in JSON.'); + assert(json.containsKey(r'textScore'), 'Required key "AssetOcrResponseDto[textScore]" is missing from JSON.'); + assert(json[r'textScore'] != null, 'Required key "AssetOcrResponseDto[textScore]" has a null value in JSON.'); + assert(json.containsKey(r'x1'), 'Required key "AssetOcrResponseDto[x1]" is missing from JSON.'); + assert(json[r'x1'] != null, 'Required key "AssetOcrResponseDto[x1]" has a null value in JSON.'); + assert(json.containsKey(r'x2'), 'Required key "AssetOcrResponseDto[x2]" is missing from JSON.'); + assert(json[r'x2'] != null, 'Required key "AssetOcrResponseDto[x2]" has a null value in JSON.'); + assert(json.containsKey(r'x3'), 'Required key "AssetOcrResponseDto[x3]" is missing from JSON.'); + assert(json[r'x3'] != null, 'Required key "AssetOcrResponseDto[x3]" has a null value in JSON.'); + assert(json.containsKey(r'x4'), 'Required key "AssetOcrResponseDto[x4]" is missing from JSON.'); + assert(json[r'x4'] != null, 'Required key "AssetOcrResponseDto[x4]" has a null value in JSON.'); + assert(json.containsKey(r'y1'), 'Required key "AssetOcrResponseDto[y1]" is missing from JSON.'); + assert(json[r'y1'] != null, 'Required key "AssetOcrResponseDto[y1]" has a null value in JSON.'); + assert(json.containsKey(r'y2'), 'Required key "AssetOcrResponseDto[y2]" is missing from JSON.'); + assert(json[r'y2'] != null, 'Required key "AssetOcrResponseDto[y2]" has a null value in JSON.'); + assert(json.containsKey(r'y3'), 'Required key "AssetOcrResponseDto[y3]" is missing from JSON.'); + assert(json[r'y3'] != null, 'Required key "AssetOcrResponseDto[y3]" has a null value in JSON.'); + assert(json.containsKey(r'y4'), 'Required key "AssetOcrResponseDto[y4]" is missing from JSON.'); + assert(json[r'y4'] != null, 'Required key "AssetOcrResponseDto[y4]" has a null value in JSON.'); + return true; + }()); + return AssetOcrResponseDto( assetId: mapValueOfType(json, r'assetId')!, - boxScore: (mapValueOfType(json, r'boxScore')!).toDouble(), + boxScore: mapValueOfType(json, r'boxScore')!, id: mapValueOfType(json, r'id')!, text: mapValueOfType(json, r'text')!, - textScore: (mapValueOfType(json, r'textScore')!).toDouble(), - x1: (mapValueOfType(json, r'x1')!).toDouble(), - x2: (mapValueOfType(json, r'x2')!).toDouble(), - x3: (mapValueOfType(json, r'x3')!).toDouble(), - x4: (mapValueOfType(json, r'x4')!).toDouble(), - y1: (mapValueOfType(json, r'y1')!).toDouble(), - y2: (mapValueOfType(json, r'y2')!).toDouble(), - y3: (mapValueOfType(json, r'y3')!).toDouble(), - y4: (mapValueOfType(json, r'y4')!).toDouble(), + textScore: mapValueOfType(json, r'textScore')!, + x1: mapValueOfType(json, r'x1')!, + x2: mapValueOfType(json, r'x2')!, + x3: mapValueOfType(json, r'x3')!, + x4: mapValueOfType(json, r'x4')!, + y1: mapValueOfType(json, r'y1')!, + y2: mapValueOfType(json, r'y2')!, + y3: mapValueOfType(json, r'y3')!, + y4: mapValueOfType(json, r'y4')!, ); } return null; diff --git a/mobile/openapi/lib/model/asset_response_dto.dart b/mobile/openapi/lib/model/asset_response_dto.dart index 7284c44580..61552ac8c2 100644 --- a/mobile/openapi/lib/model/asset_response_dto.dart +++ b/mobile/openapi/lib/model/asset_response_dto.dart @@ -255,17 +255,17 @@ class AssetResponseDto { if (this.duplicateId != null) { json[r'duplicateId'] = this.duplicateId; } else { - // json[r'duplicateId'] = null; + json[r'duplicateId'] = null; } if (this.duration != null) { json[r'duration'] = this.duration; } else { - // json[r'duration'] = null; + json[r'duration'] = null; } if (this.exifInfo != null) { json[r'exifInfo'] = this.exifInfo; } else { - // json[r'exifInfo'] = null; + json[r'exifInfo'] = null; } json[r'fileCreatedAt'] = this.fileCreatedAt.toUtc().toIso8601String(); json[r'fileModifiedAt'] = this.fileModifiedAt.toUtc().toIso8601String(); @@ -273,7 +273,7 @@ class AssetResponseDto { if (this.height != null) { json[r'height'] = this.height; } else { - // json[r'height'] = null; + json[r'height'] = null; } json[r'id'] = this.id; json[r'isArchived'] = this.isArchived; @@ -284,43 +284,43 @@ class AssetResponseDto { if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.livePhotoVideoId != null) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - // json[r'livePhotoVideoId'] = null; + json[r'livePhotoVideoId'] = null; } json[r'localDateTime'] = this.localDateTime.toUtc().toIso8601String(); json[r'originalFileName'] = this.originalFileName; if (this.originalMimeType != null) { json[r'originalMimeType'] = this.originalMimeType; } else { - // json[r'originalMimeType'] = null; + json[r'originalMimeType'] = null; } json[r'originalPath'] = this.originalPath; if (this.owner != null) { json[r'owner'] = this.owner; } else { - // json[r'owner'] = null; + json[r'owner'] = null; } json[r'ownerId'] = this.ownerId; json[r'people'] = this.people; if (this.resized != null) { json[r'resized'] = this.resized; } else { - // json[r'resized'] = null; + json[r'resized'] = null; } if (this.stack != null) { json[r'stack'] = this.stack; } else { - // json[r'stack'] = null; + json[r'stack'] = null; } json[r'tags'] = this.tags; if (this.thumbhash != null) { json[r'thumbhash'] = this.thumbhash; } else { - // json[r'thumbhash'] = null; + json[r'thumbhash'] = null; } json[r'type'] = this.type; json[r'unassignedFaces'] = this.unassignedFaces; @@ -329,7 +329,7 @@ class AssetResponseDto { if (this.width != null) { json[r'width'] = this.width; } else { - // json[r'width'] = null; + json[r'width'] = null; } return json; } @@ -338,10 +338,56 @@ class AssetResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'checksum'), 'Required key "AssetResponseDto[checksum]" is missing from JSON.'); + assert(json[r'checksum'] != null, 'Required key "AssetResponseDto[checksum]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "AssetResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "AssetResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'duration'), 'Required key "AssetResponseDto[duration]" is missing from JSON.'); + assert(json.containsKey(r'fileCreatedAt'), 'Required key "AssetResponseDto[fileCreatedAt]" is missing from JSON.'); + assert(json[r'fileCreatedAt'] != null, 'Required key "AssetResponseDto[fileCreatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'fileModifiedAt'), 'Required key "AssetResponseDto[fileModifiedAt]" is missing from JSON.'); + assert(json[r'fileModifiedAt'] != null, 'Required key "AssetResponseDto[fileModifiedAt]" has a null value in JSON.'); + assert(json.containsKey(r'hasMetadata'), 'Required key "AssetResponseDto[hasMetadata]" is missing from JSON.'); + assert(json[r'hasMetadata'] != null, 'Required key "AssetResponseDto[hasMetadata]" has a null value in JSON.'); + assert(json.containsKey(r'height'), 'Required key "AssetResponseDto[height]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isArchived'), 'Required key "AssetResponseDto[isArchived]" is missing from JSON.'); + assert(json[r'isArchived'] != null, 'Required key "AssetResponseDto[isArchived]" has a null value in JSON.'); + assert(json.containsKey(r'isEdited'), 'Required key "AssetResponseDto[isEdited]" is missing from JSON.'); + assert(json[r'isEdited'] != null, 'Required key "AssetResponseDto[isEdited]" has a null value in JSON.'); + assert(json.containsKey(r'isFavorite'), 'Required key "AssetResponseDto[isFavorite]" is missing from JSON.'); + assert(json[r'isFavorite'] != null, 'Required key "AssetResponseDto[isFavorite]" has a null value in JSON.'); + assert(json.containsKey(r'isOffline'), 'Required key "AssetResponseDto[isOffline]" is missing from JSON.'); + assert(json[r'isOffline'] != null, 'Required key "AssetResponseDto[isOffline]" has a null value in JSON.'); + assert(json.containsKey(r'isTrashed'), 'Required key "AssetResponseDto[isTrashed]" is missing from JSON.'); + assert(json[r'isTrashed'] != null, 'Required key "AssetResponseDto[isTrashed]" has a null value in JSON.'); + assert(json.containsKey(r'localDateTime'), 'Required key "AssetResponseDto[localDateTime]" is missing from JSON.'); + assert(json[r'localDateTime'] != null, 'Required key "AssetResponseDto[localDateTime]" has a null value in JSON.'); + assert(json.containsKey(r'originalFileName'), 'Required key "AssetResponseDto[originalFileName]" is missing from JSON.'); + assert(json[r'originalFileName'] != null, 'Required key "AssetResponseDto[originalFileName]" has a null value in JSON.'); + assert(json.containsKey(r'originalPath'), 'Required key "AssetResponseDto[originalPath]" is missing from JSON.'); + assert(json[r'originalPath'] != null, 'Required key "AssetResponseDto[originalPath]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "AssetResponseDto[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "AssetResponseDto[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'thumbhash'), 'Required key "AssetResponseDto[thumbhash]" is missing from JSON.'); + assert(json.containsKey(r'type'), 'Required key "AssetResponseDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "AssetResponseDto[type]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "AssetResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "AssetResponseDto[updatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'visibility'), 'Required key "AssetResponseDto[visibility]" is missing from JSON.'); + assert(json[r'visibility'] != null, 'Required key "AssetResponseDto[visibility]" has a null value in JSON.'); + assert(json.containsKey(r'width'), 'Required key "AssetResponseDto[width]" is missing from JSON.'); + return true; + }()); + return AssetResponseDto( checksum: mapValueOfType(json, r'checksum')!, createdAt: mapDateTime(json, r'createdAt', r'')!, diff --git a/mobile/openapi/lib/model/asset_stack_response_dto.dart b/mobile/openapi/lib/model/asset_stack_response_dto.dart index 96fd66a392..e3772f15f3 100644 --- a/mobile/openapi/lib/model/asset_stack_response_dto.dart +++ b/mobile/openapi/lib/model/asset_stack_response_dto.dart @@ -58,10 +58,22 @@ class AssetStackResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetStackResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetStackResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetCount'), 'Required key "AssetStackResponseDto[assetCount]" is missing from JSON.'); + assert(json[r'assetCount'] != null, 'Required key "AssetStackResponseDto[assetCount]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "AssetStackResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "AssetStackResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'primaryAssetId'), 'Required key "AssetStackResponseDto[primaryAssetId]" is missing from JSON.'); + assert(json[r'primaryAssetId'] != null, 'Required key "AssetStackResponseDto[primaryAssetId]" has a null value in JSON.'); + return true; + }()); + return AssetStackResponseDto( assetCount: mapValueOfType(json, r'assetCount')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/asset_stats_response_dto.dart b/mobile/openapi/lib/model/asset_stats_response_dto.dart index df2762a2f3..68171c4ae2 100644 --- a/mobile/openapi/lib/model/asset_stats_response_dto.dart +++ b/mobile/openapi/lib/model/asset_stats_response_dto.dart @@ -64,10 +64,22 @@ class AssetStatsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AssetStatsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetStatsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'images'), 'Required key "AssetStatsResponseDto[images]" is missing from JSON.'); + assert(json[r'images'] != null, 'Required key "AssetStatsResponseDto[images]" has a null value in JSON.'); + assert(json.containsKey(r'total'), 'Required key "AssetStatsResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "AssetStatsResponseDto[total]" has a null value in JSON.'); + assert(json.containsKey(r'videos'), 'Required key "AssetStatsResponseDto[videos]" is missing from JSON.'); + assert(json[r'videos'] != null, 'Required key "AssetStatsResponseDto[videos]" has a null value in JSON.'); + return true; + }()); + return AssetStatsResponseDto( images: mapValueOfType(json, r'images')!, total: mapValueOfType(json, r'total')!, diff --git a/mobile/openapi/lib/model/auth_status_response_dto.dart b/mobile/openapi/lib/model/auth_status_response_dto.dart index 23b9d40525..03424dddca 100644 --- a/mobile/openapi/lib/model/auth_status_response_dto.dart +++ b/mobile/openapi/lib/model/auth_status_response_dto.dart @@ -72,7 +72,7 @@ class AuthStatusResponseDto { if (this.expiresAt != null) { json[r'expiresAt'] = this.expiresAt; } else { - // json[r'expiresAt'] = null; + json[r'expiresAt'] = null; } json[r'isElevated'] = this.isElevated; json[r'password'] = this.password; @@ -80,7 +80,7 @@ class AuthStatusResponseDto { if (this.pinExpiresAt != null) { json[r'pinExpiresAt'] = this.pinExpiresAt; } else { - // json[r'pinExpiresAt'] = null; + json[r'pinExpiresAt'] = null; } return json; } @@ -89,10 +89,22 @@ class AuthStatusResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AuthStatusResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AuthStatusResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'isElevated'), 'Required key "AuthStatusResponseDto[isElevated]" is missing from JSON.'); + assert(json[r'isElevated'] != null, 'Required key "AuthStatusResponseDto[isElevated]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "AuthStatusResponseDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "AuthStatusResponseDto[password]" has a null value in JSON.'); + assert(json.containsKey(r'pinCode'), 'Required key "AuthStatusResponseDto[pinCode]" is missing from JSON.'); + assert(json[r'pinCode'] != null, 'Required key "AuthStatusResponseDto[pinCode]" has a null value in JSON.'); + return true; + }()); + return AuthStatusResponseDto( expiresAt: mapValueOfType(json, r'expiresAt'), isElevated: mapValueOfType(json, r'isElevated')!, diff --git a/mobile/openapi/lib/model/avatar_update.dart b/mobile/openapi/lib/model/avatar_update.dart index 875eb138a8..8031aa8539 100644 --- a/mobile/openapi/lib/model/avatar_update.dart +++ b/mobile/openapi/lib/model/avatar_update.dart @@ -41,7 +41,7 @@ class AvatarUpdate { if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } return json; } @@ -50,10 +50,16 @@ class AvatarUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static AvatarUpdate? fromJson(dynamic value) { - upgradeDto(value, "AvatarUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return AvatarUpdate( color: UserAvatarColor.fromJson(json[r'color']), ); diff --git a/mobile/openapi/lib/model/bulk_id_response_dto.dart b/mobile/openapi/lib/model/bulk_id_response_dto.dart index bb3f1d8856..8b394dce35 100644 --- a/mobile/openapi/lib/model/bulk_id_response_dto.dart +++ b/mobile/openapi/lib/model/bulk_id_response_dto.dart @@ -64,12 +64,12 @@ class BulkIdResponseDto { if (this.error != null) { json[r'error'] = this.error; } else { - // json[r'error'] = null; + json[r'error'] = null; } if (this.errorMessage != null) { json[r'errorMessage'] = this.errorMessage; } else { - // json[r'errorMessage'] = null; + json[r'errorMessage'] = null; } json[r'id'] = this.id; json[r'success'] = this.success; @@ -80,10 +80,20 @@ class BulkIdResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static BulkIdResponseDto? fromJson(dynamic value) { - upgradeDto(value, "BulkIdResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'id'), 'Required key "BulkIdResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "BulkIdResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'success'), 'Required key "BulkIdResponseDto[success]" is missing from JSON.'); + assert(json[r'success'] != null, 'Required key "BulkIdResponseDto[success]" has a null value in JSON.'); + return true; + }()); + return BulkIdResponseDto( error: BulkIdErrorReason.fromJson(json[r'error']), errorMessage: mapValueOfType(json, r'errorMessage'), diff --git a/mobile/openapi/lib/model/bulk_ids_dto.dart b/mobile/openapi/lib/model/bulk_ids_dto.dart index 7e7864a285..47443fa260 100644 --- a/mobile/openapi/lib/model/bulk_ids_dto.dart +++ b/mobile/openapi/lib/model/bulk_ids_dto.dart @@ -41,10 +41,18 @@ class BulkIdsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static BulkIdsDto? fromJson(dynamic value) { - upgradeDto(value, "BulkIdsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ids'), 'Required key "BulkIdsDto[ids]" is missing from JSON.'); + assert(json[r'ids'] != null, 'Required key "BulkIdsDto[ids]" has a null value in JSON.'); + return true; + }()); + return BulkIdsDto( ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/cast_response.dart b/mobile/openapi/lib/model/cast_response.dart index 796138b0bf..05ff40817a 100644 --- a/mobile/openapi/lib/model/cast_response.dart +++ b/mobile/openapi/lib/model/cast_response.dart @@ -41,10 +41,18 @@ class CastResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CastResponse? fromJson(dynamic value) { - upgradeDto(value, "CastResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'gCastEnabled'), 'Required key "CastResponse[gCastEnabled]" is missing from JSON.'); + assert(json[r'gCastEnabled'] != null, 'Required key "CastResponse[gCastEnabled]" has a null value in JSON.'); + return true; + }()); + return CastResponse( gCastEnabled: mapValueOfType(json, r'gCastEnabled')!, ); diff --git a/mobile/openapi/lib/model/cast_update.dart b/mobile/openapi/lib/model/cast_update.dart index 8dbf80f171..85354a23ea 100644 --- a/mobile/openapi/lib/model/cast_update.dart +++ b/mobile/openapi/lib/model/cast_update.dart @@ -42,7 +42,7 @@ class CastUpdate { if (this.gCastEnabled != null) { json[r'gCastEnabled'] = this.gCastEnabled; } else { - // json[r'gCastEnabled'] = null; + json[r'gCastEnabled'] = null; } return json; } @@ -51,10 +51,16 @@ class CastUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CastUpdate? fromJson(dynamic value) { - upgradeDto(value, "CastUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return CastUpdate( gCastEnabled: mapValueOfType(json, r'gCastEnabled'), ); diff --git a/mobile/openapi/lib/model/change_password_dto.dart b/mobile/openapi/lib/model/change_password_dto.dart index 3dd6e437da..680b7601df 100644 --- a/mobile/openapi/lib/model/change_password_dto.dart +++ b/mobile/openapi/lib/model/change_password_dto.dart @@ -55,10 +55,20 @@ class ChangePasswordDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ChangePasswordDto? fromJson(dynamic value) { - upgradeDto(value, "ChangePasswordDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'newPassword'), 'Required key "ChangePasswordDto[newPassword]" is missing from JSON.'); + assert(json[r'newPassword'] != null, 'Required key "ChangePasswordDto[newPassword]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "ChangePasswordDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "ChangePasswordDto[password]" has a null value in JSON.'); + return true; + }()); + return ChangePasswordDto( invalidateSessions: mapValueOfType(json, r'invalidateSessions') ?? false, newPassword: mapValueOfType(json, r'newPassword')!, diff --git a/mobile/openapi/lib/model/clip_config.dart b/mobile/openapi/lib/model/clip_config.dart index 915e4975ed..1d0196e855 100644 --- a/mobile/openapi/lib/model/clip_config.dart +++ b/mobile/openapi/lib/model/clip_config.dart @@ -48,10 +48,20 @@ class CLIPConfig { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CLIPConfig? fromJson(dynamic value) { - upgradeDto(value, "CLIPConfig"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "CLIPConfig[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "CLIPConfig[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'modelName'), 'Required key "CLIPConfig[modelName]" is missing from JSON.'); + assert(json[r'modelName'] != null, 'Required key "CLIPConfig[modelName]" has a null value in JSON.'); + return true; + }()); + return CLIPConfig( enabled: mapValueOfType(json, r'enabled')!, modelName: mapValueOfType(json, r'modelName')!, diff --git a/mobile/openapi/lib/model/contributor_count_response_dto.dart b/mobile/openapi/lib/model/contributor_count_response_dto.dart index af5b2cbf68..e8ce8e3976 100644 --- a/mobile/openapi/lib/model/contributor_count_response_dto.dart +++ b/mobile/openapi/lib/model/contributor_count_response_dto.dart @@ -51,10 +51,20 @@ class ContributorCountResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ContributorCountResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ContributorCountResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetCount'), 'Required key "ContributorCountResponseDto[assetCount]" is missing from JSON.'); + assert(json[r'assetCount'] != null, 'Required key "ContributorCountResponseDto[assetCount]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "ContributorCountResponseDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "ContributorCountResponseDto[userId]" has a null value in JSON.'); + return true; + }()); + return ContributorCountResponseDto( assetCount: mapValueOfType(json, r'assetCount')!, userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/create_album_dto.dart b/mobile/openapi/lib/model/create_album_dto.dart index 183a41c772..cb096b67ca 100644 --- a/mobile/openapi/lib/model/create_album_dto.dart +++ b/mobile/openapi/lib/model/create_album_dto.dart @@ -63,7 +63,7 @@ class CreateAlbumDto { if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } return json; } @@ -72,10 +72,18 @@ class CreateAlbumDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CreateAlbumDto? fromJson(dynamic value) { - upgradeDto(value, "CreateAlbumDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumName'), 'Required key "CreateAlbumDto[albumName]" is missing from JSON.'); + assert(json[r'albumName'] != null, 'Required key "CreateAlbumDto[albumName]" has a null value in JSON.'); + return true; + }()); + return CreateAlbumDto( albumName: mapValueOfType(json, r'albumName')!, albumUsers: AlbumUserCreateDto.listFromJson(json[r'albumUsers']), diff --git a/mobile/openapi/lib/model/create_library_dto.dart b/mobile/openapi/lib/model/create_library_dto.dart index ba12c62d76..c4579d9228 100644 --- a/mobile/openapi/lib/model/create_library_dto.dart +++ b/mobile/openapi/lib/model/create_library_dto.dart @@ -62,7 +62,7 @@ class CreateLibraryDto { if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } json[r'ownerId'] = this.ownerId; return json; @@ -72,10 +72,18 @@ class CreateLibraryDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CreateLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "CreateLibraryDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ownerId'), 'Required key "CreateLibraryDto[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "CreateLibraryDto[ownerId]" has a null value in JSON.'); + return true; + }()); + return CreateLibraryDto( exclusionPatterns: json[r'exclusionPatterns'] is Iterable ? (json[r'exclusionPatterns'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/create_profile_image_response_dto.dart b/mobile/openapi/lib/model/create_profile_image_response_dto.dart index c6ec0d94a0..41796343d3 100644 --- a/mobile/openapi/lib/model/create_profile_image_response_dto.dart +++ b/mobile/openapi/lib/model/create_profile_image_response_dto.dart @@ -57,10 +57,22 @@ class CreateProfileImageResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CreateProfileImageResponseDto? fromJson(dynamic value) { - upgradeDto(value, "CreateProfileImageResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'profileChangedAt'), 'Required key "CreateProfileImageResponseDto[profileChangedAt]" is missing from JSON.'); + assert(json[r'profileChangedAt'] != null, 'Required key "CreateProfileImageResponseDto[profileChangedAt]" has a null value in JSON.'); + assert(json.containsKey(r'profileImagePath'), 'Required key "CreateProfileImageResponseDto[profileImagePath]" is missing from JSON.'); + assert(json[r'profileImagePath'] != null, 'Required key "CreateProfileImageResponseDto[profileImagePath]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "CreateProfileImageResponseDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "CreateProfileImageResponseDto[userId]" has a null value in JSON.'); + return true; + }()); + return CreateProfileImageResponseDto( profileChangedAt: mapDateTime(json, r'profileChangedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, profileImagePath: mapValueOfType(json, r'profileImagePath')!, diff --git a/mobile/openapi/lib/model/crop_parameters.dart b/mobile/openapi/lib/model/crop_parameters.dart index d19c23562b..aed1ce81e5 100644 --- a/mobile/openapi/lib/model/crop_parameters.dart +++ b/mobile/openapi/lib/model/crop_parameters.dart @@ -74,10 +74,24 @@ class CropParameters { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static CropParameters? fromJson(dynamic value) { - upgradeDto(value, "CropParameters"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'height'), 'Required key "CropParameters[height]" is missing from JSON.'); + assert(json[r'height'] != null, 'Required key "CropParameters[height]" has a null value in JSON.'); + assert(json.containsKey(r'width'), 'Required key "CropParameters[width]" is missing from JSON.'); + assert(json[r'width'] != null, 'Required key "CropParameters[width]" has a null value in JSON.'); + assert(json.containsKey(r'x'), 'Required key "CropParameters[x]" is missing from JSON.'); + assert(json[r'x'] != null, 'Required key "CropParameters[x]" has a null value in JSON.'); + assert(json.containsKey(r'y'), 'Required key "CropParameters[y]" is missing from JSON.'); + assert(json[r'y'] != null, 'Required key "CropParameters[y]" has a null value in JSON.'); + return true; + }()); + return CropParameters( height: mapValueOfType(json, r'height')!, width: mapValueOfType(json, r'width')!, diff --git a/mobile/openapi/lib/model/database_backup_config.dart b/mobile/openapi/lib/model/database_backup_config.dart index 4beb32849e..1d46b395ff 100644 --- a/mobile/openapi/lib/model/database_backup_config.dart +++ b/mobile/openapi/lib/model/database_backup_config.dart @@ -58,10 +58,22 @@ class DatabaseBackupConfig { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DatabaseBackupConfig? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupConfig"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'cronExpression'), 'Required key "DatabaseBackupConfig[cronExpression]" is missing from JSON.'); + assert(json[r'cronExpression'] != null, 'Required key "DatabaseBackupConfig[cronExpression]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "DatabaseBackupConfig[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "DatabaseBackupConfig[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'keepLastAmount'), 'Required key "DatabaseBackupConfig[keepLastAmount]" is missing from JSON.'); + assert(json[r'keepLastAmount'] != null, 'Required key "DatabaseBackupConfig[keepLastAmount]" has a null value in JSON.'); + return true; + }()); + return DatabaseBackupConfig( cronExpression: mapValueOfType(json, r'cronExpression')!, enabled: mapValueOfType(json, r'enabled')!, diff --git a/mobile/openapi/lib/model/database_backup_delete_dto.dart b/mobile/openapi/lib/model/database_backup_delete_dto.dart index c336270b84..0490bd0670 100644 --- a/mobile/openapi/lib/model/database_backup_delete_dto.dart +++ b/mobile/openapi/lib/model/database_backup_delete_dto.dart @@ -41,10 +41,18 @@ class DatabaseBackupDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DatabaseBackupDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'backups'), 'Required key "DatabaseBackupDeleteDto[backups]" is missing from JSON.'); + assert(json[r'backups'] != null, 'Required key "DatabaseBackupDeleteDto[backups]" has a null value in JSON.'); + return true; + }()); + return DatabaseBackupDeleteDto( backups: json[r'backups'] is Iterable ? (json[r'backups'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/database_backup_dto.dart b/mobile/openapi/lib/model/database_backup_dto.dart index 5a2590da40..43fc8dcb31 100644 --- a/mobile/openapi/lib/model/database_backup_dto.dart +++ b/mobile/openapi/lib/model/database_backup_dto.dart @@ -58,10 +58,22 @@ class DatabaseBackupDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DatabaseBackupDto? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'filename'), 'Required key "DatabaseBackupDto[filename]" is missing from JSON.'); + assert(json[r'filename'] != null, 'Required key "DatabaseBackupDto[filename]" has a null value in JSON.'); + assert(json.containsKey(r'filesize'), 'Required key "DatabaseBackupDto[filesize]" is missing from JSON.'); + assert(json[r'filesize'] != null, 'Required key "DatabaseBackupDto[filesize]" has a null value in JSON.'); + assert(json.containsKey(r'timezone'), 'Required key "DatabaseBackupDto[timezone]" is missing from JSON.'); + assert(json[r'timezone'] != null, 'Required key "DatabaseBackupDto[timezone]" has a null value in JSON.'); + return true; + }()); + return DatabaseBackupDto( filename: mapValueOfType(json, r'filename')!, filesize: mapValueOfType(json, r'filesize')!, diff --git a/mobile/openapi/lib/model/database_backup_list_response_dto.dart b/mobile/openapi/lib/model/database_backup_list_response_dto.dart index de7bf78d5a..21c19f540d 100644 --- a/mobile/openapi/lib/model/database_backup_list_response_dto.dart +++ b/mobile/openapi/lib/model/database_backup_list_response_dto.dart @@ -41,10 +41,18 @@ class DatabaseBackupListResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DatabaseBackupListResponseDto? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupListResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'backups'), 'Required key "DatabaseBackupListResponseDto[backups]" is missing from JSON.'); + assert(json[r'backups'] != null, 'Required key "DatabaseBackupListResponseDto[backups]" has a null value in JSON.'); + return true; + }()); + return DatabaseBackupListResponseDto( backups: DatabaseBackupDto.listFromJson(json[r'backups']), ); diff --git a/mobile/openapi/lib/model/download_archive_dto.dart b/mobile/openapi/lib/model/download_archive_dto.dart index 20e8527f18..1ff97a9e4b 100644 --- a/mobile/openapi/lib/model/download_archive_dto.dart +++ b/mobile/openapi/lib/model/download_archive_dto.dart @@ -49,7 +49,7 @@ class DownloadArchiveDto { if (this.edited != null) { json[r'edited'] = this.edited; } else { - // json[r'edited'] = null; + json[r'edited'] = null; } return json; } @@ -58,10 +58,18 @@ class DownloadArchiveDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DownloadArchiveDto? fromJson(dynamic value) { - upgradeDto(value, "DownloadArchiveDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetIds'), 'Required key "DownloadArchiveDto[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "DownloadArchiveDto[assetIds]" has a null value in JSON.'); + return true; + }()); + return DownloadArchiveDto( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/download_archive_info.dart b/mobile/openapi/lib/model/download_archive_info.dart index dcb1258457..908843736b 100644 --- a/mobile/openapi/lib/model/download_archive_info.dart +++ b/mobile/openapi/lib/model/download_archive_info.dart @@ -51,10 +51,20 @@ class DownloadArchiveInfo { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DownloadArchiveInfo? fromJson(dynamic value) { - upgradeDto(value, "DownloadArchiveInfo"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetIds'), 'Required key "DownloadArchiveInfo[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "DownloadArchiveInfo[assetIds]" has a null value in JSON.'); + assert(json.containsKey(r'size'), 'Required key "DownloadArchiveInfo[size]" is missing from JSON.'); + assert(json[r'size'] != null, 'Required key "DownloadArchiveInfo[size]" has a null value in JSON.'); + return true; + }()); + return DownloadArchiveInfo( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/download_info_dto.dart b/mobile/openapi/lib/model/download_info_dto.dart index 8a0cebd945..1b672b415a 100644 --- a/mobile/openapi/lib/model/download_info_dto.dart +++ b/mobile/openapi/lib/model/download_info_dto.dart @@ -75,18 +75,18 @@ class DownloadInfoDto { if (this.albumId != null) { json[r'albumId'] = this.albumId; } else { - // json[r'albumId'] = null; + json[r'albumId'] = null; } if (this.archiveSize != null) { json[r'archiveSize'] = this.archiveSize; } else { - // json[r'archiveSize'] = null; + json[r'archiveSize'] = null; } json[r'assetIds'] = this.assetIds; if (this.userId != null) { json[r'userId'] = this.userId; } else { - // json[r'userId'] = null; + json[r'userId'] = null; } return json; } @@ -95,10 +95,16 @@ class DownloadInfoDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DownloadInfoDto? fromJson(dynamic value) { - upgradeDto(value, "DownloadInfoDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return DownloadInfoDto( albumId: mapValueOfType(json, r'albumId'), archiveSize: mapValueOfType(json, r'archiveSize'), diff --git a/mobile/openapi/lib/model/download_response.dart b/mobile/openapi/lib/model/download_response.dart index bc1d7b4047..f0da3c7875 100644 --- a/mobile/openapi/lib/model/download_response.dart +++ b/mobile/openapi/lib/model/download_response.dart @@ -51,10 +51,20 @@ class DownloadResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DownloadResponse? fromJson(dynamic value) { - upgradeDto(value, "DownloadResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'archiveSize'), 'Required key "DownloadResponse[archiveSize]" is missing from JSON.'); + assert(json[r'archiveSize'] != null, 'Required key "DownloadResponse[archiveSize]" has a null value in JSON.'); + assert(json.containsKey(r'includeEmbeddedVideos'), 'Required key "DownloadResponse[includeEmbeddedVideos]" is missing from JSON.'); + assert(json[r'includeEmbeddedVideos'] != null, 'Required key "DownloadResponse[includeEmbeddedVideos]" has a null value in JSON.'); + return true; + }()); + return DownloadResponse( archiveSize: mapValueOfType(json, r'archiveSize')!, includeEmbeddedVideos: mapValueOfType(json, r'includeEmbeddedVideos')!, diff --git a/mobile/openapi/lib/model/download_response_dto.dart b/mobile/openapi/lib/model/download_response_dto.dart index bfe32307fa..aef20448a1 100644 --- a/mobile/openapi/lib/model/download_response_dto.dart +++ b/mobile/openapi/lib/model/download_response_dto.dart @@ -51,10 +51,20 @@ class DownloadResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DownloadResponseDto? fromJson(dynamic value) { - upgradeDto(value, "DownloadResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'archives'), 'Required key "DownloadResponseDto[archives]" is missing from JSON.'); + assert(json[r'archives'] != null, 'Required key "DownloadResponseDto[archives]" has a null value in JSON.'); + assert(json.containsKey(r'totalSize'), 'Required key "DownloadResponseDto[totalSize]" is missing from JSON.'); + assert(json[r'totalSize'] != null, 'Required key "DownloadResponseDto[totalSize]" has a null value in JSON.'); + return true; + }()); + return DownloadResponseDto( archives: DownloadArchiveInfo.listFromJson(json[r'archives']), totalSize: mapValueOfType(json, r'totalSize')!, diff --git a/mobile/openapi/lib/model/download_update.dart b/mobile/openapi/lib/model/download_update.dart index c5feb9df43..91a5886d2d 100644 --- a/mobile/openapi/lib/model/download_update.dart +++ b/mobile/openapi/lib/model/download_update.dart @@ -57,12 +57,12 @@ class DownloadUpdate { if (this.archiveSize != null) { json[r'archiveSize'] = this.archiveSize; } else { - // json[r'archiveSize'] = null; + json[r'archiveSize'] = null; } if (this.includeEmbeddedVideos != null) { json[r'includeEmbeddedVideos'] = this.includeEmbeddedVideos; } else { - // json[r'includeEmbeddedVideos'] = null; + json[r'includeEmbeddedVideos'] = null; } return json; } @@ -71,10 +71,16 @@ class DownloadUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DownloadUpdate? fromJson(dynamic value) { - upgradeDto(value, "DownloadUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return DownloadUpdate( archiveSize: mapValueOfType(json, r'archiveSize'), includeEmbeddedVideos: mapValueOfType(json, r'includeEmbeddedVideos'), diff --git a/mobile/openapi/lib/model/duplicate_detection_config.dart b/mobile/openapi/lib/model/duplicate_detection_config.dart index 43233826ef..affb84d78c 100644 --- a/mobile/openapi/lib/model/duplicate_detection_config.dart +++ b/mobile/openapi/lib/model/duplicate_detection_config.dart @@ -51,13 +51,23 @@ class DuplicateDetectionConfig { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DuplicateDetectionConfig? fromJson(dynamic value) { - upgradeDto(value, "DuplicateDetectionConfig"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "DuplicateDetectionConfig[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "DuplicateDetectionConfig[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'maxDistance'), 'Required key "DuplicateDetectionConfig[maxDistance]" is missing from JSON.'); + assert(json[r'maxDistance'] != null, 'Required key "DuplicateDetectionConfig[maxDistance]" has a null value in JSON.'); + return true; + }()); + return DuplicateDetectionConfig( enabled: mapValueOfType(json, r'enabled')!, - maxDistance: (mapValueOfType(json, r'maxDistance')!).toDouble(), + maxDistance: mapValueOfType(json, r'maxDistance')!, ); } return null; diff --git a/mobile/openapi/lib/model/duplicate_resolve_dto.dart b/mobile/openapi/lib/model/duplicate_resolve_dto.dart index 3466d3a620..5cf3c2c144 100644 --- a/mobile/openapi/lib/model/duplicate_resolve_dto.dart +++ b/mobile/openapi/lib/model/duplicate_resolve_dto.dart @@ -41,10 +41,18 @@ class DuplicateResolveDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DuplicateResolveDto? fromJson(dynamic value) { - upgradeDto(value, "DuplicateResolveDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'groups'), 'Required key "DuplicateResolveDto[groups]" is missing from JSON.'); + assert(json[r'groups'] != null, 'Required key "DuplicateResolveDto[groups]" has a null value in JSON.'); + return true; + }()); + return DuplicateResolveDto( groups: DuplicateResolveGroupDto.listFromJson(json[r'groups']), ); diff --git a/mobile/openapi/lib/model/duplicate_resolve_group_dto.dart b/mobile/openapi/lib/model/duplicate_resolve_group_dto.dart index 94ca53eb7d..16623ff593 100644 --- a/mobile/openapi/lib/model/duplicate_resolve_group_dto.dart +++ b/mobile/openapi/lib/model/duplicate_resolve_group_dto.dart @@ -54,10 +54,22 @@ class DuplicateResolveGroupDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DuplicateResolveGroupDto? fromJson(dynamic value) { - upgradeDto(value, "DuplicateResolveGroupDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'duplicateId'), 'Required key "DuplicateResolveGroupDto[duplicateId]" is missing from JSON.'); + assert(json[r'duplicateId'] != null, 'Required key "DuplicateResolveGroupDto[duplicateId]" has a null value in JSON.'); + assert(json.containsKey(r'keepAssetIds'), 'Required key "DuplicateResolveGroupDto[keepAssetIds]" is missing from JSON.'); + assert(json[r'keepAssetIds'] != null, 'Required key "DuplicateResolveGroupDto[keepAssetIds]" has a null value in JSON.'); + assert(json.containsKey(r'trashAssetIds'), 'Required key "DuplicateResolveGroupDto[trashAssetIds]" is missing from JSON.'); + assert(json[r'trashAssetIds'] != null, 'Required key "DuplicateResolveGroupDto[trashAssetIds]" has a null value in JSON.'); + return true; + }()); + return DuplicateResolveGroupDto( duplicateId: mapValueOfType(json, r'duplicateId')!, keepAssetIds: json[r'keepAssetIds'] is Iterable diff --git a/mobile/openapi/lib/model/duplicate_response_dto.dart b/mobile/openapi/lib/model/duplicate_response_dto.dart index f0ddbb4fdd..63ec655bba 100644 --- a/mobile/openapi/lib/model/duplicate_response_dto.dart +++ b/mobile/openapi/lib/model/duplicate_response_dto.dart @@ -55,10 +55,22 @@ class DuplicateResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static DuplicateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "DuplicateResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assets'), 'Required key "DuplicateResponseDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "DuplicateResponseDto[assets]" has a null value in JSON.'); + assert(json.containsKey(r'duplicateId'), 'Required key "DuplicateResponseDto[duplicateId]" is missing from JSON.'); + assert(json[r'duplicateId'] != null, 'Required key "DuplicateResponseDto[duplicateId]" has a null value in JSON.'); + assert(json.containsKey(r'suggestedKeepAssetIds'), 'Required key "DuplicateResponseDto[suggestedKeepAssetIds]" is missing from JSON.'); + assert(json[r'suggestedKeepAssetIds'] != null, 'Required key "DuplicateResponseDto[suggestedKeepAssetIds]" has a null value in JSON.'); + return true; + }()); + return DuplicateResponseDto( assets: AssetResponseDto.listFromJson(json[r'assets']), duplicateId: mapValueOfType(json, r'duplicateId')!, diff --git a/mobile/openapi/lib/model/email_notifications_response.dart b/mobile/openapi/lib/model/email_notifications_response.dart index 08a3d580c6..ea59534476 100644 --- a/mobile/openapi/lib/model/email_notifications_response.dart +++ b/mobile/openapi/lib/model/email_notifications_response.dart @@ -55,10 +55,22 @@ class EmailNotificationsResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static EmailNotificationsResponse? fromJson(dynamic value) { - upgradeDto(value, "EmailNotificationsResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumInvite'), 'Required key "EmailNotificationsResponse[albumInvite]" is missing from JSON.'); + assert(json[r'albumInvite'] != null, 'Required key "EmailNotificationsResponse[albumInvite]" has a null value in JSON.'); + assert(json.containsKey(r'albumUpdate'), 'Required key "EmailNotificationsResponse[albumUpdate]" is missing from JSON.'); + assert(json[r'albumUpdate'] != null, 'Required key "EmailNotificationsResponse[albumUpdate]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "EmailNotificationsResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "EmailNotificationsResponse[enabled]" has a null value in JSON.'); + return true; + }()); + return EmailNotificationsResponse( albumInvite: mapValueOfType(json, r'albumInvite')!, albumUpdate: mapValueOfType(json, r'albumUpdate')!, diff --git a/mobile/openapi/lib/model/email_notifications_update.dart b/mobile/openapi/lib/model/email_notifications_update.dart index e158e45598..e04d7d8b4c 100644 --- a/mobile/openapi/lib/model/email_notifications_update.dart +++ b/mobile/openapi/lib/model/email_notifications_update.dart @@ -66,17 +66,17 @@ class EmailNotificationsUpdate { if (this.albumInvite != null) { json[r'albumInvite'] = this.albumInvite; } else { - // json[r'albumInvite'] = null; + json[r'albumInvite'] = null; } if (this.albumUpdate != null) { json[r'albumUpdate'] = this.albumUpdate; } else { - // json[r'albumUpdate'] = null; + json[r'albumUpdate'] = null; } if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } return json; } @@ -85,10 +85,16 @@ class EmailNotificationsUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static EmailNotificationsUpdate? fromJson(dynamic value) { - upgradeDto(value, "EmailNotificationsUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return EmailNotificationsUpdate( albumInvite: mapValueOfType(json, r'albumInvite'), albumUpdate: mapValueOfType(json, r'albumUpdate'), diff --git a/mobile/openapi/lib/model/exif_response_dto.dart b/mobile/openapi/lib/model/exif_response_dto.dart index ed5ffd2958..eaad295fa7 100644 --- a/mobile/openapi/lib/model/exif_response_dto.dart +++ b/mobile/openapi/lib/model/exif_response_dto.dart @@ -177,112 +177,112 @@ class ExifResponseDto { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.dateTimeOriginal != null) { json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String(); } else { - // json[r'dateTimeOriginal'] = null; + json[r'dateTimeOriginal'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.exifImageHeight != null) { json[r'exifImageHeight'] = this.exifImageHeight; } else { - // json[r'exifImageHeight'] = null; + json[r'exifImageHeight'] = null; } if (this.exifImageWidth != null) { json[r'exifImageWidth'] = this.exifImageWidth; } else { - // json[r'exifImageWidth'] = null; + json[r'exifImageWidth'] = null; } if (this.exposureTime != null) { json[r'exposureTime'] = this.exposureTime; } else { - // json[r'exposureTime'] = null; + json[r'exposureTime'] = null; } if (this.fNumber != null) { json[r'fNumber'] = this.fNumber; } else { - // json[r'fNumber'] = null; + json[r'fNumber'] = null; } if (this.fileSizeInByte != null) { json[r'fileSizeInByte'] = this.fileSizeInByte; } else { - // json[r'fileSizeInByte'] = null; + json[r'fileSizeInByte'] = null; } if (this.focalLength != null) { json[r'focalLength'] = this.focalLength; } else { - // json[r'focalLength'] = null; + json[r'focalLength'] = null; } if (this.iso != null) { json[r'iso'] = this.iso; } else { - // json[r'iso'] = null; + json[r'iso'] = null; } if (this.latitude != null) { json[r'latitude'] = this.latitude; } else { - // json[r'latitude'] = null; + json[r'latitude'] = null; } if (this.lensModel != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + json[r'lensModel'] = null; } if (this.longitude != null) { json[r'longitude'] = this.longitude; } else { - // json[r'longitude'] = null; + json[r'longitude'] = null; } if (this.make != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + json[r'make'] = null; } if (this.model != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + json[r'model'] = null; } if (this.modifyDate != null) { json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String(); } else { - // json[r'modifyDate'] = null; + json[r'modifyDate'] = null; } if (this.orientation != null) { json[r'orientation'] = this.orientation; } else { - // json[r'orientation'] = null; + json[r'orientation'] = null; } if (this.projectionType != null) { json[r'projectionType'] = this.projectionType; } else { - // json[r'projectionType'] = null; + json[r'projectionType'] = null; } if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } if (this.timeZone != null) { json[r'timeZone'] = this.timeZone; } else { - // json[r'timeZone'] = null; + json[r'timeZone'] = null; } return json; } @@ -291,10 +291,16 @@ class ExifResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ExifResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ExifResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return ExifResponseDto( city: mapValueOfType(json, r'city'), country: mapValueOfType(json, r'country'), diff --git a/mobile/openapi/lib/model/face_dto.dart b/mobile/openapi/lib/model/face_dto.dart index ec5f5c8a6c..694b7ad24c 100644 --- a/mobile/openapi/lib/model/face_dto.dart +++ b/mobile/openapi/lib/model/face_dto.dart @@ -41,10 +41,18 @@ class FaceDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static FaceDto? fromJson(dynamic value) { - upgradeDto(value, "FaceDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'id'), 'Required key "FaceDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "FaceDto[id]" has a null value in JSON.'); + return true; + }()); + return FaceDto( id: mapValueOfType(json, r'id')!, ); diff --git a/mobile/openapi/lib/model/facial_recognition_config.dart b/mobile/openapi/lib/model/facial_recognition_config.dart index 66cb542ccf..fca6e5a519 100644 --- a/mobile/openapi/lib/model/facial_recognition_config.dart +++ b/mobile/openapi/lib/model/facial_recognition_config.dart @@ -78,15 +78,31 @@ class FacialRecognitionConfig { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static FacialRecognitionConfig? fromJson(dynamic value) { - upgradeDto(value, "FacialRecognitionConfig"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "FacialRecognitionConfig[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "FacialRecognitionConfig[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'maxDistance'), 'Required key "FacialRecognitionConfig[maxDistance]" is missing from JSON.'); + assert(json[r'maxDistance'] != null, 'Required key "FacialRecognitionConfig[maxDistance]" has a null value in JSON.'); + assert(json.containsKey(r'minFaces'), 'Required key "FacialRecognitionConfig[minFaces]" is missing from JSON.'); + assert(json[r'minFaces'] != null, 'Required key "FacialRecognitionConfig[minFaces]" has a null value in JSON.'); + assert(json.containsKey(r'minScore'), 'Required key "FacialRecognitionConfig[minScore]" is missing from JSON.'); + assert(json[r'minScore'] != null, 'Required key "FacialRecognitionConfig[minScore]" has a null value in JSON.'); + assert(json.containsKey(r'modelName'), 'Required key "FacialRecognitionConfig[modelName]" is missing from JSON.'); + assert(json[r'modelName'] != null, 'Required key "FacialRecognitionConfig[modelName]" has a null value in JSON.'); + return true; + }()); + return FacialRecognitionConfig( enabled: mapValueOfType(json, r'enabled')!, - maxDistance: (mapValueOfType(json, r'maxDistance')!).toDouble(), + maxDistance: mapValueOfType(json, r'maxDistance')!, minFaces: mapValueOfType(json, r'minFaces')!, - minScore: (mapValueOfType(json, r'minScore')!).toDouble(), + minScore: mapValueOfType(json, r'minScore')!, modelName: mapValueOfType(json, r'modelName')!, ); } diff --git a/mobile/openapi/lib/model/folders_response.dart b/mobile/openapi/lib/model/folders_response.dart index 873404c786..10b26e9f56 100644 --- a/mobile/openapi/lib/model/folders_response.dart +++ b/mobile/openapi/lib/model/folders_response.dart @@ -48,10 +48,20 @@ class FoldersResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static FoldersResponse? fromJson(dynamic value) { - upgradeDto(value, "FoldersResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "FoldersResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "FoldersResponse[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'sidebarWeb'), 'Required key "FoldersResponse[sidebarWeb]" is missing from JSON.'); + assert(json[r'sidebarWeb'] != null, 'Required key "FoldersResponse[sidebarWeb]" has a null value in JSON.'); + return true; + }()); + return FoldersResponse( enabled: mapValueOfType(json, r'enabled')!, sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, diff --git a/mobile/openapi/lib/model/folders_update.dart b/mobile/openapi/lib/model/folders_update.dart index edd58014d4..84bb080891 100644 --- a/mobile/openapi/lib/model/folders_update.dart +++ b/mobile/openapi/lib/model/folders_update.dart @@ -54,12 +54,12 @@ class FoldersUpdate { if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } if (this.sidebarWeb != null) { json[r'sidebarWeb'] = this.sidebarWeb; } else { - // json[r'sidebarWeb'] = null; + json[r'sidebarWeb'] = null; } return json; } @@ -68,10 +68,16 @@ class FoldersUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static FoldersUpdate? fromJson(dynamic value) { - upgradeDto(value, "FoldersUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return FoldersUpdate( enabled: mapValueOfType(json, r'enabled'), sidebarWeb: mapValueOfType(json, r'sidebarWeb'), diff --git a/mobile/openapi/lib/model/job_create_dto.dart b/mobile/openapi/lib/model/job_create_dto.dart index fe6743cba0..09b60447dc 100644 --- a/mobile/openapi/lib/model/job_create_dto.dart +++ b/mobile/openapi/lib/model/job_create_dto.dart @@ -40,10 +40,18 @@ class JobCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static JobCreateDto? fromJson(dynamic value) { - upgradeDto(value, "JobCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'name'), 'Required key "JobCreateDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "JobCreateDto[name]" has a null value in JSON.'); + return true; + }()); + return JobCreateDto( name: ManualJobName.fromJson(json[r'name'])!, ); diff --git a/mobile/openapi/lib/model/job_settings_dto.dart b/mobile/openapi/lib/model/job_settings_dto.dart index 98fe3d3536..ae4cfc0e88 100644 --- a/mobile/openapi/lib/model/job_settings_dto.dart +++ b/mobile/openapi/lib/model/job_settings_dto.dart @@ -44,10 +44,18 @@ class JobSettingsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static JobSettingsDto? fromJson(dynamic value) { - upgradeDto(value, "JobSettingsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'concurrency'), 'Required key "JobSettingsDto[concurrency]" is missing from JSON.'); + assert(json[r'concurrency'] != null, 'Required key "JobSettingsDto[concurrency]" has a null value in JSON.'); + return true; + }()); + return JobSettingsDto( concurrency: mapValueOfType(json, r'concurrency')!, ); diff --git a/mobile/openapi/lib/model/library_response_dto.dart b/mobile/openapi/lib/model/library_response_dto.dart index 88ebceae24..9152efc92a 100644 --- a/mobile/openapi/lib/model/library_response_dto.dart +++ b/mobile/openapi/lib/model/library_response_dto.dart @@ -98,7 +98,7 @@ class LibraryResponseDto { ? this.refreshedAt!.millisecondsSinceEpoch : this.refreshedAt!.toUtc().toIso8601String(); } else { - // json[r'refreshedAt'] = null; + json[r'refreshedAt'] = null; } json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAt.millisecondsSinceEpoch @@ -110,10 +110,33 @@ class LibraryResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static LibraryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LibraryResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetCount'), 'Required key "LibraryResponseDto[assetCount]" is missing from JSON.'); + assert(json[r'assetCount'] != null, 'Required key "LibraryResponseDto[assetCount]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "LibraryResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "LibraryResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'exclusionPatterns'), 'Required key "LibraryResponseDto[exclusionPatterns]" is missing from JSON.'); + assert(json[r'exclusionPatterns'] != null, 'Required key "LibraryResponseDto[exclusionPatterns]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "LibraryResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "LibraryResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'importPaths'), 'Required key "LibraryResponseDto[importPaths]" is missing from JSON.'); + assert(json[r'importPaths'] != null, 'Required key "LibraryResponseDto[importPaths]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "LibraryResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "LibraryResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "LibraryResponseDto[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "LibraryResponseDto[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'refreshedAt'), 'Required key "LibraryResponseDto[refreshedAt]" is missing from JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "LibraryResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "LibraryResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return LibraryResponseDto( assetCount: mapValueOfType(json, r'assetCount')!, createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, diff --git a/mobile/openapi/lib/model/library_stats_response_dto.dart b/mobile/openapi/lib/model/library_stats_response_dto.dart index 55adbc2b49..90613e75e9 100644 --- a/mobile/openapi/lib/model/library_stats_response_dto.dart +++ b/mobile/openapi/lib/model/library_stats_response_dto.dart @@ -74,10 +74,24 @@ class LibraryStatsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static LibraryStatsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LibraryStatsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'photos'), 'Required key "LibraryStatsResponseDto[photos]" is missing from JSON.'); + assert(json[r'photos'] != null, 'Required key "LibraryStatsResponseDto[photos]" has a null value in JSON.'); + assert(json.containsKey(r'total'), 'Required key "LibraryStatsResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "LibraryStatsResponseDto[total]" has a null value in JSON.'); + assert(json.containsKey(r'usage'), 'Required key "LibraryStatsResponseDto[usage]" is missing from JSON.'); + assert(json[r'usage'] != null, 'Required key "LibraryStatsResponseDto[usage]" has a null value in JSON.'); + assert(json.containsKey(r'videos'), 'Required key "LibraryStatsResponseDto[videos]" is missing from JSON.'); + assert(json[r'videos'] != null, 'Required key "LibraryStatsResponseDto[videos]" has a null value in JSON.'); + return true; + }()); + return LibraryStatsResponseDto( photos: mapValueOfType(json, r'photos')!, total: mapValueOfType(json, r'total')!, diff --git a/mobile/openapi/lib/model/license_key_dto.dart b/mobile/openapi/lib/model/license_key_dto.dart index d1818a2a43..6679275df7 100644 --- a/mobile/openapi/lib/model/license_key_dto.dart +++ b/mobile/openapi/lib/model/license_key_dto.dart @@ -48,10 +48,20 @@ class LicenseKeyDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static LicenseKeyDto? fromJson(dynamic value) { - upgradeDto(value, "LicenseKeyDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'activationKey'), 'Required key "LicenseKeyDto[activationKey]" is missing from JSON.'); + assert(json[r'activationKey'] != null, 'Required key "LicenseKeyDto[activationKey]" has a null value in JSON.'); + assert(json.containsKey(r'licenseKey'), 'Required key "LicenseKeyDto[licenseKey]" is missing from JSON.'); + assert(json[r'licenseKey'] != null, 'Required key "LicenseKeyDto[licenseKey]" has a null value in JSON.'); + return true; + }()); + return LicenseKeyDto( activationKey: mapValueOfType(json, r'activationKey')!, licenseKey: mapValueOfType(json, r'licenseKey')!, diff --git a/mobile/openapi/lib/model/login_credential_dto.dart b/mobile/openapi/lib/model/login_credential_dto.dart index 1fdfdc3d40..d5f5ae3e55 100644 --- a/mobile/openapi/lib/model/login_credential_dto.dart +++ b/mobile/openapi/lib/model/login_credential_dto.dart @@ -48,10 +48,20 @@ class LoginCredentialDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static LoginCredentialDto? fromJson(dynamic value) { - upgradeDto(value, "LoginCredentialDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'email'), 'Required key "LoginCredentialDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "LoginCredentialDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "LoginCredentialDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "LoginCredentialDto[password]" has a null value in JSON.'); + return true; + }()); + return LoginCredentialDto( email: mapValueOfType(json, r'email')!, password: mapValueOfType(json, r'password')!, diff --git a/mobile/openapi/lib/model/login_response_dto.dart b/mobile/openapi/lib/model/login_response_dto.dart index c6938c2393..c6e57a1aae 100644 --- a/mobile/openapi/lib/model/login_response_dto.dart +++ b/mobile/openapi/lib/model/login_response_dto.dart @@ -90,10 +90,32 @@ class LoginResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static LoginResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LoginResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'accessToken'), 'Required key "LoginResponseDto[accessToken]" is missing from JSON.'); + assert(json[r'accessToken'] != null, 'Required key "LoginResponseDto[accessToken]" has a null value in JSON.'); + assert(json.containsKey(r'isAdmin'), 'Required key "LoginResponseDto[isAdmin]" is missing from JSON.'); + assert(json[r'isAdmin'] != null, 'Required key "LoginResponseDto[isAdmin]" has a null value in JSON.'); + assert(json.containsKey(r'isOnboarded'), 'Required key "LoginResponseDto[isOnboarded]" is missing from JSON.'); + assert(json[r'isOnboarded'] != null, 'Required key "LoginResponseDto[isOnboarded]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "LoginResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "LoginResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'profileImagePath'), 'Required key "LoginResponseDto[profileImagePath]" is missing from JSON.'); + assert(json[r'profileImagePath'] != null, 'Required key "LoginResponseDto[profileImagePath]" has a null value in JSON.'); + assert(json.containsKey(r'shouldChangePassword'), 'Required key "LoginResponseDto[shouldChangePassword]" is missing from JSON.'); + assert(json[r'shouldChangePassword'] != null, 'Required key "LoginResponseDto[shouldChangePassword]" has a null value in JSON.'); + assert(json.containsKey(r'userEmail'), 'Required key "LoginResponseDto[userEmail]" is missing from JSON.'); + assert(json[r'userEmail'] != null, 'Required key "LoginResponseDto[userEmail]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "LoginResponseDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "LoginResponseDto[userId]" has a null value in JSON.'); + return true; + }()); + return LoginResponseDto( accessToken: mapValueOfType(json, r'accessToken')!, isAdmin: mapValueOfType(json, r'isAdmin')!, diff --git a/mobile/openapi/lib/model/logout_response_dto.dart b/mobile/openapi/lib/model/logout_response_dto.dart index b50db2c28b..c400ecfa99 100644 --- a/mobile/openapi/lib/model/logout_response_dto.dart +++ b/mobile/openapi/lib/model/logout_response_dto.dart @@ -48,10 +48,20 @@ class LogoutResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static LogoutResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LogoutResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'redirectUri'), 'Required key "LogoutResponseDto[redirectUri]" is missing from JSON.'); + assert(json[r'redirectUri'] != null, 'Required key "LogoutResponseDto[redirectUri]" has a null value in JSON.'); + assert(json.containsKey(r'successful'), 'Required key "LogoutResponseDto[successful]" is missing from JSON.'); + assert(json[r'successful'] != null, 'Required key "LogoutResponseDto[successful]" has a null value in JSON.'); + return true; + }()); + return LogoutResponseDto( redirectUri: mapValueOfType(json, r'redirectUri')!, successful: mapValueOfType(json, r'successful')!, diff --git a/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart b/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart index a9b8608ac1..64499ab6ee 100644 --- a/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart +++ b/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart @@ -57,10 +57,22 @@ class MachineLearningAvailabilityChecksDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MachineLearningAvailabilityChecksDto? fromJson(dynamic value) { - upgradeDto(value, "MachineLearningAvailabilityChecksDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "MachineLearningAvailabilityChecksDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "MachineLearningAvailabilityChecksDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'interval'), 'Required key "MachineLearningAvailabilityChecksDto[interval]" is missing from JSON.'); + assert(json[r'interval'] != null, 'Required key "MachineLearningAvailabilityChecksDto[interval]" has a null value in JSON.'); + assert(json.containsKey(r'timeout'), 'Required key "MachineLearningAvailabilityChecksDto[timeout]" is missing from JSON.'); + assert(json[r'timeout'] != null, 'Required key "MachineLearningAvailabilityChecksDto[timeout]" has a null value in JSON.'); + return true; + }()); + return MachineLearningAvailabilityChecksDto( enabled: mapValueOfType(json, r'enabled')!, interval: mapValueOfType(json, r'interval')!, diff --git a/mobile/openapi/lib/model/maintenance_auth_dto.dart b/mobile/openapi/lib/model/maintenance_auth_dto.dart index f9511bdd2b..382df56438 100644 --- a/mobile/openapi/lib/model/maintenance_auth_dto.dart +++ b/mobile/openapi/lib/model/maintenance_auth_dto.dart @@ -41,10 +41,18 @@ class MaintenanceAuthDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MaintenanceAuthDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceAuthDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'username'), 'Required key "MaintenanceAuthDto[username]" is missing from JSON.'); + assert(json[r'username'] != null, 'Required key "MaintenanceAuthDto[username]" has a null value in JSON.'); + return true; + }()); + return MaintenanceAuthDto( username: mapValueOfType(json, r'username')!, ); diff --git a/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart b/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart index 1c364a6fdc..5e81ef1bb0 100644 --- a/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart +++ b/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart @@ -40,10 +40,18 @@ class MaintenanceDetectInstallResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MaintenanceDetectInstallResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceDetectInstallResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'storage'), 'Required key "MaintenanceDetectInstallResponseDto[storage]" is missing from JSON.'); + assert(json[r'storage'] != null, 'Required key "MaintenanceDetectInstallResponseDto[storage]" has a null value in JSON.'); + return true; + }()); + return MaintenanceDetectInstallResponseDto( storage: MaintenanceDetectInstallStorageFolderDto.listFromJson(json[r'storage']), ); diff --git a/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart b/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart index 83182f53d7..bc847fb0b7 100644 --- a/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart +++ b/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart @@ -64,10 +64,24 @@ class MaintenanceDetectInstallStorageFolderDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MaintenanceDetectInstallStorageFolderDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceDetectInstallStorageFolderDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'files'), 'Required key "MaintenanceDetectInstallStorageFolderDto[files]" is missing from JSON.'); + assert(json[r'files'] != null, 'Required key "MaintenanceDetectInstallStorageFolderDto[files]" has a null value in JSON.'); + assert(json.containsKey(r'folder'), 'Required key "MaintenanceDetectInstallStorageFolderDto[folder]" is missing from JSON.'); + assert(json[r'folder'] != null, 'Required key "MaintenanceDetectInstallStorageFolderDto[folder]" has a null value in JSON.'); + assert(json.containsKey(r'readable'), 'Required key "MaintenanceDetectInstallStorageFolderDto[readable]" is missing from JSON.'); + assert(json[r'readable'] != null, 'Required key "MaintenanceDetectInstallStorageFolderDto[readable]" has a null value in JSON.'); + assert(json.containsKey(r'writable'), 'Required key "MaintenanceDetectInstallStorageFolderDto[writable]" is missing from JSON.'); + assert(json[r'writable'] != null, 'Required key "MaintenanceDetectInstallStorageFolderDto[writable]" has a null value in JSON.'); + return true; + }()); + return MaintenanceDetectInstallStorageFolderDto( files: mapValueOfType(json, r'files')!, folder: StorageFolder.fromJson(json[r'folder'])!, diff --git a/mobile/openapi/lib/model/maintenance_login_dto.dart b/mobile/openapi/lib/model/maintenance_login_dto.dart index 64cf6b234b..d367125597 100644 --- a/mobile/openapi/lib/model/maintenance_login_dto.dart +++ b/mobile/openapi/lib/model/maintenance_login_dto.dart @@ -42,7 +42,7 @@ class MaintenanceLoginDto { if (this.token != null) { json[r'token'] = this.token; } else { - // json[r'token'] = null; + json[r'token'] = null; } return json; } @@ -51,10 +51,16 @@ class MaintenanceLoginDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MaintenanceLoginDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceLoginDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return MaintenanceLoginDto( token: mapValueOfType(json, r'token'), ); diff --git a/mobile/openapi/lib/model/maintenance_status_response_dto.dart b/mobile/openapi/lib/model/maintenance_status_response_dto.dart index c1c94acd91..6f21650a10 100644 --- a/mobile/openapi/lib/model/maintenance_status_response_dto.dart +++ b/mobile/openapi/lib/model/maintenance_status_response_dto.dart @@ -77,17 +77,17 @@ class MaintenanceStatusResponseDto { if (this.error != null) { json[r'error'] = this.error; } else { - // json[r'error'] = null; + json[r'error'] = null; } if (this.progress != null) { json[r'progress'] = this.progress; } else { - // json[r'progress'] = null; + json[r'progress'] = null; } if (this.task != null) { json[r'task'] = this.task; } else { - // json[r'task'] = null; + json[r'task'] = null; } return json; } @@ -96,10 +96,20 @@ class MaintenanceStatusResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MaintenanceStatusResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceStatusResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'action'), 'Required key "MaintenanceStatusResponseDto[action]" is missing from JSON.'); + assert(json[r'action'] != null, 'Required key "MaintenanceStatusResponseDto[action]" has a null value in JSON.'); + assert(json.containsKey(r'active'), 'Required key "MaintenanceStatusResponseDto[active]" is missing from JSON.'); + assert(json[r'active'] != null, 'Required key "MaintenanceStatusResponseDto[active]" has a null value in JSON.'); + return true; + }()); + return MaintenanceStatusResponseDto( action: MaintenanceAction.fromJson(json[r'action'])!, active: mapValueOfType(json, r'active')!, diff --git a/mobile/openapi/lib/model/map_marker_response_dto.dart b/mobile/openapi/lib/model/map_marker_response_dto.dart index c0a47a5458..e8e0cbb75e 100644 --- a/mobile/openapi/lib/model/map_marker_response_dto.dart +++ b/mobile/openapi/lib/model/map_marker_response_dto.dart @@ -66,12 +66,12 @@ class MapMarkerResponseDto { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } json[r'id'] = this.id; json[r'lat'] = this.lat; @@ -79,7 +79,7 @@ class MapMarkerResponseDto { if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } return json; } @@ -88,16 +88,31 @@ class MapMarkerResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MapMarkerResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MapMarkerResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'city'), 'Required key "MapMarkerResponseDto[city]" is missing from JSON.'); + assert(json.containsKey(r'country'), 'Required key "MapMarkerResponseDto[country]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "MapMarkerResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "MapMarkerResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'lat'), 'Required key "MapMarkerResponseDto[lat]" is missing from JSON.'); + assert(json[r'lat'] != null, 'Required key "MapMarkerResponseDto[lat]" has a null value in JSON.'); + assert(json.containsKey(r'lon'), 'Required key "MapMarkerResponseDto[lon]" is missing from JSON.'); + assert(json[r'lon'] != null, 'Required key "MapMarkerResponseDto[lon]" has a null value in JSON.'); + assert(json.containsKey(r'state'), 'Required key "MapMarkerResponseDto[state]" is missing from JSON.'); + return true; + }()); + return MapMarkerResponseDto( city: mapValueOfType(json, r'city'), country: mapValueOfType(json, r'country'), id: mapValueOfType(json, r'id')!, - lat: (mapValueOfType(json, r'lat')!).toDouble(), - lon: (mapValueOfType(json, r'lon')!).toDouble(), + lat: mapValueOfType(json, r'lat')!, + lon: mapValueOfType(json, r'lon')!, state: mapValueOfType(json, r'state'), ); } diff --git a/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart b/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart index 85435485e6..e9b216baa7 100644 --- a/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart +++ b/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart @@ -48,17 +48,17 @@ class MapReverseGeocodeResponseDto { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } return json; } @@ -67,10 +67,19 @@ class MapReverseGeocodeResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MapReverseGeocodeResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MapReverseGeocodeResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'city'), 'Required key "MapReverseGeocodeResponseDto[city]" is missing from JSON.'); + assert(json.containsKey(r'country'), 'Required key "MapReverseGeocodeResponseDto[country]" is missing from JSON.'); + assert(json.containsKey(r'state'), 'Required key "MapReverseGeocodeResponseDto[state]" is missing from JSON.'); + return true; + }()); + return MapReverseGeocodeResponseDto( city: mapValueOfType(json, r'city'), country: mapValueOfType(json, r'country'), diff --git a/mobile/openapi/lib/model/memories_response.dart b/mobile/openapi/lib/model/memories_response.dart index 250e214a60..b9b0aa7564 100644 --- a/mobile/openapi/lib/model/memories_response.dart +++ b/mobile/openapi/lib/model/memories_response.dart @@ -51,10 +51,20 @@ class MemoriesResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MemoriesResponse? fromJson(dynamic value) { - upgradeDto(value, "MemoriesResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'duration'), 'Required key "MemoriesResponse[duration]" is missing from JSON.'); + assert(json[r'duration'] != null, 'Required key "MemoriesResponse[duration]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "MemoriesResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "MemoriesResponse[enabled]" has a null value in JSON.'); + return true; + }()); + return MemoriesResponse( duration: mapValueOfType(json, r'duration')!, enabled: mapValueOfType(json, r'enabled')!, diff --git a/mobile/openapi/lib/model/memories_update.dart b/mobile/openapi/lib/model/memories_update.dart index ede9910d74..8023c8bba8 100644 --- a/mobile/openapi/lib/model/memories_update.dart +++ b/mobile/openapi/lib/model/memories_update.dart @@ -57,12 +57,12 @@ class MemoriesUpdate { if (this.duration != null) { json[r'duration'] = this.duration; } else { - // json[r'duration'] = null; + json[r'duration'] = null; } if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } return json; } @@ -71,10 +71,16 @@ class MemoriesUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MemoriesUpdate? fromJson(dynamic value) { - upgradeDto(value, "MemoriesUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return MemoriesUpdate( duration: mapValueOfType(json, r'duration'), enabled: mapValueOfType(json, r'enabled'), diff --git a/mobile/openapi/lib/model/memory_create_dto.dart b/mobile/openapi/lib/model/memory_create_dto.dart index b906f6dd1d..e79de5708e 100644 --- a/mobile/openapi/lib/model/memory_create_dto.dart +++ b/mobile/openapi/lib/model/memory_create_dto.dart @@ -104,12 +104,12 @@ class MemoryCreateDto { ? this.hideAt!.millisecondsSinceEpoch : this.hideAt!.toUtc().toIso8601String(); } else { - // json[r'hideAt'] = null; + json[r'hideAt'] = null; } if (this.isSaved != null) { json[r'isSaved'] = this.isSaved; } else { - // json[r'isSaved'] = null; + json[r'isSaved'] = null; } json[r'memoryAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.memoryAt.millisecondsSinceEpoch @@ -119,14 +119,14 @@ class MemoryCreateDto { ? this.seenAt!.millisecondsSinceEpoch : this.seenAt!.toUtc().toIso8601String(); } else { - // json[r'seenAt'] = null; + json[r'seenAt'] = null; } if (this.showAt != null) { json[r'showAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.showAt!.millisecondsSinceEpoch : this.showAt!.toUtc().toIso8601String(); } else { - // json[r'showAt'] = null; + json[r'showAt'] = null; } json[r'type'] = this.type; return json; @@ -136,10 +136,22 @@ class MemoryCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MemoryCreateDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'data'), 'Required key "MemoryCreateDto[data]" is missing from JSON.'); + assert(json[r'data'] != null, 'Required key "MemoryCreateDto[data]" has a null value in JSON.'); + assert(json.containsKey(r'memoryAt'), 'Required key "MemoryCreateDto[memoryAt]" is missing from JSON.'); + assert(json[r'memoryAt'] != null, 'Required key "MemoryCreateDto[memoryAt]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "MemoryCreateDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "MemoryCreateDto[type]" has a null value in JSON.'); + return true; + }()); + return MemoryCreateDto( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/memory_response_dto.dart b/mobile/openapi/lib/model/memory_response_dto.dart index e736667d57..2fe13b723b 100644 --- a/mobile/openapi/lib/model/memory_response_dto.dart +++ b/mobile/openapi/lib/model/memory_response_dto.dart @@ -136,14 +136,14 @@ class MemoryResponseDto { ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } if (this.hideAt != null) { json[r'hideAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.hideAt!.millisecondsSinceEpoch : this.hideAt!.toUtc().toIso8601String(); } else { - // json[r'hideAt'] = null; + json[r'hideAt'] = null; } json[r'id'] = this.id; json[r'isSaved'] = this.isSaved; @@ -156,14 +156,14 @@ class MemoryResponseDto { ? this.seenAt!.millisecondsSinceEpoch : this.seenAt!.toUtc().toIso8601String(); } else { - // json[r'seenAt'] = null; + json[r'seenAt'] = null; } if (this.showAt != null) { json[r'showAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.showAt!.millisecondsSinceEpoch : this.showAt!.toUtc().toIso8601String(); } else { - // json[r'showAt'] = null; + json[r'showAt'] = null; } json[r'type'] = this.type; json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') @@ -176,10 +176,34 @@ class MemoryResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MemoryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assets'), 'Required key "MemoryResponseDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "MemoryResponseDto[assets]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "MemoryResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "MemoryResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'data'), 'Required key "MemoryResponseDto[data]" is missing from JSON.'); + assert(json[r'data'] != null, 'Required key "MemoryResponseDto[data]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "MemoryResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "MemoryResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isSaved'), 'Required key "MemoryResponseDto[isSaved]" is missing from JSON.'); + assert(json[r'isSaved'] != null, 'Required key "MemoryResponseDto[isSaved]" has a null value in JSON.'); + assert(json.containsKey(r'memoryAt'), 'Required key "MemoryResponseDto[memoryAt]" is missing from JSON.'); + assert(json[r'memoryAt'] != null, 'Required key "MemoryResponseDto[memoryAt]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "MemoryResponseDto[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "MemoryResponseDto[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "MemoryResponseDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "MemoryResponseDto[type]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "MemoryResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "MemoryResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return MemoryResponseDto( assets: AssetResponseDto.listFromJson(json[r'assets']), createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, diff --git a/mobile/openapi/lib/model/memory_statistics_response_dto.dart b/mobile/openapi/lib/model/memory_statistics_response_dto.dart index ae542870d9..e538c48304 100644 --- a/mobile/openapi/lib/model/memory_statistics_response_dto.dart +++ b/mobile/openapi/lib/model/memory_statistics_response_dto.dart @@ -44,10 +44,18 @@ class MemoryStatisticsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MemoryStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryStatisticsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'total'), 'Required key "MemoryStatisticsResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "MemoryStatisticsResponseDto[total]" has a null value in JSON.'); + return true; + }()); + return MemoryStatisticsResponseDto( total: mapValueOfType(json, r'total')!, ); diff --git a/mobile/openapi/lib/model/memory_update_dto.dart b/mobile/openapi/lib/model/memory_update_dto.dart index d8d7e9643b..5563080377 100644 --- a/mobile/openapi/lib/model/memory_update_dto.dart +++ b/mobile/openapi/lib/model/memory_update_dto.dart @@ -66,21 +66,21 @@ class MemoryUpdateDto { if (this.isSaved != null) { json[r'isSaved'] = this.isSaved; } else { - // json[r'isSaved'] = null; + json[r'isSaved'] = null; } if (this.memoryAt != null) { json[r'memoryAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.memoryAt!.millisecondsSinceEpoch : this.memoryAt!.toUtc().toIso8601String(); } else { - // json[r'memoryAt'] = null; + json[r'memoryAt'] = null; } if (this.seenAt != null) { json[r'seenAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.seenAt!.millisecondsSinceEpoch : this.seenAt!.toUtc().toIso8601String(); } else { - // json[r'seenAt'] = null; + json[r'seenAt'] = null; } return json; } @@ -89,10 +89,16 @@ class MemoryUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MemoryUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return MemoryUpdateDto( isSaved: mapValueOfType(json, r'isSaved'), memoryAt: mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), diff --git a/mobile/openapi/lib/model/merge_person_dto.dart b/mobile/openapi/lib/model/merge_person_dto.dart index 8a647890c3..cf1d14d586 100644 --- a/mobile/openapi/lib/model/merge_person_dto.dart +++ b/mobile/openapi/lib/model/merge_person_dto.dart @@ -41,10 +41,18 @@ class MergePersonDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MergePersonDto? fromJson(dynamic value) { - upgradeDto(value, "MergePersonDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ids'), 'Required key "MergePersonDto[ids]" is missing from JSON.'); + assert(json[r'ids'] != null, 'Required key "MergePersonDto[ids]" has a null value in JSON.'); + return true; + }()); + return MergePersonDto( ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart index 29b1d5b68d..97dcf4d6b7 100644 --- a/mobile/openapi/lib/model/metadata_search_dto.dart +++ b/mobile/openapi/lib/model/metadata_search_dto.dart @@ -475,219 +475,219 @@ class MetadataSearchDto { if (this.checksum != null) { json[r'checksum'] = this.checksum; } else { - // json[r'checksum'] = null; + json[r'checksum'] = null; } if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.createdAfter != null) { json[r'createdAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdAfter!.millisecondsSinceEpoch : this.createdAfter!.toUtc().toIso8601String(); } else { - // json[r'createdAfter'] = null; + json[r'createdAfter'] = null; } if (this.createdBefore != null) { json[r'createdBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdBefore!.millisecondsSinceEpoch : this.createdBefore!.toUtc().toIso8601String(); } else { - // json[r'createdBefore'] = null; + json[r'createdBefore'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.encodedVideoPath != null) { json[r'encodedVideoPath'] = this.encodedVideoPath; } else { - // json[r'encodedVideoPath'] = null; + json[r'encodedVideoPath'] = null; } if (this.id != null) { json[r'id'] = this.id; } else { - // json[r'id'] = null; + json[r'id'] = null; } if (this.isEncoded != null) { json[r'isEncoded'] = this.isEncoded; } else { - // json[r'isEncoded'] = null; + json[r'isEncoded'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isMotion != null) { json[r'isMotion'] = this.isMotion; } else { - // json[r'isMotion'] = null; + json[r'isMotion'] = null; } if (this.isNotInAlbum != null) { json[r'isNotInAlbum'] = this.isNotInAlbum; } else { - // json[r'isNotInAlbum'] = null; + json[r'isNotInAlbum'] = null; } if (this.isOffline != null) { json[r'isOffline'] = this.isOffline; } else { - // json[r'isOffline'] = null; + json[r'isOffline'] = null; } if (this.lensModel != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + json[r'lensModel'] = null; } if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.make != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + json[r'make'] = null; } if (this.model != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + json[r'model'] = null; } if (this.ocr != null) { json[r'ocr'] = this.ocr; } else { - // json[r'ocr'] = null; + json[r'ocr'] = null; } if (this.order != null) { json[r'order'] = this.order; } else { - // json[r'order'] = null; + json[r'order'] = null; } if (this.originalFileName != null) { json[r'originalFileName'] = this.originalFileName; } else { - // json[r'originalFileName'] = null; + json[r'originalFileName'] = null; } if (this.originalPath != null) { json[r'originalPath'] = this.originalPath; } else { - // json[r'originalPath'] = null; + json[r'originalPath'] = null; } if (this.page != null) { json[r'page'] = this.page; } else { - // json[r'page'] = null; + json[r'page'] = null; } json[r'personIds'] = this.personIds; if (this.previewPath != null) { json[r'previewPath'] = this.previewPath; } else { - // json[r'previewPath'] = null; + json[r'previewPath'] = null; } if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.size != null) { json[r'size'] = this.size; } else { - // json[r'size'] = null; + json[r'size'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } if (this.tagIds != null) { json[r'tagIds'] = this.tagIds; } else { - // json[r'tagIds'] = null; + json[r'tagIds'] = null; } if (this.takenAfter != null) { json[r'takenAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenAfter!.millisecondsSinceEpoch : this.takenAfter!.toUtc().toIso8601String(); } else { - // json[r'takenAfter'] = null; + json[r'takenAfter'] = null; } if (this.takenBefore != null) { json[r'takenBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenBefore!.millisecondsSinceEpoch : this.takenBefore!.toUtc().toIso8601String(); } else { - // json[r'takenBefore'] = null; + json[r'takenBefore'] = null; } if (this.thumbnailPath != null) { json[r'thumbnailPath'] = this.thumbnailPath; } else { - // json[r'thumbnailPath'] = null; + json[r'thumbnailPath'] = null; } if (this.trashedAfter != null) { json[r'trashedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedAfter!.millisecondsSinceEpoch : this.trashedAfter!.toUtc().toIso8601String(); } else { - // json[r'trashedAfter'] = null; + json[r'trashedAfter'] = null; } if (this.trashedBefore != null) { json[r'trashedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedBefore!.millisecondsSinceEpoch : this.trashedBefore!.toUtc().toIso8601String(); } else { - // json[r'trashedBefore'] = null; + json[r'trashedBefore'] = null; } if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } if (this.updatedAfter != null) { json[r'updatedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAfter!.millisecondsSinceEpoch : this.updatedAfter!.toUtc().toIso8601String(); } else { - // json[r'updatedAfter'] = null; + json[r'updatedAfter'] = null; } if (this.updatedBefore != null) { json[r'updatedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedBefore!.millisecondsSinceEpoch : this.updatedBefore!.toUtc().toIso8601String(); } else { - // json[r'updatedBefore'] = null; + json[r'updatedBefore'] = null; } if (this.visibility != null) { json[r'visibility'] = this.visibility; } else { - // json[r'visibility'] = null; + json[r'visibility'] = null; } if (this.withDeleted != null) { json[r'withDeleted'] = this.withDeleted; } else { - // json[r'withDeleted'] = null; + json[r'withDeleted'] = null; } if (this.withExif != null) { json[r'withExif'] = this.withExif; } else { - // json[r'withExif'] = null; + json[r'withExif'] = null; } if (this.withPeople != null) { json[r'withPeople'] = this.withPeople; } else { - // json[r'withPeople'] = null; + json[r'withPeople'] = null; } if (this.withStacked != null) { json[r'withStacked'] = this.withStacked; } else { - // json[r'withStacked'] = null; + json[r'withStacked'] = null; } return json; } @@ -696,10 +696,16 @@ class MetadataSearchDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MetadataSearchDto? fromJson(dynamic value) { - upgradeDto(value, "MetadataSearchDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return MetadataSearchDto( albumIds: json[r'albumIds'] is Iterable ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/mirror_parameters.dart b/mobile/openapi/lib/model/mirror_parameters.dart index 78c3da786c..e54a676f95 100644 --- a/mobile/openapi/lib/model/mirror_parameters.dart +++ b/mobile/openapi/lib/model/mirror_parameters.dart @@ -40,10 +40,18 @@ class MirrorParameters { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static MirrorParameters? fromJson(dynamic value) { - upgradeDto(value, "MirrorParameters"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'axis'), 'Required key "MirrorParameters[axis]" is missing from JSON.'); + assert(json[r'axis'] != null, 'Required key "MirrorParameters[axis]" has a null value in JSON.'); + return true; + }()); + return MirrorParameters( axis: MirrorAxis.fromJson(json[r'axis'])!, ); diff --git a/mobile/openapi/lib/model/notification_create_dto.dart b/mobile/openapi/lib/model/notification_create_dto.dart index f9771246f9..013847ab3a 100644 --- a/mobile/openapi/lib/model/notification_create_dto.dart +++ b/mobile/openapi/lib/model/notification_create_dto.dart @@ -83,25 +83,25 @@ class NotificationCreateDto { if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.level != null) { json[r'level'] = this.level; } else { - // json[r'level'] = null; + json[r'level'] = null; } if (this.readAt != null) { json[r'readAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.readAt!.millisecondsSinceEpoch : this.readAt!.toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + json[r'readAt'] = null; } json[r'title'] = this.title; if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } json[r'userId'] = this.userId; return json; @@ -111,10 +111,20 @@ class NotificationCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static NotificationCreateDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'title'), 'Required key "NotificationCreateDto[title]" is missing from JSON.'); + assert(json[r'title'] != null, 'Required key "NotificationCreateDto[title]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "NotificationCreateDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "NotificationCreateDto[userId]" has a null value in JSON.'); + return true; + }()); + return NotificationCreateDto( data: mapCastOfType(json, r'data') ?? const {}, description: mapValueOfType(json, r'description'), diff --git a/mobile/openapi/lib/model/notification_delete_all_dto.dart b/mobile/openapi/lib/model/notification_delete_all_dto.dart index 1b398a4f33..8ae9a20b76 100644 --- a/mobile/openapi/lib/model/notification_delete_all_dto.dart +++ b/mobile/openapi/lib/model/notification_delete_all_dto.dart @@ -41,10 +41,18 @@ class NotificationDeleteAllDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static NotificationDeleteAllDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationDeleteAllDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ids'), 'Required key "NotificationDeleteAllDto[ids]" is missing from JSON.'); + assert(json[r'ids'] != null, 'Required key "NotificationDeleteAllDto[ids]" has a null value in JSON.'); + return true; + }()); + return NotificationDeleteAllDto( ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/notification_dto.dart b/mobile/openapi/lib/model/notification_dto.dart index ad0e79cb27..769f3784c2 100644 --- a/mobile/openapi/lib/model/notification_dto.dart +++ b/mobile/openapi/lib/model/notification_dto.dart @@ -92,7 +92,7 @@ class NotificationDto { if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } json[r'id'] = this.id; json[r'level'] = this.level; @@ -101,7 +101,7 @@ class NotificationDto { ? this.readAt!.millisecondsSinceEpoch : this.readAt!.toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + json[r'readAt'] = null; } json[r'title'] = this.title; json[r'type'] = this.type; @@ -112,10 +112,26 @@ class NotificationDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static NotificationDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "NotificationDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "NotificationDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "NotificationDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "NotificationDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'level'), 'Required key "NotificationDto[level]" is missing from JSON.'); + assert(json[r'level'] != null, 'Required key "NotificationDto[level]" has a null value in JSON.'); + assert(json.containsKey(r'title'), 'Required key "NotificationDto[title]" is missing from JSON.'); + assert(json[r'title'] != null, 'Required key "NotificationDto[title]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "NotificationDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "NotificationDto[type]" has a null value in JSON.'); + return true; + }()); + return NotificationDto( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, data: mapCastOfType(json, r'data') ?? const {}, diff --git a/mobile/openapi/lib/model/notification_update_all_dto.dart b/mobile/openapi/lib/model/notification_update_all_dto.dart index 5ac61ededc..d759602908 100644 --- a/mobile/openapi/lib/model/notification_update_all_dto.dart +++ b/mobile/openapi/lib/model/notification_update_all_dto.dart @@ -45,7 +45,7 @@ class NotificationUpdateAllDto { ? this.readAt!.millisecondsSinceEpoch : this.readAt!.toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + json[r'readAt'] = null; } return json; } @@ -54,10 +54,18 @@ class NotificationUpdateAllDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static NotificationUpdateAllDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationUpdateAllDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ids'), 'Required key "NotificationUpdateAllDto[ids]" is missing from JSON.'); + assert(json[r'ids'] != null, 'Required key "NotificationUpdateAllDto[ids]" has a null value in JSON.'); + return true; + }()); + return NotificationUpdateAllDto( ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/notification_update_dto.dart b/mobile/openapi/lib/model/notification_update_dto.dart index c5d949d7b2..d9593ad802 100644 --- a/mobile/openapi/lib/model/notification_update_dto.dart +++ b/mobile/openapi/lib/model/notification_update_dto.dart @@ -38,7 +38,7 @@ class NotificationUpdateDto { ? this.readAt!.millisecondsSinceEpoch : this.readAt!.toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + json[r'readAt'] = null; } return json; } @@ -47,10 +47,16 @@ class NotificationUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static NotificationUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return NotificationUpdateDto( readAt: mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), ); diff --git a/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart b/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart index 7eedc45673..e2556a102c 100644 --- a/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart +++ b/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart @@ -41,10 +41,18 @@ class OAuthAuthorizeResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OAuthAuthorizeResponseDto? fromJson(dynamic value) { - upgradeDto(value, "OAuthAuthorizeResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'url'), 'Required key "OAuthAuthorizeResponseDto[url]" is missing from JSON.'); + assert(json[r'url'] != null, 'Required key "OAuthAuthorizeResponseDto[url]" has a null value in JSON.'); + return true; + }()); + return OAuthAuthorizeResponseDto( url: mapValueOfType(json, r'url')!, ); diff --git a/mobile/openapi/lib/model/o_auth_callback_dto.dart b/mobile/openapi/lib/model/o_auth_callback_dto.dart index d94374935a..9fccadf64d 100644 --- a/mobile/openapi/lib/model/o_auth_callback_dto.dart +++ b/mobile/openapi/lib/model/o_auth_callback_dto.dart @@ -60,12 +60,12 @@ class OAuthCallbackDto { if (this.codeVerifier != null) { json[r'codeVerifier'] = this.codeVerifier; } else { - // json[r'codeVerifier'] = null; + json[r'codeVerifier'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } json[r'url'] = this.url; return json; @@ -75,10 +75,18 @@ class OAuthCallbackDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OAuthCallbackDto? fromJson(dynamic value) { - upgradeDto(value, "OAuthCallbackDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'url'), 'Required key "OAuthCallbackDto[url]" is missing from JSON.'); + assert(json[r'url'] != null, 'Required key "OAuthCallbackDto[url]" has a null value in JSON.'); + return true; + }()); + return OAuthCallbackDto( codeVerifier: mapValueOfType(json, r'codeVerifier'), state: mapValueOfType(json, r'state'), diff --git a/mobile/openapi/lib/model/o_auth_config_dto.dart b/mobile/openapi/lib/model/o_auth_config_dto.dart index 1c9ce8d5b8..571abcfaf7 100644 --- a/mobile/openapi/lib/model/o_auth_config_dto.dart +++ b/mobile/openapi/lib/model/o_auth_config_dto.dart @@ -60,13 +60,13 @@ class OAuthConfigDto { if (this.codeChallenge != null) { json[r'codeChallenge'] = this.codeChallenge; } else { - // json[r'codeChallenge'] = null; + json[r'codeChallenge'] = null; } json[r'redirectUri'] = this.redirectUri; if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } return json; } @@ -75,10 +75,18 @@ class OAuthConfigDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OAuthConfigDto? fromJson(dynamic value) { - upgradeDto(value, "OAuthConfigDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'redirectUri'), 'Required key "OAuthConfigDto[redirectUri]" is missing from JSON.'); + assert(json[r'redirectUri'] != null, 'Required key "OAuthConfigDto[redirectUri]" has a null value in JSON.'); + return true; + }()); + return OAuthConfigDto( codeChallenge: mapValueOfType(json, r'codeChallenge'), redirectUri: mapValueOfType(json, r'redirectUri')!, diff --git a/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart b/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart index b63f027af7..414108068a 100644 --- a/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart +++ b/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart @@ -23,13 +23,13 @@ class OAuthTokenEndpointAuthMethod { String toJson() => value; - static const post = OAuthTokenEndpointAuthMethod._(r'client_secret_post'); - static const basic = OAuthTokenEndpointAuthMethod._(r'client_secret_basic'); + static const clientSecretPost = OAuthTokenEndpointAuthMethod._(r'client_secret_post'); + static const clientSecretBasic = OAuthTokenEndpointAuthMethod._(r'client_secret_basic'); /// List of all possible values in this [enum][OAuthTokenEndpointAuthMethod]. static const values = [ - post, - basic, + clientSecretPost, + clientSecretBasic, ]; static OAuthTokenEndpointAuthMethod? fromJson(dynamic value) => OAuthTokenEndpointAuthMethodTypeTransformer().decode(value); @@ -68,8 +68,8 @@ class OAuthTokenEndpointAuthMethodTypeTransformer { OAuthTokenEndpointAuthMethod? decode(dynamic data, {bool allowNull = true}) { if (data != null) { switch (data) { - case r'client_secret_post': return OAuthTokenEndpointAuthMethod.post; - case r'client_secret_basic': return OAuthTokenEndpointAuthMethod.basic; + case r'client_secret_post': return OAuthTokenEndpointAuthMethod.clientSecretPost; + case r'client_secret_basic': return OAuthTokenEndpointAuthMethod.clientSecretBasic; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/mobile/openapi/lib/model/ocr_config.dart b/mobile/openapi/lib/model/ocr_config.dart index 2ce5646731..3d6dea9e4c 100644 --- a/mobile/openapi/lib/model/ocr_config.dart +++ b/mobile/openapi/lib/model/ocr_config.dart @@ -78,15 +78,31 @@ class OcrConfig { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OcrConfig? fromJson(dynamic value) { - upgradeDto(value, "OcrConfig"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "OcrConfig[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "OcrConfig[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'maxResolution'), 'Required key "OcrConfig[maxResolution]" is missing from JSON.'); + assert(json[r'maxResolution'] != null, 'Required key "OcrConfig[maxResolution]" has a null value in JSON.'); + assert(json.containsKey(r'minDetectionScore'), 'Required key "OcrConfig[minDetectionScore]" is missing from JSON.'); + assert(json[r'minDetectionScore'] != null, 'Required key "OcrConfig[minDetectionScore]" has a null value in JSON.'); + assert(json.containsKey(r'minRecognitionScore'), 'Required key "OcrConfig[minRecognitionScore]" is missing from JSON.'); + assert(json[r'minRecognitionScore'] != null, 'Required key "OcrConfig[minRecognitionScore]" has a null value in JSON.'); + assert(json.containsKey(r'modelName'), 'Required key "OcrConfig[modelName]" is missing from JSON.'); + assert(json[r'modelName'] != null, 'Required key "OcrConfig[modelName]" has a null value in JSON.'); + return true; + }()); + return OcrConfig( enabled: mapValueOfType(json, r'enabled')!, maxResolution: mapValueOfType(json, r'maxResolution')!, - minDetectionScore: (mapValueOfType(json, r'minDetectionScore')!).toDouble(), - minRecognitionScore: (mapValueOfType(json, r'minRecognitionScore')!).toDouble(), + minDetectionScore: mapValueOfType(json, r'minDetectionScore')!, + minRecognitionScore: mapValueOfType(json, r'minRecognitionScore')!, modelName: mapValueOfType(json, r'modelName')!, ); } diff --git a/mobile/openapi/lib/model/on_this_day_dto.dart b/mobile/openapi/lib/model/on_this_day_dto.dart index 77ae96532f..e57cdfb1e6 100644 --- a/mobile/openapi/lib/model/on_this_day_dto.dart +++ b/mobile/openapi/lib/model/on_this_day_dto.dart @@ -44,10 +44,18 @@ class OnThisDayDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OnThisDayDto? fromJson(dynamic value) { - upgradeDto(value, "OnThisDayDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'year'), 'Required key "OnThisDayDto[year]" is missing from JSON.'); + assert(json[r'year'] != null, 'Required key "OnThisDayDto[year]" has a null value in JSON.'); + return true; + }()); + return OnThisDayDto( year: mapValueOfType(json, r'year')!, ); diff --git a/mobile/openapi/lib/model/onboarding_dto.dart b/mobile/openapi/lib/model/onboarding_dto.dart index 8499bc9b9a..31d9dac4fe 100644 --- a/mobile/openapi/lib/model/onboarding_dto.dart +++ b/mobile/openapi/lib/model/onboarding_dto.dart @@ -41,10 +41,18 @@ class OnboardingDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OnboardingDto? fromJson(dynamic value) { - upgradeDto(value, "OnboardingDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'isOnboarded'), 'Required key "OnboardingDto[isOnboarded]" is missing from JSON.'); + assert(json[r'isOnboarded'] != null, 'Required key "OnboardingDto[isOnboarded]" has a null value in JSON.'); + return true; + }()); + return OnboardingDto( isOnboarded: mapValueOfType(json, r'isOnboarded')!, ); diff --git a/mobile/openapi/lib/model/onboarding_response_dto.dart b/mobile/openapi/lib/model/onboarding_response_dto.dart index 2b0dbe2b96..d192915efe 100644 --- a/mobile/openapi/lib/model/onboarding_response_dto.dart +++ b/mobile/openapi/lib/model/onboarding_response_dto.dart @@ -41,10 +41,18 @@ class OnboardingResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static OnboardingResponseDto? fromJson(dynamic value) { - upgradeDto(value, "OnboardingResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'isOnboarded'), 'Required key "OnboardingResponseDto[isOnboarded]" is missing from JSON.'); + assert(json[r'isOnboarded'] != null, 'Required key "OnboardingResponseDto[isOnboarded]" has a null value in JSON.'); + return true; + }()); + return OnboardingResponseDto( isOnboarded: mapValueOfType(json, r'isOnboarded')!, ); diff --git a/mobile/openapi/lib/model/partner_create_dto.dart b/mobile/openapi/lib/model/partner_create_dto.dart index 30aa96ff30..a0289e2b6e 100644 --- a/mobile/openapi/lib/model/partner_create_dto.dart +++ b/mobile/openapi/lib/model/partner_create_dto.dart @@ -41,10 +41,18 @@ class PartnerCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PartnerCreateDto? fromJson(dynamic value) { - upgradeDto(value, "PartnerCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'sharedWithId'), 'Required key "PartnerCreateDto[sharedWithId]" is missing from JSON.'); + assert(json[r'sharedWithId'] != null, 'Required key "PartnerCreateDto[sharedWithId]" has a null value in JSON.'); + return true; + }()); + return PartnerCreateDto( sharedWithId: mapValueOfType(json, r'sharedWithId')!, ); diff --git a/mobile/openapi/lib/model/partner_direction.dart b/mobile/openapi/lib/model/partner_direction.dart index c5e3b308ac..c1e38b8dfe 100644 --- a/mobile/openapi/lib/model/partner_direction.dart +++ b/mobile/openapi/lib/model/partner_direction.dart @@ -23,13 +23,13 @@ class PartnerDirection { String toJson() => value; - static const by = PartnerDirection._(r'shared-by'); - static const with_ = PartnerDirection._(r'shared-with'); + static const sharedBy = PartnerDirection._(r'shared-by'); + static const sharedWith = PartnerDirection._(r'shared-with'); /// List of all possible values in this [enum][PartnerDirection]. static const values = [ - by, - with_, + sharedBy, + sharedWith, ]; static PartnerDirection? fromJson(dynamic value) => PartnerDirectionTypeTransformer().decode(value); @@ -68,8 +68,8 @@ class PartnerDirectionTypeTransformer { PartnerDirection? decode(dynamic data, {bool allowNull = true}) { if (data != null) { switch (data) { - case r'shared-by': return PartnerDirection.by; - case r'shared-with': return PartnerDirection.with_; + case r'shared-by': return PartnerDirection.sharedBy; + case r'shared-with': return PartnerDirection.sharedWith; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/mobile/openapi/lib/model/partner_response_dto.dart b/mobile/openapi/lib/model/partner_response_dto.dart index f4612cc98a..233bb3ed26 100644 --- a/mobile/openapi/lib/model/partner_response_dto.dart +++ b/mobile/openapi/lib/model/partner_response_dto.dart @@ -80,7 +80,7 @@ class PartnerResponseDto { if (this.inTimeline != null) { json[r'inTimeline'] = this.inTimeline; } else { - // json[r'inTimeline'] = null; + json[r'inTimeline'] = null; } json[r'name'] = this.name; json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); @@ -92,10 +92,28 @@ class PartnerResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PartnerResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PartnerResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'avatarColor'), 'Required key "PartnerResponseDto[avatarColor]" is missing from JSON.'); + assert(json[r'avatarColor'] != null, 'Required key "PartnerResponseDto[avatarColor]" has a null value in JSON.'); + assert(json.containsKey(r'email'), 'Required key "PartnerResponseDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "PartnerResponseDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "PartnerResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PartnerResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "PartnerResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "PartnerResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'profileChangedAt'), 'Required key "PartnerResponseDto[profileChangedAt]" is missing from JSON.'); + assert(json[r'profileChangedAt'] != null, 'Required key "PartnerResponseDto[profileChangedAt]" has a null value in JSON.'); + assert(json.containsKey(r'profileImagePath'), 'Required key "PartnerResponseDto[profileImagePath]" is missing from JSON.'); + assert(json[r'profileImagePath'] != null, 'Required key "PartnerResponseDto[profileImagePath]" has a null value in JSON.'); + return true; + }()); + return PartnerResponseDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, email: mapValueOfType(json, r'email')!, diff --git a/mobile/openapi/lib/model/partner_update_dto.dart b/mobile/openapi/lib/model/partner_update_dto.dart index db3516e3a1..a9964883f3 100644 --- a/mobile/openapi/lib/model/partner_update_dto.dart +++ b/mobile/openapi/lib/model/partner_update_dto.dart @@ -41,10 +41,18 @@ class PartnerUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PartnerUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "PartnerUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'inTimeline'), 'Required key "PartnerUpdateDto[inTimeline]" is missing from JSON.'); + assert(json[r'inTimeline'] != null, 'Required key "PartnerUpdateDto[inTimeline]" has a null value in JSON.'); + return true; + }()); + return PartnerUpdateDto( inTimeline: mapValueOfType(json, r'inTimeline')!, ); diff --git a/mobile/openapi/lib/model/people_response.dart b/mobile/openapi/lib/model/people_response.dart index 9d5d8ec18a..5c42e0acd1 100644 --- a/mobile/openapi/lib/model/people_response.dart +++ b/mobile/openapi/lib/model/people_response.dart @@ -48,10 +48,20 @@ class PeopleResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PeopleResponse? fromJson(dynamic value) { - upgradeDto(value, "PeopleResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "PeopleResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "PeopleResponse[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'sidebarWeb'), 'Required key "PeopleResponse[sidebarWeb]" is missing from JSON.'); + assert(json[r'sidebarWeb'] != null, 'Required key "PeopleResponse[sidebarWeb]" has a null value in JSON.'); + return true; + }()); + return PeopleResponse( enabled: mapValueOfType(json, r'enabled')!, sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, diff --git a/mobile/openapi/lib/model/people_response_dto.dart b/mobile/openapi/lib/model/people_response_dto.dart index 87edc6b4a7..12bafd0b5e 100644 --- a/mobile/openapi/lib/model/people_response_dto.dart +++ b/mobile/openapi/lib/model/people_response_dto.dart @@ -65,7 +65,7 @@ class PeopleResponseDto { if (this.hasNextPage != null) { json[r'hasNextPage'] = this.hasNextPage; } else { - // json[r'hasNextPage'] = null; + json[r'hasNextPage'] = null; } json[r'hidden'] = this.hidden; json[r'people'] = this.people; @@ -77,10 +77,22 @@ class PeopleResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PeopleResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PeopleResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'hidden'), 'Required key "PeopleResponseDto[hidden]" is missing from JSON.'); + assert(json[r'hidden'] != null, 'Required key "PeopleResponseDto[hidden]" has a null value in JSON.'); + assert(json.containsKey(r'people'), 'Required key "PeopleResponseDto[people]" is missing from JSON.'); + assert(json[r'people'] != null, 'Required key "PeopleResponseDto[people]" has a null value in JSON.'); + assert(json.containsKey(r'total'), 'Required key "PeopleResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "PeopleResponseDto[total]" has a null value in JSON.'); + return true; + }()); + return PeopleResponseDto( hasNextPage: mapValueOfType(json, r'hasNextPage'), hidden: mapValueOfType(json, r'hidden')!, diff --git a/mobile/openapi/lib/model/people_update.dart b/mobile/openapi/lib/model/people_update.dart index fe16479bac..bc84d81663 100644 --- a/mobile/openapi/lib/model/people_update.dart +++ b/mobile/openapi/lib/model/people_update.dart @@ -54,12 +54,12 @@ class PeopleUpdate { if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } if (this.sidebarWeb != null) { json[r'sidebarWeb'] = this.sidebarWeb; } else { - // json[r'sidebarWeb'] = null; + json[r'sidebarWeb'] = null; } return json; } @@ -68,10 +68,16 @@ class PeopleUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PeopleUpdate? fromJson(dynamic value) { - upgradeDto(value, "PeopleUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PeopleUpdate( enabled: mapValueOfType(json, r'enabled'), sidebarWeb: mapValueOfType(json, r'sidebarWeb'), diff --git a/mobile/openapi/lib/model/people_update_dto.dart b/mobile/openapi/lib/model/people_update_dto.dart index c9ce74d659..148fa36952 100644 --- a/mobile/openapi/lib/model/people_update_dto.dart +++ b/mobile/openapi/lib/model/people_update_dto.dart @@ -41,10 +41,18 @@ class PeopleUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PeopleUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "PeopleUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'people'), 'Required key "PeopleUpdateDto[people]" is missing from JSON.'); + assert(json[r'people'] != null, 'Required key "PeopleUpdateDto[people]" has a null value in JSON.'); + return true; + }()); + return PeopleUpdateDto( people: PeopleUpdateItem.listFromJson(json[r'people']), ); diff --git a/mobile/openapi/lib/model/people_update_item.dart b/mobile/openapi/lib/model/people_update_item.dart index 5e20aeb464..17fc349e8f 100644 --- a/mobile/openapi/lib/model/people_update_item.dart +++ b/mobile/openapi/lib/model/people_update_item.dart @@ -96,33 +96,33 @@ class PeopleUpdateItem { if (this.birthDate != null) { json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); } else { - // json[r'birthDate'] = null; + json[r'birthDate'] = null; } if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } if (this.featureFaceAssetId != null) { json[r'featureFaceAssetId'] = this.featureFaceAssetId; } else { - // json[r'featureFaceAssetId'] = null; + json[r'featureFaceAssetId'] = null; } json[r'id'] = this.id; if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isHidden != null) { json[r'isHidden'] = this.isHidden; } else { - // json[r'isHidden'] = null; + json[r'isHidden'] = null; } if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } return json; } @@ -131,10 +131,18 @@ class PeopleUpdateItem { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PeopleUpdateItem? fromJson(dynamic value) { - upgradeDto(value, "PeopleUpdateItem"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'id'), 'Required key "PeopleUpdateItem[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PeopleUpdateItem[id]" has a null value in JSON.'); + return true; + }()); + return PeopleUpdateItem( birthDate: mapDateTime(json, r'birthDate', r''), color: mapValueOfType(json, r'color'), diff --git a/mobile/openapi/lib/model/person_create_dto.dart b/mobile/openapi/lib/model/person_create_dto.dart index f2ba702c2f..0f9f9fbbce 100644 --- a/mobile/openapi/lib/model/person_create_dto.dart +++ b/mobile/openapi/lib/model/person_create_dto.dart @@ -78,27 +78,27 @@ class PersonCreateDto { if (this.birthDate != null) { json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); } else { - // json[r'birthDate'] = null; + json[r'birthDate'] = null; } if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isHidden != null) { json[r'isHidden'] = this.isHidden; } else { - // json[r'isHidden'] = null; + json[r'isHidden'] = null; } if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } return json; } @@ -107,10 +107,16 @@ class PersonCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PersonCreateDto? fromJson(dynamic value) { - upgradeDto(value, "PersonCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PersonCreateDto( birthDate: mapDateTime(json, r'birthDate', r''), color: mapValueOfType(json, r'color'), diff --git a/mobile/openapi/lib/model/person_response_dto.dart b/mobile/openapi/lib/model/person_response_dto.dart index 455dfb98d6..f4f79c2674 100644 --- a/mobile/openapi/lib/model/person_response_dto.dart +++ b/mobile/openapi/lib/model/person_response_dto.dart @@ -96,18 +96,18 @@ class PersonResponseDto { if (this.birthDate != null) { json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); } else { - // json[r'birthDate'] = null; + json[r'birthDate'] = null; } if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } json[r'id'] = this.id; if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } json[r'isHidden'] = this.isHidden; json[r'name'] = this.name; @@ -115,7 +115,7 @@ class PersonResponseDto { if (this.updatedAt != null) { json[r'updatedAt'] = this.updatedAt!.toUtc().toIso8601String(); } else { - // json[r'updatedAt'] = null; + json[r'updatedAt'] = null; } return json; } @@ -124,10 +124,25 @@ class PersonResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PersonResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PersonResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'birthDate'), 'Required key "PersonResponseDto[birthDate]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "PersonResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PersonResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isHidden'), 'Required key "PersonResponseDto[isHidden]" is missing from JSON.'); + assert(json[r'isHidden'] != null, 'Required key "PersonResponseDto[isHidden]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "PersonResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "PersonResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnailPath'), 'Required key "PersonResponseDto[thumbnailPath]" is missing from JSON.'); + assert(json[r'thumbnailPath'] != null, 'Required key "PersonResponseDto[thumbnailPath]" has a null value in JSON.'); + return true; + }()); + return PersonResponseDto( birthDate: mapDateTime(json, r'birthDate', r''), color: mapValueOfType(json, r'color'), diff --git a/mobile/openapi/lib/model/person_statistics_response_dto.dart b/mobile/openapi/lib/model/person_statistics_response_dto.dart index aeac16cc8a..52ece56da6 100644 --- a/mobile/openapi/lib/model/person_statistics_response_dto.dart +++ b/mobile/openapi/lib/model/person_statistics_response_dto.dart @@ -44,10 +44,18 @@ class PersonStatisticsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PersonStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PersonStatisticsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assets'), 'Required key "PersonStatisticsResponseDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "PersonStatisticsResponseDto[assets]" has a null value in JSON.'); + return true; + }()); + return PersonStatisticsResponseDto( assets: mapValueOfType(json, r'assets')!, ); diff --git a/mobile/openapi/lib/model/person_update_dto.dart b/mobile/openapi/lib/model/person_update_dto.dart index b56940e51d..9c44c0def9 100644 --- a/mobile/openapi/lib/model/person_update_dto.dart +++ b/mobile/openapi/lib/model/person_update_dto.dart @@ -90,32 +90,32 @@ class PersonUpdateDto { if (this.birthDate != null) { json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); } else { - // json[r'birthDate'] = null; + json[r'birthDate'] = null; } if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } if (this.featureFaceAssetId != null) { json[r'featureFaceAssetId'] = this.featureFaceAssetId; } else { - // json[r'featureFaceAssetId'] = null; + json[r'featureFaceAssetId'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isHidden != null) { json[r'isHidden'] = this.isHidden; } else { - // json[r'isHidden'] = null; + json[r'isHidden'] = null; } if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } return json; } @@ -124,10 +124,16 @@ class PersonUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PersonUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "PersonUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PersonUpdateDto( birthDate: mapDateTime(json, r'birthDate', r''), color: mapValueOfType(json, r'color'), diff --git a/mobile/openapi/lib/model/person_with_faces_response_dto.dart b/mobile/openapi/lib/model/person_with_faces_response_dto.dart index f710dff8b9..72c8380b2b 100644 --- a/mobile/openapi/lib/model/person_with_faces_response_dto.dart +++ b/mobile/openapi/lib/model/person_with_faces_response_dto.dart @@ -101,19 +101,19 @@ class PersonWithFacesResponseDto { if (this.birthDate != null) { json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); } else { - // json[r'birthDate'] = null; + json[r'birthDate'] = null; } if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } json[r'faces'] = this.faces; json[r'id'] = this.id; if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } json[r'isHidden'] = this.isHidden; json[r'name'] = this.name; @@ -121,7 +121,7 @@ class PersonWithFacesResponseDto { if (this.updatedAt != null) { json[r'updatedAt'] = this.updatedAt!.toUtc().toIso8601String(); } else { - // json[r'updatedAt'] = null; + json[r'updatedAt'] = null; } return json; } @@ -130,10 +130,27 @@ class PersonWithFacesResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PersonWithFacesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PersonWithFacesResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'birthDate'), 'Required key "PersonWithFacesResponseDto[birthDate]" is missing from JSON.'); + assert(json.containsKey(r'faces'), 'Required key "PersonWithFacesResponseDto[faces]" is missing from JSON.'); + assert(json[r'faces'] != null, 'Required key "PersonWithFacesResponseDto[faces]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "PersonWithFacesResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PersonWithFacesResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isHidden'), 'Required key "PersonWithFacesResponseDto[isHidden]" is missing from JSON.'); + assert(json[r'isHidden'] != null, 'Required key "PersonWithFacesResponseDto[isHidden]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "PersonWithFacesResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "PersonWithFacesResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnailPath'), 'Required key "PersonWithFacesResponseDto[thumbnailPath]" is missing from JSON.'); + assert(json[r'thumbnailPath'] != null, 'Required key "PersonWithFacesResponseDto[thumbnailPath]" has a null value in JSON.'); + return true; + }()); + return PersonWithFacesResponseDto( birthDate: mapDateTime(json, r'birthDate', r''), color: mapValueOfType(json, r'color'), diff --git a/mobile/openapi/lib/model/pin_code_change_dto.dart b/mobile/openapi/lib/model/pin_code_change_dto.dart index 068cc9e91b..7f74585847 100644 --- a/mobile/openapi/lib/model/pin_code_change_dto.dart +++ b/mobile/openapi/lib/model/pin_code_change_dto.dart @@ -61,12 +61,12 @@ class PinCodeChangeDto { if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } if (this.pinCode != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + json[r'pinCode'] = null; } return json; } @@ -75,10 +75,18 @@ class PinCodeChangeDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PinCodeChangeDto? fromJson(dynamic value) { - upgradeDto(value, "PinCodeChangeDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'newPinCode'), 'Required key "PinCodeChangeDto[newPinCode]" is missing from JSON.'); + assert(json[r'newPinCode'] != null, 'Required key "PinCodeChangeDto[newPinCode]" has a null value in JSON.'); + return true; + }()); + return PinCodeChangeDto( newPinCode: mapValueOfType(json, r'newPinCode')!, password: mapValueOfType(json, r'password'), diff --git a/mobile/openapi/lib/model/pin_code_reset_dto.dart b/mobile/openapi/lib/model/pin_code_reset_dto.dart index c37be76f18..bdc6d17258 100644 --- a/mobile/openapi/lib/model/pin_code_reset_dto.dart +++ b/mobile/openapi/lib/model/pin_code_reset_dto.dart @@ -54,12 +54,12 @@ class PinCodeResetDto { if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } if (this.pinCode != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + json[r'pinCode'] = null; } return json; } @@ -68,10 +68,16 @@ class PinCodeResetDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PinCodeResetDto? fromJson(dynamic value) { - upgradeDto(value, "PinCodeResetDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PinCodeResetDto( password: mapValueOfType(json, r'password'), pinCode: mapValueOfType(json, r'pinCode'), diff --git a/mobile/openapi/lib/model/pin_code_setup_dto.dart b/mobile/openapi/lib/model/pin_code_setup_dto.dart index e2f08f102b..3c14e00a1c 100644 --- a/mobile/openapi/lib/model/pin_code_setup_dto.dart +++ b/mobile/openapi/lib/model/pin_code_setup_dto.dart @@ -41,10 +41,18 @@ class PinCodeSetupDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PinCodeSetupDto? fromJson(dynamic value) { - upgradeDto(value, "PinCodeSetupDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'pinCode'), 'Required key "PinCodeSetupDto[pinCode]" is missing from JSON.'); + assert(json[r'pinCode'] != null, 'Required key "PinCodeSetupDto[pinCode]" has a null value in JSON.'); + return true; + }()); + return PinCodeSetupDto( pinCode: mapValueOfType(json, r'pinCode')!, ); diff --git a/mobile/openapi/lib/model/places_response_dto.dart b/mobile/openapi/lib/model/places_response_dto.dart index 94aa58eba4..115c2a33af 100644 --- a/mobile/openapi/lib/model/places_response_dto.dart +++ b/mobile/openapi/lib/model/places_response_dto.dart @@ -72,12 +72,12 @@ class PlacesResponseDto { if (this.admin1name != null) { json[r'admin1name'] = this.admin1name; } else { - // json[r'admin1name'] = null; + json[r'admin1name'] = null; } if (this.admin2name != null) { json[r'admin2name'] = this.admin2name; } else { - // json[r'admin2name'] = null; + json[r'admin2name'] = null; } json[r'latitude'] = this.latitude; json[r'longitude'] = this.longitude; @@ -89,10 +89,22 @@ class PlacesResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PlacesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PlacesResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'latitude'), 'Required key "PlacesResponseDto[latitude]" is missing from JSON.'); + assert(json[r'latitude'] != null, 'Required key "PlacesResponseDto[latitude]" has a null value in JSON.'); + assert(json.containsKey(r'longitude'), 'Required key "PlacesResponseDto[longitude]" is missing from JSON.'); + assert(json[r'longitude'] != null, 'Required key "PlacesResponseDto[longitude]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "PlacesResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "PlacesResponseDto[name]" has a null value in JSON.'); + return true; + }()); + return PlacesResponseDto( admin1name: mapValueOfType(json, r'admin1name'), admin2name: mapValueOfType(json, r'admin2name'), diff --git a/mobile/openapi/lib/model/plugin_action_response_dto.dart b/mobile/openapi/lib/model/plugin_action_response_dto.dart index cff2dc92f7..0b322066af 100644 --- a/mobile/openapi/lib/model/plugin_action_response_dto.dart +++ b/mobile/openapi/lib/model/plugin_action_response_dto.dart @@ -76,7 +76,7 @@ class PluginActionResponseDto { if (this.schema != null) { json[r'schema'] = this.schema; } else { - // json[r'schema'] = null; + json[r'schema'] = null; } json[r'supportedContexts'] = this.supportedContexts; json[r'title'] = this.title; @@ -87,10 +87,29 @@ class PluginActionResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginActionResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginActionResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'description'), 'Required key "PluginActionResponseDto[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "PluginActionResponseDto[description]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "PluginActionResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PluginActionResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'methodName'), 'Required key "PluginActionResponseDto[methodName]" is missing from JSON.'); + assert(json[r'methodName'] != null, 'Required key "PluginActionResponseDto[methodName]" has a null value in JSON.'); + assert(json.containsKey(r'pluginId'), 'Required key "PluginActionResponseDto[pluginId]" is missing from JSON.'); + assert(json[r'pluginId'] != null, 'Required key "PluginActionResponseDto[pluginId]" has a null value in JSON.'); + assert(json.containsKey(r'schema'), 'Required key "PluginActionResponseDto[schema]" is missing from JSON.'); + assert(json.containsKey(r'supportedContexts'), 'Required key "PluginActionResponseDto[supportedContexts]" is missing from JSON.'); + assert(json[r'supportedContexts'] != null, 'Required key "PluginActionResponseDto[supportedContexts]" has a null value in JSON.'); + assert(json.containsKey(r'title'), 'Required key "PluginActionResponseDto[title]" is missing from JSON.'); + assert(json[r'title'] != null, 'Required key "PluginActionResponseDto[title]" has a null value in JSON.'); + return true; + }()); + return PluginActionResponseDto( description: mapValueOfType(json, r'description')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/plugin_filter_response_dto.dart b/mobile/openapi/lib/model/plugin_filter_response_dto.dart index d1ab867ff9..1012a73aa5 100644 --- a/mobile/openapi/lib/model/plugin_filter_response_dto.dart +++ b/mobile/openapi/lib/model/plugin_filter_response_dto.dart @@ -76,7 +76,7 @@ class PluginFilterResponseDto { if (this.schema != null) { json[r'schema'] = this.schema; } else { - // json[r'schema'] = null; + json[r'schema'] = null; } json[r'supportedContexts'] = this.supportedContexts; json[r'title'] = this.title; @@ -87,10 +87,29 @@ class PluginFilterResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginFilterResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginFilterResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'description'), 'Required key "PluginFilterResponseDto[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "PluginFilterResponseDto[description]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "PluginFilterResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PluginFilterResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'methodName'), 'Required key "PluginFilterResponseDto[methodName]" is missing from JSON.'); + assert(json[r'methodName'] != null, 'Required key "PluginFilterResponseDto[methodName]" has a null value in JSON.'); + assert(json.containsKey(r'pluginId'), 'Required key "PluginFilterResponseDto[pluginId]" is missing from JSON.'); + assert(json[r'pluginId'] != null, 'Required key "PluginFilterResponseDto[pluginId]" has a null value in JSON.'); + assert(json.containsKey(r'schema'), 'Required key "PluginFilterResponseDto[schema]" is missing from JSON.'); + assert(json.containsKey(r'supportedContexts'), 'Required key "PluginFilterResponseDto[supportedContexts]" is missing from JSON.'); + assert(json[r'supportedContexts'] != null, 'Required key "PluginFilterResponseDto[supportedContexts]" has a null value in JSON.'); + assert(json.containsKey(r'title'), 'Required key "PluginFilterResponseDto[title]" is missing from JSON.'); + assert(json[r'title'] != null, 'Required key "PluginFilterResponseDto[title]" has a null value in JSON.'); + return true; + }()); + return PluginFilterResponseDto( description: mapValueOfType(json, r'description')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/plugin_json_schema.dart b/mobile/openapi/lib/model/plugin_json_schema.dart index f7a2d584d9..4396c47b1e 100644 --- a/mobile/openapi/lib/model/plugin_json_schema.dart +++ b/mobile/openapi/lib/model/plugin_json_schema.dart @@ -73,19 +73,19 @@ class PluginJsonSchema { if (this.additionalProperties != null) { json[r'additionalProperties'] = this.additionalProperties; } else { - // json[r'additionalProperties'] = null; + json[r'additionalProperties'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } json[r'properties'] = this.properties; json[r'required'] = this.required_; if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } return json; } @@ -94,10 +94,16 @@ class PluginJsonSchema { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginJsonSchema? fromJson(dynamic value) { - upgradeDto(value, "PluginJsonSchema"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PluginJsonSchema( additionalProperties: mapValueOfType(json, r'additionalProperties'), description: mapValueOfType(json, r'description'), diff --git a/mobile/openapi/lib/model/plugin_json_schema_property.dart b/mobile/openapi/lib/model/plugin_json_schema_property.dart index 65951da0a3..cee52c647b 100644 --- a/mobile/openapi/lib/model/plugin_json_schema_property.dart +++ b/mobile/openapi/lib/model/plugin_json_schema_property.dart @@ -94,30 +94,30 @@ class PluginJsonSchemaProperty { if (this.additionalProperties != null) { json[r'additionalProperties'] = this.additionalProperties; } else { - // json[r'additionalProperties'] = null; + json[r'additionalProperties'] = null; } if (this.default_ != null) { json[r'default'] = this.default_; } else { - // json[r'default'] = null; + json[r'default'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } json[r'enum'] = this.enum_; if (this.items != null) { json[r'items'] = this.items; } else { - // json[r'items'] = null; + json[r'items'] = null; } json[r'properties'] = this.properties; json[r'required'] = this.required_; if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } return json; } @@ -126,10 +126,16 @@ class PluginJsonSchemaProperty { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginJsonSchemaProperty? fromJson(dynamic value) { - upgradeDto(value, "PluginJsonSchemaProperty"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PluginJsonSchemaProperty( additionalProperties: PluginJsonSchemaPropertyAdditionalProperties.fromJson(json[r'additionalProperties']), default_: mapValueOfType(json, r'default'), diff --git a/mobile/openapi/lib/model/plugin_json_schema_property_additional_properties.dart b/mobile/openapi/lib/model/plugin_json_schema_property_additional_properties.dart index 169c6be772..671a99930d 100644 --- a/mobile/openapi/lib/model/plugin_json_schema_property_additional_properties.dart +++ b/mobile/openapi/lib/model/plugin_json_schema_property_additional_properties.dart @@ -94,30 +94,30 @@ class PluginJsonSchemaPropertyAdditionalProperties { if (this.additionalProperties != null) { json[r'additionalProperties'] = this.additionalProperties; } else { - // json[r'additionalProperties'] = null; + json[r'additionalProperties'] = null; } if (this.default_ != null) { json[r'default'] = this.default_; } else { - // json[r'default'] = null; + json[r'default'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } json[r'enum'] = this.enum_; if (this.items != null) { json[r'items'] = this.items; } else { - // json[r'items'] = null; + json[r'items'] = null; } json[r'properties'] = this.properties; json[r'required'] = this.required_; if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } return json; } @@ -126,10 +126,16 @@ class PluginJsonSchemaPropertyAdditionalProperties { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginJsonSchemaPropertyAdditionalProperties? fromJson(dynamic value) { - upgradeDto(value, "PluginJsonSchemaPropertyAdditionalProperties"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PluginJsonSchemaPropertyAdditionalProperties( additionalProperties: PluginJsonSchemaPropertyAdditionalProperties.fromJson(json[r'additionalProperties']), default_: mapValueOfType(json, r'default'), diff --git a/mobile/openapi/lib/model/plugin_response_dto.dart b/mobile/openapi/lib/model/plugin_response_dto.dart index 7a99896475..b10115a021 100644 --- a/mobile/openapi/lib/model/plugin_response_dto.dart +++ b/mobile/openapi/lib/model/plugin_response_dto.dart @@ -104,10 +104,36 @@ class PluginResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'actions'), 'Required key "PluginResponseDto[actions]" is missing from JSON.'); + assert(json[r'actions'] != null, 'Required key "PluginResponseDto[actions]" has a null value in JSON.'); + assert(json.containsKey(r'author'), 'Required key "PluginResponseDto[author]" is missing from JSON.'); + assert(json[r'author'] != null, 'Required key "PluginResponseDto[author]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "PluginResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "PluginResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'description'), 'Required key "PluginResponseDto[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "PluginResponseDto[description]" has a null value in JSON.'); + assert(json.containsKey(r'filters'), 'Required key "PluginResponseDto[filters]" is missing from JSON.'); + assert(json[r'filters'] != null, 'Required key "PluginResponseDto[filters]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "PluginResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "PluginResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "PluginResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "PluginResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'title'), 'Required key "PluginResponseDto[title]" is missing from JSON.'); + assert(json[r'title'] != null, 'Required key "PluginResponseDto[title]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "PluginResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "PluginResponseDto[updatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'version'), 'Required key "PluginResponseDto[version]" is missing from JSON.'); + assert(json[r'version'] != null, 'Required key "PluginResponseDto[version]" has a null value in JSON.'); + return true; + }()); + return PluginResponseDto( actions: PluginActionResponseDto.listFromJson(json[r'actions']), author: mapValueOfType(json, r'author')!, diff --git a/mobile/openapi/lib/model/plugin_trigger_response_dto.dart b/mobile/openapi/lib/model/plugin_trigger_response_dto.dart index a6ee1c6b69..ebbbb0afb2 100644 --- a/mobile/openapi/lib/model/plugin_trigger_response_dto.dart +++ b/mobile/openapi/lib/model/plugin_trigger_response_dto.dart @@ -46,10 +46,20 @@ class PluginTriggerResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PluginTriggerResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginTriggerResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'contextType'), 'Required key "PluginTriggerResponseDto[contextType]" is missing from JSON.'); + assert(json[r'contextType'] != null, 'Required key "PluginTriggerResponseDto[contextType]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "PluginTriggerResponseDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "PluginTriggerResponseDto[type]" has a null value in JSON.'); + return true; + }()); + return PluginTriggerResponseDto( contextType: PluginContextType.fromJson(json[r'contextType'])!, type: PluginTriggerType.fromJson(json[r'type'])!, diff --git a/mobile/openapi/lib/model/purchase_response.dart b/mobile/openapi/lib/model/purchase_response.dart index e55c286629..23d3ff5f64 100644 --- a/mobile/openapi/lib/model/purchase_response.dart +++ b/mobile/openapi/lib/model/purchase_response.dart @@ -48,10 +48,20 @@ class PurchaseResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PurchaseResponse? fromJson(dynamic value) { - upgradeDto(value, "PurchaseResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'hideBuyButtonUntil'), 'Required key "PurchaseResponse[hideBuyButtonUntil]" is missing from JSON.'); + assert(json[r'hideBuyButtonUntil'] != null, 'Required key "PurchaseResponse[hideBuyButtonUntil]" has a null value in JSON.'); + assert(json.containsKey(r'showSupportBadge'), 'Required key "PurchaseResponse[showSupportBadge]" is missing from JSON.'); + assert(json[r'showSupportBadge'] != null, 'Required key "PurchaseResponse[showSupportBadge]" has a null value in JSON.'); + return true; + }()); + return PurchaseResponse( hideBuyButtonUntil: mapValueOfType(json, r'hideBuyButtonUntil')!, showSupportBadge: mapValueOfType(json, r'showSupportBadge')!, diff --git a/mobile/openapi/lib/model/purchase_update.dart b/mobile/openapi/lib/model/purchase_update.dart index 913faf9bc4..85a3d44038 100644 --- a/mobile/openapi/lib/model/purchase_update.dart +++ b/mobile/openapi/lib/model/purchase_update.dart @@ -54,12 +54,12 @@ class PurchaseUpdate { if (this.hideBuyButtonUntil != null) { json[r'hideBuyButtonUntil'] = this.hideBuyButtonUntil; } else { - // json[r'hideBuyButtonUntil'] = null; + json[r'hideBuyButtonUntil'] = null; } if (this.showSupportBadge != null) { json[r'showSupportBadge'] = this.showSupportBadge; } else { - // json[r'showSupportBadge'] = null; + json[r'showSupportBadge'] = null; } return json; } @@ -68,10 +68,16 @@ class PurchaseUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static PurchaseUpdate? fromJson(dynamic value) { - upgradeDto(value, "PurchaseUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return PurchaseUpdate( hideBuyButtonUntil: mapValueOfType(json, r'hideBuyButtonUntil'), showSupportBadge: mapValueOfType(json, r'showSupportBadge'), diff --git a/mobile/openapi/lib/model/queue_command_dto.dart b/mobile/openapi/lib/model/queue_command_dto.dart index fb68d85583..e7493b7b0a 100644 --- a/mobile/openapi/lib/model/queue_command_dto.dart +++ b/mobile/openapi/lib/model/queue_command_dto.dart @@ -48,7 +48,7 @@ class QueueCommandDto { if (this.force != null) { json[r'force'] = this.force; } else { - // json[r'force'] = null; + json[r'force'] = null; } return json; } @@ -57,10 +57,18 @@ class QueueCommandDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueCommandDto? fromJson(dynamic value) { - upgradeDto(value, "QueueCommandDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'command'), 'Required key "QueueCommandDto[command]" is missing from JSON.'); + assert(json[r'command'] != null, 'Required key "QueueCommandDto[command]" has a null value in JSON.'); + return true; + }()); + return QueueCommandDto( command: QueueCommand.fromJson(json[r'command'])!, force: mapValueOfType(json, r'force'), diff --git a/mobile/openapi/lib/model/queue_delete_dto.dart b/mobile/openapi/lib/model/queue_delete_dto.dart index d319238f92..07c441a499 100644 --- a/mobile/openapi/lib/model/queue_delete_dto.dart +++ b/mobile/openapi/lib/model/queue_delete_dto.dart @@ -42,7 +42,7 @@ class QueueDeleteDto { if (this.failed != null) { json[r'failed'] = this.failed; } else { - // json[r'failed'] = null; + json[r'failed'] = null; } return json; } @@ -51,10 +51,16 @@ class QueueDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "QueueDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return QueueDeleteDto( failed: mapValueOfType(json, r'failed'), ); diff --git a/mobile/openapi/lib/model/queue_job_response_dto.dart b/mobile/openapi/lib/model/queue_job_response_dto.dart index 06d433edad..e85a1ac31d 100644 --- a/mobile/openapi/lib/model/queue_job_response_dto.dart +++ b/mobile/openapi/lib/model/queue_job_response_dto.dart @@ -63,7 +63,7 @@ class QueueJobResponseDto { if (this.id != null) { json[r'id'] = this.id; } else { - // json[r'id'] = null; + json[r'id'] = null; } json[r'name'] = this.name; json[r'timestamp'] = this.timestamp; @@ -74,10 +74,22 @@ class QueueJobResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueJobResponseDto? fromJson(dynamic value) { - upgradeDto(value, "QueueJobResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'data'), 'Required key "QueueJobResponseDto[data]" is missing from JSON.'); + assert(json[r'data'] != null, 'Required key "QueueJobResponseDto[data]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "QueueJobResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "QueueJobResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'timestamp'), 'Required key "QueueJobResponseDto[timestamp]" is missing from JSON.'); + assert(json[r'timestamp'] != null, 'Required key "QueueJobResponseDto[timestamp]" has a null value in JSON.'); + return true; + }()); + return QueueJobResponseDto( data: mapCastOfType(json, r'data')!, id: mapValueOfType(json, r'id'), diff --git a/mobile/openapi/lib/model/queue_response_dto.dart b/mobile/openapi/lib/model/queue_response_dto.dart index c88f9fc195..827b6bed0e 100644 --- a/mobile/openapi/lib/model/queue_response_dto.dart +++ b/mobile/openapi/lib/model/queue_response_dto.dart @@ -53,10 +53,22 @@ class QueueResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueResponseDto? fromJson(dynamic value) { - upgradeDto(value, "QueueResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'isPaused'), 'Required key "QueueResponseDto[isPaused]" is missing from JSON.'); + assert(json[r'isPaused'] != null, 'Required key "QueueResponseDto[isPaused]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "QueueResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "QueueResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'statistics'), 'Required key "QueueResponseDto[statistics]" is missing from JSON.'); + assert(json[r'statistics'] != null, 'Required key "QueueResponseDto[statistics]" has a null value in JSON.'); + return true; + }()); + return QueueResponseDto( isPaused: mapValueOfType(json, r'isPaused')!, name: QueueName.fromJson(json[r'name'])!, diff --git a/mobile/openapi/lib/model/queue_response_legacy_dto.dart b/mobile/openapi/lib/model/queue_response_legacy_dto.dart index 214b0b31f6..e77505b9f7 100644 --- a/mobile/openapi/lib/model/queue_response_legacy_dto.dart +++ b/mobile/openapi/lib/model/queue_response_legacy_dto.dart @@ -46,10 +46,20 @@ class QueueResponseLegacyDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueResponseLegacyDto? fromJson(dynamic value) { - upgradeDto(value, "QueueResponseLegacyDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'jobCounts'), 'Required key "QueueResponseLegacyDto[jobCounts]" is missing from JSON.'); + assert(json[r'jobCounts'] != null, 'Required key "QueueResponseLegacyDto[jobCounts]" has a null value in JSON.'); + assert(json.containsKey(r'queueStatus'), 'Required key "QueueResponseLegacyDto[queueStatus]" is missing from JSON.'); + assert(json[r'queueStatus'] != null, 'Required key "QueueResponseLegacyDto[queueStatus]" has a null value in JSON.'); + return true; + }()); + return QueueResponseLegacyDto( jobCounts: QueueStatisticsDto.fromJson(json[r'jobCounts'])!, queueStatus: QueueStatusLegacyDto.fromJson(json[r'queueStatus'])!, diff --git a/mobile/openapi/lib/model/queue_statistics_dto.dart b/mobile/openapi/lib/model/queue_statistics_dto.dart index 86c75f8e7c..9c46ce1984 100644 --- a/mobile/openapi/lib/model/queue_statistics_dto.dart +++ b/mobile/openapi/lib/model/queue_statistics_dto.dart @@ -94,10 +94,28 @@ class QueueStatisticsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueStatisticsDto? fromJson(dynamic value) { - upgradeDto(value, "QueueStatisticsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'active'), 'Required key "QueueStatisticsDto[active]" is missing from JSON.'); + assert(json[r'active'] != null, 'Required key "QueueStatisticsDto[active]" has a null value in JSON.'); + assert(json.containsKey(r'completed'), 'Required key "QueueStatisticsDto[completed]" is missing from JSON.'); + assert(json[r'completed'] != null, 'Required key "QueueStatisticsDto[completed]" has a null value in JSON.'); + assert(json.containsKey(r'delayed'), 'Required key "QueueStatisticsDto[delayed]" is missing from JSON.'); + assert(json[r'delayed'] != null, 'Required key "QueueStatisticsDto[delayed]" has a null value in JSON.'); + assert(json.containsKey(r'failed'), 'Required key "QueueStatisticsDto[failed]" is missing from JSON.'); + assert(json[r'failed'] != null, 'Required key "QueueStatisticsDto[failed]" has a null value in JSON.'); + assert(json.containsKey(r'paused'), 'Required key "QueueStatisticsDto[paused]" is missing from JSON.'); + assert(json[r'paused'] != null, 'Required key "QueueStatisticsDto[paused]" has a null value in JSON.'); + assert(json.containsKey(r'waiting'), 'Required key "QueueStatisticsDto[waiting]" is missing from JSON.'); + assert(json[r'waiting'] != null, 'Required key "QueueStatisticsDto[waiting]" has a null value in JSON.'); + return true; + }()); + return QueueStatisticsDto( active: mapValueOfType(json, r'active')!, completed: mapValueOfType(json, r'completed')!, diff --git a/mobile/openapi/lib/model/queue_status_legacy_dto.dart b/mobile/openapi/lib/model/queue_status_legacy_dto.dart index de6ce63319..589b0444fe 100644 --- a/mobile/openapi/lib/model/queue_status_legacy_dto.dart +++ b/mobile/openapi/lib/model/queue_status_legacy_dto.dart @@ -48,10 +48,20 @@ class QueueStatusLegacyDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueStatusLegacyDto? fromJson(dynamic value) { - upgradeDto(value, "QueueStatusLegacyDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'isActive'), 'Required key "QueueStatusLegacyDto[isActive]" is missing from JSON.'); + assert(json[r'isActive'] != null, 'Required key "QueueStatusLegacyDto[isActive]" has a null value in JSON.'); + assert(json.containsKey(r'isPaused'), 'Required key "QueueStatusLegacyDto[isPaused]" is missing from JSON.'); + assert(json[r'isPaused'] != null, 'Required key "QueueStatusLegacyDto[isPaused]" has a null value in JSON.'); + return true; + }()); + return QueueStatusLegacyDto( isActive: mapValueOfType(json, r'isActive')!, isPaused: mapValueOfType(json, r'isPaused')!, diff --git a/mobile/openapi/lib/model/queue_update_dto.dart b/mobile/openapi/lib/model/queue_update_dto.dart index 28aafe95f7..7224446229 100644 --- a/mobile/openapi/lib/model/queue_update_dto.dart +++ b/mobile/openapi/lib/model/queue_update_dto.dart @@ -42,7 +42,7 @@ class QueueUpdateDto { if (this.isPaused != null) { json[r'isPaused'] = this.isPaused; } else { - // json[r'isPaused'] = null; + json[r'isPaused'] = null; } return json; } @@ -51,10 +51,16 @@ class QueueUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueueUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "QueueUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return QueueUpdateDto( isPaused: mapValueOfType(json, r'isPaused'), ); diff --git a/mobile/openapi/lib/model/queues_response_legacy_dto.dart b/mobile/openapi/lib/model/queues_response_legacy_dto.dart index c7bc23cb4d..96028179dc 100644 --- a/mobile/openapi/lib/model/queues_response_legacy_dto.dart +++ b/mobile/openapi/lib/model/queues_response_legacy_dto.dart @@ -142,10 +142,52 @@ class QueuesResponseLegacyDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static QueuesResponseLegacyDto? fromJson(dynamic value) { - upgradeDto(value, "QueuesResponseLegacyDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'backgroundTask'), 'Required key "QueuesResponseLegacyDto[backgroundTask]" is missing from JSON.'); + assert(json[r'backgroundTask'] != null, 'Required key "QueuesResponseLegacyDto[backgroundTask]" has a null value in JSON.'); + assert(json.containsKey(r'backupDatabase'), 'Required key "QueuesResponseLegacyDto[backupDatabase]" is missing from JSON.'); + assert(json[r'backupDatabase'] != null, 'Required key "QueuesResponseLegacyDto[backupDatabase]" has a null value in JSON.'); + assert(json.containsKey(r'duplicateDetection'), 'Required key "QueuesResponseLegacyDto[duplicateDetection]" is missing from JSON.'); + assert(json[r'duplicateDetection'] != null, 'Required key "QueuesResponseLegacyDto[duplicateDetection]" has a null value in JSON.'); + assert(json.containsKey(r'editor'), 'Required key "QueuesResponseLegacyDto[editor]" is missing from JSON.'); + assert(json[r'editor'] != null, 'Required key "QueuesResponseLegacyDto[editor]" has a null value in JSON.'); + assert(json.containsKey(r'faceDetection'), 'Required key "QueuesResponseLegacyDto[faceDetection]" is missing from JSON.'); + assert(json[r'faceDetection'] != null, 'Required key "QueuesResponseLegacyDto[faceDetection]" has a null value in JSON.'); + assert(json.containsKey(r'facialRecognition'), 'Required key "QueuesResponseLegacyDto[facialRecognition]" is missing from JSON.'); + assert(json[r'facialRecognition'] != null, 'Required key "QueuesResponseLegacyDto[facialRecognition]" has a null value in JSON.'); + assert(json.containsKey(r'library'), 'Required key "QueuesResponseLegacyDto[library]" is missing from JSON.'); + assert(json[r'library'] != null, 'Required key "QueuesResponseLegacyDto[library]" has a null value in JSON.'); + assert(json.containsKey(r'metadataExtraction'), 'Required key "QueuesResponseLegacyDto[metadataExtraction]" is missing from JSON.'); + assert(json[r'metadataExtraction'] != null, 'Required key "QueuesResponseLegacyDto[metadataExtraction]" has a null value in JSON.'); + assert(json.containsKey(r'migration'), 'Required key "QueuesResponseLegacyDto[migration]" is missing from JSON.'); + assert(json[r'migration'] != null, 'Required key "QueuesResponseLegacyDto[migration]" has a null value in JSON.'); + assert(json.containsKey(r'notifications'), 'Required key "QueuesResponseLegacyDto[notifications]" is missing from JSON.'); + assert(json[r'notifications'] != null, 'Required key "QueuesResponseLegacyDto[notifications]" has a null value in JSON.'); + assert(json.containsKey(r'ocr'), 'Required key "QueuesResponseLegacyDto[ocr]" is missing from JSON.'); + assert(json[r'ocr'] != null, 'Required key "QueuesResponseLegacyDto[ocr]" has a null value in JSON.'); + assert(json.containsKey(r'search'), 'Required key "QueuesResponseLegacyDto[search]" is missing from JSON.'); + assert(json[r'search'] != null, 'Required key "QueuesResponseLegacyDto[search]" has a null value in JSON.'); + assert(json.containsKey(r'sidecar'), 'Required key "QueuesResponseLegacyDto[sidecar]" is missing from JSON.'); + assert(json[r'sidecar'] != null, 'Required key "QueuesResponseLegacyDto[sidecar]" has a null value in JSON.'); + assert(json.containsKey(r'smartSearch'), 'Required key "QueuesResponseLegacyDto[smartSearch]" is missing from JSON.'); + assert(json[r'smartSearch'] != null, 'Required key "QueuesResponseLegacyDto[smartSearch]" has a null value in JSON.'); + assert(json.containsKey(r'storageTemplateMigration'), 'Required key "QueuesResponseLegacyDto[storageTemplateMigration]" is missing from JSON.'); + assert(json[r'storageTemplateMigration'] != null, 'Required key "QueuesResponseLegacyDto[storageTemplateMigration]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnailGeneration'), 'Required key "QueuesResponseLegacyDto[thumbnailGeneration]" is missing from JSON.'); + assert(json[r'thumbnailGeneration'] != null, 'Required key "QueuesResponseLegacyDto[thumbnailGeneration]" has a null value in JSON.'); + assert(json.containsKey(r'videoConversion'), 'Required key "QueuesResponseLegacyDto[videoConversion]" is missing from JSON.'); + assert(json[r'videoConversion'] != null, 'Required key "QueuesResponseLegacyDto[videoConversion]" has a null value in JSON.'); + assert(json.containsKey(r'workflow'), 'Required key "QueuesResponseLegacyDto[workflow]" is missing from JSON.'); + assert(json[r'workflow'] != null, 'Required key "QueuesResponseLegacyDto[workflow]" has a null value in JSON.'); + return true; + }()); + return QueuesResponseLegacyDto( backgroundTask: QueueResponseLegacyDto.fromJson(json[r'backgroundTask'])!, backupDatabase: QueueResponseLegacyDto.fromJson(json[r'backupDatabase'])!, diff --git a/mobile/openapi/lib/model/random_search_dto.dart b/mobile/openapi/lib/model/random_search_dto.dart index 728072639c..91a3ded061 100644 --- a/mobile/openapi/lib/model/random_search_dto.dart +++ b/mobile/openapi/lib/model/random_search_dto.dart @@ -353,169 +353,169 @@ class RandomSearchDto { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.createdAfter != null) { json[r'createdAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdAfter!.millisecondsSinceEpoch : this.createdAfter!.toUtc().toIso8601String(); } else { - // json[r'createdAfter'] = null; + json[r'createdAfter'] = null; } if (this.createdBefore != null) { json[r'createdBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdBefore!.millisecondsSinceEpoch : this.createdBefore!.toUtc().toIso8601String(); } else { - // json[r'createdBefore'] = null; + json[r'createdBefore'] = null; } if (this.isEncoded != null) { json[r'isEncoded'] = this.isEncoded; } else { - // json[r'isEncoded'] = null; + json[r'isEncoded'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isMotion != null) { json[r'isMotion'] = this.isMotion; } else { - // json[r'isMotion'] = null; + json[r'isMotion'] = null; } if (this.isNotInAlbum != null) { json[r'isNotInAlbum'] = this.isNotInAlbum; } else { - // json[r'isNotInAlbum'] = null; + json[r'isNotInAlbum'] = null; } if (this.isOffline != null) { json[r'isOffline'] = this.isOffline; } else { - // json[r'isOffline'] = null; + json[r'isOffline'] = null; } if (this.lensModel != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + json[r'lensModel'] = null; } if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.make != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + json[r'make'] = null; } if (this.model != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + json[r'model'] = null; } if (this.ocr != null) { json[r'ocr'] = this.ocr; } else { - // json[r'ocr'] = null; + json[r'ocr'] = null; } json[r'personIds'] = this.personIds; if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.size != null) { json[r'size'] = this.size; } else { - // json[r'size'] = null; + json[r'size'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } if (this.tagIds != null) { json[r'tagIds'] = this.tagIds; } else { - // json[r'tagIds'] = null; + json[r'tagIds'] = null; } if (this.takenAfter != null) { json[r'takenAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenAfter!.millisecondsSinceEpoch : this.takenAfter!.toUtc().toIso8601String(); } else { - // json[r'takenAfter'] = null; + json[r'takenAfter'] = null; } if (this.takenBefore != null) { json[r'takenBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenBefore!.millisecondsSinceEpoch : this.takenBefore!.toUtc().toIso8601String(); } else { - // json[r'takenBefore'] = null; + json[r'takenBefore'] = null; } if (this.trashedAfter != null) { json[r'trashedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedAfter!.millisecondsSinceEpoch : this.trashedAfter!.toUtc().toIso8601String(); } else { - // json[r'trashedAfter'] = null; + json[r'trashedAfter'] = null; } if (this.trashedBefore != null) { json[r'trashedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedBefore!.millisecondsSinceEpoch : this.trashedBefore!.toUtc().toIso8601String(); } else { - // json[r'trashedBefore'] = null; + json[r'trashedBefore'] = null; } if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } if (this.updatedAfter != null) { json[r'updatedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAfter!.millisecondsSinceEpoch : this.updatedAfter!.toUtc().toIso8601String(); } else { - // json[r'updatedAfter'] = null; + json[r'updatedAfter'] = null; } if (this.updatedBefore != null) { json[r'updatedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedBefore!.millisecondsSinceEpoch : this.updatedBefore!.toUtc().toIso8601String(); } else { - // json[r'updatedBefore'] = null; + json[r'updatedBefore'] = null; } if (this.visibility != null) { json[r'visibility'] = this.visibility; } else { - // json[r'visibility'] = null; + json[r'visibility'] = null; } if (this.withDeleted != null) { json[r'withDeleted'] = this.withDeleted; } else { - // json[r'withDeleted'] = null; + json[r'withDeleted'] = null; } if (this.withExif != null) { json[r'withExif'] = this.withExif; } else { - // json[r'withExif'] = null; + json[r'withExif'] = null; } if (this.withPeople != null) { json[r'withPeople'] = this.withPeople; } else { - // json[r'withPeople'] = null; + json[r'withPeople'] = null; } if (this.withStacked != null) { json[r'withStacked'] = this.withStacked; } else { - // json[r'withStacked'] = null; + json[r'withStacked'] = null; } return json; } @@ -524,10 +524,16 @@ class RandomSearchDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static RandomSearchDto? fromJson(dynamic value) { - upgradeDto(value, "RandomSearchDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return RandomSearchDto( albumIds: json[r'albumIds'] is Iterable ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/ratings_response.dart b/mobile/openapi/lib/model/ratings_response.dart index 7b067412bf..585e7d4382 100644 --- a/mobile/openapi/lib/model/ratings_response.dart +++ b/mobile/openapi/lib/model/ratings_response.dart @@ -41,10 +41,18 @@ class RatingsResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static RatingsResponse? fromJson(dynamic value) { - upgradeDto(value, "RatingsResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "RatingsResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "RatingsResponse[enabled]" has a null value in JSON.'); + return true; + }()); + return RatingsResponse( enabled: mapValueOfType(json, r'enabled')!, ); diff --git a/mobile/openapi/lib/model/ratings_update.dart b/mobile/openapi/lib/model/ratings_update.dart index 8079172e21..7a05ca08a7 100644 --- a/mobile/openapi/lib/model/ratings_update.dart +++ b/mobile/openapi/lib/model/ratings_update.dart @@ -42,7 +42,7 @@ class RatingsUpdate { if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } return json; } @@ -51,10 +51,16 @@ class RatingsUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static RatingsUpdate? fromJson(dynamic value) { - upgradeDto(value, "RatingsUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return RatingsUpdate( enabled: mapValueOfType(json, r'enabled'), ); diff --git a/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart b/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart index 6ad8c1a7b9..57817ddef5 100644 --- a/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart +++ b/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart @@ -42,12 +42,12 @@ class ReverseGeocodingStateResponseDto { if (this.lastImportFileName != null) { json[r'lastImportFileName'] = this.lastImportFileName; } else { - // json[r'lastImportFileName'] = null; + json[r'lastImportFileName'] = null; } if (this.lastUpdate != null) { json[r'lastUpdate'] = this.lastUpdate; } else { - // json[r'lastUpdate'] = null; + json[r'lastUpdate'] = null; } return json; } @@ -56,10 +56,18 @@ class ReverseGeocodingStateResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ReverseGeocodingStateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ReverseGeocodingStateResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'lastImportFileName'), 'Required key "ReverseGeocodingStateResponseDto[lastImportFileName]" is missing from JSON.'); + assert(json.containsKey(r'lastUpdate'), 'Required key "ReverseGeocodingStateResponseDto[lastUpdate]" is missing from JSON.'); + return true; + }()); + return ReverseGeocodingStateResponseDto( lastImportFileName: mapValueOfType(json, r'lastImportFileName'), lastUpdate: mapValueOfType(json, r'lastUpdate'), diff --git a/mobile/openapi/lib/model/rotate_parameters.dart b/mobile/openapi/lib/model/rotate_parameters.dart index 33609e83e5..a240cb40e5 100644 --- a/mobile/openapi/lib/model/rotate_parameters.dart +++ b/mobile/openapi/lib/model/rotate_parameters.dart @@ -41,10 +41,18 @@ class RotateParameters { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static RotateParameters? fromJson(dynamic value) { - upgradeDto(value, "RotateParameters"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'angle'), 'Required key "RotateParameters[angle]" is missing from JSON.'); + assert(json[r'angle'] != null, 'Required key "RotateParameters[angle]" has a null value in JSON.'); + return true; + }()); + return RotateParameters( angle: num.parse('${json[r'angle']}'), ); diff --git a/mobile/openapi/lib/model/search_album_response_dto.dart b/mobile/openapi/lib/model/search_album_response_dto.dart index c21113ee6d..2946ae8154 100644 --- a/mobile/openapi/lib/model/search_album_response_dto.dart +++ b/mobile/openapi/lib/model/search_album_response_dto.dart @@ -66,10 +66,24 @@ class SearchAlbumResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchAlbumResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchAlbumResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'count'), 'Required key "SearchAlbumResponseDto[count]" is missing from JSON.'); + assert(json[r'count'] != null, 'Required key "SearchAlbumResponseDto[count]" has a null value in JSON.'); + assert(json.containsKey(r'facets'), 'Required key "SearchAlbumResponseDto[facets]" is missing from JSON.'); + assert(json[r'facets'] != null, 'Required key "SearchAlbumResponseDto[facets]" has a null value in JSON.'); + assert(json.containsKey(r'items'), 'Required key "SearchAlbumResponseDto[items]" is missing from JSON.'); + assert(json[r'items'] != null, 'Required key "SearchAlbumResponseDto[items]" has a null value in JSON.'); + assert(json.containsKey(r'total'), 'Required key "SearchAlbumResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "SearchAlbumResponseDto[total]" has a null value in JSON.'); + return true; + }()); + return SearchAlbumResponseDto( count: mapValueOfType(json, r'count')!, facets: SearchFacetResponseDto.listFromJson(json[r'facets']), diff --git a/mobile/openapi/lib/model/search_asset_response_dto.dart b/mobile/openapi/lib/model/search_asset_response_dto.dart index f4ffade26b..fc5f51d6f0 100644 --- a/mobile/openapi/lib/model/search_asset_response_dto.dart +++ b/mobile/openapi/lib/model/search_asset_response_dto.dart @@ -67,7 +67,7 @@ class SearchAssetResponseDto { if (this.nextPage != null) { json[r'nextPage'] = this.nextPage; } else { - // json[r'nextPage'] = null; + json[r'nextPage'] = null; } json[r'total'] = this.total; return json; @@ -77,10 +77,25 @@ class SearchAssetResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchAssetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchAssetResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'count'), 'Required key "SearchAssetResponseDto[count]" is missing from JSON.'); + assert(json[r'count'] != null, 'Required key "SearchAssetResponseDto[count]" has a null value in JSON.'); + assert(json.containsKey(r'facets'), 'Required key "SearchAssetResponseDto[facets]" is missing from JSON.'); + assert(json[r'facets'] != null, 'Required key "SearchAssetResponseDto[facets]" has a null value in JSON.'); + assert(json.containsKey(r'items'), 'Required key "SearchAssetResponseDto[items]" is missing from JSON.'); + assert(json[r'items'] != null, 'Required key "SearchAssetResponseDto[items]" has a null value in JSON.'); + assert(json.containsKey(r'nextPage'), 'Required key "SearchAssetResponseDto[nextPage]" is missing from JSON.'); + assert(json.containsKey(r'total'), 'Required key "SearchAssetResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "SearchAssetResponseDto[total]" has a null value in JSON.'); + return true; + }()); + return SearchAssetResponseDto( count: mapValueOfType(json, r'count')!, facets: SearchFacetResponseDto.listFromJson(json[r'facets']), diff --git a/mobile/openapi/lib/model/search_explore_item.dart b/mobile/openapi/lib/model/search_explore_item.dart index 4089011879..69f7f2f356 100644 --- a/mobile/openapi/lib/model/search_explore_item.dart +++ b/mobile/openapi/lib/model/search_explore_item.dart @@ -47,10 +47,20 @@ class SearchExploreItem { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchExploreItem? fromJson(dynamic value) { - upgradeDto(value, "SearchExploreItem"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'data'), 'Required key "SearchExploreItem[data]" is missing from JSON.'); + assert(json[r'data'] != null, 'Required key "SearchExploreItem[data]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "SearchExploreItem[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "SearchExploreItem[value]" has a null value in JSON.'); + return true; + }()); + return SearchExploreItem( data: AssetResponseDto.fromJson(json[r'data'])!, value: mapValueOfType(json, r'value')!, diff --git a/mobile/openapi/lib/model/search_explore_response_dto.dart b/mobile/openapi/lib/model/search_explore_response_dto.dart index 07ce26c9b8..e355dd1955 100644 --- a/mobile/openapi/lib/model/search_explore_response_dto.dart +++ b/mobile/openapi/lib/model/search_explore_response_dto.dart @@ -47,10 +47,20 @@ class SearchExploreResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchExploreResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchExploreResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'fieldName'), 'Required key "SearchExploreResponseDto[fieldName]" is missing from JSON.'); + assert(json[r'fieldName'] != null, 'Required key "SearchExploreResponseDto[fieldName]" has a null value in JSON.'); + assert(json.containsKey(r'items'), 'Required key "SearchExploreResponseDto[items]" is missing from JSON.'); + assert(json[r'items'] != null, 'Required key "SearchExploreResponseDto[items]" has a null value in JSON.'); + return true; + }()); + return SearchExploreResponseDto( fieldName: mapValueOfType(json, r'fieldName')!, items: SearchExploreItem.listFromJson(json[r'items']), diff --git a/mobile/openapi/lib/model/search_facet_count_response_dto.dart b/mobile/openapi/lib/model/search_facet_count_response_dto.dart index 62adfaa74a..708d9b3ba2 100644 --- a/mobile/openapi/lib/model/search_facet_count_response_dto.dart +++ b/mobile/openapi/lib/model/search_facet_count_response_dto.dart @@ -51,10 +51,20 @@ class SearchFacetCountResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchFacetCountResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchFacetCountResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'count'), 'Required key "SearchFacetCountResponseDto[count]" is missing from JSON.'); + assert(json[r'count'] != null, 'Required key "SearchFacetCountResponseDto[count]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "SearchFacetCountResponseDto[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "SearchFacetCountResponseDto[value]" has a null value in JSON.'); + return true; + }()); + return SearchFacetCountResponseDto( count: mapValueOfType(json, r'count')!, value: mapValueOfType(json, r'value')!, diff --git a/mobile/openapi/lib/model/search_facet_response_dto.dart b/mobile/openapi/lib/model/search_facet_response_dto.dart index 51124ef1cf..3c4fa6dea0 100644 --- a/mobile/openapi/lib/model/search_facet_response_dto.dart +++ b/mobile/openapi/lib/model/search_facet_response_dto.dart @@ -47,10 +47,20 @@ class SearchFacetResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchFacetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchFacetResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'counts'), 'Required key "SearchFacetResponseDto[counts]" is missing from JSON.'); + assert(json[r'counts'] != null, 'Required key "SearchFacetResponseDto[counts]" has a null value in JSON.'); + assert(json.containsKey(r'fieldName'), 'Required key "SearchFacetResponseDto[fieldName]" is missing from JSON.'); + assert(json[r'fieldName'] != null, 'Required key "SearchFacetResponseDto[fieldName]" has a null value in JSON.'); + return true; + }()); + return SearchFacetResponseDto( counts: SearchFacetCountResponseDto.listFromJson(json[r'counts']), fieldName: mapValueOfType(json, r'fieldName')!, diff --git a/mobile/openapi/lib/model/search_response_dto.dart b/mobile/openapi/lib/model/search_response_dto.dart index ca742ae35c..194c803b96 100644 --- a/mobile/openapi/lib/model/search_response_dto.dart +++ b/mobile/openapi/lib/model/search_response_dto.dart @@ -46,10 +46,20 @@ class SearchResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albums'), 'Required key "SearchResponseDto[albums]" is missing from JSON.'); + assert(json[r'albums'] != null, 'Required key "SearchResponseDto[albums]" has a null value in JSON.'); + assert(json.containsKey(r'assets'), 'Required key "SearchResponseDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "SearchResponseDto[assets]" has a null value in JSON.'); + return true; + }()); + return SearchResponseDto( albums: SearchAlbumResponseDto.fromJson(json[r'albums'])!, assets: SearchAssetResponseDto.fromJson(json[r'assets'])!, diff --git a/mobile/openapi/lib/model/search_statistics_response_dto.dart b/mobile/openapi/lib/model/search_statistics_response_dto.dart index c4d893af05..112070d16f 100644 --- a/mobile/openapi/lib/model/search_statistics_response_dto.dart +++ b/mobile/openapi/lib/model/search_statistics_response_dto.dart @@ -44,10 +44,18 @@ class SearchStatisticsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SearchStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchStatisticsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'total'), 'Required key "SearchStatisticsResponseDto[total]" is missing from JSON.'); + assert(json[r'total'] != null, 'Required key "SearchStatisticsResponseDto[total]" has a null value in JSON.'); + return true; + }()); + return SearchStatisticsResponseDto( total: mapValueOfType(json, r'total')!, ); diff --git a/mobile/openapi/lib/model/server_about_response_dto.dart b/mobile/openapi/lib/model/server_about_response_dto.dart index 1ae53763fe..6f06fdaf7e 100644 --- a/mobile/openapi/lib/model/server_about_response_dto.dart +++ b/mobile/openapi/lib/model/server_about_response_dto.dart @@ -264,93 +264,93 @@ class ServerAboutResponseDto { if (this.build != null) { json[r'build'] = this.build; } else { - // json[r'build'] = null; + json[r'build'] = null; } if (this.buildImage != null) { json[r'buildImage'] = this.buildImage; } else { - // json[r'buildImage'] = null; + json[r'buildImage'] = null; } if (this.buildImageUrl != null) { json[r'buildImageUrl'] = this.buildImageUrl; } else { - // json[r'buildImageUrl'] = null; + json[r'buildImageUrl'] = null; } if (this.buildUrl != null) { json[r'buildUrl'] = this.buildUrl; } else { - // json[r'buildUrl'] = null; + json[r'buildUrl'] = null; } if (this.exiftool != null) { json[r'exiftool'] = this.exiftool; } else { - // json[r'exiftool'] = null; + json[r'exiftool'] = null; } if (this.ffmpeg != null) { json[r'ffmpeg'] = this.ffmpeg; } else { - // json[r'ffmpeg'] = null; + json[r'ffmpeg'] = null; } if (this.imagemagick != null) { json[r'imagemagick'] = this.imagemagick; } else { - // json[r'imagemagick'] = null; + json[r'imagemagick'] = null; } if (this.libvips != null) { json[r'libvips'] = this.libvips; } else { - // json[r'libvips'] = null; + json[r'libvips'] = null; } json[r'licensed'] = this.licensed; if (this.nodejs != null) { json[r'nodejs'] = this.nodejs; } else { - // json[r'nodejs'] = null; + json[r'nodejs'] = null; } if (this.repository != null) { json[r'repository'] = this.repository; } else { - // json[r'repository'] = null; + json[r'repository'] = null; } if (this.repositoryUrl != null) { json[r'repositoryUrl'] = this.repositoryUrl; } else { - // json[r'repositoryUrl'] = null; + json[r'repositoryUrl'] = null; } if (this.sourceCommit != null) { json[r'sourceCommit'] = this.sourceCommit; } else { - // json[r'sourceCommit'] = null; + json[r'sourceCommit'] = null; } if (this.sourceRef != null) { json[r'sourceRef'] = this.sourceRef; } else { - // json[r'sourceRef'] = null; + json[r'sourceRef'] = null; } if (this.sourceUrl != null) { json[r'sourceUrl'] = this.sourceUrl; } else { - // json[r'sourceUrl'] = null; + json[r'sourceUrl'] = null; } if (this.thirdPartyBugFeatureUrl != null) { json[r'thirdPartyBugFeatureUrl'] = this.thirdPartyBugFeatureUrl; } else { - // json[r'thirdPartyBugFeatureUrl'] = null; + json[r'thirdPartyBugFeatureUrl'] = null; } if (this.thirdPartyDocumentationUrl != null) { json[r'thirdPartyDocumentationUrl'] = this.thirdPartyDocumentationUrl; } else { - // json[r'thirdPartyDocumentationUrl'] = null; + json[r'thirdPartyDocumentationUrl'] = null; } if (this.thirdPartySourceUrl != null) { json[r'thirdPartySourceUrl'] = this.thirdPartySourceUrl; } else { - // json[r'thirdPartySourceUrl'] = null; + json[r'thirdPartySourceUrl'] = null; } if (this.thirdPartySupportUrl != null) { json[r'thirdPartySupportUrl'] = this.thirdPartySupportUrl; } else { - // json[r'thirdPartySupportUrl'] = null; + json[r'thirdPartySupportUrl'] = null; } json[r'version'] = this.version; json[r'versionUrl'] = this.versionUrl; @@ -361,10 +361,22 @@ class ServerAboutResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerAboutResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerAboutResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'licensed'), 'Required key "ServerAboutResponseDto[licensed]" is missing from JSON.'); + assert(json[r'licensed'] != null, 'Required key "ServerAboutResponseDto[licensed]" has a null value in JSON.'); + assert(json.containsKey(r'version'), 'Required key "ServerAboutResponseDto[version]" is missing from JSON.'); + assert(json[r'version'] != null, 'Required key "ServerAboutResponseDto[version]" has a null value in JSON.'); + assert(json.containsKey(r'versionUrl'), 'Required key "ServerAboutResponseDto[versionUrl]" is missing from JSON.'); + assert(json[r'versionUrl'] != null, 'Required key "ServerAboutResponseDto[versionUrl]" has a null value in JSON.'); + return true; + }()); + return ServerAboutResponseDto( build: mapValueOfType(json, r'build'), buildImage: mapValueOfType(json, r'buildImage'), diff --git a/mobile/openapi/lib/model/server_apk_links_dto.dart b/mobile/openapi/lib/model/server_apk_links_dto.dart index 2227018468..1ff533a2a2 100644 --- a/mobile/openapi/lib/model/server_apk_links_dto.dart +++ b/mobile/openapi/lib/model/server_apk_links_dto.dart @@ -62,10 +62,24 @@ class ServerApkLinksDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerApkLinksDto? fromJson(dynamic value) { - upgradeDto(value, "ServerApkLinksDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'arm64v8a'), 'Required key "ServerApkLinksDto[arm64v8a]" is missing from JSON.'); + assert(json[r'arm64v8a'] != null, 'Required key "ServerApkLinksDto[arm64v8a]" has a null value in JSON.'); + assert(json.containsKey(r'armeabiv7a'), 'Required key "ServerApkLinksDto[armeabiv7a]" is missing from JSON.'); + assert(json[r'armeabiv7a'] != null, 'Required key "ServerApkLinksDto[armeabiv7a]" has a null value in JSON.'); + assert(json.containsKey(r'universal'), 'Required key "ServerApkLinksDto[universal]" is missing from JSON.'); + assert(json[r'universal'] != null, 'Required key "ServerApkLinksDto[universal]" has a null value in JSON.'); + assert(json.containsKey(r'x86_64'), 'Required key "ServerApkLinksDto[x86_64]" is missing from JSON.'); + assert(json[r'x86_64'] != null, 'Required key "ServerApkLinksDto[x86_64]" has a null value in JSON.'); + return true; + }()); + return ServerApkLinksDto( arm64v8a: mapValueOfType(json, r'arm64v8a')!, armeabiv7a: mapValueOfType(json, r'armeabiv7a')!, diff --git a/mobile/openapi/lib/model/server_config_dto.dart b/mobile/openapi/lib/model/server_config_dto.dart index 316edb609f..3f7d04892a 100644 --- a/mobile/openapi/lib/model/server_config_dto.dart +++ b/mobile/openapi/lib/model/server_config_dto.dart @@ -117,10 +117,38 @@ class ServerConfigDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerConfigDto? fromJson(dynamic value) { - upgradeDto(value, "ServerConfigDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'externalDomain'), 'Required key "ServerConfigDto[externalDomain]" is missing from JSON.'); + assert(json[r'externalDomain'] != null, 'Required key "ServerConfigDto[externalDomain]" has a null value in JSON.'); + assert(json.containsKey(r'isInitialized'), 'Required key "ServerConfigDto[isInitialized]" is missing from JSON.'); + assert(json[r'isInitialized'] != null, 'Required key "ServerConfigDto[isInitialized]" has a null value in JSON.'); + assert(json.containsKey(r'isOnboarded'), 'Required key "ServerConfigDto[isOnboarded]" is missing from JSON.'); + assert(json[r'isOnboarded'] != null, 'Required key "ServerConfigDto[isOnboarded]" has a null value in JSON.'); + assert(json.containsKey(r'loginPageMessage'), 'Required key "ServerConfigDto[loginPageMessage]" is missing from JSON.'); + assert(json[r'loginPageMessage'] != null, 'Required key "ServerConfigDto[loginPageMessage]" has a null value in JSON.'); + assert(json.containsKey(r'maintenanceMode'), 'Required key "ServerConfigDto[maintenanceMode]" is missing from JSON.'); + assert(json[r'maintenanceMode'] != null, 'Required key "ServerConfigDto[maintenanceMode]" has a null value in JSON.'); + assert(json.containsKey(r'mapDarkStyleUrl'), 'Required key "ServerConfigDto[mapDarkStyleUrl]" is missing from JSON.'); + assert(json[r'mapDarkStyleUrl'] != null, 'Required key "ServerConfigDto[mapDarkStyleUrl]" has a null value in JSON.'); + assert(json.containsKey(r'mapLightStyleUrl'), 'Required key "ServerConfigDto[mapLightStyleUrl]" is missing from JSON.'); + assert(json[r'mapLightStyleUrl'] != null, 'Required key "ServerConfigDto[mapLightStyleUrl]" has a null value in JSON.'); + assert(json.containsKey(r'oauthButtonText'), 'Required key "ServerConfigDto[oauthButtonText]" is missing from JSON.'); + assert(json[r'oauthButtonText'] != null, 'Required key "ServerConfigDto[oauthButtonText]" has a null value in JSON.'); + assert(json.containsKey(r'publicUsers'), 'Required key "ServerConfigDto[publicUsers]" is missing from JSON.'); + assert(json[r'publicUsers'] != null, 'Required key "ServerConfigDto[publicUsers]" has a null value in JSON.'); + assert(json.containsKey(r'trashDays'), 'Required key "ServerConfigDto[trashDays]" is missing from JSON.'); + assert(json[r'trashDays'] != null, 'Required key "ServerConfigDto[trashDays]" has a null value in JSON.'); + assert(json.containsKey(r'userDeleteDelay'), 'Required key "ServerConfigDto[userDeleteDelay]" is missing from JSON.'); + assert(json[r'userDeleteDelay'] != null, 'Required key "ServerConfigDto[userDeleteDelay]" has a null value in JSON.'); + return true; + }()); + return ServerConfigDto( externalDomain: mapValueOfType(json, r'externalDomain')!, isInitialized: mapValueOfType(json, r'isInitialized')!, diff --git a/mobile/openapi/lib/model/server_features_dto.dart b/mobile/openapi/lib/model/server_features_dto.dart index 79494b74eb..1c9b63c80f 100644 --- a/mobile/openapi/lib/model/server_features_dto.dart +++ b/mobile/openapi/lib/model/server_features_dto.dart @@ -139,10 +139,46 @@ class ServerFeaturesDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerFeaturesDto? fromJson(dynamic value) { - upgradeDto(value, "ServerFeaturesDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'configFile'), 'Required key "ServerFeaturesDto[configFile]" is missing from JSON.'); + assert(json[r'configFile'] != null, 'Required key "ServerFeaturesDto[configFile]" has a null value in JSON.'); + assert(json.containsKey(r'duplicateDetection'), 'Required key "ServerFeaturesDto[duplicateDetection]" is missing from JSON.'); + assert(json[r'duplicateDetection'] != null, 'Required key "ServerFeaturesDto[duplicateDetection]" has a null value in JSON.'); + assert(json.containsKey(r'email'), 'Required key "ServerFeaturesDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "ServerFeaturesDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'facialRecognition'), 'Required key "ServerFeaturesDto[facialRecognition]" is missing from JSON.'); + assert(json[r'facialRecognition'] != null, 'Required key "ServerFeaturesDto[facialRecognition]" has a null value in JSON.'); + assert(json.containsKey(r'importFaces'), 'Required key "ServerFeaturesDto[importFaces]" is missing from JSON.'); + assert(json[r'importFaces'] != null, 'Required key "ServerFeaturesDto[importFaces]" has a null value in JSON.'); + assert(json.containsKey(r'map'), 'Required key "ServerFeaturesDto[map]" is missing from JSON.'); + assert(json[r'map'] != null, 'Required key "ServerFeaturesDto[map]" has a null value in JSON.'); + assert(json.containsKey(r'oauth'), 'Required key "ServerFeaturesDto[oauth]" is missing from JSON.'); + assert(json[r'oauth'] != null, 'Required key "ServerFeaturesDto[oauth]" has a null value in JSON.'); + assert(json.containsKey(r'oauthAutoLaunch'), 'Required key "ServerFeaturesDto[oauthAutoLaunch]" is missing from JSON.'); + assert(json[r'oauthAutoLaunch'] != null, 'Required key "ServerFeaturesDto[oauthAutoLaunch]" has a null value in JSON.'); + assert(json.containsKey(r'ocr'), 'Required key "ServerFeaturesDto[ocr]" is missing from JSON.'); + assert(json[r'ocr'] != null, 'Required key "ServerFeaturesDto[ocr]" has a null value in JSON.'); + assert(json.containsKey(r'passwordLogin'), 'Required key "ServerFeaturesDto[passwordLogin]" is missing from JSON.'); + assert(json[r'passwordLogin'] != null, 'Required key "ServerFeaturesDto[passwordLogin]" has a null value in JSON.'); + assert(json.containsKey(r'reverseGeocoding'), 'Required key "ServerFeaturesDto[reverseGeocoding]" is missing from JSON.'); + assert(json[r'reverseGeocoding'] != null, 'Required key "ServerFeaturesDto[reverseGeocoding]" has a null value in JSON.'); + assert(json.containsKey(r'search'), 'Required key "ServerFeaturesDto[search]" is missing from JSON.'); + assert(json[r'search'] != null, 'Required key "ServerFeaturesDto[search]" has a null value in JSON.'); + assert(json.containsKey(r'sidecar'), 'Required key "ServerFeaturesDto[sidecar]" is missing from JSON.'); + assert(json[r'sidecar'] != null, 'Required key "ServerFeaturesDto[sidecar]" has a null value in JSON.'); + assert(json.containsKey(r'smartSearch'), 'Required key "ServerFeaturesDto[smartSearch]" is missing from JSON.'); + assert(json[r'smartSearch'] != null, 'Required key "ServerFeaturesDto[smartSearch]" has a null value in JSON.'); + assert(json.containsKey(r'trash'), 'Required key "ServerFeaturesDto[trash]" is missing from JSON.'); + assert(json[r'trash'] != null, 'Required key "ServerFeaturesDto[trash]" has a null value in JSON.'); + return true; + }()); + return ServerFeaturesDto( configFile: mapValueOfType(json, r'configFile')!, duplicateDetection: mapValueOfType(json, r'duplicateDetection')!, diff --git a/mobile/openapi/lib/model/server_media_types_response_dto.dart b/mobile/openapi/lib/model/server_media_types_response_dto.dart index 6a2aaeb9e1..97cf50baa6 100644 --- a/mobile/openapi/lib/model/server_media_types_response_dto.dart +++ b/mobile/openapi/lib/model/server_media_types_response_dto.dart @@ -55,10 +55,22 @@ class ServerMediaTypesResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerMediaTypesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerMediaTypesResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'image'), 'Required key "ServerMediaTypesResponseDto[image]" is missing from JSON.'); + assert(json[r'image'] != null, 'Required key "ServerMediaTypesResponseDto[image]" has a null value in JSON.'); + assert(json.containsKey(r'sidecar'), 'Required key "ServerMediaTypesResponseDto[sidecar]" is missing from JSON.'); + assert(json[r'sidecar'] != null, 'Required key "ServerMediaTypesResponseDto[sidecar]" has a null value in JSON.'); + assert(json.containsKey(r'video'), 'Required key "ServerMediaTypesResponseDto[video]" is missing from JSON.'); + assert(json[r'video'] != null, 'Required key "ServerMediaTypesResponseDto[video]" has a null value in JSON.'); + return true; + }()); + return ServerMediaTypesResponseDto( image: json[r'image'] is Iterable ? (json[r'image'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/server_ping_response.dart b/mobile/openapi/lib/model/server_ping_response.dart index 621ebfa294..222911b6d2 100644 --- a/mobile/openapi/lib/model/server_ping_response.dart +++ b/mobile/openapi/lib/model/server_ping_response.dart @@ -40,10 +40,18 @@ class ServerPingResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerPingResponse? fromJson(dynamic value) { - upgradeDto(value, "ServerPingResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'res'), 'Required key "ServerPingResponse[res]" is missing from JSON.'); + assert(json[r'res'] != null, 'Required key "ServerPingResponse[res]" has a null value in JSON.'); + return true; + }()); + return ServerPingResponse( res: mapValueOfType(json, r'res')!, ); diff --git a/mobile/openapi/lib/model/server_stats_response_dto.dart b/mobile/openapi/lib/model/server_stats_response_dto.dart index 605bd74f41..32e9c24cea 100644 --- a/mobile/openapi/lib/model/server_stats_response_dto.dart +++ b/mobile/openapi/lib/model/server_stats_response_dto.dart @@ -91,10 +91,28 @@ class ServerStatsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerStatsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerStatsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'photos'), 'Required key "ServerStatsResponseDto[photos]" is missing from JSON.'); + assert(json[r'photos'] != null, 'Required key "ServerStatsResponseDto[photos]" has a null value in JSON.'); + assert(json.containsKey(r'usage'), 'Required key "ServerStatsResponseDto[usage]" is missing from JSON.'); + assert(json[r'usage'] != null, 'Required key "ServerStatsResponseDto[usage]" has a null value in JSON.'); + assert(json.containsKey(r'usageByUser'), 'Required key "ServerStatsResponseDto[usageByUser]" is missing from JSON.'); + assert(json[r'usageByUser'] != null, 'Required key "ServerStatsResponseDto[usageByUser]" has a null value in JSON.'); + assert(json.containsKey(r'usagePhotos'), 'Required key "ServerStatsResponseDto[usagePhotos]" is missing from JSON.'); + assert(json[r'usagePhotos'] != null, 'Required key "ServerStatsResponseDto[usagePhotos]" has a null value in JSON.'); + assert(json.containsKey(r'usageVideos'), 'Required key "ServerStatsResponseDto[usageVideos]" is missing from JSON.'); + assert(json[r'usageVideos'] != null, 'Required key "ServerStatsResponseDto[usageVideos]" has a null value in JSON.'); + assert(json.containsKey(r'videos'), 'Required key "ServerStatsResponseDto[videos]" is missing from JSON.'); + assert(json[r'videos'] != null, 'Required key "ServerStatsResponseDto[videos]" has a null value in JSON.'); + return true; + }()); + return ServerStatsResponseDto( photos: mapValueOfType(json, r'photos')!, usage: mapValueOfType(json, r'usage')!, diff --git a/mobile/openapi/lib/model/server_storage_response_dto.dart b/mobile/openapi/lib/model/server_storage_response_dto.dart index 4a66d54e37..5301b258cb 100644 --- a/mobile/openapi/lib/model/server_storage_response_dto.dart +++ b/mobile/openapi/lib/model/server_storage_response_dto.dart @@ -92,16 +92,36 @@ class ServerStorageResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerStorageResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerStorageResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'diskAvailable'), 'Required key "ServerStorageResponseDto[diskAvailable]" is missing from JSON.'); + assert(json[r'diskAvailable'] != null, 'Required key "ServerStorageResponseDto[diskAvailable]" has a null value in JSON.'); + assert(json.containsKey(r'diskAvailableRaw'), 'Required key "ServerStorageResponseDto[diskAvailableRaw]" is missing from JSON.'); + assert(json[r'diskAvailableRaw'] != null, 'Required key "ServerStorageResponseDto[diskAvailableRaw]" has a null value in JSON.'); + assert(json.containsKey(r'diskSize'), 'Required key "ServerStorageResponseDto[diskSize]" is missing from JSON.'); + assert(json[r'diskSize'] != null, 'Required key "ServerStorageResponseDto[diskSize]" has a null value in JSON.'); + assert(json.containsKey(r'diskSizeRaw'), 'Required key "ServerStorageResponseDto[diskSizeRaw]" is missing from JSON.'); + assert(json[r'diskSizeRaw'] != null, 'Required key "ServerStorageResponseDto[diskSizeRaw]" has a null value in JSON.'); + assert(json.containsKey(r'diskUsagePercentage'), 'Required key "ServerStorageResponseDto[diskUsagePercentage]" is missing from JSON.'); + assert(json[r'diskUsagePercentage'] != null, 'Required key "ServerStorageResponseDto[diskUsagePercentage]" has a null value in JSON.'); + assert(json.containsKey(r'diskUse'), 'Required key "ServerStorageResponseDto[diskUse]" is missing from JSON.'); + assert(json[r'diskUse'] != null, 'Required key "ServerStorageResponseDto[diskUse]" has a null value in JSON.'); + assert(json.containsKey(r'diskUseRaw'), 'Required key "ServerStorageResponseDto[diskUseRaw]" is missing from JSON.'); + assert(json[r'diskUseRaw'] != null, 'Required key "ServerStorageResponseDto[diskUseRaw]" has a null value in JSON.'); + return true; + }()); + return ServerStorageResponseDto( diskAvailable: mapValueOfType(json, r'diskAvailable')!, diskAvailableRaw: mapValueOfType(json, r'diskAvailableRaw')!, diskSize: mapValueOfType(json, r'diskSize')!, diskSizeRaw: mapValueOfType(json, r'diskSizeRaw')!, - diskUsagePercentage: (mapValueOfType(json, r'diskUsagePercentage')!).toDouble(), + diskUsagePercentage: mapValueOfType(json, r'diskUsagePercentage')!, diskUse: mapValueOfType(json, r'diskUse')!, diskUseRaw: mapValueOfType(json, r'diskUseRaw')!, ); diff --git a/mobile/openapi/lib/model/server_version_history_response_dto.dart b/mobile/openapi/lib/model/server_version_history_response_dto.dart index ae5e060cff..4d5b273be2 100644 --- a/mobile/openapi/lib/model/server_version_history_response_dto.dart +++ b/mobile/openapi/lib/model/server_version_history_response_dto.dart @@ -57,10 +57,22 @@ class ServerVersionHistoryResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerVersionHistoryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerVersionHistoryResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "ServerVersionHistoryResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "ServerVersionHistoryResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "ServerVersionHistoryResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "ServerVersionHistoryResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'version'), 'Required key "ServerVersionHistoryResponseDto[version]" is missing from JSON.'); + assert(json[r'version'] != null, 'Required key "ServerVersionHistoryResponseDto[version]" has a null value in JSON.'); + return true; + }()); + return ServerVersionHistoryResponseDto( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/server_version_response_dto.dart b/mobile/openapi/lib/model/server_version_response_dto.dart index 60161a7458..32bc390439 100644 --- a/mobile/openapi/lib/model/server_version_response_dto.dart +++ b/mobile/openapi/lib/model/server_version_response_dto.dart @@ -64,10 +64,22 @@ class ServerVersionResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ServerVersionResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerVersionResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'major'), 'Required key "ServerVersionResponseDto[major]" is missing from JSON.'); + assert(json[r'major'] != null, 'Required key "ServerVersionResponseDto[major]" has a null value in JSON.'); + assert(json.containsKey(r'minor'), 'Required key "ServerVersionResponseDto[minor]" is missing from JSON.'); + assert(json[r'minor'] != null, 'Required key "ServerVersionResponseDto[minor]" has a null value in JSON.'); + assert(json.containsKey(r'patch'), 'Required key "ServerVersionResponseDto[patch]" is missing from JSON.'); + assert(json[r'patch'] != null, 'Required key "ServerVersionResponseDto[patch]" has a null value in JSON.'); + return true; + }()); + return ServerVersionResponseDto( major: mapValueOfType(json, r'major')!, minor: mapValueOfType(json, r'minor')!, diff --git a/mobile/openapi/lib/model/session_create_dto.dart b/mobile/openapi/lib/model/session_create_dto.dart index 37c07955cd..06d4352007 100644 --- a/mobile/openapi/lib/model/session_create_dto.dart +++ b/mobile/openapi/lib/model/session_create_dto.dart @@ -69,17 +69,17 @@ class SessionCreateDto { if (this.deviceOS != null) { json[r'deviceOS'] = this.deviceOS; } else { - // json[r'deviceOS'] = null; + json[r'deviceOS'] = null; } if (this.deviceType != null) { json[r'deviceType'] = this.deviceType; } else { - // json[r'deviceType'] = null; + json[r'deviceType'] = null; } if (this.duration != null) { json[r'duration'] = this.duration; } else { - // json[r'duration'] = null; + json[r'duration'] = null; } return json; } @@ -88,10 +88,16 @@ class SessionCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SessionCreateDto? fromJson(dynamic value) { - upgradeDto(value, "SessionCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SessionCreateDto( deviceOS: mapValueOfType(json, r'deviceOS'), deviceType: mapValueOfType(json, r'deviceType'), diff --git a/mobile/openapi/lib/model/session_create_response_dto.dart b/mobile/openapi/lib/model/session_create_response_dto.dart index f35232b0e8..23eb43ed5e 100644 --- a/mobile/openapi/lib/model/session_create_response_dto.dart +++ b/mobile/openapi/lib/model/session_create_response_dto.dart @@ -96,7 +96,7 @@ class SessionCreateResponseDto { if (this.appVersion != null) { json[r'appVersion'] = this.appVersion; } else { - // json[r'appVersion'] = null; + json[r'appVersion'] = null; } json[r'createdAt'] = this.createdAt; json[r'current'] = this.current; @@ -105,7 +105,7 @@ class SessionCreateResponseDto { if (this.expiresAt != null) { json[r'expiresAt'] = this.expiresAt; } else { - // json[r'expiresAt'] = null; + json[r'expiresAt'] = null; } json[r'id'] = this.id; json[r'isPendingSyncReset'] = this.isPendingSyncReset; @@ -118,10 +118,33 @@ class SessionCreateResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SessionCreateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SessionCreateResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'appVersion'), 'Required key "SessionCreateResponseDto[appVersion]" is missing from JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "SessionCreateResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SessionCreateResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'current'), 'Required key "SessionCreateResponseDto[current]" is missing from JSON.'); + assert(json[r'current'] != null, 'Required key "SessionCreateResponseDto[current]" has a null value in JSON.'); + assert(json.containsKey(r'deviceOS'), 'Required key "SessionCreateResponseDto[deviceOS]" is missing from JSON.'); + assert(json[r'deviceOS'] != null, 'Required key "SessionCreateResponseDto[deviceOS]" has a null value in JSON.'); + assert(json.containsKey(r'deviceType'), 'Required key "SessionCreateResponseDto[deviceType]" is missing from JSON.'); + assert(json[r'deviceType'] != null, 'Required key "SessionCreateResponseDto[deviceType]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SessionCreateResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SessionCreateResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isPendingSyncReset'), 'Required key "SessionCreateResponseDto[isPendingSyncReset]" is missing from JSON.'); + assert(json[r'isPendingSyncReset'] != null, 'Required key "SessionCreateResponseDto[isPendingSyncReset]" has a null value in JSON.'); + assert(json.containsKey(r'token'), 'Required key "SessionCreateResponseDto[token]" is missing from JSON.'); + assert(json[r'token'] != null, 'Required key "SessionCreateResponseDto[token]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SessionCreateResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SessionCreateResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SessionCreateResponseDto( appVersion: mapValueOfType(json, r'appVersion'), createdAt: mapValueOfType(json, r'createdAt')!, diff --git a/mobile/openapi/lib/model/session_response_dto.dart b/mobile/openapi/lib/model/session_response_dto.dart index ed84160827..60a39f023d 100644 --- a/mobile/openapi/lib/model/session_response_dto.dart +++ b/mobile/openapi/lib/model/session_response_dto.dart @@ -90,7 +90,7 @@ class SessionResponseDto { if (this.appVersion != null) { json[r'appVersion'] = this.appVersion; } else { - // json[r'appVersion'] = null; + json[r'appVersion'] = null; } json[r'createdAt'] = this.createdAt; json[r'current'] = this.current; @@ -99,7 +99,7 @@ class SessionResponseDto { if (this.expiresAt != null) { json[r'expiresAt'] = this.expiresAt; } else { - // json[r'expiresAt'] = null; + json[r'expiresAt'] = null; } json[r'id'] = this.id; json[r'isPendingSyncReset'] = this.isPendingSyncReset; @@ -111,10 +111,31 @@ class SessionResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SessionResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SessionResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'appVersion'), 'Required key "SessionResponseDto[appVersion]" is missing from JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "SessionResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SessionResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'current'), 'Required key "SessionResponseDto[current]" is missing from JSON.'); + assert(json[r'current'] != null, 'Required key "SessionResponseDto[current]" has a null value in JSON.'); + assert(json.containsKey(r'deviceOS'), 'Required key "SessionResponseDto[deviceOS]" is missing from JSON.'); + assert(json[r'deviceOS'] != null, 'Required key "SessionResponseDto[deviceOS]" has a null value in JSON.'); + assert(json.containsKey(r'deviceType'), 'Required key "SessionResponseDto[deviceType]" is missing from JSON.'); + assert(json[r'deviceType'] != null, 'Required key "SessionResponseDto[deviceType]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SessionResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SessionResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isPendingSyncReset'), 'Required key "SessionResponseDto[isPendingSyncReset]" is missing from JSON.'); + assert(json[r'isPendingSyncReset'] != null, 'Required key "SessionResponseDto[isPendingSyncReset]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SessionResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SessionResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SessionResponseDto( appVersion: mapValueOfType(json, r'appVersion'), createdAt: mapValueOfType(json, r'createdAt')!, diff --git a/mobile/openapi/lib/model/session_unlock_dto.dart b/mobile/openapi/lib/model/session_unlock_dto.dart index 48ee75fb05..30eddede72 100644 --- a/mobile/openapi/lib/model/session_unlock_dto.dart +++ b/mobile/openapi/lib/model/session_unlock_dto.dart @@ -54,12 +54,12 @@ class SessionUnlockDto { if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } if (this.pinCode != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + json[r'pinCode'] = null; } return json; } @@ -68,10 +68,16 @@ class SessionUnlockDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SessionUnlockDto? fromJson(dynamic value) { - upgradeDto(value, "SessionUnlockDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SessionUnlockDto( password: mapValueOfType(json, r'password'), pinCode: mapValueOfType(json, r'pinCode'), diff --git a/mobile/openapi/lib/model/session_update_dto.dart b/mobile/openapi/lib/model/session_update_dto.dart index 3ab430deaa..4d262d1e0d 100644 --- a/mobile/openapi/lib/model/session_update_dto.dart +++ b/mobile/openapi/lib/model/session_update_dto.dart @@ -42,7 +42,7 @@ class SessionUpdateDto { if (this.isPendingSyncReset != null) { json[r'isPendingSyncReset'] = this.isPendingSyncReset; } else { - // json[r'isPendingSyncReset'] = null; + json[r'isPendingSyncReset'] = null; } return json; } @@ -51,10 +51,16 @@ class SessionUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SessionUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "SessionUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SessionUpdateDto( isPendingSyncReset: mapValueOfType(json, r'isPendingSyncReset'), ); diff --git a/mobile/openapi/lib/model/set_maintenance_mode_dto.dart b/mobile/openapi/lib/model/set_maintenance_mode_dto.dart index e7c9dc0d63..88c1b6e04b 100644 --- a/mobile/openapi/lib/model/set_maintenance_mode_dto.dart +++ b/mobile/openapi/lib/model/set_maintenance_mode_dto.dart @@ -48,7 +48,7 @@ class SetMaintenanceModeDto { if (this.restoreBackupFilename != null) { json[r'restoreBackupFilename'] = this.restoreBackupFilename; } else { - // json[r'restoreBackupFilename'] = null; + json[r'restoreBackupFilename'] = null; } return json; } @@ -57,10 +57,18 @@ class SetMaintenanceModeDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SetMaintenanceModeDto? fromJson(dynamic value) { - upgradeDto(value, "SetMaintenanceModeDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'action'), 'Required key "SetMaintenanceModeDto[action]" is missing from JSON.'); + assert(json[r'action'] != null, 'Required key "SetMaintenanceModeDto[action]" has a null value in JSON.'); + return true; + }()); + return SetMaintenanceModeDto( action: MaintenanceAction.fromJson(json[r'action'])!, restoreBackupFilename: mapValueOfType(json, r'restoreBackupFilename'), diff --git a/mobile/openapi/lib/model/shared_link_create_dto.dart b/mobile/openapi/lib/model/shared_link_create_dto.dart index a32714d556..911aabfb94 100644 --- a/mobile/openapi/lib/model/shared_link_create_dto.dart +++ b/mobile/openapi/lib/model/shared_link_create_dto.dart @@ -101,37 +101,37 @@ class SharedLinkCreateDto { if (this.albumId != null) { json[r'albumId'] = this.albumId; } else { - // json[r'albumId'] = null; + json[r'albumId'] = null; } json[r'allowDownload'] = this.allowDownload; if (this.allowUpload != null) { json[r'allowUpload'] = this.allowUpload; } else { - // json[r'allowUpload'] = null; + json[r'allowUpload'] = null; } json[r'assetIds'] = this.assetIds; if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.expiresAt != null) { json[r'expiresAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.expiresAt!.millisecondsSinceEpoch : this.expiresAt!.toUtc().toIso8601String(); } else { - // json[r'expiresAt'] = null; + json[r'expiresAt'] = null; } if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } json[r'showMetadata'] = this.showMetadata; if (this.slug != null) { json[r'slug'] = this.slug; } else { - // json[r'slug'] = null; + json[r'slug'] = null; } json[r'type'] = this.type; return json; @@ -141,10 +141,18 @@ class SharedLinkCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SharedLinkCreateDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'type'), 'Required key "SharedLinkCreateDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "SharedLinkCreateDto[type]" has a null value in JSON.'); + return true; + }()); + return SharedLinkCreateDto( albumId: mapValueOfType(json, r'albumId'), allowDownload: mapValueOfType(json, r'allowDownload') ?? true, diff --git a/mobile/openapi/lib/model/shared_link_edit_dto.dart b/mobile/openapi/lib/model/shared_link_edit_dto.dart index 11d6cdd52e..9cbfece022 100644 --- a/mobile/openapi/lib/model/shared_link_edit_dto.dart +++ b/mobile/openapi/lib/model/shared_link_edit_dto.dart @@ -13,14 +13,14 @@ part of openapi.api; class SharedLinkEditDto { /// Returns a new [SharedLinkEditDto] instance. SharedLinkEditDto({ - this.allowDownload, - this.allowUpload, - this.changeExpiryTime, - this.description, - this.expiresAt, - this.password, - this.showMetadata, - this.slug, + this.allowDownload = const Optional.absent(), + this.allowUpload = const Optional.absent(), + this.changeExpiryTime = const Optional.absent(), + this.description = const Optional.absent(), + this.expiresAt = const Optional.absent(), + this.password = const Optional.absent(), + this.showMetadata = const Optional.absent(), + this.slug = const Optional.absent(), }); /// Allow downloads @@ -30,7 +30,7 @@ class SharedLinkEditDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - bool? allowDownload; + Optional allowDownload; /// Allow uploads /// @@ -39,7 +39,7 @@ class SharedLinkEditDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - bool? allowUpload; + Optional allowUpload; /// Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this. /// @@ -48,16 +48,16 @@ class SharedLinkEditDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - bool? changeExpiryTime; + Optional changeExpiryTime; /// Link description - String? description; + Optional description; /// Expiration date - DateTime? expiresAt; + Optional expiresAt; /// Link password - String? password; + Optional password; /// Show metadata /// @@ -66,10 +66,10 @@ class SharedLinkEditDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - bool? showMetadata; + Optional showMetadata; /// Custom URL slug - String? slug; + Optional slug; @override bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto && @@ -99,47 +99,39 @@ class SharedLinkEditDto { Map toJson() { final json = {}; - if (this.allowDownload != null) { - json[r'allowDownload'] = this.allowDownload; - } else { - // json[r'allowDownload'] = null; + if (this.allowDownload.isPresent) { + final value = this.allowDownload.value; + json[r'allowDownload'] = value; } - if (this.allowUpload != null) { - json[r'allowUpload'] = this.allowUpload; - } else { - // json[r'allowUpload'] = null; + if (this.allowUpload.isPresent) { + final value = this.allowUpload.value; + json[r'allowUpload'] = value; } - if (this.changeExpiryTime != null) { - json[r'changeExpiryTime'] = this.changeExpiryTime; - } else { - // json[r'changeExpiryTime'] = null; + if (this.changeExpiryTime.isPresent) { + final value = this.changeExpiryTime.value; + json[r'changeExpiryTime'] = value; } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; + if (this.description.isPresent) { + final value = this.description.value; + json[r'description'] = value; } - if (this.expiresAt != null) { - json[r'expiresAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') - ? this.expiresAt!.millisecondsSinceEpoch - : this.expiresAt!.toUtc().toIso8601String(); - } else { - // json[r'expiresAt'] = null; + if (this.expiresAt.isPresent) { + final value = this.expiresAt.value; + json[r'expiresAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') + ? value.millisecondsSinceEpoch + : value.toUtc().toIso8601String()); } - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; + if (this.password.isPresent) { + final value = this.password.value; + json[r'password'] = value; } - if (this.showMetadata != null) { - json[r'showMetadata'] = this.showMetadata; - } else { - // json[r'showMetadata'] = null; + if (this.showMetadata.isPresent) { + final value = this.showMetadata.value; + json[r'showMetadata'] = value; } - if (this.slug != null) { - json[r'slug'] = this.slug; - } else { - // json[r'slug'] = null; + if (this.slug.isPresent) { + final value = this.slug.value; + json[r'slug'] = value; } return json; } @@ -148,19 +140,25 @@ class SharedLinkEditDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SharedLinkEditDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkEditDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SharedLinkEditDto( - allowDownload: mapValueOfType(json, r'allowDownload'), - allowUpload: mapValueOfType(json, r'allowUpload'), - changeExpiryTime: mapValueOfType(json, r'changeExpiryTime'), - description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), - password: mapValueOfType(json, r'password'), - showMetadata: mapValueOfType(json, r'showMetadata'), - slug: mapValueOfType(json, r'slug'), + allowDownload: json.containsKey(r'allowDownload') ? Optional.present(mapValueOfType(json, r'allowDownload')) : const Optional.absent(), + allowUpload: json.containsKey(r'allowUpload') ? Optional.present(mapValueOfType(json, r'allowUpload')) : const Optional.absent(), + changeExpiryTime: json.containsKey(r'changeExpiryTime') ? Optional.present(mapValueOfType(json, r'changeExpiryTime')) : const Optional.absent(), + description: json.containsKey(r'description') ? Optional.present(mapValueOfType(json, r'description')) : const Optional.absent(), + expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapDateTime(json, r'expiresAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(), + password: json.containsKey(r'password') ? Optional.present(mapValueOfType(json, r'password')) : const Optional.absent(), + showMetadata: json.containsKey(r'showMetadata') ? Optional.present(mapValueOfType(json, r'showMetadata')) : const Optional.absent(), + slug: json.containsKey(r'slug') ? Optional.present(mapValueOfType(json, r'slug')) : const Optional.absent(), ); } return null; diff --git a/mobile/openapi/lib/model/shared_link_login_dto.dart b/mobile/openapi/lib/model/shared_link_login_dto.dart index 1ab1bc9349..d8ebbc06a4 100644 --- a/mobile/openapi/lib/model/shared_link_login_dto.dart +++ b/mobile/openapi/lib/model/shared_link_login_dto.dart @@ -41,10 +41,18 @@ class SharedLinkLoginDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SharedLinkLoginDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkLoginDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'password'), 'Required key "SharedLinkLoginDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "SharedLinkLoginDto[password]" has a null value in JSON.'); + return true; + }()); + return SharedLinkLoginDto( password: mapValueOfType(json, r'password')!, ); diff --git a/mobile/openapi/lib/model/shared_link_response_dto.dart b/mobile/openapi/lib/model/shared_link_response_dto.dart index bad0966ca2..6ad2a31c97 100644 --- a/mobile/openapi/lib/model/shared_link_response_dto.dart +++ b/mobile/openapi/lib/model/shared_link_response_dto.dart @@ -117,7 +117,7 @@ class SharedLinkResponseDto { if (this.album != null) { json[r'album'] = this.album; } else { - // json[r'album'] = null; + json[r'album'] = null; } json[r'allowDownload'] = this.allowDownload; json[r'allowUpload'] = this.allowUpload; @@ -128,27 +128,27 @@ class SharedLinkResponseDto { if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.expiresAt != null) { json[r'expiresAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.expiresAt!.millisecondsSinceEpoch : this.expiresAt!.toUtc().toIso8601String(); } else { - // json[r'expiresAt'] = null; + json[r'expiresAt'] = null; } json[r'id'] = this.id; json[r'key'] = this.key; if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } json[r'showMetadata'] = this.showMetadata; if (this.slug != null) { json[r'slug'] = this.slug; } else { - // json[r'slug'] = null; + json[r'slug'] = null; } json[r'type'] = this.type; json[r'userId'] = this.userId; @@ -159,10 +159,38 @@ class SharedLinkResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SharedLinkResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'allowDownload'), 'Required key "SharedLinkResponseDto[allowDownload]" is missing from JSON.'); + assert(json[r'allowDownload'] != null, 'Required key "SharedLinkResponseDto[allowDownload]" has a null value in JSON.'); + assert(json.containsKey(r'allowUpload'), 'Required key "SharedLinkResponseDto[allowUpload]" is missing from JSON.'); + assert(json[r'allowUpload'] != null, 'Required key "SharedLinkResponseDto[allowUpload]" has a null value in JSON.'); + assert(json.containsKey(r'assets'), 'Required key "SharedLinkResponseDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "SharedLinkResponseDto[assets]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "SharedLinkResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SharedLinkResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'description'), 'Required key "SharedLinkResponseDto[description]" is missing from JSON.'); + assert(json.containsKey(r'expiresAt'), 'Required key "SharedLinkResponseDto[expiresAt]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "SharedLinkResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SharedLinkResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'key'), 'Required key "SharedLinkResponseDto[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "SharedLinkResponseDto[key]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "SharedLinkResponseDto[password]" is missing from JSON.'); + assert(json.containsKey(r'showMetadata'), 'Required key "SharedLinkResponseDto[showMetadata]" is missing from JSON.'); + assert(json[r'showMetadata'] != null, 'Required key "SharedLinkResponseDto[showMetadata]" has a null value in JSON.'); + assert(json.containsKey(r'slug'), 'Required key "SharedLinkResponseDto[slug]" is missing from JSON.'); + assert(json.containsKey(r'type'), 'Required key "SharedLinkResponseDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "SharedLinkResponseDto[type]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "SharedLinkResponseDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "SharedLinkResponseDto[userId]" has a null value in JSON.'); + return true; + }()); + return SharedLinkResponseDto( album: AlbumResponseDto.fromJson(json[r'album']), allowDownload: mapValueOfType(json, r'allowDownload')!, diff --git a/mobile/openapi/lib/model/shared_links_response.dart b/mobile/openapi/lib/model/shared_links_response.dart index 2b32a57540..5b04201043 100644 --- a/mobile/openapi/lib/model/shared_links_response.dart +++ b/mobile/openapi/lib/model/shared_links_response.dart @@ -48,10 +48,20 @@ class SharedLinksResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SharedLinksResponse? fromJson(dynamic value) { - upgradeDto(value, "SharedLinksResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SharedLinksResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SharedLinksResponse[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'sidebarWeb'), 'Required key "SharedLinksResponse[sidebarWeb]" is missing from JSON.'); + assert(json[r'sidebarWeb'] != null, 'Required key "SharedLinksResponse[sidebarWeb]" has a null value in JSON.'); + return true; + }()); + return SharedLinksResponse( enabled: mapValueOfType(json, r'enabled')!, sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, diff --git a/mobile/openapi/lib/model/shared_links_update.dart b/mobile/openapi/lib/model/shared_links_update.dart index 8e792b4f49..a5d6a1b677 100644 --- a/mobile/openapi/lib/model/shared_links_update.dart +++ b/mobile/openapi/lib/model/shared_links_update.dart @@ -54,12 +54,12 @@ class SharedLinksUpdate { if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } if (this.sidebarWeb != null) { json[r'sidebarWeb'] = this.sidebarWeb; } else { - // json[r'sidebarWeb'] = null; + json[r'sidebarWeb'] = null; } return json; } @@ -68,10 +68,16 @@ class SharedLinksUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SharedLinksUpdate? fromJson(dynamic value) { - upgradeDto(value, "SharedLinksUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SharedLinksUpdate( enabled: mapValueOfType(json, r'enabled'), sidebarWeb: mapValueOfType(json, r'sidebarWeb'), diff --git a/mobile/openapi/lib/model/sign_up_dto.dart b/mobile/openapi/lib/model/sign_up_dto.dart index 54c8fa07d2..ca40eaa9d4 100644 --- a/mobile/openapi/lib/model/sign_up_dto.dart +++ b/mobile/openapi/lib/model/sign_up_dto.dart @@ -55,10 +55,22 @@ class SignUpDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SignUpDto? fromJson(dynamic value) { - upgradeDto(value, "SignUpDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'email'), 'Required key "SignUpDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "SignUpDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "SignUpDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "SignUpDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "SignUpDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "SignUpDto[password]" has a null value in JSON.'); + return true; + }()); + return SignUpDto( email: mapValueOfType(json, r'email')!, name: mapValueOfType(json, r'name')!, diff --git a/mobile/openapi/lib/model/smart_search_dto.dart b/mobile/openapi/lib/model/smart_search_dto.dart index 9bbb4a25f0..81e5f6b03f 100644 --- a/mobile/openapi/lib/model/smart_search_dto.dart +++ b/mobile/openapi/lib/model/smart_search_dto.dart @@ -380,179 +380,179 @@ class SmartSearchDto { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.createdAfter != null) { json[r'createdAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdAfter!.millisecondsSinceEpoch : this.createdAfter!.toUtc().toIso8601String(); } else { - // json[r'createdAfter'] = null; + json[r'createdAfter'] = null; } if (this.createdBefore != null) { json[r'createdBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdBefore!.millisecondsSinceEpoch : this.createdBefore!.toUtc().toIso8601String(); } else { - // json[r'createdBefore'] = null; + json[r'createdBefore'] = null; } if (this.isEncoded != null) { json[r'isEncoded'] = this.isEncoded; } else { - // json[r'isEncoded'] = null; + json[r'isEncoded'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isMotion != null) { json[r'isMotion'] = this.isMotion; } else { - // json[r'isMotion'] = null; + json[r'isMotion'] = null; } if (this.isNotInAlbum != null) { json[r'isNotInAlbum'] = this.isNotInAlbum; } else { - // json[r'isNotInAlbum'] = null; + json[r'isNotInAlbum'] = null; } if (this.isOffline != null) { json[r'isOffline'] = this.isOffline; } else { - // json[r'isOffline'] = null; + json[r'isOffline'] = null; } if (this.language != null) { json[r'language'] = this.language; } else { - // json[r'language'] = null; + json[r'language'] = null; } if (this.lensModel != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + json[r'lensModel'] = null; } if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.make != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + json[r'make'] = null; } if (this.model != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + json[r'model'] = null; } if (this.ocr != null) { json[r'ocr'] = this.ocr; } else { - // json[r'ocr'] = null; + json[r'ocr'] = null; } if (this.page != null) { json[r'page'] = this.page; } else { - // json[r'page'] = null; + json[r'page'] = null; } json[r'personIds'] = this.personIds; if (this.query != null) { json[r'query'] = this.query; } else { - // json[r'query'] = null; + json[r'query'] = null; } if (this.queryAssetId != null) { json[r'queryAssetId'] = this.queryAssetId; } else { - // json[r'queryAssetId'] = null; + json[r'queryAssetId'] = null; } if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.size != null) { json[r'size'] = this.size; } else { - // json[r'size'] = null; + json[r'size'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } if (this.tagIds != null) { json[r'tagIds'] = this.tagIds; } else { - // json[r'tagIds'] = null; + json[r'tagIds'] = null; } if (this.takenAfter != null) { json[r'takenAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenAfter!.millisecondsSinceEpoch : this.takenAfter!.toUtc().toIso8601String(); } else { - // json[r'takenAfter'] = null; + json[r'takenAfter'] = null; } if (this.takenBefore != null) { json[r'takenBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenBefore!.millisecondsSinceEpoch : this.takenBefore!.toUtc().toIso8601String(); } else { - // json[r'takenBefore'] = null; + json[r'takenBefore'] = null; } if (this.trashedAfter != null) { json[r'trashedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedAfter!.millisecondsSinceEpoch : this.trashedAfter!.toUtc().toIso8601String(); } else { - // json[r'trashedAfter'] = null; + json[r'trashedAfter'] = null; } if (this.trashedBefore != null) { json[r'trashedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedBefore!.millisecondsSinceEpoch : this.trashedBefore!.toUtc().toIso8601String(); } else { - // json[r'trashedBefore'] = null; + json[r'trashedBefore'] = null; } if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } if (this.updatedAfter != null) { json[r'updatedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAfter!.millisecondsSinceEpoch : this.updatedAfter!.toUtc().toIso8601String(); } else { - // json[r'updatedAfter'] = null; + json[r'updatedAfter'] = null; } if (this.updatedBefore != null) { json[r'updatedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedBefore!.millisecondsSinceEpoch : this.updatedBefore!.toUtc().toIso8601String(); } else { - // json[r'updatedBefore'] = null; + json[r'updatedBefore'] = null; } if (this.visibility != null) { json[r'visibility'] = this.visibility; } else { - // json[r'visibility'] = null; + json[r'visibility'] = null; } if (this.withDeleted != null) { json[r'withDeleted'] = this.withDeleted; } else { - // json[r'withDeleted'] = null; + json[r'withDeleted'] = null; } if (this.withExif != null) { json[r'withExif'] = this.withExif; } else { - // json[r'withExif'] = null; + json[r'withExif'] = null; } return json; } @@ -561,10 +561,16 @@ class SmartSearchDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SmartSearchDto? fromJson(dynamic value) { - upgradeDto(value, "SmartSearchDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SmartSearchDto( albumIds: json[r'albumIds'] is Iterable ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/stack_create_dto.dart b/mobile/openapi/lib/model/stack_create_dto.dart index 6b08c83401..8cc188bab1 100644 --- a/mobile/openapi/lib/model/stack_create_dto.dart +++ b/mobile/openapi/lib/model/stack_create_dto.dart @@ -41,10 +41,18 @@ class StackCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static StackCreateDto? fromJson(dynamic value) { - upgradeDto(value, "StackCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetIds'), 'Required key "StackCreateDto[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "StackCreateDto[assetIds]" has a null value in JSON.'); + return true; + }()); + return StackCreateDto( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/stack_response_dto.dart b/mobile/openapi/lib/model/stack_response_dto.dart index 326f83a03d..29fd0c6925 100644 --- a/mobile/openapi/lib/model/stack_response_dto.dart +++ b/mobile/openapi/lib/model/stack_response_dto.dart @@ -54,10 +54,22 @@ class StackResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static StackResponseDto? fromJson(dynamic value) { - upgradeDto(value, "StackResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assets'), 'Required key "StackResponseDto[assets]" is missing from JSON.'); + assert(json[r'assets'] != null, 'Required key "StackResponseDto[assets]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "StackResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "StackResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'primaryAssetId'), 'Required key "StackResponseDto[primaryAssetId]" is missing from JSON.'); + assert(json[r'primaryAssetId'] != null, 'Required key "StackResponseDto[primaryAssetId]" has a null value in JSON.'); + return true; + }()); + return StackResponseDto( assets: AssetResponseDto.listFromJson(json[r'assets']), id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/stack_update_dto.dart b/mobile/openapi/lib/model/stack_update_dto.dart index e81c204f97..cf29f92402 100644 --- a/mobile/openapi/lib/model/stack_update_dto.dart +++ b/mobile/openapi/lib/model/stack_update_dto.dart @@ -42,7 +42,7 @@ class StackUpdateDto { if (this.primaryAssetId != null) { json[r'primaryAssetId'] = this.primaryAssetId; } else { - // json[r'primaryAssetId'] = null; + json[r'primaryAssetId'] = null; } return json; } @@ -51,10 +51,16 @@ class StackUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static StackUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "StackUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return StackUpdateDto( primaryAssetId: mapValueOfType(json, r'primaryAssetId'), ); diff --git a/mobile/openapi/lib/model/statistics_search_dto.dart b/mobile/openapi/lib/model/statistics_search_dto.dart index f276e3717b..ca986322b9 100644 --- a/mobile/openapi/lib/model/statistics_search_dto.dart +++ b/mobile/openapi/lib/model/statistics_search_dto.dart @@ -302,149 +302,149 @@ class StatisticsSearchDto { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.createdAfter != null) { json[r'createdAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdAfter!.millisecondsSinceEpoch : this.createdAfter!.toUtc().toIso8601String(); } else { - // json[r'createdAfter'] = null; + json[r'createdAfter'] = null; } if (this.createdBefore != null) { json[r'createdBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdBefore!.millisecondsSinceEpoch : this.createdBefore!.toUtc().toIso8601String(); } else { - // json[r'createdBefore'] = null; + json[r'createdBefore'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.isEncoded != null) { json[r'isEncoded'] = this.isEncoded; } else { - // json[r'isEncoded'] = null; + json[r'isEncoded'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.isMotion != null) { json[r'isMotion'] = this.isMotion; } else { - // json[r'isMotion'] = null; + json[r'isMotion'] = null; } if (this.isNotInAlbum != null) { json[r'isNotInAlbum'] = this.isNotInAlbum; } else { - // json[r'isNotInAlbum'] = null; + json[r'isNotInAlbum'] = null; } if (this.isOffline != null) { json[r'isOffline'] = this.isOffline; } else { - // json[r'isOffline'] = null; + json[r'isOffline'] = null; } if (this.lensModel != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + json[r'lensModel'] = null; } if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.make != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + json[r'make'] = null; } if (this.model != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + json[r'model'] = null; } if (this.ocr != null) { json[r'ocr'] = this.ocr; } else { - // json[r'ocr'] = null; + json[r'ocr'] = null; } json[r'personIds'] = this.personIds; if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } if (this.tagIds != null) { json[r'tagIds'] = this.tagIds; } else { - // json[r'tagIds'] = null; + json[r'tagIds'] = null; } if (this.takenAfter != null) { json[r'takenAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenAfter!.millisecondsSinceEpoch : this.takenAfter!.toUtc().toIso8601String(); } else { - // json[r'takenAfter'] = null; + json[r'takenAfter'] = null; } if (this.takenBefore != null) { json[r'takenBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.takenBefore!.millisecondsSinceEpoch : this.takenBefore!.toUtc().toIso8601String(); } else { - // json[r'takenBefore'] = null; + json[r'takenBefore'] = null; } if (this.trashedAfter != null) { json[r'trashedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedAfter!.millisecondsSinceEpoch : this.trashedAfter!.toUtc().toIso8601String(); } else { - // json[r'trashedAfter'] = null; + json[r'trashedAfter'] = null; } if (this.trashedBefore != null) { json[r'trashedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.trashedBefore!.millisecondsSinceEpoch : this.trashedBefore!.toUtc().toIso8601String(); } else { - // json[r'trashedBefore'] = null; + json[r'trashedBefore'] = null; } if (this.type != null) { json[r'type'] = this.type; } else { - // json[r'type'] = null; + json[r'type'] = null; } if (this.updatedAfter != null) { json[r'updatedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAfter!.millisecondsSinceEpoch : this.updatedAfter!.toUtc().toIso8601String(); } else { - // json[r'updatedAfter'] = null; + json[r'updatedAfter'] = null; } if (this.updatedBefore != null) { json[r'updatedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedBefore!.millisecondsSinceEpoch : this.updatedBefore!.toUtc().toIso8601String(); } else { - // json[r'updatedBefore'] = null; + json[r'updatedBefore'] = null; } if (this.visibility != null) { json[r'visibility'] = this.visibility; } else { - // json[r'visibility'] = null; + json[r'visibility'] = null; } return json; } @@ -453,10 +453,16 @@ class StatisticsSearchDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static StatisticsSearchDto? fromJson(dynamic value) { - upgradeDto(value, "StatisticsSearchDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return StatisticsSearchDto( albumIds: json[r'albumIds'] is Iterable ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/sync_ack_delete_dto.dart b/mobile/openapi/lib/model/sync_ack_delete_dto.dart index b72ae8c5a6..3f8dbc29fe 100644 --- a/mobile/openapi/lib/model/sync_ack_delete_dto.dart +++ b/mobile/openapi/lib/model/sync_ack_delete_dto.dart @@ -41,10 +41,16 @@ class SyncAckDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAckDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "SyncAckDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return SyncAckDeleteDto( types: SyncEntityType.listFromJson(json[r'types']), ); diff --git a/mobile/openapi/lib/model/sync_ack_dto.dart b/mobile/openapi/lib/model/sync_ack_dto.dart index fa7e20a832..098ce6c4b6 100644 --- a/mobile/openapi/lib/model/sync_ack_dto.dart +++ b/mobile/openapi/lib/model/sync_ack_dto.dart @@ -47,10 +47,20 @@ class SyncAckDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAckDto? fromJson(dynamic value) { - upgradeDto(value, "SyncAckDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'ack'), 'Required key "SyncAckDto[ack]" is missing from JSON.'); + assert(json[r'ack'] != null, 'Required key "SyncAckDto[ack]" has a null value in JSON.'); + assert(json.containsKey(r'type'), 'Required key "SyncAckDto[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "SyncAckDto[type]" has a null value in JSON.'); + return true; + }()); + return SyncAckDto( ack: mapValueOfType(json, r'ack')!, type: SyncEntityType.fromJson(json[r'type'])!, diff --git a/mobile/openapi/lib/model/sync_ack_set_dto.dart b/mobile/openapi/lib/model/sync_ack_set_dto.dart index 531a9dc763..92ba67941b 100644 --- a/mobile/openapi/lib/model/sync_ack_set_dto.dart +++ b/mobile/openapi/lib/model/sync_ack_set_dto.dart @@ -41,10 +41,18 @@ class SyncAckSetDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAckSetDto? fromJson(dynamic value) { - upgradeDto(value, "SyncAckSetDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'acks'), 'Required key "SyncAckSetDto[acks]" is missing from JSON.'); + assert(json[r'acks'] != null, 'Required key "SyncAckSetDto[acks]" has a null value in JSON.'); + return true; + }()); + return SyncAckSetDto( acks: json[r'acks'] is Iterable ? (json[r'acks'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/sync_album_delete_v1.dart b/mobile/openapi/lib/model/sync_album_delete_v1.dart index a6fdf5c68c..867be55efa 100644 --- a/mobile/openapi/lib/model/sync_album_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_album_delete_v1.dart @@ -41,10 +41,18 @@ class SyncAlbumDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumId'), 'Required key "SyncAlbumDeleteV1[albumId]" is missing from JSON.'); + assert(json[r'albumId'] != null, 'Required key "SyncAlbumDeleteV1[albumId]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumDeleteV1( albumId: mapValueOfType(json, r'albumId')!, ); diff --git a/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart b/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart index 08952b90ed..4d14bf168a 100644 --- a/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart @@ -48,10 +48,20 @@ class SyncAlbumToAssetDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumToAssetDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumToAssetDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumId'), 'Required key "SyncAlbumToAssetDeleteV1[albumId]" is missing from JSON.'); + assert(json[r'albumId'] != null, 'Required key "SyncAlbumToAssetDeleteV1[albumId]" has a null value in JSON.'); + assert(json.containsKey(r'assetId'), 'Required key "SyncAlbumToAssetDeleteV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAlbumToAssetDeleteV1[assetId]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumToAssetDeleteV1( albumId: mapValueOfType(json, r'albumId')!, assetId: mapValueOfType(json, r'assetId')!, diff --git a/mobile/openapi/lib/model/sync_album_to_asset_v1.dart b/mobile/openapi/lib/model/sync_album_to_asset_v1.dart index 5f38b35088..6f7042cc68 100644 --- a/mobile/openapi/lib/model/sync_album_to_asset_v1.dart +++ b/mobile/openapi/lib/model/sync_album_to_asset_v1.dart @@ -48,10 +48,20 @@ class SyncAlbumToAssetV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumToAssetV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumToAssetV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumId'), 'Required key "SyncAlbumToAssetV1[albumId]" is missing from JSON.'); + assert(json[r'albumId'] != null, 'Required key "SyncAlbumToAssetV1[albumId]" has a null value in JSON.'); + assert(json.containsKey(r'assetId'), 'Required key "SyncAlbumToAssetV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAlbumToAssetV1[assetId]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumToAssetV1( albumId: mapValueOfType(json, r'albumId')!, assetId: mapValueOfType(json, r'assetId')!, diff --git a/mobile/openapi/lib/model/sync_album_user_delete_v1.dart b/mobile/openapi/lib/model/sync_album_user_delete_v1.dart index 526bcc6b6e..b74da20262 100644 --- a/mobile/openapi/lib/model/sync_album_user_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_album_user_delete_v1.dart @@ -48,10 +48,20 @@ class SyncAlbumUserDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumUserDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumUserDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumId'), 'Required key "SyncAlbumUserDeleteV1[albumId]" is missing from JSON.'); + assert(json[r'albumId'] != null, 'Required key "SyncAlbumUserDeleteV1[albumId]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "SyncAlbumUserDeleteV1[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "SyncAlbumUserDeleteV1[userId]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumUserDeleteV1( albumId: mapValueOfType(json, r'albumId')!, userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/sync_album_user_v1.dart b/mobile/openapi/lib/model/sync_album_user_v1.dart index 1efe7da029..8ef4db3437 100644 --- a/mobile/openapi/lib/model/sync_album_user_v1.dart +++ b/mobile/openapi/lib/model/sync_album_user_v1.dart @@ -54,10 +54,22 @@ class SyncAlbumUserV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumUserV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumUserV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumId'), 'Required key "SyncAlbumUserV1[albumId]" is missing from JSON.'); + assert(json[r'albumId'] != null, 'Required key "SyncAlbumUserV1[albumId]" has a null value in JSON.'); + assert(json.containsKey(r'role'), 'Required key "SyncAlbumUserV1[role]" is missing from JSON.'); + assert(json[r'role'] != null, 'Required key "SyncAlbumUserV1[role]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "SyncAlbumUserV1[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "SyncAlbumUserV1[userId]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumUserV1( albumId: mapValueOfType(json, r'albumId')!, role: AlbumUserRole.fromJson(json[r'role'])!, diff --git a/mobile/openapi/lib/model/sync_album_v1.dart b/mobile/openapi/lib/model/sync_album_v1.dart index 17b2bda02b..39aa9fcbfe 100644 --- a/mobile/openapi/lib/model/sync_album_v1.dart +++ b/mobile/openapi/lib/model/sync_album_v1.dart @@ -92,7 +92,7 @@ class SyncAlbumV1 { if (this.thumbnailAssetId != null) { json[r'thumbnailAssetId'] = this.thumbnailAssetId; } else { - // json[r'thumbnailAssetId'] = null; + json[r'thumbnailAssetId'] = null; } json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAt.millisecondsSinceEpoch @@ -104,10 +104,33 @@ class SyncAlbumV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "SyncAlbumV1[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SyncAlbumV1[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'description'), 'Required key "SyncAlbumV1[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "SyncAlbumV1[description]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAlbumV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAlbumV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'isActivityEnabled'), 'Required key "SyncAlbumV1[isActivityEnabled]" is missing from JSON.'); + assert(json[r'isActivityEnabled'] != null, 'Required key "SyncAlbumV1[isActivityEnabled]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "SyncAlbumV1[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "SyncAlbumV1[name]" has a null value in JSON.'); + assert(json.containsKey(r'order'), 'Required key "SyncAlbumV1[order]" is missing from JSON.'); + assert(json[r'order'] != null, 'Required key "SyncAlbumV1[order]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "SyncAlbumV1[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "SyncAlbumV1[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnailAssetId'), 'Required key "SyncAlbumV1[thumbnailAssetId]" is missing from JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SyncAlbumV1[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SyncAlbumV1[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumV1( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, description: mapValueOfType(json, r'description')!, diff --git a/mobile/openapi/lib/model/sync_album_v2.dart b/mobile/openapi/lib/model/sync_album_v2.dart index 67c65a190b..8bc5cdf80f 100644 --- a/mobile/openapi/lib/model/sync_album_v2.dart +++ b/mobile/openapi/lib/model/sync_album_v2.dart @@ -85,7 +85,7 @@ class SyncAlbumV2 { if (this.thumbnailAssetId != null) { json[r'thumbnailAssetId'] = this.thumbnailAssetId; } else { - // json[r'thumbnailAssetId'] = null; + json[r'thumbnailAssetId'] = null; } json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAt.millisecondsSinceEpoch @@ -97,10 +97,31 @@ class SyncAlbumV2 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAlbumV2? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumV2"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "SyncAlbumV2[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SyncAlbumV2[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'description'), 'Required key "SyncAlbumV2[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "SyncAlbumV2[description]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAlbumV2[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAlbumV2[id]" has a null value in JSON.'); + assert(json.containsKey(r'isActivityEnabled'), 'Required key "SyncAlbumV2[isActivityEnabled]" is missing from JSON.'); + assert(json[r'isActivityEnabled'] != null, 'Required key "SyncAlbumV2[isActivityEnabled]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "SyncAlbumV2[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "SyncAlbumV2[name]" has a null value in JSON.'); + assert(json.containsKey(r'order'), 'Required key "SyncAlbumV2[order]" is missing from JSON.'); + assert(json[r'order'] != null, 'Required key "SyncAlbumV2[order]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnailAssetId'), 'Required key "SyncAlbumV2[thumbnailAssetId]" is missing from JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SyncAlbumV2[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SyncAlbumV2[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SyncAlbumV2( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, description: mapValueOfType(json, r'description')!, diff --git a/mobile/openapi/lib/model/sync_asset_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_delete_v1.dart index 1d5a947774..e6af3d2178 100644 --- a/mobile/openapi/lib/model/sync_asset_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_delete_v1.dart @@ -41,10 +41,18 @@ class SyncAssetDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetDeleteV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetDeleteV1[assetId]" has a null value in JSON.'); + return true; + }()); + return SyncAssetDeleteV1( assetId: mapValueOfType(json, r'assetId')!, ); diff --git a/mobile/openapi/lib/model/sync_asset_edit_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_edit_delete_v1.dart index e0c98bfef3..b244700cb2 100644 --- a/mobile/openapi/lib/model/sync_asset_edit_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_edit_delete_v1.dart @@ -41,10 +41,18 @@ class SyncAssetEditDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetEditDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetEditDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'editId'), 'Required key "SyncAssetEditDeleteV1[editId]" is missing from JSON.'); + assert(json[r'editId'] != null, 'Required key "SyncAssetEditDeleteV1[editId]" has a null value in JSON.'); + return true; + }()); + return SyncAssetEditDeleteV1( editId: mapValueOfType(json, r'editId')!, ); diff --git a/mobile/openapi/lib/model/sync_asset_edit_v1.dart b/mobile/openapi/lib/model/sync_asset_edit_v1.dart index 8acfad5f6a..5a0284a75f 100644 --- a/mobile/openapi/lib/model/sync_asset_edit_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_edit_v1.dart @@ -71,10 +71,26 @@ class SyncAssetEditV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetEditV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetEditV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'action'), 'Required key "SyncAssetEditV1[action]" is missing from JSON.'); + assert(json[r'action'] != null, 'Required key "SyncAssetEditV1[action]" has a null value in JSON.'); + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetEditV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetEditV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAssetEditV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAssetEditV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'parameters'), 'Required key "SyncAssetEditV1[parameters]" is missing from JSON.'); + assert(json[r'parameters'] != null, 'Required key "SyncAssetEditV1[parameters]" has a null value in JSON.'); + assert(json.containsKey(r'sequence'), 'Required key "SyncAssetEditV1[sequence]" is missing from JSON.'); + assert(json[r'sequence'] != null, 'Required key "SyncAssetEditV1[sequence]" has a null value in JSON.'); + return true; + }()); + return SyncAssetEditV1( action: AssetEditAction.fromJson(json[r'action'])!, assetId: mapValueOfType(json, r'assetId')!, diff --git a/mobile/openapi/lib/model/sync_asset_exif_v1.dart b/mobile/openapi/lib/model/sync_asset_exif_v1.dart index caaeed7fb3..0ed2cfb9e6 100644 --- a/mobile/openapi/lib/model/sync_asset_exif_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_exif_v1.dart @@ -196,126 +196,126 @@ class SyncAssetExifV1 { if (this.city != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + json[r'city'] = null; } if (this.country != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + json[r'country'] = null; } if (this.dateTimeOriginal != null) { json[r'dateTimeOriginal'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.dateTimeOriginal!.millisecondsSinceEpoch : this.dateTimeOriginal!.toUtc().toIso8601String(); } else { - // json[r'dateTimeOriginal'] = null; + json[r'dateTimeOriginal'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.exifImageHeight != null) { json[r'exifImageHeight'] = this.exifImageHeight; } else { - // json[r'exifImageHeight'] = null; + json[r'exifImageHeight'] = null; } if (this.exifImageWidth != null) { json[r'exifImageWidth'] = this.exifImageWidth; } else { - // json[r'exifImageWidth'] = null; + json[r'exifImageWidth'] = null; } if (this.exposureTime != null) { json[r'exposureTime'] = this.exposureTime; } else { - // json[r'exposureTime'] = null; + json[r'exposureTime'] = null; } if (this.fNumber != null) { json[r'fNumber'] = this.fNumber; } else { - // json[r'fNumber'] = null; + json[r'fNumber'] = null; } if (this.fileSizeInByte != null) { json[r'fileSizeInByte'] = this.fileSizeInByte; } else { - // json[r'fileSizeInByte'] = null; + json[r'fileSizeInByte'] = null; } if (this.focalLength != null) { json[r'focalLength'] = this.focalLength; } else { - // json[r'focalLength'] = null; + json[r'focalLength'] = null; } if (this.fps != null) { json[r'fps'] = this.fps; } else { - // json[r'fps'] = null; + json[r'fps'] = null; } if (this.iso != null) { json[r'iso'] = this.iso; } else { - // json[r'iso'] = null; + json[r'iso'] = null; } if (this.latitude != null) { json[r'latitude'] = this.latitude; } else { - // json[r'latitude'] = null; + json[r'latitude'] = null; } if (this.lensModel != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + json[r'lensModel'] = null; } if (this.longitude != null) { json[r'longitude'] = this.longitude; } else { - // json[r'longitude'] = null; + json[r'longitude'] = null; } if (this.make != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + json[r'make'] = null; } if (this.model != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + json[r'model'] = null; } if (this.modifyDate != null) { json[r'modifyDate'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.modifyDate!.millisecondsSinceEpoch : this.modifyDate!.toUtc().toIso8601String(); } else { - // json[r'modifyDate'] = null; + json[r'modifyDate'] = null; } if (this.orientation != null) { json[r'orientation'] = this.orientation; } else { - // json[r'orientation'] = null; + json[r'orientation'] = null; } if (this.profileDescription != null) { json[r'profileDescription'] = this.profileDescription; } else { - // json[r'profileDescription'] = null; + json[r'profileDescription'] = null; } if (this.projectionType != null) { json[r'projectionType'] = this.projectionType; } else { - // json[r'projectionType'] = null; + json[r'projectionType'] = null; } if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.state != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + json[r'state'] = null; } if (this.timeZone != null) { json[r'timeZone'] = this.timeZone; } else { - // json[r'timeZone'] = null; + json[r'timeZone'] = null; } return json; } @@ -324,10 +324,42 @@ class SyncAssetExifV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetExifV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetExifV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetExifV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetExifV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'city'), 'Required key "SyncAssetExifV1[city]" is missing from JSON.'); + assert(json.containsKey(r'country'), 'Required key "SyncAssetExifV1[country]" is missing from JSON.'); + assert(json.containsKey(r'dateTimeOriginal'), 'Required key "SyncAssetExifV1[dateTimeOriginal]" is missing from JSON.'); + assert(json.containsKey(r'description'), 'Required key "SyncAssetExifV1[description]" is missing from JSON.'); + assert(json.containsKey(r'exifImageHeight'), 'Required key "SyncAssetExifV1[exifImageHeight]" is missing from JSON.'); + assert(json.containsKey(r'exifImageWidth'), 'Required key "SyncAssetExifV1[exifImageWidth]" is missing from JSON.'); + assert(json.containsKey(r'exposureTime'), 'Required key "SyncAssetExifV1[exposureTime]" is missing from JSON.'); + assert(json.containsKey(r'fNumber'), 'Required key "SyncAssetExifV1[fNumber]" is missing from JSON.'); + assert(json.containsKey(r'fileSizeInByte'), 'Required key "SyncAssetExifV1[fileSizeInByte]" is missing from JSON.'); + assert(json.containsKey(r'focalLength'), 'Required key "SyncAssetExifV1[focalLength]" is missing from JSON.'); + assert(json.containsKey(r'fps'), 'Required key "SyncAssetExifV1[fps]" is missing from JSON.'); + assert(json.containsKey(r'iso'), 'Required key "SyncAssetExifV1[iso]" is missing from JSON.'); + assert(json.containsKey(r'latitude'), 'Required key "SyncAssetExifV1[latitude]" is missing from JSON.'); + assert(json.containsKey(r'lensModel'), 'Required key "SyncAssetExifV1[lensModel]" is missing from JSON.'); + assert(json.containsKey(r'longitude'), 'Required key "SyncAssetExifV1[longitude]" is missing from JSON.'); + assert(json.containsKey(r'make'), 'Required key "SyncAssetExifV1[make]" is missing from JSON.'); + assert(json.containsKey(r'model'), 'Required key "SyncAssetExifV1[model]" is missing from JSON.'); + assert(json.containsKey(r'modifyDate'), 'Required key "SyncAssetExifV1[modifyDate]" is missing from JSON.'); + assert(json.containsKey(r'orientation'), 'Required key "SyncAssetExifV1[orientation]" is missing from JSON.'); + assert(json.containsKey(r'profileDescription'), 'Required key "SyncAssetExifV1[profileDescription]" is missing from JSON.'); + assert(json.containsKey(r'projectionType'), 'Required key "SyncAssetExifV1[projectionType]" is missing from JSON.'); + assert(json.containsKey(r'rating'), 'Required key "SyncAssetExifV1[rating]" is missing from JSON.'); + assert(json.containsKey(r'state'), 'Required key "SyncAssetExifV1[state]" is missing from JSON.'); + assert(json.containsKey(r'timeZone'), 'Required key "SyncAssetExifV1[timeZone]" is missing from JSON.'); + return true; + }()); + return SyncAssetExifV1( assetId: mapValueOfType(json, r'assetId')!, city: mapValueOfType(json, r'city'), @@ -337,14 +369,14 @@ class SyncAssetExifV1 { exifImageHeight: mapValueOfType(json, r'exifImageHeight'), exifImageWidth: mapValueOfType(json, r'exifImageWidth'), exposureTime: mapValueOfType(json, r'exposureTime'), - fNumber: (mapValueOfType(json, r'fNumber'))?.toDouble(), + fNumber: mapValueOfType(json, r'fNumber'), fileSizeInByte: mapValueOfType(json, r'fileSizeInByte'), - focalLength: (mapValueOfType(json, r'focalLength'))?.toDouble(), - fps: (mapValueOfType(json, r'fps'))?.toDouble(), + focalLength: mapValueOfType(json, r'focalLength'), + fps: mapValueOfType(json, r'fps'), iso: mapValueOfType(json, r'iso'), - latitude: (mapValueOfType(json, r'latitude'))?.toDouble(), + latitude: mapValueOfType(json, r'latitude'), lensModel: mapValueOfType(json, r'lensModel'), - longitude: (mapValueOfType(json, r'longitude'))?.toDouble(), + longitude: mapValueOfType(json, r'longitude'), make: mapValueOfType(json, r'make'), model: mapValueOfType(json, r'model'), modifyDate: mapDateTime(json, r'modifyDate', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), diff --git a/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart index 9cfb8814a7..3995309bf1 100644 --- a/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart @@ -41,10 +41,18 @@ class SyncAssetFaceDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetFaceDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetFaceDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetFaceId'), 'Required key "SyncAssetFaceDeleteV1[assetFaceId]" is missing from JSON.'); + assert(json[r'assetFaceId'] != null, 'Required key "SyncAssetFaceDeleteV1[assetFaceId]" has a null value in JSON.'); + return true; + }()); + return SyncAssetFaceDeleteV1( assetFaceId: mapValueOfType(json, r'assetFaceId')!, ); diff --git a/mobile/openapi/lib/model/sync_asset_face_v1.dart b/mobile/openapi/lib/model/sync_asset_face_v1.dart index c3f74ff2cd..859ebf3fc4 100644 --- a/mobile/openapi/lib/model/sync_asset_face_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_face_v1.dart @@ -116,7 +116,7 @@ class SyncAssetFaceV1 { if (this.personId != null) { json[r'personId'] = this.personId; } else { - // json[r'personId'] = null; + json[r'personId'] = null; } json[r'sourceType'] = this.sourceType; return json; @@ -126,10 +126,35 @@ class SyncAssetFaceV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetFaceV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetFaceV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetFaceV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetFaceV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxX1'), 'Required key "SyncAssetFaceV1[boundingBoxX1]" is missing from JSON.'); + assert(json[r'boundingBoxX1'] != null, 'Required key "SyncAssetFaceV1[boundingBoxX1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxX2'), 'Required key "SyncAssetFaceV1[boundingBoxX2]" is missing from JSON.'); + assert(json[r'boundingBoxX2'] != null, 'Required key "SyncAssetFaceV1[boundingBoxX2]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY1'), 'Required key "SyncAssetFaceV1[boundingBoxY1]" is missing from JSON.'); + assert(json[r'boundingBoxY1'] != null, 'Required key "SyncAssetFaceV1[boundingBoxY1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY2'), 'Required key "SyncAssetFaceV1[boundingBoxY2]" is missing from JSON.'); + assert(json[r'boundingBoxY2'] != null, 'Required key "SyncAssetFaceV1[boundingBoxY2]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAssetFaceV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAssetFaceV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'imageHeight'), 'Required key "SyncAssetFaceV1[imageHeight]" is missing from JSON.'); + assert(json[r'imageHeight'] != null, 'Required key "SyncAssetFaceV1[imageHeight]" has a null value in JSON.'); + assert(json.containsKey(r'imageWidth'), 'Required key "SyncAssetFaceV1[imageWidth]" is missing from JSON.'); + assert(json[r'imageWidth'] != null, 'Required key "SyncAssetFaceV1[imageWidth]" has a null value in JSON.'); + assert(json.containsKey(r'personId'), 'Required key "SyncAssetFaceV1[personId]" is missing from JSON.'); + assert(json.containsKey(r'sourceType'), 'Required key "SyncAssetFaceV1[sourceType]" is missing from JSON.'); + assert(json[r'sourceType'] != null, 'Required key "SyncAssetFaceV1[sourceType]" has a null value in JSON.'); + return true; + }()); + return SyncAssetFaceV1( assetId: mapValueOfType(json, r'assetId')!, boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, diff --git a/mobile/openapi/lib/model/sync_asset_face_v2.dart b/mobile/openapi/lib/model/sync_asset_face_v2.dart index aeefc2ece9..86b85a0341 100644 --- a/mobile/openapi/lib/model/sync_asset_face_v2.dart +++ b/mobile/openapi/lib/model/sync_asset_face_v2.dart @@ -127,7 +127,7 @@ class SyncAssetFaceV2 { ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } json[r'id'] = this.id; json[r'imageHeight'] = this.imageHeight; @@ -136,7 +136,7 @@ class SyncAssetFaceV2 { if (this.personId != null) { json[r'personId'] = this.personId; } else { - // json[r'personId'] = null; + json[r'personId'] = null; } json[r'sourceType'] = this.sourceType; return json; @@ -146,10 +146,38 @@ class SyncAssetFaceV2 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetFaceV2? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetFaceV2"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetFaceV2[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetFaceV2[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxX1'), 'Required key "SyncAssetFaceV2[boundingBoxX1]" is missing from JSON.'); + assert(json[r'boundingBoxX1'] != null, 'Required key "SyncAssetFaceV2[boundingBoxX1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxX2'), 'Required key "SyncAssetFaceV2[boundingBoxX2]" is missing from JSON.'); + assert(json[r'boundingBoxX2'] != null, 'Required key "SyncAssetFaceV2[boundingBoxX2]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY1'), 'Required key "SyncAssetFaceV2[boundingBoxY1]" is missing from JSON.'); + assert(json[r'boundingBoxY1'] != null, 'Required key "SyncAssetFaceV2[boundingBoxY1]" has a null value in JSON.'); + assert(json.containsKey(r'boundingBoxY2'), 'Required key "SyncAssetFaceV2[boundingBoxY2]" is missing from JSON.'); + assert(json[r'boundingBoxY2'] != null, 'Required key "SyncAssetFaceV2[boundingBoxY2]" has a null value in JSON.'); + assert(json.containsKey(r'deletedAt'), 'Required key "SyncAssetFaceV2[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAssetFaceV2[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAssetFaceV2[id]" has a null value in JSON.'); + assert(json.containsKey(r'imageHeight'), 'Required key "SyncAssetFaceV2[imageHeight]" is missing from JSON.'); + assert(json[r'imageHeight'] != null, 'Required key "SyncAssetFaceV2[imageHeight]" has a null value in JSON.'); + assert(json.containsKey(r'imageWidth'), 'Required key "SyncAssetFaceV2[imageWidth]" is missing from JSON.'); + assert(json[r'imageWidth'] != null, 'Required key "SyncAssetFaceV2[imageWidth]" has a null value in JSON.'); + assert(json.containsKey(r'isVisible'), 'Required key "SyncAssetFaceV2[isVisible]" is missing from JSON.'); + assert(json[r'isVisible'] != null, 'Required key "SyncAssetFaceV2[isVisible]" has a null value in JSON.'); + assert(json.containsKey(r'personId'), 'Required key "SyncAssetFaceV2[personId]" is missing from JSON.'); + assert(json.containsKey(r'sourceType'), 'Required key "SyncAssetFaceV2[sourceType]" is missing from JSON.'); + assert(json[r'sourceType'] != null, 'Required key "SyncAssetFaceV2[sourceType]" has a null value in JSON.'); + return true; + }()); + return SyncAssetFaceV2( assetId: mapValueOfType(json, r'assetId')!, boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, diff --git a/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart index 326555ef13..e4fed9a013 100644 --- a/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart @@ -48,10 +48,20 @@ class SyncAssetMetadataDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetMetadataDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetMetadataDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetMetadataDeleteV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetMetadataDeleteV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'key'), 'Required key "SyncAssetMetadataDeleteV1[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "SyncAssetMetadataDeleteV1[key]" has a null value in JSON.'); + return true; + }()); + return SyncAssetMetadataDeleteV1( assetId: mapValueOfType(json, r'assetId')!, key: mapValueOfType(json, r'key')!, diff --git a/mobile/openapi/lib/model/sync_asset_metadata_v1.dart b/mobile/openapi/lib/model/sync_asset_metadata_v1.dart index 08d7eae49b..d9ecdbc5e7 100644 --- a/mobile/openapi/lib/model/sync_asset_metadata_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_metadata_v1.dart @@ -55,10 +55,22 @@ class SyncAssetMetadataV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetMetadataV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetMetadataV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncAssetMetadataV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncAssetMetadataV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'key'), 'Required key "SyncAssetMetadataV1[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "SyncAssetMetadataV1[key]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "SyncAssetMetadataV1[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "SyncAssetMetadataV1[value]" has a null value in JSON.'); + return true; + }()); + return SyncAssetMetadataV1( assetId: mapValueOfType(json, r'assetId')!, key: mapValueOfType(json, r'key')!, diff --git a/mobile/openapi/lib/model/sync_asset_v1.dart b/mobile/openapi/lib/model/sync_asset_v1.dart index d08de6ab72..6892531ff5 100644 --- a/mobile/openapi/lib/model/sync_asset_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_v1.dart @@ -151,31 +151,31 @@ class SyncAssetV1 { ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } if (this.duration != null) { json[r'duration'] = this.duration; } else { - // json[r'duration'] = null; + json[r'duration'] = null; } if (this.fileCreatedAt != null) { json[r'fileCreatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.fileCreatedAt!.millisecondsSinceEpoch : this.fileCreatedAt!.toUtc().toIso8601String(); } else { - // json[r'fileCreatedAt'] = null; + json[r'fileCreatedAt'] = null; } if (this.fileModifiedAt != null) { json[r'fileModifiedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.fileModifiedAt!.millisecondsSinceEpoch : this.fileModifiedAt!.toUtc().toIso8601String(); } else { - // json[r'fileModifiedAt'] = null; + json[r'fileModifiedAt'] = null; } if (this.height != null) { json[r'height'] = this.height; } else { - // json[r'height'] = null; + json[r'height'] = null; } json[r'id'] = this.id; json[r'isEdited'] = this.isEdited; @@ -183,38 +183,38 @@ class SyncAssetV1 { if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.livePhotoVideoId != null) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - // json[r'livePhotoVideoId'] = null; + json[r'livePhotoVideoId'] = null; } if (this.localDateTime != null) { json[r'localDateTime'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.localDateTime!.millisecondsSinceEpoch : this.localDateTime!.toUtc().toIso8601String(); } else { - // json[r'localDateTime'] = null; + json[r'localDateTime'] = null; } json[r'originalFileName'] = this.originalFileName; json[r'ownerId'] = this.ownerId; if (this.stackId != null) { json[r'stackId'] = this.stackId; } else { - // json[r'stackId'] = null; + json[r'stackId'] = null; } if (this.thumbhash != null) { json[r'thumbhash'] = this.thumbhash; } else { - // json[r'thumbhash'] = null; + json[r'thumbhash'] = null; } json[r'type'] = this.type; json[r'visibility'] = this.visibility; if (this.width != null) { json[r'width'] = this.width; } else { - // json[r'width'] = null; + json[r'width'] = null; } return json; } @@ -223,10 +223,43 @@ class SyncAssetV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'checksum'), 'Required key "SyncAssetV1[checksum]" is missing from JSON.'); + assert(json[r'checksum'] != null, 'Required key "SyncAssetV1[checksum]" has a null value in JSON.'); + assert(json.containsKey(r'deletedAt'), 'Required key "SyncAssetV1[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'duration'), 'Required key "SyncAssetV1[duration]" is missing from JSON.'); + assert(json.containsKey(r'fileCreatedAt'), 'Required key "SyncAssetV1[fileCreatedAt]" is missing from JSON.'); + assert(json.containsKey(r'fileModifiedAt'), 'Required key "SyncAssetV1[fileModifiedAt]" is missing from JSON.'); + assert(json.containsKey(r'height'), 'Required key "SyncAssetV1[height]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAssetV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAssetV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'isEdited'), 'Required key "SyncAssetV1[isEdited]" is missing from JSON.'); + assert(json[r'isEdited'] != null, 'Required key "SyncAssetV1[isEdited]" has a null value in JSON.'); + assert(json.containsKey(r'isFavorite'), 'Required key "SyncAssetV1[isFavorite]" is missing from JSON.'); + assert(json[r'isFavorite'] != null, 'Required key "SyncAssetV1[isFavorite]" has a null value in JSON.'); + assert(json.containsKey(r'libraryId'), 'Required key "SyncAssetV1[libraryId]" is missing from JSON.'); + assert(json.containsKey(r'livePhotoVideoId'), 'Required key "SyncAssetV1[livePhotoVideoId]" is missing from JSON.'); + assert(json.containsKey(r'localDateTime'), 'Required key "SyncAssetV1[localDateTime]" is missing from JSON.'); + assert(json.containsKey(r'originalFileName'), 'Required key "SyncAssetV1[originalFileName]" is missing from JSON.'); + assert(json[r'originalFileName'] != null, 'Required key "SyncAssetV1[originalFileName]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "SyncAssetV1[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "SyncAssetV1[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'stackId'), 'Required key "SyncAssetV1[stackId]" is missing from JSON.'); + assert(json.containsKey(r'thumbhash'), 'Required key "SyncAssetV1[thumbhash]" is missing from JSON.'); + assert(json.containsKey(r'type'), 'Required key "SyncAssetV1[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "SyncAssetV1[type]" has a null value in JSON.'); + assert(json.containsKey(r'visibility'), 'Required key "SyncAssetV1[visibility]" is missing from JSON.'); + assert(json[r'visibility'] != null, 'Required key "SyncAssetV1[visibility]" has a null value in JSON.'); + assert(json.containsKey(r'width'), 'Required key "SyncAssetV1[width]" is missing from JSON.'); + return true; + }()); + return SyncAssetV1( checksum: mapValueOfType(json, r'checksum')!, deletedAt: mapDateTime(json, r'deletedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), diff --git a/mobile/openapi/lib/model/sync_asset_v2.dart b/mobile/openapi/lib/model/sync_asset_v2.dart index ebe75c59b2..b87d1e9633 100644 --- a/mobile/openapi/lib/model/sync_asset_v2.dart +++ b/mobile/openapi/lib/model/sync_asset_v2.dart @@ -154,31 +154,31 @@ class SyncAssetV2 { ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } if (this.duration != null) { json[r'duration'] = this.duration; } else { - // json[r'duration'] = null; + json[r'duration'] = null; } if (this.fileCreatedAt != null) { json[r'fileCreatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.fileCreatedAt!.millisecondsSinceEpoch : this.fileCreatedAt!.toUtc().toIso8601String(); } else { - // json[r'fileCreatedAt'] = null; + json[r'fileCreatedAt'] = null; } if (this.fileModifiedAt != null) { json[r'fileModifiedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.fileModifiedAt!.millisecondsSinceEpoch : this.fileModifiedAt!.toUtc().toIso8601String(); } else { - // json[r'fileModifiedAt'] = null; + json[r'fileModifiedAt'] = null; } if (this.height != null) { json[r'height'] = this.height; } else { - // json[r'height'] = null; + json[r'height'] = null; } json[r'id'] = this.id; json[r'isEdited'] = this.isEdited; @@ -186,38 +186,38 @@ class SyncAssetV2 { if (this.libraryId != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + json[r'libraryId'] = null; } if (this.livePhotoVideoId != null) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - // json[r'livePhotoVideoId'] = null; + json[r'livePhotoVideoId'] = null; } if (this.localDateTime != null) { json[r'localDateTime'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.localDateTime!.millisecondsSinceEpoch : this.localDateTime!.toUtc().toIso8601String(); } else { - // json[r'localDateTime'] = null; + json[r'localDateTime'] = null; } json[r'originalFileName'] = this.originalFileName; json[r'ownerId'] = this.ownerId; if (this.stackId != null) { json[r'stackId'] = this.stackId; } else { - // json[r'stackId'] = null; + json[r'stackId'] = null; } if (this.thumbhash != null) { json[r'thumbhash'] = this.thumbhash; } else { - // json[r'thumbhash'] = null; + json[r'thumbhash'] = null; } json[r'type'] = this.type; json[r'visibility'] = this.visibility; if (this.width != null) { json[r'width'] = this.width; } else { - // json[r'width'] = null; + json[r'width'] = null; } return json; } @@ -226,10 +226,43 @@ class SyncAssetV2 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAssetV2? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetV2"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'checksum'), 'Required key "SyncAssetV2[checksum]" is missing from JSON.'); + assert(json[r'checksum'] != null, 'Required key "SyncAssetV2[checksum]" has a null value in JSON.'); + assert(json.containsKey(r'deletedAt'), 'Required key "SyncAssetV2[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'duration'), 'Required key "SyncAssetV2[duration]" is missing from JSON.'); + assert(json.containsKey(r'fileCreatedAt'), 'Required key "SyncAssetV2[fileCreatedAt]" is missing from JSON.'); + assert(json.containsKey(r'fileModifiedAt'), 'Required key "SyncAssetV2[fileModifiedAt]" is missing from JSON.'); + assert(json.containsKey(r'height'), 'Required key "SyncAssetV2[height]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAssetV2[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAssetV2[id]" has a null value in JSON.'); + assert(json.containsKey(r'isEdited'), 'Required key "SyncAssetV2[isEdited]" is missing from JSON.'); + assert(json[r'isEdited'] != null, 'Required key "SyncAssetV2[isEdited]" has a null value in JSON.'); + assert(json.containsKey(r'isFavorite'), 'Required key "SyncAssetV2[isFavorite]" is missing from JSON.'); + assert(json[r'isFavorite'] != null, 'Required key "SyncAssetV2[isFavorite]" has a null value in JSON.'); + assert(json.containsKey(r'libraryId'), 'Required key "SyncAssetV2[libraryId]" is missing from JSON.'); + assert(json.containsKey(r'livePhotoVideoId'), 'Required key "SyncAssetV2[livePhotoVideoId]" is missing from JSON.'); + assert(json.containsKey(r'localDateTime'), 'Required key "SyncAssetV2[localDateTime]" is missing from JSON.'); + assert(json.containsKey(r'originalFileName'), 'Required key "SyncAssetV2[originalFileName]" is missing from JSON.'); + assert(json[r'originalFileName'] != null, 'Required key "SyncAssetV2[originalFileName]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "SyncAssetV2[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "SyncAssetV2[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'stackId'), 'Required key "SyncAssetV2[stackId]" is missing from JSON.'); + assert(json.containsKey(r'thumbhash'), 'Required key "SyncAssetV2[thumbhash]" is missing from JSON.'); + assert(json.containsKey(r'type'), 'Required key "SyncAssetV2[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "SyncAssetV2[type]" has a null value in JSON.'); + assert(json.containsKey(r'visibility'), 'Required key "SyncAssetV2[visibility]" is missing from JSON.'); + assert(json[r'visibility'] != null, 'Required key "SyncAssetV2[visibility]" has a null value in JSON.'); + assert(json.containsKey(r'width'), 'Required key "SyncAssetV2[width]" is missing from JSON.'); + return true; + }()); + return SyncAssetV2( checksum: mapValueOfType(json, r'checksum')!, deletedAt: mapDateTime(json, r'deletedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), diff --git a/mobile/openapi/lib/model/sync_auth_user_v1.dart b/mobile/openapi/lib/model/sync_auth_user_v1.dart index c64d82bfbd..8a59dd4f18 100644 --- a/mobile/openapi/lib/model/sync_auth_user_v1.dart +++ b/mobile/openapi/lib/model/sync_auth_user_v1.dart @@ -113,14 +113,14 @@ class SyncAuthUserV1 { if (this.avatarColor != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + json[r'avatarColor'] = null; } if (this.deletedAt != null) { json[r'deletedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } json[r'email'] = this.email; json[r'hasProfileImage'] = this.hasProfileImage; @@ -131,7 +131,7 @@ class SyncAuthUserV1 { if (this.pinCode != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + json[r'pinCode'] = null; } json[r'profileChangedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.profileChangedAt.millisecondsSinceEpoch @@ -139,13 +139,13 @@ class SyncAuthUserV1 { if (this.quotaSizeInBytes != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + json[r'quotaSizeInBytes'] = null; } json[r'quotaUsageInBytes'] = this.quotaUsageInBytes; if (this.storageLabel != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + json[r'storageLabel'] = null; } return json; } @@ -154,10 +154,36 @@ class SyncAuthUserV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncAuthUserV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAuthUserV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'deletedAt'), 'Required key "SyncAuthUserV1[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'email'), 'Required key "SyncAuthUserV1[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "SyncAuthUserV1[email]" has a null value in JSON.'); + assert(json.containsKey(r'hasProfileImage'), 'Required key "SyncAuthUserV1[hasProfileImage]" is missing from JSON.'); + assert(json[r'hasProfileImage'] != null, 'Required key "SyncAuthUserV1[hasProfileImage]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncAuthUserV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncAuthUserV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'isAdmin'), 'Required key "SyncAuthUserV1[isAdmin]" is missing from JSON.'); + assert(json[r'isAdmin'] != null, 'Required key "SyncAuthUserV1[isAdmin]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "SyncAuthUserV1[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "SyncAuthUserV1[name]" has a null value in JSON.'); + assert(json.containsKey(r'oauthId'), 'Required key "SyncAuthUserV1[oauthId]" is missing from JSON.'); + assert(json[r'oauthId'] != null, 'Required key "SyncAuthUserV1[oauthId]" has a null value in JSON.'); + assert(json.containsKey(r'pinCode'), 'Required key "SyncAuthUserV1[pinCode]" is missing from JSON.'); + assert(json.containsKey(r'profileChangedAt'), 'Required key "SyncAuthUserV1[profileChangedAt]" is missing from JSON.'); + assert(json[r'profileChangedAt'] != null, 'Required key "SyncAuthUserV1[profileChangedAt]" has a null value in JSON.'); + assert(json.containsKey(r'quotaSizeInBytes'), 'Required key "SyncAuthUserV1[quotaSizeInBytes]" is missing from JSON.'); + assert(json.containsKey(r'quotaUsageInBytes'), 'Required key "SyncAuthUserV1[quotaUsageInBytes]" is missing from JSON.'); + assert(json[r'quotaUsageInBytes'] != null, 'Required key "SyncAuthUserV1[quotaUsageInBytes]" has a null value in JSON.'); + assert(json.containsKey(r'storageLabel'), 'Required key "SyncAuthUserV1[storageLabel]" is missing from JSON.'); + return true; + }()); + return SyncAuthUserV1( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), deletedAt: mapDateTime(json, r'deletedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), diff --git a/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart b/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart index c37682d02d..f15cbcf9d4 100644 --- a/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart @@ -48,10 +48,20 @@ class SyncMemoryAssetDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncMemoryAssetDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryAssetDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncMemoryAssetDeleteV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncMemoryAssetDeleteV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'memoryId'), 'Required key "SyncMemoryAssetDeleteV1[memoryId]" is missing from JSON.'); + assert(json[r'memoryId'] != null, 'Required key "SyncMemoryAssetDeleteV1[memoryId]" has a null value in JSON.'); + return true; + }()); + return SyncMemoryAssetDeleteV1( assetId: mapValueOfType(json, r'assetId')!, memoryId: mapValueOfType(json, r'memoryId')!, diff --git a/mobile/openapi/lib/model/sync_memory_asset_v1.dart b/mobile/openapi/lib/model/sync_memory_asset_v1.dart index 2cfab98afd..684722ebeb 100644 --- a/mobile/openapi/lib/model/sync_memory_asset_v1.dart +++ b/mobile/openapi/lib/model/sync_memory_asset_v1.dart @@ -48,10 +48,20 @@ class SyncMemoryAssetV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncMemoryAssetV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryAssetV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetId'), 'Required key "SyncMemoryAssetV1[assetId]" is missing from JSON.'); + assert(json[r'assetId'] != null, 'Required key "SyncMemoryAssetV1[assetId]" has a null value in JSON.'); + assert(json.containsKey(r'memoryId'), 'Required key "SyncMemoryAssetV1[memoryId]" is missing from JSON.'); + assert(json[r'memoryId'] != null, 'Required key "SyncMemoryAssetV1[memoryId]" has a null value in JSON.'); + return true; + }()); + return SyncMemoryAssetV1( assetId: mapValueOfType(json, r'assetId')!, memoryId: mapValueOfType(json, r'memoryId')!, diff --git a/mobile/openapi/lib/model/sync_memory_delete_v1.dart b/mobile/openapi/lib/model/sync_memory_delete_v1.dart index d5f63ec8fa..488f77a354 100644 --- a/mobile/openapi/lib/model/sync_memory_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_memory_delete_v1.dart @@ -41,10 +41,18 @@ class SyncMemoryDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncMemoryDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'memoryId'), 'Required key "SyncMemoryDeleteV1[memoryId]" is missing from JSON.'); + assert(json[r'memoryId'] != null, 'Required key "SyncMemoryDeleteV1[memoryId]" has a null value in JSON.'); + return true; + }()); + return SyncMemoryDeleteV1( memoryId: mapValueOfType(json, r'memoryId')!, ); diff --git a/mobile/openapi/lib/model/sync_memory_v1.dart b/mobile/openapi/lib/model/sync_memory_v1.dart index 855340f4d7..ebde38753b 100644 --- a/mobile/openapi/lib/model/sync_memory_v1.dart +++ b/mobile/openapi/lib/model/sync_memory_v1.dart @@ -107,14 +107,14 @@ class SyncMemoryV1 { ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } if (this.hideAt != null) { json[r'hideAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.hideAt!.millisecondsSinceEpoch : this.hideAt!.toUtc().toIso8601String(); } else { - // json[r'hideAt'] = null; + json[r'hideAt'] = null; } json[r'id'] = this.id; json[r'isSaved'] = this.isSaved; @@ -127,14 +127,14 @@ class SyncMemoryV1 { ? this.seenAt!.millisecondsSinceEpoch : this.seenAt!.toUtc().toIso8601String(); } else { - // json[r'seenAt'] = null; + json[r'seenAt'] = null; } if (this.showAt != null) { json[r'showAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.showAt!.millisecondsSinceEpoch : this.showAt!.toUtc().toIso8601String(); } else { - // json[r'showAt'] = null; + json[r'showAt'] = null; } json[r'type'] = this.type; json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') @@ -147,10 +147,36 @@ class SyncMemoryV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncMemoryV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "SyncMemoryV1[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SyncMemoryV1[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'data'), 'Required key "SyncMemoryV1[data]" is missing from JSON.'); + assert(json[r'data'] != null, 'Required key "SyncMemoryV1[data]" has a null value in JSON.'); + assert(json.containsKey(r'deletedAt'), 'Required key "SyncMemoryV1[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'hideAt'), 'Required key "SyncMemoryV1[hideAt]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncMemoryV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncMemoryV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'isSaved'), 'Required key "SyncMemoryV1[isSaved]" is missing from JSON.'); + assert(json[r'isSaved'] != null, 'Required key "SyncMemoryV1[isSaved]" has a null value in JSON.'); + assert(json.containsKey(r'memoryAt'), 'Required key "SyncMemoryV1[memoryAt]" is missing from JSON.'); + assert(json[r'memoryAt'] != null, 'Required key "SyncMemoryV1[memoryAt]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "SyncMemoryV1[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "SyncMemoryV1[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'seenAt'), 'Required key "SyncMemoryV1[seenAt]" is missing from JSON.'); + assert(json.containsKey(r'showAt'), 'Required key "SyncMemoryV1[showAt]" is missing from JSON.'); + assert(json.containsKey(r'type'), 'Required key "SyncMemoryV1[type]" is missing from JSON.'); + assert(json[r'type'] != null, 'Required key "SyncMemoryV1[type]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SyncMemoryV1[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SyncMemoryV1[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SyncMemoryV1( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, data: mapCastOfType(json, r'data')!, diff --git a/mobile/openapi/lib/model/sync_partner_delete_v1.dart b/mobile/openapi/lib/model/sync_partner_delete_v1.dart index 64dfb4eb98..56ccdf5b74 100644 --- a/mobile/openapi/lib/model/sync_partner_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_partner_delete_v1.dart @@ -48,10 +48,20 @@ class SyncPartnerDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncPartnerDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPartnerDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'sharedById'), 'Required key "SyncPartnerDeleteV1[sharedById]" is missing from JSON.'); + assert(json[r'sharedById'] != null, 'Required key "SyncPartnerDeleteV1[sharedById]" has a null value in JSON.'); + assert(json.containsKey(r'sharedWithId'), 'Required key "SyncPartnerDeleteV1[sharedWithId]" is missing from JSON.'); + assert(json[r'sharedWithId'] != null, 'Required key "SyncPartnerDeleteV1[sharedWithId]" has a null value in JSON.'); + return true; + }()); + return SyncPartnerDeleteV1( sharedById: mapValueOfType(json, r'sharedById')!, sharedWithId: mapValueOfType(json, r'sharedWithId')!, diff --git a/mobile/openapi/lib/model/sync_partner_v1.dart b/mobile/openapi/lib/model/sync_partner_v1.dart index 9f9c3d14c1..b7b01d5f6a 100644 --- a/mobile/openapi/lib/model/sync_partner_v1.dart +++ b/mobile/openapi/lib/model/sync_partner_v1.dart @@ -55,10 +55,22 @@ class SyncPartnerV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncPartnerV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPartnerV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'inTimeline'), 'Required key "SyncPartnerV1[inTimeline]" is missing from JSON.'); + assert(json[r'inTimeline'] != null, 'Required key "SyncPartnerV1[inTimeline]" has a null value in JSON.'); + assert(json.containsKey(r'sharedById'), 'Required key "SyncPartnerV1[sharedById]" is missing from JSON.'); + assert(json[r'sharedById'] != null, 'Required key "SyncPartnerV1[sharedById]" has a null value in JSON.'); + assert(json.containsKey(r'sharedWithId'), 'Required key "SyncPartnerV1[sharedWithId]" is missing from JSON.'); + assert(json[r'sharedWithId'] != null, 'Required key "SyncPartnerV1[sharedWithId]" has a null value in JSON.'); + return true; + }()); + return SyncPartnerV1( inTimeline: mapValueOfType(json, r'inTimeline')!, sharedById: mapValueOfType(json, r'sharedById')!, diff --git a/mobile/openapi/lib/model/sync_person_delete_v1.dart b/mobile/openapi/lib/model/sync_person_delete_v1.dart index 526bc26187..b21a0f034d 100644 --- a/mobile/openapi/lib/model/sync_person_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_person_delete_v1.dart @@ -41,10 +41,18 @@ class SyncPersonDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncPersonDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPersonDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'personId'), 'Required key "SyncPersonDeleteV1[personId]" is missing from JSON.'); + assert(json[r'personId'] != null, 'Required key "SyncPersonDeleteV1[personId]" has a null value in JSON.'); + return true; + }()); + return SyncPersonDeleteV1( personId: mapValueOfType(json, r'personId')!, ); diff --git a/mobile/openapi/lib/model/sync_person_v1.dart b/mobile/openapi/lib/model/sync_person_v1.dart index 1bd6f4a160..72c1785c4b 100644 --- a/mobile/openapi/lib/model/sync_person_v1.dart +++ b/mobile/openapi/lib/model/sync_person_v1.dart @@ -92,12 +92,12 @@ class SyncPersonV1 { ? this.birthDate!.millisecondsSinceEpoch : this.birthDate!.toUtc().toIso8601String(); } else { - // json[r'birthDate'] = null; + json[r'birthDate'] = null; } if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.createdAt.millisecondsSinceEpoch @@ -105,7 +105,7 @@ class SyncPersonV1 { if (this.faceAssetId != null) { json[r'faceAssetId'] = this.faceAssetId; } else { - // json[r'faceAssetId'] = null; + json[r'faceAssetId'] = null; } json[r'id'] = this.id; json[r'isFavorite'] = this.isFavorite; @@ -122,10 +122,33 @@ class SyncPersonV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncPersonV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPersonV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'birthDate'), 'Required key "SyncPersonV1[birthDate]" is missing from JSON.'); + assert(json.containsKey(r'color'), 'Required key "SyncPersonV1[color]" is missing from JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "SyncPersonV1[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SyncPersonV1[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'faceAssetId'), 'Required key "SyncPersonV1[faceAssetId]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncPersonV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncPersonV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'isFavorite'), 'Required key "SyncPersonV1[isFavorite]" is missing from JSON.'); + assert(json[r'isFavorite'] != null, 'Required key "SyncPersonV1[isFavorite]" has a null value in JSON.'); + assert(json.containsKey(r'isHidden'), 'Required key "SyncPersonV1[isHidden]" is missing from JSON.'); + assert(json[r'isHidden'] != null, 'Required key "SyncPersonV1[isHidden]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "SyncPersonV1[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "SyncPersonV1[name]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "SyncPersonV1[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "SyncPersonV1[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SyncPersonV1[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SyncPersonV1[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SyncPersonV1( birthDate: mapDateTime(json, r'birthDate', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), color: mapValueOfType(json, r'color'), diff --git a/mobile/openapi/lib/model/sync_stack_delete_v1.dart b/mobile/openapi/lib/model/sync_stack_delete_v1.dart index 2a7398291a..30348d9f2b 100644 --- a/mobile/openapi/lib/model/sync_stack_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_stack_delete_v1.dart @@ -41,10 +41,18 @@ class SyncStackDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncStackDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncStackDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'stackId'), 'Required key "SyncStackDeleteV1[stackId]" is missing from JSON.'); + assert(json[r'stackId'] != null, 'Required key "SyncStackDeleteV1[stackId]" has a null value in JSON.'); + return true; + }()); + return SyncStackDeleteV1( stackId: mapValueOfType(json, r'stackId')!, ); diff --git a/mobile/openapi/lib/model/sync_stack_v1.dart b/mobile/openapi/lib/model/sync_stack_v1.dart index 3e79a55134..3a99c21f2a 100644 --- a/mobile/openapi/lib/model/sync_stack_v1.dart +++ b/mobile/openapi/lib/model/sync_stack_v1.dart @@ -73,10 +73,26 @@ class SyncStackV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncStackV1? fromJson(dynamic value) { - upgradeDto(value, "SyncStackV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "SyncStackV1[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "SyncStackV1[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncStackV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncStackV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "SyncStackV1[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "SyncStackV1[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'primaryAssetId'), 'Required key "SyncStackV1[primaryAssetId]" is missing from JSON.'); + assert(json[r'primaryAssetId'] != null, 'Required key "SyncStackV1[primaryAssetId]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "SyncStackV1[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "SyncStackV1[updatedAt]" has a null value in JSON.'); + return true; + }()); + return SyncStackV1( createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/sync_stream_dto.dart b/mobile/openapi/lib/model/sync_stream_dto.dart index 932477cb15..c6ce8abdbc 100644 --- a/mobile/openapi/lib/model/sync_stream_dto.dart +++ b/mobile/openapi/lib/model/sync_stream_dto.dart @@ -48,7 +48,7 @@ class SyncStreamDto { if (this.reset != null) { json[r'reset'] = this.reset; } else { - // json[r'reset'] = null; + json[r'reset'] = null; } json[r'types'] = this.types; return json; @@ -58,10 +58,18 @@ class SyncStreamDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncStreamDto? fromJson(dynamic value) { - upgradeDto(value, "SyncStreamDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'types'), 'Required key "SyncStreamDto[types]" is missing from JSON.'); + assert(json[r'types'] != null, 'Required key "SyncStreamDto[types]" has a null value in JSON.'); + return true; + }()); + return SyncStreamDto( reset: mapValueOfType(json, r'reset'), types: SyncRequestType.listFromJson(json[r'types']), diff --git a/mobile/openapi/lib/model/sync_user_delete_v1.dart b/mobile/openapi/lib/model/sync_user_delete_v1.dart index bbbdc147dd..cd30b0a0fb 100644 --- a/mobile/openapi/lib/model/sync_user_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_user_delete_v1.dart @@ -41,10 +41,18 @@ class SyncUserDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncUserDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'userId'), 'Required key "SyncUserDeleteV1[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "SyncUserDeleteV1[userId]" has a null value in JSON.'); + return true; + }()); + return SyncUserDeleteV1( userId: mapValueOfType(json, r'userId')!, ); diff --git a/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart b/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart index 67976108e1..48fa49ea91 100644 --- a/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart +++ b/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart @@ -47,10 +47,20 @@ class SyncUserMetadataDeleteV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncUserMetadataDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserMetadataDeleteV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'key'), 'Required key "SyncUserMetadataDeleteV1[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "SyncUserMetadataDeleteV1[key]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "SyncUserMetadataDeleteV1[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "SyncUserMetadataDeleteV1[userId]" has a null value in JSON.'); + return true; + }()); + return SyncUserMetadataDeleteV1( key: UserMetadataKey.fromJson(json[r'key'])!, userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/sync_user_metadata_v1.dart b/mobile/openapi/lib/model/sync_user_metadata_v1.dart index ddde7c0513..3c84cb2a5b 100644 --- a/mobile/openapi/lib/model/sync_user_metadata_v1.dart +++ b/mobile/openapi/lib/model/sync_user_metadata_v1.dart @@ -54,10 +54,22 @@ class SyncUserMetadataV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncUserMetadataV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserMetadataV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'key'), 'Required key "SyncUserMetadataV1[key]" is missing from JSON.'); + assert(json[r'key'] != null, 'Required key "SyncUserMetadataV1[key]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "SyncUserMetadataV1[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "SyncUserMetadataV1[userId]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "SyncUserMetadataV1[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "SyncUserMetadataV1[value]" has a null value in JSON.'); + return true; + }()); + return SyncUserMetadataV1( key: UserMetadataKey.fromJson(json[r'key'])!, userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/sync_user_v1.dart b/mobile/openapi/lib/model/sync_user_v1.dart index 0a81593547..2d5c4347e9 100644 --- a/mobile/openapi/lib/model/sync_user_v1.dart +++ b/mobile/openapi/lib/model/sync_user_v1.dart @@ -71,14 +71,14 @@ class SyncUserV1 { if (this.avatarColor != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + json[r'avatarColor'] = null; } if (this.deletedAt != null) { json[r'deletedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } json[r'email'] = this.email; json[r'hasProfileImage'] = this.hasProfileImage; @@ -94,10 +94,27 @@ class SyncUserV1 { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SyncUserV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserV1"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'deletedAt'), 'Required key "SyncUserV1[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'email'), 'Required key "SyncUserV1[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "SyncUserV1[email]" has a null value in JSON.'); + assert(json.containsKey(r'hasProfileImage'), 'Required key "SyncUserV1[hasProfileImage]" is missing from JSON.'); + assert(json[r'hasProfileImage'] != null, 'Required key "SyncUserV1[hasProfileImage]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "SyncUserV1[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "SyncUserV1[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "SyncUserV1[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "SyncUserV1[name]" has a null value in JSON.'); + assert(json.containsKey(r'profileChangedAt'), 'Required key "SyncUserV1[profileChangedAt]" is missing from JSON.'); + assert(json[r'profileChangedAt'] != null, 'Required key "SyncUserV1[profileChangedAt]" has a null value in JSON.'); + return true; + }()); + return SyncUserV1( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), deletedAt: mapDateTime(json, r'deletedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), diff --git a/mobile/openapi/lib/model/system_config_backups_dto.dart b/mobile/openapi/lib/model/system_config_backups_dto.dart index 82cd6e59eb..310201491c 100644 --- a/mobile/openapi/lib/model/system_config_backups_dto.dart +++ b/mobile/openapi/lib/model/system_config_backups_dto.dart @@ -40,10 +40,18 @@ class SystemConfigBackupsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigBackupsDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigBackupsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'database'), 'Required key "SystemConfigBackupsDto[database]" is missing from JSON.'); + assert(json[r'database'] != null, 'Required key "SystemConfigBackupsDto[database]" has a null value in JSON.'); + return true; + }()); + return SystemConfigBackupsDto( database: DatabaseBackupConfig.fromJson(json[r'database'])!, ); diff --git a/mobile/openapi/lib/model/system_config_dto.dart b/mobile/openapi/lib/model/system_config_dto.dart index 38dbb30f0c..39ba0d608a 100644 --- a/mobile/openapi/lib/model/system_config_dto.dart +++ b/mobile/openapi/lib/model/system_config_dto.dart @@ -160,10 +160,58 @@ class SystemConfigDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'backup'), 'Required key "SystemConfigDto[backup]" is missing from JSON.'); + assert(json[r'backup'] != null, 'Required key "SystemConfigDto[backup]" has a null value in JSON.'); + assert(json.containsKey(r'ffmpeg'), 'Required key "SystemConfigDto[ffmpeg]" is missing from JSON.'); + assert(json[r'ffmpeg'] != null, 'Required key "SystemConfigDto[ffmpeg]" has a null value in JSON.'); + assert(json.containsKey(r'image'), 'Required key "SystemConfigDto[image]" is missing from JSON.'); + assert(json[r'image'] != null, 'Required key "SystemConfigDto[image]" has a null value in JSON.'); + assert(json.containsKey(r'job'), 'Required key "SystemConfigDto[job]" is missing from JSON.'); + assert(json[r'job'] != null, 'Required key "SystemConfigDto[job]" has a null value in JSON.'); + assert(json.containsKey(r'library'), 'Required key "SystemConfigDto[library]" is missing from JSON.'); + assert(json[r'library'] != null, 'Required key "SystemConfigDto[library]" has a null value in JSON.'); + assert(json.containsKey(r'logging'), 'Required key "SystemConfigDto[logging]" is missing from JSON.'); + assert(json[r'logging'] != null, 'Required key "SystemConfigDto[logging]" has a null value in JSON.'); + assert(json.containsKey(r'machineLearning'), 'Required key "SystemConfigDto[machineLearning]" is missing from JSON.'); + assert(json[r'machineLearning'] != null, 'Required key "SystemConfigDto[machineLearning]" has a null value in JSON.'); + assert(json.containsKey(r'map'), 'Required key "SystemConfigDto[map]" is missing from JSON.'); + assert(json[r'map'] != null, 'Required key "SystemConfigDto[map]" has a null value in JSON.'); + assert(json.containsKey(r'metadata'), 'Required key "SystemConfigDto[metadata]" is missing from JSON.'); + assert(json[r'metadata'] != null, 'Required key "SystemConfigDto[metadata]" has a null value in JSON.'); + assert(json.containsKey(r'newVersionCheck'), 'Required key "SystemConfigDto[newVersionCheck]" is missing from JSON.'); + assert(json[r'newVersionCheck'] != null, 'Required key "SystemConfigDto[newVersionCheck]" has a null value in JSON.'); + assert(json.containsKey(r'nightlyTasks'), 'Required key "SystemConfigDto[nightlyTasks]" is missing from JSON.'); + assert(json[r'nightlyTasks'] != null, 'Required key "SystemConfigDto[nightlyTasks]" has a null value in JSON.'); + assert(json.containsKey(r'notifications'), 'Required key "SystemConfigDto[notifications]" is missing from JSON.'); + assert(json[r'notifications'] != null, 'Required key "SystemConfigDto[notifications]" has a null value in JSON.'); + assert(json.containsKey(r'oauth'), 'Required key "SystemConfigDto[oauth]" is missing from JSON.'); + assert(json[r'oauth'] != null, 'Required key "SystemConfigDto[oauth]" has a null value in JSON.'); + assert(json.containsKey(r'passwordLogin'), 'Required key "SystemConfigDto[passwordLogin]" is missing from JSON.'); + assert(json[r'passwordLogin'] != null, 'Required key "SystemConfigDto[passwordLogin]" has a null value in JSON.'); + assert(json.containsKey(r'reverseGeocoding'), 'Required key "SystemConfigDto[reverseGeocoding]" is missing from JSON.'); + assert(json[r'reverseGeocoding'] != null, 'Required key "SystemConfigDto[reverseGeocoding]" has a null value in JSON.'); + assert(json.containsKey(r'server'), 'Required key "SystemConfigDto[server]" is missing from JSON.'); + assert(json[r'server'] != null, 'Required key "SystemConfigDto[server]" has a null value in JSON.'); + assert(json.containsKey(r'storageTemplate'), 'Required key "SystemConfigDto[storageTemplate]" is missing from JSON.'); + assert(json[r'storageTemplate'] != null, 'Required key "SystemConfigDto[storageTemplate]" has a null value in JSON.'); + assert(json.containsKey(r'templates'), 'Required key "SystemConfigDto[templates]" is missing from JSON.'); + assert(json[r'templates'] != null, 'Required key "SystemConfigDto[templates]" has a null value in JSON.'); + assert(json.containsKey(r'theme'), 'Required key "SystemConfigDto[theme]" is missing from JSON.'); + assert(json[r'theme'] != null, 'Required key "SystemConfigDto[theme]" has a null value in JSON.'); + assert(json.containsKey(r'trash'), 'Required key "SystemConfigDto[trash]" is missing from JSON.'); + assert(json[r'trash'] != null, 'Required key "SystemConfigDto[trash]" has a null value in JSON.'); + assert(json.containsKey(r'user'), 'Required key "SystemConfigDto[user]" is missing from JSON.'); + assert(json[r'user'] != null, 'Required key "SystemConfigDto[user]" has a null value in JSON.'); + return true; + }()); + return SystemConfigDto( backup: SystemConfigBackupsDto.fromJson(json[r'backup'])!, ffmpeg: SystemConfigFFmpegDto.fromJson(json[r'ffmpeg'])!, diff --git a/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart b/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart index ecf2e5da4a..204e0bd2a3 100644 --- a/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart +++ b/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart @@ -190,10 +190,58 @@ class SystemConfigFFmpegDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigFFmpegDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigFFmpegDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'accel'), 'Required key "SystemConfigFFmpegDto[accel]" is missing from JSON.'); + assert(json[r'accel'] != null, 'Required key "SystemConfigFFmpegDto[accel]" has a null value in JSON.'); + assert(json.containsKey(r'accelDecode'), 'Required key "SystemConfigFFmpegDto[accelDecode]" is missing from JSON.'); + assert(json[r'accelDecode'] != null, 'Required key "SystemConfigFFmpegDto[accelDecode]" has a null value in JSON.'); + assert(json.containsKey(r'acceptedAudioCodecs'), 'Required key "SystemConfigFFmpegDto[acceptedAudioCodecs]" is missing from JSON.'); + assert(json[r'acceptedAudioCodecs'] != null, 'Required key "SystemConfigFFmpegDto[acceptedAudioCodecs]" has a null value in JSON.'); + assert(json.containsKey(r'acceptedContainers'), 'Required key "SystemConfigFFmpegDto[acceptedContainers]" is missing from JSON.'); + assert(json[r'acceptedContainers'] != null, 'Required key "SystemConfigFFmpegDto[acceptedContainers]" has a null value in JSON.'); + assert(json.containsKey(r'acceptedVideoCodecs'), 'Required key "SystemConfigFFmpegDto[acceptedVideoCodecs]" is missing from JSON.'); + assert(json[r'acceptedVideoCodecs'] != null, 'Required key "SystemConfigFFmpegDto[acceptedVideoCodecs]" has a null value in JSON.'); + assert(json.containsKey(r'bframes'), 'Required key "SystemConfigFFmpegDto[bframes]" is missing from JSON.'); + assert(json[r'bframes'] != null, 'Required key "SystemConfigFFmpegDto[bframes]" has a null value in JSON.'); + assert(json.containsKey(r'cqMode'), 'Required key "SystemConfigFFmpegDto[cqMode]" is missing from JSON.'); + assert(json[r'cqMode'] != null, 'Required key "SystemConfigFFmpegDto[cqMode]" has a null value in JSON.'); + assert(json.containsKey(r'crf'), 'Required key "SystemConfigFFmpegDto[crf]" is missing from JSON.'); + assert(json[r'crf'] != null, 'Required key "SystemConfigFFmpegDto[crf]" has a null value in JSON.'); + assert(json.containsKey(r'gopSize'), 'Required key "SystemConfigFFmpegDto[gopSize]" is missing from JSON.'); + assert(json[r'gopSize'] != null, 'Required key "SystemConfigFFmpegDto[gopSize]" has a null value in JSON.'); + assert(json.containsKey(r'maxBitrate'), 'Required key "SystemConfigFFmpegDto[maxBitrate]" is missing from JSON.'); + assert(json[r'maxBitrate'] != null, 'Required key "SystemConfigFFmpegDto[maxBitrate]" has a null value in JSON.'); + assert(json.containsKey(r'preferredHwDevice'), 'Required key "SystemConfigFFmpegDto[preferredHwDevice]" is missing from JSON.'); + assert(json[r'preferredHwDevice'] != null, 'Required key "SystemConfigFFmpegDto[preferredHwDevice]" has a null value in JSON.'); + assert(json.containsKey(r'preset'), 'Required key "SystemConfigFFmpegDto[preset]" is missing from JSON.'); + assert(json[r'preset'] != null, 'Required key "SystemConfigFFmpegDto[preset]" has a null value in JSON.'); + assert(json.containsKey(r'refs'), 'Required key "SystemConfigFFmpegDto[refs]" is missing from JSON.'); + assert(json[r'refs'] != null, 'Required key "SystemConfigFFmpegDto[refs]" has a null value in JSON.'); + assert(json.containsKey(r'targetAudioCodec'), 'Required key "SystemConfigFFmpegDto[targetAudioCodec]" is missing from JSON.'); + assert(json[r'targetAudioCodec'] != null, 'Required key "SystemConfigFFmpegDto[targetAudioCodec]" has a null value in JSON.'); + assert(json.containsKey(r'targetResolution'), 'Required key "SystemConfigFFmpegDto[targetResolution]" is missing from JSON.'); + assert(json[r'targetResolution'] != null, 'Required key "SystemConfigFFmpegDto[targetResolution]" has a null value in JSON.'); + assert(json.containsKey(r'targetVideoCodec'), 'Required key "SystemConfigFFmpegDto[targetVideoCodec]" is missing from JSON.'); + assert(json[r'targetVideoCodec'] != null, 'Required key "SystemConfigFFmpegDto[targetVideoCodec]" has a null value in JSON.'); + assert(json.containsKey(r'temporalAQ'), 'Required key "SystemConfigFFmpegDto[temporalAQ]" is missing from JSON.'); + assert(json[r'temporalAQ'] != null, 'Required key "SystemConfigFFmpegDto[temporalAQ]" has a null value in JSON.'); + assert(json.containsKey(r'threads'), 'Required key "SystemConfigFFmpegDto[threads]" is missing from JSON.'); + assert(json[r'threads'] != null, 'Required key "SystemConfigFFmpegDto[threads]" has a null value in JSON.'); + assert(json.containsKey(r'tonemap'), 'Required key "SystemConfigFFmpegDto[tonemap]" is missing from JSON.'); + assert(json[r'tonemap'] != null, 'Required key "SystemConfigFFmpegDto[tonemap]" has a null value in JSON.'); + assert(json.containsKey(r'transcode'), 'Required key "SystemConfigFFmpegDto[transcode]" is missing from JSON.'); + assert(json[r'transcode'] != null, 'Required key "SystemConfigFFmpegDto[transcode]" has a null value in JSON.'); + assert(json.containsKey(r'twoPass'), 'Required key "SystemConfigFFmpegDto[twoPass]" is missing from JSON.'); + assert(json[r'twoPass'] != null, 'Required key "SystemConfigFFmpegDto[twoPass]" has a null value in JSON.'); + return true; + }()); + return SystemConfigFFmpegDto( accel: TranscodeHWAccel.fromJson(json[r'accel'])!, accelDecode: mapValueOfType(json, r'accelDecode')!, diff --git a/mobile/openapi/lib/model/system_config_faces_dto.dart b/mobile/openapi/lib/model/system_config_faces_dto.dart index f57303c310..a9b2269691 100644 --- a/mobile/openapi/lib/model/system_config_faces_dto.dart +++ b/mobile/openapi/lib/model/system_config_faces_dto.dart @@ -41,10 +41,18 @@ class SystemConfigFacesDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigFacesDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigFacesDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'import'), 'Required key "SystemConfigFacesDto[import]" is missing from JSON.'); + assert(json[r'import'] != null, 'Required key "SystemConfigFacesDto[import]" has a null value in JSON.'); + return true; + }()); + return SystemConfigFacesDto( import_: mapValueOfType(json, r'import')!, ); diff --git a/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart b/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart index d78f8fadd5..844eba89bc 100644 --- a/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart +++ b/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart @@ -64,7 +64,7 @@ class SystemConfigGeneratedFullsizeImageDto { if (this.progressive != null) { json[r'progressive'] = this.progressive; } else { - // json[r'progressive'] = null; + json[r'progressive'] = null; } json[r'quality'] = this.quality; return json; @@ -74,10 +74,22 @@ class SystemConfigGeneratedFullsizeImageDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigGeneratedFullsizeImageDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigGeneratedFullsizeImageDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigGeneratedFullsizeImageDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigGeneratedFullsizeImageDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'format'), 'Required key "SystemConfigGeneratedFullsizeImageDto[format]" is missing from JSON.'); + assert(json[r'format'] != null, 'Required key "SystemConfigGeneratedFullsizeImageDto[format]" has a null value in JSON.'); + assert(json.containsKey(r'quality'), 'Required key "SystemConfigGeneratedFullsizeImageDto[quality]" is missing from JSON.'); + assert(json[r'quality'] != null, 'Required key "SystemConfigGeneratedFullsizeImageDto[quality]" has a null value in JSON.'); + return true; + }()); + return SystemConfigGeneratedFullsizeImageDto( enabled: mapValueOfType(json, r'enabled')!, format: ImageFormat.fromJson(json[r'format'])!, diff --git a/mobile/openapi/lib/model/system_config_generated_image_dto.dart b/mobile/openapi/lib/model/system_config_generated_image_dto.dart index 2571c0cab0..6eca1aa4d5 100644 --- a/mobile/openapi/lib/model/system_config_generated_image_dto.dart +++ b/mobile/openapi/lib/model/system_config_generated_image_dto.dart @@ -66,7 +66,7 @@ class SystemConfigGeneratedImageDto { if (this.progressive != null) { json[r'progressive'] = this.progressive; } else { - // json[r'progressive'] = null; + json[r'progressive'] = null; } json[r'quality'] = this.quality; json[r'size'] = this.size; @@ -77,10 +77,22 @@ class SystemConfigGeneratedImageDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigGeneratedImageDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigGeneratedImageDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'format'), 'Required key "SystemConfigGeneratedImageDto[format]" is missing from JSON.'); + assert(json[r'format'] != null, 'Required key "SystemConfigGeneratedImageDto[format]" has a null value in JSON.'); + assert(json.containsKey(r'quality'), 'Required key "SystemConfigGeneratedImageDto[quality]" is missing from JSON.'); + assert(json[r'quality'] != null, 'Required key "SystemConfigGeneratedImageDto[quality]" has a null value in JSON.'); + assert(json.containsKey(r'size'), 'Required key "SystemConfigGeneratedImageDto[size]" is missing from JSON.'); + assert(json[r'size'] != null, 'Required key "SystemConfigGeneratedImageDto[size]" has a null value in JSON.'); + return true; + }()); + return SystemConfigGeneratedImageDto( format: ImageFormat.fromJson(json[r'format'])!, progressive: mapValueOfType(json, r'progressive'), diff --git a/mobile/openapi/lib/model/system_config_image_dto.dart b/mobile/openapi/lib/model/system_config_image_dto.dart index 668b740872..626a01b4b5 100644 --- a/mobile/openapi/lib/model/system_config_image_dto.dart +++ b/mobile/openapi/lib/model/system_config_image_dto.dart @@ -65,10 +65,26 @@ class SystemConfigImageDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigImageDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigImageDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'colorspace'), 'Required key "SystemConfigImageDto[colorspace]" is missing from JSON.'); + assert(json[r'colorspace'] != null, 'Required key "SystemConfigImageDto[colorspace]" has a null value in JSON.'); + assert(json.containsKey(r'extractEmbedded'), 'Required key "SystemConfigImageDto[extractEmbedded]" is missing from JSON.'); + assert(json[r'extractEmbedded'] != null, 'Required key "SystemConfigImageDto[extractEmbedded]" has a null value in JSON.'); + assert(json.containsKey(r'fullsize'), 'Required key "SystemConfigImageDto[fullsize]" is missing from JSON.'); + assert(json[r'fullsize'] != null, 'Required key "SystemConfigImageDto[fullsize]" has a null value in JSON.'); + assert(json.containsKey(r'preview'), 'Required key "SystemConfigImageDto[preview]" is missing from JSON.'); + assert(json[r'preview'] != null, 'Required key "SystemConfigImageDto[preview]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnail'), 'Required key "SystemConfigImageDto[thumbnail]" is missing from JSON.'); + assert(json[r'thumbnail'] != null, 'Required key "SystemConfigImageDto[thumbnail]" has a null value in JSON.'); + return true; + }()); + return SystemConfigImageDto( colorspace: Colorspace.fromJson(json[r'colorspace'])!, extractEmbedded: mapValueOfType(json, r'extractEmbedded')!, diff --git a/mobile/openapi/lib/model/system_config_job_dto.dart b/mobile/openapi/lib/model/system_config_job_dto.dart index d54db6809f..79d2a5e1e5 100644 --- a/mobile/openapi/lib/model/system_config_job_dto.dart +++ b/mobile/openapi/lib/model/system_config_job_dto.dart @@ -118,10 +118,44 @@ class SystemConfigJobDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigJobDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigJobDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'backgroundTask'), 'Required key "SystemConfigJobDto[backgroundTask]" is missing from JSON.'); + assert(json[r'backgroundTask'] != null, 'Required key "SystemConfigJobDto[backgroundTask]" has a null value in JSON.'); + assert(json.containsKey(r'editor'), 'Required key "SystemConfigJobDto[editor]" is missing from JSON.'); + assert(json[r'editor'] != null, 'Required key "SystemConfigJobDto[editor]" has a null value in JSON.'); + assert(json.containsKey(r'faceDetection'), 'Required key "SystemConfigJobDto[faceDetection]" is missing from JSON.'); + assert(json[r'faceDetection'] != null, 'Required key "SystemConfigJobDto[faceDetection]" has a null value in JSON.'); + assert(json.containsKey(r'library'), 'Required key "SystemConfigJobDto[library]" is missing from JSON.'); + assert(json[r'library'] != null, 'Required key "SystemConfigJobDto[library]" has a null value in JSON.'); + assert(json.containsKey(r'metadataExtraction'), 'Required key "SystemConfigJobDto[metadataExtraction]" is missing from JSON.'); + assert(json[r'metadataExtraction'] != null, 'Required key "SystemConfigJobDto[metadataExtraction]" has a null value in JSON.'); + assert(json.containsKey(r'migration'), 'Required key "SystemConfigJobDto[migration]" is missing from JSON.'); + assert(json[r'migration'] != null, 'Required key "SystemConfigJobDto[migration]" has a null value in JSON.'); + assert(json.containsKey(r'notifications'), 'Required key "SystemConfigJobDto[notifications]" is missing from JSON.'); + assert(json[r'notifications'] != null, 'Required key "SystemConfigJobDto[notifications]" has a null value in JSON.'); + assert(json.containsKey(r'ocr'), 'Required key "SystemConfigJobDto[ocr]" is missing from JSON.'); + assert(json[r'ocr'] != null, 'Required key "SystemConfigJobDto[ocr]" has a null value in JSON.'); + assert(json.containsKey(r'search'), 'Required key "SystemConfigJobDto[search]" is missing from JSON.'); + assert(json[r'search'] != null, 'Required key "SystemConfigJobDto[search]" has a null value in JSON.'); + assert(json.containsKey(r'sidecar'), 'Required key "SystemConfigJobDto[sidecar]" is missing from JSON.'); + assert(json[r'sidecar'] != null, 'Required key "SystemConfigJobDto[sidecar]" has a null value in JSON.'); + assert(json.containsKey(r'smartSearch'), 'Required key "SystemConfigJobDto[smartSearch]" is missing from JSON.'); + assert(json[r'smartSearch'] != null, 'Required key "SystemConfigJobDto[smartSearch]" has a null value in JSON.'); + assert(json.containsKey(r'thumbnailGeneration'), 'Required key "SystemConfigJobDto[thumbnailGeneration]" is missing from JSON.'); + assert(json[r'thumbnailGeneration'] != null, 'Required key "SystemConfigJobDto[thumbnailGeneration]" has a null value in JSON.'); + assert(json.containsKey(r'videoConversion'), 'Required key "SystemConfigJobDto[videoConversion]" is missing from JSON.'); + assert(json[r'videoConversion'] != null, 'Required key "SystemConfigJobDto[videoConversion]" has a null value in JSON.'); + assert(json.containsKey(r'workflow'), 'Required key "SystemConfigJobDto[workflow]" is missing from JSON.'); + assert(json[r'workflow'] != null, 'Required key "SystemConfigJobDto[workflow]" has a null value in JSON.'); + return true; + }()); + return SystemConfigJobDto( backgroundTask: JobSettingsDto.fromJson(json[r'backgroundTask'])!, editor: JobSettingsDto.fromJson(json[r'editor'])!, diff --git a/mobile/openapi/lib/model/system_config_library_dto.dart b/mobile/openapi/lib/model/system_config_library_dto.dart index e728b0bf20..85f70ac313 100644 --- a/mobile/openapi/lib/model/system_config_library_dto.dart +++ b/mobile/openapi/lib/model/system_config_library_dto.dart @@ -46,10 +46,20 @@ class SystemConfigLibraryDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLibraryDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'scan'), 'Required key "SystemConfigLibraryDto[scan]" is missing from JSON.'); + assert(json[r'scan'] != null, 'Required key "SystemConfigLibraryDto[scan]" has a null value in JSON.'); + assert(json.containsKey(r'watch'), 'Required key "SystemConfigLibraryDto[watch]" is missing from JSON.'); + assert(json[r'watch'] != null, 'Required key "SystemConfigLibraryDto[watch]" has a null value in JSON.'); + return true; + }()); + return SystemConfigLibraryDto( scan: SystemConfigLibraryScanDto.fromJson(json[r'scan'])!, watch: SystemConfigLibraryWatchDto.fromJson(json[r'watch'])!, diff --git a/mobile/openapi/lib/model/system_config_library_scan_dto.dart b/mobile/openapi/lib/model/system_config_library_scan_dto.dart index 003000d2ec..17e901d03b 100644 --- a/mobile/openapi/lib/model/system_config_library_scan_dto.dart +++ b/mobile/openapi/lib/model/system_config_library_scan_dto.dart @@ -48,10 +48,20 @@ class SystemConfigLibraryScanDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigLibraryScanDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLibraryScanDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'cronExpression'), 'Required key "SystemConfigLibraryScanDto[cronExpression]" is missing from JSON.'); + assert(json[r'cronExpression'] != null, 'Required key "SystemConfigLibraryScanDto[cronExpression]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigLibraryScanDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigLibraryScanDto[enabled]" has a null value in JSON.'); + return true; + }()); + return SystemConfigLibraryScanDto( cronExpression: mapValueOfType(json, r'cronExpression')!, enabled: mapValueOfType(json, r'enabled')!, diff --git a/mobile/openapi/lib/model/system_config_library_watch_dto.dart b/mobile/openapi/lib/model/system_config_library_watch_dto.dart index b4f171bd25..edd4e38d4d 100644 --- a/mobile/openapi/lib/model/system_config_library_watch_dto.dart +++ b/mobile/openapi/lib/model/system_config_library_watch_dto.dart @@ -41,10 +41,18 @@ class SystemConfigLibraryWatchDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigLibraryWatchDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLibraryWatchDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigLibraryWatchDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigLibraryWatchDto[enabled]" has a null value in JSON.'); + return true; + }()); + return SystemConfigLibraryWatchDto( enabled: mapValueOfType(json, r'enabled')!, ); diff --git a/mobile/openapi/lib/model/system_config_logging_dto.dart b/mobile/openapi/lib/model/system_config_logging_dto.dart index 54278893db..a814839fa8 100644 --- a/mobile/openapi/lib/model/system_config_logging_dto.dart +++ b/mobile/openapi/lib/model/system_config_logging_dto.dart @@ -47,10 +47,20 @@ class SystemConfigLoggingDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigLoggingDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLoggingDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigLoggingDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigLoggingDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'level'), 'Required key "SystemConfigLoggingDto[level]" is missing from JSON.'); + assert(json[r'level'] != null, 'Required key "SystemConfigLoggingDto[level]" has a null value in JSON.'); + return true; + }()); + return SystemConfigLoggingDto( enabled: mapValueOfType(json, r'enabled')!, level: LogLevel.fromJson(json[r'level'])!, diff --git a/mobile/openapi/lib/model/system_config_machine_learning_dto.dart b/mobile/openapi/lib/model/system_config_machine_learning_dto.dart index 6162e72b8f..1851709e45 100644 --- a/mobile/openapi/lib/model/system_config_machine_learning_dto.dart +++ b/mobile/openapi/lib/model/system_config_machine_learning_dto.dart @@ -78,10 +78,30 @@ class SystemConfigMachineLearningDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigMachineLearningDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigMachineLearningDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'availabilityChecks'), 'Required key "SystemConfigMachineLearningDto[availabilityChecks]" is missing from JSON.'); + assert(json[r'availabilityChecks'] != null, 'Required key "SystemConfigMachineLearningDto[availabilityChecks]" has a null value in JSON.'); + assert(json.containsKey(r'clip'), 'Required key "SystemConfigMachineLearningDto[clip]" is missing from JSON.'); + assert(json[r'clip'] != null, 'Required key "SystemConfigMachineLearningDto[clip]" has a null value in JSON.'); + assert(json.containsKey(r'duplicateDetection'), 'Required key "SystemConfigMachineLearningDto[duplicateDetection]" is missing from JSON.'); + assert(json[r'duplicateDetection'] != null, 'Required key "SystemConfigMachineLearningDto[duplicateDetection]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigMachineLearningDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigMachineLearningDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'facialRecognition'), 'Required key "SystemConfigMachineLearningDto[facialRecognition]" is missing from JSON.'); + assert(json[r'facialRecognition'] != null, 'Required key "SystemConfigMachineLearningDto[facialRecognition]" has a null value in JSON.'); + assert(json.containsKey(r'ocr'), 'Required key "SystemConfigMachineLearningDto[ocr]" is missing from JSON.'); + assert(json[r'ocr'] != null, 'Required key "SystemConfigMachineLearningDto[ocr]" has a null value in JSON.'); + assert(json.containsKey(r'urls'), 'Required key "SystemConfigMachineLearningDto[urls]" is missing from JSON.'); + assert(json[r'urls'] != null, 'Required key "SystemConfigMachineLearningDto[urls]" has a null value in JSON.'); + return true; + }()); + return SystemConfigMachineLearningDto( availabilityChecks: MachineLearningAvailabilityChecksDto.fromJson(json[r'availabilityChecks'])!, clip: CLIPConfig.fromJson(json[r'clip'])!, diff --git a/mobile/openapi/lib/model/system_config_map_dto.dart b/mobile/openapi/lib/model/system_config_map_dto.dart index 7a2fbb516b..59ba85dc7d 100644 --- a/mobile/openapi/lib/model/system_config_map_dto.dart +++ b/mobile/openapi/lib/model/system_config_map_dto.dart @@ -55,10 +55,22 @@ class SystemConfigMapDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigMapDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigMapDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'darkStyle'), 'Required key "SystemConfigMapDto[darkStyle]" is missing from JSON.'); + assert(json[r'darkStyle'] != null, 'Required key "SystemConfigMapDto[darkStyle]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigMapDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigMapDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'lightStyle'), 'Required key "SystemConfigMapDto[lightStyle]" is missing from JSON.'); + assert(json[r'lightStyle'] != null, 'Required key "SystemConfigMapDto[lightStyle]" has a null value in JSON.'); + return true; + }()); + return SystemConfigMapDto( darkStyle: mapValueOfType(json, r'darkStyle')!, enabled: mapValueOfType(json, r'enabled')!, diff --git a/mobile/openapi/lib/model/system_config_metadata_dto.dart b/mobile/openapi/lib/model/system_config_metadata_dto.dart index 3c32fc551d..aec80718a3 100644 --- a/mobile/openapi/lib/model/system_config_metadata_dto.dart +++ b/mobile/openapi/lib/model/system_config_metadata_dto.dart @@ -40,10 +40,18 @@ class SystemConfigMetadataDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigMetadataDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigMetadataDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'faces'), 'Required key "SystemConfigMetadataDto[faces]" is missing from JSON.'); + assert(json[r'faces'] != null, 'Required key "SystemConfigMetadataDto[faces]" has a null value in JSON.'); + return true; + }()); + return SystemConfigMetadataDto( faces: SystemConfigFacesDto.fromJson(json[r'faces'])!, ); diff --git a/mobile/openapi/lib/model/system_config_new_version_check_dto.dart b/mobile/openapi/lib/model/system_config_new_version_check_dto.dart index ec2b400dfd..c79edf4b46 100644 --- a/mobile/openapi/lib/model/system_config_new_version_check_dto.dart +++ b/mobile/openapi/lib/model/system_config_new_version_check_dto.dart @@ -41,10 +41,18 @@ class SystemConfigNewVersionCheckDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigNewVersionCheckDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigNewVersionCheckDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigNewVersionCheckDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigNewVersionCheckDto[enabled]" has a null value in JSON.'); + return true; + }()); + return SystemConfigNewVersionCheckDto( enabled: mapValueOfType(json, r'enabled')!, ); diff --git a/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart b/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart index 0db417427f..4b911d1cce 100644 --- a/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart +++ b/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart @@ -76,10 +76,28 @@ class SystemConfigNightlyTasksDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigNightlyTasksDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigNightlyTasksDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'clusterNewFaces'), 'Required key "SystemConfigNightlyTasksDto[clusterNewFaces]" is missing from JSON.'); + assert(json[r'clusterNewFaces'] != null, 'Required key "SystemConfigNightlyTasksDto[clusterNewFaces]" has a null value in JSON.'); + assert(json.containsKey(r'databaseCleanup'), 'Required key "SystemConfigNightlyTasksDto[databaseCleanup]" is missing from JSON.'); + assert(json[r'databaseCleanup'] != null, 'Required key "SystemConfigNightlyTasksDto[databaseCleanup]" has a null value in JSON.'); + assert(json.containsKey(r'generateMemories'), 'Required key "SystemConfigNightlyTasksDto[generateMemories]" is missing from JSON.'); + assert(json[r'generateMemories'] != null, 'Required key "SystemConfigNightlyTasksDto[generateMemories]" has a null value in JSON.'); + assert(json.containsKey(r'missingThumbnails'), 'Required key "SystemConfigNightlyTasksDto[missingThumbnails]" is missing from JSON.'); + assert(json[r'missingThumbnails'] != null, 'Required key "SystemConfigNightlyTasksDto[missingThumbnails]" has a null value in JSON.'); + assert(json.containsKey(r'startTime'), 'Required key "SystemConfigNightlyTasksDto[startTime]" is missing from JSON.'); + assert(json[r'startTime'] != null, 'Required key "SystemConfigNightlyTasksDto[startTime]" has a null value in JSON.'); + assert(json.containsKey(r'syncQuotaUsage'), 'Required key "SystemConfigNightlyTasksDto[syncQuotaUsage]" is missing from JSON.'); + assert(json[r'syncQuotaUsage'] != null, 'Required key "SystemConfigNightlyTasksDto[syncQuotaUsage]" has a null value in JSON.'); + return true; + }()); + return SystemConfigNightlyTasksDto( clusterNewFaces: mapValueOfType(json, r'clusterNewFaces')!, databaseCleanup: mapValueOfType(json, r'databaseCleanup')!, diff --git a/mobile/openapi/lib/model/system_config_notifications_dto.dart b/mobile/openapi/lib/model/system_config_notifications_dto.dart index 35d3d31833..efc010a0d3 100644 --- a/mobile/openapi/lib/model/system_config_notifications_dto.dart +++ b/mobile/openapi/lib/model/system_config_notifications_dto.dart @@ -40,10 +40,18 @@ class SystemConfigNotificationsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigNotificationsDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigNotificationsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'smtp'), 'Required key "SystemConfigNotificationsDto[smtp]" is missing from JSON.'); + assert(json[r'smtp'] != null, 'Required key "SystemConfigNotificationsDto[smtp]" has a null value in JSON.'); + return true; + }()); + return SystemConfigNotificationsDto( smtp: SystemConfigSmtpDto.fromJson(json[r'smtp'])!, ); diff --git a/mobile/openapi/lib/model/system_config_o_auth_dto.dart b/mobile/openapi/lib/model/system_config_o_auth_dto.dart index c65de03391..3941e02d70 100644 --- a/mobile/openapi/lib/model/system_config_o_auth_dto.dart +++ b/mobile/openapi/lib/model/system_config_o_auth_dto.dart @@ -167,7 +167,7 @@ class SystemConfigOAuthDto { if (this.defaultStorageQuota != null) { json[r'defaultStorageQuota'] = this.defaultStorageQuota; } else { - // json[r'defaultStorageQuota'] = null; + json[r'defaultStorageQuota'] = null; } json[r'enabled'] = this.enabled; json[r'endSessionEndpoint'] = this.endSessionEndpoint; @@ -190,10 +190,57 @@ class SystemConfigOAuthDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigOAuthDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigOAuthDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'allowInsecureRequests'), 'Required key "SystemConfigOAuthDto[allowInsecureRequests]" is missing from JSON.'); + assert(json[r'allowInsecureRequests'] != null, 'Required key "SystemConfigOAuthDto[allowInsecureRequests]" has a null value in JSON.'); + assert(json.containsKey(r'autoLaunch'), 'Required key "SystemConfigOAuthDto[autoLaunch]" is missing from JSON.'); + assert(json[r'autoLaunch'] != null, 'Required key "SystemConfigOAuthDto[autoLaunch]" has a null value in JSON.'); + assert(json.containsKey(r'autoRegister'), 'Required key "SystemConfigOAuthDto[autoRegister]" is missing from JSON.'); + assert(json[r'autoRegister'] != null, 'Required key "SystemConfigOAuthDto[autoRegister]" has a null value in JSON.'); + assert(json.containsKey(r'buttonText'), 'Required key "SystemConfigOAuthDto[buttonText]" is missing from JSON.'); + assert(json[r'buttonText'] != null, 'Required key "SystemConfigOAuthDto[buttonText]" has a null value in JSON.'); + assert(json.containsKey(r'clientId'), 'Required key "SystemConfigOAuthDto[clientId]" is missing from JSON.'); + assert(json[r'clientId'] != null, 'Required key "SystemConfigOAuthDto[clientId]" has a null value in JSON.'); + assert(json.containsKey(r'clientSecret'), 'Required key "SystemConfigOAuthDto[clientSecret]" is missing from JSON.'); + assert(json[r'clientSecret'] != null, 'Required key "SystemConfigOAuthDto[clientSecret]" has a null value in JSON.'); + assert(json.containsKey(r'defaultStorageQuota'), 'Required key "SystemConfigOAuthDto[defaultStorageQuota]" is missing from JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigOAuthDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigOAuthDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'endSessionEndpoint'), 'Required key "SystemConfigOAuthDto[endSessionEndpoint]" is missing from JSON.'); + assert(json[r'endSessionEndpoint'] != null, 'Required key "SystemConfigOAuthDto[endSessionEndpoint]" has a null value in JSON.'); + assert(json.containsKey(r'issuerUrl'), 'Required key "SystemConfigOAuthDto[issuerUrl]" is missing from JSON.'); + assert(json[r'issuerUrl'] != null, 'Required key "SystemConfigOAuthDto[issuerUrl]" has a null value in JSON.'); + assert(json.containsKey(r'mobileOverrideEnabled'), 'Required key "SystemConfigOAuthDto[mobileOverrideEnabled]" is missing from JSON.'); + assert(json[r'mobileOverrideEnabled'] != null, 'Required key "SystemConfigOAuthDto[mobileOverrideEnabled]" has a null value in JSON.'); + assert(json.containsKey(r'mobileRedirectUri'), 'Required key "SystemConfigOAuthDto[mobileRedirectUri]" is missing from JSON.'); + assert(json[r'mobileRedirectUri'] != null, 'Required key "SystemConfigOAuthDto[mobileRedirectUri]" has a null value in JSON.'); + assert(json.containsKey(r'profileSigningAlgorithm'), 'Required key "SystemConfigOAuthDto[profileSigningAlgorithm]" is missing from JSON.'); + assert(json[r'profileSigningAlgorithm'] != null, 'Required key "SystemConfigOAuthDto[profileSigningAlgorithm]" has a null value in JSON.'); + assert(json.containsKey(r'prompt'), 'Required key "SystemConfigOAuthDto[prompt]" is missing from JSON.'); + assert(json[r'prompt'] != null, 'Required key "SystemConfigOAuthDto[prompt]" has a null value in JSON.'); + assert(json.containsKey(r'roleClaim'), 'Required key "SystemConfigOAuthDto[roleClaim]" is missing from JSON.'); + assert(json[r'roleClaim'] != null, 'Required key "SystemConfigOAuthDto[roleClaim]" has a null value in JSON.'); + assert(json.containsKey(r'scope'), 'Required key "SystemConfigOAuthDto[scope]" is missing from JSON.'); + assert(json[r'scope'] != null, 'Required key "SystemConfigOAuthDto[scope]" has a null value in JSON.'); + assert(json.containsKey(r'signingAlgorithm'), 'Required key "SystemConfigOAuthDto[signingAlgorithm]" is missing from JSON.'); + assert(json[r'signingAlgorithm'] != null, 'Required key "SystemConfigOAuthDto[signingAlgorithm]" has a null value in JSON.'); + assert(json.containsKey(r'storageLabelClaim'), 'Required key "SystemConfigOAuthDto[storageLabelClaim]" is missing from JSON.'); + assert(json[r'storageLabelClaim'] != null, 'Required key "SystemConfigOAuthDto[storageLabelClaim]" has a null value in JSON.'); + assert(json.containsKey(r'storageQuotaClaim'), 'Required key "SystemConfigOAuthDto[storageQuotaClaim]" is missing from JSON.'); + assert(json[r'storageQuotaClaim'] != null, 'Required key "SystemConfigOAuthDto[storageQuotaClaim]" has a null value in JSON.'); + assert(json.containsKey(r'timeout'), 'Required key "SystemConfigOAuthDto[timeout]" is missing from JSON.'); + assert(json[r'timeout'] != null, 'Required key "SystemConfigOAuthDto[timeout]" has a null value in JSON.'); + assert(json.containsKey(r'tokenEndpointAuthMethod'), 'Required key "SystemConfigOAuthDto[tokenEndpointAuthMethod]" is missing from JSON.'); + assert(json[r'tokenEndpointAuthMethod'] != null, 'Required key "SystemConfigOAuthDto[tokenEndpointAuthMethod]" has a null value in JSON.'); + return true; + }()); + return SystemConfigOAuthDto( allowInsecureRequests: mapValueOfType(json, r'allowInsecureRequests')!, autoLaunch: mapValueOfType(json, r'autoLaunch')!, diff --git a/mobile/openapi/lib/model/system_config_password_login_dto.dart b/mobile/openapi/lib/model/system_config_password_login_dto.dart index 1328a6acaa..2b31b79689 100644 --- a/mobile/openapi/lib/model/system_config_password_login_dto.dart +++ b/mobile/openapi/lib/model/system_config_password_login_dto.dart @@ -41,10 +41,18 @@ class SystemConfigPasswordLoginDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigPasswordLoginDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigPasswordLoginDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigPasswordLoginDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigPasswordLoginDto[enabled]" has a null value in JSON.'); + return true; + }()); + return SystemConfigPasswordLoginDto( enabled: mapValueOfType(json, r'enabled')!, ); diff --git a/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart b/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart index 0374e19be1..4a9cbc9457 100644 --- a/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart +++ b/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart @@ -41,10 +41,18 @@ class SystemConfigReverseGeocodingDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigReverseGeocodingDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigReverseGeocodingDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigReverseGeocodingDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigReverseGeocodingDto[enabled]" has a null value in JSON.'); + return true; + }()); + return SystemConfigReverseGeocodingDto( enabled: mapValueOfType(json, r'enabled')!, ); diff --git a/mobile/openapi/lib/model/system_config_server_dto.dart b/mobile/openapi/lib/model/system_config_server_dto.dart index 200f75f7c6..02fe676339 100644 --- a/mobile/openapi/lib/model/system_config_server_dto.dart +++ b/mobile/openapi/lib/model/system_config_server_dto.dart @@ -55,10 +55,22 @@ class SystemConfigServerDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigServerDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigServerDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'externalDomain'), 'Required key "SystemConfigServerDto[externalDomain]" is missing from JSON.'); + assert(json[r'externalDomain'] != null, 'Required key "SystemConfigServerDto[externalDomain]" has a null value in JSON.'); + assert(json.containsKey(r'loginPageMessage'), 'Required key "SystemConfigServerDto[loginPageMessage]" is missing from JSON.'); + assert(json[r'loginPageMessage'] != null, 'Required key "SystemConfigServerDto[loginPageMessage]" has a null value in JSON.'); + assert(json.containsKey(r'publicUsers'), 'Required key "SystemConfigServerDto[publicUsers]" is missing from JSON.'); + assert(json[r'publicUsers'] != null, 'Required key "SystemConfigServerDto[publicUsers]" has a null value in JSON.'); + return true; + }()); + return SystemConfigServerDto( externalDomain: mapValueOfType(json, r'externalDomain')!, loginPageMessage: mapValueOfType(json, r'loginPageMessage')!, diff --git a/mobile/openapi/lib/model/system_config_smtp_dto.dart b/mobile/openapi/lib/model/system_config_smtp_dto.dart index a3d14cda63..2abe436140 100644 --- a/mobile/openapi/lib/model/system_config_smtp_dto.dart +++ b/mobile/openapi/lib/model/system_config_smtp_dto.dart @@ -61,10 +61,24 @@ class SystemConfigSmtpDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigSmtpDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigSmtpDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigSmtpDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigSmtpDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'from'), 'Required key "SystemConfigSmtpDto[from]" is missing from JSON.'); + assert(json[r'from'] != null, 'Required key "SystemConfigSmtpDto[from]" has a null value in JSON.'); + assert(json.containsKey(r'replyTo'), 'Required key "SystemConfigSmtpDto[replyTo]" is missing from JSON.'); + assert(json[r'replyTo'] != null, 'Required key "SystemConfigSmtpDto[replyTo]" has a null value in JSON.'); + assert(json.containsKey(r'transport'), 'Required key "SystemConfigSmtpDto[transport]" is missing from JSON.'); + assert(json[r'transport'] != null, 'Required key "SystemConfigSmtpDto[transport]" has a null value in JSON.'); + return true; + }()); + return SystemConfigSmtpDto( enabled: mapValueOfType(json, r'enabled')!, from: mapValueOfType(json, r'from')!, diff --git a/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart b/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart index 266e3f3c86..b2e0d7579d 100644 --- a/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart +++ b/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart @@ -79,10 +79,28 @@ class SystemConfigSmtpTransportDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigSmtpTransportDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigSmtpTransportDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'host'), 'Required key "SystemConfigSmtpTransportDto[host]" is missing from JSON.'); + assert(json[r'host'] != null, 'Required key "SystemConfigSmtpTransportDto[host]" has a null value in JSON.'); + assert(json.containsKey(r'ignoreCert'), 'Required key "SystemConfigSmtpTransportDto[ignoreCert]" is missing from JSON.'); + assert(json[r'ignoreCert'] != null, 'Required key "SystemConfigSmtpTransportDto[ignoreCert]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "SystemConfigSmtpTransportDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "SystemConfigSmtpTransportDto[password]" has a null value in JSON.'); + assert(json.containsKey(r'port'), 'Required key "SystemConfigSmtpTransportDto[port]" is missing from JSON.'); + assert(json[r'port'] != null, 'Required key "SystemConfigSmtpTransportDto[port]" has a null value in JSON.'); + assert(json.containsKey(r'secure'), 'Required key "SystemConfigSmtpTransportDto[secure]" is missing from JSON.'); + assert(json[r'secure'] != null, 'Required key "SystemConfigSmtpTransportDto[secure]" has a null value in JSON.'); + assert(json.containsKey(r'username'), 'Required key "SystemConfigSmtpTransportDto[username]" is missing from JSON.'); + assert(json[r'username'] != null, 'Required key "SystemConfigSmtpTransportDto[username]" has a null value in JSON.'); + return true; + }()); + return SystemConfigSmtpTransportDto( host: mapValueOfType(json, r'host')!, ignoreCert: mapValueOfType(json, r'ignoreCert')!, diff --git a/mobile/openapi/lib/model/system_config_storage_template_dto.dart b/mobile/openapi/lib/model/system_config_storage_template_dto.dart index f9f37e48ad..cdfb7017af 100644 --- a/mobile/openapi/lib/model/system_config_storage_template_dto.dart +++ b/mobile/openapi/lib/model/system_config_storage_template_dto.dart @@ -55,10 +55,22 @@ class SystemConfigStorageTemplateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigStorageTemplateDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigStorageTemplateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigStorageTemplateDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigStorageTemplateDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'hashVerificationEnabled'), 'Required key "SystemConfigStorageTemplateDto[hashVerificationEnabled]" is missing from JSON.'); + assert(json[r'hashVerificationEnabled'] != null, 'Required key "SystemConfigStorageTemplateDto[hashVerificationEnabled]" has a null value in JSON.'); + assert(json.containsKey(r'template'), 'Required key "SystemConfigStorageTemplateDto[template]" is missing from JSON.'); + assert(json[r'template'] != null, 'Required key "SystemConfigStorageTemplateDto[template]" has a null value in JSON.'); + return true; + }()); + return SystemConfigStorageTemplateDto( enabled: mapValueOfType(json, r'enabled')!, hashVerificationEnabled: mapValueOfType(json, r'hashVerificationEnabled')!, diff --git a/mobile/openapi/lib/model/system_config_template_emails_dto.dart b/mobile/openapi/lib/model/system_config_template_emails_dto.dart index d29ca1fac3..fb0794a031 100644 --- a/mobile/openapi/lib/model/system_config_template_emails_dto.dart +++ b/mobile/openapi/lib/model/system_config_template_emails_dto.dart @@ -55,10 +55,22 @@ class SystemConfigTemplateEmailsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigTemplateEmailsDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTemplateEmailsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albumInviteTemplate'), 'Required key "SystemConfigTemplateEmailsDto[albumInviteTemplate]" is missing from JSON.'); + assert(json[r'albumInviteTemplate'] != null, 'Required key "SystemConfigTemplateEmailsDto[albumInviteTemplate]" has a null value in JSON.'); + assert(json.containsKey(r'albumUpdateTemplate'), 'Required key "SystemConfigTemplateEmailsDto[albumUpdateTemplate]" is missing from JSON.'); + assert(json[r'albumUpdateTemplate'] != null, 'Required key "SystemConfigTemplateEmailsDto[albumUpdateTemplate]" has a null value in JSON.'); + assert(json.containsKey(r'welcomeTemplate'), 'Required key "SystemConfigTemplateEmailsDto[welcomeTemplate]" is missing from JSON.'); + assert(json[r'welcomeTemplate'] != null, 'Required key "SystemConfigTemplateEmailsDto[welcomeTemplate]" has a null value in JSON.'); + return true; + }()); + return SystemConfigTemplateEmailsDto( albumInviteTemplate: mapValueOfType(json, r'albumInviteTemplate')!, albumUpdateTemplate: mapValueOfType(json, r'albumUpdateTemplate')!, diff --git a/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart b/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart index 6f81513039..ce26b2dfb8 100644 --- a/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart +++ b/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart @@ -90,10 +90,32 @@ class SystemConfigTemplateStorageOptionDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigTemplateStorageOptionDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTemplateStorageOptionDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'dayOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[dayOptions]" is missing from JSON.'); + assert(json[r'dayOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[dayOptions]" has a null value in JSON.'); + assert(json.containsKey(r'hourOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[hourOptions]" is missing from JSON.'); + assert(json[r'hourOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[hourOptions]" has a null value in JSON.'); + assert(json.containsKey(r'minuteOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[minuteOptions]" is missing from JSON.'); + assert(json[r'minuteOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[minuteOptions]" has a null value in JSON.'); + assert(json.containsKey(r'monthOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[monthOptions]" is missing from JSON.'); + assert(json[r'monthOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[monthOptions]" has a null value in JSON.'); + assert(json.containsKey(r'presetOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[presetOptions]" is missing from JSON.'); + assert(json[r'presetOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[presetOptions]" has a null value in JSON.'); + assert(json.containsKey(r'secondOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[secondOptions]" is missing from JSON.'); + assert(json[r'secondOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[secondOptions]" has a null value in JSON.'); + assert(json.containsKey(r'weekOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[weekOptions]" is missing from JSON.'); + assert(json[r'weekOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[weekOptions]" has a null value in JSON.'); + assert(json.containsKey(r'yearOptions'), 'Required key "SystemConfigTemplateStorageOptionDto[yearOptions]" is missing from JSON.'); + assert(json[r'yearOptions'] != null, 'Required key "SystemConfigTemplateStorageOptionDto[yearOptions]" has a null value in JSON.'); + return true; + }()); + return SystemConfigTemplateStorageOptionDto( dayOptions: json[r'dayOptions'] is Iterable ? (json[r'dayOptions'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/system_config_templates_dto.dart b/mobile/openapi/lib/model/system_config_templates_dto.dart index a5e8834978..385897b257 100644 --- a/mobile/openapi/lib/model/system_config_templates_dto.dart +++ b/mobile/openapi/lib/model/system_config_templates_dto.dart @@ -40,10 +40,18 @@ class SystemConfigTemplatesDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigTemplatesDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTemplatesDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'email'), 'Required key "SystemConfigTemplatesDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "SystemConfigTemplatesDto[email]" has a null value in JSON.'); + return true; + }()); + return SystemConfigTemplatesDto( email: SystemConfigTemplateEmailsDto.fromJson(json[r'email'])!, ); diff --git a/mobile/openapi/lib/model/system_config_theme_dto.dart b/mobile/openapi/lib/model/system_config_theme_dto.dart index fca38f71fb..eba3360786 100644 --- a/mobile/openapi/lib/model/system_config_theme_dto.dart +++ b/mobile/openapi/lib/model/system_config_theme_dto.dart @@ -41,10 +41,18 @@ class SystemConfigThemeDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigThemeDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigThemeDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'customCss'), 'Required key "SystemConfigThemeDto[customCss]" is missing from JSON.'); + assert(json[r'customCss'] != null, 'Required key "SystemConfigThemeDto[customCss]" has a null value in JSON.'); + return true; + }()); + return SystemConfigThemeDto( customCss: mapValueOfType(json, r'customCss')!, ); diff --git a/mobile/openapi/lib/model/system_config_trash_dto.dart b/mobile/openapi/lib/model/system_config_trash_dto.dart index 790710751f..d0bd23d53b 100644 --- a/mobile/openapi/lib/model/system_config_trash_dto.dart +++ b/mobile/openapi/lib/model/system_config_trash_dto.dart @@ -51,10 +51,20 @@ class SystemConfigTrashDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigTrashDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTrashDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'days'), 'Required key "SystemConfigTrashDto[days]" is missing from JSON.'); + assert(json[r'days'] != null, 'Required key "SystemConfigTrashDto[days]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "SystemConfigTrashDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "SystemConfigTrashDto[enabled]" has a null value in JSON.'); + return true; + }()); + return SystemConfigTrashDto( days: mapValueOfType(json, r'days')!, enabled: mapValueOfType(json, r'enabled')!, diff --git a/mobile/openapi/lib/model/system_config_user_dto.dart b/mobile/openapi/lib/model/system_config_user_dto.dart index dc553e7369..765541fd57 100644 --- a/mobile/openapi/lib/model/system_config_user_dto.dart +++ b/mobile/openapi/lib/model/system_config_user_dto.dart @@ -44,10 +44,18 @@ class SystemConfigUserDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static SystemConfigUserDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigUserDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'deleteDelay'), 'Required key "SystemConfigUserDto[deleteDelay]" is missing from JSON.'); + assert(json[r'deleteDelay'] != null, 'Required key "SystemConfigUserDto[deleteDelay]" has a null value in JSON.'); + return true; + }()); + return SystemConfigUserDto( deleteDelay: mapValueOfType(json, r'deleteDelay')!, ); diff --git a/mobile/openapi/lib/model/tag_bulk_assets_dto.dart b/mobile/openapi/lib/model/tag_bulk_assets_dto.dart index 16abc3bcdc..34de2d724a 100644 --- a/mobile/openapi/lib/model/tag_bulk_assets_dto.dart +++ b/mobile/openapi/lib/model/tag_bulk_assets_dto.dart @@ -48,10 +48,20 @@ class TagBulkAssetsDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagBulkAssetsDto? fromJson(dynamic value) { - upgradeDto(value, "TagBulkAssetsDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'assetIds'), 'Required key "TagBulkAssetsDto[assetIds]" is missing from JSON.'); + assert(json[r'assetIds'] != null, 'Required key "TagBulkAssetsDto[assetIds]" has a null value in JSON.'); + assert(json.containsKey(r'tagIds'), 'Required key "TagBulkAssetsDto[tagIds]" is missing from JSON.'); + assert(json[r'tagIds'] != null, 'Required key "TagBulkAssetsDto[tagIds]" has a null value in JSON.'); + return true; + }()); + return TagBulkAssetsDto( assetIds: json[r'assetIds'] is Iterable ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart b/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart index 4d689f01a1..f9d9e22f05 100644 --- a/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart +++ b/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart @@ -44,10 +44,18 @@ class TagBulkAssetsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagBulkAssetsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TagBulkAssetsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'count'), 'Required key "TagBulkAssetsResponseDto[count]" is missing from JSON.'); + assert(json[r'count'] != null, 'Required key "TagBulkAssetsResponseDto[count]" has a null value in JSON.'); + return true; + }()); + return TagBulkAssetsResponseDto( count: mapValueOfType(json, r'count')!, ); diff --git a/mobile/openapi/lib/model/tag_create_dto.dart b/mobile/openapi/lib/model/tag_create_dto.dart index e05b29f1ed..7a110db538 100644 --- a/mobile/openapi/lib/model/tag_create_dto.dart +++ b/mobile/openapi/lib/model/tag_create_dto.dart @@ -48,13 +48,13 @@ class TagCreateDto { if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } json[r'name'] = this.name; if (this.parentId != null) { json[r'parentId'] = this.parentId; } else { - // json[r'parentId'] = null; + json[r'parentId'] = null; } return json; } @@ -63,10 +63,18 @@ class TagCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagCreateDto? fromJson(dynamic value) { - upgradeDto(value, "TagCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'name'), 'Required key "TagCreateDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "TagCreateDto[name]" has a null value in JSON.'); + return true; + }()); + return TagCreateDto( color: mapValueOfType(json, r'color'), name: mapValueOfType(json, r'name')!, diff --git a/mobile/openapi/lib/model/tag_response_dto.dart b/mobile/openapi/lib/model/tag_response_dto.dart index 9a71912153..b7d046aa58 100644 --- a/mobile/openapi/lib/model/tag_response_dto.dart +++ b/mobile/openapi/lib/model/tag_response_dto.dart @@ -84,7 +84,7 @@ class TagResponseDto { if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); json[r'id'] = this.id; @@ -92,7 +92,7 @@ class TagResponseDto { if (this.parentId != null) { json[r'parentId'] = this.parentId; } else { - // json[r'parentId'] = null; + json[r'parentId'] = null; } json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); json[r'value'] = this.value; @@ -103,10 +103,26 @@ class TagResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TagResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'createdAt'), 'Required key "TagResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "TagResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "TagResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "TagResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "TagResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "TagResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "TagResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "TagResponseDto[updatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'value'), 'Required key "TagResponseDto[value]" is missing from JSON.'); + assert(json[r'value'] != null, 'Required key "TagResponseDto[value]" has a null value in JSON.'); + return true; + }()); + return TagResponseDto( color: mapValueOfType(json, r'color'), createdAt: mapDateTime(json, r'createdAt', r'')!, diff --git a/mobile/openapi/lib/model/tag_update_dto.dart b/mobile/openapi/lib/model/tag_update_dto.dart index 98cb6af523..4600fd1834 100644 --- a/mobile/openapi/lib/model/tag_update_dto.dart +++ b/mobile/openapi/lib/model/tag_update_dto.dart @@ -36,7 +36,7 @@ class TagUpdateDto { if (this.color != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + json[r'color'] = null; } return json; } @@ -45,10 +45,16 @@ class TagUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "TagUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return TagUpdateDto( color: mapValueOfType(json, r'color'), ); diff --git a/mobile/openapi/lib/model/tag_upsert_dto.dart b/mobile/openapi/lib/model/tag_upsert_dto.dart index 3581ef1e8f..909ad4253c 100644 --- a/mobile/openapi/lib/model/tag_upsert_dto.dart +++ b/mobile/openapi/lib/model/tag_upsert_dto.dart @@ -41,10 +41,18 @@ class TagUpsertDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagUpsertDto? fromJson(dynamic value) { - upgradeDto(value, "TagUpsertDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'tags'), 'Required key "TagUpsertDto[tags]" is missing from JSON.'); + assert(json[r'tags'] != null, 'Required key "TagUpsertDto[tags]" has a null value in JSON.'); + return true; + }()); + return TagUpsertDto( tags: json[r'tags'] is Iterable ? (json[r'tags'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/tags_response.dart b/mobile/openapi/lib/model/tags_response.dart index 8a3ac17474..2a13564230 100644 --- a/mobile/openapi/lib/model/tags_response.dart +++ b/mobile/openapi/lib/model/tags_response.dart @@ -48,10 +48,20 @@ class TagsResponse { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagsResponse? fromJson(dynamic value) { - upgradeDto(value, "TagsResponse"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'enabled'), 'Required key "TagsResponse[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "TagsResponse[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'sidebarWeb'), 'Required key "TagsResponse[sidebarWeb]" is missing from JSON.'); + assert(json[r'sidebarWeb'] != null, 'Required key "TagsResponse[sidebarWeb]" has a null value in JSON.'); + return true; + }()); + return TagsResponse( enabled: mapValueOfType(json, r'enabled')!, sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, diff --git a/mobile/openapi/lib/model/tags_update.dart b/mobile/openapi/lib/model/tags_update.dart index e42357e3d4..554f8ffb23 100644 --- a/mobile/openapi/lib/model/tags_update.dart +++ b/mobile/openapi/lib/model/tags_update.dart @@ -54,12 +54,12 @@ class TagsUpdate { if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } if (this.sidebarWeb != null) { json[r'sidebarWeb'] = this.sidebarWeb; } else { - // json[r'sidebarWeb'] = null; + json[r'sidebarWeb'] = null; } return json; } @@ -68,10 +68,16 @@ class TagsUpdate { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TagsUpdate? fromJson(dynamic value) { - upgradeDto(value, "TagsUpdate"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return TagsUpdate( enabled: mapValueOfType(json, r'enabled'), sidebarWeb: mapValueOfType(json, r'sidebarWeb'), diff --git a/mobile/openapi/lib/model/template_dto.dart b/mobile/openapi/lib/model/template_dto.dart index b1eab848ed..d622c494d4 100644 --- a/mobile/openapi/lib/model/template_dto.dart +++ b/mobile/openapi/lib/model/template_dto.dart @@ -41,10 +41,18 @@ class TemplateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TemplateDto? fromJson(dynamic value) { - upgradeDto(value, "TemplateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'template'), 'Required key "TemplateDto[template]" is missing from JSON.'); + assert(json[r'template'] != null, 'Required key "TemplateDto[template]" has a null value in JSON.'); + return true; + }()); + return TemplateDto( template: mapValueOfType(json, r'template')!, ); diff --git a/mobile/openapi/lib/model/template_response_dto.dart b/mobile/openapi/lib/model/template_response_dto.dart index f19c1eae7d..a8c918af03 100644 --- a/mobile/openapi/lib/model/template_response_dto.dart +++ b/mobile/openapi/lib/model/template_response_dto.dart @@ -48,10 +48,20 @@ class TemplateResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TemplateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TemplateResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'html'), 'Required key "TemplateResponseDto[html]" is missing from JSON.'); + assert(json[r'html'] != null, 'Required key "TemplateResponseDto[html]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "TemplateResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "TemplateResponseDto[name]" has a null value in JSON.'); + return true; + }()); + return TemplateResponseDto( html: mapValueOfType(json, r'html')!, name: mapValueOfType(json, r'name')!, diff --git a/mobile/openapi/lib/model/test_email_response_dto.dart b/mobile/openapi/lib/model/test_email_response_dto.dart index e14783f3c4..8d6eb471fa 100644 --- a/mobile/openapi/lib/model/test_email_response_dto.dart +++ b/mobile/openapi/lib/model/test_email_response_dto.dart @@ -41,10 +41,18 @@ class TestEmailResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TestEmailResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TestEmailResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'messageId'), 'Required key "TestEmailResponseDto[messageId]" is missing from JSON.'); + assert(json[r'messageId'] != null, 'Required key "TestEmailResponseDto[messageId]" has a null value in JSON.'); + return true; + }()); + return TestEmailResponseDto( messageId: mapValueOfType(json, r'messageId')!, ); diff --git a/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart b/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart index 08e690de71..992a667565 100644 --- a/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart +++ b/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart @@ -160,10 +160,46 @@ class TimeBucketAssetResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TimeBucketAssetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TimeBucketAssetResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'city'), 'Required key "TimeBucketAssetResponseDto[city]" is missing from JSON.'); + assert(json[r'city'] != null, 'Required key "TimeBucketAssetResponseDto[city]" has a null value in JSON.'); + assert(json.containsKey(r'country'), 'Required key "TimeBucketAssetResponseDto[country]" is missing from JSON.'); + assert(json[r'country'] != null, 'Required key "TimeBucketAssetResponseDto[country]" has a null value in JSON.'); + assert(json.containsKey(r'duration'), 'Required key "TimeBucketAssetResponseDto[duration]" is missing from JSON.'); + assert(json[r'duration'] != null, 'Required key "TimeBucketAssetResponseDto[duration]" has a null value in JSON.'); + assert(json.containsKey(r'fileCreatedAt'), 'Required key "TimeBucketAssetResponseDto[fileCreatedAt]" is missing from JSON.'); + assert(json[r'fileCreatedAt'] != null, 'Required key "TimeBucketAssetResponseDto[fileCreatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "TimeBucketAssetResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "TimeBucketAssetResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isFavorite'), 'Required key "TimeBucketAssetResponseDto[isFavorite]" is missing from JSON.'); + assert(json[r'isFavorite'] != null, 'Required key "TimeBucketAssetResponseDto[isFavorite]" has a null value in JSON.'); + assert(json.containsKey(r'isImage'), 'Required key "TimeBucketAssetResponseDto[isImage]" is missing from JSON.'); + assert(json[r'isImage'] != null, 'Required key "TimeBucketAssetResponseDto[isImage]" has a null value in JSON.'); + assert(json.containsKey(r'isTrashed'), 'Required key "TimeBucketAssetResponseDto[isTrashed]" is missing from JSON.'); + assert(json[r'isTrashed'] != null, 'Required key "TimeBucketAssetResponseDto[isTrashed]" has a null value in JSON.'); + assert(json.containsKey(r'livePhotoVideoId'), 'Required key "TimeBucketAssetResponseDto[livePhotoVideoId]" is missing from JSON.'); + assert(json[r'livePhotoVideoId'] != null, 'Required key "TimeBucketAssetResponseDto[livePhotoVideoId]" has a null value in JSON.'); + assert(json.containsKey(r'localOffsetHours'), 'Required key "TimeBucketAssetResponseDto[localOffsetHours]" is missing from JSON.'); + assert(json[r'localOffsetHours'] != null, 'Required key "TimeBucketAssetResponseDto[localOffsetHours]" has a null value in JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "TimeBucketAssetResponseDto[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "TimeBucketAssetResponseDto[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'projectionType'), 'Required key "TimeBucketAssetResponseDto[projectionType]" is missing from JSON.'); + assert(json[r'projectionType'] != null, 'Required key "TimeBucketAssetResponseDto[projectionType]" has a null value in JSON.'); + assert(json.containsKey(r'ratio'), 'Required key "TimeBucketAssetResponseDto[ratio]" is missing from JSON.'); + assert(json[r'ratio'] != null, 'Required key "TimeBucketAssetResponseDto[ratio]" has a null value in JSON.'); + assert(json.containsKey(r'thumbhash'), 'Required key "TimeBucketAssetResponseDto[thumbhash]" is missing from JSON.'); + assert(json[r'thumbhash'] != null, 'Required key "TimeBucketAssetResponseDto[thumbhash]" has a null value in JSON.'); + assert(json.containsKey(r'visibility'), 'Required key "TimeBucketAssetResponseDto[visibility]" is missing from JSON.'); + assert(json[r'visibility'] != null, 'Required key "TimeBucketAssetResponseDto[visibility]" has a null value in JSON.'); + return true; + }()); + return TimeBucketAssetResponseDto( city: json[r'city'] is Iterable ? (json[r'city'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/time_buckets_response_dto.dart b/mobile/openapi/lib/model/time_buckets_response_dto.dart index 8b8da1d37a..0a870451c2 100644 --- a/mobile/openapi/lib/model/time_buckets_response_dto.dart +++ b/mobile/openapi/lib/model/time_buckets_response_dto.dart @@ -51,10 +51,20 @@ class TimeBucketsResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TimeBucketsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TimeBucketsResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'count'), 'Required key "TimeBucketsResponseDto[count]" is missing from JSON.'); + assert(json[r'count'] != null, 'Required key "TimeBucketsResponseDto[count]" has a null value in JSON.'); + assert(json.containsKey(r'timeBucket'), 'Required key "TimeBucketsResponseDto[timeBucket]" is missing from JSON.'); + assert(json[r'timeBucket'] != null, 'Required key "TimeBucketsResponseDto[timeBucket]" has a null value in JSON.'); + return true; + }()); + return TimeBucketsResponseDto( count: mapValueOfType(json, r'count')!, timeBucket: mapValueOfType(json, r'timeBucket')!, diff --git a/mobile/openapi/lib/model/trash_response_dto.dart b/mobile/openapi/lib/model/trash_response_dto.dart index 7b43d9ceb7..c91f468018 100644 --- a/mobile/openapi/lib/model/trash_response_dto.dart +++ b/mobile/openapi/lib/model/trash_response_dto.dart @@ -44,10 +44,18 @@ class TrashResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static TrashResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TrashResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'count'), 'Required key "TrashResponseDto[count]" is missing from JSON.'); + assert(json[r'count'] != null, 'Required key "TrashResponseDto[count]" has a null value in JSON.'); + return true; + }()); + return TrashResponseDto( count: mapValueOfType(json, r'count')!, ); diff --git a/mobile/openapi/lib/model/update_album_dto.dart b/mobile/openapi/lib/model/update_album_dto.dart index ae4a5c1f87..3db0171644 100644 --- a/mobile/openapi/lib/model/update_album_dto.dart +++ b/mobile/openapi/lib/model/update_album_dto.dart @@ -13,11 +13,11 @@ part of openapi.api; class UpdateAlbumDto { /// Returns a new [UpdateAlbumDto] instance. UpdateAlbumDto({ - this.albumName, - this.albumThumbnailAssetId, - this.description, - this.isActivityEnabled, - this.order, + this.albumName = const Optional.absent(), + this.albumThumbnailAssetId = const Optional.absent(), + this.description = const Optional.absent(), + this.isActivityEnabled = const Optional.absent(), + this.order = const Optional.absent(), }); /// Album name @@ -27,7 +27,7 @@ class UpdateAlbumDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - String? albumName; + Optional albumName; /// Album thumbnail asset ID /// @@ -36,7 +36,7 @@ class UpdateAlbumDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - String? albumThumbnailAssetId; + Optional albumThumbnailAssetId; /// Album description /// @@ -45,7 +45,7 @@ class UpdateAlbumDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - String? description; + Optional description; /// Enable activity feed /// @@ -54,7 +54,7 @@ class UpdateAlbumDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - bool? isActivityEnabled; + Optional isActivityEnabled; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -62,7 +62,7 @@ class UpdateAlbumDto { /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. /// - AssetOrder? order; + Optional order; @override bool operator ==(Object other) => identical(this, other) || other is UpdateAlbumDto && @@ -86,30 +86,25 @@ class UpdateAlbumDto { Map toJson() { final json = {}; - if (this.albumName != null) { - json[r'albumName'] = this.albumName; - } else { - // json[r'albumName'] = null; + if (this.albumName.isPresent) { + final value = this.albumName.value; + json[r'albumName'] = value; } - if (this.albumThumbnailAssetId != null) { - json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; - } else { - // json[r'albumThumbnailAssetId'] = null; + if (this.albumThumbnailAssetId.isPresent) { + final value = this.albumThumbnailAssetId.value; + json[r'albumThumbnailAssetId'] = value; } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; + if (this.description.isPresent) { + final value = this.description.value; + json[r'description'] = value; } - if (this.isActivityEnabled != null) { - json[r'isActivityEnabled'] = this.isActivityEnabled; - } else { - // json[r'isActivityEnabled'] = null; + if (this.isActivityEnabled.isPresent) { + final value = this.isActivityEnabled.value; + json[r'isActivityEnabled'] = value; } - if (this.order != null) { - json[r'order'] = this.order; - } else { - // json[r'order'] = null; + if (this.order.isPresent) { + final value = this.order.value; + json[r'order'] = value; } return json; } @@ -118,16 +113,22 @@ class UpdateAlbumDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UpdateAlbumDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateAlbumDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UpdateAlbumDto( - albumName: mapValueOfType(json, r'albumName'), - albumThumbnailAssetId: mapValueOfType(json, r'albumThumbnailAssetId'), - description: mapValueOfType(json, r'description'), - isActivityEnabled: mapValueOfType(json, r'isActivityEnabled'), - order: AssetOrder.fromJson(json[r'order']), + albumName: json.containsKey(r'albumName') ? Optional.present(mapValueOfType(json, r'albumName')) : const Optional.absent(), + albumThumbnailAssetId: json.containsKey(r'albumThumbnailAssetId') ? Optional.present(mapValueOfType(json, r'albumThumbnailAssetId')) : const Optional.absent(), + description: json.containsKey(r'description') ? Optional.present(mapValueOfType(json, r'description')) : const Optional.absent(), + isActivityEnabled: json.containsKey(r'isActivityEnabled') ? Optional.present(mapValueOfType(json, r'isActivityEnabled')) : const Optional.absent(), + order: json.containsKey(r'order') ? Optional.present(AssetOrder.fromJson(json[r'order'])) : const Optional.absent(), ); } return null; diff --git a/mobile/openapi/lib/model/update_album_user_dto.dart b/mobile/openapi/lib/model/update_album_user_dto.dart index 43218cae6e..f68bca0a80 100644 --- a/mobile/openapi/lib/model/update_album_user_dto.dart +++ b/mobile/openapi/lib/model/update_album_user_dto.dart @@ -40,10 +40,18 @@ class UpdateAlbumUserDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UpdateAlbumUserDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateAlbumUserDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'role'), 'Required key "UpdateAlbumUserDto[role]" is missing from JSON.'); + assert(json[r'role'] != null, 'Required key "UpdateAlbumUserDto[role]" has a null value in JSON.'); + return true; + }()); + return UpdateAlbumUserDto( role: AlbumUserRole.fromJson(json[r'role'])!, ); diff --git a/mobile/openapi/lib/model/update_asset_dto.dart b/mobile/openapi/lib/model/update_asset_dto.dart index 2c4c3352ea..765a7e1a1c 100644 --- a/mobile/openapi/lib/model/update_asset_dto.dart +++ b/mobile/openapi/lib/model/update_asset_dto.dart @@ -122,42 +122,42 @@ class UpdateAssetDto { if (this.dateTimeOriginal != null) { json[r'dateTimeOriginal'] = this.dateTimeOriginal; } else { - // json[r'dateTimeOriginal'] = null; + json[r'dateTimeOriginal'] = null; } if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; } else { - // json[r'isFavorite'] = null; + json[r'isFavorite'] = null; } if (this.latitude != null) { json[r'latitude'] = this.latitude; } else { - // json[r'latitude'] = null; + json[r'latitude'] = null; } if (this.livePhotoVideoId != null) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - // json[r'livePhotoVideoId'] = null; + json[r'livePhotoVideoId'] = null; } if (this.longitude != null) { json[r'longitude'] = this.longitude; } else { - // json[r'longitude'] = null; + json[r'longitude'] = null; } if (this.rating != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + json[r'rating'] = null; } if (this.visibility != null) { json[r'visibility'] = this.visibility; } else { - // json[r'visibility'] = null; + json[r'visibility'] = null; } return json; } @@ -166,10 +166,16 @@ class UpdateAssetDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UpdateAssetDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateAssetDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UpdateAssetDto( dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), description: mapValueOfType(json, r'description'), diff --git a/mobile/openapi/lib/model/update_library_dto.dart b/mobile/openapi/lib/model/update_library_dto.dart index 276d43ecd9..fda268c7f1 100644 --- a/mobile/openapi/lib/model/update_library_dto.dart +++ b/mobile/openapi/lib/model/update_library_dto.dart @@ -56,7 +56,7 @@ class UpdateLibraryDto { if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } return json; } @@ -65,10 +65,16 @@ class UpdateLibraryDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UpdateLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateLibraryDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UpdateLibraryDto( exclusionPatterns: json[r'exclusionPatterns'] is Iterable ? (json[r'exclusionPatterns'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/usage_by_user_dto.dart b/mobile/openapi/lib/model/usage_by_user_dto.dart index 462b82c3e0..cdc84a5dfd 100644 --- a/mobile/openapi/lib/model/usage_by_user_dto.dart +++ b/mobile/openapi/lib/model/usage_by_user_dto.dart @@ -97,7 +97,7 @@ class UsageByUserDto { if (this.quotaSizeInBytes != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + json[r'quotaSizeInBytes'] = null; } json[r'usage'] = this.usage; json[r'usagePhotos'] = this.usagePhotos; @@ -112,10 +112,31 @@ class UsageByUserDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UsageByUserDto? fromJson(dynamic value) { - upgradeDto(value, "UsageByUserDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'photos'), 'Required key "UsageByUserDto[photos]" is missing from JSON.'); + assert(json[r'photos'] != null, 'Required key "UsageByUserDto[photos]" has a null value in JSON.'); + assert(json.containsKey(r'quotaSizeInBytes'), 'Required key "UsageByUserDto[quotaSizeInBytes]" is missing from JSON.'); + assert(json.containsKey(r'usage'), 'Required key "UsageByUserDto[usage]" is missing from JSON.'); + assert(json[r'usage'] != null, 'Required key "UsageByUserDto[usage]" has a null value in JSON.'); + assert(json.containsKey(r'usagePhotos'), 'Required key "UsageByUserDto[usagePhotos]" is missing from JSON.'); + assert(json[r'usagePhotos'] != null, 'Required key "UsageByUserDto[usagePhotos]" has a null value in JSON.'); + assert(json.containsKey(r'usageVideos'), 'Required key "UsageByUserDto[usageVideos]" is missing from JSON.'); + assert(json[r'usageVideos'] != null, 'Required key "UsageByUserDto[usageVideos]" has a null value in JSON.'); + assert(json.containsKey(r'userId'), 'Required key "UsageByUserDto[userId]" is missing from JSON.'); + assert(json[r'userId'] != null, 'Required key "UsageByUserDto[userId]" has a null value in JSON.'); + assert(json.containsKey(r'userName'), 'Required key "UsageByUserDto[userName]" is missing from JSON.'); + assert(json[r'userName'] != null, 'Required key "UsageByUserDto[userName]" has a null value in JSON.'); + assert(json.containsKey(r'videos'), 'Required key "UsageByUserDto[videos]" is missing from JSON.'); + assert(json[r'videos'] != null, 'Required key "UsageByUserDto[videos]" has a null value in JSON.'); + return true; + }()); + return UsageByUserDto( photos: mapValueOfType(json, r'photos')!, quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), diff --git a/mobile/openapi/lib/model/user_admin_create_dto.dart b/mobile/openapi/lib/model/user_admin_create_dto.dart index 54da0b0566..55e3a13305 100644 --- a/mobile/openapi/lib/model/user_admin_create_dto.dart +++ b/mobile/openapi/lib/model/user_admin_create_dto.dart @@ -110,40 +110,40 @@ class UserAdminCreateDto { if (this.avatarColor != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + json[r'avatarColor'] = null; } json[r'email'] = this.email; if (this.isAdmin != null) { json[r'isAdmin'] = this.isAdmin; } else { - // json[r'isAdmin'] = null; + json[r'isAdmin'] = null; } json[r'name'] = this.name; if (this.notify != null) { json[r'notify'] = this.notify; } else { - // json[r'notify'] = null; + json[r'notify'] = null; } json[r'password'] = this.password; if (this.pinCode != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + json[r'pinCode'] = null; } if (this.quotaSizeInBytes != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + json[r'quotaSizeInBytes'] = null; } if (this.shouldChangePassword != null) { json[r'shouldChangePassword'] = this.shouldChangePassword; } else { - // json[r'shouldChangePassword'] = null; + json[r'shouldChangePassword'] = null; } if (this.storageLabel != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + json[r'storageLabel'] = null; } return json; } @@ -152,10 +152,22 @@ class UserAdminCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserAdminCreateDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'email'), 'Required key "UserAdminCreateDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "UserAdminCreateDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "UserAdminCreateDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "UserAdminCreateDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'password'), 'Required key "UserAdminCreateDto[password]" is missing from JSON.'); + assert(json[r'password'] != null, 'Required key "UserAdminCreateDto[password]" has a null value in JSON.'); + return true; + }()); + return UserAdminCreateDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), email: mapValueOfType(json, r'email')!, diff --git a/mobile/openapi/lib/model/user_admin_delete_dto.dart b/mobile/openapi/lib/model/user_admin_delete_dto.dart index 6be70f37b7..c48ec5517a 100644 --- a/mobile/openapi/lib/model/user_admin_delete_dto.dart +++ b/mobile/openapi/lib/model/user_admin_delete_dto.dart @@ -42,7 +42,7 @@ class UserAdminDeleteDto { if (this.force != null) { json[r'force'] = this.force; } else { - // json[r'force'] = null; + json[r'force'] = null; } return json; } @@ -51,10 +51,16 @@ class UserAdminDeleteDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserAdminDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminDeleteDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UserAdminDeleteDto( force: mapValueOfType(json, r'force'), ); diff --git a/mobile/openapi/lib/model/user_admin_response_dto.dart b/mobile/openapi/lib/model/user_admin_response_dto.dart index 09f8cedce4..40697a75a9 100644 --- a/mobile/openapi/lib/model/user_admin_response_dto.dart +++ b/mobile/openapi/lib/model/user_admin_response_dto.dart @@ -141,7 +141,7 @@ class UserAdminResponseDto { ? this.deletedAt!.millisecondsSinceEpoch : this.deletedAt!.toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + json[r'deletedAt'] = null; } json[r'email'] = this.email; json[r'id'] = this.id; @@ -149,7 +149,7 @@ class UserAdminResponseDto { if (this.license != null) { json[r'license'] = this.license; } else { - // json[r'license'] = null; + json[r'license'] = null; } json[r'name'] = this.name; json[r'oauthId'] = this.oauthId; @@ -158,19 +158,19 @@ class UserAdminResponseDto { if (this.quotaSizeInBytes != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + json[r'quotaSizeInBytes'] = null; } if (this.quotaUsageInBytes != null) { json[r'quotaUsageInBytes'] = this.quotaUsageInBytes; } else { - // json[r'quotaUsageInBytes'] = null; + json[r'quotaUsageInBytes'] = null; } json[r'shouldChangePassword'] = this.shouldChangePassword; json[r'status'] = this.status; if (this.storageLabel != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + json[r'storageLabel'] = null; } json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') ? this.updatedAt.millisecondsSinceEpoch @@ -182,10 +182,45 @@ class UserAdminResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserAdminResponseDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'avatarColor'), 'Required key "UserAdminResponseDto[avatarColor]" is missing from JSON.'); + assert(json[r'avatarColor'] != null, 'Required key "UserAdminResponseDto[avatarColor]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "UserAdminResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "UserAdminResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'deletedAt'), 'Required key "UserAdminResponseDto[deletedAt]" is missing from JSON.'); + assert(json.containsKey(r'email'), 'Required key "UserAdminResponseDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "UserAdminResponseDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "UserAdminResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "UserAdminResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'isAdmin'), 'Required key "UserAdminResponseDto[isAdmin]" is missing from JSON.'); + assert(json[r'isAdmin'] != null, 'Required key "UserAdminResponseDto[isAdmin]" has a null value in JSON.'); + assert(json.containsKey(r'license'), 'Required key "UserAdminResponseDto[license]" is missing from JSON.'); + assert(json.containsKey(r'name'), 'Required key "UserAdminResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "UserAdminResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'oauthId'), 'Required key "UserAdminResponseDto[oauthId]" is missing from JSON.'); + assert(json[r'oauthId'] != null, 'Required key "UserAdminResponseDto[oauthId]" has a null value in JSON.'); + assert(json.containsKey(r'profileChangedAt'), 'Required key "UserAdminResponseDto[profileChangedAt]" is missing from JSON.'); + assert(json[r'profileChangedAt'] != null, 'Required key "UserAdminResponseDto[profileChangedAt]" has a null value in JSON.'); + assert(json.containsKey(r'profileImagePath'), 'Required key "UserAdminResponseDto[profileImagePath]" is missing from JSON.'); + assert(json[r'profileImagePath'] != null, 'Required key "UserAdminResponseDto[profileImagePath]" has a null value in JSON.'); + assert(json.containsKey(r'quotaSizeInBytes'), 'Required key "UserAdminResponseDto[quotaSizeInBytes]" is missing from JSON.'); + assert(json.containsKey(r'quotaUsageInBytes'), 'Required key "UserAdminResponseDto[quotaUsageInBytes]" is missing from JSON.'); + assert(json.containsKey(r'shouldChangePassword'), 'Required key "UserAdminResponseDto[shouldChangePassword]" is missing from JSON.'); + assert(json[r'shouldChangePassword'] != null, 'Required key "UserAdminResponseDto[shouldChangePassword]" has a null value in JSON.'); + assert(json.containsKey(r'status'), 'Required key "UserAdminResponseDto[status]" is missing from JSON.'); + assert(json[r'status'] != null, 'Required key "UserAdminResponseDto[status]" has a null value in JSON.'); + assert(json.containsKey(r'storageLabel'), 'Required key "UserAdminResponseDto[storageLabel]" is missing from JSON.'); + assert(json.containsKey(r'updatedAt'), 'Required key "UserAdminResponseDto[updatedAt]" is missing from JSON.'); + assert(json[r'updatedAt'] != null, 'Required key "UserAdminResponseDto[updatedAt]" has a null value in JSON.'); + return true; + }()); + return UserAdminResponseDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, diff --git a/mobile/openapi/lib/model/user_admin_update_dto.dart b/mobile/openapi/lib/model/user_admin_update_dto.dart index 0c33a46139..c22c409c86 100644 --- a/mobile/openapi/lib/model/user_admin_update_dto.dart +++ b/mobile/openapi/lib/model/user_admin_update_dto.dart @@ -116,47 +116,47 @@ class UserAdminUpdateDto { if (this.avatarColor != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + json[r'avatarColor'] = null; } if (this.email != null) { json[r'email'] = this.email; } else { - // json[r'email'] = null; + json[r'email'] = null; } if (this.isAdmin != null) { json[r'isAdmin'] = this.isAdmin; } else { - // json[r'isAdmin'] = null; + json[r'isAdmin'] = null; } if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } if (this.pinCode != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + json[r'pinCode'] = null; } if (this.quotaSizeInBytes != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + json[r'quotaSizeInBytes'] = null; } if (this.shouldChangePassword != null) { json[r'shouldChangePassword'] = this.shouldChangePassword; } else { - // json[r'shouldChangePassword'] = null; + json[r'shouldChangePassword'] = null; } if (this.storageLabel != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + json[r'storageLabel'] = null; } return json; } @@ -165,10 +165,16 @@ class UserAdminUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserAdminUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UserAdminUpdateDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), email: mapValueOfType(json, r'email'), diff --git a/mobile/openapi/lib/model/user_license.dart b/mobile/openapi/lib/model/user_license.dart index 8ef46a0bb5..cdf0100d05 100644 --- a/mobile/openapi/lib/model/user_license.dart +++ b/mobile/openapi/lib/model/user_license.dart @@ -57,10 +57,22 @@ class UserLicense { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserLicense? fromJson(dynamic value) { - upgradeDto(value, "UserLicense"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'activatedAt'), 'Required key "UserLicense[activatedAt]" is missing from JSON.'); + assert(json[r'activatedAt'] != null, 'Required key "UserLicense[activatedAt]" has a null value in JSON.'); + assert(json.containsKey(r'activationKey'), 'Required key "UserLicense[activationKey]" is missing from JSON.'); + assert(json[r'activationKey'] != null, 'Required key "UserLicense[activationKey]" has a null value in JSON.'); + assert(json.containsKey(r'licenseKey'), 'Required key "UserLicense[licenseKey]" is missing from JSON.'); + assert(json[r'licenseKey'] != null, 'Required key "UserLicense[licenseKey]" has a null value in JSON.'); + return true; + }()); + return UserLicense( activatedAt: mapDateTime(json, r'activatedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, activationKey: mapValueOfType(json, r'activationKey')!, diff --git a/mobile/openapi/lib/model/user_preferences_response_dto.dart b/mobile/openapi/lib/model/user_preferences_response_dto.dart index 7a6e0252af..ba4bf932e1 100644 --- a/mobile/openapi/lib/model/user_preferences_response_dto.dart +++ b/mobile/openapi/lib/model/user_preferences_response_dto.dart @@ -100,10 +100,38 @@ class UserPreferencesResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserPreferencesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "UserPreferencesResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'albums'), 'Required key "UserPreferencesResponseDto[albums]" is missing from JSON.'); + assert(json[r'albums'] != null, 'Required key "UserPreferencesResponseDto[albums]" has a null value in JSON.'); + assert(json.containsKey(r'cast'), 'Required key "UserPreferencesResponseDto[cast]" is missing from JSON.'); + assert(json[r'cast'] != null, 'Required key "UserPreferencesResponseDto[cast]" has a null value in JSON.'); + assert(json.containsKey(r'download'), 'Required key "UserPreferencesResponseDto[download]" is missing from JSON.'); + assert(json[r'download'] != null, 'Required key "UserPreferencesResponseDto[download]" has a null value in JSON.'); + assert(json.containsKey(r'emailNotifications'), 'Required key "UserPreferencesResponseDto[emailNotifications]" is missing from JSON.'); + assert(json[r'emailNotifications'] != null, 'Required key "UserPreferencesResponseDto[emailNotifications]" has a null value in JSON.'); + assert(json.containsKey(r'folders'), 'Required key "UserPreferencesResponseDto[folders]" is missing from JSON.'); + assert(json[r'folders'] != null, 'Required key "UserPreferencesResponseDto[folders]" has a null value in JSON.'); + assert(json.containsKey(r'memories'), 'Required key "UserPreferencesResponseDto[memories]" is missing from JSON.'); + assert(json[r'memories'] != null, 'Required key "UserPreferencesResponseDto[memories]" has a null value in JSON.'); + assert(json.containsKey(r'people'), 'Required key "UserPreferencesResponseDto[people]" is missing from JSON.'); + assert(json[r'people'] != null, 'Required key "UserPreferencesResponseDto[people]" has a null value in JSON.'); + assert(json.containsKey(r'purchase'), 'Required key "UserPreferencesResponseDto[purchase]" is missing from JSON.'); + assert(json[r'purchase'] != null, 'Required key "UserPreferencesResponseDto[purchase]" has a null value in JSON.'); + assert(json.containsKey(r'ratings'), 'Required key "UserPreferencesResponseDto[ratings]" is missing from JSON.'); + assert(json[r'ratings'] != null, 'Required key "UserPreferencesResponseDto[ratings]" has a null value in JSON.'); + assert(json.containsKey(r'sharedLinks'), 'Required key "UserPreferencesResponseDto[sharedLinks]" is missing from JSON.'); + assert(json[r'sharedLinks'] != null, 'Required key "UserPreferencesResponseDto[sharedLinks]" has a null value in JSON.'); + assert(json.containsKey(r'tags'), 'Required key "UserPreferencesResponseDto[tags]" is missing from JSON.'); + assert(json[r'tags'] != null, 'Required key "UserPreferencesResponseDto[tags]" has a null value in JSON.'); + return true; + }()); + return UserPreferencesResponseDto( albums: AlbumsResponse.fromJson(json[r'albums'])!, cast: CastResponse.fromJson(json[r'cast'])!, diff --git a/mobile/openapi/lib/model/user_preferences_update_dto.dart b/mobile/openapi/lib/model/user_preferences_update_dto.dart index 3b9b178b55..083f135dd3 100644 --- a/mobile/openapi/lib/model/user_preferences_update_dto.dart +++ b/mobile/openapi/lib/model/user_preferences_update_dto.dart @@ -162,62 +162,62 @@ class UserPreferencesUpdateDto { if (this.albums != null) { json[r'albums'] = this.albums; } else { - // json[r'albums'] = null; + json[r'albums'] = null; } if (this.avatar != null) { json[r'avatar'] = this.avatar; } else { - // json[r'avatar'] = null; + json[r'avatar'] = null; } if (this.cast != null) { json[r'cast'] = this.cast; } else { - // json[r'cast'] = null; + json[r'cast'] = null; } if (this.download != null) { json[r'download'] = this.download; } else { - // json[r'download'] = null; + json[r'download'] = null; } if (this.emailNotifications != null) { json[r'emailNotifications'] = this.emailNotifications; } else { - // json[r'emailNotifications'] = null; + json[r'emailNotifications'] = null; } if (this.folders != null) { json[r'folders'] = this.folders; } else { - // json[r'folders'] = null; + json[r'folders'] = null; } if (this.memories != null) { json[r'memories'] = this.memories; } else { - // json[r'memories'] = null; + json[r'memories'] = null; } if (this.people != null) { json[r'people'] = this.people; } else { - // json[r'people'] = null; + json[r'people'] = null; } if (this.purchase != null) { json[r'purchase'] = this.purchase; } else { - // json[r'purchase'] = null; + json[r'purchase'] = null; } if (this.ratings != null) { json[r'ratings'] = this.ratings; } else { - // json[r'ratings'] = null; + json[r'ratings'] = null; } if (this.sharedLinks != null) { json[r'sharedLinks'] = this.sharedLinks; } else { - // json[r'sharedLinks'] = null; + json[r'sharedLinks'] = null; } if (this.tags != null) { json[r'tags'] = this.tags; } else { - // json[r'tags'] = null; + json[r'tags'] = null; } return json; } @@ -226,10 +226,16 @@ class UserPreferencesUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserPreferencesUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "UserPreferencesUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UserPreferencesUpdateDto( albums: AlbumsUpdate.fromJson(json[r'albums']), avatar: AvatarUpdate.fromJson(json[r'avatar']), diff --git a/mobile/openapi/lib/model/user_response_dto.dart b/mobile/openapi/lib/model/user_response_dto.dart index f671072c72..0bcd68da58 100644 --- a/mobile/openapi/lib/model/user_response_dto.dart +++ b/mobile/openapi/lib/model/user_response_dto.dart @@ -75,10 +75,28 @@ class UserResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserResponseDto? fromJson(dynamic value) { - upgradeDto(value, "UserResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'avatarColor'), 'Required key "UserResponseDto[avatarColor]" is missing from JSON.'); + assert(json[r'avatarColor'] != null, 'Required key "UserResponseDto[avatarColor]" has a null value in JSON.'); + assert(json.containsKey(r'email'), 'Required key "UserResponseDto[email]" is missing from JSON.'); + assert(json[r'email'] != null, 'Required key "UserResponseDto[email]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "UserResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "UserResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "UserResponseDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "UserResponseDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'profileChangedAt'), 'Required key "UserResponseDto[profileChangedAt]" is missing from JSON.'); + assert(json[r'profileChangedAt'] != null, 'Required key "UserResponseDto[profileChangedAt]" has a null value in JSON.'); + assert(json.containsKey(r'profileImagePath'), 'Required key "UserResponseDto[profileImagePath]" is missing from JSON.'); + assert(json[r'profileImagePath'] != null, 'Required key "UserResponseDto[profileImagePath]" has a null value in JSON.'); + return true; + }()); + return UserResponseDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, email: mapValueOfType(json, r'email')!, diff --git a/mobile/openapi/lib/model/user_update_me_dto.dart b/mobile/openapi/lib/model/user_update_me_dto.dart index 0751d4096b..d169382054 100644 --- a/mobile/openapi/lib/model/user_update_me_dto.dart +++ b/mobile/openapi/lib/model/user_update_me_dto.dart @@ -71,22 +71,22 @@ class UserUpdateMeDto { if (this.avatarColor != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + json[r'avatarColor'] = null; } if (this.email != null) { json[r'email'] = this.email; } else { - // json[r'email'] = null; + json[r'email'] = null; } if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } if (this.password != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + json[r'password'] = null; } return json; } @@ -95,10 +95,16 @@ class UserUpdateMeDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static UserUpdateMeDto? fromJson(dynamic value) { - upgradeDto(value, "UserUpdateMeDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return UserUpdateMeDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), email: mapValueOfType(json, r'email'), diff --git a/mobile/openapi/lib/model/validate_access_token_response_dto.dart b/mobile/openapi/lib/model/validate_access_token_response_dto.dart index 16b9d0f925..464ba93436 100644 --- a/mobile/openapi/lib/model/validate_access_token_response_dto.dart +++ b/mobile/openapi/lib/model/validate_access_token_response_dto.dart @@ -41,10 +41,18 @@ class ValidateAccessTokenResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ValidateAccessTokenResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateAccessTokenResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'authStatus'), 'Required key "ValidateAccessTokenResponseDto[authStatus]" is missing from JSON.'); + assert(json[r'authStatus'] != null, 'Required key "ValidateAccessTokenResponseDto[authStatus]" has a null value in JSON.'); + return true; + }()); + return ValidateAccessTokenResponseDto( authStatus: mapValueOfType(json, r'authStatus')!, ); diff --git a/mobile/openapi/lib/model/validate_library_dto.dart b/mobile/openapi/lib/model/validate_library_dto.dart index 68fb0e9fe2..2bdf276a86 100644 --- a/mobile/openapi/lib/model/validate_library_dto.dart +++ b/mobile/openapi/lib/model/validate_library_dto.dart @@ -48,10 +48,16 @@ class ValidateLibraryDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ValidateLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateLibraryDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return ValidateLibraryDto( exclusionPatterns: json[r'exclusionPatterns'] is Iterable ? (json[r'exclusionPatterns'] as Iterable).cast().toList(growable: false) diff --git a/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart b/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart index ebcb881935..5ac0e14333 100644 --- a/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart +++ b/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart @@ -56,7 +56,7 @@ class ValidateLibraryImportPathResponseDto { if (this.message != null) { json[r'message'] = this.message; } else { - // json[r'message'] = null; + json[r'message'] = null; } return json; } @@ -65,10 +65,20 @@ class ValidateLibraryImportPathResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ValidateLibraryImportPathResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateLibraryImportPathResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'importPath'), 'Required key "ValidateLibraryImportPathResponseDto[importPath]" is missing from JSON.'); + assert(json[r'importPath'] != null, 'Required key "ValidateLibraryImportPathResponseDto[importPath]" has a null value in JSON.'); + assert(json.containsKey(r'isValid'), 'Required key "ValidateLibraryImportPathResponseDto[isValid]" is missing from JSON.'); + assert(json[r'isValid'] != null, 'Required key "ValidateLibraryImportPathResponseDto[isValid]" has a null value in JSON.'); + return true; + }()); + return ValidateLibraryImportPathResponseDto( importPath: mapValueOfType(json, r'importPath')!, isValid: mapValueOfType(json, r'isValid')!, diff --git a/mobile/openapi/lib/model/validate_library_response_dto.dart b/mobile/openapi/lib/model/validate_library_response_dto.dart index 37f6ad07d1..2341ea59ca 100644 --- a/mobile/openapi/lib/model/validate_library_response_dto.dart +++ b/mobile/openapi/lib/model/validate_library_response_dto.dart @@ -41,10 +41,16 @@ class ValidateLibraryResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static ValidateLibraryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateLibraryResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return ValidateLibraryResponseDto( importPaths: ValidateLibraryImportPathResponseDto.listFromJson(json[r'importPaths']), ); diff --git a/mobile/openapi/lib/model/version_check_state_response_dto.dart b/mobile/openapi/lib/model/version_check_state_response_dto.dart index 71075a681c..f3ff0bdf0d 100644 --- a/mobile/openapi/lib/model/version_check_state_response_dto.dart +++ b/mobile/openapi/lib/model/version_check_state_response_dto.dart @@ -42,12 +42,12 @@ class VersionCheckStateResponseDto { if (this.checkedAt != null) { json[r'checkedAt'] = this.checkedAt; } else { - // json[r'checkedAt'] = null; + json[r'checkedAt'] = null; } if (this.releaseVersion != null) { json[r'releaseVersion'] = this.releaseVersion; } else { - // json[r'releaseVersion'] = null; + json[r'releaseVersion'] = null; } return json; } @@ -56,10 +56,18 @@ class VersionCheckStateResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static VersionCheckStateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "VersionCheckStateResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'checkedAt'), 'Required key "VersionCheckStateResponseDto[checkedAt]" is missing from JSON.'); + assert(json.containsKey(r'releaseVersion'), 'Required key "VersionCheckStateResponseDto[releaseVersion]" is missing from JSON.'); + return true; + }()); + return VersionCheckStateResponseDto( checkedAt: mapValueOfType(json, r'checkedAt'), releaseVersion: mapValueOfType(json, r'releaseVersion'), diff --git a/mobile/openapi/lib/model/workflow_action_item_dto.dart b/mobile/openapi/lib/model/workflow_action_item_dto.dart index 1ad70238d8..293c45b33a 100644 --- a/mobile/openapi/lib/model/workflow_action_item_dto.dart +++ b/mobile/openapi/lib/model/workflow_action_item_dto.dart @@ -47,10 +47,18 @@ class WorkflowActionItemDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowActionItemDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowActionItemDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'pluginActionId'), 'Required key "WorkflowActionItemDto[pluginActionId]" is missing from JSON.'); + assert(json[r'pluginActionId'] != null, 'Required key "WorkflowActionItemDto[pluginActionId]" has a null value in JSON.'); + return true; + }()); + return WorkflowActionItemDto( actionConfig: mapCastOfType(json, r'actionConfig') ?? const {}, pluginActionId: mapValueOfType(json, r'pluginActionId')!, diff --git a/mobile/openapi/lib/model/workflow_action_response_dto.dart b/mobile/openapi/lib/model/workflow_action_response_dto.dart index 999d9d86cb..a7b380b632 100644 --- a/mobile/openapi/lib/model/workflow_action_response_dto.dart +++ b/mobile/openapi/lib/model/workflow_action_response_dto.dart @@ -62,7 +62,7 @@ class WorkflowActionResponseDto { if (this.actionConfig != null) { json[r'actionConfig'] = this.actionConfig; } else { - // json[r'actionConfig'] = null; + json[r'actionConfig'] = null; } json[r'id'] = this.id; json[r'order'] = this.order; @@ -75,10 +75,25 @@ class WorkflowActionResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowActionResponseDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowActionResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'actionConfig'), 'Required key "WorkflowActionResponseDto[actionConfig]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "WorkflowActionResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "WorkflowActionResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'order'), 'Required key "WorkflowActionResponseDto[order]" is missing from JSON.'); + assert(json[r'order'] != null, 'Required key "WorkflowActionResponseDto[order]" has a null value in JSON.'); + assert(json.containsKey(r'pluginActionId'), 'Required key "WorkflowActionResponseDto[pluginActionId]" is missing from JSON.'); + assert(json[r'pluginActionId'] != null, 'Required key "WorkflowActionResponseDto[pluginActionId]" has a null value in JSON.'); + assert(json.containsKey(r'workflowId'), 'Required key "WorkflowActionResponseDto[workflowId]" is missing from JSON.'); + assert(json[r'workflowId'] != null, 'Required key "WorkflowActionResponseDto[workflowId]" has a null value in JSON.'); + return true; + }()); + return WorkflowActionResponseDto( actionConfig: mapCastOfType(json, r'actionConfig'), id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/workflow_create_dto.dart b/mobile/openapi/lib/model/workflow_create_dto.dart index 143af0ca6c..034888613d 100644 --- a/mobile/openapi/lib/model/workflow_create_dto.dart +++ b/mobile/openapi/lib/model/workflow_create_dto.dart @@ -78,12 +78,12 @@ class WorkflowCreateDto { if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } json[r'filters'] = this.filters; json[r'name'] = this.name; @@ -95,10 +95,24 @@ class WorkflowCreateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowCreateDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowCreateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'actions'), 'Required key "WorkflowCreateDto[actions]" is missing from JSON.'); + assert(json[r'actions'] != null, 'Required key "WorkflowCreateDto[actions]" has a null value in JSON.'); + assert(json.containsKey(r'filters'), 'Required key "WorkflowCreateDto[filters]" is missing from JSON.'); + assert(json[r'filters'] != null, 'Required key "WorkflowCreateDto[filters]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "WorkflowCreateDto[name]" is missing from JSON.'); + assert(json[r'name'] != null, 'Required key "WorkflowCreateDto[name]" has a null value in JSON.'); + assert(json.containsKey(r'triggerType'), 'Required key "WorkflowCreateDto[triggerType]" is missing from JSON.'); + assert(json[r'triggerType'] != null, 'Required key "WorkflowCreateDto[triggerType]" has a null value in JSON.'); + return true; + }()); + return WorkflowCreateDto( actions: WorkflowActionItemDto.listFromJson(json[r'actions']), description: mapValueOfType(json, r'description'), diff --git a/mobile/openapi/lib/model/workflow_filter_item_dto.dart b/mobile/openapi/lib/model/workflow_filter_item_dto.dart index 92224b9f16..df5b3d859c 100644 --- a/mobile/openapi/lib/model/workflow_filter_item_dto.dart +++ b/mobile/openapi/lib/model/workflow_filter_item_dto.dart @@ -47,10 +47,18 @@ class WorkflowFilterItemDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowFilterItemDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowFilterItemDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'pluginFilterId'), 'Required key "WorkflowFilterItemDto[pluginFilterId]" is missing from JSON.'); + assert(json[r'pluginFilterId'] != null, 'Required key "WorkflowFilterItemDto[pluginFilterId]" has a null value in JSON.'); + return true; + }()); + return WorkflowFilterItemDto( filterConfig: mapCastOfType(json, r'filterConfig') ?? const {}, pluginFilterId: mapValueOfType(json, r'pluginFilterId')!, diff --git a/mobile/openapi/lib/model/workflow_filter_response_dto.dart b/mobile/openapi/lib/model/workflow_filter_response_dto.dart index b9a841a68b..9bdb7f80a4 100644 --- a/mobile/openapi/lib/model/workflow_filter_response_dto.dart +++ b/mobile/openapi/lib/model/workflow_filter_response_dto.dart @@ -62,7 +62,7 @@ class WorkflowFilterResponseDto { if (this.filterConfig != null) { json[r'filterConfig'] = this.filterConfig; } else { - // json[r'filterConfig'] = null; + json[r'filterConfig'] = null; } json[r'id'] = this.id; json[r'order'] = this.order; @@ -75,10 +75,25 @@ class WorkflowFilterResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowFilterResponseDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowFilterResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'filterConfig'), 'Required key "WorkflowFilterResponseDto[filterConfig]" is missing from JSON.'); + assert(json.containsKey(r'id'), 'Required key "WorkflowFilterResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "WorkflowFilterResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'order'), 'Required key "WorkflowFilterResponseDto[order]" is missing from JSON.'); + assert(json[r'order'] != null, 'Required key "WorkflowFilterResponseDto[order]" has a null value in JSON.'); + assert(json.containsKey(r'pluginFilterId'), 'Required key "WorkflowFilterResponseDto[pluginFilterId]" is missing from JSON.'); + assert(json[r'pluginFilterId'] != null, 'Required key "WorkflowFilterResponseDto[pluginFilterId]" has a null value in JSON.'); + assert(json.containsKey(r'workflowId'), 'Required key "WorkflowFilterResponseDto[workflowId]" is missing from JSON.'); + assert(json[r'workflowId'] != null, 'Required key "WorkflowFilterResponseDto[workflowId]" has a null value in JSON.'); + return true; + }()); + return WorkflowFilterResponseDto( filterConfig: mapCastOfType(json, r'filterConfig'), id: mapValueOfType(json, r'id')!, diff --git a/mobile/openapi/lib/model/workflow_response_dto.dart b/mobile/openapi/lib/model/workflow_response_dto.dart index 6461b62508..1c84fdba29 100644 --- a/mobile/openapi/lib/model/workflow_response_dto.dart +++ b/mobile/openapi/lib/model/workflow_response_dto.dart @@ -89,7 +89,7 @@ class WorkflowResponseDto { if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } json[r'ownerId'] = this.ownerId; json[r'triggerType'] = this.triggerType; @@ -100,10 +100,33 @@ class WorkflowResponseDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowResponseDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowResponseDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + assert(json.containsKey(r'actions'), 'Required key "WorkflowResponseDto[actions]" is missing from JSON.'); + assert(json[r'actions'] != null, 'Required key "WorkflowResponseDto[actions]" has a null value in JSON.'); + assert(json.containsKey(r'createdAt'), 'Required key "WorkflowResponseDto[createdAt]" is missing from JSON.'); + assert(json[r'createdAt'] != null, 'Required key "WorkflowResponseDto[createdAt]" has a null value in JSON.'); + assert(json.containsKey(r'description'), 'Required key "WorkflowResponseDto[description]" is missing from JSON.'); + assert(json[r'description'] != null, 'Required key "WorkflowResponseDto[description]" has a null value in JSON.'); + assert(json.containsKey(r'enabled'), 'Required key "WorkflowResponseDto[enabled]" is missing from JSON.'); + assert(json[r'enabled'] != null, 'Required key "WorkflowResponseDto[enabled]" has a null value in JSON.'); + assert(json.containsKey(r'filters'), 'Required key "WorkflowResponseDto[filters]" is missing from JSON.'); + assert(json[r'filters'] != null, 'Required key "WorkflowResponseDto[filters]" has a null value in JSON.'); + assert(json.containsKey(r'id'), 'Required key "WorkflowResponseDto[id]" is missing from JSON.'); + assert(json[r'id'] != null, 'Required key "WorkflowResponseDto[id]" has a null value in JSON.'); + assert(json.containsKey(r'name'), 'Required key "WorkflowResponseDto[name]" is missing from JSON.'); + assert(json.containsKey(r'ownerId'), 'Required key "WorkflowResponseDto[ownerId]" is missing from JSON.'); + assert(json[r'ownerId'] != null, 'Required key "WorkflowResponseDto[ownerId]" has a null value in JSON.'); + assert(json.containsKey(r'triggerType'), 'Required key "WorkflowResponseDto[triggerType]" is missing from JSON.'); + assert(json[r'triggerType'] != null, 'Required key "WorkflowResponseDto[triggerType]" has a null value in JSON.'); + return true; + }()); + return WorkflowResponseDto( actions: WorkflowActionResponseDto.listFromJson(json[r'actions']), createdAt: mapValueOfType(json, r'createdAt')!, diff --git a/mobile/openapi/lib/model/workflow_update_dto.dart b/mobile/openapi/lib/model/workflow_update_dto.dart index 9abb45ddd5..d1af117538 100644 --- a/mobile/openapi/lib/model/workflow_update_dto.dart +++ b/mobile/openapi/lib/model/workflow_update_dto.dart @@ -90,23 +90,23 @@ class WorkflowUpdateDto { if (this.description != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + json[r'description'] = null; } if (this.enabled != null) { json[r'enabled'] = this.enabled; } else { - // json[r'enabled'] = null; + json[r'enabled'] = null; } json[r'filters'] = this.filters; if (this.name != null) { json[r'name'] = this.name; } else { - // json[r'name'] = null; + json[r'name'] = null; } if (this.triggerType != null) { json[r'triggerType'] = this.triggerType; } else { - // json[r'triggerType'] = null; + json[r'triggerType'] = null; } return json; } @@ -115,10 +115,16 @@ class WorkflowUpdateDto { /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods static WorkflowUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowUpdateDto"); if (value is Map) { final json = value.cast(); + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + return true; + }()); + return WorkflowUpdateDto( actions: WorkflowActionItemDto.listFromJson(json[r'actions']), description: mapValueOfType(json, r'description'), diff --git a/mobile/openapi/lib/optional.dart b/mobile/openapi/lib/optional.dart new file mode 100644 index 0000000000..f260ec4a84 --- /dev/null +++ b/mobile/openapi/lib/optional.dart @@ -0,0 +1,119 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +/// Represents an optional value that can be either absent or present. +/// +/// This is used to distinguish between three states in PATCH operations: +/// - Absent: Field is not set (omitted from JSON) +/// - Present with null: Field is explicitly set to null +/// - Present with value: Field has a value +/// +/// Example usage: +/// ```dart +/// // Field absent - not sent in request +/// final patch1 = Model(); +/// +/// // Field explicitly null - sends {"field": null} +/// final patch2 = Model(field: const Optional.present(null)); +/// +/// // Field has value - sends {"field": "value"} +/// final patch3 = Model(field: const Optional.present('value')); +/// ``` +abstract class Optional { + const Optional(); + + /// Creates an Optional with an absent value (not set). + const factory Optional.absent() = Absent; + + /// Creates an Optional with a present value (can be null). + const factory Optional.present(T value) = Present; + + /// Returns true if this Optional has a value (even if that value is null). + bool get isPresent; + + /// Returns true if this Optional does not have a value. + bool get isEmpty => !isPresent; + + /// Returns the value if present, throws if absent. + T get value; + + /// Returns the value if present, otherwise returns [defaultValue]. + T orElse(T defaultValue); + + /// Returns the value if present, otherwise returns the result of calling [defaultValue]. + T orElseGet(T Function() defaultValue); + + /// Maps the value if present using [transform], otherwise returns an absent Optional. + Optional map(R Function(T value) transform); +} + +/// Represents an absent Optional value. +class Absent extends Optional { + const Absent(); + + @override + bool get isPresent => false; + + @override + T get value => throw StateError('No value present'); + + @override + T orElse(T defaultValue) => defaultValue; + + @override + T orElseGet(T Function() defaultValue) => defaultValue(); + + @override + Optional map(R Function(T value) transform) => const Absent(); + + @override + bool operator ==(Object other) => other is Absent; + + @override + int get hashCode => 0; + + @override + String toString() => 'Optional.absent()'; +} + +/// Represents a present Optional value. +class Present extends Optional { + const Present(this._value); + + final T _value; + + @override + bool get isPresent => true; + + @override + T get value => _value; + + @override + T orElse(T defaultValue) => _value; + + @override + T orElseGet(T Function() defaultValue) => _value; + + @override + Optional map(R Function(T value) transform) => Optional.present(transform(_value)); + + @override + bool operator ==(Object other) => + identical(this, other) || + (other is Present && _value == other._value); + + @override + int get hashCode => _value.hashCode; + + @override + String toString() => 'Optional.present($_value)'; +}