refactor(server)!: add/remove album assets (#3109)

* refactor: add/remove album assets

* chore: open api

* feat: remove owned assets from album

* refactor: move to bulk id req/res dto

* chore: open api

* chore: merge main

* dev: mobile work

* fix: adding asset from web not sync with mobile

* remove print statement

---------

Co-authored-by: Alex Tran <Alex.Tran@conductix.com>
This commit is contained in:
Jason Rasmussen 2023-08-01 21:29:14 -04:00 committed by GitHub
parent ba71c83948
commit b9cda59172
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 890 additions and 1282 deletions

View file

@ -8,8 +8,6 @@ doc/APIKeyCreateDto.md
doc/APIKeyCreateResponseDto.md
doc/APIKeyResponseDto.md
doc/APIKeyUpdateDto.md
doc/AddAssetsDto.md
doc/AddAssetsResponseDto.md
doc/AddUsersDto.md
doc/AdminSignupResponseDto.md
doc/AlbumApi.md
@ -33,6 +31,7 @@ doc/AudioCodec.md
doc/AuthDeviceResponseDto.md
doc/AuthenticationApi.md
doc/BulkIdResponseDto.md
doc/BulkIdsDto.md
doc/ChangePasswordDto.md
doc/CheckDuplicateAssetDto.md
doc/CheckDuplicateAssetResponseDto.md
@ -78,7 +77,6 @@ doc/PersonApi.md
doc/PersonResponseDto.md
doc/PersonUpdateDto.md
doc/QueueStatusDto.md
doc/RemoveAssetsDto.md
doc/SearchAlbumResponseDto.md
doc/SearchApi.md
doc/SearchAssetDto.md
@ -150,8 +148,6 @@ lib/auth/authentication.dart
lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart
lib/model/add_assets_dto.dart
lib/model/add_assets_response_dto.dart
lib/model/add_users_dto.dart
lib/model/admin_signup_response_dto.dart
lib/model/album_count_response_dto.dart
@ -176,6 +172,7 @@ lib/model/asset_type_enum.dart
lib/model/audio_codec.dart
lib/model/auth_device_response_dto.dart
lib/model/bulk_id_response_dto.dart
lib/model/bulk_ids_dto.dart
lib/model/change_password_dto.dart
lib/model/check_duplicate_asset_dto.dart
lib/model/check_duplicate_asset_response_dto.dart
@ -217,7 +214,6 @@ lib/model/people_update_item.dart
lib/model/person_response_dto.dart
lib/model/person_update_dto.dart
lib/model/queue_status_dto.dart
lib/model/remove_assets_dto.dart
lib/model/search_album_response_dto.dart
lib/model/search_asset_dto.dart
lib/model/search_asset_response_dto.dart
@ -260,8 +256,6 @@ lib/model/user_response_dto.dart
lib/model/validate_access_token_response_dto.dart
lib/model/video_codec.dart
pubspec.yaml
test/add_assets_dto_test.dart
test/add_assets_response_dto_test.dart
test/add_users_dto_test.dart
test/admin_signup_response_dto_test.dart
test/album_api_test.dart
@ -290,6 +284,7 @@ test/audio_codec_test.dart
test/auth_device_response_dto_test.dart
test/authentication_api_test.dart
test/bulk_id_response_dto_test.dart
test/bulk_ids_dto_test.dart
test/change_password_dto_test.dart
test/check_duplicate_asset_dto_test.dart
test/check_duplicate_asset_response_dto_test.dart
@ -335,7 +330,6 @@ test/person_api_test.dart
test/person_response_dto_test.dart
test/person_update_dto_test.dart
test/queue_status_dto_test.dart
test/remove_assets_dto_test.dart
test/search_album_response_dto_test.dart
test/search_api_test.dart
test/search_asset_dto_test.dart

View file

@ -182,8 +182,6 @@ Class | Method | HTTP request | Description
- [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md)
- [APIKeyResponseDto](doc//APIKeyResponseDto.md)
- [APIKeyUpdateDto](doc//APIKeyUpdateDto.md)
- [AddAssetsDto](doc//AddAssetsDto.md)
- [AddAssetsResponseDto](doc//AddAssetsResponseDto.md)
- [AddUsersDto](doc//AddUsersDto.md)
- [AdminSignupResponseDto](doc//AdminSignupResponseDto.md)
- [AlbumCountResponseDto](doc//AlbumCountResponseDto.md)
@ -204,6 +202,7 @@ Class | Method | HTTP request | Description
- [AudioCodec](doc//AudioCodec.md)
- [AuthDeviceResponseDto](doc//AuthDeviceResponseDto.md)
- [BulkIdResponseDto](doc//BulkIdResponseDto.md)
- [BulkIdsDto](doc//BulkIdsDto.md)
- [ChangePasswordDto](doc//ChangePasswordDto.md)
- [CheckDuplicateAssetDto](doc//CheckDuplicateAssetDto.md)
- [CheckDuplicateAssetResponseDto](doc//CheckDuplicateAssetResponseDto.md)
@ -245,7 +244,6 @@ Class | Method | HTTP request | Description
- [PersonResponseDto](doc//PersonResponseDto.md)
- [PersonUpdateDto](doc//PersonUpdateDto.md)
- [QueueStatusDto](doc//QueueStatusDto.md)
- [RemoveAssetsDto](doc//RemoveAssetsDto.md)
- [SearchAlbumResponseDto](doc//SearchAlbumResponseDto.md)
- [SearchAssetDto](doc//SearchAssetDto.md)
- [SearchAssetResponseDto](doc//SearchAssetResponseDto.md)

View file

@ -1,17 +0,0 @@
# openapi.model.AddAssetsResponseDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**album** | [**AlbumResponseDto**](AlbumResponseDto.md) | | [optional]
**alreadyInAlbum** | **List<String>** | | [default to const []]
**successfullyAdded** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -22,7 +22,7 @@ Method | HTTP request | Description
# **addAssetsToAlbum**
> AddAssetsResponseDto addAssetsToAlbum(id, addAssetsDto, key)
> List<BulkIdResponseDto> addAssetsToAlbum(id, bulkIdsDto, key)
@ -46,11 +46,11 @@ import 'package:openapi/api.dart';
final api_instance = AlbumApi();
final id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
final addAssetsDto = AddAssetsDto(); // AddAssetsDto |
final bulkIdsDto = BulkIdsDto(); // BulkIdsDto |
final key = key_example; // String |
try {
final result = api_instance.addAssetsToAlbum(id, addAssetsDto, key);
final result = api_instance.addAssetsToAlbum(id, bulkIdsDto, key);
print(result);
} catch (e) {
print('Exception when calling AlbumApi->addAssetsToAlbum: $e\n');
@ -62,12 +62,12 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
**addAssetsDto** | [**AddAssetsDto**](AddAssetsDto.md)| |
**bulkIdsDto** | [**BulkIdsDto**](BulkIdsDto.md)| |
**key** | **String**| | [optional]
### Return type
[**AddAssetsResponseDto**](AddAssetsResponseDto.md)
[**List<BulkIdResponseDto>**](BulkIdResponseDto.md)
### Authorization
@ -412,7 +412,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **removeAssetFromAlbum**
> AlbumResponseDto removeAssetFromAlbum(id, removeAssetsDto)
> List<BulkIdResponseDto> removeAssetFromAlbum(id, bulkIdsDto)
@ -436,10 +436,10 @@ import 'package:openapi/api.dart';
final api_instance = AlbumApi();
final id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
final removeAssetsDto = RemoveAssetsDto(); // RemoveAssetsDto |
final bulkIdsDto = BulkIdsDto(); // BulkIdsDto |
try {
final result = api_instance.removeAssetFromAlbum(id, removeAssetsDto);
final result = api_instance.removeAssetFromAlbum(id, bulkIdsDto);
print(result);
} catch (e) {
print('Exception when calling AlbumApi->removeAssetFromAlbum: $e\n');
@ -451,11 +451,11 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
**removeAssetsDto** | [**RemoveAssetsDto**](RemoveAssetsDto.md)| |
**bulkIdsDto** | [**BulkIdsDto**](BulkIdsDto.md)| |
### Return type
[**AlbumResponseDto**](AlbumResponseDto.md)
[**List<BulkIdResponseDto>**](BulkIdResponseDto.md)
### Authorization

View file

@ -1,4 +1,4 @@
# openapi.model.AddAssetsDto
# openapi.model.BulkIdsDto
## Load the model package
```dart
@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assetIds** | **List<String>** | | [default to const []]
**ids** | **List<String>** | | [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -1,15 +0,0 @@
# openapi.model.RemoveAssetsDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assetIds** | **List<String>** | | [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -47,8 +47,6 @@ part 'model/api_key_create_dto.dart';
part 'model/api_key_create_response_dto.dart';
part 'model/api_key_response_dto.dart';
part 'model/api_key_update_dto.dart';
part 'model/add_assets_dto.dart';
part 'model/add_assets_response_dto.dart';
part 'model/add_users_dto.dart';
part 'model/admin_signup_response_dto.dart';
part 'model/album_count_response_dto.dart';
@ -69,6 +67,7 @@ part 'model/asset_type_enum.dart';
part 'model/audio_codec.dart';
part 'model/auth_device_response_dto.dart';
part 'model/bulk_id_response_dto.dart';
part 'model/bulk_ids_dto.dart';
part 'model/change_password_dto.dart';
part 'model/check_duplicate_asset_dto.dart';
part 'model/check_duplicate_asset_response_dto.dart';
@ -110,7 +109,6 @@ part 'model/people_update_item.dart';
part 'model/person_response_dto.dart';
part 'model/person_update_dto.dart';
part 'model/queue_status_dto.dart';
part 'model/remove_assets_dto.dart';
part 'model/search_album_response_dto.dart';
part 'model/search_asset_dto.dart';
part 'model/search_asset_response_dto.dart';

View file

@ -21,16 +21,16 @@ class AlbumApi {
///
/// * [String] id (required):
///
/// * [AddAssetsDto] addAssetsDto (required):
/// * [BulkIdsDto] bulkIdsDto (required):
///
/// * [String] key:
Future<Response> addAssetsToAlbumWithHttpInfo(String id, AddAssetsDto addAssetsDto, { String? key, }) async {
Future<Response> addAssetsToAlbumWithHttpInfo(String id, BulkIdsDto bulkIdsDto, { String? key, }) async {
// ignore: prefer_const_declarations
final path = r'/album/{id}/assets'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = addAssetsDto;
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
@ -58,11 +58,11 @@ class AlbumApi {
///
/// * [String] id (required):
///
/// * [AddAssetsDto] addAssetsDto (required):
/// * [BulkIdsDto] bulkIdsDto (required):
///
/// * [String] key:
Future<AddAssetsResponseDto?> addAssetsToAlbum(String id, AddAssetsDto addAssetsDto, { String? key, }) async {
final response = await addAssetsToAlbumWithHttpInfo(id, addAssetsDto, key: key, );
Future<List<BulkIdResponseDto>?> addAssetsToAlbum(String id, BulkIdsDto bulkIdsDto, { String? key, }) async {
final response = await addAssetsToAlbumWithHttpInfo(id, bulkIdsDto, key: key, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@ -70,8 +70,11 @@ class AlbumApi {
// 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), 'AddAssetsResponseDto',) as AddAssetsResponseDto;
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList();
}
return null;
}
@ -380,14 +383,14 @@ class AlbumApi {
///
/// * [String] id (required):
///
/// * [RemoveAssetsDto] removeAssetsDto (required):
Future<Response> removeAssetFromAlbumWithHttpInfo(String id, RemoveAssetsDto removeAssetsDto,) async {
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> removeAssetFromAlbumWithHttpInfo(String id, BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
final path = r'/album/{id}/assets'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = removeAssetsDto;
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
@ -411,9 +414,9 @@ class AlbumApi {
///
/// * [String] id (required):
///
/// * [RemoveAssetsDto] removeAssetsDto (required):
Future<AlbumResponseDto?> removeAssetFromAlbum(String id, RemoveAssetsDto removeAssetsDto,) async {
final response = await removeAssetFromAlbumWithHttpInfo(id, removeAssetsDto,);
/// * [BulkIdsDto] bulkIdsDto (required):
Future<List<BulkIdResponseDto>?> removeAssetFromAlbum(String id, BulkIdsDto bulkIdsDto,) async {
final response = await removeAssetFromAlbumWithHttpInfo(id, bulkIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@ -421,8 +424,11 @@ class AlbumApi {
// 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;
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList();
}
return null;
}

View file

@ -189,10 +189,6 @@ class ApiClient {
return APIKeyResponseDto.fromJson(value);
case 'APIKeyUpdateDto':
return APIKeyUpdateDto.fromJson(value);
case 'AddAssetsDto':
return AddAssetsDto.fromJson(value);
case 'AddAssetsResponseDto':
return AddAssetsResponseDto.fromJson(value);
case 'AddUsersDto':
return AddUsersDto.fromJson(value);
case 'AdminSignupResponseDto':
@ -233,6 +229,8 @@ class ApiClient {
return AuthDeviceResponseDto.fromJson(value);
case 'BulkIdResponseDto':
return BulkIdResponseDto.fromJson(value);
case 'BulkIdsDto':
return BulkIdsDto.fromJson(value);
case 'ChangePasswordDto':
return ChangePasswordDto.fromJson(value);
case 'CheckDuplicateAssetDto':
@ -315,8 +313,6 @@ class ApiClient {
return PersonUpdateDto.fromJson(value);
case 'QueueStatusDto':
return QueueStatusDto.fromJson(value);
case 'RemoveAssetsDto':
return RemoveAssetsDto.fromJson(value);
case 'SearchAlbumResponseDto':
return SearchAlbumResponseDto.fromJson(value);
case 'SearchAssetDto':

View file

@ -1,125 +0,0 @@
//
// 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 AddAssetsResponseDto {
/// Returns a new [AddAssetsResponseDto] instance.
AddAssetsResponseDto({
this.album,
this.alreadyInAlbum = const [],
required this.successfullyAdded,
});
///
/// 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.
///
AlbumResponseDto? album;
List<String> alreadyInAlbum;
int successfullyAdded;
@override
bool operator ==(Object other) => identical(this, other) || other is AddAssetsResponseDto &&
other.album == album &&
other.alreadyInAlbum == alreadyInAlbum &&
other.successfullyAdded == successfullyAdded;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(album == null ? 0 : album!.hashCode) +
(alreadyInAlbum.hashCode) +
(successfullyAdded.hashCode);
@override
String toString() => 'AddAssetsResponseDto[album=$album, alreadyInAlbum=$alreadyInAlbum, successfullyAdded=$successfullyAdded]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.album != null) {
json[r'album'] = this.album;
} else {
// json[r'album'] = null;
}
json[r'alreadyInAlbum'] = this.alreadyInAlbum;
json[r'successfullyAdded'] = this.successfullyAdded;
return json;
}
/// Returns a new [AddAssetsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AddAssetsResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return AddAssetsResponseDto(
album: AlbumResponseDto.fromJson(json[r'album']),
alreadyInAlbum: json[r'alreadyInAlbum'] is Iterable
? (json[r'alreadyInAlbum'] as Iterable).cast<String>().toList(growable: false)
: const [],
successfullyAdded: mapValueOfType<int>(json, r'successfullyAdded')!,
);
}
return null;
}
static List<AddAssetsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AddAssetsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AddAssetsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AddAssetsResponseDto> mapFromJson(dynamic json) {
final map = <String, AddAssetsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AddAssetsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AddAssetsResponseDto-objects as value to a dart map
static Map<String, List<AddAssetsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AddAssetsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AddAssetsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'alreadyInAlbum',
'successfullyAdded',
};
}

View file

@ -10,53 +10,53 @@
part of openapi.api;
class AddAssetsDto {
/// Returns a new [AddAssetsDto] instance.
AddAssetsDto({
this.assetIds = const [],
class BulkIdsDto {
/// Returns a new [BulkIdsDto] instance.
BulkIdsDto({
this.ids = const [],
});
List<String> assetIds;
List<String> ids;
@override
bool operator ==(Object other) => identical(this, other) || other is AddAssetsDto &&
other.assetIds == assetIds;
bool operator ==(Object other) => identical(this, other) || other is BulkIdsDto &&
other.ids == ids;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(assetIds.hashCode);
(ids.hashCode);
@override
String toString() => 'AddAssetsDto[assetIds=$assetIds]';
String toString() => 'BulkIdsDto[ids=$ids]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'assetIds'] = this.assetIds;
json[r'ids'] = this.ids;
return json;
}
/// Returns a new [AddAssetsDto] instance and imports its values from
/// Returns a new [BulkIdsDto] 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) {
static BulkIdsDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return AddAssetsDto(
assetIds: json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
return BulkIdsDto(
ids: json[r'ids'] is Iterable
? (json[r'ids'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
}
static List<AddAssetsDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AddAssetsDto>[];
static List<BulkIdsDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BulkIdsDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AddAssetsDto.fromJson(row);
final value = BulkIdsDto.fromJson(row);
if (value != null) {
result.add(value);
}
@ -65,12 +65,12 @@ class AddAssetsDto {
return result.toList(growable: growable);
}
static Map<String, AddAssetsDto> mapFromJson(dynamic json) {
final map = <String, AddAssetsDto>{};
static Map<String, BulkIdsDto> mapFromJson(dynamic json) {
final map = <String, BulkIdsDto>{};
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);
final value = BulkIdsDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@ -79,14 +79,14 @@ class AddAssetsDto {
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>>{};
// maps a json object with a list of BulkIdsDto-objects as value to a dart map
static Map<String, List<BulkIdsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<BulkIdsDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AddAssetsDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = BulkIdsDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
@ -94,7 +94,7 @@ class AddAssetsDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'assetIds',
'ids',
};
}

View file

@ -1,100 +0,0 @@
//
// 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'] = this.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>();
return RemoveAssetsDto(
assetIds: json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
: 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) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RemoveAssetsDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'assetIds',
};
}

View file

@ -1,37 +0,0 @@
//
// 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
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for AddAssetsResponseDto
void main() {
// final instance = AddAssetsResponseDto();
group('test AddAssetsResponseDto', () {
// AlbumResponseDto album
test('to test the property `album`', () async {
// TODO
});
// List<String> alreadyInAlbum (default value: const [])
test('to test the property `alreadyInAlbum`', () async {
// TODO
});
// int successfullyAdded
test('to test the property `successfullyAdded`', () async {
// TODO
});
});
}

View file

@ -17,7 +17,7 @@ void main() {
// final instance = AlbumApi();
group('tests for AlbumApi', () {
//Future<AddAssetsResponseDto> addAssetsToAlbum(String id, AddAssetsDto addAssetsDto, { String key }) async
//Future<List<BulkIdResponseDto>> addAssetsToAlbum(String id, BulkIdsDto bulkIdsDto, { String key }) async
test('test addAssetsToAlbum', () async {
// TODO
});
@ -52,7 +52,7 @@ void main() {
// TODO
});
//Future<AlbumResponseDto> removeAssetFromAlbum(String id, RemoveAssetsDto removeAssetsDto) async
//Future<List<BulkIdResponseDto>> removeAssetFromAlbum(String id, BulkIdsDto bulkIdsDto) async
test('test removeAssetFromAlbum', () async {
// TODO
});

View file

@ -11,13 +11,13 @@
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for AddAssetsDto
// tests for BulkIdsDto
void main() {
// final instance = AddAssetsDto();
// final instance = BulkIdsDto();
group('test AddAssetsDto', () {
// List<String> assetIds (default value: const [])
test('to test the property `assetIds`', () async {
group('test BulkIdsDto', () {
// List<String> ids (default value: const [])
test('to test the property `ids`', () async {
// TODO
});

View file

@ -1,27 +0,0 @@
//
// 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
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for RemoveAssetsDto
void main() {
// final instance = RemoveAssetsDto();
group('test RemoveAssetsDto', () {
// List<String> assetIds (default value: const [])
test('to test the property `assetIds`', () async {
// TODO
});
});
}