TF-4308 add data layer for addListLabelToListEmails
This commit is contained in:
@@ -238,4 +238,14 @@ abstract class EmailDataSource {
|
|||||||
List<EmailId> emailIds,
|
List<EmailId> emailIds,
|
||||||
KeyWordIdentifier labelKeyword,
|
KeyWordIdentifier labelKeyword,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -627,4 +627,24 @@ class EmailDataSourceImpl extends EmailDataSource {
|
|||||||
);
|
);
|
||||||
}).catchError(_exceptionThrower.throwException);
|
}).catchError(_exceptionThrower.throwException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
) {
|
||||||
|
return Future.sync(() async {
|
||||||
|
return await emailAPI.addListLabelToListEmail(
|
||||||
|
session,
|
||||||
|
accountId,
|
||||||
|
emailIds,
|
||||||
|
labelKeywords,
|
||||||
|
);
|
||||||
|
}).catchError(_exceptionThrower.throwException);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -601,4 +601,17 @@ class EmailHiveCacheDataSourceImpl extends EmailDataSource {
|
|||||||
})> removeLabelFromThread(Session session, AccountId accountId, List<EmailId> emailIds, KeyWordIdentifier labelKeyword) {
|
})> removeLabelFromThread(Session session, AccountId accountId, List<EmailId> emailIds, KeyWordIdentifier labelKeyword) {
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
) {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -377,4 +377,17 @@ class EmailLocalStorageDataSourceImpl extends EmailDataSource {
|
|||||||
})> removeLabelFromThread(Session session, AccountId accountId, List<EmailId> emailIds, KeyWordIdentifier labelKeyword) {
|
})> removeLabelFromThread(Session session, AccountId accountId, List<EmailId> emailIds, KeyWordIdentifier labelKeyword) {
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
) {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -291,4 +291,17 @@ class EmailSessionStorageDatasourceImpl extends EmailDataSource {
|
|||||||
})> removeLabelFromThread(Session session, AccountId accountId, List<EmailId> emailIds, KeyWordIdentifier labelKeyword) {
|
})> removeLabelFromThread(Session session, AccountId accountId, List<EmailId> emailIds, KeyWordIdentifier labelKeyword) {
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
) {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -970,4 +970,24 @@ class EmailAPI
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
) async {
|
||||||
|
return executeBatchSetEmail(
|
||||||
|
session: session,
|
||||||
|
accountId: accountId,
|
||||||
|
emailIds: emailIds,
|
||||||
|
httpClient: _httpClient,
|
||||||
|
debugLabel: 'addListLabelToListEmail',
|
||||||
|
onGenerateUpdates: (batchIds) =>
|
||||||
|
batchIds.generateMapUpdateObjectListLabel(labelKeywords),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -546,4 +546,22 @@ class EmailRepositoryImpl extends EmailRepository {
|
|||||||
labelKeyword,
|
labelKeyword,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
) {
|
||||||
|
return emailDataSource[DataSourceType.network]!.addListLabelToListEmail(
|
||||||
|
session,
|
||||||
|
accountId,
|
||||||
|
emailIds,
|
||||||
|
labelKeywords,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -195,4 +195,14 @@ abstract class EmailRepository {
|
|||||||
List<EmailId> emailIds,
|
List<EmailId> emailIds,
|
||||||
KeyWordIdentifier labelKeyword,
|
KeyWordIdentifier labelKeyword,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Future<({
|
||||||
|
List<EmailId> emailIdsSuccess,
|
||||||
|
Map<Id, SetError> mapErrors,
|
||||||
|
})> addListLabelToListEmail(
|
||||||
|
Session session,
|
||||||
|
AccountId accountId,
|
||||||
|
List<EmailId> emailIds,
|
||||||
|
List<KeyWordIdentifier> labelKeywords,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user