{-# 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.ListSecurityProfilesForTarget
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the Device Defender security profiles attached to a target (thing
-- group).
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListSecurityProfilesForTarget>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListSecurityProfilesForTarget
  ( -- * Creating a Request
    ListSecurityProfilesForTarget (..),
    newListSecurityProfilesForTarget,

    -- * Request Lenses
    listSecurityProfilesForTarget_maxResults,
    listSecurityProfilesForTarget_nextToken,
    listSecurityProfilesForTarget_recursive,
    listSecurityProfilesForTarget_securityProfileTargetArn,

    -- * Destructuring the Response
    ListSecurityProfilesForTargetResponse (..),
    newListSecurityProfilesForTargetResponse,

    -- * Response Lenses
    listSecurityProfilesForTargetResponse_nextToken,
    listSecurityProfilesForTargetResponse_securityProfileTargetMappings,
    listSecurityProfilesForTargetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListSecurityProfilesForTarget' smart constructor.
data ListSecurityProfilesForTarget = ListSecurityProfilesForTarget'
  { -- | The maximum number of results to return at one time.
    ListSecurityProfilesForTarget -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of results.
    ListSecurityProfilesForTarget -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | If true, return child groups too.
    ListSecurityProfilesForTarget -> Maybe Bool
recursive :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the target (thing group) whose attached security profiles you
    -- want to get.
    ListSecurityProfilesForTarget -> Text
securityProfileTargetArn :: Prelude.Text
  }
  deriving (ListSecurityProfilesForTarget
-> ListSecurityProfilesForTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityProfilesForTarget
-> ListSecurityProfilesForTarget -> Bool
$c/= :: ListSecurityProfilesForTarget
-> ListSecurityProfilesForTarget -> Bool
== :: ListSecurityProfilesForTarget
-> ListSecurityProfilesForTarget -> Bool
$c== :: ListSecurityProfilesForTarget
-> ListSecurityProfilesForTarget -> Bool
Prelude.Eq, ReadPrec [ListSecurityProfilesForTarget]
ReadPrec ListSecurityProfilesForTarget
Int -> ReadS ListSecurityProfilesForTarget
ReadS [ListSecurityProfilesForTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityProfilesForTarget]
$creadListPrec :: ReadPrec [ListSecurityProfilesForTarget]
readPrec :: ReadPrec ListSecurityProfilesForTarget
$creadPrec :: ReadPrec ListSecurityProfilesForTarget
readList :: ReadS [ListSecurityProfilesForTarget]
$creadList :: ReadS [ListSecurityProfilesForTarget]
readsPrec :: Int -> ReadS ListSecurityProfilesForTarget
$creadsPrec :: Int -> ReadS ListSecurityProfilesForTarget
Prelude.Read, Int -> ListSecurityProfilesForTarget -> ShowS
[ListSecurityProfilesForTarget] -> ShowS
ListSecurityProfilesForTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityProfilesForTarget] -> ShowS
$cshowList :: [ListSecurityProfilesForTarget] -> ShowS
show :: ListSecurityProfilesForTarget -> String
$cshow :: ListSecurityProfilesForTarget -> String
showsPrec :: Int -> ListSecurityProfilesForTarget -> ShowS
$cshowsPrec :: Int -> ListSecurityProfilesForTarget -> ShowS
Prelude.Show, forall x.
Rep ListSecurityProfilesForTarget x
-> ListSecurityProfilesForTarget
forall x.
ListSecurityProfilesForTarget
-> Rep ListSecurityProfilesForTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSecurityProfilesForTarget x
-> ListSecurityProfilesForTarget
$cfrom :: forall x.
ListSecurityProfilesForTarget
-> Rep ListSecurityProfilesForTarget x
Prelude.Generic)

-- |
-- Create a value of 'ListSecurityProfilesForTarget' 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:
--
-- 'maxResults', 'listSecurityProfilesForTarget_maxResults' - The maximum number of results to return at one time.
--
-- 'nextToken', 'listSecurityProfilesForTarget_nextToken' - The token for the next set of results.
--
-- 'recursive', 'listSecurityProfilesForTarget_recursive' - If true, return child groups too.
--
-- 'securityProfileTargetArn', 'listSecurityProfilesForTarget_securityProfileTargetArn' - The ARN of the target (thing group) whose attached security profiles you
-- want to get.
newListSecurityProfilesForTarget ::
  -- | 'securityProfileTargetArn'
  Prelude.Text ->
  ListSecurityProfilesForTarget
newListSecurityProfilesForTarget :: Text -> ListSecurityProfilesForTarget
newListSecurityProfilesForTarget
  Text
pSecurityProfileTargetArn_ =
    ListSecurityProfilesForTarget'
      { $sel:maxResults:ListSecurityProfilesForTarget' :: Maybe Natural
maxResults =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListSecurityProfilesForTarget' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:recursive:ListSecurityProfilesForTarget' :: Maybe Bool
recursive = forall a. Maybe a
Prelude.Nothing,
        $sel:securityProfileTargetArn:ListSecurityProfilesForTarget' :: Text
securityProfileTargetArn =
          Text
pSecurityProfileTargetArn_
      }

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

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

-- | If true, return child groups too.
listSecurityProfilesForTarget_recursive :: Lens.Lens' ListSecurityProfilesForTarget (Prelude.Maybe Prelude.Bool)
listSecurityProfilesForTarget_recursive :: Lens' ListSecurityProfilesForTarget (Maybe Bool)
listSecurityProfilesForTarget_recursive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfilesForTarget' {Maybe Bool
recursive :: Maybe Bool
$sel:recursive:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Bool
recursive} -> Maybe Bool
recursive) (\s :: ListSecurityProfilesForTarget
s@ListSecurityProfilesForTarget' {} Maybe Bool
a -> ListSecurityProfilesForTarget
s {$sel:recursive:ListSecurityProfilesForTarget' :: Maybe Bool
recursive = Maybe Bool
a} :: ListSecurityProfilesForTarget)

-- | The ARN of the target (thing group) whose attached security profiles you
-- want to get.
listSecurityProfilesForTarget_securityProfileTargetArn :: Lens.Lens' ListSecurityProfilesForTarget Prelude.Text
listSecurityProfilesForTarget_securityProfileTargetArn :: Lens' ListSecurityProfilesForTarget Text
listSecurityProfilesForTarget_securityProfileTargetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfilesForTarget' {Text
securityProfileTargetArn :: Text
$sel:securityProfileTargetArn:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Text
securityProfileTargetArn} -> Text
securityProfileTargetArn) (\s :: ListSecurityProfilesForTarget
s@ListSecurityProfilesForTarget' {} Text
a -> ListSecurityProfilesForTarget
s {$sel:securityProfileTargetArn:ListSecurityProfilesForTarget' :: Text
securityProfileTargetArn = Text
a} :: ListSecurityProfilesForTarget)

instance Core.AWSPager ListSecurityProfilesForTarget where
  page :: ListSecurityProfilesForTarget
-> AWSResponse ListSecurityProfilesForTarget
-> Maybe ListSecurityProfilesForTarget
page ListSecurityProfilesForTarget
rq AWSResponse ListSecurityProfilesForTarget
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSecurityProfilesForTarget
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecurityProfilesForTargetResponse (Maybe Text)
listSecurityProfilesForTargetResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSecurityProfilesForTarget
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListSecurityProfilesForTargetResponse
  (Maybe [SecurityProfileTargetMapping])
listSecurityProfilesForTargetResponse_securityProfileTargetMappings
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListSecurityProfilesForTarget
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSecurityProfilesForTarget (Maybe Text)
listSecurityProfilesForTarget_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSecurityProfilesForTarget
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSecurityProfilesForTargetResponse (Maybe Text)
listSecurityProfilesForTargetResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    ListSecurityProfilesForTarget
  where
  type
    AWSResponse ListSecurityProfilesForTarget =
      ListSecurityProfilesForTargetResponse
  request :: (Service -> Service)
-> ListSecurityProfilesForTarget
-> Request ListSecurityProfilesForTarget
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSecurityProfilesForTarget
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSecurityProfilesForTarget)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [SecurityProfileTargetMapping]
-> Int
-> ListSecurityProfilesForTargetResponse
ListSecurityProfilesForTargetResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"securityProfileTargetMappings"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListSecurityProfilesForTarget
  where
  hashWithSalt :: Int -> ListSecurityProfilesForTarget -> Int
hashWithSalt Int
_salt ListSecurityProfilesForTarget' {Maybe Bool
Maybe Natural
Maybe Text
Text
securityProfileTargetArn :: Text
recursive :: Maybe Bool
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:securityProfileTargetArn:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Text
$sel:recursive:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Bool
$sel:nextToken:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Text
$sel:maxResults:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
recursive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
securityProfileTargetArn

instance Prelude.NFData ListSecurityProfilesForTarget where
  rnf :: ListSecurityProfilesForTarget -> ()
rnf ListSecurityProfilesForTarget' {Maybe Bool
Maybe Natural
Maybe Text
Text
securityProfileTargetArn :: Text
recursive :: Maybe Bool
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:securityProfileTargetArn:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Text
$sel:recursive:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Bool
$sel:nextToken:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Text
$sel:maxResults:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
recursive
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
securityProfileTargetArn

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

instance Data.ToPath ListSecurityProfilesForTarget where
  toPath :: ListSecurityProfilesForTarget -> ByteString
toPath =
    forall a b. a -> b -> a
Prelude.const ByteString
"/security-profiles-for-target"

instance Data.ToQuery ListSecurityProfilesForTarget where
  toQuery :: ListSecurityProfilesForTarget -> QueryString
toQuery ListSecurityProfilesForTarget' {Maybe Bool
Maybe Natural
Maybe Text
Text
securityProfileTargetArn :: Text
recursive :: Maybe Bool
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:securityProfileTargetArn:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Text
$sel:recursive:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Bool
$sel:nextToken:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Text
$sel:maxResults:ListSecurityProfilesForTarget' :: ListSecurityProfilesForTarget -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"recursive" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
recursive,
        ByteString
"securityProfileTargetArn"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
securityProfileTargetArn
      ]

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

-- |
-- Create a value of 'ListSecurityProfilesForTargetResponse' 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', 'listSecurityProfilesForTargetResponse_nextToken' - A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
--
-- 'securityProfileTargetMappings', 'listSecurityProfilesForTargetResponse_securityProfileTargetMappings' - A list of security profiles and their associated targets.
--
-- 'httpStatus', 'listSecurityProfilesForTargetResponse_httpStatus' - The response's http status code.
newListSecurityProfilesForTargetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSecurityProfilesForTargetResponse
newListSecurityProfilesForTargetResponse :: Int -> ListSecurityProfilesForTargetResponse
newListSecurityProfilesForTargetResponse Int
pHttpStatus_ =
  ListSecurityProfilesForTargetResponse'
    { $sel:nextToken:ListSecurityProfilesForTargetResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileTargetMappings:ListSecurityProfilesForTargetResponse' :: Maybe [SecurityProfileTargetMapping]
securityProfileTargetMappings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSecurityProfilesForTargetResponse' :: 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.
listSecurityProfilesForTargetResponse_nextToken :: Lens.Lens' ListSecurityProfilesForTargetResponse (Prelude.Maybe Prelude.Text)
listSecurityProfilesForTargetResponse_nextToken :: Lens' ListSecurityProfilesForTargetResponse (Maybe Text)
listSecurityProfilesForTargetResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfilesForTargetResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecurityProfilesForTargetResponse' :: ListSecurityProfilesForTargetResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecurityProfilesForTargetResponse
s@ListSecurityProfilesForTargetResponse' {} Maybe Text
a -> ListSecurityProfilesForTargetResponse
s {$sel:nextToken:ListSecurityProfilesForTargetResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecurityProfilesForTargetResponse)

-- | A list of security profiles and their associated targets.
listSecurityProfilesForTargetResponse_securityProfileTargetMappings :: Lens.Lens' ListSecurityProfilesForTargetResponse (Prelude.Maybe [SecurityProfileTargetMapping])
listSecurityProfilesForTargetResponse_securityProfileTargetMappings :: Lens'
  ListSecurityProfilesForTargetResponse
  (Maybe [SecurityProfileTargetMapping])
listSecurityProfilesForTargetResponse_securityProfileTargetMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityProfilesForTargetResponse' {Maybe [SecurityProfileTargetMapping]
securityProfileTargetMappings :: Maybe [SecurityProfileTargetMapping]
$sel:securityProfileTargetMappings:ListSecurityProfilesForTargetResponse' :: ListSecurityProfilesForTargetResponse
-> Maybe [SecurityProfileTargetMapping]
securityProfileTargetMappings} -> Maybe [SecurityProfileTargetMapping]
securityProfileTargetMappings) (\s :: ListSecurityProfilesForTargetResponse
s@ListSecurityProfilesForTargetResponse' {} Maybe [SecurityProfileTargetMapping]
a -> ListSecurityProfilesForTargetResponse
s {$sel:securityProfileTargetMappings:ListSecurityProfilesForTargetResponse' :: Maybe [SecurityProfileTargetMapping]
securityProfileTargetMappings = Maybe [SecurityProfileTargetMapping]
a} :: ListSecurityProfilesForTargetResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListSecurityProfilesForTargetResponse
  where
  rnf :: ListSecurityProfilesForTargetResponse -> ()
rnf ListSecurityProfilesForTargetResponse' {Int
Maybe [SecurityProfileTargetMapping]
Maybe Text
httpStatus :: Int
securityProfileTargetMappings :: Maybe [SecurityProfileTargetMapping]
nextToken :: Maybe Text
$sel:httpStatus:ListSecurityProfilesForTargetResponse' :: ListSecurityProfilesForTargetResponse -> Int
$sel:securityProfileTargetMappings:ListSecurityProfilesForTargetResponse' :: ListSecurityProfilesForTargetResponse
-> Maybe [SecurityProfileTargetMapping]
$sel:nextToken:ListSecurityProfilesForTargetResponse' :: ListSecurityProfilesForTargetResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SecurityProfileTargetMapping]
securityProfileTargetMappings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus