refreshMultiple method
checks for updates of a subscription
if the response contains new TicketResponse.tickets, it likely updated. Otherwise ignore.
Implementation
Future<TicketResponse> refreshMultiple(RefreshData refreshData) async {
final response = await client.post(
prodApi.resolveUri(
Uri(path: '/aboticket/refreshmultiple'),
),
headers: _makeHeaders(),
body: jsonEncode(refreshData.toJson()),
);
switch (response.statusCode) {
case 404:
throw SubscriptionNotFoundError();
case 401:
throw SubscriptionAlreadyClaimedError();
case 200:
return TicketResponse.fromJson(jsonDecode(response.body));
default:
throw ApiHttpError(response.statusCode);
}
}