AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CapabilitiesDelegateObserverInterface.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_CAPABILITIESDELEGATEOBSERVERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_CAPABILITIESDELEGATEOBSERVERINTERFACE_H_
18 
19 #include <ostream>
20 #include <vector>
21 
22 namespace alexaClientSDK {
23 namespace avsCommon {
24 namespace sdkInterfaces {
25 
30 public:
32  enum class State {
36  SUCCESS,
41  };
42 
44  enum class Error {
48  SUCCESS,
50  UNKNOWN_ERROR,
52  CANCELED,
54  FORBIDDEN,
59  };
60 
64  virtual ~CapabilitiesDelegateObserverInterface() = default;
65 
77  virtual void onCapabilitiesStateChange(
78  State newState,
79  Error newError,
80  const std::vector<std::string>& addedOrUpdatedEndpointIds,
81  const std::vector<std::string>& deletedEndpointIds) = 0;
82 };
83 
91 inline std::ostream& operator<<(std::ostream& stream, const CapabilitiesDelegateObserverInterface::State& state) {
92  switch (state) {
94  return stream << "UNINITIALIZED";
96  return stream << "SUCCESS";
98  return stream << "FATAL_ERROR";
100  return stream << "RETRIABLE_ERROR";
101  }
102  return stream << "Unknown CapabilitiesDelegateObserverInterface::State!: " << state;
103 }
104 
112 inline std::ostream& operator<<(std::ostream& stream, const CapabilitiesDelegateObserverInterface::Error& error) {
113  switch (error) {
115  return stream << "UNINITIALIZED";
117  return stream << "SUCCESS";
119  return stream << "UNKNOWN_ERROR";
121  return stream << "FORBIDDEN";
123  return stream << "SERVER_INTERNAL_ERROR";
125  return stream << "CLIENT_ERROR_BAD_REQUEST";
127  return stream << "CANCELED";
128  }
129  return stream << "Unknown CapabilitiesDelegateObserverInterface::Error!: " << error;
130 }
131 
132 } // namespace sdkInterfaces
133 } // namespace avsCommon
134 } // namespace alexaClientSDK
135 
136 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_CAPABILITIESDELEGATEOBSERVERINTERFACE_H_
std::ostream & operator<<(std::ostream &stream, const AudioInputProcessorObserverInterface::State &state)
Definition: AudioInputProcessorObserverInterface.h:94
HTTP code for invalid request by user.
Definition: HttpResponseCodes.h:41
Error
The enum Error encodes possible errors which may occur when changing state.
Definition: CapabilitiesDelegateObserverInterface.h:44
The request is missing a required parameter, has an invalid value, or is otherwise improperly formed...
Definition: CapabilitiesDelegateObserverInterface.h:29
HTTP code for forbidden request by user.
Definition: HttpResponseCodes.h:43
HTTP code for internal error by server which didn&#39;t fulfill the request.
Definition: HttpResponseCodes.h:45
The message did not go through, but you can retry to see if you succeed.
State
The enum State describes the state of the CapabilitiesDelegate.
Definition: CapabilitiesDelegateObserverInterface.h:32
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
The message did not go through because of issues that need fixing.
virtual void onCapabilitiesStateChange(State newState, Error newError, const std::vector< std::string > &addedOrUpdatedEndpointIds, const std::vector< std::string > &deletedEndpointIds)=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