refactor(server): update asset endpoint (#3973)

* refactor(server): update asset

* chore: open api
This commit is contained in:
Jason Rasmussen
2023-09-04 22:25:31 -04:00
committed by GitHub
parent 26bc889f8d
commit 454737ca79
27 changed files with 237 additions and 184 deletions

View File

@@ -1368,8 +1368,6 @@ Name | Type | Description | Notes
Update an asset
### Example
```dart
import 'package:openapi/api.dart';

View File

@@ -11,7 +11,6 @@ Name | Type | Description | Notes
**description** | **String** | | [optional]
**isArchived** | **bool** | | [optional]
**isFavorite** | **bool** | | [optional]
**tagIds** | **List<String>** | | [optional] [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

@@ -1384,10 +1384,7 @@ class AssetApi {
return null;
}
/// Update an asset
///
/// Note: This method returns the HTTP [Response].
///
/// Performs an HTTP 'PUT /asset/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
@@ -1419,8 +1416,6 @@ class AssetApi {
);
}
/// Update an asset
///
/// Parameters:
///
/// * [String] id (required):

View File

@@ -16,7 +16,6 @@ class UpdateAssetDto {
this.description,
this.isArchived,
this.isFavorite,
this.tagIds = const [],
});
///
@@ -43,25 +42,21 @@ class UpdateAssetDto {
///
bool? isFavorite;
List<String> tagIds;
@override
bool operator ==(Object other) => identical(this, other) || other is UpdateAssetDto &&
other.description == description &&
other.isArchived == isArchived &&
other.isFavorite == isFavorite &&
other.tagIds == tagIds;
other.isFavorite == isFavorite;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(description == null ? 0 : description!.hashCode) +
(isArchived == null ? 0 : isArchived!.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
(tagIds.hashCode);
(isFavorite == null ? 0 : isFavorite!.hashCode);
@override
String toString() => 'UpdateAssetDto[description=$description, isArchived=$isArchived, isFavorite=$isFavorite, tagIds=$tagIds]';
String toString() => 'UpdateAssetDto[description=$description, isArchived=$isArchived, isFavorite=$isFavorite]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -80,7 +75,6 @@ class UpdateAssetDto {
} else {
// json[r'isFavorite'] = null;
}
json[r'tagIds'] = this.tagIds;
return json;
}
@@ -95,9 +89,6 @@ class UpdateAssetDto {
description: mapValueOfType<String>(json, r'description'),
isArchived: mapValueOfType<bool>(json, r'isArchived'),
isFavorite: mapValueOfType<bool>(json, r'isFavorite'),
tagIds: json[r'tagIds'] is List
? (json[r'tagIds'] as List).cast<String>()
: const [],
);
}
return null;

View File

@@ -144,8 +144,6 @@ void main() {
// TODO
});
// Update an asset
//
//Future<AssetResponseDto> updateAsset(String id, UpdateAssetDto updateAssetDto) async
test('test updateAsset', () async {
// TODO

View File

@@ -31,11 +31,6 @@ void main() {
// TODO
});
// List<String> tagIds (default value: const [])
test('to test the property `tagIds`', () async {
// TODO
});
});