AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
EndpointRegistrationObserverInterface.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 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_ENDPOINTS_ENDPOINTREGISTRATIONOBSERVERINTERFACE_H_
16 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_ENDPOINTS_ENDPOINTREGISTRATIONOBSERVERINTERFACE_H_
17 
21 
22 namespace alexaClientSDK {
23 namespace avsCommon {
24 namespace sdkInterfaces {
25 namespace endpoints {
26 
31 public:
35  enum class RegistrationResult {
37  SUCCEEDED,
50  };
51 
55  enum class UpdateResult {
57  SUCCEEDED,
63  NOT_REGISTERED,
70  };
71 
75  enum class DeregistrationResult {
77  SUCCEEDED,
79  NOT_REGISTERED,
89  PENDING_DEREGISTRATION
90  };
91 
95  virtual ~EndpointRegistrationObserverInterface() = default;
96 
104  virtual void onEndpointRegistration(
105  const EndpointIdentifier& endpointId,
106  const avs::AVSDiscoveryEndpointAttributes& attributes,
107  const RegistrationResult result) = 0;
108 
116  virtual void onEndpointUpdate(
117  const EndpointIdentifier& endpointId,
118  const avs::AVSDiscoveryEndpointAttributes& attributes,
119  const UpdateResult result) = 0;
120 
127  virtual void onEndpointDeregistration(const EndpointIdentifier& endpointId, const DeregistrationResult result) = 0;
128 
137  const EndpointIdentifier& endpointId,
138  const avs::AVSDiscoveryEndpointAttributes& attributes,
139  const std::vector<avs::CapabilityConfiguration>& capabilities) {
140  }
141 };
142 
150 inline std::ostream& operator<<(
151  std::ostream& stream,
153  switch (registrationResult) {
155  stream << "SUCCEEDED";
156  break;
158  stream << "CONFIGURATION_ERROR";
159  break;
161  stream << "INTERNAL_ERROR";
162  break;
164  stream << "PENDING_REGISTRATION";
165  break;
167  stream << "PENDING_DEREGISTRATION";
168  break;
170  stream << "PENDING_UPDATE";
171  break;
173  stream << "ALREADY_REGISTERED";
174  break;
175  default:
176  stream << "UNKNOWN";
177  break;
178  }
179  return stream;
180 }
181 
189 inline std::ostream& operator<<(
190  std::ostream& stream,
192  switch (deregistrationResult) {
194  stream << "SUCCEEDED";
195  break;
197  stream << "NOT_REGISTERED";
198  break;
200  stream << "CONFIGURATION_ERROR";
201  break;
203  stream << "INTERNAL_ERROR";
204  break;
206  stream << "PENDING_REGISTRATION";
207  break;
209  stream << "PENDING_DEREGISTRATION";
210  break;
212  stream << "PENDING_UPDATE";
213  break;
214  default:
215  stream << "UNKNOWN";
216  break;
217  }
218  return stream;
219 }
220 
228 inline std::ostream& operator<<(
229  std::ostream& stream,
231  switch (updateResult) {
233  stream << "SUCCEEDED";
234  break;
236  stream << "NOT_REGISTERED";
237  break;
239  stream << "CONFIGURATION_ERROR";
240  break;
242  stream << "INTERNAL_ERROR";
243  break;
245  stream << "PENDING_REGISTRATION";
246  break;
248  stream << "PENDING_DEREGISTRATION";
249  break;
251  stream << "PENDING_UPDATE";
252  default:
253  stream << "UNKNOWN";
254  break;
255  }
256  return stream;
257 }
258 
259 } // namespace endpoints
260 } // namespace sdkInterfaces
261 } // namespace avsCommon
262 } // namespace alexaClientSDK
263 
264 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_ENDPOINTS_ENDPOINTREGISTRATIONOBSERVERINTERFACE_H_
std::ostream & operator<<(std::ostream &stream, const EndpointRegistrationObserverInterface::RegistrationResult &registrationResult)
Definition: EndpointRegistrationObserverInterface.h:150
virtual void onEndpointUpdate(const EndpointIdentifier &endpointId, const avs::AVSDiscoveryEndpointAttributes &attributes, const UpdateResult result)=0
virtual void onEndpointRegistration(const EndpointIdentifier &endpointId, const avs::AVSDiscoveryEndpointAttributes &attributes, const RegistrationResult result)=0
virtual void onPendingEndpointRegistrationOrUpdate(const EndpointIdentifier &endpointId, const avs::AVSDiscoveryEndpointAttributes &attributes, const std::vector< avs::CapabilityConfiguration > &capabilities)
Definition: EndpointRegistrationObserverInterface.h:136
Definition: AVSDiscoveryEndpointAttributes.h:41
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string EndpointIdentifier
Definition: EndpointIdentifier.h:38
virtual void onEndpointDeregistration(const EndpointIdentifier &endpointId, const DeregistrationResult result)=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