AWS IoT Device SDK C++ v2 1.44.2
AWS IoT Device SDK C++ v2
Loading...
Searching...
No Matches
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
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 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
Definition Mqtt5Client.h:361
Definition MqttConnection.h:158
Definition Optional.h:19
Definition MqttRequestResponseClient.h:499
Definition MqttRequestResponseClient.h:330
Definition CreateCertificateFromCsrRequest.h:24
Definition CreateKeysAndCertificateRequest.h:24
Definition IotIdentityClientV2.h:94
virtual bool RegisterThing(const RegisterThingRequest &request, const RegisterThingResultHandler &handler)=0
virtual ~IClientV2()=default
virtual bool CreateCertificateFromCsr(const CreateCertificateFromCsrRequest &request, const CreateCertificateFromCsrResultHandler &handler)=0
virtual bool CreateKeysAndCertificate(const CreateKeysAndCertificateRequest &request, const CreateKeysAndCertificateResultHandler &handler)=0
Definition RegisterThingRequest.h:24
const E & GetModeledError() const
Definition IotIdentityClientV2.h:59
ServiceErrorV2< E > & operator=(const ServiceErrorV2< E > &rhs)=default
ServiceErrorV2(ServiceErrorV2< E > &&rhs)=default
ServiceErrorV2(int errorCode)
Definition IotIdentityClientV2.h:44
ServiceErrorV2(const ServiceErrorV2< E > &rhs)=default
int GetErrorCode() const
Definition IotIdentityClientV2.h:56
ServiceErrorV2(int errorCode, E &&modeledError)
Definition IotIdentityClientV2.h:46
ServiceErrorV2< E > & operator=(ServiceErrorV2< E > &&rhs)=default
bool HasModeledError() const
Definition IotIdentityClientV2.h:58
#define AWS_IOTIDENTITY_API
Definition Exports.h:20
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 CreateCertificateFromCsrRequest.h:17
std::function< void(CreateCertificateFromCsrResult &&)> CreateCertificateFromCsrResultHandler
Definition IotIdentityClientV2.h:77
std::function< void(RegisterThingResult &&)> RegisterThingResultHandler
Definition IotIdentityClientV2.h:85
Aws::Iot::RequestResponse::Result< RegisterThingResponse, ServiceErrorV2< V2ErrorResponse > > RegisterThingResult
Definition IotIdentityClientV2.h:83
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
Aws::Iot::RequestResponse::Result< CreateCertificateFromCsrResponse, ServiceErrorV2< V2ErrorResponse > > CreateCertificateFromCsrResult
Definition IotIdentityClientV2.h:75
std::function< void(CreateKeysAndCertificateResult &&)> CreateKeysAndCertificateResultHandler
Definition IotIdentityClientV2.h:81
Aws::Iot::RequestResponse::Result< CreateKeysAndCertificateResponse, ServiceErrorV2< V2ErrorResponse > > CreateKeysAndCertificateResult
Definition IotIdentityClientV2.h:79
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
Definition Allocator.h:11
Definition StringView.h:862