{-# 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.DeviceFarm.ListUniqueProblems
-- 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)
--
-- Gets information about unique problems, such as exceptions or crashes.
--
-- Unique problems are defined as a single instance of an error across a
-- run, job, or suite. For example, if a call in your application
-- consistently raises an exception
-- (@OutOfBoundsException in MyActivity.java:386@), @ListUniqueProblems@
-- returns a single entry instead of many individual entries for that
-- exception.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.ListUniqueProblems
  ( -- * Creating a Request
    ListUniqueProblems (..),
    newListUniqueProblems,

    -- * Request Lenses
    listUniqueProblems_nextToken,
    listUniqueProblems_arn,

    -- * Destructuring the Response
    ListUniqueProblemsResponse (..),
    newListUniqueProblemsResponse,

    -- * Response Lenses
    listUniqueProblemsResponse_nextToken,
    listUniqueProblemsResponse_uniqueProblems,
    listUniqueProblemsResponse_httpStatus,
  )
where

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

-- | Represents a request to the list unique problems operation.
--
-- /See:/ 'newListUniqueProblems' smart constructor.
data ListUniqueProblems = ListUniqueProblems'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListUniqueProblems -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The unique problems\' ARNs.
    ListUniqueProblems -> Text
arn :: Prelude.Text
  }
  deriving (ListUniqueProblems -> ListUniqueProblems -> Bool
(ListUniqueProblems -> ListUniqueProblems -> Bool)
-> (ListUniqueProblems -> ListUniqueProblems -> Bool)
-> Eq ListUniqueProblems
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUniqueProblems -> ListUniqueProblems -> Bool
$c/= :: ListUniqueProblems -> ListUniqueProblems -> Bool
== :: ListUniqueProblems -> ListUniqueProblems -> Bool
$c== :: ListUniqueProblems -> ListUniqueProblems -> Bool
Prelude.Eq, ReadPrec [ListUniqueProblems]
ReadPrec ListUniqueProblems
Int -> ReadS ListUniqueProblems
ReadS [ListUniqueProblems]
(Int -> ReadS ListUniqueProblems)
-> ReadS [ListUniqueProblems]
-> ReadPrec ListUniqueProblems
-> ReadPrec [ListUniqueProblems]
-> Read ListUniqueProblems
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUniqueProblems]
$creadListPrec :: ReadPrec [ListUniqueProblems]
readPrec :: ReadPrec ListUniqueProblems
$creadPrec :: ReadPrec ListUniqueProblems
readList :: ReadS [ListUniqueProblems]
$creadList :: ReadS [ListUniqueProblems]
readsPrec :: Int -> ReadS ListUniqueProblems
$creadsPrec :: Int -> ReadS ListUniqueProblems
Prelude.Read, Int -> ListUniqueProblems -> ShowS
[ListUniqueProblems] -> ShowS
ListUniqueProblems -> String
(Int -> ListUniqueProblems -> ShowS)
-> (ListUniqueProblems -> String)
-> ([ListUniqueProblems] -> ShowS)
-> Show ListUniqueProblems
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUniqueProblems] -> ShowS
$cshowList :: [ListUniqueProblems] -> ShowS
show :: ListUniqueProblems -> String
$cshow :: ListUniqueProblems -> String
showsPrec :: Int -> ListUniqueProblems -> ShowS
$cshowsPrec :: Int -> ListUniqueProblems -> ShowS
Prelude.Show, (forall x. ListUniqueProblems -> Rep ListUniqueProblems x)
-> (forall x. Rep ListUniqueProblems x -> ListUniqueProblems)
-> Generic ListUniqueProblems
forall x. Rep ListUniqueProblems x -> ListUniqueProblems
forall x. ListUniqueProblems -> Rep ListUniqueProblems x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUniqueProblems x -> ListUniqueProblems
$cfrom :: forall x. ListUniqueProblems -> Rep ListUniqueProblems x
Prelude.Generic)

-- |
-- Create a value of 'ListUniqueProblems' 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', 'listUniqueProblems_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'arn', 'listUniqueProblems_arn' - The unique problems\' ARNs.
newListUniqueProblems ::
  -- | 'arn'
  Prelude.Text ->
  ListUniqueProblems
newListUniqueProblems :: Text -> ListUniqueProblems
newListUniqueProblems Text
pArn_ =
  ListUniqueProblems' :: Maybe Text -> Text -> ListUniqueProblems
ListUniqueProblems'
    { $sel:nextToken:ListUniqueProblems' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ListUniqueProblems' :: Text
arn = Text
pArn_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listUniqueProblems_nextToken :: Lens.Lens' ListUniqueProblems (Prelude.Maybe Prelude.Text)
listUniqueProblems_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUniqueProblems -> f ListUniqueProblems
listUniqueProblems_nextToken = (ListUniqueProblems -> Maybe Text)
-> (ListUniqueProblems -> Maybe Text -> ListUniqueProblems)
-> Lens
     ListUniqueProblems ListUniqueProblems (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUniqueProblems' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUniqueProblems' :: ListUniqueProblems -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUniqueProblems
s@ListUniqueProblems' {} Maybe Text
a -> ListUniqueProblems
s {$sel:nextToken:ListUniqueProblems' :: Maybe Text
nextToken = Maybe Text
a} :: ListUniqueProblems)

-- | The unique problems\' ARNs.
listUniqueProblems_arn :: Lens.Lens' ListUniqueProblems Prelude.Text
listUniqueProblems_arn :: (Text -> f Text) -> ListUniqueProblems -> f ListUniqueProblems
listUniqueProblems_arn = (ListUniqueProblems -> Text)
-> (ListUniqueProblems -> Text -> ListUniqueProblems)
-> Lens ListUniqueProblems ListUniqueProblems Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUniqueProblems' {Text
arn :: Text
$sel:arn:ListUniqueProblems' :: ListUniqueProblems -> Text
arn} -> Text
arn) (\s :: ListUniqueProblems
s@ListUniqueProblems' {} Text
a -> ListUniqueProblems
s {$sel:arn:ListUniqueProblems' :: Text
arn = Text
a} :: ListUniqueProblems)

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

instance Prelude.NFData ListUniqueProblems

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

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

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

-- | Represents the result of a list unique problems request.
--
-- /See:/ 'newListUniqueProblemsResponse' smart constructor.
data ListUniqueProblemsResponse = ListUniqueProblemsResponse'
  { -- | If the number of items that are returned is significantly large, this is
    -- an identifier that is also returned. It can be used in a subsequent call
    -- to this operation to return the next set of items in the list.
    ListUniqueProblemsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the unique problems.
    --
    -- Allowed values include:
    --
    -- -   PENDING
    --
    -- -   PASSED
    --
    -- -   WARNED
    --
    -- -   FAILED
    --
    -- -   SKIPPED
    --
    -- -   ERRORED
    --
    -- -   STOPPED
    ListUniqueProblemsResponse
-> Maybe (HashMap ExecutionResult [UniqueProblem])
uniqueProblems :: Prelude.Maybe (Prelude.HashMap ExecutionResult [UniqueProblem]),
    -- | The response's http status code.
    ListUniqueProblemsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUniqueProblemsResponse -> ListUniqueProblemsResponse -> Bool
(ListUniqueProblemsResponse -> ListUniqueProblemsResponse -> Bool)
-> (ListUniqueProblemsResponse
    -> ListUniqueProblemsResponse -> Bool)
-> Eq ListUniqueProblemsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUniqueProblemsResponse -> ListUniqueProblemsResponse -> Bool
$c/= :: ListUniqueProblemsResponse -> ListUniqueProblemsResponse -> Bool
== :: ListUniqueProblemsResponse -> ListUniqueProblemsResponse -> Bool
$c== :: ListUniqueProblemsResponse -> ListUniqueProblemsResponse -> Bool
Prelude.Eq, ReadPrec [ListUniqueProblemsResponse]
ReadPrec ListUniqueProblemsResponse
Int -> ReadS ListUniqueProblemsResponse
ReadS [ListUniqueProblemsResponse]
(Int -> ReadS ListUniqueProblemsResponse)
-> ReadS [ListUniqueProblemsResponse]
-> ReadPrec ListUniqueProblemsResponse
-> ReadPrec [ListUniqueProblemsResponse]
-> Read ListUniqueProblemsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUniqueProblemsResponse]
$creadListPrec :: ReadPrec [ListUniqueProblemsResponse]
readPrec :: ReadPrec ListUniqueProblemsResponse
$creadPrec :: ReadPrec ListUniqueProblemsResponse
readList :: ReadS [ListUniqueProblemsResponse]
$creadList :: ReadS [ListUniqueProblemsResponse]
readsPrec :: Int -> ReadS ListUniqueProblemsResponse
$creadsPrec :: Int -> ReadS ListUniqueProblemsResponse
Prelude.Read, Int -> ListUniqueProblemsResponse -> ShowS
[ListUniqueProblemsResponse] -> ShowS
ListUniqueProblemsResponse -> String
(Int -> ListUniqueProblemsResponse -> ShowS)
-> (ListUniqueProblemsResponse -> String)
-> ([ListUniqueProblemsResponse] -> ShowS)
-> Show ListUniqueProblemsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUniqueProblemsResponse] -> ShowS
$cshowList :: [ListUniqueProblemsResponse] -> ShowS
show :: ListUniqueProblemsResponse -> String
$cshow :: ListUniqueProblemsResponse -> String
showsPrec :: Int -> ListUniqueProblemsResponse -> ShowS
$cshowsPrec :: Int -> ListUniqueProblemsResponse -> ShowS
Prelude.Show, (forall x.
 ListUniqueProblemsResponse -> Rep ListUniqueProblemsResponse x)
-> (forall x.
    Rep ListUniqueProblemsResponse x -> ListUniqueProblemsResponse)
-> Generic ListUniqueProblemsResponse
forall x.
Rep ListUniqueProblemsResponse x -> ListUniqueProblemsResponse
forall x.
ListUniqueProblemsResponse -> Rep ListUniqueProblemsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUniqueProblemsResponse x -> ListUniqueProblemsResponse
$cfrom :: forall x.
ListUniqueProblemsResponse -> Rep ListUniqueProblemsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUniqueProblemsResponse' 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', 'listUniqueProblemsResponse_nextToken' - If the number of items that are returned is significantly large, this is
-- an identifier that is also returned. It can be used in a subsequent call
-- to this operation to return the next set of items in the list.
--
-- 'uniqueProblems', 'listUniqueProblemsResponse_uniqueProblems' - Information about the unique problems.
--
-- Allowed values include:
--
-- -   PENDING
--
-- -   PASSED
--
-- -   WARNED
--
-- -   FAILED
--
-- -   SKIPPED
--
-- -   ERRORED
--
-- -   STOPPED
--
-- 'httpStatus', 'listUniqueProblemsResponse_httpStatus' - The response's http status code.
newListUniqueProblemsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUniqueProblemsResponse
newListUniqueProblemsResponse :: Int -> ListUniqueProblemsResponse
newListUniqueProblemsResponse Int
pHttpStatus_ =
  ListUniqueProblemsResponse' :: Maybe Text
-> Maybe (HashMap ExecutionResult [UniqueProblem])
-> Int
-> ListUniqueProblemsResponse
ListUniqueProblemsResponse'
    { $sel:nextToken:ListUniqueProblemsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:uniqueProblems:ListUniqueProblemsResponse' :: Maybe (HashMap ExecutionResult [UniqueProblem])
uniqueProblems = Maybe (HashMap ExecutionResult [UniqueProblem])
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUniqueProblemsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the number of items that are returned is significantly large, this is
-- an identifier that is also returned. It can be used in a subsequent call
-- to this operation to return the next set of items in the list.
listUniqueProblemsResponse_nextToken :: Lens.Lens' ListUniqueProblemsResponse (Prelude.Maybe Prelude.Text)
listUniqueProblemsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUniqueProblemsResponse -> f ListUniqueProblemsResponse
listUniqueProblemsResponse_nextToken = (ListUniqueProblemsResponse -> Maybe Text)
-> (ListUniqueProblemsResponse
    -> Maybe Text -> ListUniqueProblemsResponse)
-> Lens' ListUniqueProblemsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUniqueProblemsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUniqueProblemsResponse' :: ListUniqueProblemsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUniqueProblemsResponse
s@ListUniqueProblemsResponse' {} Maybe Text
a -> ListUniqueProblemsResponse
s {$sel:nextToken:ListUniqueProblemsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUniqueProblemsResponse)

-- | Information about the unique problems.
--
-- Allowed values include:
--
-- -   PENDING
--
-- -   PASSED
--
-- -   WARNED
--
-- -   FAILED
--
-- -   SKIPPED
--
-- -   ERRORED
--
-- -   STOPPED
listUniqueProblemsResponse_uniqueProblems :: Lens.Lens' ListUniqueProblemsResponse (Prelude.Maybe (Prelude.HashMap ExecutionResult [UniqueProblem]))
listUniqueProblemsResponse_uniqueProblems :: (Maybe (HashMap ExecutionResult [UniqueProblem])
 -> f (Maybe (HashMap ExecutionResult [UniqueProblem])))
-> ListUniqueProblemsResponse -> f ListUniqueProblemsResponse
listUniqueProblemsResponse_uniqueProblems = (ListUniqueProblemsResponse
 -> Maybe (HashMap ExecutionResult [UniqueProblem]))
-> (ListUniqueProblemsResponse
    -> Maybe (HashMap ExecutionResult [UniqueProblem])
    -> ListUniqueProblemsResponse)
-> Lens'
     ListUniqueProblemsResponse
     (Maybe (HashMap ExecutionResult [UniqueProblem]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUniqueProblemsResponse' {Maybe (HashMap ExecutionResult [UniqueProblem])
uniqueProblems :: Maybe (HashMap ExecutionResult [UniqueProblem])
$sel:uniqueProblems:ListUniqueProblemsResponse' :: ListUniqueProblemsResponse
-> Maybe (HashMap ExecutionResult [UniqueProblem])
uniqueProblems} -> Maybe (HashMap ExecutionResult [UniqueProblem])
uniqueProblems) (\s :: ListUniqueProblemsResponse
s@ListUniqueProblemsResponse' {} Maybe (HashMap ExecutionResult [UniqueProblem])
a -> ListUniqueProblemsResponse
s {$sel:uniqueProblems:ListUniqueProblemsResponse' :: Maybe (HashMap ExecutionResult [UniqueProblem])
uniqueProblems = Maybe (HashMap ExecutionResult [UniqueProblem])
a} :: ListUniqueProblemsResponse) ((Maybe (HashMap ExecutionResult [UniqueProblem])
  -> f (Maybe (HashMap ExecutionResult [UniqueProblem])))
 -> ListUniqueProblemsResponse -> f ListUniqueProblemsResponse)
-> ((Maybe (HashMap ExecutionResult [UniqueProblem])
     -> f (Maybe (HashMap ExecutionResult [UniqueProblem])))
    -> Maybe (HashMap ExecutionResult [UniqueProblem])
    -> f (Maybe (HashMap ExecutionResult [UniqueProblem])))
-> (Maybe (HashMap ExecutionResult [UniqueProblem])
    -> f (Maybe (HashMap ExecutionResult [UniqueProblem])))
-> ListUniqueProblemsResponse
-> f ListUniqueProblemsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap ExecutionResult [UniqueProblem])
  (HashMap ExecutionResult [UniqueProblem])
  (HashMap ExecutionResult [UniqueProblem])
  (HashMap ExecutionResult [UniqueProblem])
-> Iso
     (Maybe (HashMap ExecutionResult [UniqueProblem]))
     (Maybe (HashMap ExecutionResult [UniqueProblem]))
     (Maybe (HashMap ExecutionResult [UniqueProblem]))
     (Maybe (HashMap ExecutionResult [UniqueProblem]))
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
  (HashMap ExecutionResult [UniqueProblem])
  (HashMap ExecutionResult [UniqueProblem])
  (HashMap ExecutionResult [UniqueProblem])
  (HashMap ExecutionResult [UniqueProblem])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListUniqueProblemsResponse