AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
TimeZoneHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_TIMEZONEHANDLER_H_
17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_TIMEZONEHANDLER_H_
18 
19 #include <memory>
20 #include <string>
21 
27 
28 namespace alexaClientSDK {
29 namespace capabilityAgents {
30 namespace system {
31 
36 public:
44  static std::unique_ptr<TimeZoneHandler> create(
45  std::shared_ptr<settings::TimeZoneSetting> timeZoneSetting,
46  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender);
47 
54 
58  void handleDirectiveImmediately(std::shared_ptr<avsCommon::avs::AVSDirective> directive) override;
59  void preHandleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
60  void handleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
61  void cancelDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
63 
64 private:
70  void executeHandleDirectiveImmediately(std::shared_ptr<DirectiveInfo> info);
71 
78  void sendProcessingDirectiveException(
79  const std::shared_ptr<avsCommon::avs::AVSDirective>& directive,
80  const std::string& errorMessage);
81 
89  bool handleSetTimeZone(
90  const std::shared_ptr<avsCommon::avs::AVSDirective>& directive,
91  const rapidjson::Document& payload);
92 
100  std::shared_ptr<settings::TimeZoneSetting> timeZoneSetting,
101  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender);
102 
104  std::shared_ptr<settings::TimeZoneSetting> m_timeZoneSetting;
105 
108 };
109 
110 } // namespace system
111 } // namespace capabilityAgents
112 } // namespace alexaClientSDK
113 
114 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_TIMEZONEHANDLER_H_
Definition: CapabilityAgent.h:47
void cancelDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
Definition: TimeZoneHandler.cpp:100
Definition: SettingEventMetadata.h:27
static settings::SettingEventMetadata getTimeZoneMetadata()
Definition: TimeZoneHandler.cpp:152
static std::unique_ptr< TimeZoneHandler > create(std::shared_ptr< settings::TimeZoneSetting > timeZoneSetting, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
Definition: TimeZoneHandler.cpp:61
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
Definition: TimeZoneHandler.cpp:82
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
Definition: TimeZoneHandler.cpp:78
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void handleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
Definition: TimeZoneHandler.cpp:93
void preHandleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
Definition: TimeZoneHandler.cpp:90

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0