Skip to content

Commit b90ff7d

Browse files
authored
Update Greengrass V2 IPC models (#450)
1 parent 14d264d commit b90ff7d

File tree

6 files changed

+2737
-686
lines changed

6 files changed

+2737
-686
lines changed

eventstream_rpc/tests/include/awstest/EchoTestRpcClient.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ namespace Awstest
2828
Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept;
2929
/**
3030
* Connect the client to the server
31-
* @param lifecycleHandler An interface that is called upon when lifecycle
32-
* events relating to the connection occur.
33-
* @param connectionConfig The configuration parameters used for establishing
34-
* the connection.
35-
* @return An `RpcError` that can be used to check whether the connection was
36-
* established.
31+
* @param lifecycleHandler An interface that is called upon when lifecycle events relating to the connection
32+
* occur.
33+
* @param connectionConfig The configuration parameters used for establishing the connection.
34+
* @return An `RpcError` that can be used to check whether the connection was established.
3735
*/
3836
std::future<RpcError> Connect(
3937
ConnectionLifecycleHandler &lifecycleHandler,

eventstream_rpc/tests/include/awstest/EchoTestRpcModel.h

Lines changed: 35 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ namespace Awstest
6363
Aws::Crt::StringView,
6464
Aws::Crt::Allocator *) noexcept;
6565
static void s_customDeleter(Customer *) noexcept;
66-
/* This needs to be defined so that `Customer` can be used as a key in maps.
67-
*/
66+
/* This needs to be defined so that `Customer` can be used as a key in maps. */
6867
bool operator<(const Customer &) const noexcept;
6968
static const char *MODEL_NAME;
7069

@@ -159,8 +158,7 @@ namespace Awstest
159158
Aws::Crt::StringView,
160159
Aws::Crt::Allocator *) noexcept;
161160
static void s_customDeleter(MessageData *) noexcept;
162-
/* This needs to be defined so that `MessageData` can be used as a key in
163-
* maps. */
161+
/* This needs to be defined so that `MessageData` can be used as a key in maps. */
164162
bool operator<(const MessageData &) const noexcept;
165163
static const char *MODEL_NAME;
166164

@@ -223,8 +221,7 @@ namespace Awstest
223221
Aws::Crt::StringView,
224222
Aws::Crt::Allocator *) noexcept;
225223
static void s_customDeleter(EchoStreamingMessage *) noexcept;
226-
/* This needs to be defined so that `EchoStreamingMessage` can be used as a
227-
* key in maps. */
224+
/* This needs to be defined so that `EchoStreamingMessage` can be used as a key in maps. */
228225
bool operator<(const EchoStreamingMessage &) const noexcept;
229226
static const char *MODEL_NAME;
230227

@@ -254,8 +251,7 @@ namespace Awstest
254251
Aws::Crt::StringView,
255252
Aws::Crt::Allocator *) noexcept;
256253
static void s_customDeleter(GetAllProductsResponse *) noexcept;
257-
/* This needs to be defined so that `GetAllProductsResponse` can be used as a
258-
* key in maps. */
254+
/* This needs to be defined so that `GetAllProductsResponse` can be used as a key in maps. */
259255
bool operator<(const GetAllProductsResponse &) const noexcept;
260256
static const char *MODEL_NAME;
261257

@@ -277,8 +273,7 @@ namespace Awstest
277273
Aws::Crt::StringView,
278274
Aws::Crt::Allocator *) noexcept;
279275
static void s_customDeleter(GetAllProductsRequest *) noexcept;
280-
/* This needs to be defined so that `GetAllProductsRequest` can be used as a
281-
* key in maps. */
276+
/* This needs to be defined so that `GetAllProductsRequest` can be used as a key in maps. */
282277
bool operator<(const GetAllProductsRequest &) const noexcept;
283278
static const char *MODEL_NAME;
284279

@@ -301,8 +296,7 @@ namespace Awstest
301296
Aws::Crt::StringView,
302297
Aws::Crt::Allocator *) noexcept;
303298
static void s_customDeleter(GetAllCustomersResponse *) noexcept;
304-
/* This needs to be defined so that `GetAllCustomersResponse` can be used as a
305-
* key in maps. */
299+
/* This needs to be defined so that `GetAllCustomersResponse` can be used as a key in maps. */
306300
bool operator<(const GetAllCustomersResponse &) const noexcept;
307301
static const char *MODEL_NAME;
308302

@@ -324,8 +318,7 @@ namespace Awstest
324318
Aws::Crt::StringView,
325319
Aws::Crt::Allocator *) noexcept;
326320
static void s_customDeleter(GetAllCustomersRequest *) noexcept;
327-
/* This needs to be defined so that `GetAllCustomersRequest` can be used as a
328-
* key in maps. */
321+
/* This needs to be defined so that `GetAllCustomersRequest` can be used as a key in maps. */
329322
bool operator<(const GetAllCustomersRequest &) const noexcept;
330323
static const char *MODEL_NAME;
331324

@@ -348,8 +341,7 @@ namespace Awstest
348341
Aws::Crt::StringView,
349342
Aws::Crt::Allocator *) noexcept;
350343
static void s_customDeleter(EchoMessageResponse *) noexcept;
351-
/* This needs to be defined so that `EchoMessageResponse` can be used as a key
352-
* in maps. */
344+
/* This needs to be defined so that `EchoMessageResponse` can be used as a key in maps. */
353345
bool operator<(const EchoMessageResponse &) const noexcept;
354346
static const char *MODEL_NAME;
355347

@@ -373,8 +365,7 @@ namespace Awstest
373365
Aws::Crt::StringView,
374366
Aws::Crt::Allocator *) noexcept;
375367
static void s_customDeleter(EchoMessageRequest *) noexcept;
376-
/* This needs to be defined so that `EchoMessageRequest` can be used as a key
377-
* in maps. */
368+
/* This needs to be defined so that `EchoMessageRequest` can be used as a key in maps. */
378369
bool operator<(const EchoMessageRequest &) const noexcept;
379370
static const char *MODEL_NAME;
380371

@@ -396,8 +387,7 @@ namespace Awstest
396387
Aws::Crt::StringView,
397388
Aws::Crt::Allocator *) noexcept;
398389
static void s_customDeleter(EchoStreamingResponse *) noexcept;
399-
/* This needs to be defined so that `EchoStreamingResponse` can be used as a
400-
* key in maps. */
390+
/* This needs to be defined so that `EchoStreamingResponse` can be used as a key in maps. */
401391
bool operator<(const EchoStreamingResponse &) const noexcept;
402392
static const char *MODEL_NAME;
403393

@@ -418,8 +408,7 @@ namespace Awstest
418408
Aws::Crt::StringView,
419409
Aws::Crt::Allocator *) noexcept;
420410
static void s_customDeleter(EchoStreamingRequest *) noexcept;
421-
/* This needs to be defined so that `EchoStreamingRequest` can be used as a
422-
* key in maps. */
411+
/* This needs to be defined so that `EchoStreamingRequest` can be used as a key in maps. */
423412
bool operator<(const EchoStreamingRequest &) const noexcept;
424413
static const char *MODEL_NAME;
425414

@@ -444,8 +433,7 @@ namespace Awstest
444433
Aws::Crt::StringView,
445434
Aws::Crt::Allocator *) noexcept;
446435
static void s_customDeleter(ServiceError *) noexcept;
447-
/* This needs to be defined so that `ServiceError` can be used as a key in
448-
* maps. */
436+
/* This needs to be defined so that `ServiceError` can be used as a key in maps. */
449437
bool operator<(const ServiceError &) const noexcept;
450438
static const char *MODEL_NAME;
451439

@@ -468,8 +456,7 @@ namespace Awstest
468456
Aws::Crt::StringView,
469457
Aws::Crt::Allocator *) noexcept;
470458
static void s_customDeleter(CauseServiceErrorResponse *) noexcept;
471-
/* This needs to be defined so that `CauseServiceErrorResponse` can be used as
472-
* a key in maps. */
459+
/* This needs to be defined so that `CauseServiceErrorResponse` can be used as a key in maps. */
473460
bool operator<(const CauseServiceErrorResponse &) const noexcept;
474461
static const char *MODEL_NAME;
475462

@@ -490,8 +477,7 @@ namespace Awstest
490477
Aws::Crt::StringView,
491478
Aws::Crt::Allocator *) noexcept;
492479
static void s_customDeleter(CauseServiceErrorRequest *) noexcept;
493-
/* This needs to be defined so that `CauseServiceErrorRequest` can be used as
494-
* a key in maps. */
480+
/* This needs to be defined so that `CauseServiceErrorRequest` can be used as a key in maps. */
495481
bool operator<(const CauseServiceErrorRequest &) const noexcept;
496482
static const char *MODEL_NAME;
497483

@@ -549,10 +535,8 @@ namespace Awstest
549535
/**
550536
* Used to activate a stream for the `GetAllProductsOperation`
551537
* @param request The request used for the `GetAllProductsOperation`
552-
* @param onMessageFlushCallback An optional callback that is invoked when the
553-
* request is flushed.
554-
* @return An `RpcError` that can be used to check whether the stream was
555-
* activated.
538+
* @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
539+
* @return An `RpcError` that can be used to check whether the stream was activated.
556540
*/
557541
std::future<RpcError> Activate(
558542
const GetAllProductsRequest &request,
@@ -614,10 +598,8 @@ namespace Awstest
614598
/**
615599
* Used to activate a stream for the `CauseServiceErrorOperation`
616600
* @param request The request used for the `CauseServiceErrorOperation`
617-
* @param onMessageFlushCallback An optional callback that is invoked when the
618-
* request is flushed.
619-
* @return An `RpcError` that can be used to check whether the stream was
620-
* activated.
601+
* @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
602+
* @return An `RpcError` that can be used to check whether the stream was activated.
621603
*/
622604
std::future<RpcError> Activate(
623605
const CauseServiceErrorRequest &request,
@@ -637,10 +619,8 @@ namespace Awstest
637619
virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; }
638620

639621
/**
640-
* A callback that is invoked when an error occurs while parsing a message
641-
* from the stream.
642-
* @param rpcError The RPC error containing the status and possibly a CRT
643-
* error.
622+
* A callback that is invoked when an error occurs while parsing a message from the stream.
623+
* @param rpcError The RPC error containing the status and possibly a CRT error.
644624
*/
645625
virtual bool OnStreamError(RpcError rpcError)
646626
{
@@ -659,8 +639,7 @@ namespace Awstest
659639
}
660640

661641
/**
662-
* A callback that is invoked upon receiving ANY error response from the
663-
* server.
642+
* A callback that is invoked upon receiving ANY error response from the server.
664643
* @param operationError The error message being received.
665644
*/
666645
virtual bool OnStreamError(OperationError *operationError)
@@ -675,8 +654,7 @@ namespace Awstest
675654
*/
676655
void OnStreamEvent(Aws::Crt::ScopedResource<AbstractShapeBase> response) override;
677656
/**
678-
* Invoked when a message is received on this continuation but results in an
679-
* error.
657+
* Invoked when a message is received on this continuation but results in an error.
680658
*
681659
* This callback can return true so that the stream is closed afterwards.
682660
*/
@@ -732,12 +710,9 @@ namespace Awstest
732710
Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept;
733711
/**
734712
* Used to activate a stream for the `CauseStreamServiceToErrorOperation`
735-
* @param request The request used for the
736-
* `CauseStreamServiceToErrorOperation`
737-
* @param onMessageFlushCallback An optional callback that is invoked when the
738-
* request is flushed.
739-
* @return An `RpcError` that can be used to check whether the stream was
740-
* activated.
713+
* @param request The request used for the `CauseStreamServiceToErrorOperation`
714+
* @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
715+
* @return An `RpcError` that can be used to check whether the stream was activated.
741716
*/
742717
std::future<RpcError> Activate(
743718
const EchoStreamingRequest &request,
@@ -757,10 +732,8 @@ namespace Awstest
757732
virtual void OnStreamEvent(EchoStreamingMessage *response) { (void)response; }
758733

759734
/**
760-
* A callback that is invoked when an error occurs while parsing a message
761-
* from the stream.
762-
* @param rpcError The RPC error containing the status and possibly a CRT
763-
* error.
735+
* A callback that is invoked when an error occurs while parsing a message from the stream.
736+
* @param rpcError The RPC error containing the status and possibly a CRT error.
764737
*/
765738
virtual bool OnStreamError(RpcError rpcError)
766739
{
@@ -769,8 +742,7 @@ namespace Awstest
769742
}
770743

771744
/**
772-
* A callback that is invoked upon receiving ANY error response from the
773-
* server.
745+
* A callback that is invoked upon receiving ANY error response from the server.
774746
* @param operationError The error message being received.
775747
*/
776748
virtual bool OnStreamError(OperationError *operationError)
@@ -785,8 +757,7 @@ namespace Awstest
785757
*/
786758
void OnStreamEvent(Aws::Crt::ScopedResource<AbstractShapeBase> response) override;
787759
/**
788-
* Invoked when a message is received on this continuation but results in an
789-
* error.
760+
* Invoked when a message is received on this continuation but results in an error.
790761
*
791762
* This callback can return true so that the stream is closed afterwards.
792763
*/
@@ -841,10 +812,8 @@ namespace Awstest
841812
/**
842813
* Used to activate a stream for the `EchoStreamMessagesOperation`
843814
* @param request The request used for the `EchoStreamMessagesOperation`
844-
* @param onMessageFlushCallback An optional callback that is invoked when the
845-
* request is flushed.
846-
* @return An `RpcError` that can be used to check whether the stream was
847-
* activated.
815+
* @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
816+
* @return An `RpcError` that can be used to check whether the stream was activated.
848817
*/
849818
std::future<RpcError> Activate(
850819
const EchoStreamingRequest &request,
@@ -906,10 +875,8 @@ namespace Awstest
906875
/**
907876
* Used to activate a stream for the `EchoMessageOperation`
908877
* @param request The request used for the `EchoMessageOperation`
909-
* @param onMessageFlushCallback An optional callback that is invoked when the
910-
* request is flushed.
911-
* @return An `RpcError` that can be used to check whether the stream was
912-
* activated.
878+
* @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
879+
* @return An `RpcError` that can be used to check whether the stream was activated.
913880
*/
914881
std::future<RpcError> Activate(
915882
const EchoMessageRequest &request,
@@ -971,10 +938,8 @@ namespace Awstest
971938
/**
972939
* Used to activate a stream for the `GetAllCustomersOperation`
973940
* @param request The request used for the `GetAllCustomersOperation`
974-
* @param onMessageFlushCallback An optional callback that is invoked when the
975-
* request is flushed.
976-
* @return An `RpcError` that can be used to check whether the stream was
977-
* activated.
941+
* @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
942+
* @return An `RpcError` that can be used to check whether the stream was activated.
978943
*/
979944
std::future<RpcError> Activate(
980945
const GetAllCustomersRequest &request,

greengrass_ipc/include/aws/greengrass/GreengrassCoreIpcClient.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ namespace Aws
3030
Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept;
3131
/**
3232
* Connect the client to the server
33-
* @param lifecycleHandler An interface that is called upon when lifecycle
34-
* events relating to the connection occur.
35-
* @param connectionConfig The configuration parameters used for establishing
36-
* the connection.
37-
* @return An `RpcError` that can be used to check whether the connection was
38-
* established.
33+
* @param lifecycleHandler An interface that is called upon when lifecycle events relating to the connection
34+
* occur.
35+
* @param connectionConfig The configuration parameters used for establishing the connection.
36+
* @return An `RpcError` that can be used to check whether the connection was established.
3937
*/
4038
std::future<RpcError> Connect(
4139
ConnectionLifecycleHandler &lifecycleHandler,
@@ -67,8 +65,17 @@ namespace Aws
6765

6866
std::shared_ptr<GetComponentDetailsOperation> NewGetComponentDetails() noexcept;
6967

68+
std::shared_ptr<GetClientDeviceAuthTokenOperation> NewGetClientDeviceAuthToken() noexcept;
69+
7070
std::shared_ptr<PublishToTopicOperation> NewPublishToTopic() noexcept;
7171

72+
std::shared_ptr<SubscribeToCertificateUpdatesOperation> NewSubscribeToCertificateUpdates(
73+
std::shared_ptr<SubscribeToCertificateUpdatesStreamHandler> streamHandler) noexcept;
74+
75+
std::shared_ptr<VerifyClientDeviceIdentityOperation> NewVerifyClientDeviceIdentity() noexcept;
76+
77+
std::shared_ptr<AuthorizeClientDeviceActionOperation> NewAuthorizeClientDeviceAction() noexcept;
78+
7279
std::shared_ptr<ListComponentsOperation> NewListComponents() noexcept;
7380

7481
std::shared_ptr<CreateDebugPasswordOperation> NewCreateDebugPassword() noexcept;

0 commit comments

Comments
 (0)