{-# 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.IoT.ListMitigationActions
-- 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 a list of all mitigation actions that match the specified filter
-- criteria.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListMitigationActions>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListMitigationActions
  ( -- * Creating a Request
    ListMitigationActions (..),
    newListMitigationActions,

    -- * Request Lenses
    listMitigationActions_nextToken,
    listMitigationActions_actionType,
    listMitigationActions_maxResults,

    -- * Destructuring the Response
    ListMitigationActionsResponse (..),
    newListMitigationActionsResponse,

    -- * Response Lenses
    listMitigationActionsResponse_actionIdentifiers,
    listMitigationActionsResponse_nextToken,
    listMitigationActionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ 'newListMitigationActions' smart constructor.
data ListMitigationActions = ListMitigationActions'
  { -- | The token for the next set of results.
    ListMitigationActions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specify a value to limit the result to mitigation actions with a
    -- specific action type.
    ListMitigationActions -> Maybe MitigationActionType
actionType :: Prelude.Maybe MitigationActionType,
    -- | The maximum number of results to return at one time. The default is 25.
    ListMitigationActions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListMitigationActions -> ListMitigationActions -> Bool
(ListMitigationActions -> ListMitigationActions -> Bool)
-> (ListMitigationActions -> ListMitigationActions -> Bool)
-> Eq ListMitigationActions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMitigationActions -> ListMitigationActions -> Bool
$c/= :: ListMitigationActions -> ListMitigationActions -> Bool
== :: ListMitigationActions -> ListMitigationActions -> Bool
$c== :: ListMitigationActions -> ListMitigationActions -> Bool
Prelude.Eq, ReadPrec [ListMitigationActions]
ReadPrec ListMitigationActions
Int -> ReadS ListMitigationActions
ReadS [ListMitigationActions]
(Int -> ReadS ListMitigationActions)
-> ReadS [ListMitigationActions]
-> ReadPrec ListMitigationActions
-> ReadPrec [ListMitigationActions]
-> Read ListMitigationActions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMitigationActions]
$creadListPrec :: ReadPrec [ListMitigationActions]
readPrec :: ReadPrec ListMitigationActions
$creadPrec :: ReadPrec ListMitigationActions
readList :: ReadS [ListMitigationActions]
$creadList :: ReadS [ListMitigationActions]
readsPrec :: Int -> ReadS ListMitigationActions
$creadsPrec :: Int -> ReadS ListMitigationActions
Prelude.Read, Int -> ListMitigationActions -> ShowS
[ListMitigationActions] -> ShowS
ListMitigationActions -> String
(Int -> ListMitigationActions -> ShowS)
-> (ListMitigationActions -> String)
-> ([ListMitigationActions] -> ShowS)
-> Show ListMitigationActions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMitigationActions] -> ShowS
$cshowList :: [ListMitigationActions] -> ShowS
show :: ListMitigationActions -> String
$cshow :: ListMitigationActions -> String
showsPrec :: Int -> ListMitigationActions -> ShowS
$cshowsPrec :: Int -> ListMitigationActions -> ShowS
Prelude.Show, (forall x. ListMitigationActions -> Rep ListMitigationActions x)
-> (forall x. Rep ListMitigationActions x -> ListMitigationActions)
-> Generic ListMitigationActions
forall x. Rep ListMitigationActions x -> ListMitigationActions
forall x. ListMitigationActions -> Rep ListMitigationActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMitigationActions x -> ListMitigationActions
$cfrom :: forall x. ListMitigationActions -> Rep ListMitigationActions x
Prelude.Generic)

-- |
-- Create a value of 'ListMitigationActions' 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', 'listMitigationActions_nextToken' - The token for the next set of results.
--
-- 'actionType', 'listMitigationActions_actionType' - Specify a value to limit the result to mitigation actions with a
-- specific action type.
--
-- 'maxResults', 'listMitigationActions_maxResults' - The maximum number of results to return at one time. The default is 25.
newListMitigationActions ::
  ListMitigationActions
newListMitigationActions :: ListMitigationActions
newListMitigationActions =
  ListMitigationActions' :: Maybe Text
-> Maybe MitigationActionType
-> Maybe Natural
-> ListMitigationActions
ListMitigationActions'
    { $sel:nextToken:ListMitigationActions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionType:ListMitigationActions' :: Maybe MitigationActionType
actionType = Maybe MitigationActionType
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListMitigationActions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The token for the next set of results.
listMitigationActions_nextToken :: Lens.Lens' ListMitigationActions (Prelude.Maybe Prelude.Text)
listMitigationActions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListMitigationActions -> f ListMitigationActions
listMitigationActions_nextToken = (ListMitigationActions -> Maybe Text)
-> (ListMitigationActions -> Maybe Text -> ListMitigationActions)
-> Lens
     ListMitigationActions
     ListMitigationActions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMitigationActions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMitigationActions' :: ListMitigationActions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMitigationActions
s@ListMitigationActions' {} Maybe Text
a -> ListMitigationActions
s {$sel:nextToken:ListMitigationActions' :: Maybe Text
nextToken = Maybe Text
a} :: ListMitigationActions)

-- | Specify a value to limit the result to mitigation actions with a
-- specific action type.
listMitigationActions_actionType :: Lens.Lens' ListMitigationActions (Prelude.Maybe MitigationActionType)
listMitigationActions_actionType :: (Maybe MitigationActionType -> f (Maybe MitigationActionType))
-> ListMitigationActions -> f ListMitigationActions
listMitigationActions_actionType = (ListMitigationActions -> Maybe MitigationActionType)
-> (ListMitigationActions
    -> Maybe MitigationActionType -> ListMitigationActions)
-> Lens
     ListMitigationActions
     ListMitigationActions
     (Maybe MitigationActionType)
     (Maybe MitigationActionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMitigationActions' {Maybe MitigationActionType
actionType :: Maybe MitigationActionType
$sel:actionType:ListMitigationActions' :: ListMitigationActions -> Maybe MitigationActionType
actionType} -> Maybe MitigationActionType
actionType) (\s :: ListMitigationActions
s@ListMitigationActions' {} Maybe MitigationActionType
a -> ListMitigationActions
s {$sel:actionType:ListMitigationActions' :: Maybe MitigationActionType
actionType = Maybe MitigationActionType
a} :: ListMitigationActions)

-- | The maximum number of results to return at one time. The default is 25.
listMitigationActions_maxResults :: Lens.Lens' ListMitigationActions (Prelude.Maybe Prelude.Natural)
listMitigationActions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListMitigationActions -> f ListMitigationActions
listMitigationActions_maxResults = (ListMitigationActions -> Maybe Natural)
-> (ListMitigationActions
    -> Maybe Natural -> ListMitigationActions)
-> Lens
     ListMitigationActions
     ListMitigationActions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMitigationActions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListMitigationActions' :: ListMitigationActions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListMitigationActions
s@ListMitigationActions' {} Maybe Natural
a -> ListMitigationActions
s {$sel:maxResults:ListMitigationActions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListMitigationActions)

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

instance Prelude.NFData ListMitigationActions

instance Core.ToHeaders ListMitigationActions where
  toHeaders :: ListMitigationActions -> ResponseHeaders
toHeaders = ResponseHeaders -> ListMitigationActions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

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

-- | /See:/ 'newListMitigationActionsResponse' smart constructor.
data ListMitigationActionsResponse = ListMitigationActionsResponse'
  { -- | A set of actions that matched the specified filter criteria.
    ListMitigationActionsResponse -> Maybe [MitigationActionIdentifier]
actionIdentifiers :: Prelude.Maybe [MitigationActionIdentifier],
    -- | The token for the next set of results.
    ListMitigationActionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListMitigationActionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListMitigationActionsResponse
-> ListMitigationActionsResponse -> Bool
(ListMitigationActionsResponse
 -> ListMitigationActionsResponse -> Bool)
-> (ListMitigationActionsResponse
    -> ListMitigationActionsResponse -> Bool)
-> Eq ListMitigationActionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMitigationActionsResponse
-> ListMitigationActionsResponse -> Bool
$c/= :: ListMitigationActionsResponse
-> ListMitigationActionsResponse -> Bool
== :: ListMitigationActionsResponse
-> ListMitigationActionsResponse -> Bool
$c== :: ListMitigationActionsResponse
-> ListMitigationActionsResponse -> Bool
Prelude.Eq, ReadPrec [ListMitigationActionsResponse]
ReadPrec ListMitigationActionsResponse
Int -> ReadS ListMitigationActionsResponse
ReadS [ListMitigationActionsResponse]
(Int -> ReadS ListMitigationActionsResponse)
-> ReadS [ListMitigationActionsResponse]
-> ReadPrec ListMitigationActionsResponse
-> ReadPrec [ListMitigationActionsResponse]
-> Read ListMitigationActionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMitigationActionsResponse]
$creadListPrec :: ReadPrec [ListMitigationActionsResponse]
readPrec :: ReadPrec ListMitigationActionsResponse
$creadPrec :: ReadPrec ListMitigationActionsResponse
readList :: ReadS [ListMitigationActionsResponse]
$creadList :: ReadS [ListMitigationActionsResponse]
readsPrec :: Int -> ReadS ListMitigationActionsResponse
$creadsPrec :: Int -> ReadS ListMitigationActionsResponse
Prelude.Read, Int -> ListMitigationActionsResponse -> ShowS
[ListMitigationActionsResponse] -> ShowS
ListMitigationActionsResponse -> String
(Int -> ListMitigationActionsResponse -> ShowS)
-> (ListMitigationActionsResponse -> String)
-> ([ListMitigationActionsResponse] -> ShowS)
-> Show ListMitigationActionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMitigationActionsResponse] -> ShowS
$cshowList :: [ListMitigationActionsResponse] -> ShowS
show :: ListMitigationActionsResponse -> String
$cshow :: ListMitigationActionsResponse -> String
showsPrec :: Int -> ListMitigationActionsResponse -> ShowS
$cshowsPrec :: Int -> ListMitigationActionsResponse -> ShowS
Prelude.Show, (forall x.
 ListMitigationActionsResponse
 -> Rep ListMitigationActionsResponse x)
-> (forall x.
    Rep ListMitigationActionsResponse x
    -> ListMitigationActionsResponse)
-> Generic ListMitigationActionsResponse
forall x.
Rep ListMitigationActionsResponse x
-> ListMitigationActionsResponse
forall x.
ListMitigationActionsResponse
-> Rep ListMitigationActionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListMitigationActionsResponse x
-> ListMitigationActionsResponse
$cfrom :: forall x.
ListMitigationActionsResponse
-> Rep ListMitigationActionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListMitigationActionsResponse' 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:
--
-- 'actionIdentifiers', 'listMitigationActionsResponse_actionIdentifiers' - A set of actions that matched the specified filter criteria.
--
-- 'nextToken', 'listMitigationActionsResponse_nextToken' - The token for the next set of results.
--
-- 'httpStatus', 'listMitigationActionsResponse_httpStatus' - The response's http status code.
newListMitigationActionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMitigationActionsResponse
newListMitigationActionsResponse :: Int -> ListMitigationActionsResponse
newListMitigationActionsResponse Int
pHttpStatus_ =
  ListMitigationActionsResponse' :: Maybe [MitigationActionIdentifier]
-> Maybe Text -> Int -> ListMitigationActionsResponse
ListMitigationActionsResponse'
    { $sel:actionIdentifiers:ListMitigationActionsResponse' :: Maybe [MitigationActionIdentifier]
actionIdentifiers =
        Maybe [MitigationActionIdentifier]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListMitigationActionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMitigationActionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A set of actions that matched the specified filter criteria.
listMitigationActionsResponse_actionIdentifiers :: Lens.Lens' ListMitigationActionsResponse (Prelude.Maybe [MitigationActionIdentifier])
listMitigationActionsResponse_actionIdentifiers :: (Maybe [MitigationActionIdentifier]
 -> f (Maybe [MitigationActionIdentifier]))
-> ListMitigationActionsResponse -> f ListMitigationActionsResponse
listMitigationActionsResponse_actionIdentifiers = (ListMitigationActionsResponse
 -> Maybe [MitigationActionIdentifier])
-> (ListMitigationActionsResponse
    -> Maybe [MitigationActionIdentifier]
    -> ListMitigationActionsResponse)
-> Lens'
     ListMitigationActionsResponse (Maybe [MitigationActionIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMitigationActionsResponse' {Maybe [MitigationActionIdentifier]
actionIdentifiers :: Maybe [MitigationActionIdentifier]
$sel:actionIdentifiers:ListMitigationActionsResponse' :: ListMitigationActionsResponse -> Maybe [MitigationActionIdentifier]
actionIdentifiers} -> Maybe [MitigationActionIdentifier]
actionIdentifiers) (\s :: ListMitigationActionsResponse
s@ListMitigationActionsResponse' {} Maybe [MitigationActionIdentifier]
a -> ListMitigationActionsResponse
s {$sel:actionIdentifiers:ListMitigationActionsResponse' :: Maybe [MitigationActionIdentifier]
actionIdentifiers = Maybe [MitigationActionIdentifier]
a} :: ListMitigationActionsResponse) ((Maybe [MitigationActionIdentifier]
  -> f (Maybe [MitigationActionIdentifier]))
 -> ListMitigationActionsResponse
 -> f ListMitigationActionsResponse)
-> ((Maybe [MitigationActionIdentifier]
     -> f (Maybe [MitigationActionIdentifier]))
    -> Maybe [MitigationActionIdentifier]
    -> f (Maybe [MitigationActionIdentifier]))
-> (Maybe [MitigationActionIdentifier]
    -> f (Maybe [MitigationActionIdentifier]))
-> ListMitigationActionsResponse
-> f ListMitigationActionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MitigationActionIdentifier]
  [MitigationActionIdentifier]
  [MitigationActionIdentifier]
  [MitigationActionIdentifier]
-> Iso
     (Maybe [MitigationActionIdentifier])
     (Maybe [MitigationActionIdentifier])
     (Maybe [MitigationActionIdentifier])
     (Maybe [MitigationActionIdentifier])
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
  [MitigationActionIdentifier]
  [MitigationActionIdentifier]
  [MitigationActionIdentifier]
  [MitigationActionIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results.
listMitigationActionsResponse_nextToken :: Lens.Lens' ListMitigationActionsResponse (Prelude.Maybe Prelude.Text)
listMitigationActionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListMitigationActionsResponse -> f ListMitigationActionsResponse
listMitigationActionsResponse_nextToken = (ListMitigationActionsResponse -> Maybe Text)
-> (ListMitigationActionsResponse
    -> Maybe Text -> ListMitigationActionsResponse)
-> Lens' ListMitigationActionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMitigationActionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMitigationActionsResponse' :: ListMitigationActionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMitigationActionsResponse
s@ListMitigationActionsResponse' {} Maybe Text
a -> ListMitigationActionsResponse
s {$sel:nextToken:ListMitigationActionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListMitigationActionsResponse)

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

instance Prelude.NFData ListMitigationActionsResponse