mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Refactor mobile to use OpenApi generated SDK (#336)
This commit is contained in:
parent
d69470e207
commit
ae7e582ec8
276 changed files with 14513 additions and 3003 deletions
82
mobile/openapi/lib/api.dart
Normal file
82
mobile/openapi/lib/api.dart
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
library openapi.api;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
part 'api_client.dart';
|
||||
part 'api_helper.dart';
|
||||
part 'api_exception.dart';
|
||||
part 'auth/authentication.dart';
|
||||
part 'auth/api_key_auth.dart';
|
||||
part 'auth/oauth.dart';
|
||||
part 'auth/http_basic_auth.dart';
|
||||
part 'auth/http_bearer_auth.dart';
|
||||
|
||||
part 'api/album_api.dart';
|
||||
part 'api/asset_api.dart';
|
||||
part 'api/authentication_api.dart';
|
||||
part 'api/device_info_api.dart';
|
||||
part 'api/server_info_api.dart';
|
||||
part 'api/user_api.dart';
|
||||
|
||||
part 'model/add_assets_dto.dart';
|
||||
part 'model/add_users_dto.dart';
|
||||
part 'model/admin_signup_response_dto.dart';
|
||||
part 'model/album_response_dto.dart';
|
||||
part 'model/asset_file_upload_response_dto.dart';
|
||||
part 'model/asset_response_dto.dart';
|
||||
part 'model/asset_type_enum.dart';
|
||||
part 'model/check_duplicate_asset_dto.dart';
|
||||
part 'model/check_duplicate_asset_response_dto.dart';
|
||||
part 'model/create_album_dto.dart';
|
||||
part 'model/create_device_info_dto.dart';
|
||||
part 'model/create_profile_image_response_dto.dart';
|
||||
part 'model/create_user_dto.dart';
|
||||
part 'model/curated_locations_response_dto.dart';
|
||||
part 'model/curated_objects_response_dto.dart';
|
||||
part 'model/delete_asset_dto.dart';
|
||||
part 'model/delete_asset_response_dto.dart';
|
||||
part 'model/delete_asset_status.dart';
|
||||
part 'model/device_info_response_dto.dart';
|
||||
part 'model/device_type_enum.dart';
|
||||
part 'model/exif_response_dto.dart';
|
||||
part 'model/login_credential_dto.dart';
|
||||
part 'model/login_response_dto.dart';
|
||||
part 'model/remove_assets_dto.dart';
|
||||
part 'model/search_asset_dto.dart';
|
||||
part 'model/server_info_response_dto.dart';
|
||||
part 'model/server_ping_response.dart';
|
||||
part 'model/server_version_reponse_dto.dart';
|
||||
part 'model/sign_up_dto.dart';
|
||||
part 'model/smart_info_response_dto.dart';
|
||||
part 'model/update_album_dto.dart';
|
||||
part 'model/update_device_info_dto.dart';
|
||||
part 'model/update_user_dto.dart';
|
||||
part 'model/user_count_response_dto.dart';
|
||||
part 'model/user_response_dto.dart';
|
||||
part 'model/validate_access_token_response_dto.dart';
|
||||
|
||||
|
||||
const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
|
||||
const _dateEpochMarker = 'epoch';
|
||||
final _dateFormatter = DateFormat('yyyy-MM-dd');
|
||||
final _regList = RegExp(r'^List<(.*)>$');
|
||||
final _regSet = RegExp(r'^Set<(.*)>$');
|
||||
final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
|
||||
ApiClient defaultApiClient = ApiClient();
|
||||
452
mobile/openapi/lib/api/album_api.dart
Normal file
452
mobile/openapi/lib/api/album_api.dart
Normal file
|
|
@ -0,0 +1,452 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class AlbumApi {
|
||||
AlbumApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Performs an HTTP 'PUT /album/{albumId}/assets' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [AddAssetsDto] addAssetsDto (required):
|
||||
Future<Response> addAssetsToAlbumWithHttpInfo(String albumId, AddAssetsDto addAssetsDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}/assets'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = addAssetsDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'PUT',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [AddAssetsDto] addAssetsDto (required):
|
||||
Future<AlbumResponseDto?> addAssetsToAlbum(String albumId, AddAssetsDto addAssetsDto,) async {
|
||||
final response = await addAssetsToAlbumWithHttpInfo(albumId, addAssetsDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'PUT /album/{albumId}/users' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [AddUsersDto] addUsersDto (required):
|
||||
Future<Response> addUsersToAlbumWithHttpInfo(String albumId, AddUsersDto addUsersDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}/users'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = addUsersDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'PUT',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [AddUsersDto] addUsersDto (required):
|
||||
Future<AlbumResponseDto?> addUsersToAlbum(String albumId, AddUsersDto addUsersDto,) async {
|
||||
final response = await addUsersToAlbumWithHttpInfo(albumId, addUsersDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /album' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CreateAlbumDto] createAlbumDto (required):
|
||||
Future<Response> createAlbumWithHttpInfo(CreateAlbumDto createAlbumDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = createAlbumDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CreateAlbumDto] createAlbumDto (required):
|
||||
Future<AlbumResponseDto?> createAlbum(CreateAlbumDto createAlbumDto,) async {
|
||||
final response = await createAlbumWithHttpInfo(createAlbumDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'DELETE /album/{albumId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
Future<Response> deleteAlbumWithHttpInfo(String albumId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'DELETE',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
Future<void> deleteAlbum(String albumId,) async {
|
||||
final response = await deleteAlbumWithHttpInfo(albumId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /album/{albumId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
Future<Response> getAlbumInfoWithHttpInfo(String albumId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
Future<AlbumResponseDto?> getAlbumInfo(String albumId,) async {
|
||||
final response = await getAlbumInfoWithHttpInfo(albumId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /album' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] shared:
|
||||
Future<Response> getAllAlbumsWithHttpInfo({ bool? shared, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
if (shared != null) {
|
||||
queryParams.addAll(_queryParams('', 'shared', shared));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] shared:
|
||||
Future<List<AlbumResponseDto>?> getAllAlbums({ bool? shared, }) async {
|
||||
final response = await getAllAlbumsWithHttpInfo( shared: shared, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<AlbumResponseDto>') as List)
|
||||
.cast<AlbumResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'DELETE /album/{albumId}/assets' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [RemoveAssetsDto] removeAssetsDto (required):
|
||||
Future<Response> removeAssetFromAlbumWithHttpInfo(String albumId, RemoveAssetsDto removeAssetsDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}/assets'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = removeAssetsDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'DELETE',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [RemoveAssetsDto] removeAssetsDto (required):
|
||||
Future<void> removeAssetFromAlbum(String albumId, RemoveAssetsDto removeAssetsDto,) async {
|
||||
final response = await removeAssetFromAlbumWithHttpInfo(albumId, removeAssetsDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'DELETE /album/{albumId}/user/{userId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [String] userId (required):
|
||||
Future<Response> removeUserFromAlbumWithHttpInfo(String albumId, String userId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}/user/{userId}'
|
||||
.replaceAll('{albumId}', albumId)
|
||||
.replaceAll('{userId}', userId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'DELETE',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [String] userId (required):
|
||||
Future<void> removeUserFromAlbum(String albumId, String userId,) async {
|
||||
final response = await removeUserFromAlbumWithHttpInfo(albumId, userId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'PATCH /album/{albumId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [UpdateAlbumDto] updateAlbumDto (required):
|
||||
Future<Response> updateAlbumInfoWithHttpInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = updateAlbumDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'PATCH',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [UpdateAlbumDto] updateAlbumDto (required):
|
||||
Future<AlbumResponseDto?> updateAlbumInfo(String albumId, UpdateAlbumDto updateAlbumDto,) async {
|
||||
final response = await updateAlbumInfoWithHttpInfo(albumId, updateAlbumDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AlbumResponseDto',) as AlbumResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
715
mobile/openapi/lib/api/asset_api.dart
Normal file
715
mobile/openapi/lib/api/asset_api.dart
Normal file
|
|
@ -0,0 +1,715 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class AssetApi {
|
||||
AssetApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
///
|
||||
///
|
||||
/// Check duplicated asset before uploading - for Web upload used
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
|
||||
Future<Response> checkDuplicateAssetWithHttpInfo(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/check';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = checkDuplicateAssetDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Check duplicated asset before uploading - for Web upload used
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CheckDuplicateAssetDto] checkDuplicateAssetDto (required):
|
||||
Future<CheckDuplicateAssetResponseDto?> checkDuplicateAsset(CheckDuplicateAssetDto checkDuplicateAssetDto,) async {
|
||||
final response = await checkDuplicateAssetWithHttpInfo(checkDuplicateAssetDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CheckDuplicateAssetResponseDto',) as CheckDuplicateAssetResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'DELETE /asset' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [DeleteAssetDto] deleteAssetDto (required):
|
||||
Future<Response> deleteAssetWithHttpInfo(DeleteAssetDto deleteAssetDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = deleteAssetDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'DELETE',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [DeleteAssetDto] deleteAssetDto (required):
|
||||
Future<List<DeleteAssetResponseDto>?> deleteAsset(DeleteAssetDto deleteAssetDto,) async {
|
||||
final response = await deleteAssetWithHttpInfo(deleteAssetDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<DeleteAssetResponseDto>') as List)
|
||||
.cast<DeleteAssetResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /asset/download' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] aid (required):
|
||||
///
|
||||
/// * [String] did (required):
|
||||
///
|
||||
/// * [bool] isThumb:
|
||||
///
|
||||
/// * [bool] isWeb:
|
||||
Future<Response> downloadFileWithHttpInfo(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/download';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
queryParams.addAll(_queryParams('', 'aid', aid));
|
||||
queryParams.addAll(_queryParams('', 'did', did));
|
||||
if (isThumb != null) {
|
||||
queryParams.addAll(_queryParams('', 'isThumb', isThumb));
|
||||
}
|
||||
if (isWeb != null) {
|
||||
queryParams.addAll(_queryParams('', 'isWeb', isWeb));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] aid (required):
|
||||
///
|
||||
/// * [String] did (required):
|
||||
///
|
||||
/// * [bool] isThumb:
|
||||
///
|
||||
/// * [bool] isWeb:
|
||||
Future<Object?> downloadFile(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
|
||||
final response = await downloadFileWithHttpInfo(aid, did, isThumb: isThumb, isWeb: isWeb, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Get all AssetEntity belong to the user
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> getAllAssetsWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Get all AssetEntity belong to the user
|
||||
Future<List<AssetResponseDto>?> getAllAssets() async {
|
||||
final response = await getAllAssetsWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
|
||||
.cast<AssetResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Get a single asset's information
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] assetId (required):
|
||||
Future<Response> getAssetByIdWithHttpInfo(String assetId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/assetById/{assetId}'
|
||||
.replaceAll('{assetId}', assetId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Get a single asset's information
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] assetId (required):
|
||||
Future<AssetResponseDto?> getAssetById(String assetId,) async {
|
||||
final response = await getAssetByIdWithHttpInfo(assetId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetResponseDto',) as AssetResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /asset/searchTerm' operation and returns the [Response].
|
||||
Future<Response> getAssetSearchTermsWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/searchTerm';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<String>?> getAssetSearchTerms() async {
|
||||
final response = await getAssetSearchTermsWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
|
||||
.cast<String>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /asset/thumbnail/{assetId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] assetId (required):
|
||||
Future<Response> getAssetThumbnailWithHttpInfo(String assetId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/thumbnail/{assetId}'
|
||||
.replaceAll('{assetId}', assetId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] assetId (required):
|
||||
Future<Object?> getAssetThumbnail(String assetId,) async {
|
||||
final response = await getAssetThumbnailWithHttpInfo(assetId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /asset/allLocation' operation and returns the [Response].
|
||||
Future<Response> getCuratedLocationsWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/allLocation';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<CuratedLocationsResponseDto>?> getCuratedLocations() async {
|
||||
final response = await getCuratedLocationsWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<CuratedLocationsResponseDto>') as List)
|
||||
.cast<CuratedLocationsResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /asset/allObjects' operation and returns the [Response].
|
||||
Future<Response> getCuratedObjectsWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/allObjects';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<CuratedObjectsResponseDto>?> getCuratedObjects() async {
|
||||
final response = await getCuratedObjectsWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<CuratedObjectsResponseDto>') as List)
|
||||
.cast<CuratedObjectsResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Get all asset of a device that are in the database, ID only.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] deviceId (required):
|
||||
Future<Response> getUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/{deviceId}'
|
||||
.replaceAll('{deviceId}', deviceId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// Get all asset of a device that are in the database, ID only.
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] deviceId (required):
|
||||
Future<List<String>?> getUserAssetsByDeviceId(String deviceId,) async {
|
||||
final response = await getUserAssetsByDeviceIdWithHttpInfo(deviceId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
|
||||
.cast<String>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /asset/search' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SearchAssetDto] searchAssetDto (required):
|
||||
Future<Response> searchAssetWithHttpInfo(SearchAssetDto searchAssetDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/search';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = searchAssetDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SearchAssetDto] searchAssetDto (required):
|
||||
Future<List<AssetResponseDto>?> searchAsset(SearchAssetDto searchAssetDto,) async {
|
||||
final response = await searchAssetWithHttpInfo(searchAssetDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
|
||||
.cast<AssetResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /asset/file' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] aid (required):
|
||||
///
|
||||
/// * [String] did (required):
|
||||
///
|
||||
/// * [bool] isThumb:
|
||||
///
|
||||
/// * [bool] isWeb:
|
||||
Future<Response> serveFileWithHttpInfo(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/file';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
queryParams.addAll(_queryParams('', 'aid', aid));
|
||||
queryParams.addAll(_queryParams('', 'did', did));
|
||||
if (isThumb != null) {
|
||||
queryParams.addAll(_queryParams('', 'isThumb', isThumb));
|
||||
}
|
||||
if (isWeb != null) {
|
||||
queryParams.addAll(_queryParams('', 'isWeb', isWeb));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] aid (required):
|
||||
///
|
||||
/// * [String] did (required):
|
||||
///
|
||||
/// * [bool] isThumb:
|
||||
///
|
||||
/// * [bool] isWeb:
|
||||
Future<Object?> serveFile(String aid, String did, { bool? isThumb, bool? isWeb, }) async {
|
||||
final response = await serveFileWithHttpInfo(aid, did, isThumb: isThumb, isWeb: isWeb, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /asset/upload' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [MultipartFile] assetData (required):
|
||||
Future<Response> uploadFileWithHttpInfo(MultipartFile assetData,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/upload';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['multipart/form-data'];
|
||||
|
||||
bool hasFields = false;
|
||||
final mp = MultipartRequest('POST', Uri.parse(path));
|
||||
if (assetData != null) {
|
||||
hasFields = true;
|
||||
mp.fields[r'assetData'] = assetData.field;
|
||||
mp.files.add(assetData);
|
||||
}
|
||||
if (hasFields) {
|
||||
postBody = mp;
|
||||
}
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [MultipartFile] assetData (required):
|
||||
Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData,) async {
|
||||
final response = await uploadFileWithHttpInfo(assetData,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetFileUploadResponseDto',) as AssetFileUploadResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
153
mobile/openapi/lib/api/authentication_api.dart
Normal file
153
mobile/openapi/lib/api/authentication_api.dart
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class AuthenticationApi {
|
||||
AuthenticationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Performs an HTTP 'POST /auth/admin-sign-up' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SignUpDto] signUpDto (required):
|
||||
Future<Response> adminSignUpWithHttpInfo(SignUpDto signUpDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/auth/admin-sign-up';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = signUpDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [SignUpDto] signUpDto (required):
|
||||
Future<AdminSignupResponseDto?> adminSignUp(SignUpDto signUpDto,) async {
|
||||
final response = await adminSignUpWithHttpInfo(signUpDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AdminSignupResponseDto',) as AdminSignupResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/login' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [LoginCredentialDto] loginCredentialDto (required):
|
||||
Future<Response> loginWithHttpInfo(LoginCredentialDto loginCredentialDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/auth/login';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = loginCredentialDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [LoginCredentialDto] loginCredentialDto (required):
|
||||
Future<LoginResponseDto?> login(LoginCredentialDto loginCredentialDto,) async {
|
||||
final response = await loginWithHttpInfo(loginCredentialDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LoginResponseDto',) as LoginResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/validateToken' operation and returns the [Response].
|
||||
Future<Response> validateAccessTokenWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/auth/validateToken';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<ValidateAccessTokenResponseDto?> validateAccessToken() async {
|
||||
final response = await validateAccessTokenWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ValidateAccessTokenResponseDto',) as ValidateAccessTokenResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
112
mobile/openapi/lib/api/device_info_api.dart
Normal file
112
mobile/openapi/lib/api/device_info_api.dart
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class DeviceInfoApi {
|
||||
DeviceInfoApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Performs an HTTP 'POST /device-info' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CreateDeviceInfoDto] createDeviceInfoDto (required):
|
||||
Future<Response> createDeviceInfoWithHttpInfo(CreateDeviceInfoDto createDeviceInfoDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/device-info';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = createDeviceInfoDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CreateDeviceInfoDto] createDeviceInfoDto (required):
|
||||
Future<DeviceInfoResponseDto?> createDeviceInfo(CreateDeviceInfoDto createDeviceInfoDto,) async {
|
||||
final response = await createDeviceInfoWithHttpInfo(createDeviceInfoDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceInfoResponseDto',) as DeviceInfoResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'PATCH /device-info' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [UpdateDeviceInfoDto] updateDeviceInfoDto (required):
|
||||
Future<Response> updateDeviceInfoWithHttpInfo(UpdateDeviceInfoDto updateDeviceInfoDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/device-info';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = updateDeviceInfoDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'PATCH',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [UpdateDeviceInfoDto] updateDeviceInfoDto (required):
|
||||
Future<DeviceInfoResponseDto?> updateDeviceInfo(UpdateDeviceInfoDto updateDeviceInfoDto,) async {
|
||||
final response = await updateDeviceInfoWithHttpInfo(updateDeviceInfoDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceInfoResponseDto',) as DeviceInfoResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
141
mobile/openapi/lib/api/server_info_api.dart
Normal file
141
mobile/openapi/lib/api/server_info_api.dart
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class ServerInfoApi {
|
||||
ServerInfoApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Performs an HTTP 'GET /server-info' operation and returns the [Response].
|
||||
Future<Response> getServerInfoWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/server-info';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<ServerInfoResponseDto?> getServerInfo() async {
|
||||
final response = await getServerInfoWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerInfoResponseDto',) as ServerInfoResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /server-info/version' operation and returns the [Response].
|
||||
Future<Response> getServerVersionWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/server-info/version';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<ServerVersionReponseDto?> getServerVersion() async {
|
||||
final response = await getServerVersionWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerVersionReponseDto',) as ServerVersionReponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /server-info/ping' operation and returns the [Response].
|
||||
Future<Response> pingServerWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/server-info/ping';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<ServerPingResponse?> pingServer() async {
|
||||
final response = await pingServerWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ServerPingResponse',) as ServerPingResponse;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
351
mobile/openapi/lib/api/user_api.dart
Normal file
351
mobile/openapi/lib/api/user_api.dart
Normal file
|
|
@ -0,0 +1,351 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class UserApi {
|
||||
UserApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Performs an HTTP 'POST /user/profile-image' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [MultipartFile] file (required):
|
||||
Future<Response> createProfileImageWithHttpInfo(MultipartFile file,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user/profile-image';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['multipart/form-data'];
|
||||
|
||||
bool hasFields = false;
|
||||
final mp = MultipartRequest('POST', Uri.parse(path));
|
||||
if (file != null) {
|
||||
hasFields = true;
|
||||
mp.fields[r'file'] = file.field;
|
||||
mp.files.add(file);
|
||||
}
|
||||
if (hasFields) {
|
||||
postBody = mp;
|
||||
}
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [MultipartFile] file (required):
|
||||
Future<CreateProfileImageResponseDto?> createProfileImage(MultipartFile file,) async {
|
||||
final response = await createProfileImageWithHttpInfo(file,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateProfileImageResponseDto',) as CreateProfileImageResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /user' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CreateUserDto] createUserDto (required):
|
||||
Future<Response> createUserWithHttpInfo(CreateUserDto createUserDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = createUserDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [CreateUserDto] createUserDto (required):
|
||||
Future<UserResponseDto?> createUser(CreateUserDto createUserDto,) async {
|
||||
final response = await createUserWithHttpInfo(createUserDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /user' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] isAll (required):
|
||||
Future<Response> getAllUsersWithHttpInfo(bool isAll,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
queryParams.addAll(_queryParams('', 'isAll', isAll));
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] isAll (required):
|
||||
Future<List<UserResponseDto>?> getAllUsers(bool isAll,) async {
|
||||
final response = await getAllUsersWithHttpInfo(isAll,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
final responseBody = await _decodeBodyBytes(response);
|
||||
return (await apiClient.deserializeAsync(responseBody, 'List<UserResponseDto>') as List)
|
||||
.cast<UserResponseDto>()
|
||||
.toList();
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /user/me' operation and returns the [Response].
|
||||
Future<Response> getMyUserInfoWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user/me';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<UserResponseDto?> getMyUserInfo() async {
|
||||
final response = await getMyUserInfoWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /user/profile-image/{userId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] userId (required):
|
||||
Future<Response> getProfileImageWithHttpInfo(String userId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user/profile-image/{userId}'
|
||||
.replaceAll('{userId}', userId);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] userId (required):
|
||||
Future<Object?> getProfileImage(String userId,) async {
|
||||
final response = await getProfileImageWithHttpInfo(userId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /user/count' operation and returns the [Response].
|
||||
Future<Response> getUserCountWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user/count';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<UserCountResponseDto?> getUserCount() async {
|
||||
final response = await getUserCountWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserCountResponseDto',) as UserCountResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'PUT /user' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [UpdateUserDto] updateUserDto (required):
|
||||
Future<Response> updateUserWithHttpInfo(UpdateUserDto updateUserDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = updateUserDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'PUT',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [UpdateUserDto] updateUserDto (required):
|
||||
Future<UserResponseDto?> updateUser(UpdateUserDto updateUserDto,) async {
|
||||
final response = await updateUserWithHttpInfo(updateUserDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserResponseDto',) as UserResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
327
mobile/openapi/lib/api_client.dart
Normal file
327
mobile/openapi/lib/api_client.dart
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ApiClient {
|
||||
ApiClient({this.basePath = '/api', this.authentication});
|
||||
|
||||
final String basePath;
|
||||
|
||||
var _client = Client();
|
||||
|
||||
/// Returns the current HTTP [Client] instance to use in this class.
|
||||
///
|
||||
/// The return value is guaranteed to never be null.
|
||||
Client get client => _client;
|
||||
|
||||
/// Requests to use a new HTTP [Client] in this class.
|
||||
set client(Client newClient) {
|
||||
_client = newClient;
|
||||
}
|
||||
|
||||
final _defaultHeaderMap = <String, String>{};
|
||||
final Authentication? authentication;
|
||||
|
||||
void addDefaultHeader(String key, String value) {
|
||||
_defaultHeaderMap[key] = value;
|
||||
}
|
||||
|
||||
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
|
||||
|
||||
// We don't use a Map<String, String> for queryParams.
|
||||
// If collectionFormat is 'multi', a key might appear multiple times.
|
||||
Future<Response> invokeAPI(
|
||||
String path,
|
||||
String method,
|
||||
List<QueryParam> queryParams,
|
||||
Object? body,
|
||||
Map<String, String> headerParams,
|
||||
Map<String, String> formParams,
|
||||
String? contentType,
|
||||
) async {
|
||||
_updateParamsForAuth(queryParams, headerParams);
|
||||
|
||||
headerParams.addAll(_defaultHeaderMap);
|
||||
if (contentType != null) {
|
||||
headerParams['Content-Type'] = contentType;
|
||||
}
|
||||
|
||||
final urlEncodedQueryParams = queryParams.map((param) => '$param');
|
||||
final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : '';
|
||||
final uri = Uri.parse('$basePath$path$queryString');
|
||||
|
||||
try {
|
||||
// Special case for uploading a single file which isn't a 'multipart/form-data'.
|
||||
if (
|
||||
body is MultipartFile && (contentType == null ||
|
||||
!contentType.toLowerCase().startsWith('multipart/form-data'))
|
||||
) {
|
||||
final request = StreamedRequest(method, uri);
|
||||
request.headers.addAll(headerParams);
|
||||
request.contentLength = body.length;
|
||||
body.finalize().listen(
|
||||
request.sink.add,
|
||||
onDone: request.sink.close,
|
||||
// ignore: avoid_types_on_closure_parameters
|
||||
onError: (Object error, StackTrace trace) => request.sink.close(),
|
||||
cancelOnError: true,
|
||||
);
|
||||
final response = await _client.send(request);
|
||||
return Response.fromStream(response);
|
||||
}
|
||||
|
||||
if (body is MultipartRequest) {
|
||||
final request = MultipartRequest(method, uri);
|
||||
request.fields.addAll(body.fields);
|
||||
request.files.addAll(body.files);
|
||||
request.headers.addAll(body.headers);
|
||||
request.headers.addAll(headerParams);
|
||||
final response = await _client.send(request);
|
||||
return Response.fromStream(response);
|
||||
}
|
||||
|
||||
final msgBody = contentType == 'application/x-www-form-urlencoded'
|
||||
? formParams
|
||||
: await serializeAsync(body);
|
||||
final nullableHeaderParams = headerParams.isEmpty ? null : headerParams;
|
||||
|
||||
switch(method) {
|
||||
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
|
||||
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
|
||||
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
|
||||
}
|
||||
} on SocketException catch (error, trace) {
|
||||
throw ApiException.withInner(
|
||||
HttpStatus.badRequest,
|
||||
'Socket operation failed: $method $path',
|
||||
error,
|
||||
trace,
|
||||
);
|
||||
} on TlsException catch (error, trace) {
|
||||
throw ApiException.withInner(
|
||||
HttpStatus.badRequest,
|
||||
'TLS/SSL communication failed: $method $path',
|
||||
error,
|
||||
trace,
|
||||
);
|
||||
} on IOException catch (error, trace) {
|
||||
throw ApiException.withInner(
|
||||
HttpStatus.badRequest,
|
||||
'I/O operation failed: $method $path',
|
||||
error,
|
||||
trace,
|
||||
);
|
||||
} on ClientException catch (error, trace) {
|
||||
throw ApiException.withInner(
|
||||
HttpStatus.badRequest,
|
||||
'HTTP connection failed: $method $path',
|
||||
error,
|
||||
trace,
|
||||
);
|
||||
} on Exception catch (error, trace) {
|
||||
throw ApiException.withInner(
|
||||
HttpStatus.badRequest,
|
||||
'Exception occurred: $method $path',
|
||||
error,
|
||||
trace,
|
||||
);
|
||||
}
|
||||
|
||||
throw ApiException(
|
||||
HttpStatus.badRequest,
|
||||
'Invalid HTTP operation: $method $path',
|
||||
);
|
||||
}
|
||||
|
||||
Future<dynamic> deserializeAsync(String json, String targetType, {bool growable = false,}) async =>
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
deserialize(json, targetType, growable: growable);
|
||||
|
||||
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.')
|
||||
dynamic deserialize(String json, 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'
|
||||
? json
|
||||
: _deserialize(jsonDecode(json), targetType, growable: growable);
|
||||
}
|
||||
|
||||
// ignore: deprecated_member_use_from_same_package
|
||||
Future<String> serializeAsync(Object? value) async => serialize(value);
|
||||
|
||||
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
|
||||
String serialize(Object? value) => value == null ? '' : json.encode(value);
|
||||
|
||||
/// Update query and header parameters based on authentication settings.
|
||||
void _updateParamsForAuth(
|
||||
List<QueryParam> queryParams,
|
||||
Map<String, String> headerParams,
|
||||
) {
|
||||
if (authentication != null) {
|
||||
authentication!.applyToParams(queryParams, headerParams);
|
||||
}
|
||||
}
|
||||
|
||||
static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) {
|
||||
try {
|
||||
switch (targetType) {
|
||||
case 'String':
|
||||
return value is String ? value : value.toString();
|
||||
case 'int':
|
||||
return value is int ? value : int.parse('$value');
|
||||
case 'double':
|
||||
return value is double ? value : double.parse('$value');
|
||||
case 'bool':
|
||||
if (value is bool) {
|
||||
return value;
|
||||
}
|
||||
final valueString = '$value'.toLowerCase();
|
||||
return valueString == 'true' || valueString == '1';
|
||||
case 'DateTime':
|
||||
return value is DateTime ? value : DateTime.tryParse(value);
|
||||
case 'AddAssetsDto':
|
||||
return AddAssetsDto.fromJson(value);
|
||||
case 'AddUsersDto':
|
||||
return AddUsersDto.fromJson(value);
|
||||
case 'AdminSignupResponseDto':
|
||||
return AdminSignupResponseDto.fromJson(value);
|
||||
case 'AlbumResponseDto':
|
||||
return AlbumResponseDto.fromJson(value);
|
||||
case 'AssetFileUploadResponseDto':
|
||||
return AssetFileUploadResponseDto.fromJson(value);
|
||||
case 'AssetResponseDto':
|
||||
return AssetResponseDto.fromJson(value);
|
||||
case 'AssetTypeEnum':
|
||||
return AssetTypeEnumTypeTransformer().decode(value);
|
||||
case 'CheckDuplicateAssetDto':
|
||||
return CheckDuplicateAssetDto.fromJson(value);
|
||||
case 'CheckDuplicateAssetResponseDto':
|
||||
return CheckDuplicateAssetResponseDto.fromJson(value);
|
||||
case 'CreateAlbumDto':
|
||||
return CreateAlbumDto.fromJson(value);
|
||||
case 'CreateDeviceInfoDto':
|
||||
return CreateDeviceInfoDto.fromJson(value);
|
||||
case 'CreateProfileImageResponseDto':
|
||||
return CreateProfileImageResponseDto.fromJson(value);
|
||||
case 'CreateUserDto':
|
||||
return CreateUserDto.fromJson(value);
|
||||
case 'CuratedLocationsResponseDto':
|
||||
return CuratedLocationsResponseDto.fromJson(value);
|
||||
case 'CuratedObjectsResponseDto':
|
||||
return CuratedObjectsResponseDto.fromJson(value);
|
||||
case 'DeleteAssetDto':
|
||||
return DeleteAssetDto.fromJson(value);
|
||||
case 'DeleteAssetResponseDto':
|
||||
return DeleteAssetResponseDto.fromJson(value);
|
||||
case 'DeleteAssetStatus':
|
||||
return DeleteAssetStatusTypeTransformer().decode(value);
|
||||
case 'DeviceInfoResponseDto':
|
||||
return DeviceInfoResponseDto.fromJson(value);
|
||||
case 'DeviceTypeEnum':
|
||||
return DeviceTypeEnumTypeTransformer().decode(value);
|
||||
case 'ExifResponseDto':
|
||||
return ExifResponseDto.fromJson(value);
|
||||
case 'LoginCredentialDto':
|
||||
return LoginCredentialDto.fromJson(value);
|
||||
case 'LoginResponseDto':
|
||||
return LoginResponseDto.fromJson(value);
|
||||
case 'RemoveAssetsDto':
|
||||
return RemoveAssetsDto.fromJson(value);
|
||||
case 'SearchAssetDto':
|
||||
return SearchAssetDto.fromJson(value);
|
||||
case 'ServerInfoResponseDto':
|
||||
return ServerInfoResponseDto.fromJson(value);
|
||||
case 'ServerPingResponse':
|
||||
return ServerPingResponse.fromJson(value);
|
||||
case 'ServerVersionReponseDto':
|
||||
return ServerVersionReponseDto.fromJson(value);
|
||||
case 'SignUpDto':
|
||||
return SignUpDto.fromJson(value);
|
||||
case 'SmartInfoResponseDto':
|
||||
return SmartInfoResponseDto.fromJson(value);
|
||||
case 'UpdateAlbumDto':
|
||||
return UpdateAlbumDto.fromJson(value);
|
||||
case 'UpdateDeviceInfoDto':
|
||||
return UpdateDeviceInfoDto.fromJson(value);
|
||||
case 'UpdateUserDto':
|
||||
return UpdateUserDto.fromJson(value);
|
||||
case 'UserCountResponseDto':
|
||||
return UserCountResponseDto.fromJson(value);
|
||||
case 'UserResponseDto':
|
||||
return UserResponseDto.fromJson(value);
|
||||
case 'ValidateAccessTokenResponseDto':
|
||||
return ValidateAccessTokenResponseDto.fromJson(value);
|
||||
default:
|
||||
dynamic match;
|
||||
if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) {
|
||||
return value
|
||||
.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,))
|
||||
.toList(growable: growable);
|
||||
}
|
||||
if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) {
|
||||
return value
|
||||
.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,))
|
||||
.toSet();
|
||||
}
|
||||
if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) {
|
||||
return Map<String, dynamic>.fromIterables(
|
||||
value.keys.cast<String>(),
|
||||
value.values.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,)),
|
||||
);
|
||||
}
|
||||
}
|
||||
} on Exception catch (error, trace) {
|
||||
throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,);
|
||||
}
|
||||
throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',);
|
||||
}
|
||||
}
|
||||
|
||||
/// Primarily intended for use in an isolate.
|
||||
class DeserializationMessage {
|
||||
const DeserializationMessage({
|
||||
required this.json,
|
||||
required this.targetType,
|
||||
this.growable = false,
|
||||
});
|
||||
|
||||
/// The JSON value to deserialize.
|
||||
final String json;
|
||||
|
||||
/// Target type to deserialize to.
|
||||
final String targetType;
|
||||
|
||||
/// Whether to make deserialized lists or maps growable.
|
||||
final bool growable;
|
||||
}
|
||||
|
||||
/// Primarily intended for use in an isolate.
|
||||
Future<dynamic> deserializeAsync(DeserializationMessage message) async {
|
||||
// Remove all spaces. Necessary for regular expressions as well.
|
||||
final targetType = message.targetType.replaceAll(' ', '');
|
||||
|
||||
// If the expected target type is String, nothing to do...
|
||||
return targetType == 'String'
|
||||
? message.json
|
||||
: ApiClient._deserialize(
|
||||
jsonDecode(message.json),
|
||||
targetType,
|
||||
growable: message.growable,
|
||||
);
|
||||
}
|
||||
|
||||
/// Primarily intended for use in an isolate.
|
||||
Future<String> serializeAsync(Object? value) async => value == null ? '' : json.encode(value);
|
||||
33
mobile/openapi/lib/api_exception.dart
Normal file
33
mobile/openapi/lib/api_exception.dart
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ApiException implements Exception {
|
||||
ApiException(this.code, this.message);
|
||||
|
||||
ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace);
|
||||
|
||||
int code = 0;
|
||||
String? message;
|
||||
Exception? innerException;
|
||||
StackTrace? stackTrace;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
if (message == null) {
|
||||
return 'ApiException';
|
||||
}
|
||||
if (innerException == null) {
|
||||
return 'ApiException $code: $message';
|
||||
}
|
||||
return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace';
|
||||
}
|
||||
}
|
||||
110
mobile/openapi/lib/api_helper.dart
Normal file
110
mobile/openapi/lib/api_helper.dart
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class QueryParam {
|
||||
const QueryParam(this.name, this.value);
|
||||
|
||||
final String name;
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}';
|
||||
}
|
||||
|
||||
// Ported from the Java version.
|
||||
Iterable<QueryParam> _queryParams(String collectionFormat, String name, dynamic value,) {
|
||||
// Assertions to run in debug mode only.
|
||||
assert(name.isNotEmpty, 'Parameter cannot be an empty string.');
|
||||
|
||||
final params = <QueryParam>[];
|
||||
|
||||
if (value is List) {
|
||||
if (collectionFormat == 'multi') {
|
||||
return value.map((dynamic v) => QueryParam(name, parameterToString(v)),);
|
||||
}
|
||||
|
||||
// Default collection format is 'csv'.
|
||||
if (collectionFormat.isEmpty) {
|
||||
collectionFormat = 'csv'; // ignore: parameter_assignments
|
||||
}
|
||||
|
||||
final delimiter = _delimiters[collectionFormat] ?? ',';
|
||||
|
||||
params.add(QueryParam(name, value.map<dynamic>(parameterToString).join(delimiter),));
|
||||
} else if (value != null) {
|
||||
params.add(QueryParam(name, parameterToString(value)));
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
/// Format the given parameter object into a [String].
|
||||
String parameterToString(dynamic value) {
|
||||
if (value == null) {
|
||||
return '';
|
||||
}
|
||||
if (value is DateTime) {
|
||||
return value.toUtc().toIso8601String();
|
||||
}
|
||||
if (value is AssetTypeEnum) {
|
||||
return AssetTypeEnumTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is DeleteAssetStatus) {
|
||||
return DeleteAssetStatusTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is DeviceTypeEnum) {
|
||||
return DeviceTypeEnumTypeTransformer().encode(value).toString();
|
||||
}
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json'
|
||||
/// content type. Otherwise, returns the decoded body as decoded by dart:http package.
|
||||
Future<String> _decodeBodyBytes(Response response) async {
|
||||
final contentType = response.headers['content-type'];
|
||||
return contentType != null && contentType.toLowerCase().startsWith('application/json')
|
||||
? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes)
|
||||
: response.body;
|
||||
}
|
||||
|
||||
/// Returns a valid [T] value found at the specified Map [key], null otherwise.
|
||||
T? mapValueOfType<T>(dynamic map, String key) {
|
||||
final dynamic value = map is Map ? map[key] : null;
|
||||
return value is T ? value : null;
|
||||
}
|
||||
|
||||
/// Returns a valid Map<K, V> found at the specified Map [key], null otherwise.
|
||||
Map<K, V>? mapCastOfType<K, V>(dynamic map, String key) {
|
||||
final dynamic value = map is Map ? map[key] : null;
|
||||
return value is Map ? value.cast<K, V>() : null;
|
||||
}
|
||||
|
||||
/// Returns a valid [DateTime] found at the specified Map [key], null otherwise.
|
||||
DateTime? mapDateTime(dynamic map, String key, [String? pattern]) {
|
||||
final dynamic value = map is Map ? map[key] : null;
|
||||
if (value != null) {
|
||||
int? millis;
|
||||
if (value is int) {
|
||||
millis = value;
|
||||
} else if (value is String) {
|
||||
if (pattern == _dateEpochMarker) {
|
||||
millis = int.tryParse(value);
|
||||
} else {
|
||||
return DateTime.tryParse(value);
|
||||
}
|
||||
}
|
||||
if (millis != null) {
|
||||
return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
40
mobile/openapi/lib/auth/api_key_auth.dart
Normal file
40
mobile/openapi/lib/auth/api_key_auth.dart
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ApiKeyAuth implements Authentication {
|
||||
ApiKeyAuth(this.location, this.paramName);
|
||||
|
||||
final String location;
|
||||
final String paramName;
|
||||
|
||||
String apiKeyPrefix = '';
|
||||
String apiKey = '';
|
||||
|
||||
@override
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
|
||||
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
|
||||
|
||||
if (paramValue.isNotEmpty) {
|
||||
if (location == 'query') {
|
||||
queryParams.add(QueryParam(paramName, paramValue));
|
||||
} else if (location == 'header') {
|
||||
headerParams[paramName] = paramValue;
|
||||
} else if (location == 'cookie') {
|
||||
headerParams.update(
|
||||
'Cookie',
|
||||
(existingCookie) => '$existingCookie; $paramName=$paramValue',
|
||||
ifAbsent: () => '$paramName=$paramValue',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
mobile/openapi/lib/auth/authentication.dart
Normal file
17
mobile/openapi/lib/auth/authentication.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
// ignore: one_member_abstracts
|
||||
abstract class Authentication {
|
||||
/// Apply authentication settings to header and query params.
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams);
|
||||
}
|
||||
26
mobile/openapi/lib/auth/http_basic_auth.dart
Normal file
26
mobile/openapi/lib/auth/http_basic_auth.dart
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class HttpBasicAuth implements Authentication {
|
||||
HttpBasicAuth({this.username = '', this.password = ''});
|
||||
|
||||
String username;
|
||||
String password;
|
||||
|
||||
@override
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
|
||||
if (username.isNotEmpty && password.isNotEmpty) {
|
||||
final credentials = '$username:$password';
|
||||
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
|
||||
}
|
||||
}
|
||||
}
|
||||
49
mobile/openapi/lib/auth/http_bearer_auth.dart
Normal file
49
mobile/openapi/lib/auth/http_bearer_auth.dart
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
typedef HttpBearerAuthProvider = String Function();
|
||||
|
||||
class HttpBearerAuth implements Authentication {
|
||||
HttpBearerAuth();
|
||||
|
||||
dynamic _accessToken;
|
||||
|
||||
dynamic get accessToken => _accessToken;
|
||||
|
||||
set accessToken(dynamic accessToken) {
|
||||
if (accessToken is! String && accessToken is! HttpBearerAuthProvider) {
|
||||
throw ArgumentError('accessToken value must be either a String or a String Function().');
|
||||
}
|
||||
_accessToken = accessToken;
|
||||
}
|
||||
|
||||
@override
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
|
||||
if (_accessToken == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String accessToken;
|
||||
|
||||
if (_accessToken is String) {
|
||||
accessToken = _accessToken;
|
||||
} else if (_accessToken is HttpBearerAuthProvider) {
|
||||
accessToken = _accessToken!();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (accessToken.isNotEmpty) {
|
||||
headerParams['Authorization'] = 'Bearer $accessToken';
|
||||
}
|
||||
}
|
||||
}
|
||||
24
mobile/openapi/lib/auth/oauth.dart
Normal file
24
mobile/openapi/lib/auth/oauth.dart
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class OAuth implements Authentication {
|
||||
OAuth({this.accessToken = ''});
|
||||
|
||||
String accessToken;
|
||||
|
||||
@override
|
||||
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
|
||||
if (accessToken.isNotEmpty) {
|
||||
headerParams['Authorization'] = 'Bearer $accessToken';
|
||||
}
|
||||
}
|
||||
}
|
||||
113
mobile/openapi/lib/model/add_assets_dto.dart
Normal file
113
mobile/openapi/lib/model/add_assets_dto.dart
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class AddAssetsDto {
|
||||
/// Returns a new [AddAssetsDto] instance.
|
||||
AddAssetsDto({
|
||||
this.assetIds = const [],
|
||||
});
|
||||
|
||||
List<String> assetIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AddAssetsDto &&
|
||||
other.assetIds == assetIds;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(assetIds.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AddAssetsDto[assetIds=$assetIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'assetIds'] = assetIds;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AddAssetsDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AddAssetsDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AddAssetsDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AddAssetsDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AddAssetsDto(
|
||||
assetIds: json[r'assetIds'] is List
|
||||
? (json[r'assetIds'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AddAssetsDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AddAssetsDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AddAssetsDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AddAssetsDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AddAssetsDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AddAssetsDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AddAssetsDto-objects as value to a dart map
|
||||
static Map<String, List<AddAssetsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AddAssetsDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AddAssetsDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'assetIds',
|
||||
};
|
||||
}
|
||||
|
||||
113
mobile/openapi/lib/model/add_users_dto.dart
Normal file
113
mobile/openapi/lib/model/add_users_dto.dart
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class AddUsersDto {
|
||||
/// Returns a new [AddUsersDto] instance.
|
||||
AddUsersDto({
|
||||
this.sharedUserIds = const [],
|
||||
});
|
||||
|
||||
List<String> sharedUserIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AddUsersDto &&
|
||||
other.sharedUserIds == sharedUserIds;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(sharedUserIds.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AddUsersDto[sharedUserIds=$sharedUserIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'sharedUserIds'] = sharedUserIds;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AddUsersDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AddUsersDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AddUsersDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AddUsersDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AddUsersDto(
|
||||
sharedUserIds: json[r'sharedUserIds'] is List
|
||||
? (json[r'sharedUserIds'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AddUsersDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AddUsersDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AddUsersDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AddUsersDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AddUsersDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AddUsersDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AddUsersDto-objects as value to a dart map
|
||||
static Map<String, List<AddUsersDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AddUsersDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AddUsersDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'sharedUserIds',
|
||||
};
|
||||
}
|
||||
|
||||
143
mobile/openapi/lib/model/admin_signup_response_dto.dart
Normal file
143
mobile/openapi/lib/model/admin_signup_response_dto.dart
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class AdminSignupResponseDto {
|
||||
/// Returns a new [AdminSignupResponseDto] instance.
|
||||
AdminSignupResponseDto({
|
||||
required this.id,
|
||||
required this.email,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.createdAt,
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
String email;
|
||||
|
||||
String firstName;
|
||||
|
||||
String lastName;
|
||||
|
||||
String createdAt;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AdminSignupResponseDto &&
|
||||
other.id == id &&
|
||||
other.email == email &&
|
||||
other.firstName == firstName &&
|
||||
other.lastName == lastName &&
|
||||
other.createdAt == createdAt;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(email.hashCode) +
|
||||
(firstName.hashCode) +
|
||||
(lastName.hashCode) +
|
||||
(createdAt.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AdminSignupResponseDto[id=$id, email=$email, firstName=$firstName, lastName=$lastName, createdAt=$createdAt]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
_json[r'email'] = email;
|
||||
_json[r'firstName'] = firstName;
|
||||
_json[r'lastName'] = lastName;
|
||||
_json[r'createdAt'] = createdAt;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AdminSignupResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AdminSignupResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AdminSignupResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AdminSignupResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AdminSignupResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
email: mapValueOfType<String>(json, r'email')!,
|
||||
firstName: mapValueOfType<String>(json, r'firstName')!,
|
||||
lastName: mapValueOfType<String>(json, r'lastName')!,
|
||||
createdAt: mapValueOfType<String>(json, r'createdAt')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AdminSignupResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AdminSignupResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AdminSignupResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AdminSignupResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AdminSignupResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AdminSignupResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AdminSignupResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AdminSignupResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AdminSignupResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AdminSignupResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
'email',
|
||||
'firstName',
|
||||
'lastName',
|
||||
'createdAt',
|
||||
};
|
||||
}
|
||||
|
||||
171
mobile/openapi/lib/model/album_response_dto.dart
Normal file
171
mobile/openapi/lib/model/album_response_dto.dart
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class AlbumResponseDto {
|
||||
/// Returns a new [AlbumResponseDto] instance.
|
||||
AlbumResponseDto({
|
||||
required this.id,
|
||||
required this.ownerId,
|
||||
required this.albumName,
|
||||
required this.createdAt,
|
||||
required this.albumThumbnailAssetId,
|
||||
required this.shared,
|
||||
this.sharedUsers = const [],
|
||||
this.assets = const [],
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
String ownerId;
|
||||
|
||||
String albumName;
|
||||
|
||||
String createdAt;
|
||||
|
||||
String? albumThumbnailAssetId;
|
||||
|
||||
bool shared;
|
||||
|
||||
List<UserResponseDto> sharedUsers;
|
||||
|
||||
List<AssetResponseDto> assets;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlbumResponseDto &&
|
||||
other.id == id &&
|
||||
other.ownerId == ownerId &&
|
||||
other.albumName == albumName &&
|
||||
other.createdAt == createdAt &&
|
||||
other.albumThumbnailAssetId == albumThumbnailAssetId &&
|
||||
other.shared == shared &&
|
||||
other.sharedUsers == sharedUsers &&
|
||||
other.assets == assets;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(albumName.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
|
||||
(shared.hashCode) +
|
||||
(sharedUsers.hashCode) +
|
||||
(assets.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AlbumResponseDto[id=$id, ownerId=$ownerId, albumName=$albumName, createdAt=$createdAt, albumThumbnailAssetId=$albumThumbnailAssetId, shared=$shared, sharedUsers=$sharedUsers, assets=$assets]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
_json[r'ownerId'] = ownerId;
|
||||
_json[r'albumName'] = albumName;
|
||||
_json[r'createdAt'] = createdAt;
|
||||
if (albumThumbnailAssetId != null) {
|
||||
_json[r'albumThumbnailAssetId'] = albumThumbnailAssetId;
|
||||
} else {
|
||||
_json[r'albumThumbnailAssetId'] = null;
|
||||
}
|
||||
_json[r'shared'] = shared;
|
||||
_json[r'sharedUsers'] = sharedUsers;
|
||||
_json[r'assets'] = assets;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlbumResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AlbumResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AlbumResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AlbumResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AlbumResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
albumName: mapValueOfType<String>(json, r'albumName')!,
|
||||
createdAt: mapValueOfType<String>(json, r'createdAt')!,
|
||||
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
|
||||
shared: mapValueOfType<bool>(json, r'shared')!,
|
||||
sharedUsers: UserResponseDto.listFromJson(json[r'sharedUsers'])!,
|
||||
assets: AssetResponseDto.listFromJson(json[r'assets'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlbumResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlbumResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AlbumResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AlbumResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AlbumResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AlbumResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AlbumResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AlbumResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlbumResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AlbumResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
'ownerId',
|
||||
'albumName',
|
||||
'createdAt',
|
||||
'albumThumbnailAssetId',
|
||||
'shared',
|
||||
'sharedUsers',
|
||||
'assets',
|
||||
};
|
||||
}
|
||||
|
||||
111
mobile/openapi/lib/model/asset_file_upload_response_dto.dart
Normal file
111
mobile/openapi/lib/model/asset_file_upload_response_dto.dart
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class AssetFileUploadResponseDto {
|
||||
/// Returns a new [AssetFileUploadResponseDto] instance.
|
||||
AssetFileUploadResponseDto({
|
||||
required this.id,
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetFileUploadResponseDto &&
|
||||
other.id == id;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetFileUploadResponseDto[id=$id]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetFileUploadResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetFileUploadResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AssetFileUploadResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AssetFileUploadResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AssetFileUploadResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetFileUploadResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetFileUploadResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetFileUploadResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetFileUploadResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetFileUploadResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetFileUploadResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetFileUploadResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AssetFileUploadResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetFileUploadResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetFileUploadResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
};
|
||||
}
|
||||
|
||||
265
mobile/openapi/lib/model/asset_response_dto.dart
Normal file
265
mobile/openapi/lib/model/asset_response_dto.dart
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class AssetResponseDto {
|
||||
/// Returns a new [AssetResponseDto] instance.
|
||||
AssetResponseDto({
|
||||
required this.type,
|
||||
required this.id,
|
||||
required this.deviceAssetId,
|
||||
required this.ownerId,
|
||||
required this.deviceId,
|
||||
required this.originalPath,
|
||||
required this.resizePath,
|
||||
required this.createdAt,
|
||||
required this.modifiedAt,
|
||||
required this.isFavorite,
|
||||
required this.mimeType,
|
||||
required this.duration,
|
||||
required this.webpPath,
|
||||
required this.encodedVideoPath,
|
||||
this.exifInfo,
|
||||
this.smartInfo,
|
||||
});
|
||||
|
||||
AssetTypeEnum type;
|
||||
|
||||
String id;
|
||||
|
||||
String deviceAssetId;
|
||||
|
||||
String ownerId;
|
||||
|
||||
String deviceId;
|
||||
|
||||
String originalPath;
|
||||
|
||||
String? resizePath;
|
||||
|
||||
String createdAt;
|
||||
|
||||
String modifiedAt;
|
||||
|
||||
bool isFavorite;
|
||||
|
||||
String? mimeType;
|
||||
|
||||
String duration;
|
||||
|
||||
String? webpPath;
|
||||
|
||||
String? encodedVideoPath;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
ExifResponseDto? exifInfo;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
SmartInfoResponseDto? smartInfo;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetResponseDto &&
|
||||
other.type == type &&
|
||||
other.id == id &&
|
||||
other.deviceAssetId == deviceAssetId &&
|
||||
other.ownerId == ownerId &&
|
||||
other.deviceId == deviceId &&
|
||||
other.originalPath == originalPath &&
|
||||
other.resizePath == resizePath &&
|
||||
other.createdAt == createdAt &&
|
||||
other.modifiedAt == modifiedAt &&
|
||||
other.isFavorite == isFavorite &&
|
||||
other.mimeType == mimeType &&
|
||||
other.duration == duration &&
|
||||
other.webpPath == webpPath &&
|
||||
other.encodedVideoPath == encodedVideoPath &&
|
||||
other.exifInfo == exifInfo &&
|
||||
other.smartInfo == smartInfo;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(type.hashCode) +
|
||||
(id.hashCode) +
|
||||
(deviceAssetId.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(deviceId.hashCode) +
|
||||
(originalPath.hashCode) +
|
||||
(resizePath == null ? 0 : resizePath!.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(modifiedAt.hashCode) +
|
||||
(isFavorite.hashCode) +
|
||||
(mimeType == null ? 0 : mimeType!.hashCode) +
|
||||
(duration.hashCode) +
|
||||
(webpPath == null ? 0 : webpPath!.hashCode) +
|
||||
(encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) +
|
||||
(exifInfo == null ? 0 : exifInfo!.hashCode) +
|
||||
(smartInfo == null ? 0 : smartInfo!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, createdAt=$createdAt, modifiedAt=$modifiedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'type'] = type;
|
||||
_json[r'id'] = id;
|
||||
_json[r'deviceAssetId'] = deviceAssetId;
|
||||
_json[r'ownerId'] = ownerId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
_json[r'originalPath'] = originalPath;
|
||||
if (resizePath != null) {
|
||||
_json[r'resizePath'] = resizePath;
|
||||
} else {
|
||||
_json[r'resizePath'] = null;
|
||||
}
|
||||
_json[r'createdAt'] = createdAt;
|
||||
_json[r'modifiedAt'] = modifiedAt;
|
||||
_json[r'isFavorite'] = isFavorite;
|
||||
if (mimeType != null) {
|
||||
_json[r'mimeType'] = mimeType;
|
||||
} else {
|
||||
_json[r'mimeType'] = null;
|
||||
}
|
||||
_json[r'duration'] = duration;
|
||||
if (webpPath != null) {
|
||||
_json[r'webpPath'] = webpPath;
|
||||
} else {
|
||||
_json[r'webpPath'] = null;
|
||||
}
|
||||
if (encodedVideoPath != null) {
|
||||
_json[r'encodedVideoPath'] = encodedVideoPath;
|
||||
} else {
|
||||
_json[r'encodedVideoPath'] = null;
|
||||
}
|
||||
if (exifInfo != null) {
|
||||
_json[r'exifInfo'] = exifInfo;
|
||||
} else {
|
||||
_json[r'exifInfo'] = null;
|
||||
}
|
||||
if (smartInfo != null) {
|
||||
_json[r'smartInfo'] = smartInfo;
|
||||
} else {
|
||||
_json[r'smartInfo'] = null;
|
||||
}
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AssetResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AssetResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AssetResponseDto(
|
||||
type: AssetTypeEnum.fromJson(json[r'type'])!,
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
deviceAssetId: mapValueOfType<String>(json, r'deviceAssetId')!,
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
originalPath: mapValueOfType<String>(json, r'originalPath')!,
|
||||
resizePath: mapValueOfType<String>(json, r'resizePath'),
|
||||
createdAt: mapValueOfType<String>(json, r'createdAt')!,
|
||||
modifiedAt: mapValueOfType<String>(json, r'modifiedAt')!,
|
||||
isFavorite: mapValueOfType<bool>(json, r'isFavorite')!,
|
||||
mimeType: mapValueOfType<String>(json, r'mimeType'),
|
||||
duration: mapValueOfType<String>(json, r'duration')!,
|
||||
webpPath: mapValueOfType<String>(json, r'webpPath'),
|
||||
encodedVideoPath: mapValueOfType<String>(json, r'encodedVideoPath'),
|
||||
exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']),
|
||||
smartInfo: SmartInfoResponseDto.fromJson(json[r'smartInfo']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AssetResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'type',
|
||||
'id',
|
||||
'deviceAssetId',
|
||||
'ownerId',
|
||||
'deviceId',
|
||||
'originalPath',
|
||||
'resizePath',
|
||||
'createdAt',
|
||||
'modifiedAt',
|
||||
'isFavorite',
|
||||
'mimeType',
|
||||
'duration',
|
||||
'webpPath',
|
||||
'encodedVideoPath',
|
||||
};
|
||||
}
|
||||
|
||||
91
mobile/openapi/lib/model/asset_type_enum.dart
Normal file
91
mobile/openapi/lib/model/asset_type_enum.dart
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class AssetTypeEnum {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const AssetTypeEnum._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const IMAGE = AssetTypeEnum._(r'IMAGE');
|
||||
static const VIDEO = AssetTypeEnum._(r'VIDEO');
|
||||
static const AUDIO = AssetTypeEnum._(r'AUDIO');
|
||||
static const OTHER = AssetTypeEnum._(r'OTHER');
|
||||
|
||||
/// List of all possible values in this [enum][AssetTypeEnum].
|
||||
static const values = <AssetTypeEnum>[
|
||||
IMAGE,
|
||||
VIDEO,
|
||||
AUDIO,
|
||||
OTHER,
|
||||
];
|
||||
|
||||
static AssetTypeEnum? fromJson(dynamic value) => AssetTypeEnumTypeTransformer().decode(value);
|
||||
|
||||
static List<AssetTypeEnum>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetTypeEnum>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetTypeEnum.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [AssetTypeEnum] to String,
|
||||
/// and [decode] dynamic data back to [AssetTypeEnum].
|
||||
class AssetTypeEnumTypeTransformer {
|
||||
factory AssetTypeEnumTypeTransformer() => _instance ??= const AssetTypeEnumTypeTransformer._();
|
||||
|
||||
const AssetTypeEnumTypeTransformer._();
|
||||
|
||||
String encode(AssetTypeEnum data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a AssetTypeEnum.
|
||||
///
|
||||
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||
///
|
||||
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||
/// and users are still using an old app with the old code.
|
||||
AssetTypeEnum? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
case r'IMAGE': return AssetTypeEnum.IMAGE;
|
||||
case r'VIDEO': return AssetTypeEnum.VIDEO;
|
||||
case r'AUDIO': return AssetTypeEnum.AUDIO;
|
||||
case r'OTHER': return AssetTypeEnum.OTHER;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [AssetTypeEnumTypeTransformer] instance.
|
||||
static AssetTypeEnumTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
119
mobile/openapi/lib/model/check_duplicate_asset_dto.dart
Normal file
119
mobile/openapi/lib/model/check_duplicate_asset_dto.dart
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CheckDuplicateAssetDto {
|
||||
/// Returns a new [CheckDuplicateAssetDto] instance.
|
||||
CheckDuplicateAssetDto({
|
||||
required this.deviceAssetId,
|
||||
required this.deviceId,
|
||||
});
|
||||
|
||||
String deviceAssetId;
|
||||
|
||||
String deviceId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CheckDuplicateAssetDto &&
|
||||
other.deviceAssetId == deviceAssetId &&
|
||||
other.deviceId == deviceId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(deviceAssetId.hashCode) +
|
||||
(deviceId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CheckDuplicateAssetDto[deviceAssetId=$deviceAssetId, deviceId=$deviceId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'deviceAssetId'] = deviceAssetId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CheckDuplicateAssetDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CheckDuplicateAssetDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CheckDuplicateAssetDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CheckDuplicateAssetDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CheckDuplicateAssetDto(
|
||||
deviceAssetId: mapValueOfType<String>(json, r'deviceAssetId')!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CheckDuplicateAssetDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CheckDuplicateAssetDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CheckDuplicateAssetDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CheckDuplicateAssetDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CheckDuplicateAssetDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CheckDuplicateAssetDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CheckDuplicateAssetDto-objects as value to a dart map
|
||||
static Map<String, List<CheckDuplicateAssetDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CheckDuplicateAssetDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CheckDuplicateAssetDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'deviceAssetId',
|
||||
'deviceId',
|
||||
};
|
||||
}
|
||||
|
||||
111
mobile/openapi/lib/model/check_duplicate_asset_response_dto.dart
Normal file
111
mobile/openapi/lib/model/check_duplicate_asset_response_dto.dart
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CheckDuplicateAssetResponseDto {
|
||||
/// Returns a new [CheckDuplicateAssetResponseDto] instance.
|
||||
CheckDuplicateAssetResponseDto({
|
||||
required this.isExist,
|
||||
});
|
||||
|
||||
bool isExist;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CheckDuplicateAssetResponseDto &&
|
||||
other.isExist == isExist;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(isExist.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CheckDuplicateAssetResponseDto[isExist=$isExist]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'isExist'] = isExist;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CheckDuplicateAssetResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CheckDuplicateAssetResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CheckDuplicateAssetResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CheckDuplicateAssetResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CheckDuplicateAssetResponseDto(
|
||||
isExist: mapValueOfType<bool>(json, r'isExist')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CheckDuplicateAssetResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CheckDuplicateAssetResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CheckDuplicateAssetResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CheckDuplicateAssetResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CheckDuplicateAssetResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CheckDuplicateAssetResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CheckDuplicateAssetResponseDto-objects as value to a dart map
|
||||
static Map<String, List<CheckDuplicateAssetResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CheckDuplicateAssetResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CheckDuplicateAssetResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'isExist',
|
||||
};
|
||||
}
|
||||
|
||||
129
mobile/openapi/lib/model/create_album_dto.dart
Normal file
129
mobile/openapi/lib/model/create_album_dto.dart
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CreateAlbumDto {
|
||||
/// Returns a new [CreateAlbumDto] instance.
|
||||
CreateAlbumDto({
|
||||
required this.albumName,
|
||||
this.sharedWithUserIds = const [],
|
||||
this.assetIds = const [],
|
||||
});
|
||||
|
||||
String albumName;
|
||||
|
||||
List<String> sharedWithUserIds;
|
||||
|
||||
List<String> assetIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CreateAlbumDto &&
|
||||
other.albumName == albumName &&
|
||||
other.sharedWithUserIds == sharedWithUserIds &&
|
||||
other.assetIds == assetIds;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(albumName.hashCode) +
|
||||
(sharedWithUserIds.hashCode) +
|
||||
(assetIds.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateAlbumDto[albumName=$albumName, sharedWithUserIds=$sharedWithUserIds, assetIds=$assetIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'albumName'] = albumName;
|
||||
_json[r'sharedWithUserIds'] = sharedWithUserIds;
|
||||
_json[r'assetIds'] = assetIds;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateAlbumDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CreateAlbumDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CreateAlbumDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CreateAlbumDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CreateAlbumDto(
|
||||
albumName: mapValueOfType<String>(json, r'albumName')!,
|
||||
sharedWithUserIds: json[r'sharedWithUserIds'] is List
|
||||
? (json[r'sharedWithUserIds'] as List).cast<String>()
|
||||
: const [],
|
||||
assetIds: json[r'assetIds'] is List
|
||||
? (json[r'assetIds'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateAlbumDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateAlbumDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CreateAlbumDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CreateAlbumDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CreateAlbumDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateAlbumDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CreateAlbumDto-objects as value to a dart map
|
||||
static Map<String, List<CreateAlbumDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateAlbumDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateAlbumDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'albumName',
|
||||
};
|
||||
}
|
||||
|
||||
136
mobile/openapi/lib/model/create_device_info_dto.dart
Normal file
136
mobile/openapi/lib/model/create_device_info_dto.dart
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CreateDeviceInfoDto {
|
||||
/// Returns a new [CreateDeviceInfoDto] instance.
|
||||
CreateDeviceInfoDto({
|
||||
required this.deviceType,
|
||||
required this.deviceId,
|
||||
this.isAutoBackup,
|
||||
});
|
||||
|
||||
DeviceTypeEnum deviceType;
|
||||
|
||||
String deviceId;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? isAutoBackup;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CreateDeviceInfoDto &&
|
||||
other.deviceType == deviceType &&
|
||||
other.deviceId == deviceId &&
|
||||
other.isAutoBackup == isAutoBackup;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(deviceType.hashCode) +
|
||||
(deviceId.hashCode) +
|
||||
(isAutoBackup == null ? 0 : isAutoBackup!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateDeviceInfoDto[deviceType=$deviceType, deviceId=$deviceId, isAutoBackup=$isAutoBackup]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'deviceType'] = deviceType;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
if (isAutoBackup != null) {
|
||||
_json[r'isAutoBackup'] = isAutoBackup;
|
||||
} else {
|
||||
_json[r'isAutoBackup'] = null;
|
||||
}
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateDeviceInfoDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CreateDeviceInfoDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CreateDeviceInfoDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CreateDeviceInfoDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CreateDeviceInfoDto(
|
||||
deviceType: DeviceTypeEnum.fromJson(json[r'deviceType'])!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
isAutoBackup: mapValueOfType<bool>(json, r'isAutoBackup'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateDeviceInfoDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateDeviceInfoDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CreateDeviceInfoDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CreateDeviceInfoDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CreateDeviceInfoDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateDeviceInfoDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CreateDeviceInfoDto-objects as value to a dart map
|
||||
static Map<String, List<CreateDeviceInfoDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateDeviceInfoDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateDeviceInfoDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'deviceType',
|
||||
'deviceId',
|
||||
};
|
||||
}
|
||||
|
||||
119
mobile/openapi/lib/model/create_profile_image_response_dto.dart
Normal file
119
mobile/openapi/lib/model/create_profile_image_response_dto.dart
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CreateProfileImageResponseDto {
|
||||
/// Returns a new [CreateProfileImageResponseDto] instance.
|
||||
CreateProfileImageResponseDto({
|
||||
required this.userId,
|
||||
required this.profileImagePath,
|
||||
});
|
||||
|
||||
String userId;
|
||||
|
||||
String profileImagePath;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CreateProfileImageResponseDto &&
|
||||
other.userId == userId &&
|
||||
other.profileImagePath == profileImagePath;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(userId.hashCode) +
|
||||
(profileImagePath.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateProfileImageResponseDto[userId=$userId, profileImagePath=$profileImagePath]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'userId'] = userId;
|
||||
_json[r'profileImagePath'] = profileImagePath;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateProfileImageResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CreateProfileImageResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CreateProfileImageResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CreateProfileImageResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CreateProfileImageResponseDto(
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateProfileImageResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateProfileImageResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CreateProfileImageResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CreateProfileImageResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CreateProfileImageResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateProfileImageResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CreateProfileImageResponseDto-objects as value to a dart map
|
||||
static Map<String, List<CreateProfileImageResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateProfileImageResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateProfileImageResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'userId',
|
||||
'profileImagePath',
|
||||
};
|
||||
}
|
||||
|
||||
135
mobile/openapi/lib/model/create_user_dto.dart
Normal file
135
mobile/openapi/lib/model/create_user_dto.dart
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CreateUserDto {
|
||||
/// Returns a new [CreateUserDto] instance.
|
||||
CreateUserDto({
|
||||
required this.email,
|
||||
required this.password,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
});
|
||||
|
||||
String email;
|
||||
|
||||
String password;
|
||||
|
||||
String firstName;
|
||||
|
||||
String lastName;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CreateUserDto &&
|
||||
other.email == email &&
|
||||
other.password == password &&
|
||||
other.firstName == firstName &&
|
||||
other.lastName == lastName;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(email.hashCode) +
|
||||
(password.hashCode) +
|
||||
(firstName.hashCode) +
|
||||
(lastName.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateUserDto[email=$email, password=$password, firstName=$firstName, lastName=$lastName]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'email'] = email;
|
||||
_json[r'password'] = password;
|
||||
_json[r'firstName'] = firstName;
|
||||
_json[r'lastName'] = lastName;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateUserDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CreateUserDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CreateUserDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CreateUserDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CreateUserDto(
|
||||
email: mapValueOfType<String>(json, r'email')!,
|
||||
password: mapValueOfType<String>(json, r'password')!,
|
||||
firstName: mapValueOfType<String>(json, r'firstName')!,
|
||||
lastName: mapValueOfType<String>(json, r'lastName')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateUserDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateUserDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CreateUserDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CreateUserDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CreateUserDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateUserDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CreateUserDto-objects as value to a dart map
|
||||
static Map<String, List<CreateUserDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateUserDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateUserDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'email',
|
||||
'password',
|
||||
'firstName',
|
||||
'lastName',
|
||||
};
|
||||
}
|
||||
|
||||
143
mobile/openapi/lib/model/curated_locations_response_dto.dart
Normal file
143
mobile/openapi/lib/model/curated_locations_response_dto.dart
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CuratedLocationsResponseDto {
|
||||
/// Returns a new [CuratedLocationsResponseDto] instance.
|
||||
CuratedLocationsResponseDto({
|
||||
required this.id,
|
||||
required this.city,
|
||||
required this.resizePath,
|
||||
required this.deviceAssetId,
|
||||
required this.deviceId,
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
String city;
|
||||
|
||||
String resizePath;
|
||||
|
||||
String deviceAssetId;
|
||||
|
||||
String deviceId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CuratedLocationsResponseDto &&
|
||||
other.id == id &&
|
||||
other.city == city &&
|
||||
other.resizePath == resizePath &&
|
||||
other.deviceAssetId == deviceAssetId &&
|
||||
other.deviceId == deviceId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(city.hashCode) +
|
||||
(resizePath.hashCode) +
|
||||
(deviceAssetId.hashCode) +
|
||||
(deviceId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CuratedLocationsResponseDto[id=$id, city=$city, resizePath=$resizePath, deviceAssetId=$deviceAssetId, deviceId=$deviceId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
_json[r'city'] = city;
|
||||
_json[r'resizePath'] = resizePath;
|
||||
_json[r'deviceAssetId'] = deviceAssetId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CuratedLocationsResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CuratedLocationsResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CuratedLocationsResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CuratedLocationsResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CuratedLocationsResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
city: mapValueOfType<String>(json, r'city')!,
|
||||
resizePath: mapValueOfType<String>(json, r'resizePath')!,
|
||||
deviceAssetId: mapValueOfType<String>(json, r'deviceAssetId')!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CuratedLocationsResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CuratedLocationsResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CuratedLocationsResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CuratedLocationsResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CuratedLocationsResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CuratedLocationsResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CuratedLocationsResponseDto-objects as value to a dart map
|
||||
static Map<String, List<CuratedLocationsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CuratedLocationsResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CuratedLocationsResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
'city',
|
||||
'resizePath',
|
||||
'deviceAssetId',
|
||||
'deviceId',
|
||||
};
|
||||
}
|
||||
|
||||
143
mobile/openapi/lib/model/curated_objects_response_dto.dart
Normal file
143
mobile/openapi/lib/model/curated_objects_response_dto.dart
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class CuratedObjectsResponseDto {
|
||||
/// Returns a new [CuratedObjectsResponseDto] instance.
|
||||
CuratedObjectsResponseDto({
|
||||
required this.id,
|
||||
required this.object,
|
||||
required this.resizePath,
|
||||
required this.deviceAssetId,
|
||||
required this.deviceId,
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
String object;
|
||||
|
||||
String resizePath;
|
||||
|
||||
String deviceAssetId;
|
||||
|
||||
String deviceId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CuratedObjectsResponseDto &&
|
||||
other.id == id &&
|
||||
other.object == object &&
|
||||
other.resizePath == resizePath &&
|
||||
other.deviceAssetId == deviceAssetId &&
|
||||
other.deviceId == deviceId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(object.hashCode) +
|
||||
(resizePath.hashCode) +
|
||||
(deviceAssetId.hashCode) +
|
||||
(deviceId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CuratedObjectsResponseDto[id=$id, object=$object, resizePath=$resizePath, deviceAssetId=$deviceAssetId, deviceId=$deviceId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
_json[r'object'] = object;
|
||||
_json[r'resizePath'] = resizePath;
|
||||
_json[r'deviceAssetId'] = deviceAssetId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CuratedObjectsResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CuratedObjectsResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CuratedObjectsResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CuratedObjectsResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CuratedObjectsResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
object: mapValueOfType<String>(json, r'object')!,
|
||||
resizePath: mapValueOfType<String>(json, r'resizePath')!,
|
||||
deviceAssetId: mapValueOfType<String>(json, r'deviceAssetId')!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CuratedObjectsResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CuratedObjectsResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CuratedObjectsResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CuratedObjectsResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CuratedObjectsResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CuratedObjectsResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CuratedObjectsResponseDto-objects as value to a dart map
|
||||
static Map<String, List<CuratedObjectsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CuratedObjectsResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CuratedObjectsResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
'object',
|
||||
'resizePath',
|
||||
'deviceAssetId',
|
||||
'deviceId',
|
||||
};
|
||||
}
|
||||
|
||||
113
mobile/openapi/lib/model/delete_asset_dto.dart
Normal file
113
mobile/openapi/lib/model/delete_asset_dto.dart
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class DeleteAssetDto {
|
||||
/// Returns a new [DeleteAssetDto] instance.
|
||||
DeleteAssetDto({
|
||||
this.ids = const [],
|
||||
});
|
||||
|
||||
List<String> ids;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is DeleteAssetDto &&
|
||||
other.ids == ids;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(ids.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'DeleteAssetDto[ids=$ids]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'ids'] = ids;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeleteAssetDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static DeleteAssetDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "DeleteAssetDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "DeleteAssetDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return DeleteAssetDto(
|
||||
ids: json[r'ids'] is List
|
||||
? (json[r'ids'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeleteAssetDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeleteAssetDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = DeleteAssetDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, DeleteAssetDto> mapFromJson(dynamic json) {
|
||||
final map = <String, DeleteAssetDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = DeleteAssetDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of DeleteAssetDto-objects as value to a dart map
|
||||
static Map<String, List<DeleteAssetDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeleteAssetDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = DeleteAssetDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'ids',
|
||||
};
|
||||
}
|
||||
|
||||
119
mobile/openapi/lib/model/delete_asset_response_dto.dart
Normal file
119
mobile/openapi/lib/model/delete_asset_response_dto.dart
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class DeleteAssetResponseDto {
|
||||
/// Returns a new [DeleteAssetResponseDto] instance.
|
||||
DeleteAssetResponseDto({
|
||||
required this.status,
|
||||
required this.id,
|
||||
});
|
||||
|
||||
DeleteAssetStatus status;
|
||||
|
||||
String id;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is DeleteAssetResponseDto &&
|
||||
other.status == status &&
|
||||
other.id == id;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(status.hashCode) +
|
||||
(id.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'DeleteAssetResponseDto[status=$status, id=$id]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'status'] = status;
|
||||
_json[r'id'] = id;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeleteAssetResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static DeleteAssetResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "DeleteAssetResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "DeleteAssetResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return DeleteAssetResponseDto(
|
||||
status: DeleteAssetStatus.fromJson(json[r'status'])!,
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeleteAssetResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeleteAssetResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = DeleteAssetResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, DeleteAssetResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, DeleteAssetResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = DeleteAssetResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of DeleteAssetResponseDto-objects as value to a dart map
|
||||
static Map<String, List<DeleteAssetResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeleteAssetResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = DeleteAssetResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'status',
|
||||
'id',
|
||||
};
|
||||
}
|
||||
|
||||
85
mobile/openapi/lib/model/delete_asset_status.dart
Normal file
85
mobile/openapi/lib/model/delete_asset_status.dart
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class DeleteAssetStatus {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const DeleteAssetStatus._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const SUCCESS = DeleteAssetStatus._(r'SUCCESS');
|
||||
static const FAILED = DeleteAssetStatus._(r'FAILED');
|
||||
|
||||
/// List of all possible values in this [enum][DeleteAssetStatus].
|
||||
static const values = <DeleteAssetStatus>[
|
||||
SUCCESS,
|
||||
FAILED,
|
||||
];
|
||||
|
||||
static DeleteAssetStatus? fromJson(dynamic value) => DeleteAssetStatusTypeTransformer().decode(value);
|
||||
|
||||
static List<DeleteAssetStatus>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeleteAssetStatus>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = DeleteAssetStatus.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [DeleteAssetStatus] to String,
|
||||
/// and [decode] dynamic data back to [DeleteAssetStatus].
|
||||
class DeleteAssetStatusTypeTransformer {
|
||||
factory DeleteAssetStatusTypeTransformer() => _instance ??= const DeleteAssetStatusTypeTransformer._();
|
||||
|
||||
const DeleteAssetStatusTypeTransformer._();
|
||||
|
||||
String encode(DeleteAssetStatus data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a DeleteAssetStatus.
|
||||
///
|
||||
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||
///
|
||||
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||
/// and users are still using an old app with the old code.
|
||||
DeleteAssetStatus? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
case r'SUCCESS': return DeleteAssetStatus.SUCCESS;
|
||||
case r'FAILED': return DeleteAssetStatus.FAILED;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [DeleteAssetStatusTypeTransformer] instance.
|
||||
static DeleteAssetStatusTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
151
mobile/openapi/lib/model/device_info_response_dto.dart
Normal file
151
mobile/openapi/lib/model/device_info_response_dto.dart
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class DeviceInfoResponseDto {
|
||||
/// Returns a new [DeviceInfoResponseDto] instance.
|
||||
DeviceInfoResponseDto({
|
||||
required this.id,
|
||||
required this.deviceType,
|
||||
required this.userId,
|
||||
required this.deviceId,
|
||||
required this.createdAt,
|
||||
required this.isAutoBackup,
|
||||
});
|
||||
|
||||
int id;
|
||||
|
||||
DeviceTypeEnum deviceType;
|
||||
|
||||
String userId;
|
||||
|
||||
String deviceId;
|
||||
|
||||
String createdAt;
|
||||
|
||||
bool isAutoBackup;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is DeviceInfoResponseDto &&
|
||||
other.id == id &&
|
||||
other.deviceType == deviceType &&
|
||||
other.userId == userId &&
|
||||
other.deviceId == deviceId &&
|
||||
other.createdAt == createdAt &&
|
||||
other.isAutoBackup == isAutoBackup;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(deviceType.hashCode) +
|
||||
(userId.hashCode) +
|
||||
(deviceId.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(isAutoBackup.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'DeviceInfoResponseDto[id=$id, deviceType=$deviceType, userId=$userId, deviceId=$deviceId, createdAt=$createdAt, isAutoBackup=$isAutoBackup]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
_json[r'deviceType'] = deviceType;
|
||||
_json[r'userId'] = userId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
_json[r'createdAt'] = createdAt;
|
||||
_json[r'isAutoBackup'] = isAutoBackup;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [DeviceInfoResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static DeviceInfoResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "DeviceInfoResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "DeviceInfoResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return DeviceInfoResponseDto(
|
||||
id: mapValueOfType<int>(json, r'id')!,
|
||||
deviceType: DeviceTypeEnum.fromJson(json[r'deviceType'])!,
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
createdAt: mapValueOfType<String>(json, r'createdAt')!,
|
||||
isAutoBackup: mapValueOfType<bool>(json, r'isAutoBackup')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<DeviceInfoResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceInfoResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = DeviceInfoResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, DeviceInfoResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, DeviceInfoResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = DeviceInfoResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of DeviceInfoResponseDto-objects as value to a dart map
|
||||
static Map<String, List<DeviceInfoResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<DeviceInfoResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = DeviceInfoResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
'deviceType',
|
||||
'userId',
|
||||
'deviceId',
|
||||
'createdAt',
|
||||
'isAutoBackup',
|
||||
};
|
||||
}
|
||||
|
||||
88
mobile/openapi/lib/model/device_type_enum.dart
Normal file
88
mobile/openapi/lib/model/device_type_enum.dart
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
class DeviceTypeEnum {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const DeviceTypeEnum._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const IOS = DeviceTypeEnum._(r'IOS');
|
||||
static const ANDROID = DeviceTypeEnum._(r'ANDROID');
|
||||
static const WEB = DeviceTypeEnum._(r'WEB');
|
||||
|
||||
/// List of all possible values in this [enum][DeviceTypeEnum].
|
||||
static const values = <DeviceTypeEnum>[
|
||||
IOS,
|
||||
ANDROID,
|
||||
WEB,
|
||||
];
|
||||
|
||||
static DeviceTypeEnum? fromJson(dynamic value) => DeviceTypeEnumTypeTransformer().decode(value);
|
||||
|
||||
static List<DeviceTypeEnum>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <DeviceTypeEnum>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = DeviceTypeEnum.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [DeviceTypeEnum] to String,
|
||||
/// and [decode] dynamic data back to [DeviceTypeEnum].
|
||||
class DeviceTypeEnumTypeTransformer {
|
||||
factory DeviceTypeEnumTypeTransformer() => _instance ??= const DeviceTypeEnumTypeTransformer._();
|
||||
|
||||
const DeviceTypeEnumTypeTransformer._();
|
||||
|
||||
String encode(DeviceTypeEnum data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a DeviceTypeEnum.
|
||||
///
|
||||
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||
///
|
||||
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||
/// and users are still using an old app with the old code.
|
||||
DeviceTypeEnum? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
case r'IOS': return DeviceTypeEnum.IOS;
|
||||
case r'ANDROID': return DeviceTypeEnum.ANDROID;
|
||||
case r'WEB': return DeviceTypeEnum.WEB;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [DeviceTypeEnumTypeTransformer] instance.
|
||||
static DeviceTypeEnumTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
341
mobile/openapi/lib/model/exif_response_dto.dart
Normal file
341
mobile/openapi/lib/model/exif_response_dto.dart
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ExifResponseDto {
|
||||
/// Returns a new [ExifResponseDto] instance.
|
||||
ExifResponseDto({
|
||||
this.id,
|
||||
this.make,
|
||||
this.model,
|
||||
this.imageName,
|
||||
this.exifImageWidth,
|
||||
this.exifImageHeight,
|
||||
this.fileSizeInByte,
|
||||
this.orientation,
|
||||
this.dateTimeOriginal,
|
||||
this.modifyDate,
|
||||
this.lensModel,
|
||||
this.fNumber,
|
||||
this.focalLength,
|
||||
this.iso,
|
||||
this.exposureTime,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.city,
|
||||
this.state,
|
||||
this.country,
|
||||
});
|
||||
|
||||
String? id;
|
||||
|
||||
String? make;
|
||||
|
||||
String? model;
|
||||
|
||||
String? imageName;
|
||||
|
||||
num? exifImageWidth;
|
||||
|
||||
num? exifImageHeight;
|
||||
|
||||
num? fileSizeInByte;
|
||||
|
||||
String? orientation;
|
||||
|
||||
DateTime? dateTimeOriginal;
|
||||
|
||||
DateTime? modifyDate;
|
||||
|
||||
String? lensModel;
|
||||
|
||||
num? fNumber;
|
||||
|
||||
num? focalLength;
|
||||
|
||||
num? iso;
|
||||
|
||||
num? exposureTime;
|
||||
|
||||
num? latitude;
|
||||
|
||||
num? longitude;
|
||||
|
||||
String? city;
|
||||
|
||||
String? state;
|
||||
|
||||
String? country;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto &&
|
||||
other.id == id &&
|
||||
other.make == make &&
|
||||
other.model == model &&
|
||||
other.imageName == imageName &&
|
||||
other.exifImageWidth == exifImageWidth &&
|
||||
other.exifImageHeight == exifImageHeight &&
|
||||
other.fileSizeInByte == fileSizeInByte &&
|
||||
other.orientation == orientation &&
|
||||
other.dateTimeOriginal == dateTimeOriginal &&
|
||||
other.modifyDate == modifyDate &&
|
||||
other.lensModel == lensModel &&
|
||||
other.fNumber == fNumber &&
|
||||
other.focalLength == focalLength &&
|
||||
other.iso == iso &&
|
||||
other.exposureTime == exposureTime &&
|
||||
other.latitude == latitude &&
|
||||
other.longitude == longitude &&
|
||||
other.city == city &&
|
||||
other.state == state &&
|
||||
other.country == country;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id == null ? 0 : id!.hashCode) +
|
||||
(make == null ? 0 : make!.hashCode) +
|
||||
(model == null ? 0 : model!.hashCode) +
|
||||
(imageName == null ? 0 : imageName!.hashCode) +
|
||||
(exifImageWidth == null ? 0 : exifImageWidth!.hashCode) +
|
||||
(exifImageHeight == null ? 0 : exifImageHeight!.hashCode) +
|
||||
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
|
||||
(orientation == null ? 0 : orientation!.hashCode) +
|
||||
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
|
||||
(modifyDate == null ? 0 : modifyDate!.hashCode) +
|
||||
(lensModel == null ? 0 : lensModel!.hashCode) +
|
||||
(fNumber == null ? 0 : fNumber!.hashCode) +
|
||||
(focalLength == null ? 0 : focalLength!.hashCode) +
|
||||
(iso == null ? 0 : iso!.hashCode) +
|
||||
(exposureTime == null ? 0 : exposureTime!.hashCode) +
|
||||
(latitude == null ? 0 : latitude!.hashCode) +
|
||||
(longitude == null ? 0 : longitude!.hashCode) +
|
||||
(city == null ? 0 : city!.hashCode) +
|
||||
(state == null ? 0 : state!.hashCode) +
|
||||
(country == null ? 0 : country!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ExifResponseDto[id=$id, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, fileSizeInByte=$fileSizeInByte, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
} else {
|
||||
_json[r'id'] = null;
|
||||
}
|
||||
if (make != null) {
|
||||
_json[r'make'] = make;
|
||||
} else {
|
||||
_json[r'make'] = null;
|
||||
}
|
||||
if (model != null) {
|
||||
_json[r'model'] = model;
|
||||
} else {
|
||||
_json[r'model'] = null;
|
||||
}
|
||||
if (imageName != null) {
|
||||
_json[r'imageName'] = imageName;
|
||||
} else {
|
||||
_json[r'imageName'] = null;
|
||||
}
|
||||
if (exifImageWidth != null) {
|
||||
_json[r'exifImageWidth'] = exifImageWidth;
|
||||
} else {
|
||||
_json[r'exifImageWidth'] = null;
|
||||
}
|
||||
if (exifImageHeight != null) {
|
||||
_json[r'exifImageHeight'] = exifImageHeight;
|
||||
} else {
|
||||
_json[r'exifImageHeight'] = null;
|
||||
}
|
||||
if (fileSizeInByte != null) {
|
||||
_json[r'fileSizeInByte'] = fileSizeInByte;
|
||||
} else {
|
||||
_json[r'fileSizeInByte'] = null;
|
||||
}
|
||||
if (orientation != null) {
|
||||
_json[r'orientation'] = orientation;
|
||||
} else {
|
||||
_json[r'orientation'] = null;
|
||||
}
|
||||
if (dateTimeOriginal != null) {
|
||||
_json[r'dateTimeOriginal'] = dateTimeOriginal!.toUtc().toIso8601String();
|
||||
} else {
|
||||
_json[r'dateTimeOriginal'] = null;
|
||||
}
|
||||
if (modifyDate != null) {
|
||||
_json[r'modifyDate'] = modifyDate!.toUtc().toIso8601String();
|
||||
} else {
|
||||
_json[r'modifyDate'] = null;
|
||||
}
|
||||
if (lensModel != null) {
|
||||
_json[r'lensModel'] = lensModel;
|
||||
} else {
|
||||
_json[r'lensModel'] = null;
|
||||
}
|
||||
if (fNumber != null) {
|
||||
_json[r'fNumber'] = fNumber;
|
||||
} else {
|
||||
_json[r'fNumber'] = null;
|
||||
}
|
||||
if (focalLength != null) {
|
||||
_json[r'focalLength'] = focalLength;
|
||||
} else {
|
||||
_json[r'focalLength'] = null;
|
||||
}
|
||||
if (iso != null) {
|
||||
_json[r'iso'] = iso;
|
||||
} else {
|
||||
_json[r'iso'] = null;
|
||||
}
|
||||
if (exposureTime != null) {
|
||||
_json[r'exposureTime'] = exposureTime;
|
||||
} else {
|
||||
_json[r'exposureTime'] = null;
|
||||
}
|
||||
if (latitude != null) {
|
||||
_json[r'latitude'] = latitude;
|
||||
} else {
|
||||
_json[r'latitude'] = null;
|
||||
}
|
||||
if (longitude != null) {
|
||||
_json[r'longitude'] = longitude;
|
||||
} else {
|
||||
_json[r'longitude'] = null;
|
||||
}
|
||||
if (city != null) {
|
||||
_json[r'city'] = city;
|
||||
} else {
|
||||
_json[r'city'] = null;
|
||||
}
|
||||
if (state != null) {
|
||||
_json[r'state'] = state;
|
||||
} else {
|
||||
_json[r'state'] = null;
|
||||
}
|
||||
if (country != null) {
|
||||
_json[r'country'] = country;
|
||||
} else {
|
||||
_json[r'country'] = null;
|
||||
}
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [ExifResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ExifResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "ExifResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "ExifResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return ExifResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
make: mapValueOfType<String>(json, r'make'),
|
||||
model: mapValueOfType<String>(json, r'model'),
|
||||
imageName: mapValueOfType<String>(json, r'imageName'),
|
||||
exifImageWidth: json[r'exifImageWidth'] == null
|
||||
? null
|
||||
: num.parse(json[r'exifImageWidth'].toString()),
|
||||
exifImageHeight: json[r'exifImageHeight'] == null
|
||||
? null
|
||||
: num.parse(json[r'exifImageHeight'].toString()),
|
||||
fileSizeInByte: json[r'fileSizeInByte'] == null
|
||||
? null
|
||||
: num.parse(json[r'fileSizeInByte'].toString()),
|
||||
orientation: mapValueOfType<String>(json, r'orientation'),
|
||||
dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', ''),
|
||||
modifyDate: mapDateTime(json, r'modifyDate', ''),
|
||||
lensModel: mapValueOfType<String>(json, r'lensModel'),
|
||||
fNumber: json[r'fNumber'] == null
|
||||
? null
|
||||
: num.parse(json[r'fNumber'].toString()),
|
||||
focalLength: json[r'focalLength'] == null
|
||||
? null
|
||||
: num.parse(json[r'focalLength'].toString()),
|
||||
iso: json[r'iso'] == null
|
||||
? null
|
||||
: num.parse(json[r'iso'].toString()),
|
||||
exposureTime: json[r'exposureTime'] == null
|
||||
? null
|
||||
: num.parse(json[r'exposureTime'].toString()),
|
||||
latitude: json[r'latitude'] == null
|
||||
? null
|
||||
: num.parse(json[r'latitude'].toString()),
|
||||
longitude: json[r'longitude'] == null
|
||||
? null
|
||||
: num.parse(json[r'longitude'].toString()),
|
||||
city: mapValueOfType<String>(json, r'city'),
|
||||
state: mapValueOfType<String>(json, r'state'),
|
||||
country: mapValueOfType<String>(json, r'country'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ExifResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ExifResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = ExifResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, ExifResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, ExifResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ExifResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ExifResponseDto-objects as value to a dart map
|
||||
static Map<String, List<ExifResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ExifResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ExifResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
119
mobile/openapi/lib/model/login_credential_dto.dart
Normal file
119
mobile/openapi/lib/model/login_credential_dto.dart
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class LoginCredentialDto {
|
||||
/// Returns a new [LoginCredentialDto] instance.
|
||||
LoginCredentialDto({
|
||||
required this.email,
|
||||
required this.password,
|
||||
});
|
||||
|
||||
String email;
|
||||
|
||||
String password;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is LoginCredentialDto &&
|
||||
other.email == email &&
|
||||
other.password == password;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(email.hashCode) +
|
||||
(password.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'LoginCredentialDto[email=$email, password=$password]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'email'] = email;
|
||||
_json[r'password'] = password;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [LoginCredentialDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static LoginCredentialDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "LoginCredentialDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "LoginCredentialDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return LoginCredentialDto(
|
||||
email: mapValueOfType<String>(json, r'email')!,
|
||||
password: mapValueOfType<String>(json, r'password')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<LoginCredentialDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <LoginCredentialDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = LoginCredentialDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, LoginCredentialDto> mapFromJson(dynamic json) {
|
||||
final map = <String, LoginCredentialDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = LoginCredentialDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of LoginCredentialDto-objects as value to a dart map
|
||||
static Map<String, List<LoginCredentialDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<LoginCredentialDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = LoginCredentialDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'email',
|
||||
'password',
|
||||
};
|
||||
}
|
||||
|
||||
167
mobile/openapi/lib/model/login_response_dto.dart
Normal file
167
mobile/openapi/lib/model/login_response_dto.dart
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class LoginResponseDto {
|
||||
/// Returns a new [LoginResponseDto] instance.
|
||||
LoginResponseDto({
|
||||
required this.accessToken,
|
||||
required this.userId,
|
||||
required this.userEmail,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.profileImagePath,
|
||||
required this.isAdmin,
|
||||
required this.shouldChangePassword,
|
||||
});
|
||||
|
||||
String accessToken;
|
||||
|
||||
String userId;
|
||||
|
||||
String userEmail;
|
||||
|
||||
String firstName;
|
||||
|
||||
String lastName;
|
||||
|
||||
String profileImagePath;
|
||||
|
||||
bool isAdmin;
|
||||
|
||||
bool shouldChangePassword;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is LoginResponseDto &&
|
||||
other.accessToken == accessToken &&
|
||||
other.userId == userId &&
|
||||
other.userEmail == userEmail &&
|
||||
other.firstName == firstName &&
|
||||
other.lastName == lastName &&
|
||||
other.profileImagePath == profileImagePath &&
|
||||
other.isAdmin == isAdmin &&
|
||||
other.shouldChangePassword == shouldChangePassword;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(accessToken.hashCode) +
|
||||
(userId.hashCode) +
|
||||
(userEmail.hashCode) +
|
||||
(firstName.hashCode) +
|
||||
(lastName.hashCode) +
|
||||
(profileImagePath.hashCode) +
|
||||
(isAdmin.hashCode) +
|
||||
(shouldChangePassword.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'LoginResponseDto[accessToken=$accessToken, userId=$userId, userEmail=$userEmail, firstName=$firstName, lastName=$lastName, profileImagePath=$profileImagePath, isAdmin=$isAdmin, shouldChangePassword=$shouldChangePassword]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'accessToken'] = accessToken;
|
||||
_json[r'userId'] = userId;
|
||||
_json[r'userEmail'] = userEmail;
|
||||
_json[r'firstName'] = firstName;
|
||||
_json[r'lastName'] = lastName;
|
||||
_json[r'profileImagePath'] = profileImagePath;
|
||||
_json[r'isAdmin'] = isAdmin;
|
||||
_json[r'shouldChangePassword'] = shouldChangePassword;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [LoginResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static LoginResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "LoginResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "LoginResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return LoginResponseDto(
|
||||
accessToken: mapValueOfType<String>(json, r'accessToken')!,
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
userEmail: mapValueOfType<String>(json, r'userEmail')!,
|
||||
firstName: mapValueOfType<String>(json, r'firstName')!,
|
||||
lastName: mapValueOfType<String>(json, r'lastName')!,
|
||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
||||
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
|
||||
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<LoginResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <LoginResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = LoginResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, LoginResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, LoginResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = LoginResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of LoginResponseDto-objects as value to a dart map
|
||||
static Map<String, List<LoginResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<LoginResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = LoginResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'accessToken',
|
||||
'userId',
|
||||
'userEmail',
|
||||
'firstName',
|
||||
'lastName',
|
||||
'profileImagePath',
|
||||
'isAdmin',
|
||||
'shouldChangePassword',
|
||||
};
|
||||
}
|
||||
|
||||
113
mobile/openapi/lib/model/remove_assets_dto.dart
Normal file
113
mobile/openapi/lib/model/remove_assets_dto.dart
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class RemoveAssetsDto {
|
||||
/// Returns a new [RemoveAssetsDto] instance.
|
||||
RemoveAssetsDto({
|
||||
this.assetIds = const [],
|
||||
});
|
||||
|
||||
List<String> assetIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is RemoveAssetsDto &&
|
||||
other.assetIds == assetIds;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(assetIds.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'RemoveAssetsDto[assetIds=$assetIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'assetIds'] = assetIds;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [RemoveAssetsDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static RemoveAssetsDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "RemoveAssetsDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "RemoveAssetsDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return RemoveAssetsDto(
|
||||
assetIds: json[r'assetIds'] is List
|
||||
? (json[r'assetIds'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<RemoveAssetsDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <RemoveAssetsDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = RemoveAssetsDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, RemoveAssetsDto> mapFromJson(dynamic json) {
|
||||
final map = <String, RemoveAssetsDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = RemoveAssetsDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of RemoveAssetsDto-objects as value to a dart map
|
||||
static Map<String, List<RemoveAssetsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<RemoveAssetsDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = RemoveAssetsDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'assetIds',
|
||||
};
|
||||
}
|
||||
|
||||
111
mobile/openapi/lib/model/search_asset_dto.dart
Normal file
111
mobile/openapi/lib/model/search_asset_dto.dart
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class SearchAssetDto {
|
||||
/// Returns a new [SearchAssetDto] instance.
|
||||
SearchAssetDto({
|
||||
required this.searchTerm,
|
||||
});
|
||||
|
||||
String searchTerm;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SearchAssetDto &&
|
||||
other.searchTerm == searchTerm;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(searchTerm.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SearchAssetDto[searchTerm=$searchTerm]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'searchTerm'] = searchTerm;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [SearchAssetDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SearchAssetDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "SearchAssetDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "SearchAssetDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return SearchAssetDto(
|
||||
searchTerm: mapValueOfType<String>(json, r'searchTerm')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SearchAssetDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SearchAssetDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = SearchAssetDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, SearchAssetDto> mapFromJson(dynamic json) {
|
||||
final map = <String, SearchAssetDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SearchAssetDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of SearchAssetDto-objects as value to a dart map
|
||||
static Map<String, List<SearchAssetDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SearchAssetDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SearchAssetDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'searchTerm',
|
||||
};
|
||||
}
|
||||
|
||||
159
mobile/openapi/lib/model/server_info_response_dto.dart
Normal file
159
mobile/openapi/lib/model/server_info_response_dto.dart
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ServerInfoResponseDto {
|
||||
/// Returns a new [ServerInfoResponseDto] instance.
|
||||
ServerInfoResponseDto({
|
||||
required this.diskSizeRaw,
|
||||
required this.diskUseRaw,
|
||||
required this.diskAvailableRaw,
|
||||
required this.diskUsagePercentage,
|
||||
required this.diskSize,
|
||||
required this.diskUse,
|
||||
required this.diskAvailable,
|
||||
});
|
||||
|
||||
int diskSizeRaw;
|
||||
|
||||
int diskUseRaw;
|
||||
|
||||
int diskAvailableRaw;
|
||||
|
||||
double diskUsagePercentage;
|
||||
|
||||
String diskSize;
|
||||
|
||||
String diskUse;
|
||||
|
||||
String diskAvailable;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ServerInfoResponseDto &&
|
||||
other.diskSizeRaw == diskSizeRaw &&
|
||||
other.diskUseRaw == diskUseRaw &&
|
||||
other.diskAvailableRaw == diskAvailableRaw &&
|
||||
other.diskUsagePercentage == diskUsagePercentage &&
|
||||
other.diskSize == diskSize &&
|
||||
other.diskUse == diskUse &&
|
||||
other.diskAvailable == diskAvailable;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(diskSizeRaw.hashCode) +
|
||||
(diskUseRaw.hashCode) +
|
||||
(diskAvailableRaw.hashCode) +
|
||||
(diskUsagePercentage.hashCode) +
|
||||
(diskSize.hashCode) +
|
||||
(diskUse.hashCode) +
|
||||
(diskAvailable.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ServerInfoResponseDto[diskSizeRaw=$diskSizeRaw, diskUseRaw=$diskUseRaw, diskAvailableRaw=$diskAvailableRaw, diskUsagePercentage=$diskUsagePercentage, diskSize=$diskSize, diskUse=$diskUse, diskAvailable=$diskAvailable]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'diskSizeRaw'] = diskSizeRaw;
|
||||
_json[r'diskUseRaw'] = diskUseRaw;
|
||||
_json[r'diskAvailableRaw'] = diskAvailableRaw;
|
||||
_json[r'diskUsagePercentage'] = diskUsagePercentage;
|
||||
_json[r'diskSize'] = diskSize;
|
||||
_json[r'diskUse'] = diskUse;
|
||||
_json[r'diskAvailable'] = diskAvailable;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [ServerInfoResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ServerInfoResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "ServerInfoResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "ServerInfoResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return ServerInfoResponseDto(
|
||||
diskSizeRaw: mapValueOfType<int>(json, r'diskSizeRaw')!,
|
||||
diskUseRaw: mapValueOfType<int>(json, r'diskUseRaw')!,
|
||||
diskAvailableRaw: mapValueOfType<int>(json, r'diskAvailableRaw')!,
|
||||
diskUsagePercentage: mapValueOfType<double>(json, r'diskUsagePercentage')!,
|
||||
diskSize: mapValueOfType<String>(json, r'diskSize')!,
|
||||
diskUse: mapValueOfType<String>(json, r'diskUse')!,
|
||||
diskAvailable: mapValueOfType<String>(json, r'diskAvailable')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ServerInfoResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ServerInfoResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = ServerInfoResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, ServerInfoResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, ServerInfoResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ServerInfoResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ServerInfoResponseDto-objects as value to a dart map
|
||||
static Map<String, List<ServerInfoResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ServerInfoResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ServerInfoResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'diskSizeRaw',
|
||||
'diskUseRaw',
|
||||
'diskAvailableRaw',
|
||||
'diskUsagePercentage',
|
||||
'diskSize',
|
||||
'diskUse',
|
||||
'diskAvailable',
|
||||
};
|
||||
}
|
||||
|
||||
111
mobile/openapi/lib/model/server_ping_response.dart
Normal file
111
mobile/openapi/lib/model/server_ping_response.dart
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ServerPingResponse {
|
||||
/// Returns a new [ServerPingResponse] instance.
|
||||
ServerPingResponse({
|
||||
required this.res,
|
||||
});
|
||||
|
||||
String res;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ServerPingResponse &&
|
||||
other.res == res;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(res.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ServerPingResponse[res=$res]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'res'] = res;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [ServerPingResponse] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ServerPingResponse? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "ServerPingResponse[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "ServerPingResponse[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return ServerPingResponse(
|
||||
res: mapValueOfType<String>(json, r'res')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ServerPingResponse>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ServerPingResponse>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = ServerPingResponse.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, ServerPingResponse> mapFromJson(dynamic json) {
|
||||
final map = <String, ServerPingResponse>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ServerPingResponse.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ServerPingResponse-objects as value to a dart map
|
||||
static Map<String, List<ServerPingResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ServerPingResponse>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ServerPingResponse.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'res',
|
||||
};
|
||||
}
|
||||
|
||||
135
mobile/openapi/lib/model/server_version_reponse_dto.dart
Normal file
135
mobile/openapi/lib/model/server_version_reponse_dto.dart
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ServerVersionReponseDto {
|
||||
/// Returns a new [ServerVersionReponseDto] instance.
|
||||
ServerVersionReponseDto({
|
||||
required this.major,
|
||||
required this.minor,
|
||||
required this.patch_,
|
||||
required this.build,
|
||||
});
|
||||
|
||||
int major;
|
||||
|
||||
int minor;
|
||||
|
||||
int patch_;
|
||||
|
||||
int build;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ServerVersionReponseDto &&
|
||||
other.major == major &&
|
||||
other.minor == minor &&
|
||||
other.patch_ == patch_ &&
|
||||
other.build == build;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(major.hashCode) +
|
||||
(minor.hashCode) +
|
||||
(patch_.hashCode) +
|
||||
(build.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ServerVersionReponseDto[major=$major, minor=$minor, patch_=$patch_, build=$build]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'major'] = major;
|
||||
_json[r'minor'] = minor;
|
||||
_json[r'patch'] = patch_;
|
||||
_json[r'build'] = build;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [ServerVersionReponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ServerVersionReponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "ServerVersionReponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "ServerVersionReponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return ServerVersionReponseDto(
|
||||
major: mapValueOfType<int>(json, r'major')!,
|
||||
minor: mapValueOfType<int>(json, r'minor')!,
|
||||
patch_: mapValueOfType<int>(json, r'patch')!,
|
||||
build: mapValueOfType<int>(json, r'build')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ServerVersionReponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ServerVersionReponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = ServerVersionReponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, ServerVersionReponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, ServerVersionReponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ServerVersionReponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ServerVersionReponseDto-objects as value to a dart map
|
||||
static Map<String, List<ServerVersionReponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ServerVersionReponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ServerVersionReponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'major',
|
||||
'minor',
|
||||
'patch',
|
||||
'build',
|
||||
};
|
||||
}
|
||||
|
||||
135
mobile/openapi/lib/model/sign_up_dto.dart
Normal file
135
mobile/openapi/lib/model/sign_up_dto.dart
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class SignUpDto {
|
||||
/// Returns a new [SignUpDto] instance.
|
||||
SignUpDto({
|
||||
required this.email,
|
||||
required this.password,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
});
|
||||
|
||||
String email;
|
||||
|
||||
String password;
|
||||
|
||||
String firstName;
|
||||
|
||||
String lastName;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SignUpDto &&
|
||||
other.email == email &&
|
||||
other.password == password &&
|
||||
other.firstName == firstName &&
|
||||
other.lastName == lastName;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(email.hashCode) +
|
||||
(password.hashCode) +
|
||||
(firstName.hashCode) +
|
||||
(lastName.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SignUpDto[email=$email, password=$password, firstName=$firstName, lastName=$lastName]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'email'] = email;
|
||||
_json[r'password'] = password;
|
||||
_json[r'firstName'] = firstName;
|
||||
_json[r'lastName'] = lastName;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [SignUpDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SignUpDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "SignUpDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "SignUpDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return SignUpDto(
|
||||
email: mapValueOfType<String>(json, r'email')!,
|
||||
password: mapValueOfType<String>(json, r'password')!,
|
||||
firstName: mapValueOfType<String>(json, r'firstName')!,
|
||||
lastName: mapValueOfType<String>(json, r'lastName')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SignUpDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SignUpDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = SignUpDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, SignUpDto> mapFromJson(dynamic json) {
|
||||
final map = <String, SignUpDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SignUpDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of SignUpDto-objects as value to a dart map
|
||||
static Map<String, List<SignUpDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SignUpDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SignUpDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'email',
|
||||
'password',
|
||||
'firstName',
|
||||
'lastName',
|
||||
};
|
||||
}
|
||||
|
||||
146
mobile/openapi/lib/model/smart_info_response_dto.dart
Normal file
146
mobile/openapi/lib/model/smart_info_response_dto.dart
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class SmartInfoResponseDto {
|
||||
/// Returns a new [SmartInfoResponseDto] instance.
|
||||
SmartInfoResponseDto({
|
||||
this.id,
|
||||
this.tags = const [],
|
||||
this.objects = const [],
|
||||
});
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? id;
|
||||
|
||||
List<String>? tags;
|
||||
|
||||
List<String>? objects;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SmartInfoResponseDto &&
|
||||
other.id == id &&
|
||||
other.tags == tags &&
|
||||
other.objects == objects;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id == null ? 0 : id!.hashCode) +
|
||||
(tags == null ? 0 : tags!.hashCode) +
|
||||
(objects == null ? 0 : objects!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SmartInfoResponseDto[id=$id, tags=$tags, objects=$objects]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
if (id != null) {
|
||||
_json[r'id'] = id;
|
||||
} else {
|
||||
_json[r'id'] = null;
|
||||
}
|
||||
if (tags != null) {
|
||||
_json[r'tags'] = tags;
|
||||
} else {
|
||||
_json[r'tags'] = null;
|
||||
}
|
||||
if (objects != null) {
|
||||
_json[r'objects'] = objects;
|
||||
} else {
|
||||
_json[r'objects'] = null;
|
||||
}
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [SmartInfoResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SmartInfoResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "SmartInfoResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "SmartInfoResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return SmartInfoResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
tags: json[r'tags'] is List
|
||||
? (json[r'tags'] as List).cast<String>()
|
||||
: const [],
|
||||
objects: json[r'objects'] is List
|
||||
? (json[r'objects'] as List).cast<String>()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SmartInfoResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SmartInfoResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = SmartInfoResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, SmartInfoResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, SmartInfoResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SmartInfoResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of SmartInfoResponseDto-objects as value to a dart map
|
||||
static Map<String, List<SmartInfoResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SmartInfoResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SmartInfoResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
};
|
||||
}
|
||||
|
||||
119
mobile/openapi/lib/model/update_album_dto.dart
Normal file
119
mobile/openapi/lib/model/update_album_dto.dart
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class UpdateAlbumDto {
|
||||
/// Returns a new [UpdateAlbumDto] instance.
|
||||
UpdateAlbumDto({
|
||||
required this.albumName,
|
||||
required this.ownerId,
|
||||
});
|
||||
|
||||
String albumName;
|
||||
|
||||
String ownerId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UpdateAlbumDto &&
|
||||
other.albumName == albumName &&
|
||||
other.ownerId == ownerId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(albumName.hashCode) +
|
||||
(ownerId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UpdateAlbumDto[albumName=$albumName, ownerId=$ownerId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'albumName'] = albumName;
|
||||
_json[r'ownerId'] = ownerId;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [UpdateAlbumDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UpdateAlbumDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "UpdateAlbumDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "UpdateAlbumDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return UpdateAlbumDto(
|
||||
albumName: mapValueOfType<String>(json, r'albumName')!,
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UpdateAlbumDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UpdateAlbumDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UpdateAlbumDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UpdateAlbumDto> mapFromJson(dynamic json) {
|
||||
final map = <String, UpdateAlbumDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UpdateAlbumDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UpdateAlbumDto-objects as value to a dart map
|
||||
static Map<String, List<UpdateAlbumDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UpdateAlbumDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UpdateAlbumDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'albumName',
|
||||
'ownerId',
|
||||
};
|
||||
}
|
||||
|
||||
136
mobile/openapi/lib/model/update_device_info_dto.dart
Normal file
136
mobile/openapi/lib/model/update_device_info_dto.dart
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class UpdateDeviceInfoDto {
|
||||
/// Returns a new [UpdateDeviceInfoDto] instance.
|
||||
UpdateDeviceInfoDto({
|
||||
required this.deviceType,
|
||||
required this.deviceId,
|
||||
this.isAutoBackup,
|
||||
});
|
||||
|
||||
DeviceTypeEnum deviceType;
|
||||
|
||||
String deviceId;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? isAutoBackup;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UpdateDeviceInfoDto &&
|
||||
other.deviceType == deviceType &&
|
||||
other.deviceId == deviceId &&
|
||||
other.isAutoBackup == isAutoBackup;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(deviceType.hashCode) +
|
||||
(deviceId.hashCode) +
|
||||
(isAutoBackup == null ? 0 : isAutoBackup!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UpdateDeviceInfoDto[deviceType=$deviceType, deviceId=$deviceId, isAutoBackup=$isAutoBackup]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'deviceType'] = deviceType;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
if (isAutoBackup != null) {
|
||||
_json[r'isAutoBackup'] = isAutoBackup;
|
||||
} else {
|
||||
_json[r'isAutoBackup'] = null;
|
||||
}
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [UpdateDeviceInfoDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UpdateDeviceInfoDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "UpdateDeviceInfoDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "UpdateDeviceInfoDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return UpdateDeviceInfoDto(
|
||||
deviceType: DeviceTypeEnum.fromJson(json[r'deviceType'])!,
|
||||
deviceId: mapValueOfType<String>(json, r'deviceId')!,
|
||||
isAutoBackup: mapValueOfType<bool>(json, r'isAutoBackup'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UpdateDeviceInfoDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UpdateDeviceInfoDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UpdateDeviceInfoDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UpdateDeviceInfoDto> mapFromJson(dynamic json) {
|
||||
final map = <String, UpdateDeviceInfoDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UpdateDeviceInfoDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UpdateDeviceInfoDto-objects as value to a dart map
|
||||
static Map<String, List<UpdateDeviceInfoDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UpdateDeviceInfoDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UpdateDeviceInfoDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'deviceType',
|
||||
'deviceId',
|
||||
};
|
||||
}
|
||||
|
||||
213
mobile/openapi/lib/model/update_user_dto.dart
Normal file
213
mobile/openapi/lib/model/update_user_dto.dart
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class UpdateUserDto {
|
||||
/// Returns a new [UpdateUserDto] instance.
|
||||
UpdateUserDto({
|
||||
required this.id,
|
||||
this.password,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.isAdmin,
|
||||
this.shouldChangePassword,
|
||||
this.profileImagePath,
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? password;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? firstName;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? lastName;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? isAdmin;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? shouldChangePassword;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? profileImagePath;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UpdateUserDto &&
|
||||
other.id == id &&
|
||||
other.password == password &&
|
||||
other.firstName == firstName &&
|
||||
other.lastName == lastName &&
|
||||
other.isAdmin == isAdmin &&
|
||||
other.shouldChangePassword == shouldChangePassword &&
|
||||
other.profileImagePath == profileImagePath;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(password == null ? 0 : password!.hashCode) +
|
||||
(firstName == null ? 0 : firstName!.hashCode) +
|
||||
(lastName == null ? 0 : lastName!.hashCode) +
|
||||
(isAdmin == null ? 0 : isAdmin!.hashCode) +
|
||||
(shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
|
||||
(profileImagePath == null ? 0 : profileImagePath!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UpdateUserDto[id=$id, password=$password, firstName=$firstName, lastName=$lastName, isAdmin=$isAdmin, shouldChangePassword=$shouldChangePassword, profileImagePath=$profileImagePath]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
if (password != null) {
|
||||
_json[r'password'] = password;
|
||||
} else {
|
||||
_json[r'password'] = null;
|
||||
}
|
||||
if (firstName != null) {
|
||||
_json[r'firstName'] = firstName;
|
||||
} else {
|
||||
_json[r'firstName'] = null;
|
||||
}
|
||||
if (lastName != null) {
|
||||
_json[r'lastName'] = lastName;
|
||||
} else {
|
||||
_json[r'lastName'] = null;
|
||||
}
|
||||
if (isAdmin != null) {
|
||||
_json[r'isAdmin'] = isAdmin;
|
||||
} else {
|
||||
_json[r'isAdmin'] = null;
|
||||
}
|
||||
if (shouldChangePassword != null) {
|
||||
_json[r'shouldChangePassword'] = shouldChangePassword;
|
||||
} else {
|
||||
_json[r'shouldChangePassword'] = null;
|
||||
}
|
||||
if (profileImagePath != null) {
|
||||
_json[r'profileImagePath'] = profileImagePath;
|
||||
} else {
|
||||
_json[r'profileImagePath'] = null;
|
||||
}
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [UpdateUserDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UpdateUserDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "UpdateUserDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "UpdateUserDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return UpdateUserDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
password: mapValueOfType<String>(json, r'password'),
|
||||
firstName: mapValueOfType<String>(json, r'firstName'),
|
||||
lastName: mapValueOfType<String>(json, r'lastName'),
|
||||
isAdmin: mapValueOfType<bool>(json, r'isAdmin'),
|
||||
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword'),
|
||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UpdateUserDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UpdateUserDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UpdateUserDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UpdateUserDto> mapFromJson(dynamic json) {
|
||||
final map = <String, UpdateUserDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UpdateUserDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UpdateUserDto-objects as value to a dart map
|
||||
static Map<String, List<UpdateUserDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UpdateUserDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UpdateUserDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
};
|
||||
}
|
||||
|
||||
111
mobile/openapi/lib/model/user_count_response_dto.dart
Normal file
111
mobile/openapi/lib/model/user_count_response_dto.dart
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class UserCountResponseDto {
|
||||
/// Returns a new [UserCountResponseDto] instance.
|
||||
UserCountResponseDto({
|
||||
required this.userCount,
|
||||
});
|
||||
|
||||
int userCount;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserCountResponseDto &&
|
||||
other.userCount == userCount;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(userCount.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserCountResponseDto[userCount=$userCount]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'userCount'] = userCount;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [UserCountResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UserCountResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "UserCountResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "UserCountResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return UserCountResponseDto(
|
||||
userCount: mapValueOfType<int>(json, r'userCount')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UserCountResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UserCountResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UserCountResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UserCountResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, UserCountResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserCountResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UserCountResponseDto-objects as value to a dart map
|
||||
static Map<String, List<UserCountResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UserCountResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserCountResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'userCount',
|
||||
};
|
||||
}
|
||||
|
||||
167
mobile/openapi/lib/model/user_response_dto.dart
Normal file
167
mobile/openapi/lib/model/user_response_dto.dart
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class UserResponseDto {
|
||||
/// Returns a new [UserResponseDto] instance.
|
||||
UserResponseDto({
|
||||
required this.id,
|
||||
required this.email,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.createdAt,
|
||||
required this.profileImagePath,
|
||||
required this.shouldChangePassword,
|
||||
required this.isAdmin,
|
||||
});
|
||||
|
||||
String id;
|
||||
|
||||
String email;
|
||||
|
||||
String firstName;
|
||||
|
||||
String lastName;
|
||||
|
||||
String createdAt;
|
||||
|
||||
String profileImagePath;
|
||||
|
||||
bool shouldChangePassword;
|
||||
|
||||
bool isAdmin;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserResponseDto &&
|
||||
other.id == id &&
|
||||
other.email == email &&
|
||||
other.firstName == firstName &&
|
||||
other.lastName == lastName &&
|
||||
other.createdAt == createdAt &&
|
||||
other.profileImagePath == profileImagePath &&
|
||||
other.shouldChangePassword == shouldChangePassword &&
|
||||
other.isAdmin == isAdmin;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id.hashCode) +
|
||||
(email.hashCode) +
|
||||
(firstName.hashCode) +
|
||||
(lastName.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(profileImagePath.hashCode) +
|
||||
(shouldChangePassword.hashCode) +
|
||||
(isAdmin.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserResponseDto[id=$id, email=$email, firstName=$firstName, lastName=$lastName, createdAt=$createdAt, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, isAdmin=$isAdmin]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'id'] = id;
|
||||
_json[r'email'] = email;
|
||||
_json[r'firstName'] = firstName;
|
||||
_json[r'lastName'] = lastName;
|
||||
_json[r'createdAt'] = createdAt;
|
||||
_json[r'profileImagePath'] = profileImagePath;
|
||||
_json[r'shouldChangePassword'] = shouldChangePassword;
|
||||
_json[r'isAdmin'] = isAdmin;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [UserResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static UserResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "UserResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "UserResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return UserResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
email: mapValueOfType<String>(json, r'email')!,
|
||||
firstName: mapValueOfType<String>(json, r'firstName')!,
|
||||
lastName: mapValueOfType<String>(json, r'lastName')!,
|
||||
createdAt: mapValueOfType<String>(json, r'createdAt')!,
|
||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
||||
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
|
||||
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<UserResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <UserResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = UserResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, UserResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, UserResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of UserResponseDto-objects as value to a dart map
|
||||
static Map<String, List<UserResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<UserResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = UserResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'id',
|
||||
'email',
|
||||
'firstName',
|
||||
'lastName',
|
||||
'createdAt',
|
||||
'profileImagePath',
|
||||
'shouldChangePassword',
|
||||
'isAdmin',
|
||||
};
|
||||
}
|
||||
|
||||
111
mobile/openapi/lib/model/validate_access_token_response_dto.dart
Normal file
111
mobile/openapi/lib/model/validate_access_token_response_dto.dart
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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;
|
||||
|
||||
class ValidateAccessTokenResponseDto {
|
||||
/// Returns a new [ValidateAccessTokenResponseDto] instance.
|
||||
ValidateAccessTokenResponseDto({
|
||||
required this.authStatus,
|
||||
});
|
||||
|
||||
bool authStatus;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ValidateAccessTokenResponseDto &&
|
||||
other.authStatus == authStatus;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(authStatus.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ValidateAccessTokenResponseDto[authStatus=$authStatus]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'authStatus'] = authStatus;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [ValidateAccessTokenResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ValidateAccessTokenResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "ValidateAccessTokenResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "ValidateAccessTokenResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return ValidateAccessTokenResponseDto(
|
||||
authStatus: mapValueOfType<bool>(json, r'authStatus')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<ValidateAccessTokenResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <ValidateAccessTokenResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = ValidateAccessTokenResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, ValidateAccessTokenResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, ValidateAccessTokenResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ValidateAccessTokenResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ValidateAccessTokenResponseDto-objects as value to a dart map
|
||||
static Map<String, List<ValidateAccessTokenResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<ValidateAccessTokenResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = ValidateAccessTokenResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'authStatus',
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue