AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AlexaInterfaceMessageSenderInterface.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_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_ALEXAINTERFACEMESSAGESENDERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_ALEXAINTERFACEMESSAGESENDERINTERFACE_H_
18 
19 #include <memory>
20 
23 
24 namespace alexaClientSDK {
25 namespace avsCommon {
26 namespace sdkInterfaces {
27 
32 public:
35  enum class ErrorResponseType {
38 
41 
44 
47 
50 
53 
56 
59 
62 
65 
68 
71 
74 
77 
80 
83 
86 
89 
92 
95 
98  };
99 
105  ACTION_NOT_PERMITTED_FOR_CONTENT,
106 
108  CONFIRMATION_REQUIRED,
109 
111  CONTENT_NOT_RECORDABLE,
112 
114  NOT_SUBSCRIBED,
115 
117  RECORDING_EXISTS,
118 
120  STORAGE_FULL,
121 
126  TITLE_DISAMBIGUATION_REQUIRED,
127 
129  TUNER_OCCUPIED,
130 
132  NONE
133  };
134 
138  virtual ~AlexaInterfaceMessageSenderInterface() = default;
139 
151  virtual bool sendResponseEvent(
152  const std::string& instance,
153  const std::string& correlationToken,
154  const avsCommon::avs::AVSMessageEndpoint& endpoint,
155  const std::string& jsonPayload = "{}") = 0;
156 
170  virtual bool sendResponseEvent(
171  const std::string& instance,
172  const std::string& correlationToken,
173  const avsCommon::avs::AVSMessageEndpoint& endpoint,
174  const std::string& responseNamespace,
175  const std::string& responseName,
176  const std::string& jsonPayload = "{}") = 0;
177 
189  virtual bool sendErrorResponseEvent(
190  const std::string& instance,
191  const std::string& correlationToken,
192  const avsCommon::avs::AVSMessageEndpoint& endpoint,
193  const ErrorResponseType errorType,
194  const std::string& errorMessage = "") = 0;
195 
207  virtual bool sendErrorResponseEvent(
208  const std::string& instance,
209  const std::string& correlationToken,
210  const avsCommon::avs::AVSMessageEndpoint& endpoint,
211  const std::string& responseNamespace,
212  const std::string& jsonPayload = "{}") = 0;
213 
223  virtual bool sendDeferredResponseEvent(
224  const std::string& instance,
225  const std::string& correlationToken,
226  const int estimatedDeferralInSeconds = 0) = 0;
227 
236 
245 };
246 
248  AlexaVideoErrorResponseType responseType) {
249  switch (responseType) {
251  return "ACTION_NOT_PERMITTED_FOR_CONTENT";
253  return "CONFIRMATION_REQUIRED";
255  return "CONTENT_NOT_RECORDABLE";
257  return "NOT_SUBSCRIBED";
259  return "RECORDING_EXISTS";
261  return "STORAGE_FULL";
263  return "TITLE_DISAMBIGUATION_REQUIRED";
265  return "TUNER_OCCUPIED";
267  return "";
268  }
269  return "UNKNOWN";
270 }
271 
274  switch (responseType) {
275  case avs::AlexaResponseType::SUCCESS: // not supported
311  }
313 }
314 
315 } // namespace sdkInterfaces
316 } // namespace avsCommon
317 } // namespace alexaClientSDK
318 
319 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_ALEXAINTERFACEMESSAGESENDERINTERFACE_H_
The endpoint can&#39;t handle the directive because it is in a calibration phase, such as warming up...
virtual bool sendDeferredResponseEvent(const std::string &instance, const std::string &correlationToken, const int estimatedDeferralInSeconds=0)=0
ErrorResponseType
Definition: AlexaInterfaceMessageSenderInterface.h:35
The caller does not have the permission to perform specified operation on endpoint.
AlexaResponseType
Definition: AlexaResponseType.h:30
::std::string string
Definition: gtest-port.h:1097
The endpoint can&#39;t handle the directive because it&#39;s firmware is out of date.
The endpoint can&#39;t handle the directive because it has experienced a hardware malfunction.
AlexaVideoErrorResponseType
Definition: AlexaInterfaceMessageSenderInterface.h:102
The operation can&#39;t be performed because the endpoint is already in operation.
An error occurred that can&#39;t be described by one of the other error types.
static ErrorResponseType alexaResponseTypeToErrorType(const avsCommon::avs::AlexaResponseType responseType)
Definition: AlexaInterfaceMessageSenderInterface.h:273
Indicates an additional confirmation must occur before the requested action can be completed...
The endpoint can&#39;t handle the directive because it is performing another action.
The endpoint can&#39;t be set to the specified value because it&#39;s outside the acceptable range...
Invalid value or unsupported value passed.
The endpoint was busy and could not perform the requested operation.
The endpoint can&#39;t be set to the specified value because it&#39;s outside the acceptable temperature rang...
The user is not subscribed to the content for a channel or other subscription-based content...
The endpoint can&#39;t handle the directive because the battery power is too low.
The endpoint can&#39;t handle the requested operation because it is in a calibration phase, such as warming up.
virtual bool sendErrorResponseEvent(const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const ErrorResponseType errorType, const std::string &errorMessage="")=0
static std::string alexaVideoErrorResponseToString(AlexaVideoErrorResponseType responseType)
Definition: AlexaInterfaceMessageSenderInterface.h:247
The endpoint can&#39;t handle the directive because it doesn&#39;t support the requested power level...
The endpoint could not perform the requested operation as its battery was low.
An error occurred that can&#39;t be described by one of the other error types.
The maximum rate at which an endpoint or bridge can process directives has been exceeded.
Definition: AVSMessageEndpoint.h:32
The maximum rate at which an endpoint or bridge can handle the requests has been exceeded.
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
The endpoint was busy and could not perform because it has experienced a hardware malfunction...
Indicates that a recording request failed because of a scheduling conflict with another recording...
The endpoint can&#39;t be set to the specified value because it&#39;s outside the acceptable temperature rang...
The endpoint can&#39;t be set to the specified value because of its current mode of operation.
The endpoint can&#39;t be set to the specified value because it&#39;s outside the acceptable range...
Definition: AlexaInterfaceMessageSenderInterface.h:31
The endpoint can&#39;t be set to the specified value because of its current mode of operation.
The endpoint was busy and could not perform because its firmware is out of date.
virtual bool sendResponseEvent(const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const std::string &jsonPayload="{}")=0

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