AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <MimeResponseSink.h>
Public Member Functions | |
MimeResponseSink (std::shared_ptr< MimeResponseStatusHandlerInterface > handler, std::shared_ptr< MessageConsumerInterface > messageConsumer, std::shared_ptr< avsCommon::avs::attachment::AttachmentManagerInterface > attachmentManager, std::string attachmentContextId) | |
virtual | ~MimeResponseSink ()=default |
HTTP2MimeResponseSinkInterface methods | |
bool | onReceiveResponseCode (long responseCode) override |
bool | onReceiveHeaderLine (const std::string &line) override |
bool | onBeginMimePart (const std::multimap< std::string, std::string > &headers) override |
avsCommon::utils::http2::HTTP2ReceiveDataStatus | onReceiveMimeData (const char *bytes, size_t size) override |
bool | onEndMimePart () override |
avsCommon::utils::http2::HTTP2ReceiveDataStatus | onReceiveNonMimeData (const char *bytes, size_t size) override |
void | onResponseFinished (avsCommon::utils::http2::HTTP2ResponseFinishedStatus status) override |
Public Member Functions inherited from alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface | |
virtual | ~HTTP2MimeResponseSinkInterface ()=default |
Handle Mime encoded responses from AVS.
This includes forwarding json payloads to an MessageConsumer
, attachments to attachment writers, and capturing exceptions for non 2xx results.
alexaClientSDK::acl::MimeResponseSink::MimeResponseSink | ( | std::shared_ptr< MimeResponseStatusHandlerInterface > | handler, |
std::shared_ptr< MessageConsumerInterface > | messageConsumer, | ||
std::shared_ptr< avsCommon::avs::attachment::AttachmentManagerInterface > | attachmentManager, | ||
std::string | attachmentContextId | ||
) |
Constructor.
handler | The object to forward status and result notifications to. |
messageConsumer | Object to send decoded messages to. |
attachmentManager | Object with which to get attachments to write to. |
attachmentContextId | Id added to content IDs to assure global uniqueness. |
|
virtualdefault |
Destructor.
|
overridevirtual |
Notification of the start of a new mime part.
headers | A multimap from header names to header values. |
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
|
overridevirtual |
Notification of the end of the current mime part.
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
|
overridevirtual |
Notification that an HTTP header line was received.
line | The HTTP response header line that was received. |
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
|
overridevirtual |
Notification of new body data received from an HTTP2 response.
bytes | The buffer containing the bytes to consume. |
size | The number of bytes to consume. |
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
|
overridevirtual |
Notification of receipt of non-mime body data in an HTTP2 response.
bytes | The buffer containing the bytes to consume. |
size | The number of bytes to consume. |
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
|
overridevirtual |
Notification that an HTTP response code was returned for the request.
responseCode | The response code received for the request. |
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
|
overridevirtual |
Notification that the request/response cycle has finished and no further notifications will be provided.
status | The status with which the response finished. |
Implements alexaClientSDK::avsCommon::utils::http2::HTTP2MimeResponseSinkInterface.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0