AWS IoT Device SDK C++ v2  1.36.0
AWS IoT Device SDK C++ v2
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 
11 #include <aws/crt/StlAllocator.h>
12 #include <aws/crt/Types.h>
14 
15 #include <functional>
16 
17 namespace 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 
32 namespace 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(
275  const ShadowUpdatedSubscriptionRequest &request,
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
Aws::Iotshadow::IClientV2::DeleteShadow
virtual bool DeleteShadow(const DeleteShadowRequest &request, const DeleteShadowResultHandler &handler)=0
Aws::Iotshadow::GetNamedShadowResultHandler
std::function< void(GetNamedShadowResult &&)> GetNamedShadowResultHandler
Definition: IotShadowClientV2.h:94
Aws::Iotshadow::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2()=delete
Aws::Iotshadow::GetShadowResultHandler
std::function< void(GetShadowResult &&)> GetShadowResultHandler
Definition: IotShadowClientV2.h:97
Aws::Iotshadow::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(const ServiceErrorV2< E > &rhs)=default
Aws::Crt::ApiAllocator
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition: Allocator.cpp:24
Aws::Iotshadow::UpdateNamedShadowRequest
Definition: UpdateNamedShadowRequest.h:26
Aws::Iotshadow::DeleteShadowResultHandler
std::function< void(DeleteShadowResult &&)> DeleteShadowResultHandler
Definition: IotShadowClientV2.h:90
Aws::Iotshadow::NewClientFrom5
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
Aws::Iotshadow::IClientV2::~IClientV2
virtual ~IClientV2()=default
Aws::Iotshadow::IClientV2::GetNamedShadow
virtual bool GetNamedShadow(const GetNamedShadowRequest &request, const GetNamedShadowResultHandler &handler)=0
StlAllocator.h
Aws::Iotshadow::ServiceErrorV2::operator=
ServiceErrorV2< E > & operator=(ServiceErrorV2< E > &&rhs)=default
Aws::Iotshadow::IClientV2::DeleteNamedShadow
virtual bool DeleteNamedShadow(const DeleteNamedShadowRequest &request, const DeleteNamedShadowResultHandler &handler)=0
Aws::Iotshadow::ShadowDeltaUpdatedSubscriptionRequest
Definition: ShadowDeltaUpdatedSubscriptionRequest.h:24
Aws::Iotshadow::NamedShadowDeltaUpdatedSubscriptionRequest
Definition: NamedShadowDeltaUpdatedSubscriptionRequest.h:24
Aws::Crt::Mqtt::MqttConnection
Definition: MqttConnection.h:158
Aws::Iotshadow::DeleteNamedShadowRequest
Definition: DeleteNamedShadowRequest.h:24
Aws::Crt::Mqtt5::Mqtt5Client
Definition: Mqtt5Client.h:332
Aws::Iotshadow::IClientV2
Definition: IotShadowClientV2.h:116
Aws::Crt::Optional::has_value
bool has_value() const noexcept
Definition: Optional.h:122
Aws::Iotshadow::UpdateNamedShadowResultHandler
std::function< void(UpdateNamedShadowResult &&)> UpdateNamedShadowResultHandler
Definition: IotShadowClientV2.h:101
Aws::Iotshadow::ServiceErrorV2::HasModeledError
bool HasModeledError() const
Definition: IotShadowClientV2.h:58
Aws::Iotshadow::UpdateShadowRequest
Definition: UpdateShadowRequest.h:26
Aws::Iot::RequestResponse::RequestResponseClientOptions
Definition: MqttRequestResponseClient.h:499
Aws::Iotshadow::NamedShadowUpdatedSubscriptionRequest
Definition: NamedShadowUpdatedSubscriptionRequest.h:24
Aws::Iotshadow::DeleteShadowRequest
Definition: DeleteShadowRequest.h:24
Aws::Iotshadow::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(ServiceErrorV2< E > &&rhs)=default
Aws::Iotshadow::ServiceErrorV2::GetErrorCode
int GetErrorCode() const
Definition: IotShadowClientV2.h:56
Aws::Iotshadow::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(int errorCode)
Definition: IotShadowClientV2.h:44
Aws::Crt::Optional< E >
Aws::Iotshadow::ShadowUpdatedSubscriptionRequest
Definition: ShadowUpdatedSubscriptionRequest.h:24
Aws::Iot::RequestResponse::Result
Definition: MqttRequestResponseClient.h:330
Aws::Iotshadow::IClientV2::CreateShadowUpdatedStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateShadowUpdatedStream(const ShadowUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowUpdatedEvent > &options)=0
Aws::Crt::Optional::value
T & value() &
Definition: Optional.h:124
Exports.h
Aws::Iotshadow::IClientV2::CreateShadowDeltaUpdatedStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateShadowDeltaUpdatedStream(const ShadowDeltaUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowDeltaUpdatedEvent > &options)=0
Aws::Iotshadow::IClientV2::CreateNamedShadowDeltaUpdatedStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateNamedShadowDeltaUpdatedStream(const NamedShadowDeltaUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowDeltaUpdatedEvent > &options)=0
Aws::Iotshadow::IClientV2::UpdateShadow
virtual bool UpdateShadow(const UpdateShadowRequest &request, const UpdateShadowResultHandler &handler)=0
Types.h
Aws::Iotshadow::IClientV2::GetShadow
virtual bool GetShadow(const GetShadowRequest &request, const GetShadowResultHandler &handler)=0
Aws::Iotshadow::ServiceErrorV2::operator=
ServiceErrorV2< E > & operator=(const ServiceErrorV2< E > &rhs)=default
Aws::Iotshadow::ServiceErrorV2
Definition: IotShadowClientV2.h:38
std
Definition: StringView.h:862
Aws
Definition: Allocator.h:11
Aws::Iotshadow::GetNamedShadowRequest
Definition: GetNamedShadowRequest.h:24
Aws::Iotshadow::GetShadowRequest
Definition: GetShadowRequest.h:24
Aws::Crt::Allocator
aws_allocator Allocator
Definition: Allocator.h:14
Aws::Iotshadow::IClientV2::CreateNamedShadowUpdatedStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateNamedShadowUpdatedStream(const NamedShadowUpdatedSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< ShadowUpdatedEvent > &options)=0
Aws::Iotshadow::IClientV2::UpdateNamedShadow
virtual bool UpdateNamedShadow(const UpdateNamedShadowRequest &request, const UpdateNamedShadowResultHandler &handler)=0
Aws::Iot::RequestResponse::StreamingOperationOptions
Definition: MqttRequestResponseClient.h:405
Aws::Iotshadow::DeleteNamedShadowResultHandler
std::function< void(DeleteNamedShadowResult &&)> DeleteNamedShadowResultHandler
Definition: IotShadowClientV2.h:86
Aws::Iotshadow::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(int errorCode, E &&modeledError)
Definition: IotShadowClientV2.h:46
Aws::Iotshadow::ServiceErrorV2::~ServiceErrorV2
~ServiceErrorV2()=default
Aws::Iotshadow::ServiceErrorV2::GetModeledError
const E & GetModeledError() const
Definition: IotShadowClientV2.h:59
Aws::Iotshadow::NewClientFrom311
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
MqttRequestResponseClient.h
Aws::Iotshadow::UpdateShadowResultHandler
std::function< void(UpdateShadowResult &&)> UpdateShadowResultHandler
Definition: IotShadowClientV2.h:105
AWS_IOTSHADOW_API
#define AWS_IOTSHADOW_API
Definition: Exports.h:20