{-# 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.DevOpsGuru.ListNotificationChannels
-- 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)
--
-- Returns a list of notification channels configured for DevOps Guru. Each
-- notification channel is used to notify you when DevOps Guru generates an
-- insight that contains information about how to improve your operations.
-- The one supported notification channel is Amazon Simple Notification
-- Service (Amazon SNS).
--
-- This operation returns paginated results.
module Amazonka.DevOpsGuru.ListNotificationChannels
  ( -- * Creating a Request
    ListNotificationChannels (..),
    newListNotificationChannels,

    -- * Request Lenses
    listNotificationChannels_nextToken,

    -- * Destructuring the Response
    ListNotificationChannelsResponse (..),
    newListNotificationChannelsResponse,

    -- * Response Lenses
    listNotificationChannelsResponse_channels,
    listNotificationChannelsResponse_nextToken,
    listNotificationChannelsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.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:/ 'newListNotificationChannels' smart constructor.
data ListNotificationChannels = ListNotificationChannels'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    ListNotificationChannels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListNotificationChannels -> ListNotificationChannels -> Bool
(ListNotificationChannels -> ListNotificationChannels -> Bool)
-> (ListNotificationChannels -> ListNotificationChannels -> Bool)
-> Eq ListNotificationChannels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNotificationChannels -> ListNotificationChannels -> Bool
$c/= :: ListNotificationChannels -> ListNotificationChannels -> Bool
== :: ListNotificationChannels -> ListNotificationChannels -> Bool
$c== :: ListNotificationChannels -> ListNotificationChannels -> Bool
Prelude.Eq, ReadPrec [ListNotificationChannels]
ReadPrec ListNotificationChannels
Int -> ReadS ListNotificationChannels
ReadS [ListNotificationChannels]
(Int -> ReadS ListNotificationChannels)
-> ReadS [ListNotificationChannels]
-> ReadPrec ListNotificationChannels
-> ReadPrec [ListNotificationChannels]
-> Read ListNotificationChannels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNotificationChannels]
$creadListPrec :: ReadPrec [ListNotificationChannels]
readPrec :: ReadPrec ListNotificationChannels
$creadPrec :: ReadPrec ListNotificationChannels
readList :: ReadS [ListNotificationChannels]
$creadList :: ReadS [ListNotificationChannels]
readsPrec :: Int -> ReadS ListNotificationChannels
$creadsPrec :: Int -> ReadS ListNotificationChannels
Prelude.Read, Int -> ListNotificationChannels -> ShowS
[ListNotificationChannels] -> ShowS
ListNotificationChannels -> String
(Int -> ListNotificationChannels -> ShowS)
-> (ListNotificationChannels -> String)
-> ([ListNotificationChannels] -> ShowS)
-> Show ListNotificationChannels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNotificationChannels] -> ShowS
$cshowList :: [ListNotificationChannels] -> ShowS
show :: ListNotificationChannels -> String
$cshow :: ListNotificationChannels -> String
showsPrec :: Int -> ListNotificationChannels -> ShowS
$cshowsPrec :: Int -> ListNotificationChannels -> ShowS
Prelude.Show, (forall x.
 ListNotificationChannels -> Rep ListNotificationChannels x)
-> (forall x.
    Rep ListNotificationChannels x -> ListNotificationChannels)
-> Generic ListNotificationChannels
forall x.
Rep ListNotificationChannels x -> ListNotificationChannels
forall x.
ListNotificationChannels -> Rep ListNotificationChannels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListNotificationChannels x -> ListNotificationChannels
$cfrom :: forall x.
ListNotificationChannels -> Rep ListNotificationChannels x
Prelude.Generic)

-- |
-- Create a value of 'ListNotificationChannels' 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', 'listNotificationChannels_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
newListNotificationChannels ::
  ListNotificationChannels
newListNotificationChannels :: ListNotificationChannels
newListNotificationChannels =
  ListNotificationChannels' :: Maybe Text -> ListNotificationChannels
ListNotificationChannels'
    { $sel:nextToken:ListNotificationChannels' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
listNotificationChannels_nextToken :: Lens.Lens' ListNotificationChannels (Prelude.Maybe Prelude.Text)
listNotificationChannels_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListNotificationChannels -> f ListNotificationChannels
listNotificationChannels_nextToken = (ListNotificationChannels -> Maybe Text)
-> (ListNotificationChannels
    -> Maybe Text -> ListNotificationChannels)
-> Lens
     ListNotificationChannels
     ListNotificationChannels
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotificationChannels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNotificationChannels' :: ListNotificationChannels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNotificationChannels
s@ListNotificationChannels' {} Maybe Text
a -> ListNotificationChannels
s {$sel:nextToken:ListNotificationChannels' :: Maybe Text
nextToken = Maybe Text
a} :: ListNotificationChannels)

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

instance Prelude.NFData ListNotificationChannels

instance Core.ToHeaders ListNotificationChannels where
  toHeaders :: ListNotificationChannels -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListNotificationChannels -> 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.ToJSON ListNotificationChannels where
  toJSON :: ListNotificationChannels -> Value
toJSON ListNotificationChannels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNotificationChannels' :: ListNotificationChannels -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(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]
      )

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

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

-- | /See:/ 'newListNotificationChannelsResponse' smart constructor.
data ListNotificationChannelsResponse = ListNotificationChannelsResponse'
  { -- | An array that contains the requested notification channels.
    ListNotificationChannelsResponse -> Maybe [NotificationChannel]
channels :: Prelude.Maybe [NotificationChannel],
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    ListNotificationChannelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListNotificationChannelsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListNotificationChannelsResponse
-> ListNotificationChannelsResponse -> Bool
(ListNotificationChannelsResponse
 -> ListNotificationChannelsResponse -> Bool)
-> (ListNotificationChannelsResponse
    -> ListNotificationChannelsResponse -> Bool)
-> Eq ListNotificationChannelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNotificationChannelsResponse
-> ListNotificationChannelsResponse -> Bool
$c/= :: ListNotificationChannelsResponse
-> ListNotificationChannelsResponse -> Bool
== :: ListNotificationChannelsResponse
-> ListNotificationChannelsResponse -> Bool
$c== :: ListNotificationChannelsResponse
-> ListNotificationChannelsResponse -> Bool
Prelude.Eq, ReadPrec [ListNotificationChannelsResponse]
ReadPrec ListNotificationChannelsResponse
Int -> ReadS ListNotificationChannelsResponse
ReadS [ListNotificationChannelsResponse]
(Int -> ReadS ListNotificationChannelsResponse)
-> ReadS [ListNotificationChannelsResponse]
-> ReadPrec ListNotificationChannelsResponse
-> ReadPrec [ListNotificationChannelsResponse]
-> Read ListNotificationChannelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNotificationChannelsResponse]
$creadListPrec :: ReadPrec [ListNotificationChannelsResponse]
readPrec :: ReadPrec ListNotificationChannelsResponse
$creadPrec :: ReadPrec ListNotificationChannelsResponse
readList :: ReadS [ListNotificationChannelsResponse]
$creadList :: ReadS [ListNotificationChannelsResponse]
readsPrec :: Int -> ReadS ListNotificationChannelsResponse
$creadsPrec :: Int -> ReadS ListNotificationChannelsResponse
Prelude.Read, Int -> ListNotificationChannelsResponse -> ShowS
[ListNotificationChannelsResponse] -> ShowS
ListNotificationChannelsResponse -> String
(Int -> ListNotificationChannelsResponse -> ShowS)
-> (ListNotificationChannelsResponse -> String)
-> ([ListNotificationChannelsResponse] -> ShowS)
-> Show ListNotificationChannelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNotificationChannelsResponse] -> ShowS
$cshowList :: [ListNotificationChannelsResponse] -> ShowS
show :: ListNotificationChannelsResponse -> String
$cshow :: ListNotificationChannelsResponse -> String
showsPrec :: Int -> ListNotificationChannelsResponse -> ShowS
$cshowsPrec :: Int -> ListNotificationChannelsResponse -> ShowS
Prelude.Show, (forall x.
 ListNotificationChannelsResponse
 -> Rep ListNotificationChannelsResponse x)
-> (forall x.
    Rep ListNotificationChannelsResponse x
    -> ListNotificationChannelsResponse)
-> Generic ListNotificationChannelsResponse
forall x.
Rep ListNotificationChannelsResponse x
-> ListNotificationChannelsResponse
forall x.
ListNotificationChannelsResponse
-> Rep ListNotificationChannelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListNotificationChannelsResponse x
-> ListNotificationChannelsResponse
$cfrom :: forall x.
ListNotificationChannelsResponse
-> Rep ListNotificationChannelsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListNotificationChannelsResponse' 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:
--
-- 'channels', 'listNotificationChannelsResponse_channels' - An array that contains the requested notification channels.
--
-- 'nextToken', 'listNotificationChannelsResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'httpStatus', 'listNotificationChannelsResponse_httpStatus' - The response's http status code.
newListNotificationChannelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListNotificationChannelsResponse
newListNotificationChannelsResponse :: Int -> ListNotificationChannelsResponse
newListNotificationChannelsResponse Int
pHttpStatus_ =
  ListNotificationChannelsResponse' :: Maybe [NotificationChannel]
-> Maybe Text -> Int -> ListNotificationChannelsResponse
ListNotificationChannelsResponse'
    { $sel:channels:ListNotificationChannelsResponse' :: Maybe [NotificationChannel]
channels =
        Maybe [NotificationChannel]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListNotificationChannelsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListNotificationChannelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array that contains the requested notification channels.
listNotificationChannelsResponse_channels :: Lens.Lens' ListNotificationChannelsResponse (Prelude.Maybe [NotificationChannel])
listNotificationChannelsResponse_channels :: (Maybe [NotificationChannel] -> f (Maybe [NotificationChannel]))
-> ListNotificationChannelsResponse
-> f ListNotificationChannelsResponse
listNotificationChannelsResponse_channels = (ListNotificationChannelsResponse -> Maybe [NotificationChannel])
-> (ListNotificationChannelsResponse
    -> Maybe [NotificationChannel] -> ListNotificationChannelsResponse)
-> Lens'
     ListNotificationChannelsResponse (Maybe [NotificationChannel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotificationChannelsResponse' {Maybe [NotificationChannel]
channels :: Maybe [NotificationChannel]
$sel:channels:ListNotificationChannelsResponse' :: ListNotificationChannelsResponse -> Maybe [NotificationChannel]
channels} -> Maybe [NotificationChannel]
channels) (\s :: ListNotificationChannelsResponse
s@ListNotificationChannelsResponse' {} Maybe [NotificationChannel]
a -> ListNotificationChannelsResponse
s {$sel:channels:ListNotificationChannelsResponse' :: Maybe [NotificationChannel]
channels = Maybe [NotificationChannel]
a} :: ListNotificationChannelsResponse) ((Maybe [NotificationChannel] -> f (Maybe [NotificationChannel]))
 -> ListNotificationChannelsResponse
 -> f ListNotificationChannelsResponse)
-> ((Maybe [NotificationChannel]
     -> f (Maybe [NotificationChannel]))
    -> Maybe [NotificationChannel] -> f (Maybe [NotificationChannel]))
-> (Maybe [NotificationChannel] -> f (Maybe [NotificationChannel]))
-> ListNotificationChannelsResponse
-> f ListNotificationChannelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NotificationChannel]
  [NotificationChannel]
  [NotificationChannel]
  [NotificationChannel]
-> Iso
     (Maybe [NotificationChannel])
     (Maybe [NotificationChannel])
     (Maybe [NotificationChannel])
     (Maybe [NotificationChannel])
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
  [NotificationChannel]
  [NotificationChannel]
  [NotificationChannel]
  [NotificationChannel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
listNotificationChannelsResponse_nextToken :: Lens.Lens' ListNotificationChannelsResponse (Prelude.Maybe Prelude.Text)
listNotificationChannelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListNotificationChannelsResponse
-> f ListNotificationChannelsResponse
listNotificationChannelsResponse_nextToken = (ListNotificationChannelsResponse -> Maybe Text)
-> (ListNotificationChannelsResponse
    -> Maybe Text -> ListNotificationChannelsResponse)
-> Lens' ListNotificationChannelsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotificationChannelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNotificationChannelsResponse' :: ListNotificationChannelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNotificationChannelsResponse
s@ListNotificationChannelsResponse' {} Maybe Text
a -> ListNotificationChannelsResponse
s {$sel:nextToken:ListNotificationChannelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListNotificationChannelsResponse)

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

instance
  Prelude.NFData
    ListNotificationChannelsResponse