refactor: create album users (#9315)
This commit is contained in:
Generated
+3
@@ -18,6 +18,7 @@ doc/AlbumApi.md
|
||||
doc/AlbumCountResponseDto.md
|
||||
doc/AlbumResponseDto.md
|
||||
doc/AlbumUserAddDto.md
|
||||
doc/AlbumUserCreateDto.md
|
||||
doc/AlbumUserResponseDto.md
|
||||
doc/AlbumUserRole.md
|
||||
doc/AllJobStatusResponseDto.md
|
||||
@@ -257,6 +258,7 @@ lib/model/admin_onboarding_update_dto.dart
|
||||
lib/model/album_count_response_dto.dart
|
||||
lib/model/album_response_dto.dart
|
||||
lib/model/album_user_add_dto.dart
|
||||
lib/model/album_user_create_dto.dart
|
||||
lib/model/album_user_response_dto.dart
|
||||
lib/model/album_user_role.dart
|
||||
lib/model/all_job_status_response_dto.dart
|
||||
@@ -444,6 +446,7 @@ test/album_api_test.dart
|
||||
test/album_count_response_dto_test.dart
|
||||
test/album_response_dto_test.dart
|
||||
test/album_user_add_dto_test.dart
|
||||
test/album_user_create_dto_test.dart
|
||||
test/album_user_response_dto_test.dart
|
||||
test/album_user_role_test.dart
|
||||
test/all_job_status_response_dto_test.dart
|
||||
|
||||
Generated
+1
@@ -235,6 +235,7 @@ Class | Method | HTTP request | Description
|
||||
- [AlbumCountResponseDto](doc//AlbumCountResponseDto.md)
|
||||
- [AlbumResponseDto](doc//AlbumResponseDto.md)
|
||||
- [AlbumUserAddDto](doc//AlbumUserAddDto.md)
|
||||
- [AlbumUserCreateDto](doc//AlbumUserCreateDto.md)
|
||||
- [AlbumUserResponseDto](doc//AlbumUserResponseDto.md)
|
||||
- [AlbumUserRole](doc//AlbumUserRole.md)
|
||||
- [AllJobStatusResponseDto](doc//AllJobStatusResponseDto.md)
|
||||
|
||||
Generated
+16
@@ -0,0 +1,16 @@
|
||||
# openapi.model.AlbumUserCreateDto
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**role** | [**AlbumUserRole**](AlbumUserRole.md) | |
|
||||
**userId** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
Generated
+2
-1
@@ -9,9 +9,10 @@ import 'package:openapi/api.dart';
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**albumName** | **String** | |
|
||||
**albumUsers** | [**List<AlbumUserCreateDto>**](AlbumUserCreateDto.md) | This property was added in v1.104.0 | [optional] [default to const []]
|
||||
**assetIds** | **List<String>** | | [optional] [default to const []]
|
||||
**description** | **String** | | [optional]
|
||||
**sharedWithUserIds** | **List<String>** | | [optional] [default to const []]
|
||||
**sharedWithUserIds** | **List<String>** | This property was deprecated in v1.104.0 | [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)
|
||||
|
||||
|
||||
Generated
+1
@@ -68,6 +68,7 @@ part 'model/admin_onboarding_update_dto.dart';
|
||||
part 'model/album_count_response_dto.dart';
|
||||
part 'model/album_response_dto.dart';
|
||||
part 'model/album_user_add_dto.dart';
|
||||
part 'model/album_user_create_dto.dart';
|
||||
part 'model/album_user_response_dto.dart';
|
||||
part 'model/album_user_role.dart';
|
||||
part 'model/all_job_status_response_dto.dart';
|
||||
|
||||
Generated
+2
@@ -206,6 +206,8 @@ class ApiClient {
|
||||
return AlbumResponseDto.fromJson(value);
|
||||
case 'AlbumUserAddDto':
|
||||
return AlbumUserAddDto.fromJson(value);
|
||||
case 'AlbumUserCreateDto':
|
||||
return AlbumUserCreateDto.fromJson(value);
|
||||
case 'AlbumUserResponseDto':
|
||||
return AlbumUserResponseDto.fromJson(value);
|
||||
case 'AlbumUserRole':
|
||||
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// 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 AlbumUserCreateDto {
|
||||
/// Returns a new [AlbumUserCreateDto] instance.
|
||||
AlbumUserCreateDto({
|
||||
required this.role,
|
||||
required this.userId,
|
||||
});
|
||||
|
||||
AlbumUserRole role;
|
||||
|
||||
String userId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlbumUserCreateDto &&
|
||||
other.role == role &&
|
||||
other.userId == userId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(role.hashCode) +
|
||||
(userId.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AlbumUserCreateDto[role=$role, userId=$userId]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'role'] = this.role;
|
||||
json[r'userId'] = this.userId;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AlbumUserCreateDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AlbumUserCreateDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AlbumUserCreateDto(
|
||||
role: AlbumUserRole.fromJson(json[r'role'])!,
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AlbumUserCreateDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AlbumUserCreateDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AlbumUserCreateDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AlbumUserCreateDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AlbumUserCreateDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AlbumUserCreateDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AlbumUserCreateDto-objects as value to a dart map
|
||||
static Map<String, List<AlbumUserCreateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AlbumUserCreateDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AlbumUserCreateDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'role',
|
||||
'userId',
|
||||
};
|
||||
}
|
||||
|
||||
+10
-1
@@ -14,6 +14,7 @@ class CreateAlbumDto {
|
||||
/// Returns a new [CreateAlbumDto] instance.
|
||||
CreateAlbumDto({
|
||||
required this.albumName,
|
||||
this.albumUsers = const [],
|
||||
this.assetIds = const [],
|
||||
this.description,
|
||||
this.sharedWithUserIds = const [],
|
||||
@@ -21,6 +22,9 @@ class CreateAlbumDto {
|
||||
|
||||
String albumName;
|
||||
|
||||
/// This property was added in v1.104.0
|
||||
List<AlbumUserCreateDto> albumUsers;
|
||||
|
||||
List<String> assetIds;
|
||||
|
||||
///
|
||||
@@ -31,11 +35,13 @@ class CreateAlbumDto {
|
||||
///
|
||||
String? description;
|
||||
|
||||
/// This property was deprecated in v1.104.0
|
||||
List<String> sharedWithUserIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CreateAlbumDto &&
|
||||
other.albumName == albumName &&
|
||||
_deepEquality.equals(other.albumUsers, albumUsers) &&
|
||||
_deepEquality.equals(other.assetIds, assetIds) &&
|
||||
other.description == description &&
|
||||
_deepEquality.equals(other.sharedWithUserIds, sharedWithUserIds);
|
||||
@@ -44,16 +50,18 @@ class CreateAlbumDto {
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(albumName.hashCode) +
|
||||
(albumUsers.hashCode) +
|
||||
(assetIds.hashCode) +
|
||||
(description == null ? 0 : description!.hashCode) +
|
||||
(sharedWithUserIds.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateAlbumDto[albumName=$albumName, assetIds=$assetIds, description=$description, sharedWithUserIds=$sharedWithUserIds]';
|
||||
String toString() => 'CreateAlbumDto[albumName=$albumName, albumUsers=$albumUsers, assetIds=$assetIds, description=$description, sharedWithUserIds=$sharedWithUserIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'albumName'] = this.albumName;
|
||||
json[r'albumUsers'] = this.albumUsers;
|
||||
json[r'assetIds'] = this.assetIds;
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
@@ -73,6 +81,7 @@ class CreateAlbumDto {
|
||||
|
||||
return CreateAlbumDto(
|
||||
albumName: mapValueOfType<String>(json, r'albumName')!,
|
||||
albumUsers: AlbumUserCreateDto.listFromJson(json[r'albumUsers']),
|
||||
assetIds: json[r'assetIds'] is Iterable
|
||||
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
|
||||
: const [],
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// 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 AlbumUserCreateDto
|
||||
void main() {
|
||||
// final instance = AlbumUserCreateDto();
|
||||
|
||||
group('test AlbumUserCreateDto', () {
|
||||
// AlbumUserRole role
|
||||
test('to test the property `role`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// String userId
|
||||
test('to test the property `userId`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
+7
@@ -21,6 +21,12 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// This property was added in v1.104.0
|
||||
// List<AlbumUserCreateDto> albumUsers (default value: const [])
|
||||
test('to test the property `albumUsers`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// List<String> assetIds (default value: const [])
|
||||
test('to test the property `assetIds`', () async {
|
||||
// TODO
|
||||
@@ -31,6 +37,7 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// This property was deprecated in v1.104.0
|
||||
// List<String> sharedWithUserIds (default value: const [])
|
||||
test('to test the property `sharedWithUserIds`', () async {
|
||||
// TODO
|
||||
|
||||
Reference in New Issue
Block a user