1 /*
2  * Copyright (c) 2024-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_REMINDER_AFFECTED_H
17 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_REMINDER_AFFECTED_H
18 
19 #ifdef NOTIFICATION_SMART_REMINDER_SUPPORTED
20 #include <string>
21 #include <vector>
22 
23 #include "nlohmann/json.hpp"
24 #include "notification_flags.h"
25 
26 namespace OHOS {
27 namespace Notification {
28 class ReminderAffected {
29 public:
30     static bool ValidStatus(const nlohmann::json &root, std::string &status);
31     static bool ValidAndGetAffectedBy(
32         const nlohmann::json &affectedByJson, std::vector<std::pair<std::string, std::string>> &affectedBy);
33 
34     bool FromJson(const nlohmann::json &root);
35     std::vector<std::pair<std::string, std::string>> affectedBy_;
36     std::string status_;
37     std::shared_ptr<NotificationFlags> reminderFlags_;
38 
39     constexpr static const char* AFFECTED_BY = "affectedBy";
40     constexpr static const char* DEVICE_TYPE = "deviceType";
41     constexpr static const char* STATUS = "status";
42     static constexpr char STATUS_DEFAULT = 'x';
43     static constexpr char STATUS_DISABLE = '0';
44     static constexpr char STATUS_ENABLE = '1';
45 };
46 }  // namespace Notification
47 }  // namespace OHOS
48 
49 #endif // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_REMINDER_AFFECTED_H
50 #endif
51