AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::integration::AuthObserver Class Reference

#include <AuthObserver.h>

Inheritance diagram for alexaClientSDK::integration::AuthObserver:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::integration::AuthObserver:
Collaboration graph
[legend]

Public Member Functions

 AuthObserver ()
 
void onAuthStateChange (const avsCommon::sdkInterfaces::AuthObserverInterface::State, const avsCommon::sdkInterfaces::AuthObserverInterface::Error=avsCommon::sdkInterfaces::AuthObserverInterface::Error::SUCCESS) override
 
AuthObserverInterface::State getAuthState () const
 
bool waitFor (const avsCommon::sdkInterfaces::AuthObserverInterface::State, const std::chrono::seconds=std::chrono::seconds(20))
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
virtual ~AuthObserverInterface ()=default
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface
enum  State {
  State::UNINITIALIZED, State::REFRESHED, State::EXPIRED, State::UNRECOVERABLE_ERROR,
  State::AUTHORIZING
}
 The enum State describes the state of authorization. More...
 
enum  Error {
  Error::SUCCESS, Error::UNKNOWN_ERROR, Error::AUTHORIZATION_FAILED, Error::UNAUTHORIZED_CLIENT,
  Error::SERVER_ERROR, Error::INVALID_REQUEST, Error::INVALID_VALUE, Error::AUTHORIZATION_EXPIRED,
  Error::UNSUPPORTED_GRANT_TYPE, Error::INVALID_CODE_PAIR, Error::AUTHORIZATION_PENDING, Error::SLOW_DOWN,
  Error::INTERNAL_ERROR, Error::INVALID_CBL_CLIENT_ID
}
 The enum Error encodes possible errors which may occur when changing state. More...
 

Constructor & Destructor Documentation

◆ AuthObserver()

alexaClientSDK::integration::AuthObserver::AuthObserver ( )

Member Function Documentation

◆ getAuthState()

AuthObserverInterface::State alexaClientSDK::integration::AuthObserver::getAuthState ( ) const

◆ onAuthStateChange()

void alexaClientSDK::integration::AuthObserver::onAuthStateChange ( const avsCommon::sdkInterfaces::AuthObserverInterface::State  newState,
const avsCommon::sdkInterfaces::AuthObserverInterface::Error  error = avsCommon::sdkInterfaces::AuthObserverInterface::Error::SUCCESS 
)
overridevirtual

Notification that an authorization state has changed.

Note
Implementations of this method must not call AuthDelegate methods because the AuthDelegate may be in a 'locked' state at the time this call is made.
Parameters
newStateThe new state of the authorization token.
errorThe error associated to the state change.

Implements alexaClientSDK::avsCommon::sdkInterfaces::AuthObserverInterface.

◆ waitFor()

bool alexaClientSDK::integration::AuthObserver::waitFor ( const avsCommon::sdkInterfaces::AuthObserverInterface::State  authState,
const std::chrono::seconds  duration = std::chrono::seconds(20) 
)

The documentation for this class was generated from the following files:

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