chore(code_push_protocol): remove GetReleasePatchesResponse (#1344)
This commit is contained in:
-1
@@ -1 +0,0 @@
|
||||
export 'get_release_patches_response.dart';
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';
|
||||
|
||||
part 'get_release_patches_response.g.dart';
|
||||
|
||||
/// {@template get_release_patches_response}
|
||||
/// The response to /api/v1/apps/$appId/releases/$releaseId/patches
|
||||
/// {@endtemplate}
|
||||
@JsonSerializable()
|
||||
class GetReleasePatchesResponse {
|
||||
/// {@macro get_release_patches_response}
|
||||
const GetReleasePatchesResponse({required this.patches});
|
||||
|
||||
/// Converts a Map<String, dynamic> to a [GetReleasePatchesResponse]
|
||||
factory GetReleasePatchesResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetReleasePatchesResponseFromJson(json);
|
||||
|
||||
/// Converts a [GetReleasePatchesResponse] to a Map<String, dynamic>
|
||||
Json toJson() => _$GetReleasePatchesResponseToJson(this);
|
||||
|
||||
/// Patch numbers for a given release mapped to their artifacts.
|
||||
final Map<int, List<PatchArtifact>> patches;
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
// ignore_for_file: implicit_dynamic_parameter, require_trailing_commas, cast_nullable_to_non_nullable, lines_longer_than_80_chars
|
||||
|
||||
part of 'get_release_patches_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GetReleasePatchesResponse _$GetReleasePatchesResponseFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'GetReleasePatchesResponse',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
final val = GetReleasePatchesResponse(
|
||||
patches: $checkedConvert(
|
||||
'patches',
|
||||
(v) => (v as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(
|
||||
int.parse(k),
|
||||
(e as List<dynamic>)
|
||||
.map((e) => PatchArtifact.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList()),
|
||||
)),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetReleasePatchesResponseToJson(
|
||||
GetReleasePatchesResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'patches': instance.patches.map(
|
||||
(k, e) => MapEntry(k.toString(), e.map((e) => e.toJson()).toList())),
|
||||
};
|
||||
@@ -13,7 +13,6 @@ export 'create_user/create_user.dart';
|
||||
export 'get_apps/get_apps.dart';
|
||||
export 'get_overages/get_overages.dart';
|
||||
export 'get_release_artifacts/get_release_artifacts.dart';
|
||||
export 'get_release_patches/get_release_patches.dart';
|
||||
export 'get_releases/get_releases.dart';
|
||||
export 'get_usage/get_usage.dart';
|
||||
export 'promote_patch/promote_patch.dart';
|
||||
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group(GetReleasePatchesResponse, () {
|
||||
test('can be (de)serialized', () {
|
||||
final response = GetReleasePatchesResponse(
|
||||
patches: {
|
||||
1: [
|
||||
PatchArtifact(
|
||||
id: 1,
|
||||
patchId: 1,
|
||||
arch: 'aarch64',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
createdAt: DateTime(2023),
|
||||
),
|
||||
PatchArtifact(
|
||||
id: 2,
|
||||
patchId: 1,
|
||||
arch: 'aarch64',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
createdAt: DateTime(2023),
|
||||
),
|
||||
],
|
||||
2: [
|
||||
PatchArtifact(
|
||||
id: 3,
|
||||
patchId: 2,
|
||||
arch: 'aarch64',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
createdAt: DateTime(2023),
|
||||
),
|
||||
PatchArtifact(
|
||||
id: 4,
|
||||
patchId: 3,
|
||||
arch: 'aarch64',
|
||||
platform: ReleasePlatform.android,
|
||||
url: 'https://example.com',
|
||||
size: 42,
|
||||
hash: 'sha256:1234567890',
|
||||
createdAt: DateTime(2023),
|
||||
),
|
||||
],
|
||||
},
|
||||
);
|
||||
expect(
|
||||
GetReleasePatchesResponse.fromJson(response.toJson()).toJson(),
|
||||
equals(response.toJson()),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user