{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecretsManager.ListSecrets
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the secrets that are stored by Secrets Manager in the Amazon Web
-- Services account, not including secrets that are marked for deletion. To
-- see secrets marked for deletion, use the Secrets Manager console.
--
-- ListSecrets is eventually consistent, however it might not reflect
-- changes from the last five minutes. To get the latest information for a
-- specific secret, use DescribeSecret.
--
-- To list the versions of a secret, use ListSecretVersionIds.
--
-- To get the secret value from @SecretString@ or @SecretBinary@, call
-- GetSecretValue.
--
-- For information about finding secrets in the console, see
-- <https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html Find secrets in Secrets Manager>.
--
-- Secrets Manager generates a CloudTrail log entry when you call this
-- action. Do not include sensitive information in request parameters
-- because it might be logged. For more information, see
-- <https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html Logging Secrets Manager events with CloudTrail>.
--
-- __Required permissions:__ @secretsmanager:ListSecrets@. For more
-- information, see
-- <https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions IAM policy actions for Secrets Manager>
-- and
-- <https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html Authentication and access control in Secrets Manager>.
--
-- This operation returns paginated results.
module Amazonka.SecretsManager.ListSecrets
  ( -- * Creating a Request
    ListSecrets (..),
    newListSecrets,

    -- * Request Lenses
    listSecrets_filters,
    listSecrets_includePlannedDeletion,
    listSecrets_maxResults,
    listSecrets_nextToken,
    listSecrets_sortOrder,

    -- * Destructuring the Response
    ListSecretsResponse (..),
    newListSecretsResponse,

    -- * Response Lenses
    listSecretsResponse_nextToken,
    listSecretsResponse_secretList,
    listSecretsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecretsManager.Types

-- | /See:/ 'newListSecrets' smart constructor.
data ListSecrets = ListSecrets'
  { -- | The filters to apply to the list of secrets.
    ListSecrets -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    ListSecrets -> Maybe Bool
includePlannedDeletion :: Prelude.Maybe Prelude.Bool,
    -- | The number of results to include in the response.
    --
    -- If there are more results available, in the response, Secrets Manager
    -- includes @NextToken@. To get the next results, call @ListSecrets@ again
    -- with the value from @NextToken@.
    ListSecrets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A token that indicates where the output should continue from, if a
    -- previous call did not show all results. To get the next results, call
    -- @ListSecrets@ again with this value.
    ListSecrets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Secrets are listed by @CreatedDate@.
    ListSecrets -> Maybe SortOrderType
sortOrder :: Prelude.Maybe SortOrderType
  }
  deriving (ListSecrets -> ListSecrets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecrets -> ListSecrets -> Bool
$c/= :: ListSecrets -> ListSecrets -> Bool
== :: ListSecrets -> ListSecrets -> Bool
$c== :: ListSecrets -> ListSecrets -> Bool
Prelude.Eq, ReadPrec [ListSecrets]
ReadPrec ListSecrets
Int -> ReadS ListSecrets
ReadS [ListSecrets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecrets]
$creadListPrec :: ReadPrec [ListSecrets]
readPrec :: ReadPrec ListSecrets
$creadPrec :: ReadPrec ListSecrets
readList :: ReadS [ListSecrets]
$creadList :: ReadS [ListSecrets]
readsPrec :: Int -> ReadS ListSecrets
$creadsPrec :: Int -> ReadS ListSecrets
Prelude.Read, Int -> ListSecrets -> ShowS
[ListSecrets] -> ShowS
ListSecrets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecrets] -> ShowS
$cshowList :: [ListSecrets] -> ShowS
show :: ListSecrets -> String
$cshow :: ListSecrets -> String
showsPrec :: Int -> ListSecrets -> ShowS
$cshowsPrec :: Int -> ListSecrets -> ShowS
Prelude.Show, forall x. Rep ListSecrets x -> ListSecrets
forall x. ListSecrets -> Rep ListSecrets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSecrets x -> ListSecrets
$cfrom :: forall x. ListSecrets -> Rep ListSecrets x
Prelude.Generic)

-- |
-- Create a value of 'ListSecrets' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'listSecrets_filters' - The filters to apply to the list of secrets.
--
-- 'includePlannedDeletion', 'listSecrets_includePlannedDeletion' - Undocumented member.
--
-- 'maxResults', 'listSecrets_maxResults' - The number of results to include in the response.
--
-- If there are more results available, in the response, Secrets Manager
-- includes @NextToken@. To get the next results, call @ListSecrets@ again
-- with the value from @NextToken@.
--
-- 'nextToken', 'listSecrets_nextToken' - A token that indicates where the output should continue from, if a
-- previous call did not show all results. To get the next results, call
-- @ListSecrets@ again with this value.
--
-- 'sortOrder', 'listSecrets_sortOrder' - Secrets are listed by @CreatedDate@.
newListSecrets ::
  ListSecrets
newListSecrets :: ListSecrets
newListSecrets =
  ListSecrets'
    { $sel:filters:ListSecrets' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:includePlannedDeletion:ListSecrets' :: Maybe Bool
includePlannedDeletion = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSecrets' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSecrets' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListSecrets' :: Maybe SortOrderType
sortOrder = forall a. Maybe a
Prelude.Nothing
    }

-- | The filters to apply to the list of secrets.
listSecrets_filters :: Lens.Lens' ListSecrets (Prelude.Maybe [Filter])
listSecrets_filters :: Lens' ListSecrets (Maybe [Filter])
listSecrets_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecrets' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListSecrets' :: ListSecrets -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListSecrets
s@ListSecrets' {} Maybe [Filter]
a -> ListSecrets
s {$sel:filters:ListSecrets' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListSecrets) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
listSecrets_includePlannedDeletion :: Lens.Lens' ListSecrets (Prelude.Maybe Prelude.Bool)
listSecrets_includePlannedDeletion :: Lens' ListSecrets (Maybe Bool)
listSecrets_includePlannedDeletion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecrets' {Maybe Bool
includePlannedDeletion :: Maybe Bool
$sel:includePlannedDeletion:ListSecrets' :: ListSecrets -> Maybe Bool
includePlannedDeletion} -> Maybe Bool
includePlannedDeletion) (\s :: ListSecrets
s@ListSecrets' {} Maybe Bool
a -> ListSecrets
s {$sel:includePlannedDeletion:ListSecrets' :: Maybe Bool
includePlannedDeletion = Maybe Bool
a} :: ListSecrets)

-- | The number of results to include in the response.
--
-- If there are more results available, in the response, Secrets Manager
-- includes @NextToken@. To get the next results, call @ListSecrets@ again
-- with the value from @NextToken@.
listSecrets_maxResults :: Lens.Lens' ListSecrets (Prelude.Maybe Prelude.Natural)
listSecrets_maxResults :: Lens' ListSecrets (Maybe Natural)
listSecrets_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecrets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSecrets' :: ListSecrets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSecrets
s@ListSecrets' {} Maybe Natural
a -> ListSecrets
s {$sel:maxResults:ListSecrets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSecrets)

-- | A token that indicates where the output should continue from, if a
-- previous call did not show all results. To get the next results, call
-- @ListSecrets@ again with this value.
listSecrets_nextToken :: Lens.Lens' ListSecrets (Prelude.Maybe Prelude.Text)
listSecrets_nextToken :: Lens' ListSecrets (Maybe Text)
listSecrets_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecrets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecrets' :: ListSecrets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecrets
s@ListSecrets' {} Maybe Text
a -> ListSecrets
s {$sel:nextToken:ListSecrets' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecrets)

-- | Secrets are listed by @CreatedDate@.
listSecrets_sortOrder :: Lens.Lens' ListSecrets (Prelude.Maybe SortOrderType)
listSecrets_sortOrder :: Lens' ListSecrets (Maybe SortOrderType)
listSecrets_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecrets' {Maybe SortOrderType
sortOrder :: Maybe SortOrderType
$sel:sortOrder:ListSecrets' :: ListSecrets -> Maybe SortOrderType
sortOrder} -> Maybe SortOrderType
sortOrder) (\s :: ListSecrets
s@ListSecrets' {} Maybe SortOrderType
a -> ListSecrets
s {$sel:sortOrder:ListSecrets' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
a} :: ListSecrets)

instance Core.AWSPager ListSecrets where
  page :: ListSecrets -> AWSResponse ListSecrets -> Maybe ListSecrets
page ListSecrets
rq AWSResponse ListSecrets
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSecrets
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecretsResponse (Maybe Text)
listSecretsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSecrets
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecretsResponse (Maybe [SecretListEntry])
listSecretsResponse_secretList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListSecrets
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSecrets (Maybe Text)
listSecrets_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSecrets
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecretsResponse (Maybe Text)
listSecretsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListSecrets where
  type AWSResponse ListSecrets = ListSecretsResponse
  request :: (Service -> Service) -> ListSecrets -> Request ListSecrets
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSecrets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListSecrets)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [SecretListEntry] -> Int -> ListSecretsResponse
ListSecretsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SecretList" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListSecrets where
  hashWithSalt :: Int -> ListSecrets -> Int
hashWithSalt Int
_salt ListSecrets' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
includePlannedDeletion :: Maybe Bool
filters :: Maybe [Filter]
$sel:sortOrder:ListSecrets' :: ListSecrets -> Maybe SortOrderType
$sel:nextToken:ListSecrets' :: ListSecrets -> Maybe Text
$sel:maxResults:ListSecrets' :: ListSecrets -> Maybe Natural
$sel:includePlannedDeletion:ListSecrets' :: ListSecrets -> Maybe Bool
$sel:filters:ListSecrets' :: ListSecrets -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includePlannedDeletion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrderType
sortOrder

instance Prelude.NFData ListSecrets where
  rnf :: ListSecrets -> ()
rnf ListSecrets' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
includePlannedDeletion :: Maybe Bool
filters :: Maybe [Filter]
$sel:sortOrder:ListSecrets' :: ListSecrets -> Maybe SortOrderType
$sel:nextToken:ListSecrets' :: ListSecrets -> Maybe Text
$sel:maxResults:ListSecrets' :: ListSecrets -> Maybe Natural
$sel:includePlannedDeletion:ListSecrets' :: ListSecrets -> Maybe Bool
$sel:filters:ListSecrets' :: ListSecrets -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includePlannedDeletion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrderType
sortOrder

instance Data.ToHeaders ListSecrets where
  toHeaders :: ListSecrets -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"secretsmanager.ListSecrets" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListSecrets where
  toJSON :: ListSecrets -> Value
toJSON ListSecrets' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
includePlannedDeletion :: Maybe Bool
filters :: Maybe [Filter]
$sel:sortOrder:ListSecrets' :: ListSecrets -> Maybe SortOrderType
$sel:nextToken:ListSecrets' :: ListSecrets -> Maybe Text
$sel:maxResults:ListSecrets' :: ListSecrets -> Maybe Natural
$sel:includePlannedDeletion:ListSecrets' :: ListSecrets -> Maybe Bool
$sel:filters:ListSecrets' :: ListSecrets -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Key
"IncludePlannedDeletion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includePlannedDeletion,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"SortOrder" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrderType
sortOrder
          ]
      )

instance Data.ToPath ListSecrets where
  toPath :: ListSecrets -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListSecrets where
  toQuery :: ListSecrets -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListSecretsResponse' smart constructor.
data ListSecretsResponse = ListSecretsResponse'
  { -- | Secrets Manager includes this value if there\'s more output available
    -- than what is included in the current response. This can occur even when
    -- the response includes no values at all, such as when you ask for a
    -- filtered view of a long list. To get the next results, call
    -- @ListSecrets@ again with this value.
    ListSecretsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the secrets in the account.
    ListSecretsResponse -> Maybe [SecretListEntry]
secretList :: Prelude.Maybe [SecretListEntry],
    -- | The response's http status code.
    ListSecretsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSecretsResponse -> ListSecretsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecretsResponse -> ListSecretsResponse -> Bool
$c/= :: ListSecretsResponse -> ListSecretsResponse -> Bool
== :: ListSecretsResponse -> ListSecretsResponse -> Bool
$c== :: ListSecretsResponse -> ListSecretsResponse -> Bool
Prelude.Eq, ReadPrec [ListSecretsResponse]
ReadPrec ListSecretsResponse
Int -> ReadS ListSecretsResponse
ReadS [ListSecretsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecretsResponse]
$creadListPrec :: ReadPrec [ListSecretsResponse]
readPrec :: ReadPrec ListSecretsResponse
$creadPrec :: ReadPrec ListSecretsResponse
readList :: ReadS [ListSecretsResponse]
$creadList :: ReadS [ListSecretsResponse]
readsPrec :: Int -> ReadS ListSecretsResponse
$creadsPrec :: Int -> ReadS ListSecretsResponse
Prelude.Read, Int -> ListSecretsResponse -> ShowS
[ListSecretsResponse] -> ShowS
ListSecretsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecretsResponse] -> ShowS
$cshowList :: [ListSecretsResponse] -> ShowS
show :: ListSecretsResponse -> String
$cshow :: ListSecretsResponse -> String
showsPrec :: Int -> ListSecretsResponse -> ShowS
$cshowsPrec :: Int -> ListSecretsResponse -> ShowS
Prelude.Show, forall x. Rep ListSecretsResponse x -> ListSecretsResponse
forall x. ListSecretsResponse -> Rep ListSecretsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSecretsResponse x -> ListSecretsResponse
$cfrom :: forall x. ListSecretsResponse -> Rep ListSecretsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSecretsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listSecretsResponse_nextToken' - Secrets Manager includes this value if there\'s more output available
-- than what is included in the current response. This can occur even when
-- the response includes no values at all, such as when you ask for a
-- filtered view of a long list. To get the next results, call
-- @ListSecrets@ again with this value.
--
-- 'secretList', 'listSecretsResponse_secretList' - A list of the secrets in the account.
--
-- 'httpStatus', 'listSecretsResponse_httpStatus' - The response's http status code.
newListSecretsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSecretsResponse
newListSecretsResponse :: Int -> ListSecretsResponse
newListSecretsResponse Int
pHttpStatus_ =
  ListSecretsResponse'
    { $sel:nextToken:ListSecretsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:secretList:ListSecretsResponse' :: Maybe [SecretListEntry]
secretList = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSecretsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Secrets Manager includes this value if there\'s more output available
-- than what is included in the current response. This can occur even when
-- the response includes no values at all, such as when you ask for a
-- filtered view of a long list. To get the next results, call
-- @ListSecrets@ again with this value.
listSecretsResponse_nextToken :: Lens.Lens' ListSecretsResponse (Prelude.Maybe Prelude.Text)
listSecretsResponse_nextToken :: Lens' ListSecretsResponse (Maybe Text)
listSecretsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecretsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecretsResponse' :: ListSecretsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecretsResponse
s@ListSecretsResponse' {} Maybe Text
a -> ListSecretsResponse
s {$sel:nextToken:ListSecretsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecretsResponse)

-- | A list of the secrets in the account.
listSecretsResponse_secretList :: Lens.Lens' ListSecretsResponse (Prelude.Maybe [SecretListEntry])
listSecretsResponse_secretList :: Lens' ListSecretsResponse (Maybe [SecretListEntry])
listSecretsResponse_secretList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecretsResponse' {Maybe [SecretListEntry]
secretList :: Maybe [SecretListEntry]
$sel:secretList:ListSecretsResponse' :: ListSecretsResponse -> Maybe [SecretListEntry]
secretList} -> Maybe [SecretListEntry]
secretList) (\s :: ListSecretsResponse
s@ListSecretsResponse' {} Maybe [SecretListEntry]
a -> ListSecretsResponse
s {$sel:secretList:ListSecretsResponse' :: Maybe [SecretListEntry]
secretList = Maybe [SecretListEntry]
a} :: ListSecretsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listSecretsResponse_httpStatus :: Lens.Lens' ListSecretsResponse Prelude.Int
listSecretsResponse_httpStatus :: Lens' ListSecretsResponse Int
listSecretsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecretsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSecretsResponse' :: ListSecretsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSecretsResponse
s@ListSecretsResponse' {} Int
a -> ListSecretsResponse
s {$sel:httpStatus:ListSecretsResponse' :: Int
httpStatus = Int
a} :: ListSecretsResponse)

instance Prelude.NFData ListSecretsResponse where
  rnf :: ListSecretsResponse -> ()
rnf ListSecretsResponse' {Int
Maybe [SecretListEntry]
Maybe Text
httpStatus :: Int
secretList :: Maybe [SecretListEntry]
nextToken :: Maybe Text
$sel:httpStatus:ListSecretsResponse' :: ListSecretsResponse -> Int
$sel:secretList:ListSecretsResponse' :: ListSecretsResponse -> Maybe [SecretListEntry]
$sel:nextToken:ListSecretsResponse' :: ListSecretsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SecretListEntry]
secretList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus