AWS IoT Device SDK C++ v2 1.44.2
AWS IoT Device SDK C++ v2
Loading...
Searching...
No Matches
IotShadowClientV2.h
Go to the documentation of this file.
1#pragma once
2
3/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 * SPDX-License-Identifier: Apache-2.0.
5 *
6 * This file is generated
7 */
8
10
12#include <aws/crt/Types.h>
14
15#include <functional>
16
17namespace Aws
18{
19 namespace Crt
20 {
21 namespace Mqtt
22 {
23 class MqttConnection;
24 }
25 namespace Mqtt5
26 {
27 class Mqtt5Client;
28 }
29 } // namespace Crt
30} // namespace Aws
31
32namespace Aws
33{
34 namespace Iotshadow
35 {
36
37 template <typename E> class ServiceErrorV2
38 {
39 public:
40 ServiceErrorV2() = delete;
41 ServiceErrorV2(const ServiceErrorV2<E> &rhs) = default;
43
44 explicit ServiceErrorV2(int errorCode) : m_errorCode(errorCode), m_modeledError() {}
45
46 ServiceErrorV2(int errorCode, E &&modeledError)
47 : m_errorCode(errorCode), m_modeledError(std::move(modeledError))
48 {
49 }
50
51 ~ServiceErrorV2() = default;
52
55
56 int GetErrorCode() const { return m_errorCode; }
57
58 bool HasModeledError() const { return m_modeledError.has_value(); }
59 const E &GetModeledError() const { return m_modeledError.value(); }
60
61 private:
62 int m_errorCode;
63
64 Aws::Crt::Optional<E> m_modeledError;
65 };
66
67 class DeleteNamedShadowRequest;
68 class DeleteShadowRequest;
69 class DeleteShadowResponse;
70 class GetNamedShadowRequest;
71 class GetShadowRequest;
72 class GetShadowResponse;
73 class NamedShadowDeltaUpdatedSubscriptionRequest;
74 class NamedShadowUpdatedSubscriptionRequest;
75 class ShadowDeltaUpdatedEvent;
76 class ShadowDeltaUpdatedSubscriptionRequest;
77 class ShadowUpdatedEvent;
78 class ShadowUpdatedSubscriptionRequest;
79 class UpdateNamedShadowRequest;
80 class UpdateShadowRequest;
81 class UpdateShadowResponse;
82 class V2ErrorResponse;
83
87
90 using DeleteShadowResultHandler = std::function<void(DeleteShadowResult &&)>;
91
94 using GetNamedShadowResultHandler = std::function<void(GetNamedShadowResult &&)>;
95
97 using GetShadowResultHandler = std::function<void(GetShadowResult &&)>;
98
102
105 using UpdateShadowResultHandler = std::function<void(UpdateShadowResult &&)>;
106
116 {
117 public:
118 virtual ~IClientV2() = default;
119
132 virtual bool DeleteNamedShadow(
133 const DeleteNamedShadowRequest &request,
134 const DeleteNamedShadowResultHandler &handler) = 0;
135
148 virtual bool DeleteShadow(const DeleteShadowRequest &request, const DeleteShadowResultHandler &handler) = 0;
149
162 virtual bool GetNamedShadow(
163 const GetNamedShadowRequest &request,
164 const GetNamedShadowResultHandler &handler) = 0;
165
178 virtual bool GetShadow(const GetShadowRequest &request, const GetShadowResultHandler &handler) = 0;
179
192 virtual bool UpdateNamedShadow(
193 const UpdateNamedShadowRequest &request,
194 const UpdateNamedShadowResultHandler &handler) = 0;
195
208 virtual bool UpdateShadow(const UpdateShadowRequest &request, const UpdateShadowResultHandler &handler) = 0;
209
223 virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> CreateNamedShadowDeltaUpdatedStream(
226
240 virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> CreateNamedShadowUpdatedStream(
243
257 virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> CreateShadowDeltaUpdatedStream(
260
274 virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation> CreateShadowUpdatedStream(
277 };
278
288 AWS_IOTSHADOW_API std::shared_ptr<IClientV2> NewClientFrom5(
289 const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient,
292
302 AWS_IOTSHADOW_API std::shared_ptr<IClientV2> NewClientFrom311(
303 const Aws::Crt::Mqtt::MqttConnection &protocolClient,
306
307 } // namespace Iotshadow
308} // namespace Aws
Definition Mqtt5Client.h:361
Definition MqttConnection.h:158
Definition Optional.h:19
Definition MqttRequestResponseClient.h:499
Definition MqttRequestResponseClient.h:330
Definition MqttRequestResponseClient.h:405
Definition DeleteNamedShadowRequest.h:24
Definition DeleteShadowRequest.h:24
Definition GetNamedShadowRequest.h:24
Definition GetShadowRequest.h:24
Definition IotShadowClientV2.h:116
virtual bool DeleteShadow(const DeleteShadowRequest &request, const DeleteShadowResultHandler &handler)=0
virtual ~IClientV2()=default
virtual bool UpdateShadow(const UpdateShadowRequest &request, const UpdateShadowResultHandler &handler)=0
virtual bool GetShadow(const GetShadowRequest &request, const GetShadowResultHandler &handler)=0
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateShadowDeltaUpdatedStream(const ShadowDeltaUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowDeltaUpdatedEvent > &options)=0
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateNamedShadowDeltaUpdatedStream(const NamedShadowDeltaUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowDeltaUpdatedEvent > &options)=0
virtual bool UpdateNamedShadow(const UpdateNamedShadowRequest &request, const UpdateNamedShadowResultHandler &handler)=0
virtual bool DeleteNamedShadow(const DeleteNamedShadowRequest &request, const DeleteNamedShadowResultHandler &handler)=0
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateNamedShadowUpdatedStream(const NamedShadowUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowUpdatedEvent > &options)=0
virtual bool GetNamedShadow(const GetNamedShadowRequest &request, const GetNamedShadowResultHandler &handler)=0
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateShadowUpdatedStream(const ShadowUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowUpdatedEvent > &options)=0
Definition NamedShadowDeltaUpdatedSubscriptionRequest.h:24
Definition NamedShadowUpdatedSubscriptionRequest.h:24
ServiceErrorV2(int errorCode, E &&modeledError)
Definition IotShadowClientV2.h:46
ServiceErrorV2< E > & operator=(ServiceErrorV2< E > &&rhs)=default
ServiceErrorV2(ServiceErrorV2< E > &&rhs)=default
const E & GetModeledError() const
Definition IotShadowClientV2.h:59
ServiceErrorV2< E > & operator=(const ServiceErrorV2< E > &rhs)=default
int GetErrorCode() const
Definition IotShadowClientV2.h:56
ServiceErrorV2(const ServiceErrorV2< E > &rhs)=default
ServiceErrorV2(int errorCode)
Definition IotShadowClientV2.h:44
bool HasModeledError() const
Definition IotShadowClientV2.h:58
Definition ShadowDeltaUpdatedSubscriptionRequest.h:24
Definition ShadowUpdatedSubscriptionRequest.h:24
Definition UpdateNamedShadowRequest.h:26
Definition UpdateShadowRequest.h:26
Definition HttpRequestResponse.h:24
Definition HttpRequestResponse.h:19
Definition Allocator.h:13
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition Allocator.cpp:24
aws_allocator Allocator
Definition Allocator.h:14
Definition DeleteNamedShadowRequest.h:17
std::function< void(GetNamedShadowResult &&)> GetNamedShadowResultHandler
Definition IotShadowClientV2.h:94
Aws::Iot::RequestResponse::Result< UpdateShadowResponse, ServiceErrorV2< V2ErrorResponse > > UpdateShadowResult
Definition IotShadowClientV2.h:103
Aws::Iot::RequestResponse::Result< DeleteShadowResponse, ServiceErrorV2< V2ErrorResponse > > DeleteNamedShadowResult
Definition IotShadowClientV2.h:84
Aws::Iot::RequestResponse::Result< GetShadowResponse, ServiceErrorV2< V2ErrorResponse > > GetShadowResult
Definition IotShadowClientV2.h:96
Aws::Iot::RequestResponse::Result< GetShadowResponse, ServiceErrorV2< V2ErrorResponse > > GetNamedShadowResult
Definition IotShadowClientV2.h:92
std::function< void(UpdateShadowResult &&)> UpdateShadowResultHandler
Definition IotShadowClientV2.h:105
AWS_IOTSHADOW_API std::shared_ptr< IClientV2 > NewClientFrom311(const Aws::Crt::Mqtt::MqttConnection &protocolClient, const Aws::Iot::RequestResponse::RequestResponseClientOptions &options, Aws::Crt::Allocator *allocator=Aws::Crt::ApiAllocator())
Definition IotShadowClientV2.cpp:893
AWS_IOTSHADOW_API std::shared_ptr< IClientV2 > NewClientFrom5(const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient, const Aws::Iot::RequestResponse::RequestResponseClientOptions &options, Aws::Crt::Allocator *allocator=Aws::Crt::ApiAllocator())
Definition IotShadowClientV2.cpp:877
std::function< void(GetShadowResult &&)> GetShadowResultHandler
Definition IotShadowClientV2.h:97
Aws::Iot::RequestResponse::Result< DeleteShadowResponse, ServiceErrorV2< V2ErrorResponse > > DeleteShadowResult
Definition IotShadowClientV2.h:88
std::function< void(UpdateNamedShadowResult &&)> UpdateNamedShadowResultHandler
Definition IotShadowClientV2.h:101
std::function< void(DeleteShadowResult &&)> DeleteShadowResultHandler
Definition IotShadowClientV2.h:90
Aws::Iot::RequestResponse::Result< UpdateShadowResponse, ServiceErrorV2< V2ErrorResponse > > UpdateNamedShadowResult
Definition IotShadowClientV2.h:99
std::function< void(DeleteNamedShadowResult &&)> DeleteNamedShadowResultHandler
Definition IotShadowClientV2.h:86
Definition Allocator.h:11
Definition StringView.h:862
#define AWS_IOTSHADOW_API
Definition Exports.h:20