AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CBLAuthorizationObserverInterface.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 ACSDKAUTHORIZATIONINTERFACES_LWA_CBLAUTHORIZATIONOBSERVERINTERFACE_H_
17 #define ACSDKAUTHORIZATIONINTERFACES_LWA_CBLAUTHORIZATIONOBSERVERINTERFACE_H_
18 
19 #include <string>
20 
21 namespace alexaClientSDK {
22 namespace acsdkAuthorizationInterfaces {
23 namespace lwa {
24 
27 public:
29  virtual ~CBLAuthorizationObserverInterface() = default;
30 
32  struct CustomerProfile {
35 
38 
40  CustomerProfile() = default;
41 
48  CustomerProfile(const std::string& pName, const std::string& pEmail);
49  };
50 
58  virtual void onRequestAuthorization(const std::string& url, const std::string& code) = 0;
59 
66  virtual void onCheckingForAuthorization() = 0;
67 
73  virtual void onCustomerProfileAvailable(const CustomerProfile& customerProfile) = 0;
74 };
75 
77  const std::string& pName,
78  const std::string& pEmail) :
79  name{pName},
80  email{pEmail} {
81 }
82 
91 inline bool operator==(
94  return lhs.name == rhs.name && lhs.email == rhs.email;
95 }
96 
97 } // namespace lwa
98 } // namespace acsdkAuthorizationInterfaces
99 } // namespace alexaClientSDK
100 
101 #endif // ACSDKAUTHORIZATIONINTERFACES_LWA_CBLAUTHORIZATIONOBSERVERINTERFACE_H_
std::string name
The name associated with the account.
Definition: CBLAuthorizationObserverInterface.h:34
::std::string string
Definition: gtest-port.h:1097
virtual void onRequestAuthorization(const std::string &url, const std::string &code)=0
An optional struct that may return additional information.
Definition: CBLAuthorizationObserverInterface.h:32
std::string email
The email associated with the account.
Definition: CBLAuthorizationObserverInterface.h:37
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual void onCustomerProfileAvailable(const CustomerProfile &customerProfile)=0
An observer interface used for callbacks when authorizing using CBL in LWAAuthorizationAdapterInterfa...
Definition: CBLAuthorizationObserverInterface.h:26
bool operator==(const CBLAuthorizationObserverInterface::CustomerProfile &lhs, const CBLAuthorizationObserverInterface::CustomerProfile &rhs)
Definition: CBLAuthorizationObserverInterface.h:91

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