AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MessageRequestObserverInterface.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_MESSAGEREQUESTOBSERVERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_MESSAGEREQUESTOBSERVERINTERFACE_H_
18 
19 #include <iostream>
20 
21 namespace alexaClientSDK {
22 namespace avsCommon {
23 namespace sdkInterfaces {
24 
29 public:
33  enum class Status {
35  PENDING,
36 
38  SUCCESS,
39 
42 
45 
48 
51 
53  TIMEDOUT,
54 
57 
60 
63 
65  REFUSED,
66 
68  CANCELED,
69 
71  THROTTLED,
72 
75 
78 
81  };
82 
83  /*
84  * Destructor
85  */
86  virtual ~MessageRequestObserverInterface() = default;
87 
94 
95  /*
96  * Called when a message request has been processed by AVS.
97  *
98  * @param status The status of the response that was received.
99  */
101 
102  /*
103  * Called when an exception is thrown when trying to send a message to AVS.
104  */
105  virtual void onExceptionReceived(const std::string& exceptionMessage) = 0;
106 };
107 
115 inline std::ostream& operator<<(std::ostream& stream, MessageRequestObserverInterface::Status status) {
116  switch (status) {
118  return stream << "PENDING";
120  return stream << "SUCCESS";
122  return stream << "SUCCESS_ACCEPTED";
124  return stream << "SUCCESS_NO_CONTENT";
126  return stream << "NOT_CONNECTED";
128  return stream << "NOT_SYNCHRONIZED";
130  return stream << "TIMEDOUT";
132  return stream << "PROTOCOL_ERROR";
134  return stream << "INTERNAL_ERROR";
136  return stream << "SERVER_INTERNAL_ERROR_V2";
138  return stream << "REFUSED";
140  return stream << "CANCELED";
142  return stream << "THROTTLED";
144  return stream << "INVALID_AUTH";
146  return stream << "CLIENT_ERROR_BAD_REQUEST";
148  return stream << "SERVER_OTHER_ERROR";
149  }
150  return stream << "Unknown MessageRequestObserverInterface::Status";
151 }
152 
153 } // namespace sdkInterfaces
154 } // namespace avsCommon
155 } // namespace alexaClientSDK
156 
157 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_MESSAGEREQUESTOBSERVERINTERFACE_H_
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface
Definition: MessageRequestObserverInterface.h:28
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::onResponseStatusReceived
virtual void onResponseStatusReceived(MessageRequestObserverInterface::Status status)
Definition: MessageRequestObserverInterface.h:93
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::onSendCompleted
virtual void onSendCompleted(MessageRequestObserverInterface::Status status)=0
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS_NO_CONTENT
@ SUCCESS_NO_CONTENT
The message was successfully sent but the HTTPReponse had no content.
alexaClientSDK::avsCommon::sdkInterfaces::operator<<
std::ostream & operator<<(std::ostream &stream, const AudioInputProcessorObserverInterface::State &state)
Definition: AudioInputProcessorObserverInterface.h:86
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS_ACCEPTED
@ SUCCESS_ACCEPTED
The message was accepted by the server.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::PROTOCOL_ERROR
@ PROTOCOL_ERROR
The send failed due to an underlying protocol error.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::REFUSED
@ REFUSED
The send failed due to server refusing the request.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::INVALID_AUTH
@ INVALID_AUTH
The access credentials provided to ACL were invalid.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SERVER_INTERNAL_ERROR_V2
@ SERVER_INTERNAL_ERROR_V2
The send failed due to an internal error on the server which sends code 500.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::~MessageRequestObserverInterface
virtual ~MessageRequestObserverInterface()=default
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::PENDING
@ PENDING
The message has not yet been processed for sending.
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::BAD_REQUEST
@ BAD_REQUEST
The send failed due to invalid request sent by the user.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS
@ SUCCESS
The message was successfully sent.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::TIMEDOUT
@ TIMEDOUT
The send failed because of timeout waiting for AVS response.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SERVER_OTHER_ERROR
@ SERVER_OTHER_ERROR
The send failed due to unknown server error.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::INTERNAL_ERROR
@ INTERNAL_ERROR
The send failed due to an internal error within ACL.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::CANCELED
@ CANCELED
The send failed due to server canceling it before the transmission completed.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::THROTTLED
@ THROTTLED
The send failed due to excessive load on the server.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::onExceptionReceived
virtual void onExceptionReceived(const std::string &exceptionMessage)=0
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::NOT_CONNECTED
@ NOT_CONNECTED
The send failed because AVS was not connected.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::NOT_SYNCHRONIZED
@ NOT_SYNCHRONIZED
The send failed because AVS is not synchronized.
alexaClientSDK::avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status
Status
Definition: MessageRequestObserverInterface.h:33

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