AWS IoT Device SDK C++ v2  1.43.1
AWS IoT Device SDK C++ v2
IotCommandsClientV2.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 Iotcommands
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 CommandExecutionEvent;
68  class CommandExecutionsSubscriptionRequest;
69  class UpdateCommandExecutionRequest;
70  class UpdateCommandExecutionResponse;
71  class V2ErrorResponse;
72 
76 
85  {
86  public:
87  virtual ~IClientV2() = default;
88 
98  virtual bool UpdateCommandExecution(
99  const UpdateCommandExecutionRequest &request,
100  const UpdateCommandExecutionResultHandler &handler) = 0;
101 
112  virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation>
116 
127  virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation>
131 
142  virtual std::shared_ptr<Aws::Iot::RequestResponse::IStreamingOperation>
146  };
147 
157  AWS_IOTCOMMANDS_API std::shared_ptr<IClientV2> NewClientFrom5(
158  const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient,
161 
171  AWS_IOTCOMMANDS_API std::shared_ptr<IClientV2> NewClientFrom311(
172  const Aws::Crt::Mqtt::MqttConnection &protocolClient,
175 
176  } // namespace Iotcommands
177 } // namespace Aws
Aws::Iotcommands::IClientV2::CreateCommandExecutionsGenericPayloadStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateCommandExecutionsGenericPayloadStream(const CommandExecutionsSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< CommandExecutionEvent > &options)=0
Aws::Iotcommands::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(int errorCode)
Definition: IotCommandsClientV2.h:44
Aws::Iotcommands::NewClientFrom311
AWS_IOTCOMMANDS_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: IotCommandsClientV2.cpp:336
Aws::Iotcommands::ServiceErrorV2::GetModeledError
const E & GetModeledError() const
Definition: IotCommandsClientV2.h:59
Aws::Iotcommands::ServiceErrorV2::GetErrorCode
int GetErrorCode() const
Definition: IotCommandsClientV2.h:56
Aws::Crt::ApiAllocator
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition: Allocator.cpp:24
Exports.h
Aws::Iotcommands::IClientV2::CreateCommandExecutionsCborPayloadStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateCommandExecutionsCborPayloadStream(const CommandExecutionsSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< CommandExecutionEvent > &options)=0
StlAllocator.h
Aws::Iotcommands::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(ServiceErrorV2< E > &&rhs)=default
Aws::Crt::Mqtt::MqttConnection
Definition: MqttConnection.h:158
AWS_IOTCOMMANDS_API
#define AWS_IOTCOMMANDS_API
Definition: Exports.h:20
Aws::Crt::Mqtt5::Mqtt5Client
Definition: Mqtt5Client.h:361
Aws::Iotcommands::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(int errorCode, E &&modeledError)
Definition: IotCommandsClientV2.h:46
Aws::Crt::Optional::has_value
bool has_value() const noexcept
Definition: Optional.h:122
Aws::Iot::RequestResponse::RequestResponseClientOptions
Definition: MqttRequestResponseClient.h:499
Aws::Iotcommands::ServiceErrorV2
Definition: IotCommandsClientV2.h:38
Aws::Iotcommands::ServiceErrorV2::HasModeledError
bool HasModeledError() const
Definition: IotCommandsClientV2.h:58
Aws::Iotcommands::IClientV2
Definition: IotCommandsClientV2.h:85
Aws::Iotcommands::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2()=delete
Aws::Crt::Optional< E >
Aws::Iot::RequestResponse::Result
Definition: MqttRequestResponseClient.h:330
Aws::Crt::Optional::value
T & value() &
Definition: Optional.h:124
Aws::Iotcommands::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(const ServiceErrorV2< E > &rhs)=default
Aws::Iotcommands::IClientV2::UpdateCommandExecution
virtual bool UpdateCommandExecution(const UpdateCommandExecutionRequest &request, const UpdateCommandExecutionResultHandler &handler)=0
Types.h
Aws::Iotcommands::CommandExecutionsSubscriptionRequest
Definition: CommandExecutionsSubscriptionRequest.h:26
std
Definition: StringView.h:862
Aws::Iotcommands::ServiceErrorV2::operator=
ServiceErrorV2< E > & operator=(const ServiceErrorV2< E > &rhs)=default
Aws::Iotcommands::ServiceErrorV2::~ServiceErrorV2
~ServiceErrorV2()=default
Aws
Definition: Allocator.h:11
Aws::Iotcommands::UpdateCommandExecutionRequest
Definition: UpdateCommandExecutionRequest.h:29
Aws::Crt::Allocator
aws_allocator Allocator
Definition: Allocator.h:14
Aws::Iot::RequestResponse::StreamingOperationOptions
Definition: MqttRequestResponseClient.h:405
Aws::Iotcommands::UpdateCommandExecutionResultHandler
std::function< void(UpdateCommandExecutionResult &&)> UpdateCommandExecutionResultHandler
Definition: IotCommandsClientV2.h:75
Aws::Iotcommands::ServiceErrorV2::operator=
ServiceErrorV2< E > & operator=(ServiceErrorV2< E > &&rhs)=default
Aws::Iotcommands::IClientV2::~IClientV2
virtual ~IClientV2()=default
Aws::Iotcommands::IClientV2::CreateCommandExecutionsJsonPayloadStream
virtual std::shared_ptr< Aws::Iot::RequestResponse::IStreamingOperation > CreateCommandExecutionsJsonPayloadStream(const CommandExecutionsSubscriptionRequest &request, const Aws::Iot::RequestResponse::StreamingOperationOptions< CommandExecutionEvent > &options)=0
MqttRequestResponseClient.h
Aws::Iotcommands::NewClientFrom5
AWS_IOTCOMMANDS_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: IotCommandsClientV2.cpp:320