From 1463504e73f37edda16704ebd8a9cf6f9b18c712 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Wed, 10 Jul 2024 15:37:05 -0700 Subject: [PATCH] Update Greengrass IPC --- awsiot/greengrasscoreipc/clientv2.py | 12 ++++++++---- awsiot/greengrasscoreipc/model.py | 14 +++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/awsiot/greengrasscoreipc/clientv2.py b/awsiot/greengrasscoreipc/clientv2.py index 256a2c9..b4345dd 100644 --- a/awsiot/greengrasscoreipc/clientv2.py +++ b/awsiot/greengrasscoreipc/clientv2.py @@ -405,7 +405,8 @@ def get_local_deployment_status_async(self, *, def get_secret_value(self, *, secret_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, - version_stage: typing.Optional[str] = None) -> model.GetSecretValueResponse: + version_stage: typing.Optional[str] = None, + refresh: typing.Optional[bool] = None) -> model.GetSecretValueResponse: """ Perform the GetSecretValue operation synchronously. @@ -413,13 +414,15 @@ def get_secret_value(self, *, secret_id: version_id: version_stage: + refresh: """ - return self.get_secret_value_async(secret_id=secret_id, version_id=version_id, version_stage=version_stage).result() + return self.get_secret_value_async(secret_id=secret_id, version_id=version_id, version_stage=version_stage, refresh=refresh).result() def get_secret_value_async(self, *, secret_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, - version_stage: typing.Optional[str] = None): # type: (...) -> concurrent.futures.Future[model.GetSecretValueResponse] + version_stage: typing.Optional[str] = None, + refresh: typing.Optional[bool] = None): # type: (...) -> concurrent.futures.Future[model.GetSecretValueResponse] """ Perform the GetSecretValue operation asynchronously. @@ -427,8 +430,9 @@ def get_secret_value_async(self, *, secret_id: version_id: version_stage: + refresh: """ - request = model.GetSecretValueRequest(secret_id=secret_id, version_id=version_id, version_stage=version_stage) + request = model.GetSecretValueRequest(secret_id=secret_id, version_id=version_id, version_stage=version_stage, refresh=refresh) operation = self.client.new_get_secret_value() write_future = operation.activate(request) return self.__combine_futures(write_future, operation.get_response()) diff --git a/awsiot/greengrasscoreipc/model.py b/awsiot/greengrasscoreipc/model.py index f2d5f07..3821a64 100644 --- a/awsiot/greengrasscoreipc/model.py +++ b/awsiot/greengrasscoreipc/model.py @@ -3636,21 +3636,25 @@ class GetSecretValueRequest(rpc.Shape): secret_id: The name of the secret to get. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. version_id: (Optional) The ID of the version to get. If you don't specify versionId or versionStage, this operation defaults to the version with the AWSCURRENT label. version_stage: (Optional) The staging label of the version to get. If you don't specify versionId or versionStage, this operation defaults to the version with the AWSCURRENT label. + refresh: (Optional) Whether to fetch the latest secret from cloud when the request is handled. Defaults to false. Attributes: secret_id: The name of the secret to get. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. version_id: (Optional) The ID of the version to get. If you don't specify versionId or versionStage, this operation defaults to the version with the AWSCURRENT label. version_stage: (Optional) The staging label of the version to get. If you don't specify versionId or versionStage, this operation defaults to the version with the AWSCURRENT label. + refresh: (Optional) Whether to fetch the latest secret from cloud when the request is handled. Defaults to false. """ def __init__(self, *, secret_id: typing.Optional[str] = None, version_id: typing.Optional[str] = None, - version_stage: typing.Optional[str] = None): + version_stage: typing.Optional[str] = None, + refresh: typing.Optional[bool] = None): super().__init__() self.secret_id = secret_id # type: typing.Optional[str] self.version_id = version_id # type: typing.Optional[str] self.version_stage = version_stage # type: typing.Optional[str] + self.refresh = refresh # type: typing.Optional[bool] def set_secret_id(self, secret_id: str): self.secret_id = secret_id @@ -3664,6 +3668,10 @@ def set_version_stage(self, version_stage: str): self.version_stage = version_stage return self + def set_refresh(self, refresh: bool): + self.refresh = refresh + return self + def _to_payload(self): payload = {} @@ -3673,6 +3681,8 @@ def _to_payload(self): payload['versionId'] = self.version_id if self.version_stage is not None: payload['versionStage'] = self.version_stage + if self.refresh is not None: + payload['refresh'] = self.refresh return payload @classmethod @@ -3684,6 +3694,8 @@ def _from_payload(cls, payload): new.version_id = payload['versionId'] if 'versionStage' in payload: new.version_stage = payload['versionStage'] + if 'refresh' in payload: + new.refresh = payload['refresh'] return new @classmethod