rename stuff

This commit is contained in:
mgabor
2024-04-16 18:14:08 +02:00
parent 38bab135af
commit 9677d6108a
34 changed files with 471 additions and 487 deletions
+2 -2
View File
@@ -61,8 +61,8 @@ part 'model/activity_response_dto.dart';
part 'model/activity_statistics_response_dto.dart';
part 'model/add_users_dto.dart';
part 'model/album_count_response_dto.dart';
part 'model/album_permission_response_dto.dart';
part 'model/album_response_dto.dart';
part 'model/album_user_response_dto.dart';
part 'model/all_job_status_response_dto.dart';
part 'model/asset_bulk_delete_dto.dart';
part 'model/asset_bulk_update_dto.dart';
@@ -175,7 +175,6 @@ part 'model/server_ping_response.dart';
part 'model/server_stats_response_dto.dart';
part 'model/server_theme_dto.dart';
part 'model/server_version_response_dto.dart';
part 'model/set_album_permission_dto.dart';
part 'model/shared_link_create_dto.dart';
part 'model/shared_link_edit_dto.dart';
part 'model/shared_link_response_dto.dart';
@@ -212,6 +211,7 @@ part 'model/tone_mapping.dart';
part 'model/transcode_hw_accel.dart';
part 'model/transcode_policy.dart';
part 'model/update_album_dto.dart';
part 'model/update_album_user_dto.dart';
part 'model/update_asset_dto.dart';
part 'model/update_library_dto.dart';
part 'model/update_partner_dto.dart';
+49 -49
View File
@@ -485,55 +485,6 @@ class AlbumApi {
}
}
/// Performs an HTTP 'PUT /album/{id}/permission/{userId}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] userId (required):
///
/// * [SetAlbumPermissionDto] setAlbumPermissionDto (required):
Future<Response> setAlbumPermissionWithHttpInfo(String id, String userId, SetAlbumPermissionDto setAlbumPermissionDto,) async {
// ignore: prefer_const_declarations
final path = r'/album/{id}/permission/{userId}'
.replaceAll('{id}', id)
.replaceAll('{userId}', userId);
// ignore: prefer_final_locals
Object? postBody = setAlbumPermissionDto;
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] id (required):
///
/// * [String] userId (required):
///
/// * [SetAlbumPermissionDto] setAlbumPermissionDto (required):
Future<void> setAlbumPermission(String id, String userId, SetAlbumPermissionDto setAlbumPermissionDto,) async {
final response = await setAlbumPermissionWithHttpInfo(id, userId, setAlbumPermissionDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'PATCH /album/{id}' operation and returns the [Response].
/// Parameters:
///
@@ -585,4 +536,53 @@ class AlbumApi {
}
return null;
}
/// Performs an HTTP 'PUT /album/{id}/permission/{userId}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] userId (required):
///
/// * [UpdateAlbumUserDto] updateAlbumUserDto (required):
Future<Response> updateAlbumUserWithHttpInfo(String id, String userId, UpdateAlbumUserDto updateAlbumUserDto,) async {
// ignore: prefer_const_declarations
final path = r'/album/{id}/permission/{userId}'
.replaceAll('{id}', id)
.replaceAll('{userId}', userId);
// ignore: prefer_final_locals
Object? postBody = updateAlbumUserDto;
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] id (required):
///
/// * [String] userId (required):
///
/// * [UpdateAlbumUserDto] updateAlbumUserDto (required):
Future<void> updateAlbumUser(String id, String userId, UpdateAlbumUserDto updateAlbumUserDto,) async {
final response = await updateAlbumUserWithHttpInfo(id, userId, updateAlbumUserDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
}
+4 -4
View File
@@ -200,10 +200,10 @@ class ApiClient {
return AddUsersDto.fromJson(value);
case 'AlbumCountResponseDto':
return AlbumCountResponseDto.fromJson(value);
case 'AlbumPermissionResponseDto':
return AlbumPermissionResponseDto.fromJson(value);
case 'AlbumResponseDto':
return AlbumResponseDto.fromJson(value);
case 'AlbumUserResponseDto':
return AlbumUserResponseDto.fromJson(value);
case 'AllJobStatusResponseDto':
return AllJobStatusResponseDto.fromJson(value);
case 'AssetBulkDeleteDto':
@@ -428,8 +428,6 @@ class ApiClient {
return ServerThemeDto.fromJson(value);
case 'ServerVersionResponseDto':
return ServerVersionResponseDto.fromJson(value);
case 'SetAlbumPermissionDto':
return SetAlbumPermissionDto.fromJson(value);
case 'SharedLinkCreateDto':
return SharedLinkCreateDto.fromJson(value);
case 'SharedLinkEditDto':
@@ -502,6 +500,8 @@ class ApiClient {
return TranscodePolicyTypeTransformer().decode(value);
case 'UpdateAlbumDto':
return UpdateAlbumDto.fromJson(value);
case 'UpdateAlbumUserDto':
return UpdateAlbumUserDto.fromJson(value);
case 'UpdateAssetDto':
return UpdateAssetDto.fromJson(value);
case 'UpdateLibraryDto':
+10 -10
View File
@@ -14,7 +14,6 @@ class AlbumResponseDto {
/// Returns a new [AlbumResponseDto] instance.
AlbumResponseDto({
required this.albumName,
this.albumPermissions = const [],
required this.albumThumbnailAssetId,
required this.assetCount,
this.assets = const [],
@@ -30,14 +29,13 @@ class AlbumResponseDto {
required this.ownerId,
required this.shared,
this.sharedUsers = const [],
this.sharedUsersV2 = const [],
this.startDate,
required this.updatedAt,
});
String albumName;
List<AlbumPermissionResponseDto> albumPermissions;
String? albumThumbnailAssetId;
int assetCount;
@@ -84,9 +82,11 @@ class AlbumResponseDto {
bool shared;
/// Deprecated in favor of albumPermissions
/// Deprecated in favor of users
List<UserResponseDto> sharedUsers;
List<AlbumUserResponseDto> sharedUsersV2;
///
/// 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
@@ -100,7 +100,6 @@ class AlbumResponseDto {
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumResponseDto &&
other.albumName == albumName &&
_deepEquality.equals(other.albumPermissions, albumPermissions) &&
other.albumThumbnailAssetId == albumThumbnailAssetId &&
other.assetCount == assetCount &&
_deepEquality.equals(other.assets, assets) &&
@@ -116,6 +115,7 @@ class AlbumResponseDto {
other.ownerId == ownerId &&
other.shared == shared &&
_deepEquality.equals(other.sharedUsers, sharedUsers) &&
_deepEquality.equals(other.sharedUsersV2, sharedUsersV2) &&
other.startDate == startDate &&
other.updatedAt == updatedAt;
@@ -123,7 +123,6 @@ class AlbumResponseDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumName.hashCode) +
(albumPermissions.hashCode) +
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
(assetCount.hashCode) +
(assets.hashCode) +
@@ -139,16 +138,16 @@ class AlbumResponseDto {
(ownerId.hashCode) +
(shared.hashCode) +
(sharedUsers.hashCode) +
(sharedUsersV2.hashCode) +
(startDate == null ? 0 : startDate!.hashCode) +
(updatedAt.hashCode);
@override
String toString() => 'AlbumResponseDto[albumName=$albumName, albumPermissions=$albumPermissions, albumThumbnailAssetId=$albumThumbnailAssetId, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, owner=$owner, ownerId=$ownerId, shared=$shared, sharedUsers=$sharedUsers, startDate=$startDate, updatedAt=$updatedAt]';
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, owner=$owner, ownerId=$ownerId, shared=$shared, sharedUsers=$sharedUsers, sharedUsersV2=$sharedUsersV2, startDate=$startDate, updatedAt=$updatedAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumName'] = this.albumName;
json[r'albumPermissions'] = this.albumPermissions;
if (this.albumThumbnailAssetId != null) {
json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId;
} else {
@@ -180,6 +179,7 @@ class AlbumResponseDto {
json[r'ownerId'] = this.ownerId;
json[r'shared'] = this.shared;
json[r'sharedUsers'] = this.sharedUsers;
json[r'sharedUsersV2'] = this.sharedUsersV2;
if (this.startDate != null) {
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
} else {
@@ -198,7 +198,6 @@ class AlbumResponseDto {
return AlbumResponseDto(
albumName: mapValueOfType<String>(json, r'albumName')!,
albumPermissions: AlbumPermissionResponseDto.listFromJson(json[r'albumPermissions']),
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
assetCount: mapValueOfType<int>(json, r'assetCount')!,
assets: AssetResponseDto.listFromJson(json[r'assets']),
@@ -214,6 +213,7 @@ class AlbumResponseDto {
ownerId: mapValueOfType<String>(json, r'ownerId')!,
shared: mapValueOfType<bool>(json, r'shared')!,
sharedUsers: UserResponseDto.listFromJson(json[r'sharedUsers']),
sharedUsersV2: AlbumUserResponseDto.listFromJson(json[r'sharedUsersV2']),
startDate: mapDateTime(json, r'startDate', r''),
updatedAt: mapDateTime(json, r'updatedAt', r'')!,
);
@@ -264,7 +264,6 @@ class AlbumResponseDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumName',
'albumPermissions',
'albumThumbnailAssetId',
'assetCount',
'assets',
@@ -277,6 +276,7 @@ class AlbumResponseDto {
'ownerId',
'shared',
'sharedUsers',
'sharedUsersV2',
'updatedAt',
};
}
@@ -10,9 +10,9 @@
part of openapi.api;
class AlbumPermissionResponseDto {
/// Returns a new [AlbumPermissionResponseDto] instance.
AlbumPermissionResponseDto({
class AlbumUserResponseDto {
/// Returns a new [AlbumUserResponseDto] instance.
AlbumUserResponseDto({
required this.readonly,
required this.user,
});
@@ -22,7 +22,7 @@ class AlbumPermissionResponseDto {
UserResponseDto user;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumPermissionResponseDto &&
bool operator ==(Object other) => identical(this, other) || other is AlbumUserResponseDto &&
other.readonly == readonly &&
other.user == user;
@@ -33,7 +33,7 @@ class AlbumPermissionResponseDto {
(user.hashCode);
@override
String toString() => 'AlbumPermissionResponseDto[readonly=$readonly, user=$user]';
String toString() => 'AlbumUserResponseDto[readonly=$readonly, user=$user]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -42,14 +42,14 @@ class AlbumPermissionResponseDto {
return json;
}
/// Returns a new [AlbumPermissionResponseDto] instance and imports its values from
/// Returns a new [AlbumUserResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumPermissionResponseDto? fromJson(dynamic value) {
static AlbumUserResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumPermissionResponseDto(
return AlbumUserResponseDto(
readonly: mapValueOfType<bool>(json, r'readonly')!,
user: UserResponseDto.fromJson(json[r'user'])!,
);
@@ -57,11 +57,11 @@ class AlbumPermissionResponseDto {
return null;
}
static List<AlbumPermissionResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumPermissionResponseDto>[];
static List<AlbumUserResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumUserResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumPermissionResponseDto.fromJson(row);
final value = AlbumUserResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -70,12 +70,12 @@ class AlbumPermissionResponseDto {
return result.toList(growable: growable);
}
static Map<String, AlbumPermissionResponseDto> mapFromJson(dynamic json) {
final map = <String, AlbumPermissionResponseDto>{};
static Map<String, AlbumUserResponseDto> mapFromJson(dynamic json) {
final map = <String, AlbumUserResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumPermissionResponseDto.fromJson(entry.value);
final value = AlbumUserResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -84,14 +84,14 @@ class AlbumPermissionResponseDto {
return map;
}
// maps a json object with a list of AlbumPermissionResponseDto-objects as value to a dart map
static Map<String, List<AlbumPermissionResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumPermissionResponseDto>>{};
// maps a json object with a list of AlbumUserResponseDto-objects as value to a dart map
static Map<String, List<AlbumUserResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumUserResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumPermissionResponseDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = AlbumUserResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
@@ -10,16 +10,16 @@
part of openapi.api;
class SetAlbumPermissionDto {
/// Returns a new [SetAlbumPermissionDto] instance.
SetAlbumPermissionDto({
class UpdateAlbumUserDto {
/// Returns a new [UpdateAlbumUserDto] instance.
UpdateAlbumUserDto({
required this.readonly,
});
bool readonly;
@override
bool operator ==(Object other) => identical(this, other) || other is SetAlbumPermissionDto &&
bool operator ==(Object other) => identical(this, other) || other is UpdateAlbumUserDto &&
other.readonly == readonly;
@override
@@ -28,7 +28,7 @@ class SetAlbumPermissionDto {
(readonly.hashCode);
@override
String toString() => 'SetAlbumPermissionDto[readonly=$readonly]';
String toString() => 'UpdateAlbumUserDto[readonly=$readonly]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -36,25 +36,25 @@ class SetAlbumPermissionDto {
return json;
}
/// Returns a new [SetAlbumPermissionDto] instance and imports its values from
/// Returns a new [UpdateAlbumUserDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SetAlbumPermissionDto? fromJson(dynamic value) {
static UpdateAlbumUserDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return SetAlbumPermissionDto(
return UpdateAlbumUserDto(
readonly: mapValueOfType<bool>(json, r'readonly')!,
);
}
return null;
}
static List<SetAlbumPermissionDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SetAlbumPermissionDto>[];
static List<UpdateAlbumUserDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <UpdateAlbumUserDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SetAlbumPermissionDto.fromJson(row);
final value = UpdateAlbumUserDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -63,12 +63,12 @@ class SetAlbumPermissionDto {
return result.toList(growable: growable);
}
static Map<String, SetAlbumPermissionDto> mapFromJson(dynamic json) {
final map = <String, SetAlbumPermissionDto>{};
static Map<String, UpdateAlbumUserDto> mapFromJson(dynamic json) {
final map = <String, UpdateAlbumUserDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SetAlbumPermissionDto.fromJson(entry.value);
final value = UpdateAlbumUserDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -77,14 +77,14 @@ class SetAlbumPermissionDto {
return map;
}
// maps a json object with a list of SetAlbumPermissionDto-objects as value to a dart map
static Map<String, List<SetAlbumPermissionDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SetAlbumPermissionDto>>{};
// maps a json object with a list of UpdateAlbumUserDto-objects as value to a dart map
static Map<String, List<UpdateAlbumUserDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<UpdateAlbumUserDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = SetAlbumPermissionDto.listFromJson(entry.value, growable: growable,);
map[entry.key] = UpdateAlbumUserDto.listFromJson(entry.value, growable: growable,);
}
}
return map;