AWS IoT Device SDK C++ v2  1.36.0
AWS IoT Device SDK C++ v2
IotIdentityClientV2.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 Iotidentity
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 CreateCertificateFromCsrRequest;
68  class CreateCertificateFromCsrResponse;
69  class CreateKeysAndCertificateRequest;
70  class CreateKeysAndCertificateResponse;
71  class RegisterThingRequest;
72  class RegisterThingResponse;
73  class V2ErrorResponse;
74 
78 
82 
85  using RegisterThingResultHandler = std::function<void(RegisterThingResult &&)>;
86 
94  {
95  public:
96  virtual ~IClientV2() = default;
97 
114  const CreateCertificateFromCsrRequest &request,
115  const CreateCertificateFromCsrResultHandler &handler) = 0;
116 
133  const CreateKeysAndCertificateRequest &request,
134  const CreateKeysAndCertificateResultHandler &handler) = 0;
135 
148  virtual bool RegisterThing(
149  const RegisterThingRequest &request,
150  const RegisterThingResultHandler &handler) = 0;
151  };
152 
162  AWS_IOTIDENTITY_API std::shared_ptr<IClientV2> NewClientFrom5(
163  const Aws::Crt::Mqtt5::Mqtt5Client &protocolClient,
166 
176  AWS_IOTIDENTITY_API std::shared_ptr<IClientV2> NewClientFrom311(
177  const Aws::Crt::Mqtt::MqttConnection &protocolClient,
180 
181  } // namespace Iotidentity
182 } // namespace Aws
Aws::Iotidentity::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(int errorCode, E &&modeledError)
Definition: IotIdentityClientV2.h:46
Aws::Iotidentity::CreateKeysAndCertificateRequest
Definition: CreateKeysAndCertificateRequest.h:24
Aws::Iotidentity::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2()=delete
Aws::Iotidentity::ServiceErrorV2::GetModeledError
const E & GetModeledError() const
Definition: IotIdentityClientV2.h:59
Aws::Crt::ApiAllocator
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition: Allocator.cpp:24
Aws::Iotidentity::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(ServiceErrorV2< E > &&rhs)=default
StlAllocator.h
Aws::Iotidentity::IClientV2::~IClientV2
virtual ~IClientV2()=default
Aws::Iotidentity::IClientV2::RegisterThing
virtual bool RegisterThing(const RegisterThingRequest &request, const RegisterThingResultHandler &handler)=0
AWS_IOTIDENTITY_API
#define AWS_IOTIDENTITY_API
Definition: Exports.h:20
Aws::Crt::Mqtt::MqttConnection
Definition: MqttConnection.h:158
Aws::Iotidentity::ServiceErrorV2::operator=
ServiceErrorV2< E > & operator=(ServiceErrorV2< E > &&rhs)=default
Aws::Crt::Mqtt5::Mqtt5Client
Definition: Mqtt5Client.h:332
Aws::Iotidentity::CreateCertificateFromCsrRequest
Definition: CreateCertificateFromCsrRequest.h:24
Aws::Iotidentity::ServiceErrorV2::GetErrorCode
int GetErrorCode() const
Definition: IotIdentityClientV2.h:56
Aws::Iotidentity::ServiceErrorV2::operator=
ServiceErrorV2< E > & operator=(const ServiceErrorV2< E > &rhs)=default
Aws::Crt::Optional::has_value
bool has_value() const noexcept
Definition: Optional.h:122
Aws::Iotidentity::IClientV2::CreateKeysAndCertificate
virtual bool CreateKeysAndCertificate(const CreateKeysAndCertificateRequest &request, const CreateKeysAndCertificateResultHandler &handler)=0
Aws::Iotidentity::ServiceErrorV2::HasModeledError
bool HasModeledError() const
Definition: IotIdentityClientV2.h:58
Aws::Iot::RequestResponse::RequestResponseClientOptions
Definition: MqttRequestResponseClient.h:499
Aws::Crt::Optional< E >
Aws::Iot::RequestResponse::Result
Definition: MqttRequestResponseClient.h:330
Aws::Iotidentity::CreateCertificateFromCsrResultHandler
std::function< void(CreateCertificateFromCsrResult &&)> CreateCertificateFromCsrResultHandler
Definition: IotIdentityClientV2.h:77
Exports.h
Aws::Crt::Optional::value
T & value() &
Definition: Optional.h:124
Aws::Iotidentity::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(int errorCode)
Definition: IotIdentityClientV2.h:44
Aws::Iotidentity::ServiceErrorV2
Definition: IotIdentityClientV2.h:38
Aws::Iotidentity::ServiceErrorV2::~ServiceErrorV2
~ServiceErrorV2()=default
Types.h
Aws::Iotidentity::ServiceErrorV2::ServiceErrorV2
ServiceErrorV2(const ServiceErrorV2< E > &rhs)=default
Aws::Iotidentity::NewClientFrom5
AWS_IOTIDENTITY_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: IotIdentityClientV2.cpp:392
std
Definition: StringView.h:862
Aws
Definition: Allocator.h:11
Aws::Iotidentity::IClientV2
Definition: IotIdentityClientV2.h:94
Aws::Crt::Allocator
aws_allocator Allocator
Definition: Allocator.h:14
Aws::Iotidentity::RegisterThingResultHandler
std::function< void(RegisterThingResult &&)> RegisterThingResultHandler
Definition: IotIdentityClientV2.h:85
Aws::Iotidentity::NewClientFrom311
AWS_IOTIDENTITY_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: IotIdentityClientV2.cpp:408
Aws::Iotidentity::CreateKeysAndCertificateResultHandler
std::function< void(CreateKeysAndCertificateResult &&)> CreateKeysAndCertificateResultHandler
Definition: IotIdentityClientV2.h:81
Aws::Iotidentity::IClientV2::CreateCertificateFromCsr
virtual bool CreateCertificateFromCsr(const CreateCertificateFromCsrRequest &request, const CreateCertificateFromCsrResultHandler &handler)=0
MqttRequestResponseClient.h
Aws::Iotidentity::RegisterThingRequest
Definition: RegisterThingRequest.h:24