{-# 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.Greengrass.ListLoggerDefinitionVersions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the versions of a logger definition.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListLoggerDefinitionVersions
  ( -- * Creating a Request
    ListLoggerDefinitionVersions (..),
    newListLoggerDefinitionVersions,

    -- * Request Lenses
    listLoggerDefinitionVersions_nextToken,
    listLoggerDefinitionVersions_maxResults,
    listLoggerDefinitionVersions_loggerDefinitionId,

    -- * Destructuring the Response
    ListLoggerDefinitionVersionsResponse (..),
    newListLoggerDefinitionVersionsResponse,

    -- * Response Lenses
    listLoggerDefinitionVersionsResponse_versions,
    listLoggerDefinitionVersionsResponse_nextToken,
    listLoggerDefinitionVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListLoggerDefinitionVersions' smart constructor.
data ListLoggerDefinitionVersions = ListLoggerDefinitionVersions'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListLoggerDefinitionVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListLoggerDefinitionVersions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The ID of the logger definition.
    ListLoggerDefinitionVersions -> Text
loggerDefinitionId :: Prelude.Text
  }
  deriving (ListLoggerDefinitionVersions
-> ListLoggerDefinitionVersions -> Bool
(ListLoggerDefinitionVersions
 -> ListLoggerDefinitionVersions -> Bool)
-> (ListLoggerDefinitionVersions
    -> ListLoggerDefinitionVersions -> Bool)
-> Eq ListLoggerDefinitionVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLoggerDefinitionVersions
-> ListLoggerDefinitionVersions -> Bool
$c/= :: ListLoggerDefinitionVersions
-> ListLoggerDefinitionVersions -> Bool
== :: ListLoggerDefinitionVersions
-> ListLoggerDefinitionVersions -> Bool
$c== :: ListLoggerDefinitionVersions
-> ListLoggerDefinitionVersions -> Bool
Prelude.Eq, ReadPrec [ListLoggerDefinitionVersions]
ReadPrec ListLoggerDefinitionVersions
Int -> ReadS ListLoggerDefinitionVersions
ReadS [ListLoggerDefinitionVersions]
(Int -> ReadS ListLoggerDefinitionVersions)
-> ReadS [ListLoggerDefinitionVersions]
-> ReadPrec ListLoggerDefinitionVersions
-> ReadPrec [ListLoggerDefinitionVersions]
-> Read ListLoggerDefinitionVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLoggerDefinitionVersions]
$creadListPrec :: ReadPrec [ListLoggerDefinitionVersions]
readPrec :: ReadPrec ListLoggerDefinitionVersions
$creadPrec :: ReadPrec ListLoggerDefinitionVersions
readList :: ReadS [ListLoggerDefinitionVersions]
$creadList :: ReadS [ListLoggerDefinitionVersions]
readsPrec :: Int -> ReadS ListLoggerDefinitionVersions
$creadsPrec :: Int -> ReadS ListLoggerDefinitionVersions
Prelude.Read, Int -> ListLoggerDefinitionVersions -> ShowS
[ListLoggerDefinitionVersions] -> ShowS
ListLoggerDefinitionVersions -> String
(Int -> ListLoggerDefinitionVersions -> ShowS)
-> (ListLoggerDefinitionVersions -> String)
-> ([ListLoggerDefinitionVersions] -> ShowS)
-> Show ListLoggerDefinitionVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLoggerDefinitionVersions] -> ShowS
$cshowList :: [ListLoggerDefinitionVersions] -> ShowS
show :: ListLoggerDefinitionVersions -> String
$cshow :: ListLoggerDefinitionVersions -> String
showsPrec :: Int -> ListLoggerDefinitionVersions -> ShowS
$cshowsPrec :: Int -> ListLoggerDefinitionVersions -> ShowS
Prelude.Show, (forall x.
 ListLoggerDefinitionVersions -> Rep ListLoggerDefinitionVersions x)
-> (forall x.
    Rep ListLoggerDefinitionVersions x -> ListLoggerDefinitionVersions)
-> Generic ListLoggerDefinitionVersions
forall x.
Rep ListLoggerDefinitionVersions x -> ListLoggerDefinitionVersions
forall x.
ListLoggerDefinitionVersions -> Rep ListLoggerDefinitionVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLoggerDefinitionVersions x -> ListLoggerDefinitionVersions
$cfrom :: forall x.
ListLoggerDefinitionVersions -> Rep ListLoggerDefinitionVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListLoggerDefinitionVersions' 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', 'listLoggerDefinitionVersions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listLoggerDefinitionVersions_maxResults' - The maximum number of results to be returned per request.
--
-- 'loggerDefinitionId', 'listLoggerDefinitionVersions_loggerDefinitionId' - The ID of the logger definition.
newListLoggerDefinitionVersions ::
  -- | 'loggerDefinitionId'
  Prelude.Text ->
  ListLoggerDefinitionVersions
newListLoggerDefinitionVersions :: Text -> ListLoggerDefinitionVersions
newListLoggerDefinitionVersions Text
pLoggerDefinitionId_ =
  ListLoggerDefinitionVersions' :: Maybe Text -> Maybe Text -> Text -> ListLoggerDefinitionVersions
ListLoggerDefinitionVersions'
    { $sel:nextToken:ListLoggerDefinitionVersions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListLoggerDefinitionVersions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:loggerDefinitionId:ListLoggerDefinitionVersions' :: Text
loggerDefinitionId = Text
pLoggerDefinitionId_
    }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listLoggerDefinitionVersions_nextToken :: Lens.Lens' ListLoggerDefinitionVersions (Prelude.Maybe Prelude.Text)
listLoggerDefinitionVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLoggerDefinitionVersions -> f ListLoggerDefinitionVersions
listLoggerDefinitionVersions_nextToken = (ListLoggerDefinitionVersions -> Maybe Text)
-> (ListLoggerDefinitionVersions
    -> Maybe Text -> ListLoggerDefinitionVersions)
-> Lens
     ListLoggerDefinitionVersions
     ListLoggerDefinitionVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggerDefinitionVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLoggerDefinitionVersions
s@ListLoggerDefinitionVersions' {} Maybe Text
a -> ListLoggerDefinitionVersions
s {$sel:nextToken:ListLoggerDefinitionVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListLoggerDefinitionVersions)

-- | The maximum number of results to be returned per request.
listLoggerDefinitionVersions_maxResults :: Lens.Lens' ListLoggerDefinitionVersions (Prelude.Maybe Prelude.Text)
listLoggerDefinitionVersions_maxResults :: (Maybe Text -> f (Maybe Text))
-> ListLoggerDefinitionVersions -> f ListLoggerDefinitionVersions
listLoggerDefinitionVersions_maxResults = (ListLoggerDefinitionVersions -> Maybe Text)
-> (ListLoggerDefinitionVersions
    -> Maybe Text -> ListLoggerDefinitionVersions)
-> Lens
     ListLoggerDefinitionVersions
     ListLoggerDefinitionVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggerDefinitionVersions' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListLoggerDefinitionVersions
s@ListLoggerDefinitionVersions' {} Maybe Text
a -> ListLoggerDefinitionVersions
s {$sel:maxResults:ListLoggerDefinitionVersions' :: Maybe Text
maxResults = Maybe Text
a} :: ListLoggerDefinitionVersions)

-- | The ID of the logger definition.
listLoggerDefinitionVersions_loggerDefinitionId :: Lens.Lens' ListLoggerDefinitionVersions Prelude.Text
listLoggerDefinitionVersions_loggerDefinitionId :: (Text -> f Text)
-> ListLoggerDefinitionVersions -> f ListLoggerDefinitionVersions
listLoggerDefinitionVersions_loggerDefinitionId = (ListLoggerDefinitionVersions -> Text)
-> (ListLoggerDefinitionVersions
    -> Text -> ListLoggerDefinitionVersions)
-> Lens
     ListLoggerDefinitionVersions ListLoggerDefinitionVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggerDefinitionVersions' {Text
loggerDefinitionId :: Text
$sel:loggerDefinitionId:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Text
loggerDefinitionId} -> Text
loggerDefinitionId) (\s :: ListLoggerDefinitionVersions
s@ListLoggerDefinitionVersions' {} Text
a -> ListLoggerDefinitionVersions
s {$sel:loggerDefinitionId:ListLoggerDefinitionVersions' :: Text
loggerDefinitionId = Text
a} :: ListLoggerDefinitionVersions)

instance Core.AWSPager ListLoggerDefinitionVersions where
  page :: ListLoggerDefinitionVersions
-> AWSResponse ListLoggerDefinitionVersions
-> Maybe ListLoggerDefinitionVersions
page ListLoggerDefinitionVersions
rq AWSResponse ListLoggerDefinitionVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLoggerDefinitionVersions
ListLoggerDefinitionVersionsResponse
rs
            ListLoggerDefinitionVersionsResponse
-> Getting (First Text) ListLoggerDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLoggerDefinitionVersionsResponse
-> Const (First Text) ListLoggerDefinitionVersionsResponse
Lens' ListLoggerDefinitionVersionsResponse (Maybe Text)
listLoggerDefinitionVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLoggerDefinitionVersionsResponse
 -> Const (First Text) ListLoggerDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLoggerDefinitionVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListLoggerDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [VersionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLoggerDefinitionVersions
ListLoggerDefinitionVersionsResponse
rs
            ListLoggerDefinitionVersionsResponse
-> Getting
     (First [VersionInformation])
     ListLoggerDefinitionVersionsResponse
     [VersionInformation]
-> Maybe [VersionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [VersionInformation]
 -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> ListLoggerDefinitionVersionsResponse
-> Const
     (First [VersionInformation]) ListLoggerDefinitionVersionsResponse
Lens'
  ListLoggerDefinitionVersionsResponse (Maybe [VersionInformation])
listLoggerDefinitionVersionsResponse_versions
              ((Maybe [VersionInformation]
  -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
 -> ListLoggerDefinitionVersionsResponse
 -> Const
      (First [VersionInformation]) ListLoggerDefinitionVersionsResponse)
-> (([VersionInformation]
     -> Const (First [VersionInformation]) [VersionInformation])
    -> Maybe [VersionInformation]
    -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> Getting
     (First [VersionInformation])
     ListLoggerDefinitionVersionsResponse
     [VersionInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([VersionInformation]
 -> Const (First [VersionInformation]) [VersionInformation])
-> Maybe [VersionInformation]
-> Const (First [VersionInformation]) (Maybe [VersionInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListLoggerDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListLoggerDefinitionVersions -> Maybe ListLoggerDefinitionVersions
forall a. a -> Maybe a
Prelude.Just (ListLoggerDefinitionVersions
 -> Maybe ListLoggerDefinitionVersions)
-> ListLoggerDefinitionVersions
-> Maybe ListLoggerDefinitionVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListLoggerDefinitionVersions
rq
          ListLoggerDefinitionVersions
-> (ListLoggerDefinitionVersions -> ListLoggerDefinitionVersions)
-> ListLoggerDefinitionVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListLoggerDefinitionVersions
-> Identity ListLoggerDefinitionVersions
Lens
  ListLoggerDefinitionVersions
  ListLoggerDefinitionVersions
  (Maybe Text)
  (Maybe Text)
listLoggerDefinitionVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListLoggerDefinitionVersions
 -> Identity ListLoggerDefinitionVersions)
-> Maybe Text
-> ListLoggerDefinitionVersions
-> ListLoggerDefinitionVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLoggerDefinitionVersions
ListLoggerDefinitionVersionsResponse
rs
          ListLoggerDefinitionVersionsResponse
-> Getting (First Text) ListLoggerDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLoggerDefinitionVersionsResponse
-> Const (First Text) ListLoggerDefinitionVersionsResponse
Lens' ListLoggerDefinitionVersionsResponse (Maybe Text)
listLoggerDefinitionVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLoggerDefinitionVersionsResponse
 -> Const (First Text) ListLoggerDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLoggerDefinitionVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListLoggerDefinitionVersions where
  type
    AWSResponse ListLoggerDefinitionVersions =
      ListLoggerDefinitionVersionsResponse
  request :: ListLoggerDefinitionVersions
-> Request ListLoggerDefinitionVersions
request = Service
-> ListLoggerDefinitionVersions
-> Request ListLoggerDefinitionVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListLoggerDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListLoggerDefinitionVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListLoggerDefinitionVersions))
-> Logger
-> Service
-> Proxy ListLoggerDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListLoggerDefinitionVersions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [VersionInformation]
-> Maybe Text -> Int -> ListLoggerDefinitionVersionsResponse
ListLoggerDefinitionVersionsResponse'
            (Maybe [VersionInformation]
 -> Maybe Text -> Int -> ListLoggerDefinitionVersionsResponse)
-> Either String (Maybe [VersionInformation])
-> Either
     String (Maybe Text -> Int -> ListLoggerDefinitionVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [VersionInformation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Versions" Either String (Maybe (Maybe [VersionInformation]))
-> Maybe [VersionInformation]
-> Either String (Maybe [VersionInformation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VersionInformation]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> ListLoggerDefinitionVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListLoggerDefinitionVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> ListLoggerDefinitionVersionsResponse)
-> Either String Int
-> Either String ListLoggerDefinitionVersionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListLoggerDefinitionVersions

instance Prelude.NFData ListLoggerDefinitionVersions

instance Core.ToHeaders ListLoggerDefinitionVersions where
  toHeaders :: ListLoggerDefinitionVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListLoggerDefinitionVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListLoggerDefinitionVersions where
  toPath :: ListLoggerDefinitionVersions -> ByteString
toPath ListLoggerDefinitionVersions' {Maybe Text
Text
loggerDefinitionId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:loggerDefinitionId:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Text
$sel:maxResults:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Maybe Text
$sel:nextToken:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/loggers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
loggerDefinitionId,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListLoggerDefinitionVersions where
  toQuery :: ListLoggerDefinitionVersions -> QueryString
toQuery ListLoggerDefinitionVersions' {Maybe Text
Text
loggerDefinitionId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:loggerDefinitionId:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Text
$sel:maxResults:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Maybe Text
$sel:nextToken:ListLoggerDefinitionVersions' :: ListLoggerDefinitionVersions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newListLoggerDefinitionVersionsResponse' smart constructor.
data ListLoggerDefinitionVersionsResponse = ListLoggerDefinitionVersionsResponse'
  { -- | Information about a version.
    ListLoggerDefinitionVersionsResponse -> Maybe [VersionInformation]
versions :: Prelude.Maybe [VersionInformation],
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListLoggerDefinitionVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListLoggerDefinitionVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLoggerDefinitionVersionsResponse
-> ListLoggerDefinitionVersionsResponse -> Bool
(ListLoggerDefinitionVersionsResponse
 -> ListLoggerDefinitionVersionsResponse -> Bool)
-> (ListLoggerDefinitionVersionsResponse
    -> ListLoggerDefinitionVersionsResponse -> Bool)
-> Eq ListLoggerDefinitionVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLoggerDefinitionVersionsResponse
-> ListLoggerDefinitionVersionsResponse -> Bool
$c/= :: ListLoggerDefinitionVersionsResponse
-> ListLoggerDefinitionVersionsResponse -> Bool
== :: ListLoggerDefinitionVersionsResponse
-> ListLoggerDefinitionVersionsResponse -> Bool
$c== :: ListLoggerDefinitionVersionsResponse
-> ListLoggerDefinitionVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListLoggerDefinitionVersionsResponse]
ReadPrec ListLoggerDefinitionVersionsResponse
Int -> ReadS ListLoggerDefinitionVersionsResponse
ReadS [ListLoggerDefinitionVersionsResponse]
(Int -> ReadS ListLoggerDefinitionVersionsResponse)
-> ReadS [ListLoggerDefinitionVersionsResponse]
-> ReadPrec ListLoggerDefinitionVersionsResponse
-> ReadPrec [ListLoggerDefinitionVersionsResponse]
-> Read ListLoggerDefinitionVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLoggerDefinitionVersionsResponse]
$creadListPrec :: ReadPrec [ListLoggerDefinitionVersionsResponse]
readPrec :: ReadPrec ListLoggerDefinitionVersionsResponse
$creadPrec :: ReadPrec ListLoggerDefinitionVersionsResponse
readList :: ReadS [ListLoggerDefinitionVersionsResponse]
$creadList :: ReadS [ListLoggerDefinitionVersionsResponse]
readsPrec :: Int -> ReadS ListLoggerDefinitionVersionsResponse
$creadsPrec :: Int -> ReadS ListLoggerDefinitionVersionsResponse
Prelude.Read, Int -> ListLoggerDefinitionVersionsResponse -> ShowS
[ListLoggerDefinitionVersionsResponse] -> ShowS
ListLoggerDefinitionVersionsResponse -> String
(Int -> ListLoggerDefinitionVersionsResponse -> ShowS)
-> (ListLoggerDefinitionVersionsResponse -> String)
-> ([ListLoggerDefinitionVersionsResponse] -> ShowS)
-> Show ListLoggerDefinitionVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLoggerDefinitionVersionsResponse] -> ShowS
$cshowList :: [ListLoggerDefinitionVersionsResponse] -> ShowS
show :: ListLoggerDefinitionVersionsResponse -> String
$cshow :: ListLoggerDefinitionVersionsResponse -> String
showsPrec :: Int -> ListLoggerDefinitionVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListLoggerDefinitionVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListLoggerDefinitionVersionsResponse
 -> Rep ListLoggerDefinitionVersionsResponse x)
-> (forall x.
    Rep ListLoggerDefinitionVersionsResponse x
    -> ListLoggerDefinitionVersionsResponse)
-> Generic ListLoggerDefinitionVersionsResponse
forall x.
Rep ListLoggerDefinitionVersionsResponse x
-> ListLoggerDefinitionVersionsResponse
forall x.
ListLoggerDefinitionVersionsResponse
-> Rep ListLoggerDefinitionVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLoggerDefinitionVersionsResponse x
-> ListLoggerDefinitionVersionsResponse
$cfrom :: forall x.
ListLoggerDefinitionVersionsResponse
-> Rep ListLoggerDefinitionVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLoggerDefinitionVersionsResponse' 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:
--
-- 'versions', 'listLoggerDefinitionVersionsResponse_versions' - Information about a version.
--
-- 'nextToken', 'listLoggerDefinitionVersionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'httpStatus', 'listLoggerDefinitionVersionsResponse_httpStatus' - The response's http status code.
newListLoggerDefinitionVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLoggerDefinitionVersionsResponse
newListLoggerDefinitionVersionsResponse :: Int -> ListLoggerDefinitionVersionsResponse
newListLoggerDefinitionVersionsResponse Int
pHttpStatus_ =
  ListLoggerDefinitionVersionsResponse' :: Maybe [VersionInformation]
-> Maybe Text -> Int -> ListLoggerDefinitionVersionsResponse
ListLoggerDefinitionVersionsResponse'
    { $sel:versions:ListLoggerDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions =
        Maybe [VersionInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLoggerDefinitionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLoggerDefinitionVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about a version.
listLoggerDefinitionVersionsResponse_versions :: Lens.Lens' ListLoggerDefinitionVersionsResponse (Prelude.Maybe [VersionInformation])
listLoggerDefinitionVersionsResponse_versions :: (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListLoggerDefinitionVersionsResponse
-> f ListLoggerDefinitionVersionsResponse
listLoggerDefinitionVersionsResponse_versions = (ListLoggerDefinitionVersionsResponse
 -> Maybe [VersionInformation])
-> (ListLoggerDefinitionVersionsResponse
    -> Maybe [VersionInformation]
    -> ListLoggerDefinitionVersionsResponse)
-> Lens'
     ListLoggerDefinitionVersionsResponse (Maybe [VersionInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggerDefinitionVersionsResponse' {Maybe [VersionInformation]
versions :: Maybe [VersionInformation]
$sel:versions:ListLoggerDefinitionVersionsResponse' :: ListLoggerDefinitionVersionsResponse -> Maybe [VersionInformation]
versions} -> Maybe [VersionInformation]
versions) (\s :: ListLoggerDefinitionVersionsResponse
s@ListLoggerDefinitionVersionsResponse' {} Maybe [VersionInformation]
a -> ListLoggerDefinitionVersionsResponse
s {$sel:versions:ListLoggerDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions = Maybe [VersionInformation]
a} :: ListLoggerDefinitionVersionsResponse) ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
 -> ListLoggerDefinitionVersionsResponse
 -> f ListLoggerDefinitionVersionsResponse)
-> ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
    -> Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListLoggerDefinitionVersionsResponse
-> f ListLoggerDefinitionVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
-> Iso
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
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 AnIso
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listLoggerDefinitionVersionsResponse_nextToken :: Lens.Lens' ListLoggerDefinitionVersionsResponse (Prelude.Maybe Prelude.Text)
listLoggerDefinitionVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLoggerDefinitionVersionsResponse
-> f ListLoggerDefinitionVersionsResponse
listLoggerDefinitionVersionsResponse_nextToken = (ListLoggerDefinitionVersionsResponse -> Maybe Text)
-> (ListLoggerDefinitionVersionsResponse
    -> Maybe Text -> ListLoggerDefinitionVersionsResponse)
-> Lens' ListLoggerDefinitionVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLoggerDefinitionVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLoggerDefinitionVersionsResponse' :: ListLoggerDefinitionVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLoggerDefinitionVersionsResponse
s@ListLoggerDefinitionVersionsResponse' {} Maybe Text
a -> ListLoggerDefinitionVersionsResponse
s {$sel:nextToken:ListLoggerDefinitionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLoggerDefinitionVersionsResponse)

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

instance
  Prelude.NFData
    ListLoggerDefinitionVersionsResponse