{-# 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.SSMContacts.ListContactChannels
-- 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 all contact channels for the specified contact.
--
-- This operation returns paginated results.
module Amazonka.SSMContacts.ListContactChannels
  ( -- * Creating a Request
    ListContactChannels (..),
    newListContactChannels,

    -- * Request Lenses
    listContactChannels_nextToken,
    listContactChannels_maxResults,
    listContactChannels_contactId,

    -- * Destructuring the Response
    ListContactChannelsResponse (..),
    newListContactChannelsResponse,

    -- * Response Lenses
    listContactChannelsResponse_nextToken,
    listContactChannelsResponse_httpStatus,
    listContactChannelsResponse_contactChannels,
  )
where

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

-- | /See:/ 'newListContactChannels' smart constructor.
data ListContactChannels = ListContactChannels'
  { -- | The pagination token to continue to the next page of results.
    ListContactChannels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of contact channels per page.
    ListContactChannels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the contact.
    ListContactChannels -> Text
contactId :: Prelude.Text
  }
  deriving (ListContactChannels -> ListContactChannels -> Bool
(ListContactChannels -> ListContactChannels -> Bool)
-> (ListContactChannels -> ListContactChannels -> Bool)
-> Eq ListContactChannels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContactChannels -> ListContactChannels -> Bool
$c/= :: ListContactChannels -> ListContactChannels -> Bool
== :: ListContactChannels -> ListContactChannels -> Bool
$c== :: ListContactChannels -> ListContactChannels -> Bool
Prelude.Eq, ReadPrec [ListContactChannels]
ReadPrec ListContactChannels
Int -> ReadS ListContactChannels
ReadS [ListContactChannels]
(Int -> ReadS ListContactChannels)
-> ReadS [ListContactChannels]
-> ReadPrec ListContactChannels
-> ReadPrec [ListContactChannels]
-> Read ListContactChannels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContactChannels]
$creadListPrec :: ReadPrec [ListContactChannels]
readPrec :: ReadPrec ListContactChannels
$creadPrec :: ReadPrec ListContactChannels
readList :: ReadS [ListContactChannels]
$creadList :: ReadS [ListContactChannels]
readsPrec :: Int -> ReadS ListContactChannels
$creadsPrec :: Int -> ReadS ListContactChannels
Prelude.Read, Int -> ListContactChannels -> ShowS
[ListContactChannels] -> ShowS
ListContactChannels -> String
(Int -> ListContactChannels -> ShowS)
-> (ListContactChannels -> String)
-> ([ListContactChannels] -> ShowS)
-> Show ListContactChannels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContactChannels] -> ShowS
$cshowList :: [ListContactChannels] -> ShowS
show :: ListContactChannels -> String
$cshow :: ListContactChannels -> String
showsPrec :: Int -> ListContactChannels -> ShowS
$cshowsPrec :: Int -> ListContactChannels -> ShowS
Prelude.Show, (forall x. ListContactChannels -> Rep ListContactChannels x)
-> (forall x. Rep ListContactChannels x -> ListContactChannels)
-> Generic ListContactChannels
forall x. Rep ListContactChannels x -> ListContactChannels
forall x. ListContactChannels -> Rep ListContactChannels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListContactChannels x -> ListContactChannels
$cfrom :: forall x. ListContactChannels -> Rep ListContactChannels x
Prelude.Generic)

-- |
-- Create a value of 'ListContactChannels' 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', 'listContactChannels_nextToken' - The pagination token to continue to the next page of results.
--
-- 'maxResults', 'listContactChannels_maxResults' - The maximum number of contact channels per page.
--
-- 'contactId', 'listContactChannels_contactId' - The Amazon Resource Name (ARN) of the contact.
newListContactChannels ::
  -- | 'contactId'
  Prelude.Text ->
  ListContactChannels
newListContactChannels :: Text -> ListContactChannels
newListContactChannels Text
pContactId_ =
  ListContactChannels' :: Maybe Text -> Maybe Natural -> Text -> ListContactChannels
ListContactChannels'
    { $sel:nextToken:ListContactChannels' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListContactChannels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:contactId:ListContactChannels' :: Text
contactId = Text
pContactId_
    }

-- | The pagination token to continue to the next page of results.
listContactChannels_nextToken :: Lens.Lens' ListContactChannels (Prelude.Maybe Prelude.Text)
listContactChannels_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContactChannels -> f ListContactChannels
listContactChannels_nextToken = (ListContactChannels -> Maybe Text)
-> (ListContactChannels -> Maybe Text -> ListContactChannels)
-> Lens
     ListContactChannels ListContactChannels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactChannels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContactChannels' :: ListContactChannels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContactChannels
s@ListContactChannels' {} Maybe Text
a -> ListContactChannels
s {$sel:nextToken:ListContactChannels' :: Maybe Text
nextToken = Maybe Text
a} :: ListContactChannels)

-- | The maximum number of contact channels per page.
listContactChannels_maxResults :: Lens.Lens' ListContactChannels (Prelude.Maybe Prelude.Natural)
listContactChannels_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListContactChannels -> f ListContactChannels
listContactChannels_maxResults = (ListContactChannels -> Maybe Natural)
-> (ListContactChannels -> Maybe Natural -> ListContactChannels)
-> Lens
     ListContactChannels
     ListContactChannels
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactChannels' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListContactChannels' :: ListContactChannels -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListContactChannels
s@ListContactChannels' {} Maybe Natural
a -> ListContactChannels
s {$sel:maxResults:ListContactChannels' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListContactChannels)

-- | The Amazon Resource Name (ARN) of the contact.
listContactChannels_contactId :: Lens.Lens' ListContactChannels Prelude.Text
listContactChannels_contactId :: (Text -> f Text) -> ListContactChannels -> f ListContactChannels
listContactChannels_contactId = (ListContactChannels -> Text)
-> (ListContactChannels -> Text -> ListContactChannels)
-> Lens ListContactChannels ListContactChannels Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactChannels' {Text
contactId :: Text
$sel:contactId:ListContactChannels' :: ListContactChannels -> Text
contactId} -> Text
contactId) (\s :: ListContactChannels
s@ListContactChannels' {} Text
a -> ListContactChannels
s {$sel:contactId:ListContactChannels' :: Text
contactId = Text
a} :: ListContactChannels)

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

instance Prelude.Hashable ListContactChannels

instance Prelude.NFData ListContactChannels

instance Core.ToHeaders ListContactChannels where
  toHeaders :: ListContactChannels -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListContactChannels -> 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
"SSMContacts.ListContactChannels" ::
                          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 ListContactChannels where
  toJSON :: ListContactChannels -> Value
toJSON ListContactChannels' {Maybe Natural
Maybe Text
Text
contactId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:contactId:ListContactChannels' :: ListContactChannels -> Text
$sel:maxResults:ListContactChannels' :: ListContactChannels -> Maybe Natural
$sel:nextToken:ListContactChannels' :: ListContactChannels -> 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,
            (Text
"MaxResults" 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
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactId)
          ]
      )

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

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

-- | /See:/ 'newListContactChannelsResponse' smart constructor.
data ListContactChannelsResponse = ListContactChannelsResponse'
  { -- | The pagination token to continue to the next page of results.
    ListContactChannelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListContactChannelsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of contact channels related to the specified contact.
    ListContactChannelsResponse -> [ContactChannel]
contactChannels :: [ContactChannel]
  }
  deriving (ListContactChannelsResponse -> ListContactChannelsResponse -> Bool
(ListContactChannelsResponse
 -> ListContactChannelsResponse -> Bool)
-> (ListContactChannelsResponse
    -> ListContactChannelsResponse -> Bool)
-> Eq ListContactChannelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContactChannelsResponse -> ListContactChannelsResponse -> Bool
$c/= :: ListContactChannelsResponse -> ListContactChannelsResponse -> Bool
== :: ListContactChannelsResponse -> ListContactChannelsResponse -> Bool
$c== :: ListContactChannelsResponse -> ListContactChannelsResponse -> Bool
Prelude.Eq, ReadPrec [ListContactChannelsResponse]
ReadPrec ListContactChannelsResponse
Int -> ReadS ListContactChannelsResponse
ReadS [ListContactChannelsResponse]
(Int -> ReadS ListContactChannelsResponse)
-> ReadS [ListContactChannelsResponse]
-> ReadPrec ListContactChannelsResponse
-> ReadPrec [ListContactChannelsResponse]
-> Read ListContactChannelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContactChannelsResponse]
$creadListPrec :: ReadPrec [ListContactChannelsResponse]
readPrec :: ReadPrec ListContactChannelsResponse
$creadPrec :: ReadPrec ListContactChannelsResponse
readList :: ReadS [ListContactChannelsResponse]
$creadList :: ReadS [ListContactChannelsResponse]
readsPrec :: Int -> ReadS ListContactChannelsResponse
$creadsPrec :: Int -> ReadS ListContactChannelsResponse
Prelude.Read, Int -> ListContactChannelsResponse -> ShowS
[ListContactChannelsResponse] -> ShowS
ListContactChannelsResponse -> String
(Int -> ListContactChannelsResponse -> ShowS)
-> (ListContactChannelsResponse -> String)
-> ([ListContactChannelsResponse] -> ShowS)
-> Show ListContactChannelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContactChannelsResponse] -> ShowS
$cshowList :: [ListContactChannelsResponse] -> ShowS
show :: ListContactChannelsResponse -> String
$cshow :: ListContactChannelsResponse -> String
showsPrec :: Int -> ListContactChannelsResponse -> ShowS
$cshowsPrec :: Int -> ListContactChannelsResponse -> ShowS
Prelude.Show, (forall x.
 ListContactChannelsResponse -> Rep ListContactChannelsResponse x)
-> (forall x.
    Rep ListContactChannelsResponse x -> ListContactChannelsResponse)
-> Generic ListContactChannelsResponse
forall x.
Rep ListContactChannelsResponse x -> ListContactChannelsResponse
forall x.
ListContactChannelsResponse -> Rep ListContactChannelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListContactChannelsResponse x -> ListContactChannelsResponse
$cfrom :: forall x.
ListContactChannelsResponse -> Rep ListContactChannelsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListContactChannelsResponse' 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', 'listContactChannelsResponse_nextToken' - The pagination token to continue to the next page of results.
--
-- 'httpStatus', 'listContactChannelsResponse_httpStatus' - The response's http status code.
--
-- 'contactChannels', 'listContactChannelsResponse_contactChannels' - A list of contact channels related to the specified contact.
newListContactChannelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListContactChannelsResponse
newListContactChannelsResponse :: Int -> ListContactChannelsResponse
newListContactChannelsResponse Int
pHttpStatus_ =
  ListContactChannelsResponse' :: Maybe Text
-> Int -> [ContactChannel] -> ListContactChannelsResponse
ListContactChannelsResponse'
    { $sel:nextToken:ListContactChannelsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListContactChannelsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:contactChannels:ListContactChannelsResponse' :: [ContactChannel]
contactChannels = [ContactChannel]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The pagination token to continue to the next page of results.
listContactChannelsResponse_nextToken :: Lens.Lens' ListContactChannelsResponse (Prelude.Maybe Prelude.Text)
listContactChannelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContactChannelsResponse -> f ListContactChannelsResponse
listContactChannelsResponse_nextToken = (ListContactChannelsResponse -> Maybe Text)
-> (ListContactChannelsResponse
    -> Maybe Text -> ListContactChannelsResponse)
-> Lens' ListContactChannelsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactChannelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContactChannelsResponse' :: ListContactChannelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContactChannelsResponse
s@ListContactChannelsResponse' {} Maybe Text
a -> ListContactChannelsResponse
s {$sel:nextToken:ListContactChannelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListContactChannelsResponse)

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

-- | A list of contact channels related to the specified contact.
listContactChannelsResponse_contactChannels :: Lens.Lens' ListContactChannelsResponse [ContactChannel]
listContactChannelsResponse_contactChannels :: ([ContactChannel] -> f [ContactChannel])
-> ListContactChannelsResponse -> f ListContactChannelsResponse
listContactChannelsResponse_contactChannels = (ListContactChannelsResponse -> [ContactChannel])
-> (ListContactChannelsResponse
    -> [ContactChannel] -> ListContactChannelsResponse)
-> Lens' ListContactChannelsResponse [ContactChannel]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactChannelsResponse' {[ContactChannel]
contactChannels :: [ContactChannel]
$sel:contactChannels:ListContactChannelsResponse' :: ListContactChannelsResponse -> [ContactChannel]
contactChannels} -> [ContactChannel]
contactChannels) (\s :: ListContactChannelsResponse
s@ListContactChannelsResponse' {} [ContactChannel]
a -> ListContactChannelsResponse
s {$sel:contactChannels:ListContactChannelsResponse' :: [ContactChannel]
contactChannels = [ContactChannel]
a} :: ListContactChannelsResponse) (([ContactChannel] -> f [ContactChannel])
 -> ListContactChannelsResponse -> f ListContactChannelsResponse)
-> (([ContactChannel] -> f [ContactChannel])
    -> [ContactChannel] -> f [ContactChannel])
-> ([ContactChannel] -> f [ContactChannel])
-> ListContactChannelsResponse
-> f ListContactChannelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ContactChannel] -> f [ContactChannel])
-> [ContactChannel] -> f [ContactChannel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListContactChannelsResponse