AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::settings::SettingEventSender Class Reference

#include <SettingEventSender.h>

Inheritance diagram for alexaClientSDK::settings::SettingEventSender:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::settings::SettingEventSender:
Collaboration graph
[legend]

Public Member Functions

 ~SettingEventSender ()
 
SettingEventSenderInterface Functions
std::shared_future< bool > sendChangedEvent (const std::string &value) override
 
std::shared_future< bool > sendReportEvent (const std::string &value) override
 
std::shared_future< bool > sendStateReportEvent (const std::string &payload) override
 
void cancel () override
 
- Public Member Functions inherited from alexaClientSDK::settings::SettingEventSenderInterface
virtual ~SettingEventSenderInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< SettingEventSendercreate (const SettingEventMetadata &metadata, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, const std::vector< int > &retryTable=getDefaultRetryTable())
 

Detailed Description

An implementation of the SettingEventSenderInterface.

Constructor & Destructor Documentation

◆ ~SettingEventSender()

alexaClientSDK::settings::SettingEventSender::~SettingEventSender ( )

Destructor. Cancels any pending requests.

Member Function Documentation

◆ cancel()

void alexaClientSDK::settings::SettingEventSender::cancel ( )
overridevirtual

Cancels an ongoing event transmission to AVS.

Implements alexaClientSDK::settings::SettingEventSenderInterface.

◆ create()

static std::unique_ptr<SettingEventSender> alexaClientSDK::settings::SettingEventSender::create ( const SettingEventMetadata metadata,
std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
const std::vector< int > &  retryTable = getDefaultRetryTable() 
)
static

Creates an instance of the .

Parameters
metadataContains the information needed to construct AVS events.
messageSenderThe delivery service for the AVS events.
Returns
The shared pointer to the created SettingEventSender instance.

◆ sendChangedEvent()

std::shared_future<bool> alexaClientSDK::settings::SettingEventSender::sendChangedEvent ( const std::string &  value)
overridevirtual

Sends a setting changed event to AVS. This event follows the format:

{
"event": {
"header": {
"namespace": "{eventNamespace}",
"name": "{eventChangedName}",
"messageId": "xxxxx"
},
"payload": {
"{settingName}": yyyyy
}
}
}

The setting specific fields should be specified in a SettingEventMetadata passed as an argument on creation this object.

Parameters
valueThe value of the setting. It should be a valid JSON string value.
Returns
A future expressing if the event has been guaranteed to be sent to AVS.

Implements alexaClientSDK::settings::SettingEventSenderInterface.

◆ sendReportEvent()

std::shared_future<bool> alexaClientSDK::settings::SettingEventSender::sendReportEvent ( const std::string &  value)
overridevirtual

Sends a report setting event to AVS.

The setting report event follows the format:

{
"event": {
"header": {
"namespace": "{eventNamespace}",
"name": "{eventReportName}",
"messageId": "xxxxx"
},
"payload": {
"{settingName}": yyyyy
}
}
}

The setting specific fields should be specified in a SettingEventMetadata passed as an argument on creation this object.

Parameters
valueThe value of the setting. It should be a valid JSON string value.
Returns
A future expressing if the event has been guaranteed to be sent to AVS.

Implements alexaClientSDK::settings::SettingEventSenderInterface.

◆ sendStateReportEvent()

std::shared_future<bool> alexaClientSDK::settings::SettingEventSender::sendStateReportEvent ( const std::string &  payload)
overridevirtual

Sends a state report event to AVS.

The setting state report event follows the format:

{
"event": {
"header": {
"namespace": "{eventNamespace}",
"name": "{eventReportName}",
"messageId": "xxxxx"
},
"payload": {payload}
}
}

The setting specific fields should be specified in a SettingEventMetadata passed as an argument on creation this object.

Parameters
payloadThe report payload. It should be a valid JSON element.
Returns
A future expressing if the event has been guaranteed to be sent to AVS.

Implements alexaClientSDK::settings::SettingEventSenderInterface.


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

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