{-# 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.ListSecurityProfiles
-- 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 Device Defender security profiles you\'ve created. You can
-- filter security profiles by dimension or custom metric.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListSecurityProfiles>
-- action.
--
-- @dimensionName@ and @metricName@ cannot be used in the same request.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListSecurityProfiles
  ( -- * Creating a Request
    ListSecurityProfiles (..),
    newListSecurityProfiles,

    -- * Request Lenses
    listSecurityProfiles_metricName,
    listSecurityProfiles_nextToken,
    listSecurityProfiles_dimensionName,
    listSecurityProfiles_maxResults,

    -- * Destructuring the Response
    ListSecurityProfilesResponse (..),
    newListSecurityProfilesResponse,

    -- * Response Lenses
    listSecurityProfilesResponse_nextToken,
    listSecurityProfilesResponse_securityProfileIdentifiers,
    listSecurityProfilesResponse_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:/ 'newListSecurityProfiles' smart constructor.
data ListSecurityProfiles = ListSecurityProfiles'
  { -- | The name of the custom metric. Cannot be used with @dimensionName@.
    ListSecurityProfiles -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results.
    ListSecurityProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A filter to limit results to the security profiles that use the defined
    -- dimension. Cannot be used with @metricName@
    ListSecurityProfiles -> Maybe Text
dimensionName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return at one time.
    ListSecurityProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSecurityProfiles -> ListSecurityProfiles -> Bool
(ListSecurityProfiles -> ListSecurityProfiles -> Bool)
-> (ListSecurityProfiles -> ListSecurityProfiles -> Bool)
-> Eq ListSecurityProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityProfiles -> ListSecurityProfiles -> Bool
$c/= :: ListSecurityProfiles -> ListSecurityProfiles -> Bool
== :: ListSecurityProfiles -> ListSecurityProfiles -> Bool
$c== :: ListSecurityProfiles -> ListSecurityProfiles -> Bool
Prelude.Eq, ReadPrec [ListSecurityProfiles]
ReadPrec ListSecurityProfiles
Int -> ReadS ListSecurityProfiles
ReadS [ListSecurityProfiles]
(Int -> ReadS ListSecurityProfiles)
-> ReadS [ListSecurityProfiles]
-> ReadPrec ListSecurityProfiles
-> ReadPrec [ListSecurityProfiles]
-> Read ListSecurityProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityProfiles]
$creadListPrec :: ReadPrec [ListSecurityProfiles]
readPrec :: ReadPrec ListSecurityProfiles
$creadPrec :: ReadPrec ListSecurityProfiles
readList :: ReadS [ListSecurityProfiles]
$creadList :: ReadS [ListSecurityProfiles]
readsPrec :: Int -> ReadS ListSecurityProfiles
$creadsPrec :: Int -> ReadS ListSecurityProfiles
Prelude.Read, Int -> ListSecurityProfiles -> ShowS
[ListSecurityProfiles] -> ShowS
ListSecurityProfiles -> String
(Int -> ListSecurityProfiles -> ShowS)
-> (ListSecurityProfiles -> String)
-> ([ListSecurityProfiles] -> ShowS)
-> Show ListSecurityProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityProfiles] -> ShowS
$cshowList :: [ListSecurityProfiles] -> ShowS
show :: ListSecurityProfiles -> String
$cshow :: ListSecurityProfiles -> String
showsPrec :: Int -> ListSecurityProfiles -> ShowS
$cshowsPrec :: Int -> ListSecurityProfiles -> ShowS
Prelude.Show, (forall x. ListSecurityProfiles -> Rep ListSecurityProfiles x)
-> (forall x. Rep ListSecurityProfiles x -> ListSecurityProfiles)
-> Generic ListSecurityProfiles
forall x. Rep ListSecurityProfiles x -> ListSecurityProfiles
forall x. ListSecurityProfiles -> Rep ListSecurityProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSecurityProfiles x -> ListSecurityProfiles
$cfrom :: forall x. ListSecurityProfiles -> Rep ListSecurityProfiles x
Prelude.Generic)

-- |
-- Create a value of 'ListSecurityProfiles' 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:
--
-- 'metricName', 'listSecurityProfiles_metricName' - The name of the custom metric. Cannot be used with @dimensionName@.
--
-- 'nextToken', 'listSecurityProfiles_nextToken' - The token for the next set of results.
--
-- 'dimensionName', 'listSecurityProfiles_dimensionName' - A filter to limit results to the security profiles that use the defined
-- dimension. Cannot be used with @metricName@
--
-- 'maxResults', 'listSecurityProfiles_maxResults' - The maximum number of results to return at one time.
newListSecurityProfiles ::
  ListSecurityProfiles
newListSecurityProfiles :: ListSecurityProfiles
newListSecurityProfiles =
  ListSecurityProfiles' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> ListSecurityProfiles
ListSecurityProfiles'
    { $sel:metricName:ListSecurityProfiles' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSecurityProfiles' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dimensionName:ListSecurityProfiles' :: Maybe Text
dimensionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSecurityProfiles' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the custom metric. Cannot be used with @dimensionName@.
listSecurityProfiles_metricName :: Lens.Lens' ListSecurityProfiles (Prelude.Maybe Prelude.Text)
listSecurityProfiles_metricName :: (Maybe Text -> f (Maybe Text))
-> ListSecurityProfiles -> f ListSecurityProfiles
listSecurityProfiles_metricName = (ListSecurityProfiles -> Maybe Text)
-> (ListSecurityProfiles -> Maybe Text -> ListSecurityProfiles)
-> Lens
     ListSecurityProfiles ListSecurityProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfiles' {Maybe Text
metricName :: Maybe Text
$sel:metricName:ListSecurityProfiles' :: ListSecurityProfiles -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: ListSecurityProfiles
s@ListSecurityProfiles' {} Maybe Text
a -> ListSecurityProfiles
s {$sel:metricName:ListSecurityProfiles' :: Maybe Text
metricName = Maybe Text
a} :: ListSecurityProfiles)

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

-- | A filter to limit results to the security profiles that use the defined
-- dimension. Cannot be used with @metricName@
listSecurityProfiles_dimensionName :: Lens.Lens' ListSecurityProfiles (Prelude.Maybe Prelude.Text)
listSecurityProfiles_dimensionName :: (Maybe Text -> f (Maybe Text))
-> ListSecurityProfiles -> f ListSecurityProfiles
listSecurityProfiles_dimensionName = (ListSecurityProfiles -> Maybe Text)
-> (ListSecurityProfiles -> Maybe Text -> ListSecurityProfiles)
-> Lens
     ListSecurityProfiles ListSecurityProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfiles' {Maybe Text
dimensionName :: Maybe Text
$sel:dimensionName:ListSecurityProfiles' :: ListSecurityProfiles -> Maybe Text
dimensionName} -> Maybe Text
dimensionName) (\s :: ListSecurityProfiles
s@ListSecurityProfiles' {} Maybe Text
a -> ListSecurityProfiles
s {$sel:dimensionName:ListSecurityProfiles' :: Maybe Text
dimensionName = Maybe Text
a} :: ListSecurityProfiles)

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

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

instance Prelude.NFData ListSecurityProfiles

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

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

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

-- | /See:/ 'newListSecurityProfilesResponse' smart constructor.
data ListSecurityProfilesResponse = ListSecurityProfilesResponse'
  { -- | A token that can be used to retrieve the next set of results, or @null@
    -- if there are no additional results.
    ListSecurityProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of security profile identifiers (names and ARNs).
    ListSecurityProfilesResponse -> Maybe [SecurityProfileIdentifier]
securityProfileIdentifiers :: Prelude.Maybe [SecurityProfileIdentifier],
    -- | The response's http status code.
    ListSecurityProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSecurityProfilesResponse
-> ListSecurityProfilesResponse -> Bool
(ListSecurityProfilesResponse
 -> ListSecurityProfilesResponse -> Bool)
-> (ListSecurityProfilesResponse
    -> ListSecurityProfilesResponse -> Bool)
-> Eq ListSecurityProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityProfilesResponse
-> ListSecurityProfilesResponse -> Bool
$c/= :: ListSecurityProfilesResponse
-> ListSecurityProfilesResponse -> Bool
== :: ListSecurityProfilesResponse
-> ListSecurityProfilesResponse -> Bool
$c== :: ListSecurityProfilesResponse
-> ListSecurityProfilesResponse -> Bool
Prelude.Eq, ReadPrec [ListSecurityProfilesResponse]
ReadPrec ListSecurityProfilesResponse
Int -> ReadS ListSecurityProfilesResponse
ReadS [ListSecurityProfilesResponse]
(Int -> ReadS ListSecurityProfilesResponse)
-> ReadS [ListSecurityProfilesResponse]
-> ReadPrec ListSecurityProfilesResponse
-> ReadPrec [ListSecurityProfilesResponse]
-> Read ListSecurityProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityProfilesResponse]
$creadListPrec :: ReadPrec [ListSecurityProfilesResponse]
readPrec :: ReadPrec ListSecurityProfilesResponse
$creadPrec :: ReadPrec ListSecurityProfilesResponse
readList :: ReadS [ListSecurityProfilesResponse]
$creadList :: ReadS [ListSecurityProfilesResponse]
readsPrec :: Int -> ReadS ListSecurityProfilesResponse
$creadsPrec :: Int -> ReadS ListSecurityProfilesResponse
Prelude.Read, Int -> ListSecurityProfilesResponse -> ShowS
[ListSecurityProfilesResponse] -> ShowS
ListSecurityProfilesResponse -> String
(Int -> ListSecurityProfilesResponse -> ShowS)
-> (ListSecurityProfilesResponse -> String)
-> ([ListSecurityProfilesResponse] -> ShowS)
-> Show ListSecurityProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityProfilesResponse] -> ShowS
$cshowList :: [ListSecurityProfilesResponse] -> ShowS
show :: ListSecurityProfilesResponse -> String
$cshow :: ListSecurityProfilesResponse -> String
showsPrec :: Int -> ListSecurityProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListSecurityProfilesResponse -> ShowS
Prelude.Show, (forall x.
 ListSecurityProfilesResponse -> Rep ListSecurityProfilesResponse x)
-> (forall x.
    Rep ListSecurityProfilesResponse x -> ListSecurityProfilesResponse)
-> Generic ListSecurityProfilesResponse
forall x.
Rep ListSecurityProfilesResponse x -> ListSecurityProfilesResponse
forall x.
ListSecurityProfilesResponse -> Rep ListSecurityProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSecurityProfilesResponse x -> ListSecurityProfilesResponse
$cfrom :: forall x.
ListSecurityProfilesResponse -> Rep ListSecurityProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSecurityProfilesResponse' 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', 'listSecurityProfilesResponse_nextToken' - A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
--
-- 'securityProfileIdentifiers', 'listSecurityProfilesResponse_securityProfileIdentifiers' - A list of security profile identifiers (names and ARNs).
--
-- 'httpStatus', 'listSecurityProfilesResponse_httpStatus' - The response's http status code.
newListSecurityProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSecurityProfilesResponse
newListSecurityProfilesResponse :: Int -> ListSecurityProfilesResponse
newListSecurityProfilesResponse Int
pHttpStatus_ =
  ListSecurityProfilesResponse' :: Maybe Text
-> Maybe [SecurityProfileIdentifier]
-> Int
-> ListSecurityProfilesResponse
ListSecurityProfilesResponse'
    { $sel:nextToken:ListSecurityProfilesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileIdentifiers:ListSecurityProfilesResponse' :: Maybe [SecurityProfileIdentifier]
securityProfileIdentifiers = Maybe [SecurityProfileIdentifier]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSecurityProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
listSecurityProfilesResponse_nextToken :: Lens.Lens' ListSecurityProfilesResponse (Prelude.Maybe Prelude.Text)
listSecurityProfilesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSecurityProfilesResponse -> f ListSecurityProfilesResponse
listSecurityProfilesResponse_nextToken = (ListSecurityProfilesResponse -> Maybe Text)
-> (ListSecurityProfilesResponse
    -> Maybe Text -> ListSecurityProfilesResponse)
-> Lens' ListSecurityProfilesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecurityProfilesResponse' :: ListSecurityProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecurityProfilesResponse
s@ListSecurityProfilesResponse' {} Maybe Text
a -> ListSecurityProfilesResponse
s {$sel:nextToken:ListSecurityProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecurityProfilesResponse)

-- | A list of security profile identifiers (names and ARNs).
listSecurityProfilesResponse_securityProfileIdentifiers :: Lens.Lens' ListSecurityProfilesResponse (Prelude.Maybe [SecurityProfileIdentifier])
listSecurityProfilesResponse_securityProfileIdentifiers :: (Maybe [SecurityProfileIdentifier]
 -> f (Maybe [SecurityProfileIdentifier]))
-> ListSecurityProfilesResponse -> f ListSecurityProfilesResponse
listSecurityProfilesResponse_securityProfileIdentifiers = (ListSecurityProfilesResponse -> Maybe [SecurityProfileIdentifier])
-> (ListSecurityProfilesResponse
    -> Maybe [SecurityProfileIdentifier]
    -> ListSecurityProfilesResponse)
-> Lens'
     ListSecurityProfilesResponse (Maybe [SecurityProfileIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfilesResponse' {Maybe [SecurityProfileIdentifier]
securityProfileIdentifiers :: Maybe [SecurityProfileIdentifier]
$sel:securityProfileIdentifiers:ListSecurityProfilesResponse' :: ListSecurityProfilesResponse -> Maybe [SecurityProfileIdentifier]
securityProfileIdentifiers} -> Maybe [SecurityProfileIdentifier]
securityProfileIdentifiers) (\s :: ListSecurityProfilesResponse
s@ListSecurityProfilesResponse' {} Maybe [SecurityProfileIdentifier]
a -> ListSecurityProfilesResponse
s {$sel:securityProfileIdentifiers:ListSecurityProfilesResponse' :: Maybe [SecurityProfileIdentifier]
securityProfileIdentifiers = Maybe [SecurityProfileIdentifier]
a} :: ListSecurityProfilesResponse) ((Maybe [SecurityProfileIdentifier]
  -> f (Maybe [SecurityProfileIdentifier]))
 -> ListSecurityProfilesResponse -> f ListSecurityProfilesResponse)
-> ((Maybe [SecurityProfileIdentifier]
     -> f (Maybe [SecurityProfileIdentifier]))
    -> Maybe [SecurityProfileIdentifier]
    -> f (Maybe [SecurityProfileIdentifier]))
-> (Maybe [SecurityProfileIdentifier]
    -> f (Maybe [SecurityProfileIdentifier]))
-> ListSecurityProfilesResponse
-> f ListSecurityProfilesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SecurityProfileIdentifier]
  [SecurityProfileIdentifier]
  [SecurityProfileIdentifier]
  [SecurityProfileIdentifier]
-> Iso
     (Maybe [SecurityProfileIdentifier])
     (Maybe [SecurityProfileIdentifier])
     (Maybe [SecurityProfileIdentifier])
     (Maybe [SecurityProfileIdentifier])
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
  [SecurityProfileIdentifier]
  [SecurityProfileIdentifier]
  [SecurityProfileIdentifier]
  [SecurityProfileIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListSecurityProfilesResponse