diff --git a/packages/shorebird_code_push_client/lib/src/version.dart b/packages/shorebird_code_push_client/lib/src/version.dart index 664d8961..957ca59e 100644 --- a/packages/shorebird_code_push_client/lib/src/version.dart +++ b/packages/shorebird_code_push_client/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '0.5.0+1'; +const packageVersion = '0.6.0+1'; diff --git a/packages/shorebird_code_push_client/pubspec.yaml b/packages/shorebird_code_push_client/pubspec.yaml index 1169e324..4c7c2b5c 100644 --- a/packages/shorebird_code_push_client/pubspec.yaml +++ b/packages/shorebird_code_push_client/pubspec.yaml @@ -1,6 +1,6 @@ name: shorebird_code_push_client description: Library which allows Dart applications to interact with the ShoreBird CodePush API -version: 0.5.0+1 +version: 0.6.0+1 repository: https://github.com/shorebirdtech/shorebird publish_to: none diff --git a/packages/shorebird_code_push_client/test/src/code_push_client_test.dart b/packages/shorebird_code_push_client/test/src/code_push_client_test.dart index afc410fc..059d52c6 100644 --- a/packages/shorebird_code_push_client/test/src/code_push_client_test.dart +++ b/packages/shorebird_code_push_client/test/src/code_push_client_test.dart @@ -2054,6 +2054,7 @@ void main() { currentPeriodCost: Money.fromIntWithCurrency(0, usd), currentPeriodStart: DateTime(2023), currentPeriodEnd: DateTime(2023, 2), + cancelAtPeriodEnd: false, ); when(() => httpClient.send(any())).thenAnswer( diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.dart b/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.dart index 177a2f32..8b3417ab 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.dart @@ -15,6 +15,7 @@ class GetUsageResponse { required this.currentPeriodStart, required this.currentPeriodEnd, required this.currentPeriodCost, + required this.cancelAtPeriodEnd, }); /// Converts a Map to a [GetUsageResponse]. @@ -40,6 +41,10 @@ class GetUsageResponse { /// monthly cost and any overages. @MoneyConverter() final Money currentPeriodCost; + + /// Whether the subscription will be canceled + /// at the end of the current billing period. + final bool cancelAtPeriodEnd; } /// {@template app_usage} diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.g.dart b/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.g.dart index 9d6ec7c2..78956f52 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/get_usage/get_usage_response.g.dart @@ -27,13 +27,16 @@ GetUsageResponse _$GetUsageResponseFromJson(Map json) => 'current_period_end', (v) => DateTime.parse(v as String)), currentPeriodCost: $checkedConvert('current_period_cost', (v) => const MoneyConverter().fromJson(v as int)), + cancelAtPeriodEnd: + $checkedConvert('cancel_at_period_end', (v) => v as bool), ); return val; }, fieldKeyMap: const { 'currentPeriodStart': 'current_period_start', 'currentPeriodEnd': 'current_period_end', - 'currentPeriodCost': 'current_period_cost' + 'currentPeriodCost': 'current_period_cost', + 'cancelAtPeriodEnd': 'cancel_at_period_end' }, ); @@ -45,6 +48,7 @@ Map _$GetUsageResponseToJson(GetUsageResponse instance) => 'current_period_end': instance.currentPeriodEnd.toIso8601String(), 'current_period_cost': const MoneyConverter().toJson(instance.currentPeriodCost), + 'cancel_at_period_end': instance.cancelAtPeriodEnd, }; AppUsage _$AppUsageFromJson(Map json) => $checkedCreate( diff --git a/packages/shorebird_code_push_protocol/lib/src/models/patch_events/patch_install_event.g.dart b/packages/shorebird_code_push_protocol/lib/src/models/patch_events/patch_install_event.g.dart deleted file mode 100644 index c5f851c4..00000000 --- a/packages/shorebird_code_push_protocol/lib/src/models/patch_events/patch_install_event.g.dart +++ /dev/null @@ -1,49 +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 'patch_install_event.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -PatchInstallEvent _$PatchInstallEventFromJson(Map json) => - $checkedCreate( - 'PatchInstallEvent', - json, - ($checkedConvert) { - final val = PatchInstallEvent( - clientId: $checkedConvert('client_id', (v) => v as String), - appId: $checkedConvert('app_id', (v) => v as String), - releaseVersion: - $checkedConvert('release_version', (v) => v as String), - patchNumber: $checkedConvert('patch_number', (v) => v as int), - platform: $checkedConvert( - 'platform', (v) => $enumDecode(_$ReleasePlatformEnumMap, v)), - arch: $checkedConvert('arch', (v) => v as String), - ); - return val; - }, - fieldKeyMap: const { - 'clientId': 'client_id', - 'appId': 'app_id', - 'releaseVersion': 'release_version', - 'patchNumber': 'patch_number' - }, - ); - -Map _$PatchInstallEventToJson(PatchInstallEvent instance) => - { - 'client_id': instance.clientId, - 'app_id': instance.appId, - 'release_version': instance.releaseVersion, - 'patch_number': instance.patchNumber, - 'platform': _$ReleasePlatformEnumMap[instance.platform]!, - 'arch': instance.arch, - }; - -const _$ReleasePlatformEnumMap = { - ReleasePlatform.android: 'android', - ReleasePlatform.ios: 'ios', -}; diff --git a/packages/shorebird_code_push_protocol/test/src/messages/get_usage/get_usage_response_test.dart b/packages/shorebird_code_push_protocol/test/src/messages/get_usage/get_usage_response_test.dart index adb0e83d..910dfea0 100644 --- a/packages/shorebird_code_push_protocol/test/src/messages/get_usage/get_usage_response_test.dart +++ b/packages/shorebird_code_push_protocol/test/src/messages/get_usage/get_usage_response_test.dart @@ -18,6 +18,7 @@ void main() { currentPeriodCost: Money.fromIntWithCurrency(0, usd), currentPeriodStart: DateTime(2021), currentPeriodEnd: DateTime(2021, 1, 2), + cancelAtPeriodEnd: false, ); expect( GetUsageResponse.fromJson(response.toJson()).toJson(),