AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Classes | Functions | Variables
alexaClientSDK::capabilitiesDelegate::utils Namespace Reference

Namespaces

 test
 

Classes

struct  JsonObjectScope
 

Functions

bool validateCapabilityConfiguration (const avsCommon::avs::CapabilityConfiguration &capabilityConfig)
 
bool validateEndpointAttributes (const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes)
 
bool compareEndpointConfigurations (const std::string &firstEndpointConfigJson, const std::string &secondEndpointConfigJson)
 
std::string getEndpointConfigJson (const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes, const std::vector< avsCommon::avs::CapabilityConfiguration > &capabilities)
 
std::pair< std::string, std::string > getAddOrUpdateReportEventJson (const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
 
std::string getDeleteReportEndpointConfigJson (const std::string &endpointId)
 
std::string getDeleteReportEventJson (const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
 
static std::string getScopeJson (const std::string &authToken)
 
static void addSortedMembersArray (JsonGenerator &generator, const std::string &key, const std::vector< std::string > &memberArray)
 
static void addSortedStringArray (JsonGenerator &generator, const std::string &key, const std::vector< std::string > &stringArray)
 
static std::string getCapabilityConfigJson (const CapabilityConfiguration &capabilityConfig)
 

Variables

static constexpr int MAX_DISCOVERY_PAYLOAD_SIZE = 256 * 1024
 Maximum size of the Discovery event (256 KB) More...
 
static constexpr int MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE = 10 * 1024
 Maximum size of header and scope fields in the Discovery event (Choosing a sufficiently large size of 10KB). More...
 
static constexpr int MAX_ENDPOINTS_SIZE_IN_PAYLOAD = MAX_DISCOVERY_PAYLOAD_SIZE - MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE
 Maximum size of endpoint configurations in Event payload. More...
 
static const std::string CAPABILITY_INTERFACE_INSTANCE_NAME_KEY = "instance"
 
static const std::string CAPABILITY_INTERFACE_PROPERTIES_KEY = "properties"
 The properties key. More...
 
static const std::string CAPABILITY_INTERFACE_PROPERTIES_NAME_KEY = "name"
 The interface name key. More...
 
static const std::string CAPABILITY_INTERFACE_PROPERTIES_SUPPORTED_KEY = "supported"
 The supported key. More...
 
static const std::string CAPABILITY_INTERFACE_PROPERTIES_PROACTIVELY_REPORTED_KEY = "proactivelyReported"
 The proactively report key. More...
 
static const std::string CAPABILITY_INTERFACE_PROPERTIES_RETRIEVABLE_KEY = "retrievable"
 The retrievable key. More...
 
static const std::string CAPABILITY_INTERFACE_PROPERTIES_NON_CONTROLLABLE_KEY = "nonControllable"
 The nonControllable key. More...
 
const static std::string ENDPOINT_ID_KEY = "endpointId"
 
const static std::string FRIENDLY_NAME_KEY = "friendlyName"
 Friendly name key. More...
 
const static std::string DESCRIPTION_KEY = "description"
 Description key. More...
 
const static std::string MANUFACTURER_NAME_KEY = "manufacturerName"
 Manufacturer name key. More...
 
const static std::string DISPLAY_CATEGORIES_KEY = "displayCategories"
 Display Categories key. More...
 
const static std::string ADDITIONAL_ATTRIBUTES_KEY = "additionalAttributes"
 Additional Attributes key. More...
 
const static std::string DEVICE_SERIAL_NUMBER_KEY = "deviceSerialNumber"
 DSN Key. More...
 
const static std::string CONNECTIONS_KEY = "connections"
 Connections Key. More...
 
const static std::string COOKIE_KEY = "cookie"
 Cookie key. More...
 
static const std::string ADDITIONAL_MANUFACTURER_KEY = "manufacturer"
 Manufacturer name key. More...
 
static const std::string ADDITIONAL_MODEL_KEY = "model"
 model key More...
 
static const std::string ADDITIONAL_SERIAL_NUMBER_KEY = "serialNumber"
 serial number key More...
 
static const std::string ADDITIONAL_FIRMWARE_VERSION_KEY = "firmwareVersion"
 firmware version key More...
 
static const std::string ADDITIONAL_SOFTWARE_VERSION_KEY = "softwareVersion"
 software version key More...
 
static const std::string ADDITIONAL_CUSTOM_IDENTIFIER_KEY = "customIdentifier"
 custom identifier key More...
 
static const std::string CAPABILITIES_KEY = "capabilities"
 Capabilities key in message body. More...
 
static const std::string DISCOVERY_NAMESPACE = "Alexa.Discovery"
 
static const std::string PAYLOAD_VERSION = "3"
 Payload version. More...
 
static const std::string ADD_OR_UPDATE_REPORT_NAME = "AddOrUpdateReport"
 AddOrUpdateReport event name. More...
 
static const std::string DELETE_REPORT_NAME = "DeleteReport"
 DeleteReport event name. More...
 
static const std::string ENDPOINTS_KEY = "endpoints"
 Endpoints Key. More...
 
static const std::string SCOPE_KEY = "scope"
 Scope Key. More...
 
static const std::string SCOPE_TYPE_KEY = "type"
 Scope Type Key. More...
 
static const std::string SCOPE_TYPE_BEARER_TOKEN = "BearerToken"
 Scope Type Value Key. More...
 
static const std::string SCOPE_TOKEN_KEY = "token"
 Scope Token key. More...
 

Function Documentation

◆ addSortedMembersArray()

static void alexaClientSDK::capabilitiesDelegate::utils::addSortedMembersArray ( JsonGenerator generator,
const std::string &  key,
const std::vector< std::string > &  memberArray 
)
static

Adds the given string array as a sorted members array with the given key to the JsonGenerator.

Parameters
generatorThe JsonGenerator used to generate the JSON.
keyThe key to use for the members array entry.
memberArrayThe string array where each entry represents a member.

◆ addSortedStringArray()

static void alexaClientSDK::capabilitiesDelegate::utils::addSortedStringArray ( JsonGenerator generator,
const std::string &  key,
const std::vector< std::string > &  stringArray 
)
static

Adds the given string array as a sorted string array with the given key to the JsonGenerator.

Parameters
generatorThe JsonGenerator used to generate the JSON.
keyThe key to use for the string array entry.
stringArrayThe string array to be added.

◆ compareEndpointConfigurations()

bool alexaClientSDK::capabilitiesDelegate::utils::compareEndpointConfigurations ( const std::string &  firstEndpointConfigJson,
const std::string &  secondEndpointConfigJson 
)

Compares given endpoint configuration JSONs and returns true if they are equal, else false. @Note: RapidJSON's equal to operator compares elements of arrays in order. To overcome this, we always sort array entries before creating JSON strings.

Parameters
firstEndpointConfigJsonThe first endpoint config json string.
secondEndpointConfigJsonThe second endpoint config json string.
Returns
True if the json strings are same, else false.

◆ getAddOrUpdateReportEventJson()

std::pair< std::string, std::string > alexaClientSDK::capabilitiesDelegate::utils::getAddOrUpdateReportEventJson ( const std::vector< std::string > &  endpointConfigurations,
const std::string &  authToken 
)

Formats the Discovery.AddOrUpdateReport event.

Parameters
endpointConfigurationsThe endpointConfiguration jsons to be included in the event.
authTokenThe authorization token that needs to be included in the event.
Returns
The string pair containing the JSON formatted Discovery.AddOrUpdateReport event and the eventCorrelationToken.

◆ getCapabilityConfigJson()

static std::string alexaClientSDK::capabilitiesDelegate::utils::getCapabilityConfigJson ( const CapabilityConfiguration capabilityConfig)
static

Formats the given CapabilityConfiguration into a JSON required to send in Discovery.AddOrUpdateReport event. Note: The caller should validate the CapabilityConfiguration before calling this method.

Parameters
capabilityConfigThe input CapabilityConfiguration.
Returns
The JSON formatted CapabilityConfiguration.

◆ getDeleteReportEndpointConfigJson()

std::string alexaClientSDK::capabilitiesDelegate::utils::getDeleteReportEndpointConfigJson ( const std::string &  endpointId)

Formats the endpoint ID into endpointConfig JSON that will be sent in the payload of Discovery.DeleteReport event.

Parameters
endpointIdThe endpointId for which the endpoint config JSON will be created.
Returns
The string representing the individual endpointConfig JSON for the Discovery.DeleteReport event.

◆ getDeleteReportEventJson()

std::string alexaClientSDK::capabilitiesDelegate::utils::getDeleteReportEventJson ( const std::vector< std::string > &  endpointConfigurations,
const std::string &  authToken 
)

Formats the Discovery.DeleteReport event.

Parameters
endpointConfigurationsThe endpointConfiguration jsons to be included in the event.
authTokenThe authorization token that needs to be included in the event.
Returns
The string containing the JSON formatted Discovery.DeleteReport event.

◆ getEndpointConfigJson()

std::string alexaClientSDK::capabilitiesDelegate::utils::getEndpointConfigJson ( const avsCommon::avs::AVSDiscoveryEndpointAttributes endpointAttributes,
const std::vector< avsCommon::avs::CapabilityConfiguration > &  capabilities 
)

Formats the given EndpointAttributes and CapabilityConfigurations into a JSON required to send in the Discovery.AddOrUpdateReport event.

Parameters
endpointAttributesThe EndpointAttributes to format.
capabilitiesThe list of CapabilityConfigurations to format.
Returns
The JSON formatted Endpoint configuration.

Additional Attributes Object.

Registration Object.

Connections Object.

Cookie Object.

Capabilities Object.

Additional Attributes Object.

Registration Object.

Connections Object.

Cookie Object.

Capabilities Object.

◆ getScopeJson()

static std::string alexaClientSDK::capabilitiesDelegate::utils::getScopeJson ( const std::string &  authToken)
static

Formats the scope object that needs to be included in the AddOrUpdateReport and DeleteReport events.

Parameters
authTokenThe authorization token to be included in the event.
Returns
The JSON formatted scope object.

◆ validateCapabilityConfiguration()

bool alexaClientSDK::capabilitiesDelegate::utils::validateCapabilityConfiguration ( const avsCommon::avs::CapabilityConfiguration capabilityConfig)

Validates if all the required fields are available for the given CapabilityConfiguration.

Parameters
capabilityConfigThe CapabilityConfiguration to validate.
Returns
True if the capabilityConfig is valid, else false.

◆ validateEndpointAttributes()

bool alexaClientSDK::capabilitiesDelegate::utils::validateEndpointAttributes ( const avsCommon::avs::AVSDiscoveryEndpointAttributes endpointAttributes)

Validates if the given EndpointAttributes contains all the required fields.

Parameters
endpointAttributesThe input EndpointAttributes to validate.
Returns
True if the endpointAttributes are valid, else false.

Variable Documentation

◆ ADD_OR_UPDATE_REPORT_NAME

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADD_OR_UPDATE_REPORT_NAME = "AddOrUpdateReport"
static

AddOrUpdateReport event name.

◆ ADDITIONAL_ATTRIBUTES_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_ATTRIBUTES_KEY = "additionalAttributes"
static

Additional Attributes key.

◆ ADDITIONAL_CUSTOM_IDENTIFIER_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_CUSTOM_IDENTIFIER_KEY = "customIdentifier"
static

custom identifier key

◆ ADDITIONAL_FIRMWARE_VERSION_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_FIRMWARE_VERSION_KEY = "firmwareVersion"
static

firmware version key

◆ ADDITIONAL_MANUFACTURER_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_MANUFACTURER_KEY = "manufacturer"
static

Manufacturer name key.

◆ ADDITIONAL_MODEL_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_MODEL_KEY = "model"
static

model key

◆ ADDITIONAL_SERIAL_NUMBER_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_SERIAL_NUMBER_KEY = "serialNumber"
static

serial number key

◆ ADDITIONAL_SOFTWARE_VERSION_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ADDITIONAL_SOFTWARE_VERSION_KEY = "softwareVersion"
static

software version key

◆ CAPABILITIES_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITIES_KEY = "capabilities"
static

Capabilities key in message body.

◆ CAPABILITY_INTERFACE_INSTANCE_NAME_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_INSTANCE_NAME_KEY = "instance"
static

CapabilityConfiguration keys The instance name key

◆ CAPABILITY_INTERFACE_PROPERTIES_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_PROPERTIES_KEY = "properties"
static

The properties key.

◆ CAPABILITY_INTERFACE_PROPERTIES_NAME_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_PROPERTIES_NAME_KEY = "name"
static

The interface name key.

◆ CAPABILITY_INTERFACE_PROPERTIES_NON_CONTROLLABLE_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_PROPERTIES_NON_CONTROLLABLE_KEY = "nonControllable"
static

The nonControllable key.

◆ CAPABILITY_INTERFACE_PROPERTIES_PROACTIVELY_REPORTED_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_PROPERTIES_PROACTIVELY_REPORTED_KEY = "proactivelyReported"
static

The proactively report key.

◆ CAPABILITY_INTERFACE_PROPERTIES_RETRIEVABLE_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_PROPERTIES_RETRIEVABLE_KEY = "retrievable"
static

The retrievable key.

◆ CAPABILITY_INTERFACE_PROPERTIES_SUPPORTED_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::CAPABILITY_INTERFACE_PROPERTIES_SUPPORTED_KEY = "supported"
static

The supported key.

◆ CONNECTIONS_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::CONNECTIONS_KEY = "connections"
static

Connections Key.

◆ COOKIE_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::COOKIE_KEY = "cookie"
static

Cookie key.

◆ DELETE_REPORT_NAME

const std::string alexaClientSDK::capabilitiesDelegate::utils::DELETE_REPORT_NAME = "DeleteReport"
static

DeleteReport event name.

◆ DESCRIPTION_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::DESCRIPTION_KEY = "description"
static

Description key.

◆ DEVICE_SERIAL_NUMBER_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::DEVICE_SERIAL_NUMBER_KEY = "deviceSerialNumber"
static

DSN Key.

◆ DISCOVERY_NAMESPACE

const std::string alexaClientSDK::capabilitiesDelegate::utils::DISCOVERY_NAMESPACE = "Alexa.Discovery"
static

Discovery Keys Discovery Namespace

◆ DISPLAY_CATEGORIES_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::DISPLAY_CATEGORIES_KEY = "displayCategories"
static

Display Categories key.

◆ ENDPOINT_ID_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::ENDPOINT_ID_KEY = "endpointId"
static

Endpoint Configuration keys Endpoint ID key

◆ ENDPOINTS_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::ENDPOINTS_KEY = "endpoints"
static

Endpoints Key.

◆ FRIENDLY_NAME_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::FRIENDLY_NAME_KEY = "friendlyName"
static

Friendly name key.

◆ MANUFACTURER_NAME_KEY

const static std::string alexaClientSDK::capabilitiesDelegate::utils::MANUFACTURER_NAME_KEY = "manufacturerName"
static

Manufacturer name key.

◆ MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE

constexpr int alexaClientSDK::capabilitiesDelegate::utils::MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE = 10 * 1024
staticconstexpr

Maximum size of header and scope fields in the Discovery event (Choosing a sufficiently large size of 10KB).

◆ MAX_DISCOVERY_PAYLOAD_SIZE

constexpr int alexaClientSDK::capabilitiesDelegate::utils::MAX_DISCOVERY_PAYLOAD_SIZE = 256 * 1024
staticconstexpr

Maximum size of the Discovery event (256 KB)

◆ MAX_ENDPOINTS_SIZE_IN_PAYLOAD

constexpr int alexaClientSDK::capabilitiesDelegate::utils::MAX_ENDPOINTS_SIZE_IN_PAYLOAD = MAX_DISCOVERY_PAYLOAD_SIZE - MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE
staticconstexpr

Maximum size of endpoint configurations in Event payload.

◆ PAYLOAD_VERSION

const std::string alexaClientSDK::capabilitiesDelegate::utils::PAYLOAD_VERSION = "3"
static

Payload version.

◆ SCOPE_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::SCOPE_KEY = "scope"
static

Scope Key.

◆ SCOPE_TOKEN_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::SCOPE_TOKEN_KEY = "token"
static

Scope Token key.

◆ SCOPE_TYPE_BEARER_TOKEN

const std::string alexaClientSDK::capabilitiesDelegate::utils::SCOPE_TYPE_BEARER_TOKEN = "BearerToken"
static

Scope Type Value Key.

◆ SCOPE_TYPE_KEY

const std::string alexaClientSDK::capabilitiesDelegate::utils::SCOPE_TYPE_KEY = "type"
static

Scope Type Key.

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