U Dx`b@sUdZddlZddlZddlZddlmZmZmZmZm Z ddl Z ddl m Z e eZejed<d eee jeeefdddZd eee jeeefdd d ZdS) zSecrets Manager module.N)AnyDictOptionalUnioncast)_utils_logger)name boto3_sessionreturncCsJtj|d}tjd|d}|j|d}d|kr>> import awswrangler as wr >>> value = wr.secretsmanager.get_secret("my-secret") )sessionZsecretsmanager) service_namer )ZSecretIdZ SecretStringZ SecretBinary)rZensure_sessionclientZget_secret_valuerstrbase64 b64decode)r r r rresponserA/tmp/pip-target-zr53vnty/lib/python/awswrangler/secretsmanager.py get_secrets   rcCs$t||d}ttttft|S)aqGet JSON secret value. Parameters ---------- name: str: Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. boto3_session : boto3.Session(), optional Boto3 Session. The default boto3 session will be used if boto3_session receive None. Returns ------- Dict[str, Any] Secret JSON value parsed as a dictionary. Examples -------- >>> import awswrangler as wr >>> value = wr.secretsmanager.get_secret_json("my-secret-with-json-content") )r r )rrrrrjsonloads)r r valuerrrget_secret_json-s r)N)N)__doc__rrloggingtypingrrrrrZboto3Z awswranglerr getLogger__name__rLogger__annotations__rSessionbytesrrrrrrs "