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

#include <ActionsToDirectiveMapping.h>

Public Member Functions

 ActionsToDirectiveMapping ()
bool addAction (const std::string &actionId)
bool setDirective (const std::string &name, const std::string &payload="{}")
bool isValid () const
std::string toJson () const

Detailed Description

This class represents an "ActionsToDirective" type "actionMapping" in a semantic annotation for a capability primitive.

See also

Constructor & Destructor Documentation

◆ ActionsToDirectiveMapping()

alexaClientSDK::avsCommon::avs::capabilitySemantics::ActionsToDirectiveMapping::ActionsToDirectiveMapping ( )

The constructor.

Member Function Documentation

◆ addAction()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::ActionsToDirectiveMapping::addAction ( const std::string &  actionId)

Adds the specified action identifier to the "actions" array of this mapping object. The action identifier represents utterances that should trigger the directive specified in setDirective().

See the class-level link for supported action identifiers.
actionThe identifier of the action to add to the "actions" array.
true if the action was successfully added, else false.

◆ isValid()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::ActionsToDirectiveMapping::isValid ( ) const

Checks whether this ActionsToDirectiveMapping is valid.

true if valid, else false.

◆ setDirective()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::ActionsToDirectiveMapping::setDirective ( const std::string &  name,
const std::string &  payload = "{}" 

Sets the "directive" field of this mapping object. The action IDs specified with calls to addAction() correspond to this directive name and payload.

nameThe name of the directive mapped to the action(s). Must be a valid directive of the capability interface to which the semantics object belongs.
payloadThe desired payload of the directive.
true if the directive was successfully set, else false.

◆ toJson()

std::string alexaClientSDK::avsCommon::avs::capabilitySemantics::ActionsToDirectiveMapping::toJson ( ) const

Converts this ActionsToDirectiveMapping to a JSON string.

This follows the AVS discovery message format.
A JSON string of this ActionsToDirectiveMapping.

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

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