{-# 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.SSM.ListDocuments
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns all Systems Manager (SSM) documents in the current Amazon Web
-- Services account and Amazon Web Services Region. You can limit the
-- results of this request by using a filter.
--
-- This operation returns paginated results.
module Amazonka.SSM.ListDocuments
  ( -- * Creating a Request
    ListDocuments (..),
    newListDocuments,

    -- * Request Lenses
    listDocuments_documentFilterList,
    listDocuments_filters,
    listDocuments_maxResults,
    listDocuments_nextToken,

    -- * Destructuring the Response
    ListDocumentsResponse (..),
    newListDocumentsResponse,

    -- * Response Lenses
    listDocumentsResponse_documentIdentifiers,
    listDocumentsResponse_nextToken,
    listDocumentsResponse_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.SSM.Types

-- | /See:/ 'newListDocuments' smart constructor.
data ListDocuments = ListDocuments'
  { -- | This data type is deprecated. Instead, use @Filters@.
    ListDocuments -> Maybe (NonEmpty DocumentFilter)
documentFilterList :: Prelude.Maybe (Prelude.NonEmpty DocumentFilter),
    -- | One or more @DocumentKeyValuesFilter@ objects. Use a filter to return a
    -- more specific list of results. For keys, you can specify one or more
    -- key-value pair tags that have been applied to a document. Other valid
    -- keys include @Owner@, @Name@, @PlatformTypes@, @DocumentType@, and
    -- @TargetType@. For example, to return documents you own use
    -- @Key=Owner,Values=Self@. To specify a custom key-value pair, use the
    -- format @Key=tag:tagName,Values=valueName@.
    --
    -- This API operation only supports filtering documents by using a single
    -- tag key and one or more tag values. For example:
    -- @Key=tag:tagName,Values=valueName1,valueName2@
    ListDocuments -> Maybe [DocumentKeyValuesFilter]
filters :: Prelude.Maybe [DocumentKeyValuesFilter],
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    ListDocuments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    ListDocuments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListDocuments -> ListDocuments -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDocuments -> ListDocuments -> Bool
$c/= :: ListDocuments -> ListDocuments -> Bool
== :: ListDocuments -> ListDocuments -> Bool
$c== :: ListDocuments -> ListDocuments -> Bool
Prelude.Eq, ReadPrec [ListDocuments]
ReadPrec ListDocuments
Int -> ReadS ListDocuments
ReadS [ListDocuments]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDocuments]
$creadListPrec :: ReadPrec [ListDocuments]
readPrec :: ReadPrec ListDocuments
$creadPrec :: ReadPrec ListDocuments
readList :: ReadS [ListDocuments]
$creadList :: ReadS [ListDocuments]
readsPrec :: Int -> ReadS ListDocuments
$creadsPrec :: Int -> ReadS ListDocuments
Prelude.Read, Int -> ListDocuments -> ShowS
[ListDocuments] -> ShowS
ListDocuments -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDocuments] -> ShowS
$cshowList :: [ListDocuments] -> ShowS
show :: ListDocuments -> String
$cshow :: ListDocuments -> String
showsPrec :: Int -> ListDocuments -> ShowS
$cshowsPrec :: Int -> ListDocuments -> ShowS
Prelude.Show, forall x. Rep ListDocuments x -> ListDocuments
forall x. ListDocuments -> Rep ListDocuments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDocuments x -> ListDocuments
$cfrom :: forall x. ListDocuments -> Rep ListDocuments x
Prelude.Generic)

-- |
-- Create a value of 'ListDocuments' 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:
--
-- 'documentFilterList', 'listDocuments_documentFilterList' - This data type is deprecated. Instead, use @Filters@.
--
-- 'filters', 'listDocuments_filters' - One or more @DocumentKeyValuesFilter@ objects. Use a filter to return a
-- more specific list of results. For keys, you can specify one or more
-- key-value pair tags that have been applied to a document. Other valid
-- keys include @Owner@, @Name@, @PlatformTypes@, @DocumentType@, and
-- @TargetType@. For example, to return documents you own use
-- @Key=Owner,Values=Self@. To specify a custom key-value pair, use the
-- format @Key=tag:tagName,Values=valueName@.
--
-- This API operation only supports filtering documents by using a single
-- tag key and one or more tag values. For example:
-- @Key=tag:tagName,Values=valueName1,valueName2@
--
-- 'maxResults', 'listDocuments_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- 'nextToken', 'listDocuments_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
newListDocuments ::
  ListDocuments
newListDocuments :: ListDocuments
newListDocuments =
  ListDocuments'
    { $sel:documentFilterList:ListDocuments' :: Maybe (NonEmpty DocumentFilter)
documentFilterList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListDocuments' :: Maybe [DocumentKeyValuesFilter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDocuments' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDocuments' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | This data type is deprecated. Instead, use @Filters@.
listDocuments_documentFilterList :: Lens.Lens' ListDocuments (Prelude.Maybe (Prelude.NonEmpty DocumentFilter))
listDocuments_documentFilterList :: Lens' ListDocuments (Maybe (NonEmpty DocumentFilter))
listDocuments_documentFilterList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocuments' {Maybe (NonEmpty DocumentFilter)
documentFilterList :: Maybe (NonEmpty DocumentFilter)
$sel:documentFilterList:ListDocuments' :: ListDocuments -> Maybe (NonEmpty DocumentFilter)
documentFilterList} -> Maybe (NonEmpty DocumentFilter)
documentFilterList) (\s :: ListDocuments
s@ListDocuments' {} Maybe (NonEmpty DocumentFilter)
a -> ListDocuments
s {$sel:documentFilterList:ListDocuments' :: Maybe (NonEmpty DocumentFilter)
documentFilterList = Maybe (NonEmpty DocumentFilter)
a} :: ListDocuments) 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

-- | One or more @DocumentKeyValuesFilter@ objects. Use a filter to return a
-- more specific list of results. For keys, you can specify one or more
-- key-value pair tags that have been applied to a document. Other valid
-- keys include @Owner@, @Name@, @PlatformTypes@, @DocumentType@, and
-- @TargetType@. For example, to return documents you own use
-- @Key=Owner,Values=Self@. To specify a custom key-value pair, use the
-- format @Key=tag:tagName,Values=valueName@.
--
-- This API operation only supports filtering documents by using a single
-- tag key and one or more tag values. For example:
-- @Key=tag:tagName,Values=valueName1,valueName2@
listDocuments_filters :: Lens.Lens' ListDocuments (Prelude.Maybe [DocumentKeyValuesFilter])
listDocuments_filters :: Lens' ListDocuments (Maybe [DocumentKeyValuesFilter])
listDocuments_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocuments' {Maybe [DocumentKeyValuesFilter]
filters :: Maybe [DocumentKeyValuesFilter]
$sel:filters:ListDocuments' :: ListDocuments -> Maybe [DocumentKeyValuesFilter]
filters} -> Maybe [DocumentKeyValuesFilter]
filters) (\s :: ListDocuments
s@ListDocuments' {} Maybe [DocumentKeyValuesFilter]
a -> ListDocuments
s {$sel:filters:ListDocuments' :: Maybe [DocumentKeyValuesFilter]
filters = Maybe [DocumentKeyValuesFilter]
a} :: ListDocuments) 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 maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
listDocuments_maxResults :: Lens.Lens' ListDocuments (Prelude.Maybe Prelude.Natural)
listDocuments_maxResults :: Lens' ListDocuments (Maybe Natural)
listDocuments_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocuments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDocuments' :: ListDocuments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDocuments
s@ListDocuments' {} Maybe Natural
a -> ListDocuments
s {$sel:maxResults:ListDocuments' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDocuments)

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
listDocuments_nextToken :: Lens.Lens' ListDocuments (Prelude.Maybe Prelude.Text)
listDocuments_nextToken :: Lens' ListDocuments (Maybe Text)
listDocuments_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocuments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDocuments' :: ListDocuments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDocuments
s@ListDocuments' {} Maybe Text
a -> ListDocuments
s {$sel:nextToken:ListDocuments' :: Maybe Text
nextToken = Maybe Text
a} :: ListDocuments)

instance Core.AWSPager ListDocuments where
  page :: ListDocuments -> AWSResponse ListDocuments -> Maybe ListDocuments
page ListDocuments
rq AWSResponse ListDocuments
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDocuments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDocumentsResponse (Maybe Text)
listDocumentsResponse_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 ListDocuments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDocumentsResponse (Maybe [DocumentIdentifier])
listDocumentsResponse_documentIdentifiers
            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.$ ListDocuments
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDocuments (Maybe Text)
listDocuments_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDocuments
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDocumentsResponse (Maybe Text)
listDocumentsResponse_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 ListDocuments where
  type
    AWSResponse ListDocuments =
      ListDocumentsResponse
  request :: (Service -> Service) -> ListDocuments -> Request ListDocuments
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 ListDocuments
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDocuments)))
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 [DocumentIdentifier]
-> Maybe Text -> Int -> ListDocumentsResponse
ListDocumentsResponse'
            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
"DocumentIdentifiers"
                            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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListDocuments where
  hashWithSalt :: Int -> ListDocuments -> Int
hashWithSalt Int
_salt ListDocuments' {Maybe Natural
Maybe [DocumentKeyValuesFilter]
Maybe (NonEmpty DocumentFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [DocumentKeyValuesFilter]
documentFilterList :: Maybe (NonEmpty DocumentFilter)
$sel:nextToken:ListDocuments' :: ListDocuments -> Maybe Text
$sel:maxResults:ListDocuments' :: ListDocuments -> Maybe Natural
$sel:filters:ListDocuments' :: ListDocuments -> Maybe [DocumentKeyValuesFilter]
$sel:documentFilterList:ListDocuments' :: ListDocuments -> Maybe (NonEmpty DocumentFilter)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DocumentFilter)
documentFilterList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DocumentKeyValuesFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListDocuments where
  rnf :: ListDocuments -> ()
rnf ListDocuments' {Maybe Natural
Maybe [DocumentKeyValuesFilter]
Maybe (NonEmpty DocumentFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [DocumentKeyValuesFilter]
documentFilterList :: Maybe (NonEmpty DocumentFilter)
$sel:nextToken:ListDocuments' :: ListDocuments -> Maybe Text
$sel:maxResults:ListDocuments' :: ListDocuments -> Maybe Natural
$sel:filters:ListDocuments' :: ListDocuments -> Maybe [DocumentKeyValuesFilter]
$sel:documentFilterList:ListDocuments' :: ListDocuments -> Maybe (NonEmpty DocumentFilter)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty DocumentFilter)
documentFilterList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DocumentKeyValuesFilter]
filters
      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

instance Data.ToHeaders ListDocuments where
  toHeaders :: ListDocuments -> 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
"AmazonSSM.ListDocuments" :: 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 ListDocuments where
  toJSON :: ListDocuments -> Value
toJSON ListDocuments' {Maybe Natural
Maybe [DocumentKeyValuesFilter]
Maybe (NonEmpty DocumentFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [DocumentKeyValuesFilter]
documentFilterList :: Maybe (NonEmpty DocumentFilter)
$sel:nextToken:ListDocuments' :: ListDocuments -> Maybe Text
$sel:maxResults:ListDocuments' :: ListDocuments -> Maybe Natural
$sel:filters:ListDocuments' :: ListDocuments -> Maybe [DocumentKeyValuesFilter]
$sel:documentFilterList:ListDocuments' :: ListDocuments -> Maybe (NonEmpty DocumentFilter)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DocumentFilterList" 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 (NonEmpty DocumentFilter)
documentFilterList,
            (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 [DocumentKeyValuesFilter]
filters,
            (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
          ]
      )

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

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

-- | /See:/ 'newListDocumentsResponse' smart constructor.
data ListDocumentsResponse = ListDocumentsResponse'
  { -- | The names of the SSM documents.
    ListDocumentsResponse -> Maybe [DocumentIdentifier]
documentIdentifiers :: Prelude.Maybe [DocumentIdentifier],
    -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    ListDocumentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDocumentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDocumentsResponse -> ListDocumentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
$c/= :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
== :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
$c== :: ListDocumentsResponse -> ListDocumentsResponse -> Bool
Prelude.Eq, ReadPrec [ListDocumentsResponse]
ReadPrec ListDocumentsResponse
Int -> ReadS ListDocumentsResponse
ReadS [ListDocumentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDocumentsResponse]
$creadListPrec :: ReadPrec [ListDocumentsResponse]
readPrec :: ReadPrec ListDocumentsResponse
$creadPrec :: ReadPrec ListDocumentsResponse
readList :: ReadS [ListDocumentsResponse]
$creadList :: ReadS [ListDocumentsResponse]
readsPrec :: Int -> ReadS ListDocumentsResponse
$creadsPrec :: Int -> ReadS ListDocumentsResponse
Prelude.Read, Int -> ListDocumentsResponse -> ShowS
[ListDocumentsResponse] -> ShowS
ListDocumentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDocumentsResponse] -> ShowS
$cshowList :: [ListDocumentsResponse] -> ShowS
show :: ListDocumentsResponse -> String
$cshow :: ListDocumentsResponse -> String
showsPrec :: Int -> ListDocumentsResponse -> ShowS
$cshowsPrec :: Int -> ListDocumentsResponse -> ShowS
Prelude.Show, forall x. Rep ListDocumentsResponse x -> ListDocumentsResponse
forall x. ListDocumentsResponse -> Rep ListDocumentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDocumentsResponse x -> ListDocumentsResponse
$cfrom :: forall x. ListDocumentsResponse -> Rep ListDocumentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDocumentsResponse' 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:
--
-- 'documentIdentifiers', 'listDocumentsResponse_documentIdentifiers' - The names of the SSM documents.
--
-- 'nextToken', 'listDocumentsResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'httpStatus', 'listDocumentsResponse_httpStatus' - The response's http status code.
newListDocumentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDocumentsResponse
newListDocumentsResponse :: Int -> ListDocumentsResponse
newListDocumentsResponse Int
pHttpStatus_ =
  ListDocumentsResponse'
    { $sel:documentIdentifiers:ListDocumentsResponse' :: Maybe [DocumentIdentifier]
documentIdentifiers =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDocumentsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDocumentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The names of the SSM documents.
listDocumentsResponse_documentIdentifiers :: Lens.Lens' ListDocumentsResponse (Prelude.Maybe [DocumentIdentifier])
listDocumentsResponse_documentIdentifiers :: Lens' ListDocumentsResponse (Maybe [DocumentIdentifier])
listDocumentsResponse_documentIdentifiers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentsResponse' {Maybe [DocumentIdentifier]
documentIdentifiers :: Maybe [DocumentIdentifier]
$sel:documentIdentifiers:ListDocumentsResponse' :: ListDocumentsResponse -> Maybe [DocumentIdentifier]
documentIdentifiers} -> Maybe [DocumentIdentifier]
documentIdentifiers) (\s :: ListDocumentsResponse
s@ListDocumentsResponse' {} Maybe [DocumentIdentifier]
a -> ListDocumentsResponse
s {$sel:documentIdentifiers:ListDocumentsResponse' :: Maybe [DocumentIdentifier]
documentIdentifiers = Maybe [DocumentIdentifier]
a} :: ListDocumentsResponse) 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 token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
listDocumentsResponse_nextToken :: Lens.Lens' ListDocumentsResponse (Prelude.Maybe Prelude.Text)
listDocumentsResponse_nextToken :: Lens' ListDocumentsResponse (Maybe Text)
listDocumentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDocumentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDocumentsResponse' :: ListDocumentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDocumentsResponse
s@ListDocumentsResponse' {} Maybe Text
a -> ListDocumentsResponse
s {$sel:nextToken:ListDocumentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDocumentsResponse)

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

instance Prelude.NFData ListDocumentsResponse where
  rnf :: ListDocumentsResponse -> ()
rnf ListDocumentsResponse' {Int
Maybe [DocumentIdentifier]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
documentIdentifiers :: Maybe [DocumentIdentifier]
$sel:httpStatus:ListDocumentsResponse' :: ListDocumentsResponse -> Int
$sel:nextToken:ListDocumentsResponse' :: ListDocumentsResponse -> Maybe Text
$sel:documentIdentifiers:ListDocumentsResponse' :: ListDocumentsResponse -> Maybe [DocumentIdentifier]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DocumentIdentifier]
documentIdentifiers
      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 Int
httpStatus