{-# 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.SecurityHub.DescribeActionTargets
-- 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 the custom action targets in Security Hub in your
-- account.
--
-- This operation returns paginated results.
module Amazonka.SecurityHub.DescribeActionTargets
  ( -- * Creating a Request
    DescribeActionTargets (..),
    newDescribeActionTargets,

    -- * Request Lenses
    describeActionTargets_actionTargetArns,
    describeActionTargets_nextToken,
    describeActionTargets_maxResults,

    -- * Destructuring the Response
    DescribeActionTargetsResponse (..),
    newDescribeActionTargetsResponse,

    -- * Response Lenses
    describeActionTargetsResponse_nextToken,
    describeActionTargetsResponse_httpStatus,
    describeActionTargetsResponse_actionTargets,
  )
where

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

-- | /See:/ 'newDescribeActionTargets' smart constructor.
data DescribeActionTargets = DescribeActionTargets'
  { -- | A list of custom action target ARNs for the custom action targets to
    -- retrieve.
    DescribeActionTargets -> Maybe [Text]
actionTargetArns :: Prelude.Maybe [Prelude.Text],
    -- | The token that is required for pagination. On your first call to the
    -- @DescribeActionTargets@ operation, set the value of this parameter to
    -- @NULL@.
    --
    -- For subsequent calls to the operation, to continue listing data, set the
    -- value of this parameter to the value returned from the previous
    -- response.
    DescribeActionTargets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    DescribeActionTargets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeActionTargets -> DescribeActionTargets -> Bool
(DescribeActionTargets -> DescribeActionTargets -> Bool)
-> (DescribeActionTargets -> DescribeActionTargets -> Bool)
-> Eq DescribeActionTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActionTargets -> DescribeActionTargets -> Bool
$c/= :: DescribeActionTargets -> DescribeActionTargets -> Bool
== :: DescribeActionTargets -> DescribeActionTargets -> Bool
$c== :: DescribeActionTargets -> DescribeActionTargets -> Bool
Prelude.Eq, ReadPrec [DescribeActionTargets]
ReadPrec DescribeActionTargets
Int -> ReadS DescribeActionTargets
ReadS [DescribeActionTargets]
(Int -> ReadS DescribeActionTargets)
-> ReadS [DescribeActionTargets]
-> ReadPrec DescribeActionTargets
-> ReadPrec [DescribeActionTargets]
-> Read DescribeActionTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActionTargets]
$creadListPrec :: ReadPrec [DescribeActionTargets]
readPrec :: ReadPrec DescribeActionTargets
$creadPrec :: ReadPrec DescribeActionTargets
readList :: ReadS [DescribeActionTargets]
$creadList :: ReadS [DescribeActionTargets]
readsPrec :: Int -> ReadS DescribeActionTargets
$creadsPrec :: Int -> ReadS DescribeActionTargets
Prelude.Read, Int -> DescribeActionTargets -> ShowS
[DescribeActionTargets] -> ShowS
DescribeActionTargets -> String
(Int -> DescribeActionTargets -> ShowS)
-> (DescribeActionTargets -> String)
-> ([DescribeActionTargets] -> ShowS)
-> Show DescribeActionTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActionTargets] -> ShowS
$cshowList :: [DescribeActionTargets] -> ShowS
show :: DescribeActionTargets -> String
$cshow :: DescribeActionTargets -> String
showsPrec :: Int -> DescribeActionTargets -> ShowS
$cshowsPrec :: Int -> DescribeActionTargets -> ShowS
Prelude.Show, (forall x. DescribeActionTargets -> Rep DescribeActionTargets x)
-> (forall x. Rep DescribeActionTargets x -> DescribeActionTargets)
-> Generic DescribeActionTargets
forall x. Rep DescribeActionTargets x -> DescribeActionTargets
forall x. DescribeActionTargets -> Rep DescribeActionTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeActionTargets x -> DescribeActionTargets
$cfrom :: forall x. DescribeActionTargets -> Rep DescribeActionTargets x
Prelude.Generic)

-- |
-- Create a value of 'DescribeActionTargets' 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:
--
-- 'actionTargetArns', 'describeActionTargets_actionTargetArns' - A list of custom action target ARNs for the custom action targets to
-- retrieve.
--
-- 'nextToken', 'describeActionTargets_nextToken' - The token that is required for pagination. On your first call to the
-- @DescribeActionTargets@ operation, set the value of this parameter to
-- @NULL@.
--
-- For subsequent calls to the operation, to continue listing data, set the
-- value of this parameter to the value returned from the previous
-- response.
--
-- 'maxResults', 'describeActionTargets_maxResults' - The maximum number of results to return.
newDescribeActionTargets ::
  DescribeActionTargets
newDescribeActionTargets :: DescribeActionTargets
newDescribeActionTargets =
  DescribeActionTargets' :: Maybe [Text]
-> Maybe Text -> Maybe Natural -> DescribeActionTargets
DescribeActionTargets'
    { $sel:actionTargetArns:DescribeActionTargets' :: Maybe [Text]
actionTargetArns =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeActionTargets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeActionTargets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of custom action target ARNs for the custom action targets to
-- retrieve.
describeActionTargets_actionTargetArns :: Lens.Lens' DescribeActionTargets (Prelude.Maybe [Prelude.Text])
describeActionTargets_actionTargetArns :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeActionTargets -> f DescribeActionTargets
describeActionTargets_actionTargetArns = (DescribeActionTargets -> Maybe [Text])
-> (DescribeActionTargets -> Maybe [Text] -> DescribeActionTargets)
-> Lens
     DescribeActionTargets
     DescribeActionTargets
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActionTargets' {Maybe [Text]
actionTargetArns :: Maybe [Text]
$sel:actionTargetArns:DescribeActionTargets' :: DescribeActionTargets -> Maybe [Text]
actionTargetArns} -> Maybe [Text]
actionTargetArns) (\s :: DescribeActionTargets
s@DescribeActionTargets' {} Maybe [Text]
a -> DescribeActionTargets
s {$sel:actionTargetArns:DescribeActionTargets' :: Maybe [Text]
actionTargetArns = Maybe [Text]
a} :: DescribeActionTargets) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeActionTargets -> f DescribeActionTargets)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeActionTargets
-> f DescribeActionTargets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token that is required for pagination. On your first call to the
-- @DescribeActionTargets@ operation, set the value of this parameter to
-- @NULL@.
--
-- For subsequent calls to the operation, to continue listing data, set the
-- value of this parameter to the value returned from the previous
-- response.
describeActionTargets_nextToken :: Lens.Lens' DescribeActionTargets (Prelude.Maybe Prelude.Text)
describeActionTargets_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeActionTargets -> f DescribeActionTargets
describeActionTargets_nextToken = (DescribeActionTargets -> Maybe Text)
-> (DescribeActionTargets -> Maybe Text -> DescribeActionTargets)
-> Lens
     DescribeActionTargets
     DescribeActionTargets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActionTargets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeActionTargets' :: DescribeActionTargets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeActionTargets
s@DescribeActionTargets' {} Maybe Text
a -> DescribeActionTargets
s {$sel:nextToken:DescribeActionTargets' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeActionTargets)

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

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

instance Prelude.Hashable DescribeActionTargets

instance Prelude.NFData DescribeActionTargets

instance Core.ToHeaders DescribeActionTargets where
  toHeaders :: DescribeActionTargets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeActionTargets -> 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.ToJSON DescribeActionTargets where
  toJSON :: DescribeActionTargets -> Value
toJSON DescribeActionTargets' {Maybe Natural
Maybe [Text]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
actionTargetArns :: Maybe [Text]
$sel:maxResults:DescribeActionTargets' :: DescribeActionTargets -> Maybe Natural
$sel:nextToken:DescribeActionTargets' :: DescribeActionTargets -> Maybe Text
$sel:actionTargetArns:DescribeActionTargets' :: DescribeActionTargets -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ActionTargetArns" 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]
actionTargetArns,
            (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
"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
          ]
      )

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

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

-- | /See:/ 'newDescribeActionTargetsResponse' smart constructor.
data DescribeActionTargetsResponse = DescribeActionTargetsResponse'
  { -- | The pagination token to use to request the next page of results.
    DescribeActionTargetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeActionTargetsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of @ActionTarget@ objects. Each object includes the
    -- @ActionTargetArn@, @Description@, and @Name@ of a custom action target
    -- available in Security Hub.
    DescribeActionTargetsResponse -> [ActionTarget]
actionTargets :: [ActionTarget]
  }
  deriving (DescribeActionTargetsResponse
-> DescribeActionTargetsResponse -> Bool
(DescribeActionTargetsResponse
 -> DescribeActionTargetsResponse -> Bool)
-> (DescribeActionTargetsResponse
    -> DescribeActionTargetsResponse -> Bool)
-> Eq DescribeActionTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActionTargetsResponse
-> DescribeActionTargetsResponse -> Bool
$c/= :: DescribeActionTargetsResponse
-> DescribeActionTargetsResponse -> Bool
== :: DescribeActionTargetsResponse
-> DescribeActionTargetsResponse -> Bool
$c== :: DescribeActionTargetsResponse
-> DescribeActionTargetsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeActionTargetsResponse]
ReadPrec DescribeActionTargetsResponse
Int -> ReadS DescribeActionTargetsResponse
ReadS [DescribeActionTargetsResponse]
(Int -> ReadS DescribeActionTargetsResponse)
-> ReadS [DescribeActionTargetsResponse]
-> ReadPrec DescribeActionTargetsResponse
-> ReadPrec [DescribeActionTargetsResponse]
-> Read DescribeActionTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActionTargetsResponse]
$creadListPrec :: ReadPrec [DescribeActionTargetsResponse]
readPrec :: ReadPrec DescribeActionTargetsResponse
$creadPrec :: ReadPrec DescribeActionTargetsResponse
readList :: ReadS [DescribeActionTargetsResponse]
$creadList :: ReadS [DescribeActionTargetsResponse]
readsPrec :: Int -> ReadS DescribeActionTargetsResponse
$creadsPrec :: Int -> ReadS DescribeActionTargetsResponse
Prelude.Read, Int -> DescribeActionTargetsResponse -> ShowS
[DescribeActionTargetsResponse] -> ShowS
DescribeActionTargetsResponse -> String
(Int -> DescribeActionTargetsResponse -> ShowS)
-> (DescribeActionTargetsResponse -> String)
-> ([DescribeActionTargetsResponse] -> ShowS)
-> Show DescribeActionTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActionTargetsResponse] -> ShowS
$cshowList :: [DescribeActionTargetsResponse] -> ShowS
show :: DescribeActionTargetsResponse -> String
$cshow :: DescribeActionTargetsResponse -> String
showsPrec :: Int -> DescribeActionTargetsResponse -> ShowS
$cshowsPrec :: Int -> DescribeActionTargetsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeActionTargetsResponse
 -> Rep DescribeActionTargetsResponse x)
-> (forall x.
    Rep DescribeActionTargetsResponse x
    -> DescribeActionTargetsResponse)
-> Generic DescribeActionTargetsResponse
forall x.
Rep DescribeActionTargetsResponse x
-> DescribeActionTargetsResponse
forall x.
DescribeActionTargetsResponse
-> Rep DescribeActionTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeActionTargetsResponse x
-> DescribeActionTargetsResponse
$cfrom :: forall x.
DescribeActionTargetsResponse
-> Rep DescribeActionTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeActionTargetsResponse' 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', 'describeActionTargetsResponse_nextToken' - The pagination token to use to request the next page of results.
--
-- 'httpStatus', 'describeActionTargetsResponse_httpStatus' - The response's http status code.
--
-- 'actionTargets', 'describeActionTargetsResponse_actionTargets' - A list of @ActionTarget@ objects. Each object includes the
-- @ActionTargetArn@, @Description@, and @Name@ of a custom action target
-- available in Security Hub.
newDescribeActionTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeActionTargetsResponse
newDescribeActionTargetsResponse :: Int -> DescribeActionTargetsResponse
newDescribeActionTargetsResponse Int
pHttpStatus_ =
  DescribeActionTargetsResponse' :: Maybe Text
-> Int -> [ActionTarget] -> DescribeActionTargetsResponse
DescribeActionTargetsResponse'
    { $sel:nextToken:DescribeActionTargetsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeActionTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:actionTargets:DescribeActionTargetsResponse' :: [ActionTarget]
actionTargets = [ActionTarget]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The pagination token to use to request the next page of results.
describeActionTargetsResponse_nextToken :: Lens.Lens' DescribeActionTargetsResponse (Prelude.Maybe Prelude.Text)
describeActionTargetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeActionTargetsResponse -> f DescribeActionTargetsResponse
describeActionTargetsResponse_nextToken = (DescribeActionTargetsResponse -> Maybe Text)
-> (DescribeActionTargetsResponse
    -> Maybe Text -> DescribeActionTargetsResponse)
-> Lens' DescribeActionTargetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActionTargetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeActionTargetsResponse' :: DescribeActionTargetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeActionTargetsResponse
s@DescribeActionTargetsResponse' {} Maybe Text
a -> DescribeActionTargetsResponse
s {$sel:nextToken:DescribeActionTargetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeActionTargetsResponse)

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

-- | A list of @ActionTarget@ objects. Each object includes the
-- @ActionTargetArn@, @Description@, and @Name@ of a custom action target
-- available in Security Hub.
describeActionTargetsResponse_actionTargets :: Lens.Lens' DescribeActionTargetsResponse [ActionTarget]
describeActionTargetsResponse_actionTargets :: ([ActionTarget] -> f [ActionTarget])
-> DescribeActionTargetsResponse -> f DescribeActionTargetsResponse
describeActionTargetsResponse_actionTargets = (DescribeActionTargetsResponse -> [ActionTarget])
-> (DescribeActionTargetsResponse
    -> [ActionTarget] -> DescribeActionTargetsResponse)
-> Lens' DescribeActionTargetsResponse [ActionTarget]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActionTargetsResponse' {[ActionTarget]
actionTargets :: [ActionTarget]
$sel:actionTargets:DescribeActionTargetsResponse' :: DescribeActionTargetsResponse -> [ActionTarget]
actionTargets} -> [ActionTarget]
actionTargets) (\s :: DescribeActionTargetsResponse
s@DescribeActionTargetsResponse' {} [ActionTarget]
a -> DescribeActionTargetsResponse
s {$sel:actionTargets:DescribeActionTargetsResponse' :: [ActionTarget]
actionTargets = [ActionTarget]
a} :: DescribeActionTargetsResponse) (([ActionTarget] -> f [ActionTarget])
 -> DescribeActionTargetsResponse
 -> f DescribeActionTargetsResponse)
-> (([ActionTarget] -> f [ActionTarget])
    -> [ActionTarget] -> f [ActionTarget])
-> ([ActionTarget] -> f [ActionTarget])
-> DescribeActionTargetsResponse
-> f DescribeActionTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ActionTarget] -> f [ActionTarget])
-> [ActionTarget] -> f [ActionTarget]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData DescribeActionTargetsResponse