diff --git a/awsiot/greengrasscoreipc/client.py b/awsiot/greengrasscoreipc/client.py index 57f936f4..fe5c16c9 100644 --- a/awsiot/greengrasscoreipc/client.py +++ b/awsiot/greengrasscoreipc/client.py @@ -8,45 +8,16 @@ import concurrent.futures -class SubscribeToIoTCoreStreamHandler(rpc.StreamResponseHandler): - """ - Event handler for SubscribeToIoTCoreOperation - - Inherit from this class and override methods to handle - stream events during a SubscribeToIoTCoreOperation. - """ - - def on_stream_event(self, event: model.IoTCoreMessage) -> None: - """ - Invoked when a IoTCoreMessage 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 SubscribeToIoTCoreOperation(model._SubscribeToIoTCoreOperation): +class CreateDebugPasswordOperation(model._CreateDebugPasswordOperation): """ - SubscribeToIoTCoreOperation + CreateDebugPasswordOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_iot_core() + Create with GreengrassCoreIPCClient.new_create_debug_password() """ - def activate(self, request: model.SubscribeToIoTCoreRequest) -> concurrent.futures.Future: + def activate(self, request: model.CreateDebugPasswordRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToIoTCoreRequest 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 @@ -56,7 +27,7 @@ def activate(self, request: model.SubscribeToIoTCoreRequest) -> concurrent.futur def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of SubscribeToIoTCoreResponse, + Returns a Future which completes with a result of CreateDebugPasswordResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -71,16 +42,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class ResumeComponentOperation(model._ResumeComponentOperation): +class CreateLocalDeploymentOperation(model._CreateLocalDeploymentOperation): """ - ResumeComponentOperation + CreateLocalDeploymentOperation - Create with GreengrassCoreIPCClient.new_resume_component() + Create with GreengrassCoreIPCClient.new_create_local_deployment() """ - def activate(self, request: model.ResumeComponentRequest) -> concurrent.futures.Future: + def activate(self, request: model.CreateLocalDeploymentRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial ResumeComponentRequest message. + Activate this operation by sending the initial CreateLocalDeploymentRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -90,7 +61,7 @@ def activate(self, request: model.ResumeComponentRequest) -> concurrent.futures. def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of ResumeComponentResponse, + Returns a Future which completes with a result of CreateLocalDeploymentResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -105,16 +76,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class PublishToIoTCoreOperation(model._PublishToIoTCoreOperation): +class DeferComponentUpdateOperation(model._DeferComponentUpdateOperation): """ - PublishToIoTCoreOperation + DeferComponentUpdateOperation - Create with GreengrassCoreIPCClient.new_publish_to_iot_core() + Create with GreengrassCoreIPCClient.new_defer_component_update() """ - def activate(self, request: model.PublishToIoTCoreRequest) -> concurrent.futures.Future: + def activate(self, request: model.DeferComponentUpdateRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial PublishToIoTCoreRequest 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 @@ -124,7 +95,7 @@ def activate(self, request: model.PublishToIoTCoreRequest) -> concurrent.futures def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of PublishToIoTCoreResponse, + Returns a Future which completes with a result of DeferComponentUpdateResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -139,45 +110,50 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SubscribeToConfigurationUpdateStreamHandler(rpc.StreamResponseHandler): +class DeleteThingShadowOperation(model._DeleteThingShadowOperation): """ - Event handler for SubscribeToConfigurationUpdateOperation + DeleteThingShadowOperation - Inherit from this class and override methods to handle - stream events during a SubscribeToConfigurationUpdateOperation. + Create with GreengrassCoreIPCClient.new_delete_thing_shadow() """ - def on_stream_event(self, event: model.ConfigurationUpdateEvents) -> None: - """ - Invoked when a ConfigurationUpdateEvents is received. + def activate(self, request: model.DeleteThingShadowRequest) -> concurrent.futures.Future: """ - pass + Activate this operation by sending the initial DeleteThingShadowRequest message. - def on_stream_error(self, error: Exception) -> bool: + 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. """ - Invoked when an error occurs on the operation stream. + return self._activate(request) - Return True if operation should close as a result of this error, + def get_response(self) -> concurrent.futures.Future: """ - return True + Returns a Future which completes with a result of DeleteThingShadowResponse, + when the initial response is received, or an exception. + """ + return self._get_response() - def on_stream_closed(self) -> None: + def close(self) -> concurrent.futures.Future: """ - Invoked when the stream for this operation is closed. + Close the operation, whether or not it has completed. + + Returns a Future which completes with a result of None + when the operation has closed. """ - pass + return super().close() -class SubscribeToConfigurationUpdateOperation(model._SubscribeToConfigurationUpdateOperation): +class GetComponentDetailsOperation(model._GetComponentDetailsOperation): """ - SubscribeToConfigurationUpdateOperation + GetComponentDetailsOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_configuration_update() + Create with GreengrassCoreIPCClient.new_get_component_details() """ - def activate(self, request: model.SubscribeToConfigurationUpdateRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetComponentDetailsRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToConfigurationUpdateRequest message. + 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 @@ -187,7 +163,7 @@ def activate(self, request: model.SubscribeToConfigurationUpdateRequest) -> conc def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of SubscribeToConfigurationUpdateResponse, + Returns a Future which completes with a result of GetComponentDetailsResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -202,16 +178,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class DeleteThingShadowOperation(model._DeleteThingShadowOperation): +class GetConfigurationOperation(model._GetConfigurationOperation): """ - DeleteThingShadowOperation + GetConfigurationOperation - Create with GreengrassCoreIPCClient.new_delete_thing_shadow() + Create with GreengrassCoreIPCClient.new_get_configuration() """ - def activate(self, request: model.DeleteThingShadowRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetConfigurationRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial DeleteThingShadowRequest 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 @@ -221,7 +197,7 @@ def activate(self, request: model.DeleteThingShadowRequest) -> concurrent.future def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of DeleteThingShadowResponse, + Returns a Future which completes with a result of GetConfigurationResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -236,16 +212,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class DeferComponentUpdateOperation(model._DeferComponentUpdateOperation): +class GetLocalDeploymentStatusOperation(model._GetLocalDeploymentStatusOperation): """ - DeferComponentUpdateOperation + GetLocalDeploymentStatusOperation - Create with GreengrassCoreIPCClient.new_defer_component_update() + Create with GreengrassCoreIPCClient.new_get_local_deployment_status() """ - def activate(self, request: model.DeferComponentUpdateRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetLocalDeploymentStatusRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial DeferComponentUpdateRequest message. + 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 @@ -255,7 +231,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 GetLocalDeploymentStatusResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -270,45 +246,50 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SubscribeToValidateConfigurationUpdatesStreamHandler(rpc.StreamResponseHandler): +class GetSecretValueOperation(model._GetSecretValueOperation): """ - Event handler for SubscribeToValidateConfigurationUpdatesOperation + GetSecretValueOperation - Inherit from this class and override methods to handle - stream events during a SubscribeToValidateConfigurationUpdatesOperation. + Create with GreengrassCoreIPCClient.new_get_secret_value() """ - def on_stream_event(self, event: model.ValidateConfigurationUpdateEvents) -> None: - """ - Invoked when a ValidateConfigurationUpdateEvents is received. + def activate(self, request: model.GetSecretValueRequest) -> concurrent.futures.Future: """ - pass + Activate this operation by sending the initial GetSecretValueRequest message. - def on_stream_error(self, error: Exception) -> bool: + 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. """ - Invoked when an error occurs on the operation stream. + return self._activate(request) - Return True if operation should close as a result of this error, + def get_response(self) -> concurrent.futures.Future: """ - return True + Returns a Future which completes with a result of GetSecretValueResponse, + when the initial response is received, or an exception. + """ + return self._get_response() - def on_stream_closed(self) -> None: + def close(self) -> concurrent.futures.Future: """ - Invoked when the stream for this operation is closed. + Close the operation, whether or not it has completed. + + Returns a Future which completes with a result of None + when the operation has closed. """ - pass + return super().close() -class SubscribeToValidateConfigurationUpdatesOperation(model._SubscribeToValidateConfigurationUpdatesOperation): +class GetThingShadowOperation(model._GetThingShadowOperation): """ - SubscribeToValidateConfigurationUpdatesOperation + GetThingShadowOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_validate_configuration_updates() + Create with GreengrassCoreIPCClient.new_get_thing_shadow() """ - def activate(self, request: model.SubscribeToValidateConfigurationUpdatesRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetThingShadowRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToValidateConfigurationUpdatesRequest 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 @@ -318,7 +299,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 GetThingShadowResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -333,16 +314,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetConfigurationOperation(model._GetConfigurationOperation): +class ListComponentsOperation(model._ListComponentsOperation): """ - GetConfigurationOperation + ListComponentsOperation - Create with GreengrassCoreIPCClient.new_get_configuration() + Create with GreengrassCoreIPCClient.new_list_components() """ - def activate(self, request: model.GetConfigurationRequest) -> concurrent.futures.Future: + def activate(self, request: model.ListComponentsRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetConfigurationRequest 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 @@ -352,7 +333,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 ListComponentsResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -367,45 +348,50 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SubscribeToTopicStreamHandler(rpc.StreamResponseHandler): +class ListLocalDeploymentsOperation(model._ListLocalDeploymentsOperation): """ - Event handler for SubscribeToTopicOperation + ListLocalDeploymentsOperation - Inherit from this class and override methods to handle - stream events during a SubscribeToTopicOperation. + Create with GreengrassCoreIPCClient.new_list_local_deployments() """ - def on_stream_event(self, event: model.SubscriptionResponseMessage) -> None: - """ - Invoked when a SubscriptionResponseMessage is received. + def activate(self, request: model.ListLocalDeploymentsRequest) -> concurrent.futures.Future: """ - pass + Activate this operation by sending the initial ListLocalDeploymentsRequest message. - def on_stream_error(self, error: Exception) -> bool: + 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. """ - Invoked when an error occurs on the operation stream. + return self._activate(request) - Return True if operation should close as a result of this error, + def get_response(self) -> concurrent.futures.Future: """ - return True + Returns a Future which completes with a result of ListLocalDeploymentsResponse, + when the initial response is received, or an exception. + """ + return self._get_response() - def on_stream_closed(self) -> None: + def close(self) -> concurrent.futures.Future: """ - Invoked when the stream for this operation is closed. + Close the operation, whether or not it has completed. + + Returns a Future which completes with a result of None + when the operation has closed. """ - pass + return super().close() -class SubscribeToTopicOperation(model._SubscribeToTopicOperation): +class ListNamedShadowsForThingOperation(model._ListNamedShadowsForThingOperation): """ - SubscribeToTopicOperation + ListNamedShadowsForThingOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_topic() + Create with GreengrassCoreIPCClient.new_list_named_shadows_for_thing() """ - def activate(self, request: model.SubscribeToTopicRequest) -> concurrent.futures.Future: + def activate(self, request: model.ListNamedShadowsForThingRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToTopicRequest message. + Activate this operation by sending the initial ListNamedShadowsForThingRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -415,7 +401,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 ListNamedShadowsForThingResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -430,16 +416,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetComponentDetailsOperation(model._GetComponentDetailsOperation): +class PauseComponentOperation(model._PauseComponentOperation): """ - GetComponentDetailsOperation + PauseComponentOperation - Create with GreengrassCoreIPCClient.new_get_component_details() + Create with GreengrassCoreIPCClient.new_pause_component() """ - def activate(self, request: model.GetComponentDetailsRequest) -> concurrent.futures.Future: + def activate(self, request: model.PauseComponentRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetComponentDetailsRequest message. + Activate this operation by sending the initial PauseComponentRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -449,7 +435,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 PauseComponentResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -464,16 +450,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class PublishToTopicOperation(model._PublishToTopicOperation): +class PublishToIoTCoreOperation(model._PublishToIoTCoreOperation): """ - PublishToTopicOperation + PublishToIoTCoreOperation - Create with GreengrassCoreIPCClient.new_publish_to_topic() + Create with GreengrassCoreIPCClient.new_publish_to_iot_core() """ - def activate(self, request: model.PublishToTopicRequest) -> concurrent.futures.Future: + def activate(self, request: model.PublishToIoTCoreRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial PublishToTopicRequest message. + Activate this operation by sending the initial PublishToIoTCoreRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -483,7 +469,7 @@ def activate(self, request: model.PublishToTopicRequest) -> concurrent.futures.F def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of PublishToTopicResponse, + Returns a Future which completes with a result of PublishToIoTCoreResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -498,16 +484,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class ListComponentsOperation(model._ListComponentsOperation): +class PublishToTopicOperation(model._PublishToTopicOperation): """ - ListComponentsOperation + PublishToTopicOperation - Create with GreengrassCoreIPCClient.new_list_components() + Create with GreengrassCoreIPCClient.new_publish_to_topic() """ - def activate(self, request: model.ListComponentsRequest) -> concurrent.futures.Future: + def activate(self, request: model.PublishToTopicRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial ListComponentsRequest message. + 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 @@ -517,7 +503,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 PublishToTopicResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -532,16 +518,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class CreateDebugPasswordOperation(model._CreateDebugPasswordOperation): +class RestartComponentOperation(model._RestartComponentOperation): """ - CreateDebugPasswordOperation + RestartComponentOperation - Create with GreengrassCoreIPCClient.new_create_debug_password() + Create with GreengrassCoreIPCClient.new_restart_component() """ - def activate(self, request: model.CreateDebugPasswordRequest) -> concurrent.futures.Future: + def activate(self, request: model.RestartComponentRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial CreateDebugPasswordRequest message. + 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 @@ -551,7 +537,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 RestartComponentResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -566,16 +552,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetThingShadowOperation(model._GetThingShadowOperation): +class ResumeComponentOperation(model._ResumeComponentOperation): """ - GetThingShadowOperation + ResumeComponentOperation - Create with GreengrassCoreIPCClient.new_get_thing_shadow() + Create with GreengrassCoreIPCClient.new_resume_component() """ - def activate(self, request: model.GetThingShadowRequest) -> concurrent.futures.Future: + def activate(self, request: model.ResumeComponentRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetThingShadowRequest message. + Activate this operation by sending the initial ResumeComponentRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -585,7 +571,7 @@ def activate(self, request: model.GetThingShadowRequest) -> concurrent.futures.F def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of GetThingShadowResponse, + Returns a Future which completes with a result of ResumeComponentResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -634,16 +620,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class UpdateThingShadowOperation(model._UpdateThingShadowOperation): +class StopComponentOperation(model._StopComponentOperation): """ - UpdateThingShadowOperation + StopComponentOperation - Create with GreengrassCoreIPCClient.new_update_thing_shadow() + Create with GreengrassCoreIPCClient.new_stop_component() """ - def activate(self, request: model.UpdateThingShadowRequest) -> concurrent.futures.Future: + def activate(self, request: model.StopComponentRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial UpdateThingShadowRequest message. + Activate this operation by sending the initial StopComponentRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -653,7 +639,7 @@ def activate(self, request: model.UpdateThingShadowRequest) -> concurrent.future def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of UpdateThingShadowResponse, + Returns a Future which completes with a result of StopComponentResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -668,50 +654,45 @@ def close(self) -> concurrent.futures.Future: return super().close() -class UpdateConfigurationOperation(model._UpdateConfigurationOperation): +class SubscribeToComponentUpdatesStreamHandler(rpc.StreamResponseHandler): """ - UpdateConfigurationOperation + Event handler for SubscribeToComponentUpdatesOperation - Create with GreengrassCoreIPCClient.new_update_configuration() + Inherit from this class and override methods to handle + stream events during a SubscribeToComponentUpdatesOperation. """ - def activate(self, request: model.UpdateConfigurationRequest) -> concurrent.futures.Future: + def on_stream_event(self, event: model.ComponentUpdatePolicyEvents) -> None: """ - 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 - the request fails to send. + Invoked when a ComponentUpdatePolicyEvents is received. """ - return self._activate(request) + pass - def get_response(self) -> concurrent.futures.Future: - """ - Returns a Future which completes with a result of UpdateConfigurationResponse, - when the initial response is received, or an exception. + def on_stream_error(self, error: Exception) -> bool: """ - return self._get_response() + Invoked when an error occurs on the operation stream. - def close(self) -> concurrent.futures.Future: + Return True if operation should close as a result of this error, """ - Close the operation, whether or not it has completed. + return True - Returns a Future which completes with a result of None - when the operation has closed. + def on_stream_closed(self) -> None: """ - return super().close() + Invoked when the stream for this operation is closed. + """ + pass -class ValidateAuthorizationTokenOperation(model._ValidateAuthorizationTokenOperation): +class SubscribeToComponentUpdatesOperation(model._SubscribeToComponentUpdatesOperation): """ - ValidateAuthorizationTokenOperation + SubscribeToComponentUpdatesOperation - Create with GreengrassCoreIPCClient.new_validate_authorization_token() + Create with GreengrassCoreIPCClient.new_subscribe_to_component_updates() """ - def activate(self, request: model.ValidateAuthorizationTokenRequest) -> concurrent.futures.Future: + def activate(self, request: model.SubscribeToComponentUpdatesRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial ValidateAuthorizationTokenRequest message. + Activate this operation by sending the initial SubscribeToComponentUpdatesRequest 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 +702,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 SubscribeToComponentUpdatesResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -736,50 +717,45 @@ def close(self) -> concurrent.futures.Future: return super().close() -class RestartComponentOperation(model._RestartComponentOperation): +class SubscribeToConfigurationUpdateStreamHandler(rpc.StreamResponseHandler): """ - RestartComponentOperation + Event handler for SubscribeToConfigurationUpdateOperation - Create with GreengrassCoreIPCClient.new_restart_component() + Inherit from this class and override methods to handle + stream events during a SubscribeToConfigurationUpdateOperation. """ - def activate(self, request: model.RestartComponentRequest) -> concurrent.futures.Future: + def on_stream_event(self, event: model.ConfigurationUpdateEvents) -> None: """ - 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. + Invoked when a ConfigurationUpdateEvents is received. """ - return self._activate(request) + pass - def get_response(self) -> concurrent.futures.Future: - """ - Returns a Future which completes with a result of RestartComponentResponse, - when the initial response is received, or an exception. + def on_stream_error(self, error: Exception) -> bool: """ - return self._get_response() + Invoked when an error occurs on the operation stream. - def close(self) -> concurrent.futures.Future: + Return True if operation should close as a result of this error, """ - Close the operation, whether or not it has completed. + return True - Returns a Future which completes with a result of None - when the operation has closed. + def on_stream_closed(self) -> None: """ - return super().close() + Invoked when the stream for this operation is closed. + """ + pass -class GetLocalDeploymentStatusOperation(model._GetLocalDeploymentStatusOperation): +class SubscribeToConfigurationUpdateOperation(model._SubscribeToConfigurationUpdateOperation): """ - GetLocalDeploymentStatusOperation + SubscribeToConfigurationUpdateOperation - Create with GreengrassCoreIPCClient.new_get_local_deployment_status() + Create with GreengrassCoreIPCClient.new_subscribe_to_configuration_update() """ - def activate(self, request: model.GetLocalDeploymentStatusRequest) -> concurrent.futures.Future: + def activate(self, request: model.SubscribeToConfigurationUpdateRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetLocalDeploymentStatusRequest message. + Activate this operation by sending the initial SubscribeToConfigurationUpdateRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -789,7 +765,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 SubscribeToConfigurationUpdateResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -804,50 +780,45 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetSecretValueOperation(model._GetSecretValueOperation): +class SubscribeToIoTCoreStreamHandler(rpc.StreamResponseHandler): """ - GetSecretValueOperation + Event handler for SubscribeToIoTCoreOperation - Create with GreengrassCoreIPCClient.new_get_secret_value() + Inherit from this class and override methods to handle + stream events during a SubscribeToIoTCoreOperation. """ - def activate(self, request: model.GetSecretValueRequest) -> concurrent.futures.Future: + def on_stream_event(self, event: model.IoTCoreMessage) -> None: """ - 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 - the request fails to send. + Invoked when a IoTCoreMessage is received. """ - return self._activate(request) + pass - def get_response(self) -> concurrent.futures.Future: - """ - Returns a Future which completes with a result of GetSecretValueResponse, - when the initial response is received, or an exception. + def on_stream_error(self, error: Exception) -> bool: """ - return self._get_response() + Invoked when an error occurs on the operation stream. - def close(self) -> concurrent.futures.Future: + Return True if operation should close as a result of this error, """ - Close the operation, whether or not it has completed. + return True - Returns a Future which completes with a result of None - when the operation has closed. + def on_stream_closed(self) -> None: """ - return super().close() + Invoked when the stream for this operation is closed. + """ + pass -class UpdateStateOperation(model._UpdateStateOperation): +class SubscribeToIoTCoreOperation(model._SubscribeToIoTCoreOperation): """ - UpdateStateOperation + SubscribeToIoTCoreOperation - Create with GreengrassCoreIPCClient.new_update_state() + Create with GreengrassCoreIPCClient.new_subscribe_to_iot_core() """ - def activate(self, request: model.UpdateStateRequest) -> concurrent.futures.Future: + def activate(self, request: model.SubscribeToIoTCoreRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial UpdateStateRequest message. + Activate this operation by sending the initial SubscribeToIoTCoreRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -857,7 +828,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 SubscribeToIoTCoreResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -872,16 +843,45 @@ def close(self) -> concurrent.futures.Future: return super().close() -class ListNamedShadowsForThingOperation(model._ListNamedShadowsForThingOperation): +class SubscribeToTopicStreamHandler(rpc.StreamResponseHandler): """ - ListNamedShadowsForThingOperation + Event handler for SubscribeToTopicOperation - Create with GreengrassCoreIPCClient.new_list_named_shadows_for_thing() + Inherit from this class and override methods to handle + stream events during a SubscribeToTopicOperation. """ - def activate(self, request: model.ListNamedShadowsForThingRequest) -> concurrent.futures.Future: + def on_stream_event(self, event: model.SubscriptionResponseMessage) -> None: """ - Activate this operation by sending the initial ListNamedShadowsForThingRequest 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 @@ -891,7 +891,7 @@ def activate(self, request: model.ListNamedShadowsForThingRequest) -> concurrent def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of ListNamedShadowsForThingResponse, + Returns a Future which completes with a result of SubscribeToTopicResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -906,17 +906,17 @@ def close(self) -> concurrent.futures.Future: return super().close() -class SubscribeToComponentUpdatesStreamHandler(rpc.StreamResponseHandler): +class SubscribeToValidateConfigurationUpdatesStreamHandler(rpc.StreamResponseHandler): """ - Event handler for SubscribeToComponentUpdatesOperation + Event handler for SubscribeToValidateConfigurationUpdatesOperation Inherit from this class and override methods to handle - stream events during a SubscribeToComponentUpdatesOperation. + stream events during a SubscribeToValidateConfigurationUpdatesOperation. """ - def on_stream_event(self, event: model.ComponentUpdatePolicyEvents) -> None: + def on_stream_event(self, event: model.ValidateConfigurationUpdateEvents) -> None: """ - Invoked when a ComponentUpdatePolicyEvents is received. + Invoked when a ValidateConfigurationUpdateEvents is received. """ pass @@ -935,16 +935,16 @@ def on_stream_closed(self) -> None: pass -class SubscribeToComponentUpdatesOperation(model._SubscribeToComponentUpdatesOperation): +class SubscribeToValidateConfigurationUpdatesOperation(model._SubscribeToValidateConfigurationUpdatesOperation): """ - SubscribeToComponentUpdatesOperation + SubscribeToValidateConfigurationUpdatesOperation - Create with GreengrassCoreIPCClient.new_subscribe_to_component_updates() + Create with GreengrassCoreIPCClient.new_subscribe_to_validate_configuration_updates() """ - def activate(self, request: model.SubscribeToComponentUpdatesRequest) -> concurrent.futures.Future: + def activate(self, request: model.SubscribeToValidateConfigurationUpdatesRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial SubscribeToComponentUpdatesRequest message. + 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 @@ -954,7 +954,7 @@ def activate(self, request: model.SubscribeToComponentUpdatesRequest) -> concurr def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of SubscribeToComponentUpdatesResponse, + Returns a Future which completes with a result of SubscribeToValidateConfigurationUpdatesResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -969,16 +969,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class ListLocalDeploymentsOperation(model._ListLocalDeploymentsOperation): +class UpdateConfigurationOperation(model._UpdateConfigurationOperation): """ - ListLocalDeploymentsOperation + UpdateConfigurationOperation - Create with GreengrassCoreIPCClient.new_list_local_deployments() + Create with GreengrassCoreIPCClient.new_update_configuration() """ - def activate(self, request: model.ListLocalDeploymentsRequest) -> concurrent.futures.Future: + def activate(self, request: model.UpdateConfigurationRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial ListLocalDeploymentsRequest 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 @@ -988,7 +988,7 @@ def activate(self, request: model.ListLocalDeploymentsRequest) -> concurrent.fut def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of ListLocalDeploymentsResponse, + Returns a Future which completes with a result of UpdateConfigurationResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -1003,16 +1003,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class StopComponentOperation(model._StopComponentOperation): +class UpdateStateOperation(model._UpdateStateOperation): """ - StopComponentOperation + UpdateStateOperation - Create with GreengrassCoreIPCClient.new_stop_component() + Create with GreengrassCoreIPCClient.new_update_state() """ - def activate(self, request: model.StopComponentRequest) -> concurrent.futures.Future: + def activate(self, request: model.UpdateStateRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial StopComponentRequest 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 @@ -1022,7 +1022,7 @@ def activate(self, request: model.StopComponentRequest) -> concurrent.futures.Fu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of StopComponentResponse, + Returns a Future which completes with a result of UpdateStateResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -1037,16 +1037,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class PauseComponentOperation(model._PauseComponentOperation): +class UpdateThingShadowOperation(model._UpdateThingShadowOperation): """ - PauseComponentOperation + UpdateThingShadowOperation - Create with GreengrassCoreIPCClient.new_pause_component() + Create with GreengrassCoreIPCClient.new_update_thing_shadow() """ - def activate(self, request: model.PauseComponentRequest) -> concurrent.futures.Future: + def activate(self, request: model.UpdateThingShadowRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial PauseComponentRequest 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 @@ -1056,7 +1056,7 @@ def activate(self, request: model.PauseComponentRequest) -> concurrent.futures.F def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of PauseComponentResponse, + Returns a Future which completes with a result of UpdateThingShadowResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -1071,16 +1071,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class CreateLocalDeploymentOperation(model._CreateLocalDeploymentOperation): +class ValidateAuthorizationTokenOperation(model._ValidateAuthorizationTokenOperation): """ - CreateLocalDeploymentOperation + ValidateAuthorizationTokenOperation - Create with GreengrassCoreIPCClient.new_create_local_deployment() + Create with GreengrassCoreIPCClient.new_validate_authorization_token() """ - def activate(self, request: model.CreateLocalDeploymentRequest) -> concurrent.futures.Future: + def activate(self, request: model.ValidateAuthorizationTokenRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial CreateLocalDeploymentRequest 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 @@ -1090,7 +1090,7 @@ def activate(self, request: model.CreateLocalDeploymentRequest) -> concurrent.fu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of CreateLocalDeploymentResponse, + Returns a Future which completes with a result of ValidateAuthorizationTokenResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -1116,255 +1116,255 @@ class GreengrassCoreIPCClient(rpc.Client): def __init__(self, connection: rpc.Connection): super().__init__(connection, model.SHAPE_INDEX) - def new_subscribe_to_iot_core(self, stream_handler: SubscribeToIoTCoreStreamHandler) -> SubscribeToIoTCoreOperation: + def new_create_debug_password(self) -> CreateDebugPasswordOperation: """ - Create a new SubscribeToIoTCoreOperation. + Create a new CreateDebugPasswordOperation. 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(SubscribeToIoTCoreOperation, stream_handler) + return self._new_operation(CreateDebugPasswordOperation) - def new_resume_component(self) -> ResumeComponentOperation: + def new_create_local_deployment(self) -> CreateLocalDeploymentOperation: """ - Create a new ResumeComponentOperation. + Create a new CreateLocalDeploymentOperation. 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(ResumeComponentOperation) + return self._new_operation(CreateLocalDeploymentOperation) - def new_publish_to_iot_core(self) -> PublishToIoTCoreOperation: + def new_defer_component_update(self) -> DeferComponentUpdateOperation: """ - Create a new PublishToIoTCoreOperation. + 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(PublishToIoTCoreOperation) + return self._new_operation(DeferComponentUpdateOperation) - 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. - - Args: - 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(DeleteThingShadowOperation) - def new_delete_thing_shadow(self) -> DeleteThingShadowOperation: + def new_get_component_details(self) -> GetComponentDetailsOperation: """ - Create a new DeleteThingShadowOperation. + 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(DeleteThingShadowOperation) + return self._new_operation(GetComponentDetailsOperation) - def new_defer_component_update(self) -> DeferComponentUpdateOperation: + def new_get_configuration(self) -> GetConfigurationOperation: """ - Create a new DeferComponentUpdateOperation. + 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(DeferComponentUpdateOperation) + return self._new_operation(GetConfigurationOperation) - def new_subscribe_to_validate_configuration_updates(self, stream_handler: SubscribeToValidateConfigurationUpdatesStreamHandler) -> SubscribeToValidateConfigurationUpdatesOperation: + def new_get_local_deployment_status(self) -> GetLocalDeploymentStatusOperation: """ - Create a new SubscribeToValidateConfigurationUpdatesOperation. + Create a new GetLocalDeploymentStatusOperation. 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(GetLocalDeploymentStatusOperation) - def new_get_configuration(self) -> GetConfigurationOperation: + def new_get_secret_value(self) -> GetSecretValueOperation: """ - Create a new GetConfigurationOperation. + Create a new GetSecretValueOperation. 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) + return self._new_operation(GetSecretValueOperation) - def new_subscribe_to_topic(self, stream_handler: SubscribeToTopicStreamHandler) -> SubscribeToTopicOperation: + def new_get_thing_shadow(self) -> GetThingShadowOperation: """ - Create a new SubscribeToTopicOperation. + 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. - - Args: - stream_handler: Methods on this object will be called as - stream events happen on this operation. """ - return self._new_operation(SubscribeToTopicOperation, stream_handler) + return self._new_operation(GetThingShadowOperation) - def new_get_component_details(self) -> GetComponentDetailsOperation: + def new_list_components(self) -> ListComponentsOperation: """ - Create a new GetComponentDetailsOperation. + Create a new ListComponentsOperation. 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) + return self._new_operation(ListComponentsOperation) - def new_publish_to_topic(self) -> PublishToTopicOperation: + def new_list_local_deployments(self) -> ListLocalDeploymentsOperation: """ - Create a new PublishToTopicOperation. + Create a new ListLocalDeploymentsOperation. 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(ListLocalDeploymentsOperation) - def new_list_components(self) -> ListComponentsOperation: + def new_list_named_shadows_for_thing(self) -> ListNamedShadowsForThingOperation: """ - Create a new ListComponentsOperation. + Create a new ListNamedShadowsForThingOperation. 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(ListComponentsOperation) + return self._new_operation(ListNamedShadowsForThingOperation) - def new_create_debug_password(self) -> CreateDebugPasswordOperation: + def new_pause_component(self) -> PauseComponentOperation: """ - Create a new CreateDebugPasswordOperation. + Create a new PauseComponentOperation. 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(CreateDebugPasswordOperation) + return self._new_operation(PauseComponentOperation) - def new_get_thing_shadow(self) -> GetThingShadowOperation: + def new_publish_to_iot_core(self) -> PublishToIoTCoreOperation: """ - Create a new GetThingShadowOperation. + 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(GetThingShadowOperation) + return self._new_operation(PublishToIoTCoreOperation) - def new_send_configuration_validity_report(self) -> SendConfigurationValidityReportOperation: + def new_publish_to_topic(self) -> PublishToTopicOperation: """ - Create a new SendConfigurationValidityReportOperation. + 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(SendConfigurationValidityReportOperation) + return self._new_operation(PublishToTopicOperation) - def new_update_thing_shadow(self) -> UpdateThingShadowOperation: + def new_restart_component(self) -> RestartComponentOperation: """ - Create a new UpdateThingShadowOperation. + Create a new RestartComponentOperation. 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(UpdateThingShadowOperation) + return self._new_operation(RestartComponentOperation) - def new_update_configuration(self) -> UpdateConfigurationOperation: + def new_resume_component(self) -> ResumeComponentOperation: """ - Create a new UpdateConfigurationOperation. + Create a new ResumeComponentOperation. 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(ResumeComponentOperation) - def new_validate_authorization_token(self) -> ValidateAuthorizationTokenOperation: + def new_send_configuration_validity_report(self) -> SendConfigurationValidityReportOperation: """ - Create a new ValidateAuthorizationTokenOperation. + Create a new SendConfigurationValidityReportOperation. 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(ValidateAuthorizationTokenOperation) + return self._new_operation(SendConfigurationValidityReportOperation) - def new_restart_component(self) -> RestartComponentOperation: + def new_stop_component(self) -> StopComponentOperation: """ - Create a new RestartComponentOperation. + Create a new StopComponentOperation. 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(RestartComponentOperation) + return self._new_operation(StopComponentOperation) - def new_get_local_deployment_status(self) -> GetLocalDeploymentStatusOperation: + def new_subscribe_to_component_updates(self, stream_handler: SubscribeToComponentUpdatesStreamHandler) -> SubscribeToComponentUpdatesOperation: """ - Create a new GetLocalDeploymentStatusOperation. + Create a new SubscribeToComponentUpdatesOperation. 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(GetLocalDeploymentStatusOperation) + return self._new_operation(SubscribeToComponentUpdatesOperation, stream_handler) - def new_get_secret_value(self) -> GetSecretValueOperation: + def new_subscribe_to_configuration_update(self, stream_handler: SubscribeToConfigurationUpdateStreamHandler) -> SubscribeToConfigurationUpdateOperation: """ - Create a new GetSecretValueOperation. + 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(GetSecretValueOperation) + return self._new_operation(SubscribeToConfigurationUpdateOperation, stream_handler) - def new_update_state(self) -> UpdateStateOperation: + def new_subscribe_to_iot_core(self, stream_handler: SubscribeToIoTCoreStreamHandler) -> SubscribeToIoTCoreOperation: """ - Create a new UpdateStateOperation. + Create a new SubscribeToIoTCoreOperation. 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(UpdateStateOperation) + return self._new_operation(SubscribeToIoTCoreOperation, stream_handler) - def new_list_named_shadows_for_thing(self) -> ListNamedShadowsForThingOperation: + def new_subscribe_to_topic(self, stream_handler: SubscribeToTopicStreamHandler) -> SubscribeToTopicOperation: """ - Create a new ListNamedShadowsForThingOperation. + 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(ListNamedShadowsForThingOperation) + return self._new_operation(SubscribeToTopicOperation, stream_handler) - def new_subscribe_to_component_updates(self, stream_handler: SubscribeToComponentUpdatesStreamHandler) -> SubscribeToComponentUpdatesOperation: + def new_subscribe_to_validate_configuration_updates(self, stream_handler: SubscribeToValidateConfigurationUpdatesStreamHandler) -> SubscribeToValidateConfigurationUpdatesOperation: """ - Create a new SubscribeToComponentUpdatesOperation. + 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 @@ -1374,44 +1374,44 @@ def new_subscribe_to_component_updates(self, stream_handler: SubscribeToComponen stream_handler: Methods on this object will be called as stream events happen on this operation. """ - return self._new_operation(SubscribeToComponentUpdatesOperation, stream_handler) + return self._new_operation(SubscribeToValidateConfigurationUpdatesOperation, stream_handler) - def new_list_local_deployments(self) -> ListLocalDeploymentsOperation: + def new_update_configuration(self) -> UpdateConfigurationOperation: """ - Create a new ListLocalDeploymentsOperation. + 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. """ - return self._new_operation(ListLocalDeploymentsOperation) + return self._new_operation(UpdateConfigurationOperation) - def new_stop_component(self) -> StopComponentOperation: + def new_update_state(self) -> UpdateStateOperation: """ - Create a new StopComponentOperation. + Create a new UpdateStateOperation. 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(StopComponentOperation) + return self._new_operation(UpdateStateOperation) - def new_pause_component(self) -> PauseComponentOperation: + def new_update_thing_shadow(self) -> UpdateThingShadowOperation: """ - Create a new PauseComponentOperation. + 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(PauseComponentOperation) + return self._new_operation(UpdateThingShadowOperation) - def new_create_local_deployment(self) -> CreateLocalDeploymentOperation: + def new_validate_authorization_token(self) -> ValidateAuthorizationTokenOperation: """ - Create a new CreateLocalDeploymentOperation. + Create a new ValidateAuthorizationTokenOperation. 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(CreateLocalDeploymentOperation) + return self._new_operation(ValidateAuthorizationTokenOperation) diff --git a/awsiot/greengrasscoreipc/model.py b/awsiot/greengrasscoreipc/model.py index b5f5db65..8efb0252 100644 --- a/awsiot/greengrasscoreipc/model.py +++ b/awsiot/greengrasscoreipc/model.py @@ -84,48 +84,48 @@ def __eq__(self, other): return False -class RunWithInfo(rpc.Shape): +class ValidateConfigurationUpdateEvent(rpc.Shape): """ - RunWithInfo + ValidateConfigurationUpdateEvent All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - posix_user: - system_resource_limits: + configuration: + deployment_id: Attributes: - posix_user: - system_resource_limits: + configuration: + deployment_id: """ def __init__(self, *, - posix_user: typing.Optional[str] = None, - system_resource_limits: typing.Optional[SystemResourceLimits] = None): + configuration: typing.Optional[typing.Dict[str, typing.Any]] = None, + deployment_id: typing.Optional[str] = None): super().__init__() - self.posix_user = posix_user # type: typing.Optional[str] - self.system_resource_limits = system_resource_limits # type: typing.Optional[SystemResourceLimits] + 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.posix_user is not None: - payload['posixUser'] = self.posix_user - if self.system_resource_limits is not None: - payload['systemResourceLimits'] = self.system_resource_limits._to_payload() + 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 'posixUser' in payload: - new.posix_user = payload['posixUser'] - if 'systemResourceLimits' in payload: - new.system_resource_limits = SystemResourceLimits._from_payload(payload['systemResourceLimits']) + 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#RunWithInfo' + return 'aws.greengrass#ValidateConfigurationUpdateEvent' def __repr__(self): attrs = [] @@ -140,40 +140,56 @@ def __eq__(self, other): return False -class PostComponentUpdateEvent(rpc.Shape): +class RunWithInfo(rpc.Shape): """ - PostComponentUpdateEvent + RunWithInfo All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - deployment_id: + posix_user: + windows_user: + system_resource_limits: Attributes: - deployment_id: + posix_user: + windows_user: + system_resource_limits: """ def __init__(self, *, - deployment_id: typing.Optional[str] = None): + posix_user: typing.Optional[str] = None, + windows_user: typing.Optional[str] = None, + system_resource_limits: typing.Optional[SystemResourceLimits] = None): super().__init__() - self.deployment_id = deployment_id # type: typing.Optional[str] + self.posix_user = posix_user # type: typing.Optional[str] + self.windows_user = windows_user # type: typing.Optional[str] + self.system_resource_limits = system_resource_limits # type: typing.Optional[SystemResourceLimits] def _to_payload(self): payload = {} - if self.deployment_id is not None: - payload['deploymentId'] = self.deployment_id + if self.posix_user is not None: + payload['posixUser'] = self.posix_user + if self.windows_user is not None: + payload['windowsUser'] = self.windows_user + if self.system_resource_limits is not None: + payload['systemResourceLimits'] = self.system_resource_limits._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'deploymentId' in payload: - new.deployment_id = payload['deploymentId'] + if 'posixUser' in payload: + new.posix_user = payload['posixUser'] + if 'windowsUser' in payload: + new.windows_user = payload['windowsUser'] + if 'systemResourceLimits' in payload: + new.system_resource_limits = SystemResourceLimits._from_payload(payload['systemResourceLimits']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#PostComponentUpdateEvent' + return 'aws.greengrass#RunWithInfo' def __repr__(self): attrs = [] @@ -244,75 +260,40 @@ 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 - """ - - RUNNING = 'RUNNING' - ERRORED = 'ERRORED' - NEW = 'NEW' - FINISHED = 'FINISHED' - INSTALLED = 'INSTALLED' - BROKEN = 'BROKEN' - STARTING = 'STARTING' - STOPPING = 'STOPPING' - - -class BinaryMessage(rpc.Shape): +class PostComponentUpdateEvent(rpc.Shape): """ - BinaryMessage + PostComponentUpdateEvent All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + deployment_id: Attributes: - message: + deployment_id: """ def __init__(self, *, - message: typing.Optional[bytes] = None): + deployment_id: typing.Optional[str] = None): super().__init__() - self.message = message # type: typing.Optional[bytes] + 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.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 'deploymentId' in payload: + new.deployment_id = payload['deploymentId'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#BinaryMessage' + return 'aws.greengrass#PostComponentUpdateEvent' def __repr__(self): attrs = [] @@ -327,40 +308,48 @@ def __eq__(self, other): return False -class JsonMessage(rpc.Shape): +class MQTTMessage(rpc.Shape): """ - JsonMessage + MQTTMessage All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - message: + topic_name: + payload: Attributes: - message: + topic_name: + payload: """ def __init__(self, *, - message: typing.Optional[typing.Dict[str, typing.Any]] = None): + topic_name: typing.Optional[str] = None, + payload: typing.Optional[bytes] = None): super().__init__() - self.message = message # type: typing.Optional[typing.Dict[str, typing.Any]] + self.topic_name = topic_name # type: typing.Optional[str] + self.payload = payload # type: typing.Optional[bytes] 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 + if self.payload is not None: + payload['payload'] = base64.b64encode(self.payload).decode() 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'] + if 'payload' in payload: + new.payload = base64.b64decode(payload['payload']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#JsonMessage' + return 'aws.greengrass#MQTTMessage' def __repr__(self): attrs = [] @@ -375,48 +364,55 @@ def __eq__(self, other): return False -class ValidateConfigurationUpdateEvent(rpc.Shape): +class LifecycleState: + """ + LifecycleState enum """ - ValidateConfigurationUpdateEvent + + RUNNING = 'RUNNING' + ERRORED = 'ERRORED' + NEW = 'NEW' + FINISHED = 'FINISHED' + INSTALLED = 'INSTALLED' + BROKEN = 'BROKEN' + STARTING = 'STARTING' + STOPPING = 'STOPPING' + + +class JsonMessage(rpc.Shape): + """ + JsonMessage 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[typing.Dict[str, typing.Any]] = 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[typing.Dict[str, typing.Any]] 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'] = self.message 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 = payload['message'] return new @classmethod def _model_name(cls): - return 'aws.greengrass#ValidateConfigurationUpdateEvent' + return 'aws.greengrass#JsonMessage' def __repr__(self): attrs = [] @@ -431,6 +427,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 ConfigurationUpdateEvent(rpc.Shape): """ ConfigurationUpdateEvent @@ -487,48 +503,40 @@ def __eq__(self, other): return False -class MQTTMessage(rpc.Shape): +class BinaryMessage(rpc.Shape): """ - MQTTMessage + BinaryMessage All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - topic_name: - payload: + message: Attributes: - topic_name: - payload: + message: """ def __init__(self, *, - topic_name: typing.Optional[str] = None, - payload: typing.Optional[bytes] = None): + message: typing.Optional[bytes] = None): super().__init__() - self.topic_name = topic_name # type: typing.Optional[str] - self.payload = payload # type: typing.Optional[bytes] + self.message = message # type: typing.Optional[bytes] def _to_payload(self): payload = {} - if self.topic_name is not None: - payload['topicName'] = self.topic_name - if self.payload is not None: - payload['payload'] = base64.b64encode(self.payload).decode() + if self.message is not None: + payload['message'] = base64.b64encode(self.message).decode() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'topicName' in payload: - new.topic_name = payload['topicName'] - if 'payload' in payload: - new.payload = base64.b64decode(payload['payload']) + if 'message' in payload: + new.message = base64.b64decode(payload['message']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#MQTTMessage' + return 'aws.greengrass#BinaryMessage' def __repr__(self): attrs = [] @@ -543,50 +551,42 @@ def __eq__(self, other): return False -class ComponentUpdatePolicyEvents(rpc.Shape): +class ValidateConfigurationUpdateEvents(rpc.Shape): """ - MQTTMessage is a "tagged union" class. + BinaryMessage 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: - pre_update_event: - post_update_event: + validate_configuration_update_event: Attributes: - pre_update_event: - post_update_event: + validate_configuration_update_event: """ def __init__(self, *, - pre_update_event: typing.Optional[PreComponentUpdateEvent] = None, - post_update_event: typing.Optional[PostComponentUpdateEvent] = None): + validate_configuration_update_event: typing.Optional[ValidateConfigurationUpdateEvent] = None): super().__init__() - self.pre_update_event = pre_update_event # type: typing.Optional[PreComponentUpdateEvent] - self.post_update_event = post_update_event # type: typing.Optional[PostComponentUpdateEvent] + self.validate_configuration_update_event = validate_configuration_update_event # type: typing.Optional[ValidateConfigurationUpdateEvent] def _to_payload(self): payload = {} - if self.pre_update_event is not None: - payload['preUpdateEvent'] = self.pre_update_event._to_payload() - if self.post_update_event is not None: - payload['postUpdateEvent'] = self.post_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 'preUpdateEvent' in payload: - new.pre_update_event = PreComponentUpdateEvent._from_payload(payload['preUpdateEvent']) - if 'postUpdateEvent' in payload: - new.post_update_event = PostComponentUpdateEvent._from_payload(payload['postUpdateEvent']) + if 'validateConfigurationUpdateEvent' in payload: + new.validate_configuration_update_event = ValidateConfigurationUpdateEvent._from_payload(payload['validateConfigurationUpdateEvent']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#ComponentUpdatePolicyEvents' + return 'aws.greengrass#ValidateConfigurationUpdateEvents' def __repr__(self): attrs = [] @@ -601,59 +601,50 @@ def __eq__(self, other): return False -class ReportedLifecycleState: - """ - ReportedLifecycleState enum - """ - - RUNNING = 'RUNNING' - ERRORED = 'ERRORED' - - -class SecretValue(rpc.Shape): +class SubscriptionResponseMessage(rpc.Shape): """ - MQTTMessage is a "tagged union" class. + BinaryMessage 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: - secret_string: - secret_binary: + json_message: + binary_message: Attributes: - secret_string: - secret_binary: + json_message: + binary_message: """ def __init__(self, *, - secret_string: typing.Optional[str] = None, - secret_binary: typing.Optional[bytes] = None): + json_message: typing.Optional[JsonMessage] = None, + binary_message: typing.Optional[BinaryMessage] = None): super().__init__() - self.secret_string = secret_string # type: typing.Optional[str] - self.secret_binary = secret_binary # type: typing.Optional[bytes] + 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.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.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 'secretString' in payload: - new.secret_string = payload['secretString'] - if 'secretBinary' in payload: - new.secret_binary = base64.b64decode(payload['secretBinary']) + 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#SecretValue' + return 'aws.greengrass#SubscriptionResponseMessage' def __repr__(self): attrs = [] @@ -668,48 +659,50 @@ def __eq__(self, other): return False -class LocalDeployment(rpc.Shape): +class SecretValue(rpc.Shape): """ - LocalDeployment + BinaryMessage 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 + secret_string: + secret_binary: Attributes: - deployment_id: - status: DeploymentStatus enum value + secret_string: + secret_binary: """ def __init__(self, *, - deployment_id: typing.Optional[str] = None, - status: typing.Optional[str] = None): + secret_string: typing.Optional[str] = None, + secret_binary: typing.Optional[bytes] = None): super().__init__() - self.deployment_id = deployment_id # type: typing.Optional[str] - self.status = status # type: typing.Optional[str] + 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.deployment_id is not None: - payload['deploymentId'] = self.deployment_id - if self.status is not None: - payload['status'] = self.status + 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 'deploymentId' in payload: - new.deployment_id = payload['deploymentId'] - if 'status' in payload: - new.status = payload['status'] + 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#LocalDeployment' + return 'aws.greengrass#SecretValue' def __repr__(self): attrs = [] @@ -733,73 +726,27 @@ class RequestStatus: FAILED = 'FAILED' -class ConfigurationValidityReport(rpc.Shape): +class ReportedLifecycleState: """ - ConfigurationValidityReport - - All attributes are None by default, and may be set by keyword in the constructor. - - Keyword Args: - status: ConfigurationValidityStatus enum value - deployment_id: - message: - - Attributes: - status: ConfigurationValidityStatus enum value - deployment_id: - message: + ReportedLifecycleState enum """ - def __init__(self, *, - status: typing.Optional[str] = None, - deployment_id: typing.Optional[str] = None, - message: typing.Optional[str] = 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] - - 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 - 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'] - return new + RUNNING = 'RUNNING' + ERRORED = 'ERRORED' - @classmethod - def _model_name(cls): - return 'aws.greengrass#ConfigurationValidityReport' - 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)) +class QOS: + """ + QOS enum + """ - def __eq__(self, other): - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False + AT_MOST_ONCE = '0' + AT_LEAST_ONCE = '1' class PublishMessage(rpc.Shape): """ - ConfigurationValidityReport is a "tagged union" class. + BinaryMessage 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. @@ -855,64 +802,48 @@ def __eq__(self, other): return False -class ComponentDetails(rpc.Shape): +class LocalDeployment(rpc.Shape): """ - ComponentDetails + LocalDeployment All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - component_name: - version: - state: LifecycleState enum value - configuration: + deployment_id: + status: DeploymentStatus enum value Attributes: - component_name: - version: - state: LifecycleState enum value - configuration: + deployment_id: + status: DeploymentStatus enum value """ 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): + deployment_id: typing.Optional[str] = None, + status: typing.Optional[str] = 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.deployment_id = deployment_id # type: typing.Optional[str] + self.status = status # type: typing.Optional[str] 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.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 '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 '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#ComponentDetails' + return 'aws.greengrass#LocalDeployment' def __repr__(self): attrs = [] @@ -927,50 +858,42 @@ def __eq__(self, other): return False -class SubscriptionResponseMessage(rpc.Shape): +class IoTCoreMessage(rpc.Shape): """ - ComponentDetails is a "tagged union" class. + LocalDeployment 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: + message: Attributes: - json_message: - binary_message: + message: """ def __init__(self, *, - json_message: typing.Optional[JsonMessage] = None, - binary_message: typing.Optional[BinaryMessage] = None): + message: typing.Optional[MQTTMessage] = None): super().__init__() - self.json_message = json_message # type: typing.Optional[JsonMessage] - self.binary_message = binary_message # type: typing.Optional[BinaryMessage] + self.message = message # type: typing.Optional[MQTTMessage] 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.message is not None: + payload['message'] = self.message._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 'message' in payload: + new.message = MQTTMessage._from_payload(payload['message']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#SubscriptionResponseMessage' + return 'aws.greengrass#IoTCoreMessage' def __repr__(self): attrs = [] @@ -985,42 +908,56 @@ def __eq__(self, other): return False -class ValidateConfigurationUpdateEvents(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: - validate_configuration_update_event: + status: ConfigurationValidityStatus enum value + deployment_id: + message: Attributes: - validate_configuration_update_event: + status: ConfigurationValidityStatus enum value + deployment_id: + message: """ def __init__(self, *, - validate_configuration_update_event: typing.Optional[ValidateConfigurationUpdateEvent] = None): + status: typing.Optional[str] = None, + deployment_id: typing.Optional[str] = None, + message: typing.Optional[str] = None): super().__init__() - self.validate_configuration_update_event = validate_configuration_update_event # type: typing.Optional[ValidateConfigurationUpdateEvent] + 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.validate_configuration_update_event is not None: - payload['validateConfigurationUpdateEvent'] = self.validate_configuration_update_event._to_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 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 '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#ValidateConfigurationUpdateEvents' + return 'aws.greengrass#ConfigurationValidityReport' def __repr__(self): attrs = [] @@ -1037,7 +974,7 @@ def __eq__(self, other): class ConfigurationUpdateEvents(rpc.Shape): """ - ComponentDetails is a "tagged union" class. + ConfigurationValidityReport 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. @@ -1085,42 +1022,50 @@ def __eq__(self, other): return False -class IoTCoreMessage(rpc.Shape): +class ComponentUpdatePolicyEvents(rpc.Shape): """ - ComponentDetails is a "tagged union" class. + ConfigurationValidityReport 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: - message: + pre_update_event: + post_update_event: Attributes: - message: + pre_update_event: + post_update_event: """ def __init__(self, *, - message: typing.Optional[MQTTMessage] = None): + pre_update_event: typing.Optional[PreComponentUpdateEvent] = None, + post_update_event: typing.Optional[PostComponentUpdateEvent] = None): super().__init__() - self.message = message # type: typing.Optional[MQTTMessage] + self.pre_update_event = pre_update_event # type: typing.Optional[PreComponentUpdateEvent] + self.post_update_event = post_update_event # type: typing.Optional[PostComponentUpdateEvent] def _to_payload(self): payload = {} - if self.message is not None: - payload['message'] = self.message._to_payload() + if self.pre_update_event is not None: + payload['preUpdateEvent'] = self.pre_update_event._to_payload() + if self.post_update_event is not None: + payload['postUpdateEvent'] = self.post_update_event._to_payload() return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'message' in payload: - new.message = MQTTMessage._from_payload(payload['message']) + if 'preUpdateEvent' in payload: + new.pre_update_event = PreComponentUpdateEvent._from_payload(payload['preUpdateEvent']) + if 'postUpdateEvent' in payload: + new.post_update_event = PostComponentUpdateEvent._from_payload(payload['postUpdateEvent']) return new @classmethod def _model_name(cls): - return 'aws.greengrass#IoTCoreMessage' + return 'aws.greengrass#ComponentUpdatePolicyEvents' def __repr__(self): attrs = [] @@ -1135,13 +1080,76 @@ def __eq__(self, other): return False -class QOS: +class ComponentDetails(rpc.Shape): """ - QOS enum + ComponentDetails + + All attributes are None by default, and may be set by keyword in the constructor. + + Keyword Args: + component_name: + version: + state: LifecycleState enum value + configuration: + + Attributes: + component_name: + version: + state: LifecycleState enum value + configuration: """ - AT_MOST_ONCE = '0' - AT_LEAST_ONCE = '1' + 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): + 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]] + + 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 + 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'] + return new + + @classmethod + def _model_name(cls): + return 'aws.greengrass#ComponentDetails' + + 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 InvalidArtifactsDirectoryPathError(GreengrassCoreIPCError): @@ -1341,11 +1349,11 @@ def _to_payload(self): if self.group_name is not None: payload['groupName'] = self.group_name if self.root_component_versions_to_add is not None: - payload['rootComponentVersionsToAdd'] = {k: v for k, v in self.root_component_versions_to_add.items()} + payload['rootComponentVersionsToAdd'] = self.root_component_versions_to_add if self.root_components_to_remove is not None: payload['rootComponentsToRemove'] = self.root_components_to_remove if self.component_to_configuration is not None: - payload['componentToConfiguration'] = {k: v for k, v in self.component_to_configuration.items()} + payload['componentToConfiguration'] = self.component_to_configuration if self.component_to_run_with_info is not None: payload['componentToRunWithInfo'] = {k: v._to_payload() for k, v in self.component_to_run_with_info.items()} if self.recipe_directory_path is not None: @@ -4410,14 +4418,14 @@ def __eq__(self, other): SHAPE_INDEX = rpc.ShapeIndex([ SystemResourceLimits, + ValidateConfigurationUpdateEvent, RunWithInfo, - PostComponentUpdateEvent, PreComponentUpdateEvent, - BinaryMessage, + PostComponentUpdateEvent, + MQTTMessage, JsonMessage, - ValidateConfigurationUpdateEvent, ConfigurationUpdateEvent, - MQTTMessage, + BinaryMessage, LocalDeployment, ConfigurationValidityReport, ComponentDetails, @@ -4490,14 +4498,14 @@ def __eq__(self, other): ]) -class _SubscribeToIoTCoreOperation(rpc.ClientOperation): +class _CreateDebugPasswordOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToIoTCore' + return 'aws.greengrass#CreateDebugPassword' @classmethod def _request_type(cls): - return SubscribeToIoTCoreRequest + return CreateDebugPasswordRequest @classmethod def _request_stream_type(cls): @@ -4505,21 +4513,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToIoTCoreResponse + return CreateDebugPasswordResponse @classmethod def _response_stream_type(cls): - return IoTCoreMessage + return None -class _ResumeComponentOperation(rpc.ClientOperation): +class _CreateLocalDeploymentOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#ResumeComponent' + return 'aws.greengrass#CreateLocalDeployment' @classmethod def _request_type(cls): - return ResumeComponentRequest + return CreateLocalDeploymentRequest @classmethod def _request_stream_type(cls): @@ -4527,21 +4535,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return ResumeComponentResponse + return CreateLocalDeploymentResponse @classmethod def _response_stream_type(cls): return None -class _PublishToIoTCoreOperation(rpc.ClientOperation): +class _DeferComponentUpdateOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#PublishToIoTCore' + return 'aws.greengrass#DeferComponentUpdate' @classmethod def _request_type(cls): - return PublishToIoTCoreRequest + return DeferComponentUpdateRequest @classmethod def _request_stream_type(cls): @@ -4549,21 +4557,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return PublishToIoTCoreResponse + return DeferComponentUpdateResponse @classmethod def _response_stream_type(cls): return None -class _SubscribeToConfigurationUpdateOperation(rpc.ClientOperation): +class _DeleteThingShadowOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToConfigurationUpdate' + return 'aws.greengrass#DeleteThingShadow' @classmethod def _request_type(cls): - return SubscribeToConfigurationUpdateRequest + return DeleteThingShadowRequest @classmethod def _request_stream_type(cls): @@ -4571,21 +4579,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToConfigurationUpdateResponse + return DeleteThingShadowResponse @classmethod def _response_stream_type(cls): - return ConfigurationUpdateEvents + return None -class _DeleteThingShadowOperation(rpc.ClientOperation): +class _GetComponentDetailsOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#DeleteThingShadow' + return 'aws.greengrass#GetComponentDetails' @classmethod def _request_type(cls): - return DeleteThingShadowRequest + return GetComponentDetailsRequest @classmethod def _request_stream_type(cls): @@ -4593,21 +4601,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return DeleteThingShadowResponse + return GetComponentDetailsResponse @classmethod def _response_stream_type(cls): return None -class _DeferComponentUpdateOperation(rpc.ClientOperation): +class _GetConfigurationOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#DeferComponentUpdate' + return 'aws.greengrass#GetConfiguration' @classmethod def _request_type(cls): - return DeferComponentUpdateRequest + return GetConfigurationRequest @classmethod def _request_stream_type(cls): @@ -4615,21 +4623,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return DeferComponentUpdateResponse + return GetConfigurationResponse @classmethod def _response_stream_type(cls): return None -class _SubscribeToValidateConfigurationUpdatesOperation(rpc.ClientOperation): +class _GetLocalDeploymentStatusOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToValidateConfigurationUpdates' + return 'aws.greengrass#GetLocalDeploymentStatus' @classmethod def _request_type(cls): - return SubscribeToValidateConfigurationUpdatesRequest + return GetLocalDeploymentStatusRequest @classmethod def _request_stream_type(cls): @@ -4637,21 +4645,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToValidateConfigurationUpdatesResponse + return GetLocalDeploymentStatusResponse @classmethod def _response_stream_type(cls): - return ValidateConfigurationUpdateEvents + return None -class _GetConfigurationOperation(rpc.ClientOperation): +class _GetSecretValueOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetConfiguration' + return 'aws.greengrass#GetSecretValue' @classmethod def _request_type(cls): - return GetConfigurationRequest + return GetSecretValueRequest @classmethod def _request_stream_type(cls): @@ -4659,21 +4667,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetConfigurationResponse + return GetSecretValueResponse @classmethod def _response_stream_type(cls): return None -class _SubscribeToTopicOperation(rpc.ClientOperation): +class _GetThingShadowOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToTopic' + return 'aws.greengrass#GetThingShadow' @classmethod def _request_type(cls): - return SubscribeToTopicRequest + return GetThingShadowRequest @classmethod def _request_stream_type(cls): @@ -4681,21 +4689,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToTopicResponse + return GetThingShadowResponse @classmethod def _response_stream_type(cls): - return SubscriptionResponseMessage + return None -class _GetComponentDetailsOperation(rpc.ClientOperation): +class _ListComponentsOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetComponentDetails' + return 'aws.greengrass#ListComponents' @classmethod def _request_type(cls): - return GetComponentDetailsRequest + return ListComponentsRequest @classmethod def _request_stream_type(cls): @@ -4703,21 +4711,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetComponentDetailsResponse + return ListComponentsResponse @classmethod def _response_stream_type(cls): return None -class _PublishToTopicOperation(rpc.ClientOperation): +class _ListLocalDeploymentsOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#PublishToTopic' + return 'aws.greengrass#ListLocalDeployments' @classmethod def _request_type(cls): - return PublishToTopicRequest + return ListLocalDeploymentsRequest @classmethod def _request_stream_type(cls): @@ -4725,21 +4733,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return PublishToTopicResponse + return ListLocalDeploymentsResponse @classmethod def _response_stream_type(cls): return None -class _ListComponentsOperation(rpc.ClientOperation): +class _ListNamedShadowsForThingOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#ListComponents' + return 'aws.greengrass#ListNamedShadowsForThing' @classmethod def _request_type(cls): - return ListComponentsRequest + return ListNamedShadowsForThingRequest @classmethod def _request_stream_type(cls): @@ -4747,21 +4755,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return ListComponentsResponse + return ListNamedShadowsForThingResponse @classmethod def _response_stream_type(cls): return None -class _CreateDebugPasswordOperation(rpc.ClientOperation): +class _PauseComponentOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#CreateDebugPassword' + return 'aws.greengrass#PauseComponent' @classmethod def _request_type(cls): - return CreateDebugPasswordRequest + return PauseComponentRequest @classmethod def _request_stream_type(cls): @@ -4769,21 +4777,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return CreateDebugPasswordResponse + return PauseComponentResponse @classmethod def _response_stream_type(cls): return None -class _GetThingShadowOperation(rpc.ClientOperation): +class _PublishToIoTCoreOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetThingShadow' + return 'aws.greengrass#PublishToIoTCore' @classmethod def _request_type(cls): - return GetThingShadowRequest + return PublishToIoTCoreRequest @classmethod def _request_stream_type(cls): @@ -4791,21 +4799,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetThingShadowResponse + return PublishToIoTCoreResponse @classmethod def _response_stream_type(cls): return None -class _SendConfigurationValidityReportOperation(rpc.ClientOperation): +class _PublishToTopicOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SendConfigurationValidityReport' + return 'aws.greengrass#PublishToTopic' @classmethod def _request_type(cls): - return SendConfigurationValidityReportRequest + return PublishToTopicRequest @classmethod def _request_stream_type(cls): @@ -4813,21 +4821,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SendConfigurationValidityReportResponse + return PublishToTopicResponse @classmethod def _response_stream_type(cls): return None -class _UpdateThingShadowOperation(rpc.ClientOperation): +class _RestartComponentOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateThingShadow' + return 'aws.greengrass#RestartComponent' @classmethod def _request_type(cls): - return UpdateThingShadowRequest + return RestartComponentRequest @classmethod def _request_stream_type(cls): @@ -4835,21 +4843,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return UpdateThingShadowResponse + return RestartComponentResponse @classmethod def _response_stream_type(cls): return None -class _UpdateConfigurationOperation(rpc.ClientOperation): +class _ResumeComponentOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateConfiguration' + return 'aws.greengrass#ResumeComponent' @classmethod def _request_type(cls): - return UpdateConfigurationRequest + return ResumeComponentRequest @classmethod def _request_stream_type(cls): @@ -4857,21 +4865,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return UpdateConfigurationResponse + return ResumeComponentResponse @classmethod def _response_stream_type(cls): 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): @@ -4879,21 +4887,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 _StopComponentOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#RestartComponent' + return 'aws.greengrass#StopComponent' @classmethod def _request_type(cls): - return RestartComponentRequest + return StopComponentRequest @classmethod def _request_stream_type(cls): @@ -4901,21 +4909,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return RestartComponentResponse + return StopComponentResponse @classmethod def _response_stream_type(cls): return None -class _GetLocalDeploymentStatusOperation(rpc.ClientOperation): +class _SubscribeToComponentUpdatesOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetLocalDeploymentStatus' + return 'aws.greengrass#SubscribeToComponentUpdates' @classmethod def _request_type(cls): - return GetLocalDeploymentStatusRequest + return SubscribeToComponentUpdatesRequest @classmethod def _request_stream_type(cls): @@ -4923,21 +4931,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetLocalDeploymentStatusResponse + return SubscribeToComponentUpdatesResponse @classmethod def _response_stream_type(cls): - return None + return ComponentUpdatePolicyEvents -class _GetSecretValueOperation(rpc.ClientOperation): +class _SubscribeToConfigurationUpdateOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#GetSecretValue' + return 'aws.greengrass#SubscribeToConfigurationUpdate' @classmethod def _request_type(cls): - return GetSecretValueRequest + return SubscribeToConfigurationUpdateRequest @classmethod def _request_stream_type(cls): @@ -4945,21 +4953,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetSecretValueResponse + return SubscribeToConfigurationUpdateResponse @classmethod def _response_stream_type(cls): - return None + return ConfigurationUpdateEvents -class _UpdateStateOperation(rpc.ClientOperation): +class _SubscribeToIoTCoreOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#UpdateState' + return 'aws.greengrass#SubscribeToIoTCore' @classmethod def _request_type(cls): - return UpdateStateRequest + return SubscribeToIoTCoreRequest @classmethod def _request_stream_type(cls): @@ -4967,21 +4975,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return UpdateStateResponse + return SubscribeToIoTCoreResponse @classmethod def _response_stream_type(cls): - return None + return IoTCoreMessage -class _ListNamedShadowsForThingOperation(rpc.ClientOperation): +class _SubscribeToTopicOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#ListNamedShadowsForThing' + return 'aws.greengrass#SubscribeToTopic' @classmethod def _request_type(cls): - return ListNamedShadowsForThingRequest + return SubscribeToTopicRequest @classmethod def _request_stream_type(cls): @@ -4989,21 +4997,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return ListNamedShadowsForThingResponse + return SubscribeToTopicResponse @classmethod def _response_stream_type(cls): - return None + return SubscriptionResponseMessage -class _SubscribeToComponentUpdatesOperation(rpc.ClientOperation): +class _SubscribeToValidateConfigurationUpdatesOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#SubscribeToComponentUpdates' + return 'aws.greengrass#SubscribeToValidateConfigurationUpdates' @classmethod def _request_type(cls): - return SubscribeToComponentUpdatesRequest + return SubscribeToValidateConfigurationUpdatesRequest @classmethod def _request_stream_type(cls): @@ -5011,21 +5019,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return SubscribeToComponentUpdatesResponse + return SubscribeToValidateConfigurationUpdatesResponse @classmethod def _response_stream_type(cls): - return ComponentUpdatePolicyEvents + return ValidateConfigurationUpdateEvents -class _ListLocalDeploymentsOperation(rpc.ClientOperation): +class _UpdateConfigurationOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#ListLocalDeployments' + return 'aws.greengrass#UpdateConfiguration' @classmethod def _request_type(cls): - return ListLocalDeploymentsRequest + return UpdateConfigurationRequest @classmethod def _request_stream_type(cls): @@ -5033,21 +5041,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return ListLocalDeploymentsResponse + return UpdateConfigurationResponse @classmethod def _response_stream_type(cls): return None -class _StopComponentOperation(rpc.ClientOperation): +class _UpdateStateOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#StopComponent' + return 'aws.greengrass#UpdateState' @classmethod def _request_type(cls): - return StopComponentRequest + return UpdateStateRequest @classmethod def _request_stream_type(cls): @@ -5055,21 +5063,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return StopComponentResponse + return UpdateStateResponse @classmethod def _response_stream_type(cls): return None -class _PauseComponentOperation(rpc.ClientOperation): +class _UpdateThingShadowOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#PauseComponent' + return 'aws.greengrass#UpdateThingShadow' @classmethod def _request_type(cls): - return PauseComponentRequest + return UpdateThingShadowRequest @classmethod def _request_stream_type(cls): @@ -5077,21 +5085,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return PauseComponentResponse + return UpdateThingShadowResponse @classmethod def _response_stream_type(cls): return None -class _CreateLocalDeploymentOperation(rpc.ClientOperation): +class _ValidateAuthorizationTokenOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'aws.greengrass#CreateLocalDeployment' + return 'aws.greengrass#ValidateAuthorizationToken' @classmethod def _request_type(cls): - return CreateLocalDeploymentRequest + return ValidateAuthorizationTokenRequest @classmethod def _request_stream_type(cls): @@ -5099,7 +5107,7 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return CreateLocalDeploymentResponse + return ValidateAuthorizationTokenResponse @classmethod def _response_stream_type(cls): diff --git a/test/echotestrpc/client.py b/test/echotestrpc/client.py index 0e7179b3..612e6a41 100644 --- a/test/echotestrpc/client.py +++ b/test/echotestrpc/client.py @@ -8,40 +8,6 @@ import concurrent.futures -class GetAllProductsOperation(model._GetAllProductsOperation): - """ - GetAllProductsOperation - - Create with EchoTestRPCClient.new_get_all_products() - """ - - def activate(self, request: model.GetAllProductsRequest) -> concurrent.futures.Future: - """ - Activate this operation by sending the initial GetAllProductsRequest 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 GetAllProductsResponse, - 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 CauseServiceErrorOperation(model._CauseServiceErrorOperation): """ CauseServiceErrorOperation @@ -151,6 +117,40 @@ def close(self) -> concurrent.futures.Future: return super().close() +class EchoMessageOperation(model._EchoMessageOperation): + """ + EchoMessageOperation + + Create with EchoTestRPCClient.new_echo_message() + """ + + def activate(self, request: model.EchoMessageRequest) -> concurrent.futures.Future: + """ + Activate this operation by sending the initial EchoMessageRequest 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 EchoMessageResponse, + 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 EchoStreamMessagesStreamHandler(rpc.StreamResponseHandler): """ Event handler for EchoStreamMessagesOperation @@ -226,16 +226,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class EchoMessageOperation(model._EchoMessageOperation): +class GetAllCustomersOperation(model._GetAllCustomersOperation): """ - EchoMessageOperation + GetAllCustomersOperation - Create with EchoTestRPCClient.new_echo_message() + Create with EchoTestRPCClient.new_get_all_customers() """ - def activate(self, request: model.EchoMessageRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetAllCustomersRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial EchoMessageRequest message. + Activate this operation by sending the initial GetAllCustomersRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -245,7 +245,7 @@ def activate(self, request: model.EchoMessageRequest) -> concurrent.futures.Futu def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of EchoMessageResponse, + Returns a Future which completes with a result of GetAllCustomersResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -260,16 +260,16 @@ def close(self) -> concurrent.futures.Future: return super().close() -class GetAllCustomersOperation(model._GetAllCustomersOperation): +class GetAllProductsOperation(model._GetAllProductsOperation): """ - GetAllCustomersOperation + GetAllProductsOperation - Create with EchoTestRPCClient.new_get_all_customers() + Create with EchoTestRPCClient.new_get_all_products() """ - def activate(self, request: model.GetAllCustomersRequest) -> concurrent.futures.Future: + def activate(self, request: model.GetAllProductsRequest) -> concurrent.futures.Future: """ - Activate this operation by sending the initial GetAllCustomersRequest message. + Activate this operation by sending the initial GetAllProductsRequest message. Returns a Future which completes with a result of None if the request is successfully written to the wire, or an exception if @@ -279,7 +279,7 @@ def activate(self, request: model.GetAllCustomersRequest) -> concurrent.futures. def get_response(self) -> concurrent.futures.Future: """ - Returns a Future which completes with a result of GetAllCustomersResponse, + Returns a Future which completes with a result of GetAllProductsResponse, when the initial response is received, or an exception. """ return self._get_response() @@ -305,16 +305,6 @@ class EchoTestRPCClient(rpc.Client): def __init__(self, connection: rpc.Connection): super().__init__(connection, model.SHAPE_INDEX) - def new_get_all_products(self) -> GetAllProductsOperation: - """ - Create a new GetAllProductsOperation. - - 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(GetAllProductsOperation) - def new_cause_service_error(self) -> CauseServiceErrorOperation: """ Create a new CauseServiceErrorOperation. @@ -339,6 +329,16 @@ def new_cause_stream_service_to_error(self, stream_handler: CauseStreamServiceTo """ return self._new_operation(CauseStreamServiceToErrorOperation, stream_handler) + def new_echo_message(self) -> EchoMessageOperation: + """ + Create a new EchoMessageOperation. + + 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(EchoMessageOperation) + def new_echo_stream_messages(self, stream_handler: EchoStreamMessagesStreamHandler) -> EchoStreamMessagesOperation: """ Create a new EchoStreamMessagesOperation. @@ -353,22 +353,22 @@ def new_echo_stream_messages(self, stream_handler: EchoStreamMessagesStreamHandl """ return self._new_operation(EchoStreamMessagesOperation, stream_handler) - def new_echo_message(self) -> EchoMessageOperation: + def new_get_all_customers(self) -> GetAllCustomersOperation: """ - Create a new EchoMessageOperation. + Create a new GetAllCustomersOperation. 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(EchoMessageOperation) + return self._new_operation(GetAllCustomersOperation) - def new_get_all_customers(self) -> GetAllCustomersOperation: + def new_get_all_products(self) -> GetAllProductsOperation: """ - Create a new GetAllCustomersOperation. + Create a new GetAllProductsOperation. 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(GetAllCustomersOperation) + return self._new_operation(GetAllProductsOperation) diff --git a/test/echotestrpc/model.py b/test/echotestrpc/model.py index 4cff86c6..35ea37d9 100644 --- a/test/echotestrpc/model.py +++ b/test/echotestrpc/model.py @@ -28,56 +28,48 @@ def is_client_error(self) -> bool: return self._get_error_type_string() == 'client' -class Customer(rpc.Shape): +class Product(rpc.Shape): """ - Customer + Product All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - id: - first_name: - last_name: + name: + price: Attributes: - id: - first_name: - last_name: + name: + price: """ def __init__(self, *, - id: typing.Optional[int] = None, - first_name: typing.Optional[str] = None, - last_name: typing.Optional[str] = None): + name: typing.Optional[str] = None, + price: typing.Optional[float] = None): super().__init__() - self.id = id # type: typing.Optional[int] - self.first_name = first_name # type: typing.Optional[str] - self.last_name = last_name # type: typing.Optional[str] + self.name = name # type: typing.Optional[str] + self.price = price # type: typing.Optional[float] def _to_payload(self): payload = {} - if self.id is not None: - payload['id'] = self.id - if self.first_name is not None: - payload['firstName'] = self.first_name - if self.last_name is not None: - payload['lastName'] = self.last_name + if self.name is not None: + payload['name'] = self.name + if self.price is not None: + payload['price'] = self.price return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'id' in payload: - new.id = int(payload['id']) - if 'firstName' in payload: - new.first_name = payload['firstName'] - if 'lastName' in payload: - new.last_name = payload['lastName'] + if 'name' in payload: + new.name = payload['name'] + if 'price' in payload: + new.price = float(payload['price']) return new @classmethod def _model_name(cls): - return 'awstest#Customer' + return 'awstest#Product' def __repr__(self): attrs = [] @@ -92,17 +84,6 @@ def __eq__(self, other): return False -class FruitEnum: - """ - FruitEnum enum - """ - - APPLE = 'apl' - ORANGE = 'org' - BANANA = 'ban' - PINEAPPLE = 'pin' - - class Pair(rpc.Shape): """ Pair @@ -159,48 +140,67 @@ def __eq__(self, other): return False -class Product(rpc.Shape): +class FruitEnum: + """ + FruitEnum enum """ - Product + + APPLE = 'apl' + ORANGE = 'org' + BANANA = 'ban' + PINEAPPLE = 'pin' + + +class Customer(rpc.Shape): + """ + Customer All attributes are None by default, and may be set by keyword in the constructor. Keyword Args: - name: - price: + id: + first_name: + last_name: Attributes: - name: - price: + id: + first_name: + last_name: """ def __init__(self, *, - name: typing.Optional[str] = None, - price: typing.Optional[float] = None): + id: typing.Optional[int] = None, + first_name: typing.Optional[str] = None, + last_name: typing.Optional[str] = None): super().__init__() - self.name = name # type: typing.Optional[str] - self.price = price # type: typing.Optional[float] + self.id = id # type: typing.Optional[int] + self.first_name = first_name # type: typing.Optional[str] + self.last_name = last_name # type: typing.Optional[str] def _to_payload(self): payload = {} - if self.name is not None: - payload['name'] = self.name - if self.price is not None: - payload['price'] = self.price + if self.id is not None: + payload['id'] = self.id + if self.first_name is not None: + payload['firstName'] = self.first_name + if self.last_name is not None: + payload['lastName'] = self.last_name return payload @classmethod def _from_payload(cls, payload): new = cls() - if 'name' in payload: - new.name = payload['name'] - if 'price' in payload: - new.price = float(payload['price']) + if 'id' in payload: + new.id = int(payload['id']) + if 'firstName' in payload: + new.first_name = payload['firstName'] + if 'lastName' in payload: + new.last_name = payload['lastName'] return new @classmethod def _model_name(cls): - return 'awstest#Product' + return 'awstest#Customer' def __repr__(self): attrs = [] @@ -841,9 +841,9 @@ def __eq__(self, other): SHAPE_INDEX = rpc.ShapeIndex([ - Customer, - Pair, Product, + Pair, + Customer, MessageData, GetAllCustomersResponse, GetAllCustomersRequest, @@ -859,14 +859,14 @@ def __eq__(self, other): ]) -class _GetAllProductsOperation(rpc.ClientOperation): +class _CauseServiceErrorOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'awstest#GetAllProducts' + return 'awstest#CauseServiceError' @classmethod def _request_type(cls): - return GetAllProductsRequest + return CauseServiceErrorRequest @classmethod def _request_stream_type(cls): @@ -874,55 +874,55 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetAllProductsResponse + return CauseServiceErrorResponse @classmethod def _response_stream_type(cls): return None -class _CauseServiceErrorOperation(rpc.ClientOperation): +class _CauseStreamServiceToErrorOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'awstest#CauseServiceError' + return 'awstest#CauseStreamServiceToError' @classmethod def _request_type(cls): - return CauseServiceErrorRequest + return EchoStreamingRequest @classmethod def _request_stream_type(cls): - return None + return EchoStreamingMessage @classmethod def _response_type(cls): - return CauseServiceErrorResponse + return EchoStreamingResponse @classmethod def _response_stream_type(cls): - return None + return EchoStreamingMessage -class _CauseStreamServiceToErrorOperation(rpc.ClientOperation): +class _EchoMessageOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'awstest#CauseStreamServiceToError' + return 'awstest#EchoMessage' @classmethod def _request_type(cls): - return EchoStreamingRequest + return EchoMessageRequest @classmethod def _request_stream_type(cls): - return EchoStreamingMessage + return None @classmethod def _response_type(cls): - return EchoStreamingResponse + return EchoMessageResponse @classmethod def _response_stream_type(cls): - return EchoStreamingMessage + return None class _EchoStreamMessagesOperation(rpc.ClientOperation): @@ -947,14 +947,14 @@ def _response_stream_type(cls): return EchoStreamingMessage -class _EchoMessageOperation(rpc.ClientOperation): +class _GetAllCustomersOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'awstest#EchoMessage' + return 'awstest#GetAllCustomers' @classmethod def _request_type(cls): - return EchoMessageRequest + return GetAllCustomersRequest @classmethod def _request_stream_type(cls): @@ -962,21 +962,21 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return EchoMessageResponse + return GetAllCustomersResponse @classmethod def _response_stream_type(cls): return None -class _GetAllCustomersOperation(rpc.ClientOperation): +class _GetAllProductsOperation(rpc.ClientOperation): @classmethod def _model_name(cls): - return 'awstest#GetAllCustomers' + return 'awstest#GetAllProducts' @classmethod def _request_type(cls): - return GetAllCustomersRequest + return GetAllProductsRequest @classmethod def _request_stream_type(cls): @@ -984,7 +984,7 @@ def _request_stream_type(cls): @classmethod def _response_type(cls): - return GetAllCustomersResponse + return GetAllProductsResponse @classmethod def _response_stream_type(cls):