{-# 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.ListUseCases
-- 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 use cases for the integration association.
--
-- This operation returns paginated results.
module Amazonka.Connect.ListUseCases
  ( -- * Creating a Request
    ListUseCases (..),
    newListUseCases,

    -- * Request Lenses
    listUseCases_nextToken,
    listUseCases_maxResults,
    listUseCases_instanceId,
    listUseCases_integrationAssociationId,

    -- * Destructuring the Response
    ListUseCasesResponse (..),
    newListUseCasesResponse,

    -- * Response Lenses
    listUseCasesResponse_useCaseSummaryList,
    listUseCasesResponse_nextToken,
    listUseCasesResponse_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

-- | Provides summary information about the use cases for the specified
-- integration association.
--
-- /See:/ 'newListUseCases' smart constructor.
data ListUseCases = ListUseCases'
  { -- | 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.
    ListUseCases -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per page.
    ListUseCases -> 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.
    ListUseCases -> Text
instanceId :: Prelude.Text,
    -- | The identifier for the integration association.
    ListUseCases -> Text
integrationAssociationId :: Prelude.Text
  }
  deriving (ListUseCases -> ListUseCases -> Bool
(ListUseCases -> ListUseCases -> Bool)
-> (ListUseCases -> ListUseCases -> Bool) -> Eq ListUseCases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUseCases -> ListUseCases -> Bool
$c/= :: ListUseCases -> ListUseCases -> Bool
== :: ListUseCases -> ListUseCases -> Bool
$c== :: ListUseCases -> ListUseCases -> Bool
Prelude.Eq, ReadPrec [ListUseCases]
ReadPrec ListUseCases
Int -> ReadS ListUseCases
ReadS [ListUseCases]
(Int -> ReadS ListUseCases)
-> ReadS [ListUseCases]
-> ReadPrec ListUseCases
-> ReadPrec [ListUseCases]
-> Read ListUseCases
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUseCases]
$creadListPrec :: ReadPrec [ListUseCases]
readPrec :: ReadPrec ListUseCases
$creadPrec :: ReadPrec ListUseCases
readList :: ReadS [ListUseCases]
$creadList :: ReadS [ListUseCases]
readsPrec :: Int -> ReadS ListUseCases
$creadsPrec :: Int -> ReadS ListUseCases
Prelude.Read, Int -> ListUseCases -> ShowS
[ListUseCases] -> ShowS
ListUseCases -> String
(Int -> ListUseCases -> ShowS)
-> (ListUseCases -> String)
-> ([ListUseCases] -> ShowS)
-> Show ListUseCases
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUseCases] -> ShowS
$cshowList :: [ListUseCases] -> ShowS
show :: ListUseCases -> String
$cshow :: ListUseCases -> String
showsPrec :: Int -> ListUseCases -> ShowS
$cshowsPrec :: Int -> ListUseCases -> ShowS
Prelude.Show, (forall x. ListUseCases -> Rep ListUseCases x)
-> (forall x. Rep ListUseCases x -> ListUseCases)
-> Generic ListUseCases
forall x. Rep ListUseCases x -> ListUseCases
forall x. ListUseCases -> Rep ListUseCases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUseCases x -> ListUseCases
$cfrom :: forall x. ListUseCases -> Rep ListUseCases x
Prelude.Generic)

-- |
-- Create a value of 'ListUseCases' 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', 'listUseCases_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', 'listUseCases_maxResults' - The maximum number of results to return per page.
--
-- 'instanceId', 'listUseCases_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'integrationAssociationId', 'listUseCases_integrationAssociationId' - The identifier for the integration association.
newListUseCases ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'integrationAssociationId'
  Prelude.Text ->
  ListUseCases
newListUseCases :: Text -> Text -> ListUseCases
newListUseCases
  Text
pInstanceId_
  Text
pIntegrationAssociationId_ =
    ListUseCases' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListUseCases
ListUseCases'
      { $sel:nextToken:ListUseCases' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListUseCases' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:ListUseCases' :: Text
instanceId = Text
pInstanceId_,
        $sel:integrationAssociationId:ListUseCases' :: Text
integrationAssociationId =
          Text
pIntegrationAssociationId_
      }

-- | 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.
listUseCases_nextToken :: Lens.Lens' ListUseCases (Prelude.Maybe Prelude.Text)
listUseCases_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListUseCases -> f ListUseCases
listUseCases_nextToken = (ListUseCases -> Maybe Text)
-> (ListUseCases -> Maybe Text -> ListUseCases)
-> Lens ListUseCases ListUseCases (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUseCases' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUseCases' :: ListUseCases -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUseCases
s@ListUseCases' {} Maybe Text
a -> ListUseCases
s {$sel:nextToken:ListUseCases' :: Maybe Text
nextToken = Maybe Text
a} :: ListUseCases)

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

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

-- | The identifier for the integration association.
listUseCases_integrationAssociationId :: Lens.Lens' ListUseCases Prelude.Text
listUseCases_integrationAssociationId :: (Text -> f Text) -> ListUseCases -> f ListUseCases
listUseCases_integrationAssociationId = (ListUseCases -> Text)
-> (ListUseCases -> Text -> ListUseCases)
-> Lens ListUseCases ListUseCases Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUseCases' {Text
integrationAssociationId :: Text
$sel:integrationAssociationId:ListUseCases' :: ListUseCases -> Text
integrationAssociationId} -> Text
integrationAssociationId) (\s :: ListUseCases
s@ListUseCases' {} Text
a -> ListUseCases
s {$sel:integrationAssociationId:ListUseCases' :: Text
integrationAssociationId = Text
a} :: ListUseCases)

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

instance Prelude.NFData ListUseCases

instance Core.ToHeaders ListUseCases where
  toHeaders :: ListUseCases -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUseCases -> 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 ListUseCases where
  toPath :: ListUseCases -> ByteString
toPath ListUseCases' {Maybe Natural
Maybe Text
Text
integrationAssociationId :: Text
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:integrationAssociationId:ListUseCases' :: ListUseCases -> Text
$sel:instanceId:ListUseCases' :: ListUseCases -> Text
$sel:maxResults:ListUseCases' :: ListUseCases -> Maybe Natural
$sel:nextToken:ListUseCases' :: ListUseCases -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/instance/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/integration-associations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
integrationAssociationId,
        ByteString
"/use-cases"
      ]

instance Core.ToQuery ListUseCases where
  toQuery :: ListUseCases -> QueryString
toQuery ListUseCases' {Maybe Natural
Maybe Text
Text
integrationAssociationId :: Text
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:integrationAssociationId:ListUseCases' :: ListUseCases -> Text
$sel:instanceId:ListUseCases' :: ListUseCases -> Text
$sel:maxResults:ListUseCases' :: ListUseCases -> Maybe Natural
$sel:nextToken:ListUseCases' :: ListUseCases -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

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

-- |
-- Create a value of 'ListUseCasesResponse' 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:
--
-- 'useCaseSummaryList', 'listUseCasesResponse_useCaseSummaryList' - The use cases.
--
-- 'nextToken', 'listUseCasesResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'httpStatus', 'listUseCasesResponse_httpStatus' - The response's http status code.
newListUseCasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUseCasesResponse
newListUseCasesResponse :: Int -> ListUseCasesResponse
newListUseCasesResponse Int
pHttpStatus_ =
  ListUseCasesResponse' :: Maybe [UseCase] -> Maybe Text -> Int -> ListUseCasesResponse
ListUseCasesResponse'
    { $sel:useCaseSummaryList:ListUseCasesResponse' :: Maybe [UseCase]
useCaseSummaryList =
        Maybe [UseCase]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListUseCasesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUseCasesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The use cases.
listUseCasesResponse_useCaseSummaryList :: Lens.Lens' ListUseCasesResponse (Prelude.Maybe [UseCase])
listUseCasesResponse_useCaseSummaryList :: (Maybe [UseCase] -> f (Maybe [UseCase]))
-> ListUseCasesResponse -> f ListUseCasesResponse
listUseCasesResponse_useCaseSummaryList = (ListUseCasesResponse -> Maybe [UseCase])
-> (ListUseCasesResponse
    -> Maybe [UseCase] -> ListUseCasesResponse)
-> Lens' ListUseCasesResponse (Maybe [UseCase])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUseCasesResponse' {Maybe [UseCase]
useCaseSummaryList :: Maybe [UseCase]
$sel:useCaseSummaryList:ListUseCasesResponse' :: ListUseCasesResponse -> Maybe [UseCase]
useCaseSummaryList} -> Maybe [UseCase]
useCaseSummaryList) (\s :: ListUseCasesResponse
s@ListUseCasesResponse' {} Maybe [UseCase]
a -> ListUseCasesResponse
s {$sel:useCaseSummaryList:ListUseCasesResponse' :: Maybe [UseCase]
useCaseSummaryList = Maybe [UseCase]
a} :: ListUseCasesResponse) ((Maybe [UseCase] -> f (Maybe [UseCase]))
 -> ListUseCasesResponse -> f ListUseCasesResponse)
-> ((Maybe [UseCase] -> f (Maybe [UseCase]))
    -> Maybe [UseCase] -> f (Maybe [UseCase]))
-> (Maybe [UseCase] -> f (Maybe [UseCase]))
-> ListUseCasesResponse
-> f ListUseCasesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UseCase] [UseCase] [UseCase] [UseCase]
-> Iso
     (Maybe [UseCase])
     (Maybe [UseCase])
     (Maybe [UseCase])
     (Maybe [UseCase])
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 [UseCase] [UseCase] [UseCase] [UseCase]
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.
listUseCasesResponse_nextToken :: Lens.Lens' ListUseCasesResponse (Prelude.Maybe Prelude.Text)
listUseCasesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUseCasesResponse -> f ListUseCasesResponse
listUseCasesResponse_nextToken = (ListUseCasesResponse -> Maybe Text)
-> (ListUseCasesResponse -> Maybe Text -> ListUseCasesResponse)
-> Lens' ListUseCasesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUseCasesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUseCasesResponse' :: ListUseCasesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUseCasesResponse
s@ListUseCasesResponse' {} Maybe Text
a -> ListUseCasesResponse
s {$sel:nextToken:ListUseCasesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUseCasesResponse)

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

instance Prelude.NFData ListUseCasesResponse