{-# 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.CodeBuild.DescribeTestCases
-- 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 details about test cases for a report.
--
-- This operation returns paginated results.
module Amazonka.CodeBuild.DescribeTestCases
  ( -- * Creating a Request
    DescribeTestCases (..),
    newDescribeTestCases,

    -- * Request Lenses
    describeTestCases_nextToken,
    describeTestCases_filter,
    describeTestCases_maxResults,
    describeTestCases_reportArn,

    -- * Destructuring the Response
    DescribeTestCasesResponse (..),
    newDescribeTestCasesResponse,

    -- * Response Lenses
    describeTestCasesResponse_nextToken,
    describeTestCasesResponse_testCases,
    describeTestCasesResponse_httpStatus,
  )
where

import Amazonka.CodeBuild.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:/ 'newDescribeTestCases' smart constructor.
data DescribeTestCases = DescribeTestCases'
  { -- | During a previous call, the maximum number of items that can be returned
    -- is the value specified in @maxResults@. If there more items in the list,
    -- then a unique string called a /nextToken/ is returned. To get the next
    -- batch of items in the list, call this operation again, adding the next
    -- token to the call. To get all of the items in the list, keep calling
    -- this operation with each subsequent next token that is returned, until
    -- no more next tokens are returned.
    DescribeTestCases -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A @TestCaseFilter@ object used to filter the returned reports.
    DescribeTestCases -> Maybe TestCaseFilter
filter' :: Prelude.Maybe TestCaseFilter,
    -- | The maximum number of paginated test cases returned per response. Use
    -- @nextToken@ to iterate pages in the list of returned @TestCase@ objects.
    -- The default value is 100.
    DescribeTestCases -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the report for which test cases are returned.
    DescribeTestCases -> Text
reportArn :: Prelude.Text
  }
  deriving (DescribeTestCases -> DescribeTestCases -> Bool
(DescribeTestCases -> DescribeTestCases -> Bool)
-> (DescribeTestCases -> DescribeTestCases -> Bool)
-> Eq DescribeTestCases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTestCases -> DescribeTestCases -> Bool
$c/= :: DescribeTestCases -> DescribeTestCases -> Bool
== :: DescribeTestCases -> DescribeTestCases -> Bool
$c== :: DescribeTestCases -> DescribeTestCases -> Bool
Prelude.Eq, ReadPrec [DescribeTestCases]
ReadPrec DescribeTestCases
Int -> ReadS DescribeTestCases
ReadS [DescribeTestCases]
(Int -> ReadS DescribeTestCases)
-> ReadS [DescribeTestCases]
-> ReadPrec DescribeTestCases
-> ReadPrec [DescribeTestCases]
-> Read DescribeTestCases
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTestCases]
$creadListPrec :: ReadPrec [DescribeTestCases]
readPrec :: ReadPrec DescribeTestCases
$creadPrec :: ReadPrec DescribeTestCases
readList :: ReadS [DescribeTestCases]
$creadList :: ReadS [DescribeTestCases]
readsPrec :: Int -> ReadS DescribeTestCases
$creadsPrec :: Int -> ReadS DescribeTestCases
Prelude.Read, Int -> DescribeTestCases -> ShowS
[DescribeTestCases] -> ShowS
DescribeTestCases -> String
(Int -> DescribeTestCases -> ShowS)
-> (DescribeTestCases -> String)
-> ([DescribeTestCases] -> ShowS)
-> Show DescribeTestCases
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTestCases] -> ShowS
$cshowList :: [DescribeTestCases] -> ShowS
show :: DescribeTestCases -> String
$cshow :: DescribeTestCases -> String
showsPrec :: Int -> DescribeTestCases -> ShowS
$cshowsPrec :: Int -> DescribeTestCases -> ShowS
Prelude.Show, (forall x. DescribeTestCases -> Rep DescribeTestCases x)
-> (forall x. Rep DescribeTestCases x -> DescribeTestCases)
-> Generic DescribeTestCases
forall x. Rep DescribeTestCases x -> DescribeTestCases
forall x. DescribeTestCases -> Rep DescribeTestCases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTestCases x -> DescribeTestCases
$cfrom :: forall x. DescribeTestCases -> Rep DescribeTestCases x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTestCases' 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', 'describeTestCases_nextToken' - During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
--
-- 'filter'', 'describeTestCases_filter' - A @TestCaseFilter@ object used to filter the returned reports.
--
-- 'maxResults', 'describeTestCases_maxResults' - The maximum number of paginated test cases returned per response. Use
-- @nextToken@ to iterate pages in the list of returned @TestCase@ objects.
-- The default value is 100.
--
-- 'reportArn', 'describeTestCases_reportArn' - The ARN of the report for which test cases are returned.
newDescribeTestCases ::
  -- | 'reportArn'
  Prelude.Text ->
  DescribeTestCases
newDescribeTestCases :: Text -> DescribeTestCases
newDescribeTestCases Text
pReportArn_ =
  DescribeTestCases' :: Maybe Text
-> Maybe TestCaseFilter
-> Maybe Natural
-> Text
-> DescribeTestCases
DescribeTestCases'
    { $sel:nextToken:DescribeTestCases' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':DescribeTestCases' :: Maybe TestCaseFilter
filter' = Maybe TestCaseFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeTestCases' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:reportArn:DescribeTestCases' :: Text
reportArn = Text
pReportArn_
    }

-- | During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
describeTestCases_nextToken :: Lens.Lens' DescribeTestCases (Prelude.Maybe Prelude.Text)
describeTestCases_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeTestCases -> f DescribeTestCases
describeTestCases_nextToken = (DescribeTestCases -> Maybe Text)
-> (DescribeTestCases -> Maybe Text -> DescribeTestCases)
-> Lens
     DescribeTestCases DescribeTestCases (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTestCases' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTestCases' :: DescribeTestCases -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTestCases
s@DescribeTestCases' {} Maybe Text
a -> DescribeTestCases
s {$sel:nextToken:DescribeTestCases' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTestCases)

-- | A @TestCaseFilter@ object used to filter the returned reports.
describeTestCases_filter :: Lens.Lens' DescribeTestCases (Prelude.Maybe TestCaseFilter)
describeTestCases_filter :: (Maybe TestCaseFilter -> f (Maybe TestCaseFilter))
-> DescribeTestCases -> f DescribeTestCases
describeTestCases_filter = (DescribeTestCases -> Maybe TestCaseFilter)
-> (DescribeTestCases -> Maybe TestCaseFilter -> DescribeTestCases)
-> Lens
     DescribeTestCases
     DescribeTestCases
     (Maybe TestCaseFilter)
     (Maybe TestCaseFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTestCases' {Maybe TestCaseFilter
filter' :: Maybe TestCaseFilter
$sel:filter':DescribeTestCases' :: DescribeTestCases -> Maybe TestCaseFilter
filter'} -> Maybe TestCaseFilter
filter') (\s :: DescribeTestCases
s@DescribeTestCases' {} Maybe TestCaseFilter
a -> DescribeTestCases
s {$sel:filter':DescribeTestCases' :: Maybe TestCaseFilter
filter' = Maybe TestCaseFilter
a} :: DescribeTestCases)

-- | The maximum number of paginated test cases returned per response. Use
-- @nextToken@ to iterate pages in the list of returned @TestCase@ objects.
-- The default value is 100.
describeTestCases_maxResults :: Lens.Lens' DescribeTestCases (Prelude.Maybe Prelude.Natural)
describeTestCases_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeTestCases -> f DescribeTestCases
describeTestCases_maxResults = (DescribeTestCases -> Maybe Natural)
-> (DescribeTestCases -> Maybe Natural -> DescribeTestCases)
-> Lens
     DescribeTestCases DescribeTestCases (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTestCases' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeTestCases' :: DescribeTestCases -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeTestCases
s@DescribeTestCases' {} Maybe Natural
a -> DescribeTestCases
s {$sel:maxResults:DescribeTestCases' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeTestCases)

-- | The ARN of the report for which test cases are returned.
describeTestCases_reportArn :: Lens.Lens' DescribeTestCases Prelude.Text
describeTestCases_reportArn :: (Text -> f Text) -> DescribeTestCases -> f DescribeTestCases
describeTestCases_reportArn = (DescribeTestCases -> Text)
-> (DescribeTestCases -> Text -> DescribeTestCases)
-> Lens DescribeTestCases DescribeTestCases Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTestCases' {Text
reportArn :: Text
$sel:reportArn:DescribeTestCases' :: DescribeTestCases -> Text
reportArn} -> Text
reportArn) (\s :: DescribeTestCases
s@DescribeTestCases' {} Text
a -> DescribeTestCases
s {$sel:reportArn:DescribeTestCases' :: Text
reportArn = Text
a} :: DescribeTestCases)

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

instance Prelude.NFData DescribeTestCases

instance Core.ToHeaders DescribeTestCases where
  toHeaders :: DescribeTestCases -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeTestCases -> 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
"CodeBuild_20161006.DescribeTestCases" ::
                          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 DescribeTestCases where
  toJSON :: DescribeTestCases -> Value
toJSON DescribeTestCases' {Maybe Natural
Maybe Text
Maybe TestCaseFilter
Text
reportArn :: Text
maxResults :: Maybe Natural
filter' :: Maybe TestCaseFilter
nextToken :: Maybe Text
$sel:reportArn:DescribeTestCases' :: DescribeTestCases -> Text
$sel:maxResults:DescribeTestCases' :: DescribeTestCases -> Maybe Natural
$sel:filter':DescribeTestCases' :: DescribeTestCases -> Maybe TestCaseFilter
$sel:nextToken:DescribeTestCases' :: DescribeTestCases -> 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
"filter" Text -> TestCaseFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TestCaseFilter -> Pair) -> Maybe TestCaseFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TestCaseFilter
filter',
            (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
"reportArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reportArn)
          ]
      )

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

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

-- | /See:/ 'newDescribeTestCasesResponse' smart constructor.
data DescribeTestCasesResponse = DescribeTestCasesResponse'
  { -- | During a previous call, the maximum number of items that can be returned
    -- is the value specified in @maxResults@. If there more items in the list,
    -- then a unique string called a /nextToken/ is returned. To get the next
    -- batch of items in the list, call this operation again, adding the next
    -- token to the call. To get all of the items in the list, keep calling
    -- this operation with each subsequent next token that is returned, until
    -- no more next tokens are returned.
    DescribeTestCasesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The returned list of test cases.
    DescribeTestCasesResponse -> Maybe [TestCase]
testCases :: Prelude.Maybe [TestCase],
    -- | The response's http status code.
    DescribeTestCasesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool
(DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool)
-> (DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool)
-> Eq DescribeTestCasesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool
$c/= :: DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool
== :: DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool
$c== :: DescribeTestCasesResponse -> DescribeTestCasesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTestCasesResponse]
ReadPrec DescribeTestCasesResponse
Int -> ReadS DescribeTestCasesResponse
ReadS [DescribeTestCasesResponse]
(Int -> ReadS DescribeTestCasesResponse)
-> ReadS [DescribeTestCasesResponse]
-> ReadPrec DescribeTestCasesResponse
-> ReadPrec [DescribeTestCasesResponse]
-> Read DescribeTestCasesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTestCasesResponse]
$creadListPrec :: ReadPrec [DescribeTestCasesResponse]
readPrec :: ReadPrec DescribeTestCasesResponse
$creadPrec :: ReadPrec DescribeTestCasesResponse
readList :: ReadS [DescribeTestCasesResponse]
$creadList :: ReadS [DescribeTestCasesResponse]
readsPrec :: Int -> ReadS DescribeTestCasesResponse
$creadsPrec :: Int -> ReadS DescribeTestCasesResponse
Prelude.Read, Int -> DescribeTestCasesResponse -> ShowS
[DescribeTestCasesResponse] -> ShowS
DescribeTestCasesResponse -> String
(Int -> DescribeTestCasesResponse -> ShowS)
-> (DescribeTestCasesResponse -> String)
-> ([DescribeTestCasesResponse] -> ShowS)
-> Show DescribeTestCasesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTestCasesResponse] -> ShowS
$cshowList :: [DescribeTestCasesResponse] -> ShowS
show :: DescribeTestCasesResponse -> String
$cshow :: DescribeTestCasesResponse -> String
showsPrec :: Int -> DescribeTestCasesResponse -> ShowS
$cshowsPrec :: Int -> DescribeTestCasesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeTestCasesResponse -> Rep DescribeTestCasesResponse x)
-> (forall x.
    Rep DescribeTestCasesResponse x -> DescribeTestCasesResponse)
-> Generic DescribeTestCasesResponse
forall x.
Rep DescribeTestCasesResponse x -> DescribeTestCasesResponse
forall x.
DescribeTestCasesResponse -> Rep DescribeTestCasesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTestCasesResponse x -> DescribeTestCasesResponse
$cfrom :: forall x.
DescribeTestCasesResponse -> Rep DescribeTestCasesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTestCasesResponse' 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', 'describeTestCasesResponse_nextToken' - During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
--
-- 'testCases', 'describeTestCasesResponse_testCases' - The returned list of test cases.
--
-- 'httpStatus', 'describeTestCasesResponse_httpStatus' - The response's http status code.
newDescribeTestCasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTestCasesResponse
newDescribeTestCasesResponse :: Int -> DescribeTestCasesResponse
newDescribeTestCasesResponse Int
pHttpStatus_ =
  DescribeTestCasesResponse' :: Maybe Text -> Maybe [TestCase] -> Int -> DescribeTestCasesResponse
DescribeTestCasesResponse'
    { $sel:nextToken:DescribeTestCasesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:testCases:DescribeTestCasesResponse' :: Maybe [TestCase]
testCases = Maybe [TestCase]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTestCasesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
describeTestCasesResponse_nextToken :: Lens.Lens' DescribeTestCasesResponse (Prelude.Maybe Prelude.Text)
describeTestCasesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeTestCasesResponse -> f DescribeTestCasesResponse
describeTestCasesResponse_nextToken = (DescribeTestCasesResponse -> Maybe Text)
-> (DescribeTestCasesResponse
    -> Maybe Text -> DescribeTestCasesResponse)
-> Lens' DescribeTestCasesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTestCasesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTestCasesResponse' :: DescribeTestCasesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTestCasesResponse
s@DescribeTestCasesResponse' {} Maybe Text
a -> DescribeTestCasesResponse
s {$sel:nextToken:DescribeTestCasesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTestCasesResponse)

-- | The returned list of test cases.
describeTestCasesResponse_testCases :: Lens.Lens' DescribeTestCasesResponse (Prelude.Maybe [TestCase])
describeTestCasesResponse_testCases :: (Maybe [TestCase] -> f (Maybe [TestCase]))
-> DescribeTestCasesResponse -> f DescribeTestCasesResponse
describeTestCasesResponse_testCases = (DescribeTestCasesResponse -> Maybe [TestCase])
-> (DescribeTestCasesResponse
    -> Maybe [TestCase] -> DescribeTestCasesResponse)
-> Lens' DescribeTestCasesResponse (Maybe [TestCase])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTestCasesResponse' {Maybe [TestCase]
testCases :: Maybe [TestCase]
$sel:testCases:DescribeTestCasesResponse' :: DescribeTestCasesResponse -> Maybe [TestCase]
testCases} -> Maybe [TestCase]
testCases) (\s :: DescribeTestCasesResponse
s@DescribeTestCasesResponse' {} Maybe [TestCase]
a -> DescribeTestCasesResponse
s {$sel:testCases:DescribeTestCasesResponse' :: Maybe [TestCase]
testCases = Maybe [TestCase]
a} :: DescribeTestCasesResponse) ((Maybe [TestCase] -> f (Maybe [TestCase]))
 -> DescribeTestCasesResponse -> f DescribeTestCasesResponse)
-> ((Maybe [TestCase] -> f (Maybe [TestCase]))
    -> Maybe [TestCase] -> f (Maybe [TestCase]))
-> (Maybe [TestCase] -> f (Maybe [TestCase]))
-> DescribeTestCasesResponse
-> f DescribeTestCasesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TestCase] [TestCase] [TestCase] [TestCase]
-> Iso
     (Maybe [TestCase])
     (Maybe [TestCase])
     (Maybe [TestCase])
     (Maybe [TestCase])
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 [TestCase] [TestCase] [TestCase] [TestCase]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeTestCasesResponse