{-# 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.Connect.ListContactFlows
-- 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)
--
-- Provides information about the contact flows for the specified Amazon
-- Connect instance.
--
-- You can also create and update contact flows using the
-- <https://docs.aws.amazon.com/connect/latest/adminguide/flow-language.html Amazon Connect Flow language>.
--
-- For more information about contact flows, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-contact-flows.html Contact Flows>
-- in the /Amazon Connect Administrator Guide/.
--
-- This operation returns paginated results.
module Amazonka.Connect.ListContactFlows
  ( -- * Creating a Request
    ListContactFlows (..),
    newListContactFlows,

    -- * Request Lenses
    listContactFlows_contactFlowTypes,
    listContactFlows_nextToken,
    listContactFlows_maxResults,
    listContactFlows_instanceId,

    -- * Destructuring the Response
    ListContactFlowsResponse (..),
    newListContactFlowsResponse,

    -- * Response Lenses
    listContactFlowsResponse_contactFlowSummaryList,
    listContactFlowsResponse_nextToken,
    listContactFlowsResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
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

-- | /See:/ 'newListContactFlows' smart constructor.
data ListContactFlows = ListContactFlows'
  { -- | The type of contact flow.
    ListContactFlows -> Maybe [ContactFlowType]
contactFlowTypes :: Prelude.Maybe [ContactFlowType],
    -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListContactFlows -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per page.
    ListContactFlows -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    ListContactFlows -> Text
instanceId :: Prelude.Text
  }
  deriving (ListContactFlows -> ListContactFlows -> Bool
(ListContactFlows -> ListContactFlows -> Bool)
-> (ListContactFlows -> ListContactFlows -> Bool)
-> Eq ListContactFlows
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContactFlows -> ListContactFlows -> Bool
$c/= :: ListContactFlows -> ListContactFlows -> Bool
== :: ListContactFlows -> ListContactFlows -> Bool
$c== :: ListContactFlows -> ListContactFlows -> Bool
Prelude.Eq, ReadPrec [ListContactFlows]
ReadPrec ListContactFlows
Int -> ReadS ListContactFlows
ReadS [ListContactFlows]
(Int -> ReadS ListContactFlows)
-> ReadS [ListContactFlows]
-> ReadPrec ListContactFlows
-> ReadPrec [ListContactFlows]
-> Read ListContactFlows
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContactFlows]
$creadListPrec :: ReadPrec [ListContactFlows]
readPrec :: ReadPrec ListContactFlows
$creadPrec :: ReadPrec ListContactFlows
readList :: ReadS [ListContactFlows]
$creadList :: ReadS [ListContactFlows]
readsPrec :: Int -> ReadS ListContactFlows
$creadsPrec :: Int -> ReadS ListContactFlows
Prelude.Read, Int -> ListContactFlows -> ShowS
[ListContactFlows] -> ShowS
ListContactFlows -> String
(Int -> ListContactFlows -> ShowS)
-> (ListContactFlows -> String)
-> ([ListContactFlows] -> ShowS)
-> Show ListContactFlows
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContactFlows] -> ShowS
$cshowList :: [ListContactFlows] -> ShowS
show :: ListContactFlows -> String
$cshow :: ListContactFlows -> String
showsPrec :: Int -> ListContactFlows -> ShowS
$cshowsPrec :: Int -> ListContactFlows -> ShowS
Prelude.Show, (forall x. ListContactFlows -> Rep ListContactFlows x)
-> (forall x. Rep ListContactFlows x -> ListContactFlows)
-> Generic ListContactFlows
forall x. Rep ListContactFlows x -> ListContactFlows
forall x. ListContactFlows -> Rep ListContactFlows x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListContactFlows x -> ListContactFlows
$cfrom :: forall x. ListContactFlows -> Rep ListContactFlows x
Prelude.Generic)

-- |
-- Create a value of 'ListContactFlows' 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:
--
-- 'contactFlowTypes', 'listContactFlows_contactFlowTypes' - The type of contact flow.
--
-- 'nextToken', 'listContactFlows_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'maxResults', 'listContactFlows_maxResults' - The maximum number of results to return per page.
--
-- 'instanceId', 'listContactFlows_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
newListContactFlows ::
  -- | 'instanceId'
  Prelude.Text ->
  ListContactFlows
newListContactFlows :: Text -> ListContactFlows
newListContactFlows Text
pInstanceId_ =
  ListContactFlows' :: Maybe [ContactFlowType]
-> Maybe Text -> Maybe Natural -> Text -> ListContactFlows
ListContactFlows'
    { $sel:contactFlowTypes:ListContactFlows' :: Maybe [ContactFlowType]
contactFlowTypes =
        Maybe [ContactFlowType]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListContactFlows' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListContactFlows' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:ListContactFlows' :: Text
instanceId = Text
pInstanceId_
    }

-- | The type of contact flow.
listContactFlows_contactFlowTypes :: Lens.Lens' ListContactFlows (Prelude.Maybe [ContactFlowType])
listContactFlows_contactFlowTypes :: (Maybe [ContactFlowType] -> f (Maybe [ContactFlowType]))
-> ListContactFlows -> f ListContactFlows
listContactFlows_contactFlowTypes = (ListContactFlows -> Maybe [ContactFlowType])
-> (ListContactFlows
    -> Maybe [ContactFlowType] -> ListContactFlows)
-> Lens
     ListContactFlows
     ListContactFlows
     (Maybe [ContactFlowType])
     (Maybe [ContactFlowType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactFlows' {Maybe [ContactFlowType]
contactFlowTypes :: Maybe [ContactFlowType]
$sel:contactFlowTypes:ListContactFlows' :: ListContactFlows -> Maybe [ContactFlowType]
contactFlowTypes} -> Maybe [ContactFlowType]
contactFlowTypes) (\s :: ListContactFlows
s@ListContactFlows' {} Maybe [ContactFlowType]
a -> ListContactFlows
s {$sel:contactFlowTypes:ListContactFlows' :: Maybe [ContactFlowType]
contactFlowTypes = Maybe [ContactFlowType]
a} :: ListContactFlows) ((Maybe [ContactFlowType] -> f (Maybe [ContactFlowType]))
 -> ListContactFlows -> f ListContactFlows)
-> ((Maybe [ContactFlowType] -> f (Maybe [ContactFlowType]))
    -> Maybe [ContactFlowType] -> f (Maybe [ContactFlowType]))
-> (Maybe [ContactFlowType] -> f (Maybe [ContactFlowType]))
-> ListContactFlows
-> f ListContactFlows
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ContactFlowType]
  [ContactFlowType]
  [ContactFlowType]
  [ContactFlowType]
-> Iso
     (Maybe [ContactFlowType])
     (Maybe [ContactFlowType])
     (Maybe [ContactFlowType])
     (Maybe [ContactFlowType])
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
  [ContactFlowType]
  [ContactFlowType]
  [ContactFlowType]
  [ContactFlowType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listContactFlows_nextToken :: Lens.Lens' ListContactFlows (Prelude.Maybe Prelude.Text)
listContactFlows_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContactFlows -> f ListContactFlows
listContactFlows_nextToken = (ListContactFlows -> Maybe Text)
-> (ListContactFlows -> Maybe Text -> ListContactFlows)
-> Lens ListContactFlows ListContactFlows (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactFlows' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContactFlows' :: ListContactFlows -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContactFlows
s@ListContactFlows' {} Maybe Text
a -> ListContactFlows
s {$sel:nextToken:ListContactFlows' :: Maybe Text
nextToken = Maybe Text
a} :: ListContactFlows)

-- | The maximum number of results to return per page.
listContactFlows_maxResults :: Lens.Lens' ListContactFlows (Prelude.Maybe Prelude.Natural)
listContactFlows_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListContactFlows -> f ListContactFlows
listContactFlows_maxResults = (ListContactFlows -> Maybe Natural)
-> (ListContactFlows -> Maybe Natural -> ListContactFlows)
-> Lens
     ListContactFlows ListContactFlows (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactFlows' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListContactFlows' :: ListContactFlows -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListContactFlows
s@ListContactFlows' {} Maybe Natural
a -> ListContactFlows
s {$sel:maxResults:ListContactFlows' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListContactFlows)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
listContactFlows_instanceId :: Lens.Lens' ListContactFlows Prelude.Text
listContactFlows_instanceId :: (Text -> f Text) -> ListContactFlows -> f ListContactFlows
listContactFlows_instanceId = (ListContactFlows -> Text)
-> (ListContactFlows -> Text -> ListContactFlows)
-> Lens ListContactFlows ListContactFlows Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactFlows' {Text
instanceId :: Text
$sel:instanceId:ListContactFlows' :: ListContactFlows -> Text
instanceId} -> Text
instanceId) (\s :: ListContactFlows
s@ListContactFlows' {} Text
a -> ListContactFlows
s {$sel:instanceId:ListContactFlows' :: Text
instanceId = Text
a} :: ListContactFlows)

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

instance Prelude.NFData ListContactFlows

instance Core.ToHeaders ListContactFlows where
  toHeaders :: ListContactFlows -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListContactFlows -> 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 ListContactFlows where
  toPath :: ListContactFlows -> ByteString
toPath ListContactFlows' {Maybe Natural
Maybe [ContactFlowType]
Maybe Text
Text
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
contactFlowTypes :: Maybe [ContactFlowType]
$sel:instanceId:ListContactFlows' :: ListContactFlows -> Text
$sel:maxResults:ListContactFlows' :: ListContactFlows -> Maybe Natural
$sel:nextToken:ListContactFlows' :: ListContactFlows -> Maybe Text
$sel:contactFlowTypes:ListContactFlows' :: ListContactFlows -> Maybe [ContactFlowType]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/contact-flows-summary/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId]

instance Core.ToQuery ListContactFlows where
  toQuery :: ListContactFlows -> QueryString
toQuery ListContactFlows' {Maybe Natural
Maybe [ContactFlowType]
Maybe Text
Text
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
contactFlowTypes :: Maybe [ContactFlowType]
$sel:instanceId:ListContactFlows' :: ListContactFlows -> Text
$sel:maxResults:ListContactFlows' :: ListContactFlows -> Maybe Natural
$sel:nextToken:ListContactFlows' :: ListContactFlows -> Maybe Text
$sel:contactFlowTypes:ListContactFlows' :: ListContactFlows -> Maybe [ContactFlowType]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"contactFlowTypes"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [ContactFlowType] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([ContactFlowType] -> QueryString)
-> Maybe [ContactFlowType] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ContactFlowType]
contactFlowTypes
            ),
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListContactFlowsResponse' smart constructor.
data ListContactFlowsResponse = ListContactFlowsResponse'
  { -- | Information about the contact flows.
    ListContactFlowsResponse -> Maybe [ContactFlowSummary]
contactFlowSummaryList :: Prelude.Maybe [ContactFlowSummary],
    -- | If there are additional results, this is the token for the next set of
    -- results.
    ListContactFlowsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListContactFlowsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListContactFlowsResponse -> ListContactFlowsResponse -> Bool
(ListContactFlowsResponse -> ListContactFlowsResponse -> Bool)
-> (ListContactFlowsResponse -> ListContactFlowsResponse -> Bool)
-> Eq ListContactFlowsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContactFlowsResponse -> ListContactFlowsResponse -> Bool
$c/= :: ListContactFlowsResponse -> ListContactFlowsResponse -> Bool
== :: ListContactFlowsResponse -> ListContactFlowsResponse -> Bool
$c== :: ListContactFlowsResponse -> ListContactFlowsResponse -> Bool
Prelude.Eq, ReadPrec [ListContactFlowsResponse]
ReadPrec ListContactFlowsResponse
Int -> ReadS ListContactFlowsResponse
ReadS [ListContactFlowsResponse]
(Int -> ReadS ListContactFlowsResponse)
-> ReadS [ListContactFlowsResponse]
-> ReadPrec ListContactFlowsResponse
-> ReadPrec [ListContactFlowsResponse]
-> Read ListContactFlowsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContactFlowsResponse]
$creadListPrec :: ReadPrec [ListContactFlowsResponse]
readPrec :: ReadPrec ListContactFlowsResponse
$creadPrec :: ReadPrec ListContactFlowsResponse
readList :: ReadS [ListContactFlowsResponse]
$creadList :: ReadS [ListContactFlowsResponse]
readsPrec :: Int -> ReadS ListContactFlowsResponse
$creadsPrec :: Int -> ReadS ListContactFlowsResponse
Prelude.Read, Int -> ListContactFlowsResponse -> ShowS
[ListContactFlowsResponse] -> ShowS
ListContactFlowsResponse -> String
(Int -> ListContactFlowsResponse -> ShowS)
-> (ListContactFlowsResponse -> String)
-> ([ListContactFlowsResponse] -> ShowS)
-> Show ListContactFlowsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContactFlowsResponse] -> ShowS
$cshowList :: [ListContactFlowsResponse] -> ShowS
show :: ListContactFlowsResponse -> String
$cshow :: ListContactFlowsResponse -> String
showsPrec :: Int -> ListContactFlowsResponse -> ShowS
$cshowsPrec :: Int -> ListContactFlowsResponse -> ShowS
Prelude.Show, (forall x.
 ListContactFlowsResponse -> Rep ListContactFlowsResponse x)
-> (forall x.
    Rep ListContactFlowsResponse x -> ListContactFlowsResponse)
-> Generic ListContactFlowsResponse
forall x.
Rep ListContactFlowsResponse x -> ListContactFlowsResponse
forall x.
ListContactFlowsResponse -> Rep ListContactFlowsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListContactFlowsResponse x -> ListContactFlowsResponse
$cfrom :: forall x.
ListContactFlowsResponse -> Rep ListContactFlowsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListContactFlowsResponse' 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:
--
-- 'contactFlowSummaryList', 'listContactFlowsResponse_contactFlowSummaryList' - Information about the contact flows.
--
-- 'nextToken', 'listContactFlowsResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'httpStatus', 'listContactFlowsResponse_httpStatus' - The response's http status code.
newListContactFlowsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListContactFlowsResponse
newListContactFlowsResponse :: Int -> ListContactFlowsResponse
newListContactFlowsResponse Int
pHttpStatus_ =
  ListContactFlowsResponse' :: Maybe [ContactFlowSummary]
-> Maybe Text -> Int -> ListContactFlowsResponse
ListContactFlowsResponse'
    { $sel:contactFlowSummaryList:ListContactFlowsResponse' :: Maybe [ContactFlowSummary]
contactFlowSummaryList =
        Maybe [ContactFlowSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListContactFlowsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListContactFlowsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the contact flows.
listContactFlowsResponse_contactFlowSummaryList :: Lens.Lens' ListContactFlowsResponse (Prelude.Maybe [ContactFlowSummary])
listContactFlowsResponse_contactFlowSummaryList :: (Maybe [ContactFlowSummary] -> f (Maybe [ContactFlowSummary]))
-> ListContactFlowsResponse -> f ListContactFlowsResponse
listContactFlowsResponse_contactFlowSummaryList = (ListContactFlowsResponse -> Maybe [ContactFlowSummary])
-> (ListContactFlowsResponse
    -> Maybe [ContactFlowSummary] -> ListContactFlowsResponse)
-> Lens' ListContactFlowsResponse (Maybe [ContactFlowSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactFlowsResponse' {Maybe [ContactFlowSummary]
contactFlowSummaryList :: Maybe [ContactFlowSummary]
$sel:contactFlowSummaryList:ListContactFlowsResponse' :: ListContactFlowsResponse -> Maybe [ContactFlowSummary]
contactFlowSummaryList} -> Maybe [ContactFlowSummary]
contactFlowSummaryList) (\s :: ListContactFlowsResponse
s@ListContactFlowsResponse' {} Maybe [ContactFlowSummary]
a -> ListContactFlowsResponse
s {$sel:contactFlowSummaryList:ListContactFlowsResponse' :: Maybe [ContactFlowSummary]
contactFlowSummaryList = Maybe [ContactFlowSummary]
a} :: ListContactFlowsResponse) ((Maybe [ContactFlowSummary] -> f (Maybe [ContactFlowSummary]))
 -> ListContactFlowsResponse -> f ListContactFlowsResponse)
-> ((Maybe [ContactFlowSummary] -> f (Maybe [ContactFlowSummary]))
    -> Maybe [ContactFlowSummary] -> f (Maybe [ContactFlowSummary]))
-> (Maybe [ContactFlowSummary] -> f (Maybe [ContactFlowSummary]))
-> ListContactFlowsResponse
-> f ListContactFlowsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ContactFlowSummary]
  [ContactFlowSummary]
  [ContactFlowSummary]
  [ContactFlowSummary]
-> Iso
     (Maybe [ContactFlowSummary])
     (Maybe [ContactFlowSummary])
     (Maybe [ContactFlowSummary])
     (Maybe [ContactFlowSummary])
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
  [ContactFlowSummary]
  [ContactFlowSummary]
  [ContactFlowSummary]
  [ContactFlowSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If there are additional results, this is the token for the next set of
-- results.
listContactFlowsResponse_nextToken :: Lens.Lens' ListContactFlowsResponse (Prelude.Maybe Prelude.Text)
listContactFlowsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContactFlowsResponse -> f ListContactFlowsResponse
listContactFlowsResponse_nextToken = (ListContactFlowsResponse -> Maybe Text)
-> (ListContactFlowsResponse
    -> Maybe Text -> ListContactFlowsResponse)
-> Lens' ListContactFlowsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactFlowsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContactFlowsResponse' :: ListContactFlowsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContactFlowsResponse
s@ListContactFlowsResponse' {} Maybe Text
a -> ListContactFlowsResponse
s {$sel:nextToken:ListContactFlowsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListContactFlowsResponse)

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

instance Prelude.NFData ListContactFlowsResponse