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::StatesToValueMapping Class Reference

#include <StatesToValueMapping.h>

Public Member Functions

 StatesToValueMapping ()
 
bool addState (const std::string &stateId)
 
bool setValue (const std::string &value)
 
bool setValue (double value)
 
bool isValid () const
 
std::string toJson () const
 

Detailed Description

This class represents a "StatesToValue" type "stateMapping" in a semantic annotation for a capability primitive.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/capability-primitives.html#semantic-annotation

Constructor & Destructor Documentation

◆ StatesToValueMapping()

alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToValueMapping::StatesToValueMapping ( )

The constructor.

Member Function Documentation

◆ addState()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToValueMapping::addState ( const std::string &  stateId)

Adds the specified state identifier to the "states" array of this mapping object. The state identifier represents utterances that correspond to the value specified in setValue().

Note
See the class-level link for supported state identifiers.
Parameters
statesThe identifier of the state to add to the "states" array.
Returns
true if the state was successfully added, else false.

◆ isValid()

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

Checks whether this StatesToValueMapping is valid.

Returns
true if valid, else false.

◆ setValue() [1/2]

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToValueMapping::setValue ( const std::string &  value)

Sets a string value used in this state mapping.

Note
The accepted value depends on the type of the capability interface to which this semantics object belongs. The value must match a configured value of the corresponding reportable state property for the capability.
See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/reportable-state-properties.html
Parameters
valueThe value mapped to the state(s).
Returns
true if the value was successfully set, else false.

◆ setValue() [2/2]

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToValueMapping::setValue ( double  value)

Sets a floating point value used in this state mapping.

Note
This value type is only supported for RangeController capability instances. The value must be between the minimumValue and maximumValue of configuration.supportedRange.
See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/alexa-rangecontroller.html
Parameters
valueThe value mapped to the state(s).
Returns
true if the value was successfully set, else false.

◆ toJson()

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

Converts this StatesToValueMapping to a JSON string.

Note
This follows the AVS discovery message format.
Returns
A JSON string of this StatesToValueMapping.

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