AlexaClientSDK
1.19.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Namespaces | |
renderer | |
storage | |
test | |
Classes | |
class | Alarm |
class | Alert |
class | AlertObserverInterface |
class | AlertsCapabilityAgent |
class | AlertScheduler |
class | Reminder |
struct | TimeComparator |
class | Timer |
Functions | |
std::ostream & | operator<< (std::ostream &stream, const Alert::State &state) |
std::ostream & | operator<< (std::ostream &stream, const Alert::StopReason &reason) |
std::ostream & | operator<< (std::ostream &stream, const Alert::ParseFromJsonStatus &status) |
std::ostream & | operator<< (std::ostream &stream, const AlertObserverInterface::State &state) |
static const std::string | TAG ("Alert") |
String to identify log entries originating from this file. More... | |
static Alert::ParseFromJsonStatus | parseAlertAssetConfigurationFromJson (const rapidjson::Value &payload, Alert::AssetConfiguration *assetConfiguration, Alert::DynamicData *dynamicData) |
static bool | hasAsset (const std::string &key, const std::unordered_map< std::string, Alert::Asset > &assets) |
static bool | validateStaticData (const Alert::StaticData &staticData) |
static const std::string | TAG ("AlertsCapabilityAgent") |
String to identify log entries originating from this file. More... | |
static std::shared_ptr< avsCommon::avs::CapabilityConfiguration > | getAlertsCapabilityConfiguration () |
static rapidjson::Value | buildAllAlertsContext (const std::vector< Alert::ContextInfo > &alertsInfo, Document::AllocatorType &allocator) |
static rapidjson::Value | buildActiveAlertsContext (const std::vector< Alert::ContextInfo > &alertsInfo, Document::AllocatorType &allocator) |
static void | submitMetric (const std::shared_ptr< MetricRecorderInterface > &metricRecorder, const std::string &eventName, int count) |
static const std::string | TAG ("AlertScheduler") |
String to identify log entries originating from this file. More... | |
Variables | |
static const std::chrono::minutes | ALERT_PAST_DUE_CUTOFF_MINUTES = std::chrono::minutes(30) |
static const std::string | KEY_TOKEN = "token" |
String for lookup of the token value in a parsed JSON document. More... | |
static const std::string | KEY_SCHEDULED_TIME = "scheduledTime" |
String for lookup of the scheduled time value in a parsed JSON document. More... | |
static const std::string | KEY_ASSETS = "assets" |
String for lookup of the assets array in a parsed JSON document. More... | |
static const std::string | KEY_ASSET_ID = "assetId" |
String for lookup of the asset id within an asset object in a parsed JSON document. More... | |
static const std::string | KEY_ASSET_URL = "url" |
String for lookup of the asset url within an asset object in a parsed JSON document. More... | |
static const std::string | KEY_ASSET_PLAY_ORDER = "assetPlayOrder" |
String for lookup of the asset play order array in a parsed JSON document. More... | |
static const std::string | KEY_LOOP_COUNT = "loopCount" |
String for lookup of the loop count value in a parsed JSON document. More... | |
static const std::string | KEY_LOOP_PAUSE_IN_MILLISECONDS = "loopPauseInMilliSeconds" |
String for lookup of the loop pause in milliseconds value in a parsed JSON document. More... | |
static const std::string | KEY_BACKGROUND_ASSET_ID = "backgroundAlertAsset" |
String for lookup of the backgroundAssetId for an alert, if assets are provided. More... | |
const std::chrono::seconds | MAXIMUM_ALERT_RENDERING_TIME = std::chrono::hours(1) |
We won't allow an alert to render more than 1 hour. More... | |
const auto | BACKGROUND_ALERT_SOUND_PAUSE_TIME = std::chrono::seconds(10) |
Length of pause of alert sounds when played in background. More... | |
static const std::string | ALERTS_CAPABILITY_INTERFACE_TYPE = "AlexaInterface" |
static const std::string | ALERTS_CAPABILITY_INTERFACE_NAME = "Alerts" |
Alerts interface name. More... | |
static const std::string | ALERTS_CAPABILITY_INTERFACE_VERSION = "1.4" |
Alerts interface version. More... | |
static const std::string | KEY_TYPE = "type" |
The value for Type which we need for json parsing. More... | |
static const std::string | DIRECTIVE_NAME_SET_ALERT = "SetAlert" |
The value of the SetAlert Directive. More... | |
static const std::string | DIRECTIVE_NAME_DELETE_ALERT = "DeleteAlert" |
The value of the DeleteAlert Directive. More... | |
static const std::string | DIRECTIVE_NAME_DELETE_ALERTS = "DeleteAlerts" |
The value of the DeleteAlerts Directive. More... | |
static const std::string | DIRECTIVE_NAME_SET_VOLUME = "SetVolume" |
The value of the SetVolume Directive. More... | |
static const std::string | DIRECTIVE_NAME_ADJUST_VOLUME = "AdjustVolume" |
The value of the AdjustVolume Directive. More... | |
static const std::string | DIRECTIVE_NAME_SET_ALARM_VOLUME_RAMP = "SetAlarmVolumeRamp" |
The value of the SetAlarmVolumeRamp Directive. More... | |
static const std::string | SET_ALERT_SUCCEEDED_EVENT_NAME = "SetAlertSucceeded" |
The value of the SetAlertSucceeded Event name. More... | |
static const std::string | SET_ALERT_FAILED_EVENT_NAME = "SetAlertFailed" |
The value of the SetAlertFailed Event name. More... | |
static const std::string | DELETE_ALERT_SUCCEEDED_EVENT_NAME = "DeleteAlertSucceeded" |
The value of the DeleteAlertSucceeded Event name. More... | |
static const std::string | DELETE_ALERT_FAILED_EVENT_NAME = "DeleteAlertFailed" |
The value of the DeleteAlertFailed Event name. More... | |
static const std::string | ALERT_STARTED_EVENT_NAME = "AlertStarted" |
The value of the AlertStarted Event name. More... | |
static const std::string | ALERT_STOPPED_EVENT_NAME = "AlertStopped" |
The value of the AlertStopped Event name. More... | |
static const std::string | ALERT_ENTERED_FOREGROUND_EVENT_NAME = "AlertEnteredForeground" |
The value of the AlertEnteredForeground Event name. More... | |
static const std::string | ALERT_ENTERED_BACKGROUND_EVENT_NAME = "AlertEnteredBackground" |
The value of the AlertEnteredBackground Event name. More... | |
static const std::string | ALERT_VOLUME_CHANGED_EVENT_NAME = "VolumeChanged" |
The value of the VolumeChanged Event name. More... | |
static const std::string | ALERT_DELETE_ALERTS_SUCCEEDED_EVENT_NAME = "DeleteAlertsSucceeded" |
The value of the DeleteAlertsSucceeded Event name. More... | |
static const std::string | ALERT_DELETE_ALERTS_FAILED_EVENT_NAME = "DeleteAlertsFailed" |
The value of the DeleteAlertsFailed Event name. More... | |
static const std::string | ALERT_ALARM_VOLUME_RAMP_CHANGED_EVENT_NAME = "AlarmVolumeRampChanged" |
The value of the AlarmVolumeRampChanged Event name. More... | |
static const std::string | ALERT_REPORT_ALARM_VOLUME_RAMP_EVENT_NAME = "AlarmVolumeRampReport" |
The value of the ReportAlarmVolumeRamp Event name. More... | |
static const std::string | EVENT_PAYLOAD_TOKEN_KEY = "token" |
The value of the event payload key for a single token. More... | |
static const std::string | EVENT_PAYLOAD_TOKENS_KEY = "tokens" |
The value of the event payload key for multiple tokens. More... | |
static const std::string | DIRECTIVE_PAYLOAD_TOKEN_KEY = "token" |
The value of Token text in a Directive we may receive. More... | |
static const std::string | DIRECTIVE_PAYLOAD_TOKENS_KEY = "tokens" |
The value of Token list key in a Directive we may receive. More... | |
static const std::string | DIRECTIVE_PAYLOAD_VOLUME = "volume" |
The value of volume key in a Directive we may receive. More... | |
static const std::string | DIRECTIVE_PAYLOAD_ALARM_VOLUME_RAMP = "alarmVolumeRamp" |
The value of alarm volume ramp key in a Directive we may receive. More... | |
static const std::string | AVS_CONTEXT_HEADER_NAMESPACE_VALUE_KEY = "Alerts" |
static const std::string | AVS_CONTEXT_HEADER_NAME_VALUE_KEY = "AlertsState" |
The value of the Alerts Context Names. More... | |
static const std::string | AVS_CONTEXT_ALL_ALERTS_TOKEN_KEY = "allAlerts" |
The value of the Alerts Context allAlerts node. More... | |
static const std::string | AVS_CONTEXT_ACTIVE_ALERTS_TOKEN_KEY = "activeAlerts" |
The value of the Alerts Context activeAlerts node. More... | |
static const std::string | AVS_CONTEXT_ALERT_TOKEN_KEY = "token" |
The value of the Alerts Context token key. More... | |
static const std::string | AVS_CONTEXT_ALERT_TYPE_KEY = "type" |
The value of the Alerts Context type key. More... | |
static const std::string | AVS_CONTEXT_ALERT_SCHEDULED_TIME_KEY = "scheduledTime" |
The value of the Alerts Context scheduled time key. More... | |
static const std::string | AVS_PAYLOAD_VOLUME_KEY = "volume" |
The value of the volume state info volume key. More... | |
static const std::string | AVS_PAYLOAD_ALARM_VOLUME_RAMP_KEY = "alarmVolumeRamp" |
The value of the alarm volume ramp state key for alarm volume ramp events. More... | |
static const std::string | AVS_PAYLOAD_ERROR_KEY = "error" |
The JSON key in the payload of error events. More... | |
static const std::string | AVS_PAYLOAD_ERROR_TYPE_KEY = "type" |
The JSON key for the error type in the payload of error events. More... | |
static const std::string | AVS_PAYLOAD_ERROR_MESSAGE_KEY = "message" |
The JSON key for the error message in the payload of error events. More... | |
static const std::string | EMPTY_DIALOG_REQUEST_ID = "" |
An empty dialogRequestId. More... | |
static const std::string | NAMESPACE = "Alerts" |
The namespace for this capability agent. More... | |
static const avsCommon::avs::NamespaceAndName | SET_ALERT {NAMESPACE, DIRECTIVE_NAME_SET_ALERT} |
The SetAlert directive signature. More... | |
static const avsCommon::avs::NamespaceAndName | DELETE_ALERT {NAMESPACE, DIRECTIVE_NAME_DELETE_ALERT} |
The DeleteAlert directive signature. More... | |
static const avsCommon::avs::NamespaceAndName | DELETE_ALERTS {NAMESPACE, DIRECTIVE_NAME_DELETE_ALERTS} |
The DeleteAlerts directive signature. More... | |
static const avsCommon::avs::NamespaceAndName | SET_VOLUME {NAMESPACE, DIRECTIVE_NAME_SET_VOLUME} |
The SetVolume directive signature. More... | |
static const avsCommon::avs::NamespaceAndName | ADJUST_VOLUME {NAMESPACE, DIRECTIVE_NAME_ADJUST_VOLUME} |
The AdjustVolume directive signature. More... | |
static const avsCommon::avs::NamespaceAndName | SET_ALARM_VOLUME_RAMP {NAMESPACE, DIRECTIVE_NAME_SET_ALARM_VOLUME_RAMP} |
The SetAlarmVolumeRamp directive signature. More... | |
static const std::string | ALERT_METRIC_SOURCE_PREFIX = "ALERT-" |
Metric Activity Name Prefix for ALERT metric source. More... | |
static const std::string | FAILED_SNOOZE_ALERT = "failedToSnoozeAlert" |
Metric constants related to Alerts. More... | |
static const std::string | FAILED_SCHEDULE_ALERT = "failedToScheduleAlert" |
static const std::string | INVALID_PAYLOAD_FOR_SET_ALARM_VOLUME = "invalidPayloadToSetAlarmRamping" |
static const std::string | INVALID_PAYLOAD_FOR_CHANGE_ALARM_VOLUME = "invalidPayloadToChangeAlarmVolume" |
|
static |
Utility function to construct a rapidjson array of alert details, representing all the currently active alerts.
alertsInfo | The currently active alert, which may be nullptr if no alert is active. |
allocator | The rapidjson allocator, required for the results of this function to be mergable with other rapidjson::Value objects. |
|
static |
Utility function to construct a rapidjson array of alert details, representing all the alerts currently managed.
alertsInfo | All the alerts being managed by this Capability Agent. |
allocator | The rapidjson allocator, required for the results of this function to be mergable with other rapidjson::Value objects. |
|
static |
Creates the alerts capability configuration.
|
static |
Checks if the assets map contains a certain key and that the object mapped by the key is valid.
key | The key to search in the assets map |
assets | The assets map |
true
if the key was found in the assets, if the asset's id is the same as the key and asset url is not empty
|
inline |
Write a State
value to an ostream
.
stream | The stream to write the value to. |
state | The State value to write to the ostream as a string. |
ostream
that was passed in and written to.
|
inline |
Write a Alert::State
value to an ostream
as a string.
stream | The stream to write the value to. |
state | The Alert::State value to write to the ostream as a string. |
ostream
that was passed in and written to.
|
inline |
Write a Alert::StopReason
value to an ostream
as a string.
stream | The stream to write the value to. |
reason | The Alert::StopReason value to write to the ostream as a string. |
ostream
that was passed in and written to.
|
inline |
Write a Alert::ParseFromJsonStatus
value to an ostream
as a string.
stream | The stream to write the value to. |
status | The Alert::ParseFromJsonStatus value to write to the ostream as a string. |
ostream
that was passed in and written to.
|
static |
Utility function to parse the optional Asset data from an AVS SetAlert Directive. The only strictly required fields for assets to be valid are the assets themselves (a pair of id & url), and the assetPlayOrder. If the other fields are missing or empty, they are ignored. If the assets are malformed or missing, or otherwise not complete for asset rendering, this function returns early allowing the caller to proceed as if there were no assets in the Directive. This allows the Alert to still serve its purpose in some capacity.
payload | The pre-parsed rapidjson::Value. | |
[out] | assetConfiguration | An output parameter where the assets will be stored if parsed successfully. |
|
static |
Submits a metric for a given count and name
metricRecorder | The MetricRecorderInterface which records Metric events |
eventName | The name of the metric event |
count | The count for metric event |
|
static |
String to identify log entries originating from this file.
|
static |
String to identify log entries originating from this file.
|
static |
String to identify log entries originating from this file.
|
static |
Validates the static data
staticData | Static data struct to validate |
true
if the data is valid
|
static |
The AdjustVolume directive signature.
|
static |
The value of the AlarmVolumeRampChanged Event name.
|
static |
The value of the DeleteAlertsFailed Event name.
|
static |
The value of the DeleteAlertsSucceeded Event name.
|
static |
The value of the AlertEnteredBackground Event name.
|
static |
The value of the AlertEnteredForeground Event name.
|
static |
Metric Activity Name Prefix for ALERT metric source.
|
static |
|
static |
The value of the ReportAlarmVolumeRamp Event name.
|
static |
The value of the AlertStarted Event name.
|
static |
The value of the AlertStopped Event name.
|
static |
The value of the VolumeChanged Event name.
|
static |
Alerts interface name.
|
static |
Alerts capability constants Alerts interface type
|
static |
Alerts interface version.
|
static |
The value of the Alerts Context activeAlerts node.
|
static |
The value of the Alerts Context scheduled time key.
|
static |
The value of the Alerts Context token key.
|
static |
The value of the Alerts Context type key.
|
static |
The value of the Alerts Context allAlerts node.
|
static |
The value of the Alerts Context Names.
|
static |
|
static |
The value of the alarm volume ramp state key for alarm volume ramp events.
|
static |
The JSON key in the payload of error events.
|
static |
The JSON key for the error message in the payload of error events.
|
static |
The JSON key for the error type in the payload of error events.
|
static |
The value of the volume state info volume key.
const auto alexaClientSDK::capabilityAgents::alerts::BACKGROUND_ALERT_SOUND_PAUSE_TIME = std::chrono::seconds(10) |
Length of pause of alert sounds when played in background.
|
static |
The DeleteAlert directive signature.
|
static |
The value of the DeleteAlertFailed Event name.
|
static |
The value of the DeleteAlertSucceeded Event name.
|
static |
The DeleteAlerts directive signature.
|
static |
The value of the AdjustVolume Directive.
|
static |
The value of the DeleteAlert Directive.
|
static |
The value of the DeleteAlerts Directive.
|
static |
The value of the SetAlarmVolumeRamp Directive.
|
static |
The value of the SetAlert Directive.
|
static |
The value of the SetVolume Directive.
|
static |
The value of alarm volume ramp key in a Directive we may receive.
|
static |
The value of Token text in a Directive we may receive.
|
static |
The value of Token list key in a Directive we may receive.
|
static |
The value of volume key in a Directive we may receive.
|
static |
An empty dialogRequestId.
|
static |
The value of the event payload key for a single token.
|
static |
The value of the event payload key for multiple tokens.
|
static |
|
static |
Metric constants related to Alerts.
|
static |
|
static |
|
static |
String for lookup of the asset id within an asset object in a parsed JSON document.
|
static |
String for lookup of the asset play order array in a parsed JSON document.
|
static |
String for lookup of the asset url within an asset object in a parsed JSON document.
|
static |
String for lookup of the assets array in a parsed JSON document.
|
static |
String for lookup of the backgroundAssetId for an alert, if assets are provided.
|
static |
String for lookup of the loop count value in a parsed JSON document.
|
static |
String for lookup of the loop pause in milliseconds value in a parsed JSON document.
|
static |
String for lookup of the scheduled time value in a parsed JSON document.
|
static |
String for lookup of the token value in a parsed JSON document.
|
static |
The value for Type which we need for json parsing.
const std::chrono::seconds alexaClientSDK::capabilityAgents::alerts::MAXIMUM_ALERT_RENDERING_TIME = std::chrono::hours(1) |
We won't allow an alert to render more than 1 hour.
|
static |
The namespace for this capability agent.
|
static |
The SetAlarmVolumeRamp directive signature.
|
static |
The SetAlert directive signature.
|
static |
The value of the SetAlertFailed Event name.
|
static |
The value of the SetAlertSucceeded Event name.
|
static |
The SetVolume directive signature.
AlexaClientSDK 1.19.0 - Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0