update method

Future<InboxItem> update(
  1. String id, {
  2. required String state,
  3. DateTime? snoozedUntil,
})

Moves an item to state, one of InboxItemState. A snoozed item resurfaces at snoozedUntil.

Implementation

Future<InboxItem> update(
  String id, {
  required String state,
  DateTime? snoozedUntil,
}) async {
  final body = pruned({
    'state': state,
    'snoozedUntil': snoozedUntil?.toUtc().toIso8601String(),
  });
  return InboxItem.fromJson(
      await _http.object('PATCH', '/inbox/${segment(id)}', body: body));
}