AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | List of all members
alexaClientSDK::avsCommon::avs::CapabilityResources Class Reference

#include <CapabilityResources.h>

Public Member Functions

 CapabilityResources ()
 
bool addFriendlyNameWithAssetId (const resources::AlexaAssetId &assetId)
 
bool addFriendlyNameWithText (const std::string &text, const sdkInterfaces::LocaleAssetsManagerInterface::Locale &locale)
 
bool isValid () const
 
std::string toJson () const
 

Detailed Description

This class represents the resources used by a Capability, communicated as friendly names to AVS.

See also
https://developer.amazon.com/docs/alexa/device-apis/resources-and-assets.html#capability-resources

Constructor & Destructor Documentation

◆ CapabilityResources()

alexaClientSDK::avsCommon::avs::CapabilityResources::CapabilityResources ( )

The constructor.

Member Function Documentation

◆ addFriendlyNameWithAssetId()

bool alexaClientSDK::avsCommon::avs::CapabilityResources::addFriendlyNameWithAssetId ( const resources::AlexaAssetId assetId)

Function to add friendly name with asset id.

Note
It is recommended to use asset identifier whenever available, as the friendly name are already localized into all Alexa supported languages.
Parameters
assetIdThe asset id of the friendly name using AlexaAssetId.
Returns
Return true if successful in adding the asset id, otherwise false.

◆ addFriendlyNameWithText()

bool alexaClientSDK::avsCommon::avs::CapabilityResources::addFriendlyNameWithText ( const std::string &  text,
const sdkInterfaces::LocaleAssetsManagerInterface::Locale locale 
)

Function to add friendly name with text value and its locale.

Note
When using this method it is recommended to provide the friendly names in all the Alexa supported languages. See the class-level link to find the currently supported languages.
Providing an unsupported locale will result in Discovery failure.
Parameters
textThe text of the friendly name.
localeThe locale of the friendly name Locale.
Returns
Return true if successful in adding the text and locale, otherwise false.

◆ isValid()

bool alexaClientSDK::avsCommon::avs::CapabilityResources::isValid ( ) const

Function to check if the CapabilityResources is valid.

Returns
Return true if valid, otherwise false.

◆ toJson()

std::string alexaClientSDK::avsCommon::avs::CapabilityResources::toJson ( ) const

Helper function to convert a FriendlyName to a json string.

Note
This follows the AVS discovery message format.
Returns
A json string of FriendlyName.

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

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