dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/clients/interfaces/notification.go (about) 1 // 2 // Copyright (C) 2021 IOTech Ltd 3 // 4 // SPDX-License-Identifier: Apache-2.0 5 6 package interfaces 7 8 import ( 9 "context" 10 11 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/common" 12 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/requests" 13 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/responses" 14 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/errors" 15 ) 16 17 // NotificationClient defines the interface for interactions with the Notification endpoint on the EdgeX Foundry support-notifications service. 18 type NotificationClient interface { 19 // SendNotification sends new notifications. 20 SendNotification(ctx context.Context, reqs []requests.AddNotificationRequest) ([]common.BaseWithIdResponse, errors.EdgeX) 21 // NotificationById query notification by id. 22 NotificationById(ctx context.Context, id string) (responses.NotificationResponse, errors.EdgeX) 23 // DeleteNotificationById deletes a notification by id. 24 DeleteNotificationById(ctx context.Context, id string) (common.BaseResponse, errors.EdgeX) 25 // NotificationsByCategory queries notifications with category, offset and limit 26 NotificationsByCategory(ctx context.Context, category string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) 27 // NotificationsByLabel queries notifications with label, offset and limit 28 NotificationsByLabel(ctx context.Context, label string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) 29 // NotificationsByStatus queries notifications with status, offset and limit 30 NotificationsByStatus(ctx context.Context, status string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) 31 // NotificationsByTimeRange query notifications with time range, offset and limit 32 NotificationsByTimeRange(ctx context.Context, start int, end int, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) 33 // NotificationsBySubscriptionName query notifications with subscriptionName, offset and limit 34 NotificationsBySubscriptionName(ctx context.Context, subscriptionName string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) 35 // CleanupNotificationsByAge removes notifications that are older than age. And the corresponding transmissions will also be deleted. 36 // Age is supposed in milliseconds since modified timestamp 37 CleanupNotificationsByAge(ctx context.Context, age int) (common.BaseResponse, errors.EdgeX) 38 // CleanupNotifications removes notifications and the corresponding transmissions. 39 CleanupNotifications(ctx context.Context) (common.BaseResponse, errors.EdgeX) 40 // DeleteProcessedNotificationsByAge removes processed notifications that are older than age. And the corresponding transmissions will also be deleted. 41 // Age is supposed in milliseconds since modified timestamp 42 // Please notice that this API is only for processed notifications (status = PROCESSED). If the deletion purpose includes each kind of notifications, please refer to cleanup API. 43 DeleteProcessedNotificationsByAge(ctx context.Context, age int) (common.BaseResponse, errors.EdgeX) 44 }