{-# 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.Inspector.ListAssessmentTargets
-- 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 ARNs of the assessment targets within this AWS account. For
-- more information about assessment targets, see
-- <https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html Amazon Inspector Assessment Targets>.
--
-- This operation returns paginated results.
module Amazonka.Inspector.ListAssessmentTargets
  ( -- * Creating a Request
    ListAssessmentTargets (..),
    newListAssessmentTargets,

    -- * Request Lenses
    listAssessmentTargets_nextToken,
    listAssessmentTargets_filter,
    listAssessmentTargets_maxResults,

    -- * Destructuring the Response
    ListAssessmentTargetsResponse (..),
    newListAssessmentTargetsResponse,

    -- * Response Lenses
    listAssessmentTargetsResponse_nextToken,
    listAssessmentTargetsResponse_httpStatus,
    listAssessmentTargetsResponse_assessmentTargetArns,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Inspector.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

-- | /See:/ 'newListAssessmentTargets' smart constructor.
data ListAssessmentTargets = ListAssessmentTargets'
  { -- | You can use this parameter when paginating results. Set the value of
    -- this parameter to null on your first call to the
    -- __ListAssessmentTargets__ action. Subsequent calls to the action fill
    -- __nextToken__ in the request with the value of __NextToken__ from the
    -- previous response to continue listing data.
    ListAssessmentTargets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | You can use this parameter to specify a subset of data to be included in
    -- the action\'s response.
    --
    -- For a record to match a filter, all specified filter attributes must
    -- match. When multiple values are specified for a filter attribute, any of
    -- the values can match.
    ListAssessmentTargets -> Maybe AssessmentTargetFilter
filter' :: Prelude.Maybe AssessmentTargetFilter,
    -- | You can use this parameter to indicate the maximum number of items you
    -- want in the response. The default value is 10. The maximum value is 500.
    ListAssessmentTargets -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListAssessmentTargets -> ListAssessmentTargets -> Bool
(ListAssessmentTargets -> ListAssessmentTargets -> Bool)
-> (ListAssessmentTargets -> ListAssessmentTargets -> Bool)
-> Eq ListAssessmentTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssessmentTargets -> ListAssessmentTargets -> Bool
$c/= :: ListAssessmentTargets -> ListAssessmentTargets -> Bool
== :: ListAssessmentTargets -> ListAssessmentTargets -> Bool
$c== :: ListAssessmentTargets -> ListAssessmentTargets -> Bool
Prelude.Eq, ReadPrec [ListAssessmentTargets]
ReadPrec ListAssessmentTargets
Int -> ReadS ListAssessmentTargets
ReadS [ListAssessmentTargets]
(Int -> ReadS ListAssessmentTargets)
-> ReadS [ListAssessmentTargets]
-> ReadPrec ListAssessmentTargets
-> ReadPrec [ListAssessmentTargets]
-> Read ListAssessmentTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssessmentTargets]
$creadListPrec :: ReadPrec [ListAssessmentTargets]
readPrec :: ReadPrec ListAssessmentTargets
$creadPrec :: ReadPrec ListAssessmentTargets
readList :: ReadS [ListAssessmentTargets]
$creadList :: ReadS [ListAssessmentTargets]
readsPrec :: Int -> ReadS ListAssessmentTargets
$creadsPrec :: Int -> ReadS ListAssessmentTargets
Prelude.Read, Int -> ListAssessmentTargets -> ShowS
[ListAssessmentTargets] -> ShowS
ListAssessmentTargets -> String
(Int -> ListAssessmentTargets -> ShowS)
-> (ListAssessmentTargets -> String)
-> ([ListAssessmentTargets] -> ShowS)
-> Show ListAssessmentTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssessmentTargets] -> ShowS
$cshowList :: [ListAssessmentTargets] -> ShowS
show :: ListAssessmentTargets -> String
$cshow :: ListAssessmentTargets -> String
showsPrec :: Int -> ListAssessmentTargets -> ShowS
$cshowsPrec :: Int -> ListAssessmentTargets -> ShowS
Prelude.Show, (forall x. ListAssessmentTargets -> Rep ListAssessmentTargets x)
-> (forall x. Rep ListAssessmentTargets x -> ListAssessmentTargets)
-> Generic ListAssessmentTargets
forall x. Rep ListAssessmentTargets x -> ListAssessmentTargets
forall x. ListAssessmentTargets -> Rep ListAssessmentTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssessmentTargets x -> ListAssessmentTargets
$cfrom :: forall x. ListAssessmentTargets -> Rep ListAssessmentTargets x
Prelude.Generic)

-- |
-- Create a value of 'ListAssessmentTargets' 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', 'listAssessmentTargets_nextToken' - You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the
-- __ListAssessmentTargets__ action. Subsequent calls to the action fill
-- __nextToken__ in the request with the value of __NextToken__ from the
-- previous response to continue listing data.
--
-- 'filter'', 'listAssessmentTargets_filter' - You can use this parameter to specify a subset of data to be included in
-- the action\'s response.
--
-- For a record to match a filter, all specified filter attributes must
-- match. When multiple values are specified for a filter attribute, any of
-- the values can match.
--
-- 'maxResults', 'listAssessmentTargets_maxResults' - You can use this parameter to indicate the maximum number of items you
-- want in the response. The default value is 10. The maximum value is 500.
newListAssessmentTargets ::
  ListAssessmentTargets
newListAssessmentTargets :: ListAssessmentTargets
newListAssessmentTargets =
  ListAssessmentTargets' :: Maybe Text
-> Maybe AssessmentTargetFilter
-> Maybe Int
-> ListAssessmentTargets
ListAssessmentTargets'
    { $sel:nextToken:ListAssessmentTargets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListAssessmentTargets' :: Maybe AssessmentTargetFilter
filter' = Maybe AssessmentTargetFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAssessmentTargets' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | You can use this parameter when paginating results. Set the value of
-- this parameter to null on your first call to the
-- __ListAssessmentTargets__ action. Subsequent calls to the action fill
-- __nextToken__ in the request with the value of __NextToken__ from the
-- previous response to continue listing data.
listAssessmentTargets_nextToken :: Lens.Lens' ListAssessmentTargets (Prelude.Maybe Prelude.Text)
listAssessmentTargets_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssessmentTargets -> f ListAssessmentTargets
listAssessmentTargets_nextToken = (ListAssessmentTargets -> Maybe Text)
-> (ListAssessmentTargets -> Maybe Text -> ListAssessmentTargets)
-> Lens
     ListAssessmentTargets
     ListAssessmentTargets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssessmentTargets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssessmentTargets' :: ListAssessmentTargets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssessmentTargets
s@ListAssessmentTargets' {} Maybe Text
a -> ListAssessmentTargets
s {$sel:nextToken:ListAssessmentTargets' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssessmentTargets)

-- | You can use this parameter to specify a subset of data to be included in
-- the action\'s response.
--
-- For a record to match a filter, all specified filter attributes must
-- match. When multiple values are specified for a filter attribute, any of
-- the values can match.
listAssessmentTargets_filter :: Lens.Lens' ListAssessmentTargets (Prelude.Maybe AssessmentTargetFilter)
listAssessmentTargets_filter :: (Maybe AssessmentTargetFilter -> f (Maybe AssessmentTargetFilter))
-> ListAssessmentTargets -> f ListAssessmentTargets
listAssessmentTargets_filter = (ListAssessmentTargets -> Maybe AssessmentTargetFilter)
-> (ListAssessmentTargets
    -> Maybe AssessmentTargetFilter -> ListAssessmentTargets)
-> Lens
     ListAssessmentTargets
     ListAssessmentTargets
     (Maybe AssessmentTargetFilter)
     (Maybe AssessmentTargetFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssessmentTargets' {Maybe AssessmentTargetFilter
filter' :: Maybe AssessmentTargetFilter
$sel:filter':ListAssessmentTargets' :: ListAssessmentTargets -> Maybe AssessmentTargetFilter
filter'} -> Maybe AssessmentTargetFilter
filter') (\s :: ListAssessmentTargets
s@ListAssessmentTargets' {} Maybe AssessmentTargetFilter
a -> ListAssessmentTargets
s {$sel:filter':ListAssessmentTargets' :: Maybe AssessmentTargetFilter
filter' = Maybe AssessmentTargetFilter
a} :: ListAssessmentTargets)

-- | You can use this parameter to indicate the maximum number of items you
-- want in the response. The default value is 10. The maximum value is 500.
listAssessmentTargets_maxResults :: Lens.Lens' ListAssessmentTargets (Prelude.Maybe Prelude.Int)
listAssessmentTargets_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListAssessmentTargets -> f ListAssessmentTargets
listAssessmentTargets_maxResults = (ListAssessmentTargets -> Maybe Int)
-> (ListAssessmentTargets -> Maybe Int -> ListAssessmentTargets)
-> Lens
     ListAssessmentTargets ListAssessmentTargets (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssessmentTargets' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListAssessmentTargets' :: ListAssessmentTargets -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListAssessmentTargets
s@ListAssessmentTargets' {} Maybe Int
a -> ListAssessmentTargets
s {$sel:maxResults:ListAssessmentTargets' :: Maybe Int
maxResults = Maybe Int
a} :: ListAssessmentTargets)

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

instance Prelude.Hashable ListAssessmentTargets

instance Prelude.NFData ListAssessmentTargets

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

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

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

-- | /See:/ 'newListAssessmentTargetsResponse' smart constructor.
data ListAssessmentTargetsResponse = ListAssessmentTargetsResponse'
  { -- | When a response is generated, if there is more data to be listed, this
    -- parameter is present in the response and contains the value to use for
    -- the __nextToken__ parameter in a subsequent pagination request. If there
    -- is no more data to be listed, this parameter is set to null.
    ListAssessmentTargetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAssessmentTargetsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of ARNs that specifies the assessment targets that are returned
    -- by the action.
    ListAssessmentTargetsResponse -> [Text]
assessmentTargetArns :: [Prelude.Text]
  }
  deriving (ListAssessmentTargetsResponse
-> ListAssessmentTargetsResponse -> Bool
(ListAssessmentTargetsResponse
 -> ListAssessmentTargetsResponse -> Bool)
-> (ListAssessmentTargetsResponse
    -> ListAssessmentTargetsResponse -> Bool)
-> Eq ListAssessmentTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssessmentTargetsResponse
-> ListAssessmentTargetsResponse -> Bool
$c/= :: ListAssessmentTargetsResponse
-> ListAssessmentTargetsResponse -> Bool
== :: ListAssessmentTargetsResponse
-> ListAssessmentTargetsResponse -> Bool
$c== :: ListAssessmentTargetsResponse
-> ListAssessmentTargetsResponse -> Bool
Prelude.Eq, ReadPrec [ListAssessmentTargetsResponse]
ReadPrec ListAssessmentTargetsResponse
Int -> ReadS ListAssessmentTargetsResponse
ReadS [ListAssessmentTargetsResponse]
(Int -> ReadS ListAssessmentTargetsResponse)
-> ReadS [ListAssessmentTargetsResponse]
-> ReadPrec ListAssessmentTargetsResponse
-> ReadPrec [ListAssessmentTargetsResponse]
-> Read ListAssessmentTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssessmentTargetsResponse]
$creadListPrec :: ReadPrec [ListAssessmentTargetsResponse]
readPrec :: ReadPrec ListAssessmentTargetsResponse
$creadPrec :: ReadPrec ListAssessmentTargetsResponse
readList :: ReadS [ListAssessmentTargetsResponse]
$creadList :: ReadS [ListAssessmentTargetsResponse]
readsPrec :: Int -> ReadS ListAssessmentTargetsResponse
$creadsPrec :: Int -> ReadS ListAssessmentTargetsResponse
Prelude.Read, Int -> ListAssessmentTargetsResponse -> ShowS
[ListAssessmentTargetsResponse] -> ShowS
ListAssessmentTargetsResponse -> String
(Int -> ListAssessmentTargetsResponse -> ShowS)
-> (ListAssessmentTargetsResponse -> String)
-> ([ListAssessmentTargetsResponse] -> ShowS)
-> Show ListAssessmentTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssessmentTargetsResponse] -> ShowS
$cshowList :: [ListAssessmentTargetsResponse] -> ShowS
show :: ListAssessmentTargetsResponse -> String
$cshow :: ListAssessmentTargetsResponse -> String
showsPrec :: Int -> ListAssessmentTargetsResponse -> ShowS
$cshowsPrec :: Int -> ListAssessmentTargetsResponse -> ShowS
Prelude.Show, (forall x.
 ListAssessmentTargetsResponse
 -> Rep ListAssessmentTargetsResponse x)
-> (forall x.
    Rep ListAssessmentTargetsResponse x
    -> ListAssessmentTargetsResponse)
-> Generic ListAssessmentTargetsResponse
forall x.
Rep ListAssessmentTargetsResponse x
-> ListAssessmentTargetsResponse
forall x.
ListAssessmentTargetsResponse
-> Rep ListAssessmentTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssessmentTargetsResponse x
-> ListAssessmentTargetsResponse
$cfrom :: forall x.
ListAssessmentTargetsResponse
-> Rep ListAssessmentTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAssessmentTargetsResponse' 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', 'listAssessmentTargetsResponse_nextToken' - When a response is generated, if there is more data to be listed, this
-- parameter is present in the response and contains the value to use for
-- the __nextToken__ parameter in a subsequent pagination request. If there
-- is no more data to be listed, this parameter is set to null.
--
-- 'httpStatus', 'listAssessmentTargetsResponse_httpStatus' - The response's http status code.
--
-- 'assessmentTargetArns', 'listAssessmentTargetsResponse_assessmentTargetArns' - A list of ARNs that specifies the assessment targets that are returned
-- by the action.
newListAssessmentTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssessmentTargetsResponse
newListAssessmentTargetsResponse :: Int -> ListAssessmentTargetsResponse
newListAssessmentTargetsResponse Int
pHttpStatus_ =
  ListAssessmentTargetsResponse' :: Maybe Text -> Int -> [Text] -> ListAssessmentTargetsResponse
ListAssessmentTargetsResponse'
    { $sel:nextToken:ListAssessmentTargetsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssessmentTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:assessmentTargetArns:ListAssessmentTargetsResponse' :: [Text]
assessmentTargetArns = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | When a response is generated, if there is more data to be listed, this
-- parameter is present in the response and contains the value to use for
-- the __nextToken__ parameter in a subsequent pagination request. If there
-- is no more data to be listed, this parameter is set to null.
listAssessmentTargetsResponse_nextToken :: Lens.Lens' ListAssessmentTargetsResponse (Prelude.Maybe Prelude.Text)
listAssessmentTargetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssessmentTargetsResponse -> f ListAssessmentTargetsResponse
listAssessmentTargetsResponse_nextToken = (ListAssessmentTargetsResponse -> Maybe Text)
-> (ListAssessmentTargetsResponse
    -> Maybe Text -> ListAssessmentTargetsResponse)
-> Lens' ListAssessmentTargetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssessmentTargetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssessmentTargetsResponse' :: ListAssessmentTargetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssessmentTargetsResponse
s@ListAssessmentTargetsResponse' {} Maybe Text
a -> ListAssessmentTargetsResponse
s {$sel:nextToken:ListAssessmentTargetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssessmentTargetsResponse)

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

-- | A list of ARNs that specifies the assessment targets that are returned
-- by the action.
listAssessmentTargetsResponse_assessmentTargetArns :: Lens.Lens' ListAssessmentTargetsResponse [Prelude.Text]
listAssessmentTargetsResponse_assessmentTargetArns :: ([Text] -> f [Text])
-> ListAssessmentTargetsResponse -> f ListAssessmentTargetsResponse
listAssessmentTargetsResponse_assessmentTargetArns = (ListAssessmentTargetsResponse -> [Text])
-> (ListAssessmentTargetsResponse
    -> [Text] -> ListAssessmentTargetsResponse)
-> Lens' ListAssessmentTargetsResponse [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssessmentTargetsResponse' {[Text]
assessmentTargetArns :: [Text]
$sel:assessmentTargetArns:ListAssessmentTargetsResponse' :: ListAssessmentTargetsResponse -> [Text]
assessmentTargetArns} -> [Text]
assessmentTargetArns) (\s :: ListAssessmentTargetsResponse
s@ListAssessmentTargetsResponse' {} [Text]
a -> ListAssessmentTargetsResponse
s {$sel:assessmentTargetArns:ListAssessmentTargetsResponse' :: [Text]
assessmentTargetArns = [Text]
a} :: ListAssessmentTargetsResponse) (([Text] -> f [Text])
 -> ListAssessmentTargetsResponse
 -> f ListAssessmentTargetsResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListAssessmentTargetsResponse
-> f ListAssessmentTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListAssessmentTargetsResponse