{-# 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.ListLoggerDefinitions
-- 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)
--
-- Retrieves a list of logger definitions.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListLoggerDefinitions
  ( -- * Creating a Request
    ListLoggerDefinitions (..),
    newListLoggerDefinitions,

    -- * Request Lenses
    listLoggerDefinitions_nextToken,
    listLoggerDefinitions_maxResults,

    -- * Destructuring the Response
    ListLoggerDefinitionsResponse (..),
    newListLoggerDefinitionsResponse,

    -- * Response Lenses
    listLoggerDefinitionsResponse_nextToken,
    listLoggerDefinitionsResponse_definitions,
    listLoggerDefinitionsResponse_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:/ 'newListLoggerDefinitions' smart constructor.
data ListLoggerDefinitions = ListLoggerDefinitions'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListLoggerDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListLoggerDefinitions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text
  }
  deriving (ListLoggerDefinitions -> ListLoggerDefinitions -> Bool
(ListLoggerDefinitions -> ListLoggerDefinitions -> Bool)
-> (ListLoggerDefinitions -> ListLoggerDefinitions -> Bool)
-> Eq ListLoggerDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLoggerDefinitions -> ListLoggerDefinitions -> Bool
$c/= :: ListLoggerDefinitions -> ListLoggerDefinitions -> Bool
== :: ListLoggerDefinitions -> ListLoggerDefinitions -> Bool
$c== :: ListLoggerDefinitions -> ListLoggerDefinitions -> Bool
Prelude.Eq, ReadPrec [ListLoggerDefinitions]
ReadPrec ListLoggerDefinitions
Int -> ReadS ListLoggerDefinitions
ReadS [ListLoggerDefinitions]
(Int -> ReadS ListLoggerDefinitions)
-> ReadS [ListLoggerDefinitions]
-> ReadPrec ListLoggerDefinitions
-> ReadPrec [ListLoggerDefinitions]
-> Read ListLoggerDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLoggerDefinitions]
$creadListPrec :: ReadPrec [ListLoggerDefinitions]
readPrec :: ReadPrec ListLoggerDefinitions
$creadPrec :: ReadPrec ListLoggerDefinitions
readList :: ReadS [ListLoggerDefinitions]
$creadList :: ReadS [ListLoggerDefinitions]
readsPrec :: Int -> ReadS ListLoggerDefinitions
$creadsPrec :: Int -> ReadS ListLoggerDefinitions
Prelude.Read, Int -> ListLoggerDefinitions -> ShowS
[ListLoggerDefinitions] -> ShowS
ListLoggerDefinitions -> String
(Int -> ListLoggerDefinitions -> ShowS)
-> (ListLoggerDefinitions -> String)
-> ([ListLoggerDefinitions] -> ShowS)
-> Show ListLoggerDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLoggerDefinitions] -> ShowS
$cshowList :: [ListLoggerDefinitions] -> ShowS
show :: ListLoggerDefinitions -> String
$cshow :: ListLoggerDefinitions -> String
showsPrec :: Int -> ListLoggerDefinitions -> ShowS
$cshowsPrec :: Int -> ListLoggerDefinitions -> ShowS
Prelude.Show, (forall x. ListLoggerDefinitions -> Rep ListLoggerDefinitions x)
-> (forall x. Rep ListLoggerDefinitions x -> ListLoggerDefinitions)
-> Generic ListLoggerDefinitions
forall x. Rep ListLoggerDefinitions x -> ListLoggerDefinitions
forall x. ListLoggerDefinitions -> Rep ListLoggerDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLoggerDefinitions x -> ListLoggerDefinitions
$cfrom :: forall x. ListLoggerDefinitions -> Rep ListLoggerDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListLoggerDefinitions' 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', 'listLoggerDefinitions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listLoggerDefinitions_maxResults' - The maximum number of results to be returned per request.
newListLoggerDefinitions ::
  ListLoggerDefinitions
newListLoggerDefinitions :: ListLoggerDefinitions
newListLoggerDefinitions =
  ListLoggerDefinitions' :: Maybe Text -> Maybe Text -> ListLoggerDefinitions
ListLoggerDefinitions'
    { $sel:nextToken:ListLoggerDefinitions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListLoggerDefinitions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.AWSPager ListLoggerDefinitions where
  page :: ListLoggerDefinitions
-> AWSResponse ListLoggerDefinitions -> Maybe ListLoggerDefinitions
page ListLoggerDefinitions
rq AWSResponse ListLoggerDefinitions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLoggerDefinitions
ListLoggerDefinitionsResponse
rs
            ListLoggerDefinitionsResponse
-> Getting (First Text) ListLoggerDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLoggerDefinitionsResponse
-> Const (First Text) ListLoggerDefinitionsResponse
Lens' ListLoggerDefinitionsResponse (Maybe Text)
listLoggerDefinitionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLoggerDefinitionsResponse
 -> Const (First Text) ListLoggerDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLoggerDefinitionsResponse 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 ListLoggerDefinitions
forall a. Maybe a
Prelude.Nothing
    | Maybe [DefinitionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLoggerDefinitions
ListLoggerDefinitionsResponse
rs
            ListLoggerDefinitionsResponse
-> Getting
     (First [DefinitionInformation])
     ListLoggerDefinitionsResponse
     [DefinitionInformation]
-> Maybe [DefinitionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DefinitionInformation]
 -> Const
      (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
-> ListLoggerDefinitionsResponse
-> Const
     (First [DefinitionInformation]) ListLoggerDefinitionsResponse
Lens' ListLoggerDefinitionsResponse (Maybe [DefinitionInformation])
listLoggerDefinitionsResponse_definitions
              ((Maybe [DefinitionInformation]
  -> Const
       (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
 -> ListLoggerDefinitionsResponse
 -> Const
      (First [DefinitionInformation]) ListLoggerDefinitionsResponse)
-> (([DefinitionInformation]
     -> Const (First [DefinitionInformation]) [DefinitionInformation])
    -> Maybe [DefinitionInformation]
    -> Const
         (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
-> Getting
     (First [DefinitionInformation])
     ListLoggerDefinitionsResponse
     [DefinitionInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DefinitionInformation]
 -> Const (First [DefinitionInformation]) [DefinitionInformation])
-> Maybe [DefinitionInformation]
-> Const
     (First [DefinitionInformation]) (Maybe [DefinitionInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListLoggerDefinitions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListLoggerDefinitions -> Maybe ListLoggerDefinitions
forall a. a -> Maybe a
Prelude.Just (ListLoggerDefinitions -> Maybe ListLoggerDefinitions)
-> ListLoggerDefinitions -> Maybe ListLoggerDefinitions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListLoggerDefinitions
rq
          ListLoggerDefinitions
-> (ListLoggerDefinitions -> ListLoggerDefinitions)
-> ListLoggerDefinitions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListLoggerDefinitions -> Identity ListLoggerDefinitions
Lens
  ListLoggerDefinitions
  ListLoggerDefinitions
  (Maybe Text)
  (Maybe Text)
listLoggerDefinitions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListLoggerDefinitions -> Identity ListLoggerDefinitions)
-> Maybe Text -> ListLoggerDefinitions -> ListLoggerDefinitions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLoggerDefinitions
ListLoggerDefinitionsResponse
rs
          ListLoggerDefinitionsResponse
-> Getting (First Text) ListLoggerDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLoggerDefinitionsResponse
-> Const (First Text) ListLoggerDefinitionsResponse
Lens' ListLoggerDefinitionsResponse (Maybe Text)
listLoggerDefinitionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLoggerDefinitionsResponse
 -> Const (First Text) ListLoggerDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLoggerDefinitionsResponse 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 ListLoggerDefinitions where
  type
    AWSResponse ListLoggerDefinitions =
      ListLoggerDefinitionsResponse
  request :: ListLoggerDefinitions -> Request ListLoggerDefinitions
request = Service -> ListLoggerDefinitions -> Request ListLoggerDefinitions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListLoggerDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListLoggerDefinitions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListLoggerDefinitions))
-> Logger
-> Service
-> Proxy ListLoggerDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListLoggerDefinitions)))
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 Text
-> Maybe [DefinitionInformation]
-> Int
-> ListLoggerDefinitionsResponse
ListLoggerDefinitionsResponse'
            (Maybe Text
 -> Maybe [DefinitionInformation]
 -> Int
 -> ListLoggerDefinitionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DefinitionInformation]
      -> Int -> ListLoggerDefinitionsResponse)
forall (f :: * -> *) a b. Functor 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
  (Maybe [DefinitionInformation]
   -> Int -> ListLoggerDefinitionsResponse)
-> Either String (Maybe [DefinitionInformation])
-> Either String (Int -> ListLoggerDefinitionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [DefinitionInformation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Definitions" Either String (Maybe (Maybe [DefinitionInformation]))
-> Maybe [DefinitionInformation]
-> Either String (Maybe [DefinitionInformation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DefinitionInformation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListLoggerDefinitionsResponse)
-> Either String Int -> Either String ListLoggerDefinitionsResponse
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 ListLoggerDefinitions

instance Prelude.NFData ListLoggerDefinitions

instance Core.ToHeaders ListLoggerDefinitions where
  toHeaders :: ListLoggerDefinitions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListLoggerDefinitions -> 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 ListLoggerDefinitions where
  toPath :: ListLoggerDefinitions -> ByteString
toPath =
    ByteString -> ListLoggerDefinitions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/greengrass/definition/loggers"

instance Core.ToQuery ListLoggerDefinitions where
  toQuery :: ListLoggerDefinitions -> QueryString
toQuery ListLoggerDefinitions' {Maybe Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListLoggerDefinitions' :: ListLoggerDefinitions -> Maybe Text
$sel:nextToken:ListLoggerDefinitions' :: ListLoggerDefinitions -> 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:/ 'newListLoggerDefinitionsResponse' smart constructor.
data ListLoggerDefinitionsResponse = ListLoggerDefinitionsResponse'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListLoggerDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about a definition.
    ListLoggerDefinitionsResponse -> Maybe [DefinitionInformation]
definitions :: Prelude.Maybe [DefinitionInformation],
    -- | The response's http status code.
    ListLoggerDefinitionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLoggerDefinitionsResponse
-> ListLoggerDefinitionsResponse -> Bool
(ListLoggerDefinitionsResponse
 -> ListLoggerDefinitionsResponse -> Bool)
-> (ListLoggerDefinitionsResponse
    -> ListLoggerDefinitionsResponse -> Bool)
-> Eq ListLoggerDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLoggerDefinitionsResponse
-> ListLoggerDefinitionsResponse -> Bool
$c/= :: ListLoggerDefinitionsResponse
-> ListLoggerDefinitionsResponse -> Bool
== :: ListLoggerDefinitionsResponse
-> ListLoggerDefinitionsResponse -> Bool
$c== :: ListLoggerDefinitionsResponse
-> ListLoggerDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [ListLoggerDefinitionsResponse]
ReadPrec ListLoggerDefinitionsResponse
Int -> ReadS ListLoggerDefinitionsResponse
ReadS [ListLoggerDefinitionsResponse]
(Int -> ReadS ListLoggerDefinitionsResponse)
-> ReadS [ListLoggerDefinitionsResponse]
-> ReadPrec ListLoggerDefinitionsResponse
-> ReadPrec [ListLoggerDefinitionsResponse]
-> Read ListLoggerDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLoggerDefinitionsResponse]
$creadListPrec :: ReadPrec [ListLoggerDefinitionsResponse]
readPrec :: ReadPrec ListLoggerDefinitionsResponse
$creadPrec :: ReadPrec ListLoggerDefinitionsResponse
readList :: ReadS [ListLoggerDefinitionsResponse]
$creadList :: ReadS [ListLoggerDefinitionsResponse]
readsPrec :: Int -> ReadS ListLoggerDefinitionsResponse
$creadsPrec :: Int -> ReadS ListLoggerDefinitionsResponse
Prelude.Read, Int -> ListLoggerDefinitionsResponse -> ShowS
[ListLoggerDefinitionsResponse] -> ShowS
ListLoggerDefinitionsResponse -> String
(Int -> ListLoggerDefinitionsResponse -> ShowS)
-> (ListLoggerDefinitionsResponse -> String)
-> ([ListLoggerDefinitionsResponse] -> ShowS)
-> Show ListLoggerDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLoggerDefinitionsResponse] -> ShowS
$cshowList :: [ListLoggerDefinitionsResponse] -> ShowS
show :: ListLoggerDefinitionsResponse -> String
$cshow :: ListLoggerDefinitionsResponse -> String
showsPrec :: Int -> ListLoggerDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> ListLoggerDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 ListLoggerDefinitionsResponse
 -> Rep ListLoggerDefinitionsResponse x)
-> (forall x.
    Rep ListLoggerDefinitionsResponse x
    -> ListLoggerDefinitionsResponse)
-> Generic ListLoggerDefinitionsResponse
forall x.
Rep ListLoggerDefinitionsResponse x
-> ListLoggerDefinitionsResponse
forall x.
ListLoggerDefinitionsResponse
-> Rep ListLoggerDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLoggerDefinitionsResponse x
-> ListLoggerDefinitionsResponse
$cfrom :: forall x.
ListLoggerDefinitionsResponse
-> Rep ListLoggerDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLoggerDefinitionsResponse' 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', 'listLoggerDefinitionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'definitions', 'listLoggerDefinitionsResponse_definitions' - Information about a definition.
--
-- 'httpStatus', 'listLoggerDefinitionsResponse_httpStatus' - The response's http status code.
newListLoggerDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLoggerDefinitionsResponse
newListLoggerDefinitionsResponse :: Int -> ListLoggerDefinitionsResponse
newListLoggerDefinitionsResponse Int
pHttpStatus_ =
  ListLoggerDefinitionsResponse' :: Maybe Text
-> Maybe [DefinitionInformation]
-> Int
-> ListLoggerDefinitionsResponse
ListLoggerDefinitionsResponse'
    { $sel:nextToken:ListLoggerDefinitionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:definitions:ListLoggerDefinitionsResponse' :: Maybe [DefinitionInformation]
definitions = Maybe [DefinitionInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLoggerDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

instance Prelude.NFData ListLoggerDefinitionsResponse