Skip to content

Commit 055e874

Browse files
authored
Update Greengrass IPC (#586)
* Add refresh field to GetSecretValueRequest
1 parent 6b063b5 commit 055e874

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

awsiot/greengrasscoreipc/clientv2.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,30 +405,34 @@ def get_local_deployment_status_async(self, *,
405405
def get_secret_value(self, *,
406406
secret_id: typing.Optional[str] = None,
407407
version_id: typing.Optional[str] = None,
408-
version_stage: typing.Optional[str] = None) -> model.GetSecretValueResponse:
408+
version_stage: typing.Optional[str] = None,
409+
refresh: typing.Optional[bool] = None) -> model.GetSecretValueResponse:
409410
"""
410411
Perform the GetSecretValue operation synchronously.
411412
412413
Args:
413414
secret_id:
414415
version_id:
415416
version_stage:
417+
refresh:
416418
"""
417-
return self.get_secret_value_async(secret_id=secret_id, version_id=version_id, version_stage=version_stage).result()
419+
return self.get_secret_value_async(secret_id=secret_id, version_id=version_id, version_stage=version_stage, refresh=refresh).result()
418420

419421
def get_secret_value_async(self, *,
420422
secret_id: typing.Optional[str] = None,
421423
version_id: typing.Optional[str] = None,
422-
version_stage: typing.Optional[str] = None): # type: (...) -> concurrent.futures.Future[model.GetSecretValueResponse]
424+
version_stage: typing.Optional[str] = None,
425+
refresh: typing.Optional[bool] = None): # type: (...) -> concurrent.futures.Future[model.GetSecretValueResponse]
423426
"""
424427
Perform the GetSecretValue operation asynchronously.
425428
426429
Args:
427430
secret_id:
428431
version_id:
429432
version_stage:
433+
refresh:
430434
"""
431-
request = model.GetSecretValueRequest(secret_id=secret_id, version_id=version_id, version_stage=version_stage)
435+
request = model.GetSecretValueRequest(secret_id=secret_id, version_id=version_id, version_stage=version_stage, refresh=refresh)
432436
operation = self.client.new_get_secret_value()
433437
write_future = operation.activate(request)
434438
return self.__combine_futures(write_future, operation.get_response())

awsiot/greengrasscoreipc/model.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3636,21 +3636,25 @@ class GetSecretValueRequest(rpc.Shape):
36363636
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.
36373637
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.
36383638
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.
3639+
refresh: (Optional) Whether to fetch the latest secret from cloud when the request is handled. Defaults to false.
36393640
36403641
Attributes:
36413642
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.
36423643
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.
36433644
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.
3645+
refresh: (Optional) Whether to fetch the latest secret from cloud when the request is handled. Defaults to false.
36443646
"""
36453647

36463648
def __init__(self, *,
36473649
secret_id: typing.Optional[str] = None,
36483650
version_id: typing.Optional[str] = None,
3649-
version_stage: typing.Optional[str] = None):
3651+
version_stage: typing.Optional[str] = None,
3652+
refresh: typing.Optional[bool] = None):
36503653
super().__init__()
36513654
self.secret_id = secret_id # type: typing.Optional[str]
36523655
self.version_id = version_id # type: typing.Optional[str]
36533656
self.version_stage = version_stage # type: typing.Optional[str]
3657+
self.refresh = refresh # type: typing.Optional[bool]
36543658

36553659
def set_secret_id(self, secret_id: str):
36563660
self.secret_id = secret_id
@@ -3664,6 +3668,10 @@ def set_version_stage(self, version_stage: str):
36643668
self.version_stage = version_stage
36653669
return self
36663670

3671+
def set_refresh(self, refresh: bool):
3672+
self.refresh = refresh
3673+
return self
3674+
36673675

36683676
def _to_payload(self):
36693677
payload = {}
@@ -3673,6 +3681,8 @@ def _to_payload(self):
36733681
payload['versionId'] = self.version_id
36743682
if self.version_stage is not None:
36753683
payload['versionStage'] = self.version_stage
3684+
if self.refresh is not None:
3685+
payload['refresh'] = self.refresh
36763686
return payload
36773687

36783688
@classmethod
@@ -3684,6 +3694,8 @@ def _from_payload(cls, payload):
36843694
new.version_id = payload['versionId']
36853695
if 'versionStage' in payload:
36863696
new.version_stage = payload['versionStage']
3697+
if 'refresh' in payload:
3698+
new.refresh = payload['refresh']
36873699
return new
36883700

36893701
@classmethod

0 commit comments

Comments
 (0)