From 34dbaa6fa6a5b16f1cc27fd1eb22bdb743b59dc9 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Thu, 4 Mar 2021 17:28:59 -0800 Subject: [PATCH 1/4] update GG codengen module --- awsiot/greengrasscoreipc/__init__.py | 68 - awsiot/greengrasscoreipc/client.py | 536 +++--- awsiot/greengrasscoreipc/model.py | 2331 +++++++++++++++----------- test/echotestrpc/model.py | 1 + 4 files changed, 1704 insertions(+), 1232 deletions(-) diff --git a/awsiot/greengrasscoreipc/__init__.py b/awsiot/greengrasscoreipc/__init__.py index 350270eb..e69de29b 100644 --- a/awsiot/greengrasscoreipc/__init__.py +++ b/awsiot/greengrasscoreipc/__init__.py @@ -1,68 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0. - -import os -from typing import Optional - -from awscrt.io import ( - ClientBootstrap, - DefaultHostResolver, - EventLoopGroup, - SocketDomain, - SocketOptions, -) -from awsiot.eventstreamrpc import ( - Connection, - LifecycleHandler, - MessageAmendment, -) -from awsiot.greengrasscoreipc.client import GreengrassCoreIPCClient - - -def connect(*, - ipc_socket: str=None, - authtoken: str=None, - lifecycle_handler: Optional[LifecycleHandler]=None, - timeout: float=10.0) -> GreengrassCoreIPCClient: - """ - Creates an IPC client and connects to the GreengrassCoreIPC service. - - Args: - ipc_socket: Path to the Unix domain socket of Greengrass Nucleus, defaults to - environment variable AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT - authtoken: Authentication token, defaults to environment variable SVCUID - lifecycle_handler: Handler for events over the course of this - network connection. See :class:`LifecycleHandler` for more info. - Handler methods will only be invoked if the connect attempt - succeeds. - timeout: The number of seconds to wait for establishing the connection. - - Returns: - Client for the GreengrassCoreIPC service. - """ - - if not ipc_socket: - ipc_socket = os.environ["AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT"] - if not authtoken: - authtoken = os.environ["SVCUID"] - if not lifecycle_handler: - lifecycle_handler = LifecycleHandler() - - elg = EventLoopGroup(num_threads=1) - resolver = DefaultHostResolver(elg) - bootstrap = ClientBootstrap(elg, resolver) - socket_options = SocketOptions() - socket_options.domain = SocketDomain.Local - amender = MessageAmendment.create_static_authtoken_amender(authtoken) - - connection = Connection( - host_name=ipc_socket, - port=0, # dummy port number, not needed for Unix domain sockets - bootstrap=bootstrap, - socket_options=socket_options, - connect_message_amender=amender, - ) - connect_future = connection.connect(lifecycle_handler) - connect_future.result(timeout) - - return GreengrassCoreIPCClient(connection) diff --git a/awsiot/greengrasscoreipc/client.py b/awsiot/greengrasscoreipc/client.py index 56438d9b..e2d598d7 100644 --- a/awsiot/greengrasscoreipc/client.py +++ b/awsiot/greengrasscoreipc/client.py @@ -71,40 +71,6 @@ def close(self) -> concurrent.futures.Future: return super().close() -class PublishToTopicOperation(model._PublishToTopicOperation): - """ - PublishToTopicOperation - - Create with GreengrassCoreIPCClient.new_publish_to_topic() - """ - - def activate(self, request: model.PublishToTopicRequest) -> concurrent.futures.Future: - """ - Activate this operation by sending the initial PublishToTopicRequest message. - - Returns a Future which completes with a result of None if the - request is successfully written to the wire, or an exception if - the request fails to send. - """ - return self._activate(request) - - def get_response(self) -> concurrent.futures.Future: - """ - Returns a Future which completes with a result of PublishToTopicResponse, - when the initial response is received, or an exception. - """ - return self._get_response() - - def close(self) -> concurrent.futures.Future: - """ - Close the operation, whether or not it has completed. - - Returns a Future which completes with a result of None - when the operation has closed. - """ - return super().close() - - class PublishToIoTCoreOperation(model._PublishToIoTCoreOperation): """ PublishToIoTCoreOperation @@ -202,16 +168,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class ListComponentsOperation(model._ListComponentsOperation): +class DeleteThingShadowOperation(model._DeleteThingShadowOperation): """ - ListComponentsOperation + DeleteThingShadowOperation - Create with GreengrassCoreIPCClient.new_list_components() + Create with GreengrassCoreIPCClient.new_delete_thing_shadow() """ - def activate(self, request: model.ListComponentsRequest) -> concurrent.futures.Future: + def activate(self, request: model.DeleteThingShadowRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial ListComponentsRequest message. + Activate this operation by sending the initial DeleteThingShadowRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -221,7 +187,7 @@ def activate(self, request: model.ListComponentsRequest) -> concurrent.futures.F def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of ListComponentsResponse, + Returns a Future which completes with a result of DeleteThingShadowResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -236,16 +202,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class CreateDebugPasswordOperation(model._CreateDebugPasswordOperation): +class DeferComponentUpdateOperation(model._DeferComponentUpdateOperation): """ - CreateDebugPasswordOperation + DeferComponentUpdateOperation - Create with GreengrassCoreIPCClient.new_create_debug_password() + Create with GreengrassCoreIPCClient.new_defer_component_update() """ - def activate(self, request: model.CreateDebugPasswordRequest) -> concurrent.futures.Future: + def activate(self, request: model.DeferComponentUpdateRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial CreateDebugPasswordRequest message. + Activate this operation by sending the initial DeferComponentUpdateRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -255,7 +221,7 @@ def activate(self, request: model.CreateDebugPasswordRequest) -> concurrent.futu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of CreateDebugPasswordResponse, + Returns a Future which completes with a result of DeferComponentUpdateResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -270,16 +236,45 @@ def close(self) -> concurrent.futures.Future: return super().close() -class DeferComponentUpdateOperation(model._DeferComponentUpdateOperation): +class SubscribeToValidateConfigurationUpdatesStreamHandler(rpc.StreamResponseHandler): """ - DeferComponentUpdateOperation + Event handler for SubscribeToValidateConfigurationUpdatesOperation - Create with GreengrassCoreIPCClient.new_defer_component_update() + Inherit from this class and override methods to handle + stream events during a SubscribeToValidateConfigurationUpdatesOperation. """ - def activate(self, request: model.DeferComponentUpdateRequest) -> concurrent.futures.Future: + def on_stream_event(self, event: model.ValidateConfigurationUpdateEvents) -> None: """ - Activate this operation by sending the initial DeferComponentUpdateRequest message. + Invoked when a ValidateConfigurationUpdateEvents is received. + """ + pass + + def on_stream_error(self, error: Exception) -> bool: + """ + Invoked when an error occurs on the operation stream. + + Return True if operation should close as a result of this error, + """ + return True + + def on_stream_closed(self) -> None: + """ + Invoked when the stream for this operation is closed. + """ + pass + + +class SubscribeToValidateConfigurationUpdatesOperation(model._SubscribeToValidateConfigurationUpdatesOperation): + """ + SubscribeToValidateConfigurationUpdatesOperation + + Create with GreengrassCoreIPCClient.new_subscribe_to_validate_configuration_updates() + """ + + def activate(self, request: model.SubscribeToValidateConfigurationUpdatesRequest) -> concurrent.futures.Future: + """ + Activate this operation by sending the initial SubscribeToValidateConfigurationUpdatesRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -289,7 +284,7 @@ def activate(self, request: model.DeferComponentUpdateRequest) -> concurrent.fut def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of DeferComponentUpdateResponse, + Returns a Future which completes with a result of SubscribeToValidateConfigurationUpdatesResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -304,16 +299,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SendConfigurationValidityReportOperation(model._SendConfigurationValidityReportOperation): +class GetConfigurationOperation(model._GetConfigurationOperation): """ - SendConfigurationValidityReportOperation + GetConfigurationOperation - Create with GreengrassCoreIPCClient.new_send_configuration_validity_report() + Create with GreengrassCoreIPCClient.new_get_configuration() """ - def activate(self, request: model.SendConfigurationValidityReportRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetConfigurationRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SendConfigurationValidityReportRequest message. + Activate this operation by sending the initial GetConfigurationRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -323,7 +318,7 @@ def activate(self, request: model.SendConfigurationValidityReportRequest) -> con def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of SendConfigurationValidityReportResponse, + Returns a Future which completes with a result of GetConfigurationResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -338,16 +333,45 @@ def close(self) -> concurrent.futures.Future: return super().close() -class UpdateConfigurationOperation(model._UpdateConfigurationOperation): +class SubscribeToTopicStreamHandler(rpc.StreamResponseHandler): """ - UpdateConfigurationOperation + Event handler for SubscribeToTopicOperation - Create with GreengrassCoreIPCClient.new_update_configuration() + Inherit from this class and override methods to handle + stream events during a SubscribeToTopicOperation. """ - def activate(self, request: model.UpdateConfigurationRequest) -> concurrent.futures.Future: + def on_stream_event(self, event: model.SubscriptionResponseMessage) -> None: """ - Activate this operation by sending the initial UpdateConfigurationRequest message. + Invoked when a SubscriptionResponseMessage is received. + """ + pass + + def on_stream_error(self, error: Exception) -> bool: + """ + Invoked when an error occurs on the operation stream. + + Return True if operation should close as a result of this error, + """ + return True + + def on_stream_closed(self) -> None: + """ + Invoked when the stream for this operation is closed. + """ + pass + + +class SubscribeToTopicOperation(model._SubscribeToTopicOperation): + """ + SubscribeToTopicOperation + + Create with GreengrassCoreIPCClient.new_subscribe_to_topic() + """ + + def activate(self, request: model.SubscribeToTopicRequest) -> concurrent.futures.Future: + """ + Activate this operation by sending the initial SubscribeToTopicRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -357,7 +381,7 @@ def activate(self, request: model.UpdateConfigurationRequest) -> concurrent.futu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of UpdateConfigurationResponse, + Returns a Future which completes with a result of SubscribeToTopicResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -372,45 +396,84 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SubscribeToValidateConfigurationUpdatesStreamHandler(rpc.StreamResponseHandler): +class GetComponentDetailsOperation(model._GetComponentDetailsOperation): """ - Event handler for SubscribeToValidateConfigurationUpdatesOperation + GetComponentDetailsOperation - Inherit from this class and override methods to handle - stream events during a SubscribeToValidateConfigurationUpdatesOperation. + Create with GreengrassCoreIPCClient.new_get_component_details() """ - def on_stream_event(self, event: model.ValidateConfigurationUpdateEvents) -> None: + def activate(self, request: model.GetComponentDetailsRequest) -> concurrent.futures.Future: """ - Invoked when a ValidateConfigurationUpdateEvents is received. + Activate this operation by sending the initial GetComponentDetailsRequest message. + + Returns a Future which completes with a result of None if the + request is successfully written to the wire, or an exception if + the request fails to send. """ - pass + return self._activate(request) - def on_stream_error(self, error: Exception) -> bool: + def get_response(self) -> concurrent.futures.Future: """ - Invoked when an error occurs on the operation stream. + Returns a Future which completes with a result of GetComponentDetailsResponse, + when the initial response is received, or an exception. + """ + return self._get_response() - Return True if operation should close as a result of this error, + def close(self) -> concurrent.futures.Future: """ - return True + Close the operation, whether or not it has completed. - def on_stream_closed(self) -> None: + Returns a Future which completes with a result of None + when the operation has closed. """ - Invoked when the stream for this operation is closed. + return super().close() + + +class PublishToTopicOperation(model._PublishToTopicOperation): + """ + PublishToTopicOperation + + Create with GreengrassCoreIPCClient.new_publish_to_topic() + """ + + def activate(self, request: model.PublishToTopicRequest) -> concurrent.futures.Future: """ - pass + Activate this operation by sending the initial PublishToTopicRequest message. + Returns a Future which completes with a result of None if the + request is successfully written to the wire, or an exception if + the request fails to send. + """ + return self._activate(request) -class SubscribeToValidateConfigurationUpdatesOperation(model._SubscribeToValidateConfigurationUpdatesOperation): + def get_response(self) -> concurrent.futures.Future: + """ + Returns a Future which completes with a result of PublishToTopicResponse, + when the initial response is received, or an exception. + """ + return self._get_response() + + def close(self) -> concurrent.futures.Future: + """ + Close the operation, whether or not it has completed. + + Returns a Future which completes with a result of None + when the operation has closed. + """ + return super().close() + + +class ListComponentsOperation(model._ListComponentsOperation): """ - SubscribeToValidateConfigurationUpdatesOperation + ListComponentsOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_validate_configuration_updates() + Create with GreengrassCoreIPCClient.new_list_components() """ - def activate(self, request: model.SubscribeToValidateConfigurationUpdatesRequest) -> concurrent.futures.Future: + def activate(self, request: model.ListComponentsRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToValidateConfigurationUpdatesRequest message. + Activate this operation by sending the initial ListComponentsRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -420,7 +483,7 @@ def activate(self, request: model.SubscribeToValidateConfigurationUpdatesRequest def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of SubscribeToValidateConfigurationUpdatesResponse, + Returns a Future which completes with a result of ListComponentsResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -435,16 +498,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class ValidateAuthorizationTokenOperation(model._ValidateAuthorizationTokenOperation): +class CreateDebugPasswordOperation(model._CreateDebugPasswordOperation): """ - ValidateAuthorizationTokenOperation + CreateDebugPasswordOperation - Create with GreengrassCoreIPCClient.new_validate_authorization_token() + Create with GreengrassCoreIPCClient.new_create_debug_password() """ - def activate(self, request: model.ValidateAuthorizationTokenRequest) -> concurrent.futures.Future: + def activate(self, request: model.CreateDebugPasswordRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial ValidateAuthorizationTokenRequest message. + Activate this operation by sending the initial CreateDebugPasswordRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -454,7 +517,7 @@ def activate(self, request: model.ValidateAuthorizationTokenRequest) -> concurre def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of ValidateAuthorizationTokenResponse, + Returns a Future which completes with a result of CreateDebugPasswordResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -469,16 +532,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class RestartComponentOperation(model._RestartComponentOperation): +class GetThingShadowOperation(model._GetThingShadowOperation): """ - RestartComponentOperation + GetThingShadowOperation - Create with GreengrassCoreIPCClient.new_restart_component() + Create with GreengrassCoreIPCClient.new_get_thing_shadow() """ - def activate(self, request: model.RestartComponentRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetThingShadowRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial RestartComponentRequest message. + Activate this operation by sending the initial GetThingShadowRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -488,7 +551,7 @@ def activate(self, request: model.RestartComponentRequest) -> concurrent.futures def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of RestartComponentResponse, + Returns a Future which completes with a result of GetThingShadowResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -503,16 +566,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetLocalDeploymentStatusOperation(model._GetLocalDeploymentStatusOperation): +class SendConfigurationValidityReportOperation(model._SendConfigurationValidityReportOperation): """ - GetLocalDeploymentStatusOperation + SendConfigurationValidityReportOperation - Create with GreengrassCoreIPCClient.new_get_local_deployment_status() + Create with GreengrassCoreIPCClient.new_send_configuration_validity_report() """ - def activate(self, request: model.GetLocalDeploymentStatusRequest) -> concurrent.futures.Future: + def activate(self, request: model.SendConfigurationValidityReportRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetLocalDeploymentStatusRequest message. + Activate this operation by sending the initial SendConfigurationValidityReportRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -522,7 +585,7 @@ def activate(self, request: model.GetLocalDeploymentStatusRequest) -> concurrent def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of GetLocalDeploymentStatusResponse, + Returns a Future which completes with a result of SendConfigurationValidityReportResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -537,16 +600,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetSecretValueOperation(model._GetSecretValueOperation): +class UpdateThingShadowOperation(model._UpdateThingShadowOperation): """ - GetSecretValueOperation + UpdateThingShadowOperation - Create with GreengrassCoreIPCClient.new_get_secret_value() + Create with GreengrassCoreIPCClient.new_update_thing_shadow() """ - def activate(self, request: model.GetSecretValueRequest) -> concurrent.futures.Future: + def activate(self, request: model.UpdateThingShadowRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetSecretValueRequest message. + Activate this operation by sending the initial UpdateThingShadowRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -556,7 +619,7 @@ def activate(self, request: model.GetSecretValueRequest) -> concurrent.futures.F def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of GetSecretValueResponse, + Returns a Future which completes with a result of UpdateThingShadowResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -571,16 +634,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class UpdateStateOperation(model._UpdateStateOperation): +class UpdateConfigurationOperation(model._UpdateConfigurationOperation): """ - UpdateStateOperation + UpdateConfigurationOperation - Create with GreengrassCoreIPCClient.new_update_state() + Create with GreengrassCoreIPCClient.new_update_configuration() """ - def activate(self, request: model.UpdateStateRequest) -> concurrent.futures.Future: + def activate(self, request: model.UpdateConfigurationRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial UpdateStateRequest message. + Activate this operation by sending the initial UpdateConfigurationRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -590,7 +653,7 @@ def activate(self, request: model.UpdateStateRequest) -> concurrent.futures.Futu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of UpdateStateResponse, + Returns a Future which completes with a result of UpdateConfigurationResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -605,16 +668,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetConfigurationOperation(model._GetConfigurationOperation): +class ValidateAuthorizationTokenOperation(model._ValidateAuthorizationTokenOperation): """ - GetConfigurationOperation + ValidateAuthorizationTokenOperation - Create with GreengrassCoreIPCClient.new_get_configuration() + Create with GreengrassCoreIPCClient.new_validate_authorization_token() """ - def activate(self, request: model.GetConfigurationRequest) -> concurrent.futures.Future: + def activate(self, request: model.ValidateAuthorizationTokenRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetConfigurationRequest message. + Activate this operation by sending the initial ValidateAuthorizationTokenRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -624,7 +687,7 @@ def activate(self, request: model.GetConfigurationRequest) -> concurrent.futures def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of GetConfigurationResponse, + Returns a Future which completes with a result of ValidateAuthorizationTokenResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -639,45 +702,84 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SubscribeToTopicStreamHandler(rpc.StreamResponseHandler): +class RestartComponentOperation(model._RestartComponentOperation): """ - Event handler for SubscribeToTopicOperation + RestartComponentOperation - Inherit from this class and override methods to handle - stream events during a SubscribeToTopicOperation. + Create with GreengrassCoreIPCClient.new_restart_component() """ - def on_stream_event(self, event: model.SubscriptionResponseMessage) -> None: + def activate(self, request: model.RestartComponentRequest) -> concurrent.futures.Future: """ - Invoked when a SubscriptionResponseMessage is received. + Activate this operation by sending the initial RestartComponentRequest message. + + Returns a Future which completes with a result of None if the + request is successfully written to the wire, or an exception if + the request fails to send. """ - pass + return self._activate(request) - def on_stream_error(self, error: Exception) -> bool: + def get_response(self) -> concurrent.futures.Future: """ - Invoked when an error occurs on the operation stream. + Returns a Future which completes with a result of RestartComponentResponse, + when the initial response is received, or an exception. + """ + return self._get_response() - Return True if operation should close as a result of this error, + def close(self) -> concurrent.futures.Future: """ - return True + Close the operation, whether or not it has completed. - def on_stream_closed(self) -> None: + Returns a Future which completes with a result of None + when the operation has closed. """ - Invoked when the stream for this operation is closed. + return super().close() + + +class GetLocalDeploymentStatusOperation(model._GetLocalDeploymentStatusOperation): + """ + GetLocalDeploymentStatusOperation + + Create with GreengrassCoreIPCClient.new_get_local_deployment_status() + """ + + def activate(self, request: model.GetLocalDeploymentStatusRequest) -> concurrent.futures.Future: """ - pass + Activate this operation by sending the initial GetLocalDeploymentStatusRequest message. + + Returns a Future which completes with a result of None if the + request is successfully written to the wire, or an exception if + the request fails to send. + """ + return self._activate(request) + def get_response(self) -> concurrent.futures.Future: + """ + Returns a Future which completes with a result of GetLocalDeploymentStatusResponse, + when the initial response is received, or an exception. + """ + return self._get_response() -class SubscribeToTopicOperation(model._SubscribeToTopicOperation): + def close(self) -> concurrent.futures.Future: + """ + Close the operation, whether or not it has completed. + + Returns a Future which completes with a result of None + when the operation has closed. + """ + return super().close() + + +class GetSecretValueOperation(model._GetSecretValueOperation): """ - SubscribeToTopicOperation + GetSecretValueOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_topic() + Create with GreengrassCoreIPCClient.new_get_secret_value() """ - def activate(self, request: model.SubscribeToTopicRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetSecretValueRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToTopicRequest message. + Activate this operation by sending the initial GetSecretValueRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -687,7 +789,7 @@ def activate(self, request: model.SubscribeToTopicRequest) -> concurrent.futures def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of SubscribeToTopicResponse, + Returns a Future which completes with a result of GetSecretValueResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -702,16 +804,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetComponentDetailsOperation(model._GetComponentDetailsOperation): +class UpdateStateOperation(model._UpdateStateOperation): """ - GetComponentDetailsOperation + UpdateStateOperation - Create with GreengrassCoreIPCClient.new_get_component_details() + Create with GreengrassCoreIPCClient.new_update_state() """ - def activate(self, request: model.GetComponentDetailsRequest) -> concurrent.futures.Future: + def activate(self, request: model.UpdateStateRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetComponentDetailsRequest message. + Activate this operation by sending the initial UpdateStateRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -721,7 +823,7 @@ def activate(self, request: model.GetComponentDetailsRequest) -> concurrent.futu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of GetComponentDetailsResponse, + Returns a Future which completes with a result of UpdateStateResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -926,29 +1028,53 @@ def new_subscribe_to_iot_core(self, stream_handler: SubscribeToIoTCoreStreamHand """ return self._new_operation(SubscribeToIoTCoreOperation, stream_handler) - def new_publish_to_topic(self) -> PublishToTopicOperation: + def new_publish_to_iot_core(self) -> PublishToIoTCoreOperation: """ - Create a new PublishToTopicOperation. + Create a new PublishToIoTCoreOperation. This operation will not send or receive any data until activate() is called. Call activate() when you're ready for callbacks and events to fire. """ - return self._new_operation(PublishToTopicOperation) + return self._new_operation(PublishToIoTCoreOperation) - def new_publish_to_iot_core(self) -> PublishToIoTCoreOperation: + def new_subscribe_to_configuration_update(self, stream_handler: SubscribeToConfigurationUpdateStreamHandler) -> SubscribeToConfigurationUpdateOperation: """ - Create a new PublishToIoTCoreOperation. + Create a new SubscribeToConfigurationUpdateOperation. This operation will not send or receive any data until activate() is called. Call activate() when you're ready for callbacks and events to fire. + + Args: + stream_handler: Methods on this object will be called as + stream events happen on this operation. """ - return self._new_operation(PublishToIoTCoreOperation) + return self._new_operation(SubscribeToConfigurationUpdateOperation, stream_handler) - def new_subscribe_to_configuration_update(self, stream_handler: SubscribeToConfigurationUpdateStreamHandler) -> SubscribeToConfigurationUpdateOperation: + def new_delete_thing_shadow(self) -> DeleteThingShadowOperation: """ - Create a new SubscribeToConfigurationUpdateOperation. + Create a new DeleteThingShadowOperation. + + This operation will not send or receive any data until activate() + is called. Call activate() when you're ready for callbacks and + events to fire. + """ + return self._new_operation(DeleteThingShadowOperation) + + def new_defer_component_update(self) -> DeferComponentUpdateOperation: + """ + Create a new DeferComponentUpdateOperation. + + This operation will not send or receive any data until activate() + is called. Call activate() when you're ready for callbacks and + events to fire. + """ + return self._new_operation(DeferComponentUpdateOperation) + + def new_subscribe_to_validate_configuration_updates(self, stream_handler: SubscribeToValidateConfigurationUpdatesStreamHandler) -> SubscribeToValidateConfigurationUpdatesOperation: + """ + Create a new SubscribeToValidateConfigurationUpdatesOperation. This operation will not send or receive any data until activate() is called. Call activate() when you're ready for callbacks and @@ -958,7 +1084,51 @@ def new_subscribe_to_configuration_update(self, stream_handler: SubscribeToConfi stream_handler: Methods on this object will be called as stream events happen on this operation. """ - return self._new_operation(SubscribeToConfigurationUpdateOperation, stream_handler) + return self._new_operation(SubscribeToValidateConfigurationUpdatesOperation, stream_handler) + + def new_get_configuration(self) -> GetConfigurationOperation: + """ + Create a new GetConfigurationOperation. + + This operation will not send or receive any data until activate() + is called. Call activate() when you're ready for callbacks and + events to fire. + """ + return self._new_operation(GetConfigurationOperation) + + def new_subscribe_to_topic(self, stream_handler: SubscribeToTopicStreamHandler) -> SubscribeToTopicOperation: + """ + Create a new SubscribeToTopicOperation. + + This operation will not send or receive any data until activate() + is called. Call activate() when you're ready for callbacks and + events to fire. + + Args: + stream_handler: Methods on this object will be called as + stream events happen on this operation. + """ + return self._new_operation(SubscribeToTopicOperation, stream_handler) + + def new_get_component_details(self) -> GetComponentDetailsOperation: + """ + Create a new GetComponentDetailsOperation. + + This operation will not send or receive any data until activate() + is called. Call activate() when you're ready for callbacks and + events to fire. + """ + return self._new_operation(GetComponentDetailsOperation) + + def new_publish_to_topic(self) -> PublishToTopicOperation: + """ + Create a new PublishToTopicOperation. + + This operation will not send or receive any data until activate() + is called. Call activate() when you're ready for callbacks and + events to fire. + """ + return self._new_operation(PublishToTopicOperation) def new_list_components(self) -> ListComponentsOperation: """ @@ -980,15 +1150,15 @@ def new_create_debug_password(self) -> CreateDebugPasswordOperation: """ return self._new_operation(CreateDebugPasswordOperation) - def new_defer_component_update(self) -> DeferComponentUpdateOperation: + def new_get_thing_shadow(self) -> GetThingShadowOperation: """ - Create a new DeferComponentUpdateOperation. + Create a new GetThingShadowOperation. This operation will not send or receive any data until activate() is called. Call activate() when you're ready for callbacks and events to fire. """ - return self._new_operation(DeferComponentUpdateOperation) + return self._new_operation(GetThingShadowOperation) def new_send_configuration_validity_report(self) -> SendConfigurationValidityReportOperation: """ @@ -1000,29 +1170,25 @@ def new_send_configuration_validity_report(self) -> SendConfigurationValidityRep """ return self._new_operation(SendConfigurationValidityReportOperation) - def new_update_configuration(self) -> UpdateConfigurationOperation: + def new_update_thing_shadow(self) -> UpdateThingShadowOperation: """ - Create a new UpdateConfigurationOperation. + Create a new UpdateThingShadowOperation. This operation will not send or receive any data until activate() is called. Call activate() when you're ready for callbacks and events to fire. """ - return self._new_operation(UpdateConfigurationOperation) + return self._new_operation(UpdateThingShadowOperation) - def new_subscribe_to_validate_configuration_updates(self, stream_handler: SubscribeToValidateConfigurationUpdatesStreamHandler) -> SubscribeToValidateConfigurationUpdatesOperation: + def new_update_configuration(self) -> UpdateConfigurationOperation: """ - Create a new SubscribeToValidateConfigurationUpdatesOperation. + Create a new UpdateConfigurationOperation. This operation will not send or receive any data until activate() is called. Call activate() when you're ready for callbacks and events to fire. - - Args: - stream_handler: Methods on this object will be called as - stream events happen on this operation. """ - return self._new_operation(SubscribeToValidateConfigurationUpdatesOperation, stream_handler) + return self._new_operation(UpdateConfigurationOperation) def new_validate_authorization_token(self) -> ValidateAuthorizationTokenOperation: """ @@ -1074,40 +1240,6 @@ def new_update_state(self) -> UpdateStateOperation: """ return self._new_operation(UpdateStateOperation) - def new_get_configuration(self) -> GetConfigurationOperation: - """ - Create a new GetConfigurationOperation. - - This operation will not send or receive any data until activate() - is called. Call activate() when you're ready for callbacks and - events to fire. - """ - return self._new_operation(GetConfigurationOperation) - - def new_subscribe_to_topic(self, stream_handler: SubscribeToTopicStreamHandler) -> SubscribeToTopicOperation: - """ - Create a new SubscribeToTopicOperation. - - This operation will not send or receive any data until activate() - is called. Call activate() when you're ready for callbacks and - events to fire. - - Args: - stream_handler: Methods on this object will be called as - stream events happen on this operation. - """ - return self._new_operation(SubscribeToTopicOperation, stream_handler) - - def new_get_component_details(self) -> GetComponentDetailsOperation: - """ - Create a new GetComponentDetailsOperation. - - This operation will not send or receive any data until activate() - is called. Call activate() when you're ready for callbacks and - events to fire. - """ - return self._new_operation(GetComponentDetailsOperation) - def new_subscribe_to_component_updates(self, stream_handler: SubscribeToComponentUpdatesStreamHandler) -> SubscribeToComponentUpdatesOperation: """ Create a new SubscribeToComponentUpdatesOperation. diff --git a/awsiot/greengrasscoreipc/model.py b/awsiot/greengrasscoreipc/model.py index 3b3fc998..8c9d61f2 100644 --- a/awsiot/greengrasscoreipc/model.py +++ b/awsiot/greengrasscoreipc/model.py @@ -180,6 +180,26 @@ def __eq__(self, other): return False +class DeploymentStatus: + """ + DeploymentStatus enum + """ + + QUEUED = 'QUEUED' + IN_PROGRESS = 'IN_PROGRESS' + SUCCEEDED = 'SUCCEEDED' + FAILED = 'FAILED' + + +class ConfigurationValidityStatus: + """ + ConfigurationValidityStatus enum + """ + + ACCEPTED = 'ACCEPTED' + REJECTED = 'REJECTED' + + class LifecycleState: """ LifecycleState enum @@ -195,59 +215,40 @@ class LifecycleState: STOPPING = 'STOPPING' -class DeploymentStatus: - """ - DeploymentStatus enum - """ - - QUEUED = 'QUEUED' - IN_PROGRESS = 'IN_PROGRESS' - SUCCEEDED = 'SUCCEEDED' - FAILED = 'FAILED' - - -class ValidateConfigurationUpdateEvent(rpc.Shape): +class BinaryMessage(rpc.Shape): """ - ValidateConfigurationUpdateEvent + BinaryMessage All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - configuration: - deployment_id: + message: Attributes: - configuration: - deployment_id: + message: """ def __init__(self, *, - configuration: typing.Optional[typing.Dict[str, typing.Any]] = None, - deployment_id: typing.Optional[str] = None): + message: typing.Optional[bytes] = None): super().__init__() - self.configuration = configuration # type: typing.Optional[typing.Dict[str, typing.Any]] - self.deployment_id = deployment_id # type: typing.Optional[str] + self.message = message # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.configuration is not None: - payload['configuration'] = self.configuration - if self.deployment_id is not None: - payload['deploymentId'] = self.deployment_id + if self.message is not None: + payload['message'] = base64.b64encode(self.message).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'configuration' in payload: - new.configuration = payload['configuration'] - if 'deploymentId' in payload: - new.deployment_id = payload['deploymentId'] + if 'message' in payload: + new.message = base64.b64decode(payload['message']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#ValidateConfigurationUpdateEvent' + return 'aws.greengrass#BinaryMessage' def __repr__(self): attrs = [] @@ -262,57 +263,40 @@ def __eq__(self, other): return False -class ConfigurationValidityStatus: - """ - ConfigurationValidityStatus enum - """ - - ACCEPTED = 'ACCEPTED' - REJECTED = 'REJECTED' - - -class ConfigurationUpdateEvent(rpc.Shape): +class JsonMessage(rpc.Shape): """ - ConfigurationUpdateEvent + JsonMessage All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + message: Attributes: - component_name: - key_path: + message: """ def __init__(self, *, - component_name: typing.Optional[str] = None, - key_path: typing.Optional[typing.List[str]] = None): + message: typing.Optional[typing.Dict[str, typing.Any]] = None): super().__init__() - self.component_name = component_name # type: typing.Optional[str] - self.key_path = key_path # type: typing.Optional[typing.List[str]] + self.message = message # type: typing.Optional[typing.Dict[str, typing.Any]] def _to_payload(self): payload = {} - if self.component_name is not None: - payload['componentName'] = self.component_name - if self.key_path is not None: - payload['keyPath'] = self.key_path + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] - if 'keyPath' in payload: - new.key_path = payload['keyPath'] + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ConfigurationUpdateEvent' + return 'aws.greengrass#JsonMessage' def __repr__(self): attrs = [] @@ -327,40 +311,48 @@ def __eq__(self, other): return False -class BinaryMessage(rpc.Shape): +class ValidateConfigurationUpdateEvent(rpc.Shape): """ - BinaryMessage + ValidateConfigurationUpdateEvent All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + configuration: + deployment_id: Attributes: - message: + configuration: + deployment_id: """ def __init__(self, *, - message: typing.Optional[bytes] = None): + configuration: typing.Optional[typing.Dict[str, typing.Any]] = None, + deployment_id: typing.Optional[str] = None): super().__init__() - self.message = message # type: typing.Optional[bytes] + self.configuration = configuration # type: typing.Optional[typing.Dict[str, typing.Any]] + self.deployment_id = deployment_id # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = base64.b64encode(self.message).decode() + if self.configuration is not None: + payload['configuration'] = self.configuration + if self.deployment_id is not None: + payload['deploymentId'] = self.deployment_id return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = base64.b64decode(payload['message']) + if 'configuration' in payload: + new.configuration = payload['configuration'] + if 'deploymentId' in payload: + new.deployment_id = payload['deploymentId'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#BinaryMessage' + return 'aws.greengrass#ValidateConfigurationUpdateEvent' def __repr__(self): attrs = [] @@ -375,40 +367,48 @@ def __eq__(self, other): return False -class JsonMessage(rpc.Shape): +class ConfigurationUpdateEvent(rpc.Shape): """ - JsonMessage + ConfigurationUpdateEvent All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + component_name: + key_path: Attributes: - message: + component_name: + key_path: """ def __init__(self, *, - message: typing.Optional[typing.Dict[str, typing.Any]] = None): + component_name: typing.Optional[str] = None, + key_path: typing.Optional[typing.List[str]] = None): super().__init__() - self.message = message # type: typing.Optional[typing.Dict[str, typing.Any]] + self.component_name = component_name # type: typing.Optional[str] + self.key_path = key_path # type: typing.Optional[typing.List[str]] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message + if self.component_name is not None: + payload['componentName'] = self.component_name + if self.key_path is not None: + payload['keyPath'] = self.key_path return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = payload['message'] + if 'componentName' in payload: + new.component_name = payload['componentName'] + if 'keyPath' in payload: + new.key_path = payload['keyPath'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#JsonMessage' + return 'aws.greengrass#ConfigurationUpdateEvent' def __repr__(self): attrs = [] @@ -479,6 +479,7 @@ def __eq__(self, other): return False + class ComponentUpdatePolicyEvents(rpc.Shape): """ MQTTMessage is a "tagged union" class. @@ -537,64 +538,60 @@ def __eq__(self, other): return False -class ComponentDetails(rpc.Shape): +class ReportedLifecycleState: + """ + ReportedLifecycleState enum """ - ComponentDetails - All attributes are None by default, and may be set by keyword in the constructor. + RUNNING = 'RUNNING' + ERRORED = 'ERRORED' + + + +class SecretValue(rpc.Shape): + """ + MQTTMessage is a "tagged union" class. + + When sending, only one of the attributes may be set. + When receiving, only one of the attributes will be set. + All other attributes will be None. Keyword Args: - component_name: - version: - state: LifecycleState enum value - configuration: + secret_string: + secret_binary: Attributes: - component_name: - version: - state: LifecycleState enum value - configuration: + secret_string: + secret_binary: """ def __init__(self, *, - component_name: typing.Optional[str] = None, - version: typing.Optional[str] = None, - state: typing.Optional[str] = None, - configuration: typing.Optional[typing.Dict[str, typing.Any]] = None): + secret_string: typing.Optional[str] = None, + secret_binary: typing.Optional[bytes] = None): super().__init__() - self.component_name = component_name # type: typing.Optional[str] - self.version = version # type: typing.Optional[str] - self.state = state # type: typing.Optional[str] - self.configuration = configuration # type: typing.Optional[typing.Dict[str, typing.Any]] + self.secret_string = secret_string # type: typing.Optional[str] + self.secret_binary = secret_binary # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.component_name is not None: - payload['componentName'] = self.component_name - if self.version is not None: - payload['version'] = self.version - if self.state is not None: - payload['state'] = self.state - if self.configuration is not None: - payload['configuration'] = self.configuration + if self.secret_string is not None: + payload['secretString'] = self.secret_string + if self.secret_binary is not None: + payload['secretBinary'] = base64.b64encode(self.secret_binary).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] - if 'version' in payload: - new.version = payload['version'] - if 'state' in payload: - new.state = payload['state'] - if 'configuration' in payload: - new.configuration = payload['configuration'] + if 'secretString' in payload: + new.secret_string = payload['secretString'] + if 'secretBinary' in payload: + new.secret_binary = base64.b64decode(payload['secretBinary']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#ComponentDetails' + return 'aws.greengrass#SecretValue' def __repr__(self): attrs = [] @@ -609,50 +606,48 @@ def __eq__(self, other): return False -class SubscriptionResponseMessage(rpc.Shape): +class LocalDeployment(rpc.Shape): """ - ComponentDetails is a "tagged union" class. + LocalDeployment - When sending, only one of the attributes may be set. - When receiving, only one of the attributes will be set. - All other attributes will be None. + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - json_message: - binary_message: + deployment_id: + status: DeploymentStatus enum value Attributes: - json_message: - binary_message: + deployment_id: + status: DeploymentStatus enum value """ def __init__(self, *, - json_message: typing.Optional[JsonMessage] = None, - binary_message: typing.Optional[BinaryMessage] = None): + deployment_id: typing.Optional[str] = None, + status: typing.Optional[str] = None): super().__init__() - self.json_message = json_message # type: typing.Optional[JsonMessage] - self.binary_message = binary_message # type: typing.Optional[BinaryMessage] + self.deployment_id = deployment_id # type: typing.Optional[str] + self.status = status # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.json_message is not None: - payload['jsonMessage'] = self.json_message._to_payload() - if self.binary_message is not None: - payload['binaryMessage'] = self.binary_message._to_payload() - return payload + if self.deployment_id is not None: + payload['deploymentId'] = self.deployment_id + if self.status is not None: + payload['status'] = self.status + return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'jsonMessage' in payload: - new.json_message = JsonMessage._from_payload(payload['jsonMessage']) - if 'binaryMessage' in payload: - new.binary_message = BinaryMessage._from_payload(payload['binaryMessage']) + if 'deploymentId' in payload: + new.deployment_id = payload['deploymentId'] + if 'status' in payload: + new.status = payload['status'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscriptionResponseMessage' + return 'aws.greengrass#LocalDeployment' def __repr__(self): attrs = [] @@ -667,59 +662,65 @@ def __eq__(self, other): return False -class ReportedLifecycleState: +class RequestStatus: """ - ReportedLifecycleState enum + RequestStatus enum """ - RUNNING = 'RUNNING' - ERRORED = 'ERRORED' + SUCCEEDED = 'SUCCEEDED' + FAILED = 'FAILED' -class SecretValue(rpc.Shape): +class ConfigurationValidityReport(rpc.Shape): """ - ComponentDetails is a "tagged union" class. + ConfigurationValidityReport - When sending, only one of the attributes may be set. - When receiving, only one of the attributes will be set. - All other attributes will be None. + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - secret_string: - secret_binary: + status: ConfigurationValidityStatus enum value + deployment_id: + message: Attributes: - secret_string: - secret_binary: + status: ConfigurationValidityStatus enum value + deployment_id: + message: """ def __init__(self, *, - secret_string: typing.Optional[str] = None, - secret_binary: typing.Optional[bytes] = None): + status: typing.Optional[str] = None, + deployment_id: typing.Optional[str] = None, + message: typing.Optional[str] = None): super().__init__() - self.secret_string = secret_string # type: typing.Optional[str] - self.secret_binary = secret_binary # type: typing.Optional[bytes] + self.status = status # type: typing.Optional[str] + self.deployment_id = deployment_id # type: typing.Optional[str] + self.message = message # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.secret_string is not None: - payload['secretString'] = self.secret_string - if self.secret_binary is not None: - payload['secretBinary'] = base64.b64encode(self.secret_binary).decode() + if self.status is not None: + payload['status'] = self.status + if self.deployment_id is not None: + payload['deploymentId'] = self.deployment_id + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'secretString' in payload: - new.secret_string = payload['secretString'] - if 'secretBinary' in payload: - new.secret_binary = base64.b64decode(payload['secretBinary']) + if 'status' in payload: + new.status = payload['status'] + if 'deploymentId' in payload: + new.deployment_id = payload['deploymentId'] + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SecretValue' + return 'aws.greengrass#ConfigurationValidityReport' def __repr__(self): attrs = [] @@ -734,48 +735,51 @@ def __eq__(self, other): return False -class LocalDeployment(rpc.Shape): + +class PublishMessage(rpc.Shape): """ - LocalDeployment + ConfigurationValidityReport is a "tagged union" class. - All attributes are None by default, and may be set by keyword in the constructor. + When sending, only one of the attributes may be set. + When receiving, only one of the attributes will be set. + All other attributes will be None. Keyword Args: - deployment_id: - status: DeploymentStatus enum value + json_message: + binary_message: Attributes: - deployment_id: - status: DeploymentStatus enum value + json_message: + binary_message: """ def __init__(self, *, - deployment_id: typing.Optional[str] = None, - status: typing.Optional[str] = None): + json_message: typing.Optional[JsonMessage] = None, + binary_message: typing.Optional[BinaryMessage] = None): super().__init__() - self.deployment_id = deployment_id # type: typing.Optional[str] - self.status = status # type: typing.Optional[str] + self.json_message = json_message # type: typing.Optional[JsonMessage] + self.binary_message = binary_message # type: typing.Optional[BinaryMessage] def _to_payload(self): payload = {} - if self.deployment_id is not None: - payload['deploymentId'] = self.deployment_id - if self.status is not None: - payload['status'] = self.status + if self.json_message is not None: + payload['jsonMessage'] = self.json_message._to_payload() + if self.binary_message is not None: + payload['binaryMessage'] = self.binary_message._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'deploymentId' in payload: - new.deployment_id = payload['deploymentId'] - if 'status' in payload: - new.status = payload['status'] + if 'jsonMessage' in payload: + new.json_message = JsonMessage._from_payload(payload['jsonMessage']) + if 'binaryMessage' in payload: + new.binary_message = BinaryMessage._from_payload(payload['binaryMessage']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#LocalDeployment' + return 'aws.greengrass#PublishMessage' def __repr__(self): attrs = [] @@ -790,51 +794,64 @@ def __eq__(self, other): return False -class RequestStatus: - """ - RequestStatus enum - """ - - SUCCEEDED = 'SUCCEEDED' - FAILED = 'FAILED' - - -class ValidateConfigurationUpdateEvents(rpc.Shape): +class ComponentDetails(rpc.Shape): """ - LocalDeployment is a "tagged union" class. + ComponentDetails - When sending, only one of the attributes may be set. - When receiving, only one of the attributes will be set. - All other attributes will be None. + All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - validate_configuration_update_event: + component_name: + version: + state: LifecycleState enum value + configuration: Attributes: - validate_configuration_update_event: + component_name: + version: + state: LifecycleState enum value + configuration: """ def __init__(self, *, - validate_configuration_update_event: typing.Optional[ValidateConfigurationUpdateEvent] = None): + component_name: typing.Optional[str] = None, + version: typing.Optional[str] = None, + state: typing.Optional[str] = None, + configuration: typing.Optional[typing.Dict[str, typing.Any]] = None): super().__init__() - self.validate_configuration_update_event = validate_configuration_update_event # type: typing.Optional[ValidateConfigurationUpdateEvent] + self.component_name = component_name # type: typing.Optional[str] + self.version = version # type: typing.Optional[str] + self.state = state # type: typing.Optional[str] + self.configuration = configuration # type: typing.Optional[typing.Dict[str, typing.Any]] def _to_payload(self): payload = {} - if self.validate_configuration_update_event is not None: - payload['validateConfigurationUpdateEvent'] = self.validate_configuration_update_event._to_payload() + if self.component_name is not None: + payload['componentName'] = self.component_name + if self.version is not None: + payload['version'] = self.version + if self.state is not None: + payload['state'] = self.state + if self.configuration is not None: + payload['configuration'] = self.configuration return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'validateConfigurationUpdateEvent' in payload: - new.validate_configuration_update_event = ValidateConfigurationUpdateEvent._from_payload(payload['validateConfigurationUpdateEvent']) + if 'componentName' in payload: + new.component_name = payload['componentName'] + if 'version' in payload: + new.version = payload['version'] + if 'state' in payload: + new.state = payload['state'] + if 'configuration' in payload: + new.configuration = payload['configuration'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ValidateConfigurationUpdateEvents' + return 'aws.greengrass#ComponentDetails' def __repr__(self): attrs = [] @@ -849,56 +866,51 @@ def __eq__(self, other): return False -class ConfigurationValidityReport(rpc.Shape): + +class SubscriptionResponseMessage(rpc.Shape): """ - ConfigurationValidityReport + ComponentDetails is a "tagged union" class. - All attributes are None by default, and may be set by keyword in the constructor. + When sending, only one of the attributes may be set. + When receiving, only one of the attributes will be set. + All other attributes will be None. Keyword Args: - status: ConfigurationValidityStatus enum value - deployment_id: - message: + json_message: + binary_message: Attributes: - status: ConfigurationValidityStatus enum value - deployment_id: - message: + json_message: + binary_message: """ def __init__(self, *, - status: typing.Optional[str] = None, - deployment_id: typing.Optional[str] = None, - message: typing.Optional[str] = None): + json_message: typing.Optional[JsonMessage] = None, + binary_message: typing.Optional[BinaryMessage] = None): super().__init__() - self.status = status # type: typing.Optional[str] - self.deployment_id = deployment_id # type: typing.Optional[str] - self.message = message # type: typing.Optional[str] + self.json_message = json_message # type: typing.Optional[JsonMessage] + self.binary_message = binary_message # type: typing.Optional[BinaryMessage] def _to_payload(self): payload = {} - if self.status is not None: - payload['status'] = self.status - if self.deployment_id is not None: - payload['deploymentId'] = self.deployment_id - if self.message is not None: - payload['message'] = self.message + if self.json_message is not None: + payload['jsonMessage'] = self.json_message._to_payload() + if self.binary_message is not None: + payload['binaryMessage'] = self.binary_message._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'status' in payload: - new.status = payload['status'] - if 'deploymentId' in payload: - new.deployment_id = payload['deploymentId'] - if 'message' in payload: - new.message = payload['message'] + if 'jsonMessage' in payload: + new.json_message = JsonMessage._from_payload(payload['jsonMessage']) + if 'binaryMessage' in payload: + new.binary_message = BinaryMessage._from_payload(payload['binaryMessage']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#ConfigurationValidityReport' + return 'aws.greengrass#SubscriptionResponseMessage' def __repr__(self): attrs = [] @@ -913,42 +925,43 @@ def __eq__(self, other): return False -class ConfigurationUpdateEvents(rpc.Shape): + +class ValidateConfigurationUpdateEvents(rpc.Shape): """ - ConfigurationValidityReport is a "tagged union" class. + ComponentDetails is a "tagged union" class. When sending, only one of the attributes may be set. When receiving, only one of the attributes will be set. All other attributes will be None. Keyword Args: - configuration_update_event: + validate_configuration_update_event: Attributes: - configuration_update_event: + validate_configuration_update_event: """ def __init__(self, *, - configuration_update_event: typing.Optional[ConfigurationUpdateEvent] = None): + validate_configuration_update_event: typing.Optional[ValidateConfigurationUpdateEvent] = None): super().__init__() - self.configuration_update_event = configuration_update_event # type: typing.Optional[ConfigurationUpdateEvent] + self.validate_configuration_update_event = validate_configuration_update_event # type: typing.Optional[ValidateConfigurationUpdateEvent] def _to_payload(self): payload = {} - if self.configuration_update_event is not None: - payload['configurationUpdateEvent'] = self.configuration_update_event._to_payload() + if self.validate_configuration_update_event is not None: + payload['validateConfigurationUpdateEvent'] = self.validate_configuration_update_event._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'configurationUpdateEvent' in payload: - new.configuration_update_event = ConfigurationUpdateEvent._from_payload(payload['configurationUpdateEvent']) + if 'validateConfigurationUpdateEvent' in payload: + new.validate_configuration_update_event = ValidateConfigurationUpdateEvent._from_payload(payload['validateConfigurationUpdateEvent']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#ConfigurationUpdateEvents' + return 'aws.greengrass#ValidateConfigurationUpdateEvents' def __repr__(self): attrs = [] @@ -963,50 +976,43 @@ def __eq__(self, other): return False -class PublishMessage(rpc.Shape): + +class ConfigurationUpdateEvents(rpc.Shape): """ - ConfigurationValidityReport is a "tagged union" class. + ComponentDetails is a "tagged union" class. When sending, only one of the attributes may be set. When receiving, only one of the attributes will be set. All other attributes will be None. Keyword Args: - json_message: - binary_message: + configuration_update_event: Attributes: - json_message: - binary_message: + configuration_update_event: """ def __init__(self, *, - json_message: typing.Optional[JsonMessage] = None, - binary_message: typing.Optional[BinaryMessage] = None): + configuration_update_event: typing.Optional[ConfigurationUpdateEvent] = None): super().__init__() - self.json_message = json_message # type: typing.Optional[JsonMessage] - self.binary_message = binary_message # type: typing.Optional[BinaryMessage] + self.configuration_update_event = configuration_update_event # type: typing.Optional[ConfigurationUpdateEvent] def _to_payload(self): payload = {} - if self.json_message is not None: - payload['jsonMessage'] = self.json_message._to_payload() - if self.binary_message is not None: - payload['binaryMessage'] = self.binary_message._to_payload() + if self.configuration_update_event is not None: + payload['configurationUpdateEvent'] = self.configuration_update_event._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'jsonMessage' in payload: - new.json_message = JsonMessage._from_payload(payload['jsonMessage']) - if 'binaryMessage' in payload: - new.binary_message = BinaryMessage._from_payload(payload['binaryMessage']) + if 'configurationUpdateEvent' in payload: + new.configuration_update_event = ConfigurationUpdateEvent._from_payload(payload['configurationUpdateEvent']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#PublishMessage' + return 'aws.greengrass#ConfigurationUpdateEvents' def __repr__(self): attrs = [] @@ -1021,9 +1027,10 @@ def __eq__(self, other): return False + class IoTCoreMessage(rpc.Shape): """ - ConfigurationValidityReport is a "tagged union" class. + ComponentDetails is a "tagged union" class. When sending, only one of the attributes may be set. When receiving, only one of the attributes will be set. @@ -1409,13 +1416,429 @@ def _to_payload(self): @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] + if 'componentName' in payload: + new.component_name = payload['componentName'] + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#StopComponentRequest' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class ListLocalDeploymentsResponse(rpc.Shape): + """ + ListLocalDeploymentsResponse + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + local_deployments: + + Attributes: + local_deployments: + """ + + def __init__(self, *, + local_deployments: typing.Optional[typing.List[LocalDeployment]] = None): + super().__init__() + self.local_deployments = local_deployments # type: typing.Optional[typing.List[LocalDeployment]] + + def _to_payload(self): + payload = {} + if self.local_deployments is not None: + payload['localDeployments'] = [i._to_payload() for i in self.local_deployments] + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + if 'localDeployments' in payload: + new.local_deployments = [LocalDeployment._from_payload(i) for i in payload['localDeployments']] + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#ListLocalDeploymentsResponse' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class ListLocalDeploymentsRequest(rpc.Shape): + """ + ListLocalDeploymentsRequest + """ + + def __init__(self): + super().__init__() + + def _to_payload(self): + payload = {} + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#ListLocalDeploymentsRequest' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class SubscribeToComponentUpdatesResponse(rpc.Shape): + """ + SubscribeToComponentUpdatesResponse + """ + + def __init__(self): + super().__init__() + + def _to_payload(self): + payload = {} + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#SubscribeToComponentUpdatesResponse' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class SubscribeToComponentUpdatesRequest(rpc.Shape): + """ + SubscribeToComponentUpdatesRequest + """ + + def __init__(self): + super().__init__() + + def _to_payload(self): + payload = {} + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#SubscribeToComponentUpdatesRequest' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class UpdateStateResponse(rpc.Shape): + """ + UpdateStateResponse + """ + + def __init__(self): + super().__init__() + + def _to_payload(self): + payload = {} + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#UpdateStateResponse' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class UpdateStateRequest(rpc.Shape): + """ + UpdateStateRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + state: ReportedLifecycleState enum value + + Attributes: + state: ReportedLifecycleState enum value + """ + + def __init__(self, *, + state: typing.Optional[str] = None): + super().__init__() + self.state = state # type: typing.Optional[str] + + def _to_payload(self): + payload = {} + if self.state is not None: + payload['state'] = self.state + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + if 'state' in payload: + new.state = payload['state'] + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#UpdateStateRequest' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class GetSecretValueResponse(rpc.Shape): + """ + GetSecretValueResponse + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + secret_id: + version_id: + version_stage: + secret_value: + + Attributes: + secret_id: + version_id: + version_stage: + secret_value: + """ + + def __init__(self, *, + secret_id: typing.Optional[str] = None, + version_id: typing.Optional[str] = None, + version_stage: typing.Optional[typing.List[str]] = None, + secret_value: typing.Optional[SecretValue] = None): + super().__init__() + self.secret_id = secret_id # type: typing.Optional[str] + self.version_id = version_id # type: typing.Optional[str] + self.version_stage = version_stage # type: typing.Optional[typing.List[str]] + self.secret_value = secret_value # type: typing.Optional[SecretValue] + + def _to_payload(self): + payload = {} + if self.secret_id is not None: + payload['secretId'] = self.secret_id + if self.version_id is not None: + payload['versionId'] = self.version_id + if self.version_stage is not None: + payload['versionStage'] = self.version_stage + if self.secret_value is not None: + payload['secretValue'] = self.secret_value._to_payload() + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + if 'secretId' in payload: + new.secret_id = payload['secretId'] + if 'versionId' in payload: + new.version_id = payload['versionId'] + if 'versionStage' in payload: + new.version_stage = payload['versionStage'] + if 'secretValue' in payload: + new.secret_value = SecretValue._from_payload(payload['secretValue']) + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#GetSecretValueResponse' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class GetSecretValueRequest(rpc.Shape): + """ + GetSecretValueRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + secret_id: + version_id: + version_stage: + + Attributes: + secret_id: + version_id: + version_stage: + """ + + def __init__(self, *, + secret_id: typing.Optional[str] = None, + version_id: typing.Optional[str] = None, + version_stage: typing.Optional[str] = None): + super().__init__() + self.secret_id = secret_id # type: typing.Optional[str] + self.version_id = version_id # type: typing.Optional[str] + self.version_stage = version_stage # type: typing.Optional[str] + + def _to_payload(self): + payload = {} + if self.secret_id is not None: + payload['secretId'] = self.secret_id + if self.version_id is not None: + payload['versionId'] = self.version_id + if self.version_stage is not None: + payload['versionStage'] = self.version_stage + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + if 'secretId' in payload: + new.secret_id = payload['secretId'] + if 'versionId' in payload: + new.version_id = payload['versionId'] + if 'versionStage' in payload: + new.version_stage = payload['versionStage'] + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#GetSecretValueRequest' + + def __repr__(self): + attrs = [] + for attr, val in self.__dict__.items(): + if val is not None: + attrs.append('%s=%r' % (attr, val)) + return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + +class GetLocalDeploymentStatusResponse(rpc.Shape): + """ + GetLocalDeploymentStatusResponse + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + deployment: + + Attributes: + deployment: + """ + + def __init__(self, *, + deployment: typing.Optional[LocalDeployment] = None): + super().__init__() + self.deployment = deployment # type: typing.Optional[LocalDeployment] + + def _to_payload(self): + payload = {} + if self.deployment is not None: + payload['deployment'] = self.deployment._to_payload() + return payload + + @classmethod + def _from_payload(cls, payload): + new = cls() + if 'deployment' in payload: + new.deployment = LocalDeployment._from_payload(payload['deployment']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#StopComponentRequest' + return 'aws.greengrass#GetLocalDeploymentStatusResponse' def __repr__(self): attrs = [] @@ -1430,40 +1853,40 @@ def __eq__(self, other): return False -class ListLocalDeploymentsResponse(rpc.Shape): +class GetLocalDeploymentStatusRequest(rpc.Shape): """ - ListLocalDeploymentsResponse + GetLocalDeploymentStatusRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - local_deployments: + deployment_id: Attributes: - local_deployments: + deployment_id: """ def __init__(self, *, - local_deployments: typing.Optional[typing.List[LocalDeployment]] = None): + deployment_id: typing.Optional[str] = None): super().__init__() - self.local_deployments = local_deployments # type: typing.Optional[typing.List[LocalDeployment]] + self.deployment_id = deployment_id # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.local_deployments is not None: - payload['localDeployments'] = [i._to_payload() for i in self.local_deployments] + if self.deployment_id is not None: + payload['deploymentId'] = self.deployment_id return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'localDeployments' in payload: - new.local_deployments = [LocalDeployment._from_payload(i) for i in payload['localDeployments']] + if 'deploymentId' in payload: + new.deployment_id = payload['deploymentId'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ListLocalDeploymentsResponse' + return 'aws.greengrass#GetLocalDeploymentStatusRequest' def __repr__(self): attrs = [] @@ -1478,26 +1901,43 @@ def __eq__(self, other): return False -class ListLocalDeploymentsRequest(rpc.Shape): +class ComponentNotFoundError(GreengrassCoreIPCError): """ - ListLocalDeploymentsRequest + ComponentNotFoundError + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + message: + + Attributes: + message: """ - def __init__(self): + def __init__(self, *, + message: typing.Optional[str] = None): super().__init__() + self.message = message # type: typing.Optional[str] + + def _get_error_type_string(self): + return 'client' def _to_payload(self): payload = {} + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ListLocalDeploymentsRequest' + return 'aws.greengrass#ComponentNotFoundError' def __repr__(self): attrs = [] @@ -1512,26 +1952,48 @@ def __eq__(self, other): return False -class SubscribeToComponentUpdatesResponse(rpc.Shape): +class RestartComponentResponse(rpc.Shape): """ - SubscribeToComponentUpdatesResponse + RestartComponentResponse + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + restart_status: RequestStatus enum value + message: + + Attributes: + restart_status: RequestStatus enum value + message: """ - def __init__(self): + def __init__(self, *, + restart_status: typing.Optional[str] = None, + message: typing.Optional[str] = None): super().__init__() + self.restart_status = restart_status # type: typing.Optional[str] + self.message = message # type: typing.Optional[str] def _to_payload(self): payload = {} + if self.restart_status is not None: + payload['restartStatus'] = self.restart_status + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'restartStatus' in payload: + new.restart_status = payload['restartStatus'] + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToComponentUpdatesResponse' + return 'aws.greengrass#RestartComponentResponse' def __repr__(self): attrs = [] @@ -1546,26 +2008,40 @@ def __eq__(self, other): return False -class SubscribeToComponentUpdatesRequest(rpc.Shape): +class RestartComponentRequest(rpc.Shape): """ - SubscribeToComponentUpdatesRequest + RestartComponentRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + component_name: + + Attributes: + component_name: """ - def __init__(self): + def __init__(self, *, + component_name: typing.Optional[str] = None): super().__init__() + self.component_name = component_name # type: typing.Optional[str] def _to_payload(self): payload = {} + if self.component_name is not None: + payload['componentName'] = self.component_name return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'componentName' in payload: + new.component_name = payload['componentName'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToComponentUpdatesRequest' + return 'aws.greengrass#RestartComponentRequest' def __repr__(self): attrs = [] @@ -1580,40 +2056,43 @@ def __eq__(self, other): return False -class GetComponentDetailsResponse(rpc.Shape): +class InvalidTokenError(GreengrassCoreIPCError): """ - GetComponentDetailsResponse + InvalidTokenError All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_details: + message: Attributes: - component_details: + message: """ def __init__(self, *, - component_details: typing.Optional[ComponentDetails] = None): + message: typing.Optional[str] = None): super().__init__() - self.component_details = component_details # type: typing.Optional[ComponentDetails] + self.message = message # type: typing.Optional[str] + + def _get_error_type_string(self): + return 'server' def _to_payload(self): payload = {} - if self.component_details is not None: - payload['componentDetails'] = self.component_details._to_payload() + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentDetails' in payload: - new.component_details = ComponentDetails._from_payload(payload['componentDetails']) + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetComponentDetailsResponse' + return 'aws.greengrass#InvalidTokenError' def __repr__(self): attrs = [] @@ -1628,40 +2107,40 @@ def __eq__(self, other): return False -class GetComponentDetailsRequest(rpc.Shape): +class ValidateAuthorizationTokenResponse(rpc.Shape): """ - GetComponentDetailsRequest + ValidateAuthorizationTokenResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + is_valid: Attributes: - component_name: + is_valid: """ def __init__(self, *, - component_name: typing.Optional[str] = None): + is_valid: typing.Optional[bool] = None): super().__init__() - self.component_name = component_name # type: typing.Optional[str] + self.is_valid = is_valid # type: typing.Optional[bool] def _to_payload(self): payload = {} - if self.component_name is not None: - payload['componentName'] = self.component_name + if self.is_valid is not None: + payload['isValid'] = self.is_valid return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] + if 'isValid' in payload: + new.is_valid = payload['isValid'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetComponentDetailsRequest' + return 'aws.greengrass#ValidateAuthorizationTokenResponse' def __repr__(self): attrs = [] @@ -1676,40 +2155,40 @@ def __eq__(self, other): return False -class SubscribeToTopicResponse(rpc.Shape): +class ValidateAuthorizationTokenRequest(rpc.Shape): """ - SubscribeToTopicResponse + ValidateAuthorizationTokenRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + token: Attributes: - topic_name: + token: """ def __init__(self, *, - topic_name: typing.Optional[str] = None): + token: typing.Optional[str] = None): super().__init__() - self.topic_name = topic_name # type: typing.Optional[str] + self.token = token # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.topic_name is not None: - payload['topicName'] = self.topic_name + if self.token is not None: + payload['token'] = self.token return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'topicName' in payload: - new.topic_name = payload['topicName'] + if 'token' in payload: + new.token = payload['token'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToTopicResponse' + return 'aws.greengrass#ValidateAuthorizationTokenRequest' def __repr__(self): attrs = [] @@ -1724,40 +2203,43 @@ def __eq__(self, other): return False -class SubscribeToTopicRequest(rpc.Shape): +class FailedUpdateConditionCheckError(GreengrassCoreIPCError): """ - SubscribeToTopicRequest + FailedUpdateConditionCheckError All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic: + message: Attributes: - topic: + message: """ def __init__(self, *, - topic: typing.Optional[str] = None): + message: typing.Optional[str] = None): super().__init__() - self.topic = topic # type: typing.Optional[str] + self.message = message # type: typing.Optional[str] + + def _get_error_type_string(self): + return 'client' def _to_payload(self): payload = {} - if self.topic is not None: - payload['topic'] = self.topic + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'topic' in payload: - new.topic = payload['topic'] + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToTopicRequest' + return 'aws.greengrass#FailedUpdateConditionCheckError' def __repr__(self): attrs = [] @@ -1772,48 +2254,26 @@ def __eq__(self, other): return False -class GetConfigurationResponse(rpc.Shape): +class UpdateConfigurationResponse(rpc.Shape): """ - GetConfigurationResponse - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - component_name: - value: - - Attributes: - component_name: - value: + UpdateConfigurationResponse """ - def __init__(self, *, - component_name: typing.Optional[str] = None, - value: typing.Optional[typing.Dict[str, typing.Any]] = None): + def __init__(self): super().__init__() - self.component_name = component_name # type: typing.Optional[str] - self.value = value # type: typing.Optional[typing.Dict[str, typing.Any]] def _to_payload(self): payload = {} - if self.component_name is not None: - payload['componentName'] = self.component_name - if self.value is not None: - payload['value'] = self.value return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] - if 'value' in payload: - new.value = payload['value'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetConfigurationResponse' + return 'aws.greengrass#UpdateConfigurationResponse' def __repr__(self): attrs = [] @@ -1828,48 +2288,56 @@ def __eq__(self, other): return False -class GetConfigurationRequest(rpc.Shape): +class UpdateConfigurationRequest(rpc.Shape): """ - GetConfigurationRequest + UpdateConfigurationRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: key_path: + timestamp: + value_to_merge: Attributes: - component_name: key_path: + timestamp: + value_to_merge: """ def __init__(self, *, - component_name: typing.Optional[str] = None, - key_path: typing.Optional[typing.List[str]] = None): + key_path: typing.Optional[typing.List[str]] = None, + timestamp: typing.Optional[datetime.datetime] = None, + value_to_merge: typing.Optional[typing.Dict[str, typing.Any]] = None): super().__init__() - self.component_name = component_name # type: typing.Optional[str] self.key_path = key_path # type: typing.Optional[typing.List[str]] + self.timestamp = timestamp # type: typing.Optional[datetime.datetime] + self.value_to_merge = value_to_merge # type: typing.Optional[typing.Dict[str, typing.Any]] def _to_payload(self): payload = {} - if self.component_name is not None: - payload['componentName'] = self.component_name if self.key_path is not None: payload['keyPath'] = self.key_path + if self.timestamp is not None: + payload['timestamp'] = self.timestamp.timestamp() + if self.value_to_merge is not None: + payload['valueToMerge'] = self.value_to_merge return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] if 'keyPath' in payload: new.key_path = payload['keyPath'] + if 'timestamp' in payload: + new.timestamp = datetime.datetime.fromtimestamp(payload['timestamp'], datetime.timezone.utc) + if 'valueToMerge' in payload: + new.value_to_merge = payload['valueToMerge'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetConfigurationRequest' + return 'aws.greengrass#UpdateConfigurationRequest' def __repr__(self): attrs = [] @@ -1884,26 +2352,43 @@ def __eq__(self, other): return False -class UpdateStateResponse(rpc.Shape): +class ConflictError(GreengrassCoreIPCError): """ - UpdateStateResponse + ConflictError + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + message: + + Attributes: + message: """ - def __init__(self): + def __init__(self, *, + message: typing.Optional[str] = None): super().__init__() + self.message = message # type: typing.Optional[str] + + def _get_error_type_string(self): + return 'client' def _to_payload(self): payload = {} + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateStateResponse' + return 'aws.greengrass#ConflictError' def __repr__(self): attrs = [] @@ -1918,40 +2403,40 @@ def __eq__(self, other): return False -class UpdateStateRequest(rpc.Shape): +class UpdateThingShadowResponse(rpc.Shape): """ - UpdateStateRequest + UpdateThingShadowResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - state: ReportedLifecycleState enum value + payload: Attributes: - state: ReportedLifecycleState enum value + payload: """ def __init__(self, *, - state: typing.Optional[str] = None): + payload: typing.Optional[bytes] = None): super().__init__() - self.state = state # type: typing.Optional[str] + self.payload = payload # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.state is not None: - payload['state'] = self.state + if self.payload is not None: + payload['payload'] = base64.b64encode(self.payload).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'state' in payload: - new.state = payload['state'] + if 'payload' in payload: + new.payload = base64.b64decode(payload['payload']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateStateRequest' + return 'aws.greengrass#UpdateThingShadowResponse' def __repr__(self): attrs = [] @@ -1966,64 +2451,56 @@ def __eq__(self, other): return False -class GetSecretValueResponse(rpc.Shape): +class UpdateThingShadowRequest(rpc.Shape): """ - GetSecretValueResponse + UpdateThingShadowRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - secret_id: - version_id: - version_stage: - secret_value: + thing_name: + shadow_name: + payload: Attributes: - secret_id: - version_id: - version_stage: - secret_value: + thing_name: + shadow_name: + payload: """ def __init__(self, *, - secret_id: typing.Optional[str] = None, - version_id: typing.Optional[str] = None, - version_stage: typing.Optional[typing.List[str]] = None, - secret_value: typing.Optional[SecretValue] = None): + thing_name: typing.Optional[str] = None, + shadow_name: typing.Optional[str] = None, + payload: typing.Optional[bytes] = None): super().__init__() - self.secret_id = secret_id # type: typing.Optional[str] - self.version_id = version_id # type: typing.Optional[str] - self.version_stage = version_stage # type: typing.Optional[typing.List[str]] - self.secret_value = secret_value # type: typing.Optional[SecretValue] + self.thing_name = thing_name # type: typing.Optional[str] + self.shadow_name = shadow_name # type: typing.Optional[str] + self.payload = payload # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.secret_id is not None: - payload['secretId'] = self.secret_id - if self.version_id is not None: - payload['versionId'] = self.version_id - if self.version_stage is not None: - payload['versionStage'] = self.version_stage - if self.secret_value is not None: - payload['secretValue'] = self.secret_value._to_payload() + if self.thing_name is not None: + payload['thingName'] = self.thing_name + if self.shadow_name is not None: + payload['shadowName'] = self.shadow_name + if self.payload is not None: + payload['payload'] = base64.b64encode(self.payload).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'secretId' in payload: - new.secret_id = payload['secretId'] - if 'versionId' in payload: - new.version_id = payload['versionId'] - if 'versionStage' in payload: - new.version_stage = payload['versionStage'] - if 'secretValue' in payload: - new.secret_value = SecretValue._from_payload(payload['secretValue']) + if 'thingName' in payload: + new.thing_name = payload['thingName'] + if 'shadowName' in payload: + new.shadow_name = payload['shadowName'] + if 'payload' in payload: + new.payload = base64.b64decode(payload['payload']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetSecretValueResponse' + return 'aws.greengrass#UpdateThingShadowRequest' def __repr__(self): attrs = [] @@ -2038,56 +2515,26 @@ def __eq__(self, other): return False -class GetSecretValueRequest(rpc.Shape): +class SendConfigurationValidityReportResponse(rpc.Shape): """ - GetSecretValueRequest - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - secret_id: - version_id: - version_stage: - - Attributes: - secret_id: - version_id: - version_stage: + SendConfigurationValidityReportResponse """ - def __init__(self, *, - secret_id: typing.Optional[str] = None, - version_id: typing.Optional[str] = None, - version_stage: typing.Optional[str] = None): + def __init__(self): super().__init__() - self.secret_id = secret_id # type: typing.Optional[str] - self.version_id = version_id # type: typing.Optional[str] - self.version_stage = version_stage # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.secret_id is not None: - payload['secretId'] = self.secret_id - if self.version_id is not None: - payload['versionId'] = self.version_id - if self.version_stage is not None: - payload['versionStage'] = self.version_stage return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'secretId' in payload: - new.secret_id = payload['secretId'] - if 'versionId' in payload: - new.version_id = payload['versionId'] - if 'versionStage' in payload: - new.version_stage = payload['versionStage'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetSecretValueRequest' + return 'aws.greengrass#SendConfigurationValidityReportResponse' def __repr__(self): attrs = [] @@ -2102,40 +2549,40 @@ def __eq__(self, other): return False -class GetLocalDeploymentStatusResponse(rpc.Shape): +class SendConfigurationValidityReportRequest(rpc.Shape): """ - GetLocalDeploymentStatusResponse + SendConfigurationValidityReportRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment: + configuration_validity_report: Attributes: - deployment: + configuration_validity_report: """ def __init__(self, *, - deployment: typing.Optional[LocalDeployment] = None): + configuration_validity_report: typing.Optional[ConfigurationValidityReport] = None): super().__init__() - self.deployment = deployment # type: typing.Optional[LocalDeployment] + self.configuration_validity_report = configuration_validity_report # type: typing.Optional[ConfigurationValidityReport] def _to_payload(self): payload = {} - if self.deployment is not None: - payload['deployment'] = self.deployment._to_payload() + if self.configuration_validity_report is not None: + payload['configurationValidityReport'] = self.configuration_validity_report._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'deployment' in payload: - new.deployment = LocalDeployment._from_payload(payload['deployment']) + if 'configurationValidityReport' in payload: + new.configuration_validity_report = ConfigurationValidityReport._from_payload(payload['configurationValidityReport']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetLocalDeploymentStatusResponse' + return 'aws.greengrass#SendConfigurationValidityReportRequest' def __repr__(self): attrs = [] @@ -2150,40 +2597,40 @@ def __eq__(self, other): return False -class GetLocalDeploymentStatusRequest(rpc.Shape): +class GetThingShadowResponse(rpc.Shape): """ - GetLocalDeploymentStatusRequest + GetThingShadowResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + payload: Attributes: - deployment_id: + payload: """ def __init__(self, *, - deployment_id: typing.Optional[str] = None): + payload: typing.Optional[bytes] = None): super().__init__() - self.deployment_id = deployment_id # type: typing.Optional[str] + self.payload = payload # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.deployment_id is not None: - payload['deploymentId'] = self.deployment_id + if self.payload is not None: + payload['payload'] = base64.b64encode(self.payload).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'deploymentId' in payload: - new.deployment_id = payload['deploymentId'] + if 'payload' in payload: + new.payload = base64.b64decode(payload['payload']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#GetLocalDeploymentStatusRequest' + return 'aws.greengrass#GetThingShadowResponse' def __repr__(self): attrs = [] @@ -2198,43 +2645,48 @@ def __eq__(self, other): return False -class ComponentNotFoundError(GreengrassCoreIPCError): +class GetThingShadowRequest(rpc.Shape): """ - ComponentNotFoundError + GetThingShadowRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + thing_name: + shadow_name: Attributes: - message: + thing_name: + shadow_name: """ def __init__(self, *, - message: typing.Optional[str] = None): + thing_name: typing.Optional[str] = None, + shadow_name: typing.Optional[str] = None): super().__init__() - self.message = message # type: typing.Optional[str] - - def _get_error_type_string(self): - return 'client' + self.thing_name = thing_name # type: typing.Optional[str] + self.shadow_name = shadow_name # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message + if self.thing_name is not None: + payload['thingName'] = self.thing_name + if self.shadow_name is not None: + payload['shadowName'] = self.shadow_name return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = payload['message'] + if 'thingName' in payload: + new.thing_name = payload['thingName'] + if 'shadowName' in payload: + new.shadow_name = payload['shadowName'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ComponentNotFoundError' + return 'aws.greengrass#GetThingShadowRequest' def __repr__(self): attrs = [] @@ -2249,48 +2701,64 @@ def __eq__(self, other): return False -class RestartComponentResponse(rpc.Shape): +class CreateDebugPasswordResponse(rpc.Shape): """ - RestartComponentResponse + CreateDebugPasswordResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - restart_status: RequestStatus enum value - message: + password: + username: + password_expiration: + certificate_signature: Attributes: - restart_status: RequestStatus enum value - message: + password: + username: + password_expiration: + certificate_signature: """ def __init__(self, *, - restart_status: typing.Optional[str] = None, - message: typing.Optional[str] = None): + password: typing.Optional[str] = None, + username: typing.Optional[str] = None, + password_expiration: typing.Optional[datetime.datetime] = None, + certificate_signature: typing.Optional[str] = None): super().__init__() - self.restart_status = restart_status # type: typing.Optional[str] - self.message = message # type: typing.Optional[str] + self.password = password # type: typing.Optional[str] + self.username = username # type: typing.Optional[str] + self.password_expiration = password_expiration # type: typing.Optional[datetime.datetime] + self.certificate_signature = certificate_signature # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.restart_status is not None: - payload['restartStatus'] = self.restart_status - if self.message is not None: - payload['message'] = self.message + if self.password is not None: + payload['password'] = self.password + if self.username is not None: + payload['username'] = self.username + if self.password_expiration is not None: + payload['passwordExpiration'] = self.password_expiration.timestamp() + if self.certificate_signature is not None: + payload['certificateSignature'] = self.certificate_signature return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'restartStatus' in payload: - new.restart_status = payload['restartStatus'] - if 'message' in payload: - new.message = payload['message'] + if 'password' in payload: + new.password = payload['password'] + if 'username' in payload: + new.username = payload['username'] + if 'passwordExpiration' in payload: + new.password_expiration = datetime.datetime.fromtimestamp(payload['passwordExpiration'], datetime.timezone.utc) + if 'certificateSignature' in payload: + new.certificate_signature = payload['certificateSignature'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#RestartComponentResponse' + return 'aws.greengrass#CreateDebugPasswordResponse' def __repr__(self): attrs = [] @@ -2305,40 +2773,26 @@ def __eq__(self, other): return False -class RestartComponentRequest(rpc.Shape): +class CreateDebugPasswordRequest(rpc.Shape): """ - RestartComponentRequest - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - component_name: - - Attributes: - component_name: + CreateDebugPasswordRequest """ - def __init__(self, *, - component_name: typing.Optional[str] = None): + def __init__(self): super().__init__() - self.component_name = component_name # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.component_name is not None: - payload['componentName'] = self.component_name return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'componentName' in payload: - new.component_name = payload['componentName'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#RestartComponentRequest' + return 'aws.greengrass#CreateDebugPasswordRequest' def __repr__(self): attrs = [] @@ -2353,43 +2807,40 @@ def __eq__(self, other): return False -class InvalidTokenError(GreengrassCoreIPCError): +class ListComponentsResponse(rpc.Shape): """ - InvalidTokenError + ListComponentsResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + components: Attributes: - message: + components: """ def __init__(self, *, - message: typing.Optional[str] = None): + components: typing.Optional[typing.List[ComponentDetails]] = None): super().__init__() - self.message = message # type: typing.Optional[str] - - def _get_error_type_string(self): - return 'server' + self.components = components # type: typing.Optional[typing.List[ComponentDetails]] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message + if self.components is not None: + payload['components'] = [i._to_payload() for i in self.components] return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = payload['message'] + if 'components' in payload: + new.components = [ComponentDetails._from_payload(i) for i in payload['components']] return new @classmethod def _model_name(cls): - return 'aws.greengrass#InvalidTokenError' + return 'aws.greengrass#ListComponentsResponse' def __repr__(self): attrs = [] @@ -2404,40 +2855,26 @@ def __eq__(self, other): return False -class ValidateAuthorizationTokenResponse(rpc.Shape): +class ListComponentsRequest(rpc.Shape): """ - ValidateAuthorizationTokenResponse - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - is_valid: - - Attributes: - is_valid: + ListComponentsRequest """ - def __init__(self, *, - is_valid: typing.Optional[bool] = None): + def __init__(self): super().__init__() - self.is_valid = is_valid # type: typing.Optional[bool] def _to_payload(self): payload = {} - if self.is_valid is not None: - payload['isValid'] = self.is_valid return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'isValid' in payload: - new.is_valid = payload['isValid'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ValidateAuthorizationTokenResponse' + return 'aws.greengrass#ListComponentsRequest' def __repr__(self): attrs = [] @@ -2452,40 +2889,26 @@ def __eq__(self, other): return False -class ValidateAuthorizationTokenRequest(rpc.Shape): +class PublishToTopicResponse(rpc.Shape): """ - ValidateAuthorizationTokenRequest - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - token: - - Attributes: - token: + PublishToTopicResponse """ - def __init__(self, *, - token: typing.Optional[str] = None): + def __init__(self): super().__init__() - self.token = token # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.token is not None: - payload['token'] = self.token return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'token' in payload: - new.token = payload['token'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ValidateAuthorizationTokenRequest' + return 'aws.greengrass#PublishToTopicResponse' def __repr__(self): attrs = [] @@ -2500,26 +2923,48 @@ def __eq__(self, other): return False -class SubscribeToValidateConfigurationUpdatesResponse(rpc.Shape): +class PublishToTopicRequest(rpc.Shape): """ - SubscribeToValidateConfigurationUpdatesResponse + PublishToTopicRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + topic: + publish_message: + + Attributes: + topic: + publish_message: """ - def __init__(self): + def __init__(self, *, + topic: typing.Optional[str] = None, + publish_message: typing.Optional[PublishMessage] = None): super().__init__() + self.topic = topic # type: typing.Optional[str] + self.publish_message = publish_message # type: typing.Optional[PublishMessage] def _to_payload(self): payload = {} + if self.topic is not None: + payload['topic'] = self.topic + if self.publish_message is not None: + payload['publishMessage'] = self.publish_message._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'topic' in payload: + new.topic = payload['topic'] + if 'publishMessage' in payload: + new.publish_message = PublishMessage._from_payload(payload['publishMessage']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse' + return 'aws.greengrass#PublishToTopicRequest' def __repr__(self): attrs = [] @@ -2534,26 +2979,40 @@ def __eq__(self, other): return False -class SubscribeToValidateConfigurationUpdatesRequest(rpc.Shape): +class GetComponentDetailsResponse(rpc.Shape): """ - SubscribeToValidateConfigurationUpdatesRequest + GetComponentDetailsResponse + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + component_details: + + Attributes: + component_details: """ - def __init__(self): + def __init__(self, *, + component_details: typing.Optional[ComponentDetails] = None): super().__init__() + self.component_details = component_details # type: typing.Optional[ComponentDetails] def _to_payload(self): payload = {} + if self.component_details is not None: + payload['componentDetails'] = self.component_details._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'componentDetails' in payload: + new.component_details = ComponentDetails._from_payload(payload['componentDetails']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest' + return 'aws.greengrass#GetComponentDetailsResponse' def __repr__(self): attrs = [] @@ -2568,43 +3027,40 @@ def __eq__(self, other): return False -class FailedUpdateConditionCheckError(GreengrassCoreIPCError): +class GetComponentDetailsRequest(rpc.Shape): """ - FailedUpdateConditionCheckError + GetComponentDetailsRequest All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + component_name: Attributes: - message: + component_name: """ def __init__(self, *, - message: typing.Optional[str] = None): + component_name: typing.Optional[str] = None): super().__init__() - self.message = message # type: typing.Optional[str] - - def _get_error_type_string(self): - return 'client' + self.component_name = component_name # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message + if self.component_name is not None: + payload['componentName'] = self.component_name return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = payload['message'] + if 'componentName' in payload: + new.component_name = payload['componentName'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#FailedUpdateConditionCheckError' + return 'aws.greengrass#GetComponentDetailsRequest' def __repr__(self): attrs = [] @@ -2619,43 +3075,40 @@ def __eq__(self, other): return False -class ConflictError(GreengrassCoreIPCError): +class SubscribeToTopicResponse(rpc.Shape): """ - ConflictError + SubscribeToTopicResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + topic_name: Attributes: - message: + topic_name: """ def __init__(self, *, - message: typing.Optional[str] = None): + topic_name: typing.Optional[str] = None): super().__init__() - self.message = message # type: typing.Optional[str] - - def _get_error_type_string(self): - return 'client' + self.topic_name = topic_name # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message + if self.topic_name is not None: + payload['topicName'] = self.topic_name return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = payload['message'] + if 'topicName' in payload: + new.topic_name = payload['topicName'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ConflictError' + return 'aws.greengrass#SubscribeToTopicResponse' def __repr__(self): attrs = [] @@ -2670,26 +3123,40 @@ def __eq__(self, other): return False -class UpdateConfigurationResponse(rpc.Shape): +class SubscribeToTopicRequest(rpc.Shape): """ - UpdateConfigurationResponse + SubscribeToTopicRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + topic: + + Attributes: + topic: """ - def __init__(self): + def __init__(self, *, + topic: typing.Optional[str] = None): super().__init__() + self.topic = topic # type: typing.Optional[str] def _to_payload(self): payload = {} + if self.topic is not None: + payload['topic'] = self.topic return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'topic' in payload: + new.topic = payload['topic'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateConfigurationResponse' + return 'aws.greengrass#SubscribeToTopicRequest' def __repr__(self): attrs = [] @@ -2704,56 +3171,48 @@ def __eq__(self, other): return False -class UpdateConfigurationRequest(rpc.Shape): +class GetConfigurationResponse(rpc.Shape): """ - UpdateConfigurationRequest + GetConfigurationResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - key_path: - timestamp: - value_to_merge: + component_name: + value: Attributes: - key_path: - timestamp: - value_to_merge: + component_name: + value: """ def __init__(self, *, - key_path: typing.Optional[typing.List[str]] = None, - timestamp: typing.Optional[datetime.datetime] = None, - value_to_merge: typing.Optional[typing.Dict[str, typing.Any]] = None): + component_name: typing.Optional[str] = None, + value: typing.Optional[typing.Dict[str, typing.Any]] = None): super().__init__() - self.key_path = key_path # type: typing.Optional[typing.List[str]] - self.timestamp = timestamp # type: typing.Optional[datetime.datetime] - self.value_to_merge = value_to_merge # type: typing.Optional[typing.Dict[str, typing.Any]] + self.component_name = component_name # type: typing.Optional[str] + self.value = value # type: typing.Optional[typing.Dict[str, typing.Any]] def _to_payload(self): payload = {} - if self.key_path is not None: - payload['keyPath'] = self.key_path - if self.timestamp is not None: - payload['timestamp'] = self.timestamp.timestamp() - if self.value_to_merge is not None: - payload['valueToMerge'] = self.value_to_merge + if self.component_name is not None: + payload['componentName'] = self.component_name + if self.value is not None: + payload['value'] = self.value return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'keyPath' in payload: - new.key_path = payload['keyPath'] - if 'timestamp' in payload: - new.timestamp = datetime.datetime.fromtimestamp(payload['timestamp'], datetime.timezone.utc) - if 'valueToMerge' in payload: - new.value_to_merge = payload['valueToMerge'] + if 'componentName' in payload: + new.component_name = payload['componentName'] + if 'value' in payload: + new.value = payload['value'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateConfigurationRequest' + return 'aws.greengrass#GetConfigurationResponse' def __repr__(self): attrs = [] @@ -2768,26 +3227,48 @@ def __eq__(self, other): return False -class SendConfigurationValidityReportResponse(rpc.Shape): +class GetConfigurationRequest(rpc.Shape): """ - SendConfigurationValidityReportResponse + GetConfigurationRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + component_name: + key_path: + + Attributes: + component_name: + key_path: """ - def __init__(self): + def __init__(self, *, + component_name: typing.Optional[str] = None, + key_path: typing.Optional[typing.List[str]] = None): super().__init__() + self.component_name = component_name # type: typing.Optional[str] + self.key_path = key_path # type: typing.Optional[typing.List[str]] def _to_payload(self): payload = {} + if self.component_name is not None: + payload['componentName'] = self.component_name + if self.key_path is not None: + payload['keyPath'] = self.key_path return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'componentName' in payload: + new.component_name = payload['componentName'] + if 'keyPath' in payload: + new.key_path = payload['keyPath'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#SendConfigurationValidityReportResponse' + return 'aws.greengrass#GetConfigurationRequest' def __repr__(self): attrs = [] @@ -2802,40 +3283,26 @@ def __eq__(self, other): return False -class SendConfigurationValidityReportRequest(rpc.Shape): +class SubscribeToValidateConfigurationUpdatesResponse(rpc.Shape): """ - SendConfigurationValidityReportRequest - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - configuration_validity_report: - - Attributes: - configuration_validity_report: + SubscribeToValidateConfigurationUpdatesResponse """ - def __init__(self, *, - configuration_validity_report: typing.Optional[ConfigurationValidityReport] = None): + def __init__(self): super().__init__() - self.configuration_validity_report = configuration_validity_report # type: typing.Optional[ConfigurationValidityReport] def _to_payload(self): payload = {} - if self.configuration_validity_report is not None: - payload['configurationValidityReport'] = self.configuration_validity_report._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'configurationValidityReport' in payload: - new.configuration_validity_report = ConfigurationValidityReport._from_payload(payload['configurationValidityReport']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#SendConfigurationValidityReportRequest' + return 'aws.greengrass#SubscribeToValidateConfigurationUpdatesResponse' def __repr__(self): attrs = [] @@ -2850,43 +3317,26 @@ def __eq__(self, other): return False -class InvalidArgumentsError(GreengrassCoreIPCError): +class SubscribeToValidateConfigurationUpdatesRequest(rpc.Shape): """ - InvalidArgumentsError - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - message: - - Attributes: - message: + SubscribeToValidateConfigurationUpdatesRequest """ - def __init__(self, *, - message: typing.Optional[str] = None): + def __init__(self): super().__init__() - self.message = message # type: typing.Optional[str] - - def _get_error_type_string(self): - return 'client' def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#InvalidArgumentsError' + return 'aws.greengrass#SubscribeToValidateConfigurationUpdatesRequest' def __repr__(self): attrs = [] @@ -2999,90 +3449,43 @@ def __eq__(self, other): return False -class CreateDebugPasswordResponse(rpc.Shape): +class InvalidArgumentsError(GreengrassCoreIPCError): """ - CreateDebugPasswordResponse + InvalidArgumentsError All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - password: - username: - password_expiration: + message: Attributes: - password: - username: - password_expiration: + message: """ def __init__(self, *, - password: typing.Optional[str] = None, - username: typing.Optional[str] = None, - password_expiration: typing.Optional[datetime.datetime] = None): + message: typing.Optional[str] = None): super().__init__() - self.password = password # type: typing.Optional[str] - self.username = username # type: typing.Optional[str] - self.password_expiration = password_expiration # type: typing.Optional[datetime.datetime] - - def _to_payload(self): - payload = {} - if self.password is not None: - payload['password'] = self.password - if self.username is not None: - payload['username'] = self.username - if self.password_expiration is not None: - payload['passwordExpiration'] = self.password_expiration.timestamp() - return payload - - @classmethod - def _from_payload(cls, payload): - new = cls() - if 'password' in payload: - new.password = payload['password'] - if 'username' in payload: - new.username = payload['username'] - if 'passwordExpiration' in payload: - new.password_expiration = datetime.datetime.fromtimestamp(payload['passwordExpiration'], datetime.timezone.utc) - return new - - @classmethod - def _model_name(cls): - return 'aws.greengrass#CreateDebugPasswordResponse' - - def __repr__(self): - attrs = [] - for attr, val in self.__dict__.items(): - if val is not None: - attrs.append('%s=%r' % (attr, val)) - return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) - - def __eq__(self, other): - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - -class CreateDebugPasswordRequest(rpc.Shape): - """ - CreateDebugPasswordRequest - """ + self.message = message # type: typing.Optional[str] - def __init__(self): - super().__init__() + def _get_error_type_string(self): + return 'client' def _to_payload(self): payload = {} + if self.message is not None: + payload['message'] = self.message return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'message' in payload: + new.message = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#CreateDebugPasswordRequest' + return 'aws.greengrass#InvalidArgumentsError' def __repr__(self): attrs = [] @@ -3097,40 +3500,40 @@ def __eq__(self, other): return False -class ListComponentsResponse(rpc.Shape): +class DeleteThingShadowResponse(rpc.Shape): """ - ListComponentsResponse + DeleteThingShadowResponse All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - components: + payload: Attributes: - components: + payload: """ def __init__(self, *, - components: typing.Optional[typing.List[ComponentDetails]] = None): + payload: typing.Optional[bytes] = None): super().__init__() - self.components = components # type: typing.Optional[typing.List[ComponentDetails]] + self.payload = payload # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.components is not None: - payload['components'] = [i._to_payload() for i in self.components] + if self.payload is not None: + payload['payload'] = base64.b64encode(self.payload).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'components' in payload: - new.components = [ComponentDetails._from_payload(i) for i in payload['components']] + if 'payload' in payload: + new.payload = base64.b64decode(payload['payload']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#ListComponentsResponse' + return 'aws.greengrass#DeleteThingShadowResponse' def __repr__(self): attrs = [] @@ -3145,26 +3548,48 @@ def __eq__(self, other): return False -class ListComponentsRequest(rpc.Shape): +class DeleteThingShadowRequest(rpc.Shape): """ - ListComponentsRequest + DeleteThingShadowRequest + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + thing_name: + shadow_name: + + Attributes: + thing_name: + shadow_name: """ - def __init__(self): + def __init__(self, *, + thing_name: typing.Optional[str] = None, + shadow_name: typing.Optional[str] = None): super().__init__() + self.thing_name = thing_name # type: typing.Optional[str] + self.shadow_name = shadow_name # type: typing.Optional[str] def _to_payload(self): payload = {} + if self.thing_name is not None: + payload['thingName'] = self.thing_name + if self.shadow_name is not None: + payload['shadowName'] = self.shadow_name return payload @classmethod def _from_payload(cls, payload): new = cls() + if 'thingName' in payload: + new.thing_name = payload['thingName'] + if 'shadowName' in payload: + new.shadow_name = payload['shadowName'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ListComponentsRequest' + return 'aws.greengrass#DeleteThingShadowRequest' def __repr__(self): attrs = [] @@ -3391,125 +3816,35 @@ def __init__(self, *, topic_name: typing.Optional[str] = None, qos: typing.Optional[str] = None, payload: typing.Optional[bytes] = None): - super().__init__() - self.topic_name = topic_name # type: typing.Optional[str] - self.qos = qos # type: typing.Optional[str] - self.payload = payload # type: typing.Optional[bytes] - - def _to_payload(self): - payload = {} - if self.topic_name is not None: - payload['topicName'] = self.topic_name - if self.qos is not None: - payload['qos'] = self.qos - if self.payload is not None: - payload['payload'] = base64.b64encode(self.payload).decode() - return payload - - @classmethod - def _from_payload(cls, payload): - new = cls() - if 'topicName' in payload: - new.topic_name = payload['topicName'] - if 'qos' in payload: - new.qos = payload['qos'] - if 'payload' in payload: - new.payload = base64.b64decode(payload['payload']) - return new - - @classmethod - def _model_name(cls): - return 'aws.greengrass#PublishToIoTCoreRequest' - - def __repr__(self): - attrs = [] - for attr, val in self.__dict__.items(): - if val is not None: - attrs.append('%s=%r' % (attr, val)) - return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) - - def __eq__(self, other): - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - -class PublishToTopicResponse(rpc.Shape): - """ - PublishToTopicResponse - """ - - def __init__(self): - super().__init__() - - def _to_payload(self): - payload = {} - return payload - - @classmethod - def _from_payload(cls, payload): - new = cls() - return new - - @classmethod - def _model_name(cls): - return 'aws.greengrass#PublishToTopicResponse' - - def __repr__(self): - attrs = [] - for attr, val in self.__dict__.items(): - if val is not None: - attrs.append('%s=%r' % (attr, val)) - return '%s(%s)' % (self.__class__.__name__, ', '.join(attrs)) - - def __eq__(self, other): - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - -class PublishToTopicRequest(rpc.Shape): - """ - PublishToTopicRequest - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - topic: - publish_message: - - Attributes: - topic: - publish_message: - """ - - def __init__(self, *, - topic: typing.Optional[str] = None, - publish_message: typing.Optional[PublishMessage] = None): - super().__init__() - self.topic = topic # type: typing.Optional[str] - self.publish_message = publish_message # type: typing.Optional[PublishMessage] + super().__init__() + self.topic_name = topic_name # type: typing.Optional[str] + self.qos = qos # type: typing.Optional[str] + self.payload = payload # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.topic is not None: - payload['topic'] = self.topic - if self.publish_message is not None: - payload['publishMessage'] = self.publish_message._to_payload() + if self.topic_name is not None: + payload['topicName'] = self.topic_name + if self.qos is not None: + payload['qos'] = self.qos + if self.payload is not None: + payload['payload'] = base64.b64encode(self.payload).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'topic' in payload: - new.topic = payload['topic'] - if 'publishMessage' in payload: - new.publish_message = PublishMessage._from_payload(payload['publishMessage']) + if 'topicName' in payload: + new.topic_name = payload['topicName'] + if 'qos' in payload: + new.qos = payload['qos'] + if 'payload' in payload: + new.payload = base64.b64decode(payload['payload']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#PublishToTopicRequest' + return 'aws.greengrass#PublishToIoTCoreRequest' def __repr__(self): attrs = [] @@ -3720,14 +4055,14 @@ def __eq__(self, other): RunWithInfo, PostComponentUpdateEvent, PreComponentUpdateEvent, - ValidateConfigurationUpdateEvent, - ConfigurationUpdateEvent, BinaryMessage, JsonMessage, + ValidateConfigurationUpdateEvent, + ConfigurationUpdateEvent, MQTTMessage, - ComponentDetails, LocalDeployment, ConfigurationValidityReport, + ComponentDetails, InvalidArtifactsDirectoryPathError, InvalidRecipeDirectoryPathError, CreateLocalDeploymentResponse, @@ -3738,12 +4073,6 @@ def __eq__(self, other): ListLocalDeploymentsRequest, SubscribeToComponentUpdatesResponse, SubscribeToComponentUpdatesRequest, - GetComponentDetailsResponse, - GetComponentDetailsRequest, - SubscribeToTopicResponse, - SubscribeToTopicRequest, - GetConfigurationResponse, - GetConfigurationRequest, UpdateStateResponse, UpdateStateRequest, GetSecretValueResponse, @@ -3756,28 +4085,40 @@ def __eq__(self, other): InvalidTokenError, ValidateAuthorizationTokenResponse, ValidateAuthorizationTokenRequest, - SubscribeToValidateConfigurationUpdatesResponse, - SubscribeToValidateConfigurationUpdatesRequest, FailedUpdateConditionCheckError, - ConflictError, UpdateConfigurationResponse, UpdateConfigurationRequest, + ConflictError, + UpdateThingShadowResponse, + UpdateThingShadowRequest, SendConfigurationValidityReportResponse, SendConfigurationValidityReportRequest, - InvalidArgumentsError, - DeferComponentUpdateResponse, - DeferComponentUpdateRequest, + GetThingShadowResponse, + GetThingShadowRequest, CreateDebugPasswordResponse, CreateDebugPasswordRequest, ListComponentsResponse, ListComponentsRequest, + PublishToTopicResponse, + PublishToTopicRequest, + GetComponentDetailsResponse, + GetComponentDetailsRequest, + SubscribeToTopicResponse, + SubscribeToTopicRequest, + GetConfigurationResponse, + GetConfigurationRequest, + SubscribeToValidateConfigurationUpdatesResponse, + SubscribeToValidateConfigurationUpdatesRequest, + DeferComponentUpdateResponse, + DeferComponentUpdateRequest, + InvalidArgumentsError, + DeleteThingShadowResponse, + DeleteThingShadowRequest, ResourceNotFoundError, SubscribeToConfigurationUpdateResponse, SubscribeToConfigurationUpdateRequest, PublishToIoTCoreResponse, PublishToIoTCoreRequest, - PublishToTopicResponse, - PublishToTopicRequest, UnauthorizedError, ServiceError, SubscribeToIoTCoreResponse, @@ -3807,14 +4148,14 @@ def _response_stream_type(cls): return IoTCoreMessage -class _PublishToTopicOperation(rpc.ClientOperation): +class _PublishToIoTCoreOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#PublishToTopic' + return 'aws.greengrass#PublishToIoTCore' @classmethod def _request_type(cls): - return PublishToTopicRequest + return PublishToIoTCoreRequest @classmethod def _request_stream_type(cls): @@ -3822,21 +4163,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return PublishToTopicResponse + return PublishToIoTCoreResponse @classmethod def _response_stream_type(cls): return None -class _PublishToIoTCoreOperation(rpc.ClientOperation): +class _SubscribeToConfigurationUpdateOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#PublishToIoTCore' + return 'aws.greengrass#SubscribeToConfigurationUpdate' @classmethod def _request_type(cls): - return PublishToIoTCoreRequest + return SubscribeToConfigurationUpdateRequest @classmethod def _request_stream_type(cls): @@ -3844,21 +4185,43 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return PublishToIoTCoreResponse + return SubscribeToConfigurationUpdateResponse + + @classmethod + def _response_stream_type(cls): + return ConfigurationUpdateEvents + + +class _DeleteThingShadowOperation(rpc.ClientOperation): + @classmethod + def _model_name(cls): + return 'aws.greengrass#DeleteThingShadow' + + @classmethod + def _request_type(cls): + return DeleteThingShadowRequest + + @classmethod + def _request_stream_type(cls): + return None + + @classmethod + def _response_type(cls): + return DeleteThingShadowResponse @classmethod def _response_stream_type(cls): return None -class _SubscribeToConfigurationUpdateOperation(rpc.ClientOperation): +class _DeferComponentUpdateOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToConfigurationUpdate' + return 'aws.greengrass#DeferComponentUpdate' @classmethod def _request_type(cls): - return SubscribeToConfigurationUpdateRequest + return DeferComponentUpdateRequest @classmethod def _request_stream_type(cls): @@ -3866,21 +4229,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToConfigurationUpdateResponse + return DeferComponentUpdateResponse @classmethod def _response_stream_type(cls): - return ConfigurationUpdateEvents + return None -class _ListComponentsOperation(rpc.ClientOperation): +class _SubscribeToValidateConfigurationUpdatesOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#ListComponents' + return 'aws.greengrass#SubscribeToValidateConfigurationUpdates' @classmethod def _request_type(cls): - return ListComponentsRequest + return SubscribeToValidateConfigurationUpdatesRequest @classmethod def _request_stream_type(cls): @@ -3888,21 +4251,43 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return ListComponentsResponse + return SubscribeToValidateConfigurationUpdatesResponse + + @classmethod + def _response_stream_type(cls): + return ValidateConfigurationUpdateEvents + + +class _GetConfigurationOperation(rpc.ClientOperation): + @classmethod + def _model_name(cls): + return 'aws.greengrass#GetConfiguration' + + @classmethod + def _request_type(cls): + return GetConfigurationRequest + + @classmethod + def _request_stream_type(cls): + return None + + @classmethod + def _response_type(cls): + return GetConfigurationResponse @classmethod def _response_stream_type(cls): return None -class _CreateDebugPasswordOperation(rpc.ClientOperation): +class _SubscribeToTopicOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#CreateDebugPassword' + return 'aws.greengrass#SubscribeToTopic' @classmethod def _request_type(cls): - return CreateDebugPasswordRequest + return SubscribeToTopicRequest @classmethod def _request_stream_type(cls): @@ -3910,21 +4295,43 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return CreateDebugPasswordResponse + return SubscribeToTopicResponse @classmethod def _response_stream_type(cls): + return SubscriptionResponseMessage + + +class _GetComponentDetailsOperation(rpc.ClientOperation): + @classmethod + def _model_name(cls): + return 'aws.greengrass#GetComponentDetails' + + @classmethod + def _request_type(cls): + return GetComponentDetailsRequest + + @classmethod + def _request_stream_type(cls): return None + @classmethod + def _response_type(cls): + return GetComponentDetailsResponse -class _DeferComponentUpdateOperation(rpc.ClientOperation): + @classmethod + def _response_stream_type(cls): + return None + + +class _PublishToTopicOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#DeferComponentUpdate' + return 'aws.greengrass#PublishToTopic' @classmethod def _request_type(cls): - return DeferComponentUpdateRequest + return PublishToTopicRequest @classmethod def _request_stream_type(cls): @@ -3932,21 +4339,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return DeferComponentUpdateResponse + return PublishToTopicResponse @classmethod def _response_stream_type(cls): return None -class _SendConfigurationValidityReportOperation(rpc.ClientOperation): +class _ListComponentsOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SendConfigurationValidityReport' + return 'aws.greengrass#ListComponents' @classmethod def _request_type(cls): - return SendConfigurationValidityReportRequest + return ListComponentsRequest @classmethod def _request_stream_type(cls): @@ -3954,21 +4361,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SendConfigurationValidityReportResponse + return ListComponentsResponse @classmethod def _response_stream_type(cls): return None -class _UpdateConfigurationOperation(rpc.ClientOperation): +class _CreateDebugPasswordOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateConfiguration' + return 'aws.greengrass#CreateDebugPassword' @classmethod def _request_type(cls): - return UpdateConfigurationRequest + return CreateDebugPasswordRequest @classmethod def _request_stream_type(cls): @@ -3976,21 +4383,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return UpdateConfigurationResponse + return CreateDebugPasswordResponse @classmethod def _response_stream_type(cls): return None -class _SubscribeToValidateConfigurationUpdatesOperation(rpc.ClientOperation): +class _GetThingShadowOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToValidateConfigurationUpdates' + return 'aws.greengrass#GetThingShadow' @classmethod def _request_type(cls): - return SubscribeToValidateConfigurationUpdatesRequest + return GetThingShadowRequest @classmethod def _request_stream_type(cls): @@ -3998,21 +4405,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToValidateConfigurationUpdatesResponse + return GetThingShadowResponse @classmethod def _response_stream_type(cls): - return ValidateConfigurationUpdateEvents + return None -class _ValidateAuthorizationTokenOperation(rpc.ClientOperation): +class _SendConfigurationValidityReportOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#ValidateAuthorizationToken' + return 'aws.greengrass#SendConfigurationValidityReport' @classmethod def _request_type(cls): - return ValidateAuthorizationTokenRequest + return SendConfigurationValidityReportRequest @classmethod def _request_stream_type(cls): @@ -4020,21 +4427,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return ValidateAuthorizationTokenResponse + return SendConfigurationValidityReportResponse @classmethod def _response_stream_type(cls): return None -class _RestartComponentOperation(rpc.ClientOperation): +class _UpdateThingShadowOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#RestartComponent' + return 'aws.greengrass#UpdateThingShadow' @classmethod def _request_type(cls): - return RestartComponentRequest + return UpdateThingShadowRequest @classmethod def _request_stream_type(cls): @@ -4042,21 +4449,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return RestartComponentResponse + return UpdateThingShadowResponse @classmethod def _response_stream_type(cls): return None -class _GetLocalDeploymentStatusOperation(rpc.ClientOperation): +class _UpdateConfigurationOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetLocalDeploymentStatus' + return 'aws.greengrass#UpdateConfiguration' @classmethod def _request_type(cls): - return GetLocalDeploymentStatusRequest + return UpdateConfigurationRequest @classmethod def _request_stream_type(cls): @@ -4064,21 +4471,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetLocalDeploymentStatusResponse + return UpdateConfigurationResponse @classmethod def _response_stream_type(cls): return None -class _GetSecretValueOperation(rpc.ClientOperation): +class _ValidateAuthorizationTokenOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetSecretValue' + return 'aws.greengrass#ValidateAuthorizationToken' @classmethod def _request_type(cls): - return GetSecretValueRequest + return ValidateAuthorizationTokenRequest @classmethod def _request_stream_type(cls): @@ -4086,21 +4493,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetSecretValueResponse + return ValidateAuthorizationTokenResponse @classmethod def _response_stream_type(cls): return None -class _UpdateStateOperation(rpc.ClientOperation): +class _RestartComponentOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateState' + return 'aws.greengrass#RestartComponent' @classmethod def _request_type(cls): - return UpdateStateRequest + return RestartComponentRequest @classmethod def _request_stream_type(cls): @@ -4108,21 +4515,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return UpdateStateResponse + return RestartComponentResponse @classmethod def _response_stream_type(cls): return None -class _GetConfigurationOperation(rpc.ClientOperation): +class _GetLocalDeploymentStatusOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetConfiguration' + return 'aws.greengrass#GetLocalDeploymentStatus' @classmethod def _request_type(cls): - return GetConfigurationRequest + return GetLocalDeploymentStatusRequest @classmethod def _request_stream_type(cls): @@ -4130,21 +4537,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetConfigurationResponse + return GetLocalDeploymentStatusResponse @classmethod def _response_stream_type(cls): return None -class _SubscribeToTopicOperation(rpc.ClientOperation): +class _GetSecretValueOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToTopic' + return 'aws.greengrass#GetSecretValue' @classmethod def _request_type(cls): - return SubscribeToTopicRequest + return GetSecretValueRequest @classmethod def _request_stream_type(cls): @@ -4152,21 +4559,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToTopicResponse + return GetSecretValueResponse @classmethod def _response_stream_type(cls): - return SubscriptionResponseMessage + return None -class _GetComponentDetailsOperation(rpc.ClientOperation): +class _UpdateStateOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetComponentDetails' + return 'aws.greengrass#UpdateState' @classmethod def _request_type(cls): - return GetComponentDetailsRequest + return UpdateStateRequest @classmethod def _request_stream_type(cls): @@ -4174,7 +4581,7 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetComponentDetailsResponse + return UpdateStateResponse @classmethod def _response_stream_type(cls): diff --git a/test/echotestrpc/model.py b/test/echotestrpc/model.py index 6717e877..8ef940af 100644 --- a/test/echotestrpc/model.py +++ b/test/echotestrpc/model.py @@ -319,6 +319,7 @@ def __eq__(self, other): return False + class EchoStreamingMessage(rpc.Shape): """ MessageData is a "tagged union" class. From 570f9c2c51c255b0ce2ebd0929c8866cae6d0496 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Fri, 5 Mar 2021 11:02:43 -0800 Subject: [PATCH 2/4] undo the change of init --- awsiot/greengrasscoreipc/__init__.py | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/awsiot/greengrasscoreipc/__init__.py b/awsiot/greengrasscoreipc/__init__.py index e69de29b..350270eb 100644 --- a/awsiot/greengrasscoreipc/__init__.py +++ b/awsiot/greengrasscoreipc/__init__.py @@ -0,0 +1,68 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0. + +import os +from typing import Optional + +from awscrt.io import ( + ClientBootstrap, + DefaultHostResolver, + EventLoopGroup, + SocketDomain, + SocketOptions, +) +from awsiot.eventstreamrpc import ( + Connection, + LifecycleHandler, + MessageAmendment, +) +from awsiot.greengrasscoreipc.client import GreengrassCoreIPCClient + + +def connect(*, + ipc_socket: str=None, + authtoken: str=None, + lifecycle_handler: Optional[LifecycleHandler]=None, + timeout: float=10.0) -> GreengrassCoreIPCClient: + """ + Creates an IPC client and connects to the GreengrassCoreIPC service. + + Args: + ipc_socket: Path to the Unix domain socket of Greengrass Nucleus, defaults to + environment variable AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT + authtoken: Authentication token, defaults to environment variable SVCUID + lifecycle_handler: Handler for events over the course of this + network connection. See :class:`LifecycleHandler` for more info. + Handler methods will only be invoked if the connect attempt + succeeds. + timeout: The number of seconds to wait for establishing the connection. + + Returns: + Client for the GreengrassCoreIPC service. + """ + + if not ipc_socket: + ipc_socket = os.environ["AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT"] + if not authtoken: + authtoken = os.environ["SVCUID"] + if not lifecycle_handler: + lifecycle_handler = LifecycleHandler() + + elg = EventLoopGroup(num_threads=1) + resolver = DefaultHostResolver(elg) + bootstrap = ClientBootstrap(elg, resolver) + socket_options = SocketOptions() + socket_options.domain = SocketDomain.Local + amender = MessageAmendment.create_static_authtoken_amender(authtoken) + + connection = Connection( + host_name=ipc_socket, + port=0, # dummy port number, not needed for Unix domain sockets + bootstrap=bootstrap, + socket_options=socket_options, + connect_message_amender=amender, + ) + connect_future = connection.connect(lifecycle_handler) + connect_future.result(timeout) + + return GreengrassCoreIPCClient(connection) From 13fc56ad752f498001f904a8084b0d479b714166 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Fri, 5 Mar 2021 16:57:18 -0800 Subject: [PATCH 3/4] remove those comments --- awsiot/greengrasscoreipc/model.py | 415 +++++++++++++++--------------- test/echotestrpc/model.py | 89 ++++--- 2 files changed, 248 insertions(+), 256 deletions(-) diff --git a/awsiot/greengrasscoreipc/model.py b/awsiot/greengrasscoreipc/model.py index 8c9d61f2..4f52f9af 100644 --- a/awsiot/greengrasscoreipc/model.py +++ b/awsiot/greengrasscoreipc/model.py @@ -35,10 +35,10 @@ class RunWithInfo(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - posix_user: + posix_user: Attributes: - posix_user: + posix_user: """ def __init__(self, *, @@ -83,10 +83,10 @@ class PostComponentUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: Attributes: - deployment_id: + deployment_id: """ def __init__(self, *, @@ -131,12 +131,12 @@ class PreComponentUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: - is_ggc_restarting: + deployment_id: + is_ggc_restarting: Attributes: - deployment_id: - is_ggc_restarting: + deployment_id: + is_ggc_restarting: """ def __init__(self, *, @@ -222,10 +222,10 @@ class BinaryMessage(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -270,10 +270,10 @@ class JsonMessage(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -318,12 +318,12 @@ class ValidateConfigurationUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - configuration: - deployment_id: + configuration: + deployment_id: Attributes: - configuration: - deployment_id: + configuration: + deployment_id: """ def __init__(self, *, @@ -374,12 +374,12 @@ class ConfigurationUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + component_name: + key_path: Attributes: - component_name: - key_path: + component_name: + key_path: """ def __init__(self, *, @@ -430,12 +430,12 @@ class MQTTMessage(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: - payload: + topic_name: + payload: Attributes: - topic_name: - payload: + topic_name: + payload: """ def __init__(self, *, @@ -479,7 +479,6 @@ def __eq__(self, other): return False - class ComponentUpdatePolicyEvents(rpc.Shape): """ MQTTMessage is a "tagged union" class. @@ -489,12 +488,12 @@ class ComponentUpdatePolicyEvents(rpc.Shape): All other attributes will be None. Keyword Args: - pre_update_event: - post_update_event: + pre_update_event: + post_update_event: Attributes: - pre_update_event: - post_update_event: + pre_update_event: + post_update_event: """ def __init__(self, *, @@ -547,7 +546,6 @@ class ReportedLifecycleState: ERRORED = 'ERRORED' - class SecretValue(rpc.Shape): """ MQTTMessage is a "tagged union" class. @@ -557,12 +555,12 @@ class SecretValue(rpc.Shape): All other attributes will be None. Keyword Args: - secret_string: - secret_binary: + secret_string: + secret_binary: Attributes: - secret_string: - secret_binary: + secret_string: + secret_binary: """ def __init__(self, *, @@ -613,11 +611,11 @@ class LocalDeployment(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: status: DeploymentStatus enum value Attributes: - deployment_id: + deployment_id: status: DeploymentStatus enum value """ @@ -679,13 +677,13 @@ class ConfigurationValidityReport(rpc.Shape): Keyword Args: status: ConfigurationValidityStatus enum value - deployment_id: - message: + deployment_id: + message: Attributes: status: ConfigurationValidityStatus enum value - deployment_id: - message: + deployment_id: + message: """ def __init__(self, *, @@ -735,7 +733,6 @@ def __eq__(self, other): return False - class PublishMessage(rpc.Shape): """ ConfigurationValidityReport is a "tagged union" class. @@ -745,12 +742,12 @@ class PublishMessage(rpc.Shape): All other attributes will be None. Keyword Args: - json_message: - binary_message: + json_message: + binary_message: Attributes: - json_message: - binary_message: + json_message: + binary_message: """ def __init__(self, *, @@ -801,16 +798,16 @@ class ComponentDetails(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - version: + component_name: + version: state: LifecycleState enum value - configuration: + configuration: Attributes: - component_name: - version: + component_name: + version: state: LifecycleState enum value - configuration: + configuration: """ def __init__(self, *, @@ -866,7 +863,6 @@ def __eq__(self, other): return False - class SubscriptionResponseMessage(rpc.Shape): """ ComponentDetails is a "tagged union" class. @@ -876,12 +872,12 @@ class SubscriptionResponseMessage(rpc.Shape): All other attributes will be None. Keyword Args: - json_message: - binary_message: + json_message: + binary_message: Attributes: - json_message: - binary_message: + json_message: + binary_message: """ def __init__(self, *, @@ -925,7 +921,6 @@ def __eq__(self, other): return False - class ValidateConfigurationUpdateEvents(rpc.Shape): """ ComponentDetails is a "tagged union" class. @@ -935,10 +930,10 @@ class ValidateConfigurationUpdateEvents(rpc.Shape): All other attributes will be None. Keyword Args: - validate_configuration_update_event: + validate_configuration_update_event: Attributes: - validate_configuration_update_event: + validate_configuration_update_event: """ def __init__(self, *, @@ -976,7 +971,6 @@ def __eq__(self, other): return False - class ConfigurationUpdateEvents(rpc.Shape): """ ComponentDetails is a "tagged union" class. @@ -986,10 +980,10 @@ class ConfigurationUpdateEvents(rpc.Shape): All other attributes will be None. Keyword Args: - configuration_update_event: + configuration_update_event: Attributes: - configuration_update_event: + configuration_update_event: """ def __init__(self, *, @@ -1027,7 +1021,6 @@ def __eq__(self, other): return False - class IoTCoreMessage(rpc.Shape): """ ComponentDetails is a "tagged union" class. @@ -1037,10 +1030,10 @@ class IoTCoreMessage(rpc.Shape): All other attributes will be None. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1094,10 +1087,10 @@ class InvalidArtifactsDirectoryPathError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1145,10 +1138,10 @@ class InvalidRecipeDirectoryPathError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1196,10 +1189,10 @@ class CreateLocalDeploymentResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: Attributes: - deployment_id: + deployment_id: """ def __init__(self, *, @@ -1244,22 +1237,22 @@ class CreateLocalDeploymentRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - group_name: - root_component_versions_to_add: - root_components_to_remove: - component_to_configuration: - component_to_run_with_info: - recipe_directory_path: - artifacts_directory_path: + group_name: + root_component_versions_to_add: + root_components_to_remove: + component_to_configuration: + component_to_run_with_info: + recipe_directory_path: + artifacts_directory_path: Attributes: - group_name: - root_component_versions_to_add: - root_components_to_remove: - component_to_configuration: - component_to_run_with_info: - recipe_directory_path: - artifacts_directory_path: + group_name: + root_component_versions_to_add: + root_components_to_remove: + component_to_configuration: + component_to_run_with_info: + recipe_directory_path: + artifacts_directory_path: """ def __init__(self, *, @@ -1341,11 +1334,11 @@ class StopComponentResponse(rpc.Shape): Keyword Args: stop_status: RequestStatus enum value - message: + message: Attributes: stop_status: RequestStatus enum value - message: + message: """ def __init__(self, *, @@ -1396,10 +1389,10 @@ class StopComponentRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + component_name: Attributes: - component_name: + component_name: """ def __init__(self, *, @@ -1444,10 +1437,10 @@ class ListLocalDeploymentsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - local_deployments: + local_deployments: Attributes: - local_deployments: + local_deployments: """ def __init__(self, *, @@ -1676,16 +1669,16 @@ class GetSecretValueResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - secret_id: - version_id: - version_stage: - secret_value: + secret_id: + version_id: + version_stage: + secret_value: Attributes: - secret_id: - version_id: - version_stage: - secret_value: + secret_id: + version_id: + version_stage: + secret_value: """ def __init__(self, *, @@ -1748,14 +1741,14 @@ class GetSecretValueRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - secret_id: - version_id: - version_stage: + secret_id: + version_id: + version_stage: Attributes: - secret_id: - version_id: - version_stage: + secret_id: + version_id: + version_stage: """ def __init__(self, *, @@ -1812,10 +1805,10 @@ class GetLocalDeploymentStatusResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment: + deployment: Attributes: - deployment: + deployment: """ def __init__(self, *, @@ -1860,10 +1853,10 @@ class GetLocalDeploymentStatusRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: Attributes: - deployment_id: + deployment_id: """ def __init__(self, *, @@ -1908,10 +1901,10 @@ class ComponentNotFoundError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1960,11 +1953,11 @@ class RestartComponentResponse(rpc.Shape): Keyword Args: restart_status: RequestStatus enum value - message: + message: Attributes: restart_status: RequestStatus enum value - message: + message: """ def __init__(self, *, @@ -2015,10 +2008,10 @@ class RestartComponentRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + component_name: Attributes: - component_name: + component_name: """ def __init__(self, *, @@ -2063,10 +2056,10 @@ class InvalidTokenError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -2114,10 +2107,10 @@ class ValidateAuthorizationTokenResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - is_valid: + is_valid: Attributes: - is_valid: + is_valid: """ def __init__(self, *, @@ -2162,10 +2155,10 @@ class ValidateAuthorizationTokenRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - token: + token: Attributes: - token: + token: """ def __init__(self, *, @@ -2210,10 +2203,10 @@ class FailedUpdateConditionCheckError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -2295,14 +2288,14 @@ class UpdateConfigurationRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - key_path: - timestamp: - value_to_merge: + key_path: + timestamp: + value_to_merge: Attributes: - key_path: - timestamp: - value_to_merge: + key_path: + timestamp: + value_to_merge: """ def __init__(self, *, @@ -2359,10 +2352,10 @@ class ConflictError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -2410,10 +2403,10 @@ class UpdateThingShadowResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - payload: + payload: Attributes: - payload: + payload: """ def __init__(self, *, @@ -2458,14 +2451,14 @@ class UpdateThingShadowRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - thing_name: - shadow_name: - payload: + thing_name: + shadow_name: + payload: Attributes: - thing_name: - shadow_name: - payload: + thing_name: + shadow_name: + payload: """ def __init__(self, *, @@ -2556,10 +2549,10 @@ class SendConfigurationValidityReportRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - configuration_validity_report: + configuration_validity_report: Attributes: - configuration_validity_report: + configuration_validity_report: """ def __init__(self, *, @@ -2604,10 +2597,10 @@ class GetThingShadowResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - payload: + payload: Attributes: - payload: + payload: """ def __init__(self, *, @@ -2652,12 +2645,12 @@ class GetThingShadowRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - thing_name: - shadow_name: + thing_name: + shadow_name: Attributes: - thing_name: - shadow_name: + thing_name: + shadow_name: """ def __init__(self, *, @@ -2708,16 +2701,16 @@ class CreateDebugPasswordResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - password: - username: - password_expiration: - certificate_signature: + password: + username: + password_expiration: + certificate_signature: Attributes: - password: - username: - password_expiration: - certificate_signature: + password: + username: + password_expiration: + certificate_signature: """ def __init__(self, *, @@ -2814,10 +2807,10 @@ class ListComponentsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - components: + components: Attributes: - components: + components: """ def __init__(self, *, @@ -2930,12 +2923,12 @@ class PublishToTopicRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic: - publish_message: + topic: + publish_message: Attributes: - topic: - publish_message: + topic: + publish_message: """ def __init__(self, *, @@ -2986,10 +2979,10 @@ class GetComponentDetailsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_details: + component_details: Attributes: - component_details: + component_details: """ def __init__(self, *, @@ -3034,10 +3027,10 @@ class GetComponentDetailsRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + component_name: Attributes: - component_name: + component_name: """ def __init__(self, *, @@ -3082,10 +3075,10 @@ class SubscribeToTopicResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + topic_name: Attributes: - topic_name: + topic_name: """ def __init__(self, *, @@ -3130,10 +3123,10 @@ class SubscribeToTopicRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic: + topic: Attributes: - topic: + topic: """ def __init__(self, *, @@ -3178,12 +3171,12 @@ class GetConfigurationResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - value: + component_name: + value: Attributes: - component_name: - value: + component_name: + value: """ def __init__(self, *, @@ -3234,12 +3227,12 @@ class GetConfigurationRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + component_name: + key_path: Attributes: - component_name: - key_path: + component_name: + key_path: """ def __init__(self, *, @@ -3392,14 +3385,14 @@ class DeferComponentUpdateRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: - message: - recheck_after_ms: + deployment_id: + message: + recheck_after_ms: Attributes: - deployment_id: - message: - recheck_after_ms: + deployment_id: + message: + recheck_after_ms: """ def __init__(self, *, @@ -3456,10 +3449,10 @@ class InvalidArgumentsError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -3507,10 +3500,10 @@ class DeleteThingShadowResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - payload: + payload: Attributes: - payload: + payload: """ def __init__(self, *, @@ -3555,12 +3548,12 @@ class DeleteThingShadowRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - thing_name: - shadow_name: + thing_name: + shadow_name: Attributes: - thing_name: - shadow_name: + thing_name: + shadow_name: """ def __init__(self, *, @@ -3611,14 +3604,14 @@ class ResourceNotFoundError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: - resource_type: - resource_name: + message: + resource_type: + resource_name: Attributes: - message: - resource_type: - resource_name: + message: + resource_type: + resource_name: """ def __init__(self, *, @@ -3712,12 +3705,12 @@ class SubscribeToConfigurationUpdateRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + component_name: + key_path: Attributes: - component_name: - key_path: + component_name: + key_path: """ def __init__(self, *, @@ -3802,14 +3795,14 @@ class PublishToIoTCoreRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + topic_name: qos: QOS enum value - payload: + payload: Attributes: - topic_name: + topic_name: qos: QOS enum value - payload: + payload: """ def __init__(self, *, @@ -3866,10 +3859,10 @@ class UnauthorizedError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -3917,10 +3910,10 @@ class ServiceError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -4002,11 +3995,11 @@ class SubscribeToIoTCoreRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + topic_name: qos: QOS enum value Attributes: - topic_name: + topic_name: qos: QOS enum value """ diff --git a/test/echotestrpc/model.py b/test/echotestrpc/model.py index 8ef940af..143af083 100644 --- a/test/echotestrpc/model.py +++ b/test/echotestrpc/model.py @@ -35,14 +35,14 @@ class Customer(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - id: - first_name: - last_name: + id: + first_name: + last_name: Attributes: - id: - first_name: - last_name: + id: + first_name: + last_name: """ def __init__(self, *, @@ -110,12 +110,12 @@ class Pair(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - key: - value: + key: + value: Attributes: - key: - value: + key: + value: """ def __init__(self, *, @@ -166,12 +166,12 @@ class Product(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - name: - price: + name: + price: Attributes: - name: - price: + name: + price: """ def __init__(self, *, @@ -222,24 +222,24 @@ class MessageData(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - string_message: - boolean_message: - time_message: - document_message: + string_message: + boolean_message: + time_message: + document_message: enum_message: FruitEnum enum value - blob_message: - string_list_message: - key_value_pair_list: + blob_message: + string_list_message: + key_value_pair_list: Attributes: - string_message: - boolean_message: - time_message: - document_message: + string_message: + boolean_message: + time_message: + document_message: enum_message: FruitEnum enum value - blob_message: - string_list_message: - key_value_pair_list: + blob_message: + string_list_message: + key_value_pair_list: """ def __init__(self, *, @@ -319,7 +319,6 @@ def __eq__(self, other): return False - class EchoStreamingMessage(rpc.Shape): """ MessageData is a "tagged union" class. @@ -329,12 +328,12 @@ class EchoStreamingMessage(rpc.Shape): All other attributes will be None. Keyword Args: - stream_message: - key_value_pair: + stream_message: + key_value_pair: Attributes: - stream_message: - key_value_pair: + stream_message: + key_value_pair: """ def __init__(self, *, @@ -385,10 +384,10 @@ class GetAllCustomersResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - customers: + customers: Attributes: - customers: + customers: """ def __init__(self, *, @@ -467,10 +466,10 @@ class EchoMessageResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -515,10 +514,10 @@ class EchoMessageRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -699,12 +698,12 @@ class ServiceError(EchoTestRPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: - value: + message: + value: Attributes: - message: - value: + message: + value: """ def __init__(self, *, @@ -758,10 +757,10 @@ class GetAllProductsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - products: + products: Attributes: - products: + products: """ def __init__(self, *, From ec138504b375f9ab69e88847f5cbca8dec5050a2 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Fri, 5 Mar 2021 16:59:37 -0800 Subject: [PATCH 4/4] use codegen --- awsiot/greengrasscoreipc/model.py | 408 +++++++++++++++--------------- test/echotestrpc/model.py | 88 +++---- 2 files changed, 248 insertions(+), 248 deletions(-) diff --git a/awsiot/greengrasscoreipc/model.py b/awsiot/greengrasscoreipc/model.py index 4f52f9af..d5e90d4d 100644 --- a/awsiot/greengrasscoreipc/model.py +++ b/awsiot/greengrasscoreipc/model.py @@ -35,10 +35,10 @@ class RunWithInfo(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - posix_user: + posix_user: Attributes: - posix_user: + posix_user: """ def __init__(self, *, @@ -83,10 +83,10 @@ class PostComponentUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: Attributes: - deployment_id: + deployment_id: """ def __init__(self, *, @@ -131,12 +131,12 @@ class PreComponentUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: - is_ggc_restarting: + deployment_id: + is_ggc_restarting: Attributes: - deployment_id: - is_ggc_restarting: + deployment_id: + is_ggc_restarting: """ def __init__(self, *, @@ -222,10 +222,10 @@ class BinaryMessage(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -270,10 +270,10 @@ class JsonMessage(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -318,12 +318,12 @@ class ValidateConfigurationUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - configuration: - deployment_id: + configuration: + deployment_id: Attributes: - configuration: - deployment_id: + configuration: + deployment_id: """ def __init__(self, *, @@ -374,12 +374,12 @@ class ConfigurationUpdateEvent(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + component_name: + key_path: Attributes: - component_name: - key_path: + component_name: + key_path: """ def __init__(self, *, @@ -430,12 +430,12 @@ class MQTTMessage(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: - payload: + topic_name: + payload: Attributes: - topic_name: - payload: + topic_name: + payload: """ def __init__(self, *, @@ -488,12 +488,12 @@ class ComponentUpdatePolicyEvents(rpc.Shape): All other attributes will be None. Keyword Args: - pre_update_event: - post_update_event: + pre_update_event: + post_update_event: Attributes: - pre_update_event: - post_update_event: + pre_update_event: + post_update_event: """ def __init__(self, *, @@ -555,12 +555,12 @@ class SecretValue(rpc.Shape): All other attributes will be None. Keyword Args: - secret_string: - secret_binary: + secret_string: + secret_binary: Attributes: - secret_string: - secret_binary: + secret_string: + secret_binary: """ def __init__(self, *, @@ -611,11 +611,11 @@ class LocalDeployment(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: status: DeploymentStatus enum value Attributes: - deployment_id: + deployment_id: status: DeploymentStatus enum value """ @@ -677,13 +677,13 @@ class ConfigurationValidityReport(rpc.Shape): Keyword Args: status: ConfigurationValidityStatus enum value - deployment_id: - message: + deployment_id: + message: Attributes: status: ConfigurationValidityStatus enum value - deployment_id: - message: + deployment_id: + message: """ def __init__(self, *, @@ -742,12 +742,12 @@ class PublishMessage(rpc.Shape): All other attributes will be None. Keyword Args: - json_message: - binary_message: + json_message: + binary_message: Attributes: - json_message: - binary_message: + json_message: + binary_message: """ def __init__(self, *, @@ -798,16 +798,16 @@ class ComponentDetails(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - version: + component_name: + version: state: LifecycleState enum value - configuration: + configuration: Attributes: - component_name: - version: + component_name: + version: state: LifecycleState enum value - configuration: + configuration: """ def __init__(self, *, @@ -872,12 +872,12 @@ class SubscriptionResponseMessage(rpc.Shape): All other attributes will be None. Keyword Args: - json_message: - binary_message: + json_message: + binary_message: Attributes: - json_message: - binary_message: + json_message: + binary_message: """ def __init__(self, *, @@ -930,10 +930,10 @@ class ValidateConfigurationUpdateEvents(rpc.Shape): All other attributes will be None. Keyword Args: - validate_configuration_update_event: + validate_configuration_update_event: Attributes: - validate_configuration_update_event: + validate_configuration_update_event: """ def __init__(self, *, @@ -980,10 +980,10 @@ class ConfigurationUpdateEvents(rpc.Shape): All other attributes will be None. Keyword Args: - configuration_update_event: + configuration_update_event: Attributes: - configuration_update_event: + configuration_update_event: """ def __init__(self, *, @@ -1030,10 +1030,10 @@ class IoTCoreMessage(rpc.Shape): All other attributes will be None. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1087,10 +1087,10 @@ class InvalidArtifactsDirectoryPathError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1138,10 +1138,10 @@ class InvalidRecipeDirectoryPathError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1189,10 +1189,10 @@ class CreateLocalDeploymentResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: Attributes: - deployment_id: + deployment_id: """ def __init__(self, *, @@ -1237,22 +1237,22 @@ class CreateLocalDeploymentRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - group_name: - root_component_versions_to_add: - root_components_to_remove: - component_to_configuration: - component_to_run_with_info: - recipe_directory_path: - artifacts_directory_path: + group_name: + root_component_versions_to_add: + root_components_to_remove: + component_to_configuration: + component_to_run_with_info: + recipe_directory_path: + artifacts_directory_path: Attributes: - group_name: - root_component_versions_to_add: - root_components_to_remove: - component_to_configuration: - component_to_run_with_info: - recipe_directory_path: - artifacts_directory_path: + group_name: + root_component_versions_to_add: + root_components_to_remove: + component_to_configuration: + component_to_run_with_info: + recipe_directory_path: + artifacts_directory_path: """ def __init__(self, *, @@ -1334,11 +1334,11 @@ class StopComponentResponse(rpc.Shape): Keyword Args: stop_status: RequestStatus enum value - message: + message: Attributes: stop_status: RequestStatus enum value - message: + message: """ def __init__(self, *, @@ -1389,10 +1389,10 @@ class StopComponentRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + component_name: Attributes: - component_name: + component_name: """ def __init__(self, *, @@ -1437,10 +1437,10 @@ class ListLocalDeploymentsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - local_deployments: + local_deployments: Attributes: - local_deployments: + local_deployments: """ def __init__(self, *, @@ -1669,16 +1669,16 @@ class GetSecretValueResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - secret_id: - version_id: - version_stage: - secret_value: + secret_id: + version_id: + version_stage: + secret_value: Attributes: - secret_id: - version_id: - version_stage: - secret_value: + secret_id: + version_id: + version_stage: + secret_value: """ def __init__(self, *, @@ -1741,14 +1741,14 @@ class GetSecretValueRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - secret_id: - version_id: - version_stage: + secret_id: + version_id: + version_stage: Attributes: - secret_id: - version_id: - version_stage: + secret_id: + version_id: + version_stage: """ def __init__(self, *, @@ -1805,10 +1805,10 @@ class GetLocalDeploymentStatusResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment: + deployment: Attributes: - deployment: + deployment: """ def __init__(self, *, @@ -1853,10 +1853,10 @@ class GetLocalDeploymentStatusRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + deployment_id: Attributes: - deployment_id: + deployment_id: """ def __init__(self, *, @@ -1901,10 +1901,10 @@ class ComponentNotFoundError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -1953,11 +1953,11 @@ class RestartComponentResponse(rpc.Shape): Keyword Args: restart_status: RequestStatus enum value - message: + message: Attributes: restart_status: RequestStatus enum value - message: + message: """ def __init__(self, *, @@ -2008,10 +2008,10 @@ class RestartComponentRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + component_name: Attributes: - component_name: + component_name: """ def __init__(self, *, @@ -2056,10 +2056,10 @@ class InvalidTokenError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -2107,10 +2107,10 @@ class ValidateAuthorizationTokenResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - is_valid: + is_valid: Attributes: - is_valid: + is_valid: """ def __init__(self, *, @@ -2155,10 +2155,10 @@ class ValidateAuthorizationTokenRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - token: + token: Attributes: - token: + token: """ def __init__(self, *, @@ -2203,10 +2203,10 @@ class FailedUpdateConditionCheckError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -2288,14 +2288,14 @@ class UpdateConfigurationRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - key_path: - timestamp: - value_to_merge: + key_path: + timestamp: + value_to_merge: Attributes: - key_path: - timestamp: - value_to_merge: + key_path: + timestamp: + value_to_merge: """ def __init__(self, *, @@ -2352,10 +2352,10 @@ class ConflictError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -2403,10 +2403,10 @@ class UpdateThingShadowResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - payload: + payload: Attributes: - payload: + payload: """ def __init__(self, *, @@ -2451,14 +2451,14 @@ class UpdateThingShadowRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - thing_name: - shadow_name: - payload: + thing_name: + shadow_name: + payload: Attributes: - thing_name: - shadow_name: - payload: + thing_name: + shadow_name: + payload: """ def __init__(self, *, @@ -2549,10 +2549,10 @@ class SendConfigurationValidityReportRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - configuration_validity_report: + configuration_validity_report: Attributes: - configuration_validity_report: + configuration_validity_report: """ def __init__(self, *, @@ -2597,10 +2597,10 @@ class GetThingShadowResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - payload: + payload: Attributes: - payload: + payload: """ def __init__(self, *, @@ -2645,12 +2645,12 @@ class GetThingShadowRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - thing_name: - shadow_name: + thing_name: + shadow_name: Attributes: - thing_name: - shadow_name: + thing_name: + shadow_name: """ def __init__(self, *, @@ -2701,16 +2701,16 @@ class CreateDebugPasswordResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - password: - username: - password_expiration: - certificate_signature: + password: + username: + password_expiration: + certificate_signature: Attributes: - password: - username: - password_expiration: - certificate_signature: + password: + username: + password_expiration: + certificate_signature: """ def __init__(self, *, @@ -2807,10 +2807,10 @@ class ListComponentsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - components: + components: Attributes: - components: + components: """ def __init__(self, *, @@ -2923,12 +2923,12 @@ class PublishToTopicRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic: - publish_message: + topic: + publish_message: Attributes: - topic: - publish_message: + topic: + publish_message: """ def __init__(self, *, @@ -2979,10 +2979,10 @@ class GetComponentDetailsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_details: + component_details: Attributes: - component_details: + component_details: """ def __init__(self, *, @@ -3027,10 +3027,10 @@ class GetComponentDetailsRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: + component_name: Attributes: - component_name: + component_name: """ def __init__(self, *, @@ -3075,10 +3075,10 @@ class SubscribeToTopicResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + topic_name: Attributes: - topic_name: + topic_name: """ def __init__(self, *, @@ -3123,10 +3123,10 @@ class SubscribeToTopicRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic: + topic: Attributes: - topic: + topic: """ def __init__(self, *, @@ -3171,12 +3171,12 @@ class GetConfigurationResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - value: + component_name: + value: Attributes: - component_name: - value: + component_name: + value: """ def __init__(self, *, @@ -3227,12 +3227,12 @@ class GetConfigurationRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + component_name: + key_path: Attributes: - component_name: - key_path: + component_name: + key_path: """ def __init__(self, *, @@ -3385,14 +3385,14 @@ class DeferComponentUpdateRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: - message: - recheck_after_ms: + deployment_id: + message: + recheck_after_ms: Attributes: - deployment_id: - message: - recheck_after_ms: + deployment_id: + message: + recheck_after_ms: """ def __init__(self, *, @@ -3449,10 +3449,10 @@ class InvalidArgumentsError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -3500,10 +3500,10 @@ class DeleteThingShadowResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - payload: + payload: Attributes: - payload: + payload: """ def __init__(self, *, @@ -3548,12 +3548,12 @@ class DeleteThingShadowRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - thing_name: - shadow_name: + thing_name: + shadow_name: Attributes: - thing_name: - shadow_name: + thing_name: + shadow_name: """ def __init__(self, *, @@ -3604,14 +3604,14 @@ class ResourceNotFoundError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: - resource_type: - resource_name: + message: + resource_type: + resource_name: Attributes: - message: - resource_type: - resource_name: + message: + resource_type: + resource_name: """ def __init__(self, *, @@ -3705,12 +3705,12 @@ class SubscribeToConfigurationUpdateRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - key_path: + component_name: + key_path: Attributes: - component_name: - key_path: + component_name: + key_path: """ def __init__(self, *, @@ -3795,14 +3795,14 @@ class PublishToIoTCoreRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + topic_name: qos: QOS enum value - payload: + payload: Attributes: - topic_name: + topic_name: qos: QOS enum value - payload: + payload: """ def __init__(self, *, @@ -3859,10 +3859,10 @@ class UnauthorizedError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -3910,10 +3910,10 @@ class ServiceError(GreengrassCoreIPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -3995,11 +3995,11 @@ class SubscribeToIoTCoreRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: + topic_name: qos: QOS enum value Attributes: - topic_name: + topic_name: qos: QOS enum value """ diff --git a/test/echotestrpc/model.py b/test/echotestrpc/model.py index 143af083..6717e877 100644 --- a/test/echotestrpc/model.py +++ b/test/echotestrpc/model.py @@ -35,14 +35,14 @@ class Customer(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - id: - first_name: - last_name: + id: + first_name: + last_name: Attributes: - id: - first_name: - last_name: + id: + first_name: + last_name: """ def __init__(self, *, @@ -110,12 +110,12 @@ class Pair(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - key: - value: + key: + value: Attributes: - key: - value: + key: + value: """ def __init__(self, *, @@ -166,12 +166,12 @@ class Product(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - name: - price: + name: + price: Attributes: - name: - price: + name: + price: """ def __init__(self, *, @@ -222,24 +222,24 @@ class MessageData(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - string_message: - boolean_message: - time_message: - document_message: + string_message: + boolean_message: + time_message: + document_message: enum_message: FruitEnum enum value - blob_message: - string_list_message: - key_value_pair_list: + blob_message: + string_list_message: + key_value_pair_list: Attributes: - string_message: - boolean_message: - time_message: - document_message: + string_message: + boolean_message: + time_message: + document_message: enum_message: FruitEnum enum value - blob_message: - string_list_message: - key_value_pair_list: + blob_message: + string_list_message: + key_value_pair_list: """ def __init__(self, *, @@ -328,12 +328,12 @@ class EchoStreamingMessage(rpc.Shape): All other attributes will be None. Keyword Args: - stream_message: - key_value_pair: + stream_message: + key_value_pair: Attributes: - stream_message: - key_value_pair: + stream_message: + key_value_pair: """ def __init__(self, *, @@ -384,10 +384,10 @@ class GetAllCustomersResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - customers: + customers: Attributes: - customers: + customers: """ def __init__(self, *, @@ -466,10 +466,10 @@ class EchoMessageResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -514,10 +514,10 @@ class EchoMessageRequest(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + message: Attributes: - message: + message: """ def __init__(self, *, @@ -698,12 +698,12 @@ class ServiceError(EchoTestRPCError): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: - value: + message: + value: Attributes: - message: - value: + message: + value: """ def __init__(self, *, @@ -757,10 +757,10 @@ class GetAllProductsResponse(rpc.Shape): All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - products: + products: Attributes: - products: + products: """ def __init__(self, *,