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

#include <AVSMessage.h>

Inheritance diagram for alexaClientSDK::avsCommon::avs::AVSMessage:
Inheritance graph
[legend]

Public Member Functions

 AVSMessage (std::shared_ptr< AVSMessageHeader > avsMessageHeader, std::string payload, const utils::Optional< AVSMessageEndpoint > &endpoint=utils::Optional< AVSMessageEndpoint >())
 
virtual ~AVSMessage ()=default
 
std::string getNamespace () const
 
std::string getName () const
 
std::string getMessageId () const
 
std::string getCorrelationToken () const
 
std::string getEventCorrelationToken () const
 
std::string getPayloadVersion () const
 
std::string getInstance () const
 
std::string getDialogRequestId () const
 
std::string getPayload () const
 
std::shared_ptr< const AVSMessageHeadergetHeader () const
 
std::string getHeaderAsString () const
 
utils::Optional< AVSMessageEndpointgetEndpoint () const
 

Detailed Description

This is a base class which allows us to represent a message sent or received from AVS. This class encapsulates the common data elements for all such messages.

Constructor & Destructor Documentation

◆ AVSMessage()

alexaClientSDK::avsCommon::avs::AVSMessage::AVSMessage ( std::shared_ptr< AVSMessageHeader avsMessageHeader,
std::string  payload,
const utils::Optional< AVSMessageEndpoint > &  endpoint = utils::OptionalAVSMessageEndpoint >() 
)

Constructor.

Parameters
avsMessageHeaderAn object that contains the necessary header fields of an AVS message. NOTE: This parameter MUST NOT be null.
payloadThe payload associated with an AVS message. This is expected to be in the JSON format.
endpointThe attributes for the target endpoint if available.

◆ ~AVSMessage()

virtual alexaClientSDK::avsCommon::avs::AVSMessage::~AVSMessage ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getCorrelationToken()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getCorrelationToken ( ) const

Returns the correlation token of the message.

Returns
The correlation token string.

◆ getDialogRequestId()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getDialogRequestId ( ) const

Returns The dialog request ID of the message.

Returns
The dialog request ID, a unique ID for the messages that are part of the same dialog.

◆ getEndpoint()

utils::Optional<AVSMessageEndpoint> alexaClientSDK::avsCommon::avs::AVSMessage::getEndpoint ( ) const

Return the endpoint attributes included in this message.

Returns
The endpoint attributes if present; otherwise an empty object.

◆ getEventCorrelationToken()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getEventCorrelationToken ( ) const

Returns the event correlation token of the message.

Returns
The event correlation token string.

◆ getHeader()

std::shared_ptr<const AVSMessageHeader> alexaClientSDK::avsCommon::avs::AVSMessage::getHeader ( ) const

Return a pointer to its header.

Returns
A pointer to this AVSMessage's header.

◆ getHeaderAsString()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getHeaderAsString ( ) const

Return a string representation of this AVSMessage's header.

Returns
A string representation of this AVSMessage's header.

◆ getInstance()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getInstance ( ) const

Return the instance in an AVS message.

Returns
The target instance id if present or an empty string if this field is not available.

◆ getMessageId()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getMessageId ( ) const

Returns The message ID of the message.

Returns
The message ID, a unique ID used to identify a specific message.

◆ getName()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getName ( ) const

Returns The name of the message, which describes the intent.

Returns
The name.

◆ getNamespace()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getNamespace ( ) const

Returns The namespace of the message.

Returns
The namespace.

◆ getPayload()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getPayload ( ) const

Returns the payload of the message.

Returns
The payload.

◆ getPayloadVersion()

std::string alexaClientSDK::avsCommon::avs::AVSMessage::getPayloadVersion ( ) const

Return the payload version in an AVS message.

Returns
The payload version if present or an empty string if this field is not available.

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