{-# 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.DirectoryService.ListLogSubscriptions
-- 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 active log subscriptions for the Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.DirectoryService.ListLogSubscriptions
  ( -- * Creating a Request
    ListLogSubscriptions (..),
    newListLogSubscriptions,

    -- * Request Lenses
    listLogSubscriptions_directoryId,
    listLogSubscriptions_nextToken,
    listLogSubscriptions_limit,

    -- * Destructuring the Response
    ListLogSubscriptionsResponse (..),
    newListLogSubscriptionsResponse,

    -- * Response Lenses
    listLogSubscriptionsResponse_nextToken,
    listLogSubscriptionsResponse_logSubscriptions,
    listLogSubscriptionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.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:/ 'newListLogSubscriptions' smart constructor.
data ListLogSubscriptions = ListLogSubscriptions'
  { -- | If a /DirectoryID/ is provided, lists only the log subscription
    -- associated with that directory. If no /DirectoryId/ is provided, lists
    -- all log subscriptions associated with your Amazon Web Services account.
    -- If there are no log subscriptions for the Amazon Web Services account or
    -- the directory, an empty list will be returned.
    ListLogSubscriptions -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of items to return.
    ListLogSubscriptions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items returned.
    ListLogSubscriptions -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListLogSubscriptions -> ListLogSubscriptions -> Bool
(ListLogSubscriptions -> ListLogSubscriptions -> Bool)
-> (ListLogSubscriptions -> ListLogSubscriptions -> Bool)
-> Eq ListLogSubscriptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLogSubscriptions -> ListLogSubscriptions -> Bool
$c/= :: ListLogSubscriptions -> ListLogSubscriptions -> Bool
== :: ListLogSubscriptions -> ListLogSubscriptions -> Bool
$c== :: ListLogSubscriptions -> ListLogSubscriptions -> Bool
Prelude.Eq, ReadPrec [ListLogSubscriptions]
ReadPrec ListLogSubscriptions
Int -> ReadS ListLogSubscriptions
ReadS [ListLogSubscriptions]
(Int -> ReadS ListLogSubscriptions)
-> ReadS [ListLogSubscriptions]
-> ReadPrec ListLogSubscriptions
-> ReadPrec [ListLogSubscriptions]
-> Read ListLogSubscriptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLogSubscriptions]
$creadListPrec :: ReadPrec [ListLogSubscriptions]
readPrec :: ReadPrec ListLogSubscriptions
$creadPrec :: ReadPrec ListLogSubscriptions
readList :: ReadS [ListLogSubscriptions]
$creadList :: ReadS [ListLogSubscriptions]
readsPrec :: Int -> ReadS ListLogSubscriptions
$creadsPrec :: Int -> ReadS ListLogSubscriptions
Prelude.Read, Int -> ListLogSubscriptions -> ShowS
[ListLogSubscriptions] -> ShowS
ListLogSubscriptions -> String
(Int -> ListLogSubscriptions -> ShowS)
-> (ListLogSubscriptions -> String)
-> ([ListLogSubscriptions] -> ShowS)
-> Show ListLogSubscriptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLogSubscriptions] -> ShowS
$cshowList :: [ListLogSubscriptions] -> ShowS
show :: ListLogSubscriptions -> String
$cshow :: ListLogSubscriptions -> String
showsPrec :: Int -> ListLogSubscriptions -> ShowS
$cshowsPrec :: Int -> ListLogSubscriptions -> ShowS
Prelude.Show, (forall x. ListLogSubscriptions -> Rep ListLogSubscriptions x)
-> (forall x. Rep ListLogSubscriptions x -> ListLogSubscriptions)
-> Generic ListLogSubscriptions
forall x. Rep ListLogSubscriptions x -> ListLogSubscriptions
forall x. ListLogSubscriptions -> Rep ListLogSubscriptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLogSubscriptions x -> ListLogSubscriptions
$cfrom :: forall x. ListLogSubscriptions -> Rep ListLogSubscriptions x
Prelude.Generic)

-- |
-- Create a value of 'ListLogSubscriptions' 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:
--
-- 'directoryId', 'listLogSubscriptions_directoryId' - If a /DirectoryID/ is provided, lists only the log subscription
-- associated with that directory. If no /DirectoryId/ is provided, lists
-- all log subscriptions associated with your Amazon Web Services account.
-- If there are no log subscriptions for the Amazon Web Services account or
-- the directory, an empty list will be returned.
--
-- 'nextToken', 'listLogSubscriptions_nextToken' - The token for the next set of items to return.
--
-- 'limit', 'listLogSubscriptions_limit' - The maximum number of items returned.
newListLogSubscriptions ::
  ListLogSubscriptions
newListLogSubscriptions :: ListLogSubscriptions
newListLogSubscriptions =
  ListLogSubscriptions' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListLogSubscriptions
ListLogSubscriptions'
    { $sel:directoryId:ListLogSubscriptions' :: Maybe Text
directoryId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLogSubscriptions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListLogSubscriptions' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | If a /DirectoryID/ is provided, lists only the log subscription
-- associated with that directory. If no /DirectoryId/ is provided, lists
-- all log subscriptions associated with your Amazon Web Services account.
-- If there are no log subscriptions for the Amazon Web Services account or
-- the directory, an empty list will be returned.
listLogSubscriptions_directoryId :: Lens.Lens' ListLogSubscriptions (Prelude.Maybe Prelude.Text)
listLogSubscriptions_directoryId :: (Maybe Text -> f (Maybe Text))
-> ListLogSubscriptions -> f ListLogSubscriptions
listLogSubscriptions_directoryId = (ListLogSubscriptions -> Maybe Text)
-> (ListLogSubscriptions -> Maybe Text -> ListLogSubscriptions)
-> Lens
     ListLogSubscriptions ListLogSubscriptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLogSubscriptions' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:ListLogSubscriptions' :: ListLogSubscriptions -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: ListLogSubscriptions
s@ListLogSubscriptions' {} Maybe Text
a -> ListLogSubscriptions
s {$sel:directoryId:ListLogSubscriptions' :: Maybe Text
directoryId = Maybe Text
a} :: ListLogSubscriptions)

-- | The token for the next set of items to return.
listLogSubscriptions_nextToken :: Lens.Lens' ListLogSubscriptions (Prelude.Maybe Prelude.Text)
listLogSubscriptions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLogSubscriptions -> f ListLogSubscriptions
listLogSubscriptions_nextToken = (ListLogSubscriptions -> Maybe Text)
-> (ListLogSubscriptions -> Maybe Text -> ListLogSubscriptions)
-> Lens
     ListLogSubscriptions ListLogSubscriptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLogSubscriptions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLogSubscriptions' :: ListLogSubscriptions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLogSubscriptions
s@ListLogSubscriptions' {} Maybe Text
a -> ListLogSubscriptions
s {$sel:nextToken:ListLogSubscriptions' :: Maybe Text
nextToken = Maybe Text
a} :: ListLogSubscriptions)

-- | The maximum number of items returned.
listLogSubscriptions_limit :: Lens.Lens' ListLogSubscriptions (Prelude.Maybe Prelude.Natural)
listLogSubscriptions_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListLogSubscriptions -> f ListLogSubscriptions
listLogSubscriptions_limit = (ListLogSubscriptions -> Maybe Natural)
-> (ListLogSubscriptions -> Maybe Natural -> ListLogSubscriptions)
-> Lens
     ListLogSubscriptions
     ListLogSubscriptions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLogSubscriptions' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListLogSubscriptions' :: ListLogSubscriptions -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListLogSubscriptions
s@ListLogSubscriptions' {} Maybe Natural
a -> ListLogSubscriptions
s {$sel:limit:ListLogSubscriptions' :: Maybe Natural
limit = Maybe Natural
a} :: ListLogSubscriptions)

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

instance Prelude.NFData ListLogSubscriptions

instance Core.ToHeaders ListLogSubscriptions where
  toHeaders :: ListLogSubscriptions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListLogSubscriptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DirectoryService_20150416.ListLogSubscriptions" ::
                          Prelude.ByteString
                      ),
            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.ToJSON ListLogSubscriptions where
  toJSON :: ListLogSubscriptions -> Value
toJSON ListLogSubscriptions' {Maybe Natural
Maybe Text
limit :: Maybe Natural
nextToken :: Maybe Text
directoryId :: Maybe Text
$sel:limit:ListLogSubscriptions' :: ListLogSubscriptions -> Maybe Natural
$sel:nextToken:ListLogSubscriptions' :: ListLogSubscriptions -> Maybe Text
$sel:directoryId:ListLogSubscriptions' :: ListLogSubscriptions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
directoryId,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit
          ]
      )

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

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

-- | /See:/ 'newListLogSubscriptionsResponse' smart constructor.
data ListLogSubscriptionsResponse = ListLogSubscriptionsResponse'
  { -- | The token for the next set of items to return.
    ListLogSubscriptionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of active LogSubscription objects for calling the Amazon Web
    -- Services account.
    ListLogSubscriptionsResponse -> Maybe [LogSubscription]
logSubscriptions :: Prelude.Maybe [LogSubscription],
    -- | The response's http status code.
    ListLogSubscriptionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLogSubscriptionsResponse
-> ListLogSubscriptionsResponse -> Bool
(ListLogSubscriptionsResponse
 -> ListLogSubscriptionsResponse -> Bool)
-> (ListLogSubscriptionsResponse
    -> ListLogSubscriptionsResponse -> Bool)
-> Eq ListLogSubscriptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLogSubscriptionsResponse
-> ListLogSubscriptionsResponse -> Bool
$c/= :: ListLogSubscriptionsResponse
-> ListLogSubscriptionsResponse -> Bool
== :: ListLogSubscriptionsResponse
-> ListLogSubscriptionsResponse -> Bool
$c== :: ListLogSubscriptionsResponse
-> ListLogSubscriptionsResponse -> Bool
Prelude.Eq, ReadPrec [ListLogSubscriptionsResponse]
ReadPrec ListLogSubscriptionsResponse
Int -> ReadS ListLogSubscriptionsResponse
ReadS [ListLogSubscriptionsResponse]
(Int -> ReadS ListLogSubscriptionsResponse)
-> ReadS [ListLogSubscriptionsResponse]
-> ReadPrec ListLogSubscriptionsResponse
-> ReadPrec [ListLogSubscriptionsResponse]
-> Read ListLogSubscriptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLogSubscriptionsResponse]
$creadListPrec :: ReadPrec [ListLogSubscriptionsResponse]
readPrec :: ReadPrec ListLogSubscriptionsResponse
$creadPrec :: ReadPrec ListLogSubscriptionsResponse
readList :: ReadS [ListLogSubscriptionsResponse]
$creadList :: ReadS [ListLogSubscriptionsResponse]
readsPrec :: Int -> ReadS ListLogSubscriptionsResponse
$creadsPrec :: Int -> ReadS ListLogSubscriptionsResponse
Prelude.Read, Int -> ListLogSubscriptionsResponse -> ShowS
[ListLogSubscriptionsResponse] -> ShowS
ListLogSubscriptionsResponse -> String
(Int -> ListLogSubscriptionsResponse -> ShowS)
-> (ListLogSubscriptionsResponse -> String)
-> ([ListLogSubscriptionsResponse] -> ShowS)
-> Show ListLogSubscriptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLogSubscriptionsResponse] -> ShowS
$cshowList :: [ListLogSubscriptionsResponse] -> ShowS
show :: ListLogSubscriptionsResponse -> String
$cshow :: ListLogSubscriptionsResponse -> String
showsPrec :: Int -> ListLogSubscriptionsResponse -> ShowS
$cshowsPrec :: Int -> ListLogSubscriptionsResponse -> ShowS
Prelude.Show, (forall x.
 ListLogSubscriptionsResponse -> Rep ListLogSubscriptionsResponse x)
-> (forall x.
    Rep ListLogSubscriptionsResponse x -> ListLogSubscriptionsResponse)
-> Generic ListLogSubscriptionsResponse
forall x.
Rep ListLogSubscriptionsResponse x -> ListLogSubscriptionsResponse
forall x.
ListLogSubscriptionsResponse -> Rep ListLogSubscriptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLogSubscriptionsResponse x -> ListLogSubscriptionsResponse
$cfrom :: forall x.
ListLogSubscriptionsResponse -> Rep ListLogSubscriptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLogSubscriptionsResponse' 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', 'listLogSubscriptionsResponse_nextToken' - The token for the next set of items to return.
--
-- 'logSubscriptions', 'listLogSubscriptionsResponse_logSubscriptions' - A list of active LogSubscription objects for calling the Amazon Web
-- Services account.
--
-- 'httpStatus', 'listLogSubscriptionsResponse_httpStatus' - The response's http status code.
newListLogSubscriptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLogSubscriptionsResponse
newListLogSubscriptionsResponse :: Int -> ListLogSubscriptionsResponse
newListLogSubscriptionsResponse Int
pHttpStatus_ =
  ListLogSubscriptionsResponse' :: Maybe Text
-> Maybe [LogSubscription] -> Int -> ListLogSubscriptionsResponse
ListLogSubscriptionsResponse'
    { $sel:nextToken:ListLogSubscriptionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:logSubscriptions:ListLogSubscriptionsResponse' :: Maybe [LogSubscription]
logSubscriptions = Maybe [LogSubscription]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLogSubscriptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of items to return.
listLogSubscriptionsResponse_nextToken :: Lens.Lens' ListLogSubscriptionsResponse (Prelude.Maybe Prelude.Text)
listLogSubscriptionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLogSubscriptionsResponse -> f ListLogSubscriptionsResponse
listLogSubscriptionsResponse_nextToken = (ListLogSubscriptionsResponse -> Maybe Text)
-> (ListLogSubscriptionsResponse
    -> Maybe Text -> ListLogSubscriptionsResponse)
-> Lens' ListLogSubscriptionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLogSubscriptionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLogSubscriptionsResponse' :: ListLogSubscriptionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLogSubscriptionsResponse
s@ListLogSubscriptionsResponse' {} Maybe Text
a -> ListLogSubscriptionsResponse
s {$sel:nextToken:ListLogSubscriptionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLogSubscriptionsResponse)

-- | A list of active LogSubscription objects for calling the Amazon Web
-- Services account.
listLogSubscriptionsResponse_logSubscriptions :: Lens.Lens' ListLogSubscriptionsResponse (Prelude.Maybe [LogSubscription])
listLogSubscriptionsResponse_logSubscriptions :: (Maybe [LogSubscription] -> f (Maybe [LogSubscription]))
-> ListLogSubscriptionsResponse -> f ListLogSubscriptionsResponse
listLogSubscriptionsResponse_logSubscriptions = (ListLogSubscriptionsResponse -> Maybe [LogSubscription])
-> (ListLogSubscriptionsResponse
    -> Maybe [LogSubscription] -> ListLogSubscriptionsResponse)
-> Lens' ListLogSubscriptionsResponse (Maybe [LogSubscription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLogSubscriptionsResponse' {Maybe [LogSubscription]
logSubscriptions :: Maybe [LogSubscription]
$sel:logSubscriptions:ListLogSubscriptionsResponse' :: ListLogSubscriptionsResponse -> Maybe [LogSubscription]
logSubscriptions} -> Maybe [LogSubscription]
logSubscriptions) (\s :: ListLogSubscriptionsResponse
s@ListLogSubscriptionsResponse' {} Maybe [LogSubscription]
a -> ListLogSubscriptionsResponse
s {$sel:logSubscriptions:ListLogSubscriptionsResponse' :: Maybe [LogSubscription]
logSubscriptions = Maybe [LogSubscription]
a} :: ListLogSubscriptionsResponse) ((Maybe [LogSubscription] -> f (Maybe [LogSubscription]))
 -> ListLogSubscriptionsResponse -> f ListLogSubscriptionsResponse)
-> ((Maybe [LogSubscription] -> f (Maybe [LogSubscription]))
    -> Maybe [LogSubscription] -> f (Maybe [LogSubscription]))
-> (Maybe [LogSubscription] -> f (Maybe [LogSubscription]))
-> ListLogSubscriptionsResponse
-> f ListLogSubscriptionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LogSubscription]
  [LogSubscription]
  [LogSubscription]
  [LogSubscription]
-> Iso
     (Maybe [LogSubscription])
     (Maybe [LogSubscription])
     (Maybe [LogSubscription])
     (Maybe [LogSubscription])
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
  [LogSubscription]
  [LogSubscription]
  [LogSubscription]
  [LogSubscription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListLogSubscriptionsResponse