AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CapabilityConfiguration.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_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYCONFIGURATION_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYCONFIGURATION_H_
18 
19 #include <map>
20 #include <string>
21 #include <unordered_map>
22 #include <vector>
23 
25 
26 namespace alexaClientSDK {
27 namespace avsCommon {
28 namespace avs {
29 
31 static const auto CAPABILITY_INTERFACE_TYPE_KEY = "type";
33 static const auto CAPABILITY_INTERFACE_NAME_KEY = "interface";
35 static const auto CAPABILITY_INTERFACE_VERSION_KEY = "version";
37 static const auto CAPABILITY_INTERFACE_CONFIGURATIONS_KEY = "configurations";
38 
44  static constexpr const char* ALEXA_INTERFACE_TYPE = "AlexaInterface";
45 
47  using AdditionalConfigurations = std::map<std::string, std::string>;
48 
52  struct Properties {
58  std::vector<std::string> supportedList;
61 
70  Properties(
71  bool isRetrievableIn = false,
72  bool isProactivelyReportedIn = false,
73  const std::vector<std::string>& supportedListIn = std::vector<std::string>(),
75  };
76 
80  CapabilityConfiguration() = default;
81 
95  CapabilityConfiguration(const std::unordered_map<std::string, std::string>& capabilityConfigurationIn);
96 
108  const std::string& typeIn,
109  const std::string& interfaceNameIn,
110  const std::string& versionIn,
113  const AdditionalConfigurations& additionalConfigurationsIn = AdditionalConfigurations());
114 
128 };
129 
137 
145 
153 bool operator==(const CapabilityConfiguration& lhs, const CapabilityConfiguration& rhs);
154 
162 bool operator!=(const CapabilityConfiguration& lhs, const CapabilityConfiguration& rhs);
163 
171 bool operator==(
172  const std::shared_ptr<CapabilityConfiguration>& lhs,
173  const std::shared_ptr<CapabilityConfiguration>& rhs);
174 
182 bool operator!=(
183  const std::shared_ptr<CapabilityConfiguration>& lhs,
184  const std::shared_ptr<CapabilityConfiguration>& rhs);
185 
186 } // namespace avs
187 } // namespace avsCommon
188 } // namespace alexaClientSDK
189 
190 namespace std {
191 
195 template <>
196 struct hash<alexaClientSDK::avsCommon::avs::CapabilityConfiguration> {
197  size_t operator()(const alexaClientSDK::avsCommon::avs::CapabilityConfiguration& in) const;
198 };
199 
203 template <>
204 struct hash<std::shared_ptr<alexaClientSDK::avsCommon::avs::CapabilityConfiguration>> {
205  size_t operator()(const std::shared_ptr<alexaClientSDK::avsCommon::avs::CapabilityConfiguration>& in) const;
206 };
207 
208 } // namespace std
209 
210 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYCONFIGURATION_H_
static const auto CAPABILITY_INTERFACE_VERSION_KEY
Key for interface version in the CapabilityConfiguration map.
Definition: CapabilityConfiguration.h:35
bool isRetrievable
boolean indicating if the capability properties can be retrieved using the ReportState Directive...
Definition: CapabilityConfiguration.h:54
avsCommon::utils::Optional< bool > isNonControllable
The optional nonControllable properties flag.
Definition: CapabilityConfiguration.h:60
static constexpr const char * ALEXA_INTERFACE_TYPE
Alexa interface type.
Definition: CapabilityConfiguration.h:44
std::string interfaceName
The mandatory name of the Alexa interface.
Definition: CapabilityConfiguration.h:118
::std::string string
Definition: gtest-port.h:1097
Definition: CapabilityConfiguration.h:190
static const auto CAPABILITY_INTERFACE_TYPE_KEY
Key for interface type in the CapabilityConfiguration map.
Definition: CapabilityConfiguration.h:31
static const auto CAPABILITY_INTERFACE_CONFIGURATIONS_KEY
Key for interface configurations in the CapabilityConfiguration map.
Definition: CapabilityConfiguration.h:37
bool operator==(const BlockingPolicy &lhs, const BlockingPolicy &rhs)
static const auto CAPABILITY_INTERFACE_NAME_KEY
Key for interface name in the CapabilityConfiguration map.
Definition: CapabilityConfiguration.h:33
bool operator!=(const BlockingPolicy &lhs, const BlockingPolicy &rhs)
std::string type
The mandatory type of interface for this Capability.
Definition: CapabilityConfiguration.h:116
Properties(bool isRetrievableIn=false, bool isProactivelyReportedIn=false, const std::vector< std::string > &supportedListIn=std::vector< std::string >(), const avsCommon::utils::Optional< bool > &isNonControllableIn=avsCommon::utils::Optional< bool >())
AdditionalConfigurations additionalConfigurations
Definition: CapabilityConfiguration.h:127
avsCommon::utils::Optional< std::string > instanceName
The optional instance name of the Capability.
Definition: CapabilityConfiguration.h:122
avsCommon::utils::Optional< Properties > properties
The optional properties field of the Capability.
Definition: CapabilityConfiguration.h:124
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool isProactivelyReported
boolean indicating if the capability properties are proactively reported using the ChangeReport Event...
Definition: CapabilityConfiguration.h:56
Definition: CapabilityConfiguration.h:42
std::string version
The mandatory version of the Capability.
Definition: CapabilityConfiguration.h:120
std::vector< std::string > supportedList
The list of supported properties of the capability agent.
Definition: CapabilityConfiguration.h:58
std::map< std::string, std::string > AdditionalConfigurations
Alias for additional configurations.
Definition: CapabilityConfiguration.h:47

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