{-# 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.ListTargetsForSecurityProfile
-- 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 targets (thing groups) associated with a given Device Defender
-- security profile.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListTargetsForSecurityProfile>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListTargetsForSecurityProfile
  ( -- * Creating a Request
    ListTargetsForSecurityProfile (..),
    newListTargetsForSecurityProfile,

    -- * Request Lenses
    listTargetsForSecurityProfile_nextToken,
    listTargetsForSecurityProfile_maxResults,
    listTargetsForSecurityProfile_securityProfileName,

    -- * Destructuring the Response
    ListTargetsForSecurityProfileResponse (..),
    newListTargetsForSecurityProfileResponse,

    -- * Response Lenses
    listTargetsForSecurityProfileResponse_securityProfileTargets,
    listTargetsForSecurityProfileResponse_nextToken,
    listTargetsForSecurityProfileResponse_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:/ 'newListTargetsForSecurityProfile' smart constructor.
data ListTargetsForSecurityProfile = ListTargetsForSecurityProfile'
  { -- | The token for the next set of results.
    ListTargetsForSecurityProfile -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return at one time.
    ListTargetsForSecurityProfile -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The security profile.
    ListTargetsForSecurityProfile -> Text
securityProfileName :: Prelude.Text
  }
  deriving (ListTargetsForSecurityProfile
-> ListTargetsForSecurityProfile -> Bool
(ListTargetsForSecurityProfile
 -> ListTargetsForSecurityProfile -> Bool)
-> (ListTargetsForSecurityProfile
    -> ListTargetsForSecurityProfile -> Bool)
-> Eq ListTargetsForSecurityProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTargetsForSecurityProfile
-> ListTargetsForSecurityProfile -> Bool
$c/= :: ListTargetsForSecurityProfile
-> ListTargetsForSecurityProfile -> Bool
== :: ListTargetsForSecurityProfile
-> ListTargetsForSecurityProfile -> Bool
$c== :: ListTargetsForSecurityProfile
-> ListTargetsForSecurityProfile -> Bool
Prelude.Eq, ReadPrec [ListTargetsForSecurityProfile]
ReadPrec ListTargetsForSecurityProfile
Int -> ReadS ListTargetsForSecurityProfile
ReadS [ListTargetsForSecurityProfile]
(Int -> ReadS ListTargetsForSecurityProfile)
-> ReadS [ListTargetsForSecurityProfile]
-> ReadPrec ListTargetsForSecurityProfile
-> ReadPrec [ListTargetsForSecurityProfile]
-> Read ListTargetsForSecurityProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTargetsForSecurityProfile]
$creadListPrec :: ReadPrec [ListTargetsForSecurityProfile]
readPrec :: ReadPrec ListTargetsForSecurityProfile
$creadPrec :: ReadPrec ListTargetsForSecurityProfile
readList :: ReadS [ListTargetsForSecurityProfile]
$creadList :: ReadS [ListTargetsForSecurityProfile]
readsPrec :: Int -> ReadS ListTargetsForSecurityProfile
$creadsPrec :: Int -> ReadS ListTargetsForSecurityProfile
Prelude.Read, Int -> ListTargetsForSecurityProfile -> ShowS
[ListTargetsForSecurityProfile] -> ShowS
ListTargetsForSecurityProfile -> String
(Int -> ListTargetsForSecurityProfile -> ShowS)
-> (ListTargetsForSecurityProfile -> String)
-> ([ListTargetsForSecurityProfile] -> ShowS)
-> Show ListTargetsForSecurityProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTargetsForSecurityProfile] -> ShowS
$cshowList :: [ListTargetsForSecurityProfile] -> ShowS
show :: ListTargetsForSecurityProfile -> String
$cshow :: ListTargetsForSecurityProfile -> String
showsPrec :: Int -> ListTargetsForSecurityProfile -> ShowS
$cshowsPrec :: Int -> ListTargetsForSecurityProfile -> ShowS
Prelude.Show, (forall x.
 ListTargetsForSecurityProfile
 -> Rep ListTargetsForSecurityProfile x)
-> (forall x.
    Rep ListTargetsForSecurityProfile x
    -> ListTargetsForSecurityProfile)
-> Generic ListTargetsForSecurityProfile
forall x.
Rep ListTargetsForSecurityProfile x
-> ListTargetsForSecurityProfile
forall x.
ListTargetsForSecurityProfile
-> Rep ListTargetsForSecurityProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTargetsForSecurityProfile x
-> ListTargetsForSecurityProfile
$cfrom :: forall x.
ListTargetsForSecurityProfile
-> Rep ListTargetsForSecurityProfile x
Prelude.Generic)

-- |
-- Create a value of 'ListTargetsForSecurityProfile' 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', 'listTargetsForSecurityProfile_nextToken' - The token for the next set of results.
--
-- 'maxResults', 'listTargetsForSecurityProfile_maxResults' - The maximum number of results to return at one time.
--
-- 'securityProfileName', 'listTargetsForSecurityProfile_securityProfileName' - The security profile.
newListTargetsForSecurityProfile ::
  -- | 'securityProfileName'
  Prelude.Text ->
  ListTargetsForSecurityProfile
newListTargetsForSecurityProfile :: Text -> ListTargetsForSecurityProfile
newListTargetsForSecurityProfile
  Text
pSecurityProfileName_ =
    ListTargetsForSecurityProfile' :: Maybe Text
-> Maybe Natural -> Text -> ListTargetsForSecurityProfile
ListTargetsForSecurityProfile'
      { $sel:nextToken:ListTargetsForSecurityProfile' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListTargetsForSecurityProfile' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:securityProfileName:ListTargetsForSecurityProfile' :: Text
securityProfileName = Text
pSecurityProfileName_
      }

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

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

-- | The security profile.
listTargetsForSecurityProfile_securityProfileName :: Lens.Lens' ListTargetsForSecurityProfile Prelude.Text
listTargetsForSecurityProfile_securityProfileName :: (Text -> f Text)
-> ListTargetsForSecurityProfile -> f ListTargetsForSecurityProfile
listTargetsForSecurityProfile_securityProfileName = (ListTargetsForSecurityProfile -> Text)
-> (ListTargetsForSecurityProfile
    -> Text -> ListTargetsForSecurityProfile)
-> Lens
     ListTargetsForSecurityProfile
     ListTargetsForSecurityProfile
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTargetsForSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> Text
securityProfileName} -> Text
securityProfileName) (\s :: ListTargetsForSecurityProfile
s@ListTargetsForSecurityProfile' {} Text
a -> ListTargetsForSecurityProfile
s {$sel:securityProfileName:ListTargetsForSecurityProfile' :: Text
securityProfileName = Text
a} :: ListTargetsForSecurityProfile)

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

instance Prelude.NFData ListTargetsForSecurityProfile

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

instance Core.ToPath ListTargetsForSecurityProfile where
  toPath :: ListTargetsForSecurityProfile -> ByteString
toPath ListTargetsForSecurityProfile' {Maybe Natural
Maybe Text
Text
securityProfileName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:securityProfileName:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> Text
$sel:maxResults:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> Maybe Natural
$sel:nextToken:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/security-profiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
securityProfileName,
        ByteString
"/targets"
      ]

instance Core.ToQuery ListTargetsForSecurityProfile where
  toQuery :: ListTargetsForSecurityProfile -> QueryString
toQuery ListTargetsForSecurityProfile' {Maybe Natural
Maybe Text
Text
securityProfileName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:securityProfileName:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> Text
$sel:maxResults:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> Maybe Natural
$sel:nextToken:ListTargetsForSecurityProfile' :: ListTargetsForSecurityProfile -> 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
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

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

-- |
-- Create a value of 'ListTargetsForSecurityProfileResponse' 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:
--
-- 'securityProfileTargets', 'listTargetsForSecurityProfileResponse_securityProfileTargets' - The thing groups to which the security profile is attached.
--
-- 'nextToken', 'listTargetsForSecurityProfileResponse_nextToken' - A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
--
-- 'httpStatus', 'listTargetsForSecurityProfileResponse_httpStatus' - The response's http status code.
newListTargetsForSecurityProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTargetsForSecurityProfileResponse
newListTargetsForSecurityProfileResponse :: Int -> ListTargetsForSecurityProfileResponse
newListTargetsForSecurityProfileResponse Int
pHttpStatus_ =
  ListTargetsForSecurityProfileResponse' :: Maybe [SecurityProfileTarget]
-> Maybe Text -> Int -> ListTargetsForSecurityProfileResponse
ListTargetsForSecurityProfileResponse'
    { $sel:securityProfileTargets:ListTargetsForSecurityProfileResponse' :: Maybe [SecurityProfileTarget]
securityProfileTargets =
        Maybe [SecurityProfileTarget]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTargetsForSecurityProfileResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTargetsForSecurityProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The thing groups to which the security profile is attached.
listTargetsForSecurityProfileResponse_securityProfileTargets :: Lens.Lens' ListTargetsForSecurityProfileResponse (Prelude.Maybe [SecurityProfileTarget])
listTargetsForSecurityProfileResponse_securityProfileTargets :: (Maybe [SecurityProfileTarget]
 -> f (Maybe [SecurityProfileTarget]))
-> ListTargetsForSecurityProfileResponse
-> f ListTargetsForSecurityProfileResponse
listTargetsForSecurityProfileResponse_securityProfileTargets = (ListTargetsForSecurityProfileResponse
 -> Maybe [SecurityProfileTarget])
-> (ListTargetsForSecurityProfileResponse
    -> Maybe [SecurityProfileTarget]
    -> ListTargetsForSecurityProfileResponse)
-> Lens'
     ListTargetsForSecurityProfileResponse
     (Maybe [SecurityProfileTarget])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTargetsForSecurityProfileResponse' {Maybe [SecurityProfileTarget]
securityProfileTargets :: Maybe [SecurityProfileTarget]
$sel:securityProfileTargets:ListTargetsForSecurityProfileResponse' :: ListTargetsForSecurityProfileResponse
-> Maybe [SecurityProfileTarget]
securityProfileTargets} -> Maybe [SecurityProfileTarget]
securityProfileTargets) (\s :: ListTargetsForSecurityProfileResponse
s@ListTargetsForSecurityProfileResponse' {} Maybe [SecurityProfileTarget]
a -> ListTargetsForSecurityProfileResponse
s {$sel:securityProfileTargets:ListTargetsForSecurityProfileResponse' :: Maybe [SecurityProfileTarget]
securityProfileTargets = Maybe [SecurityProfileTarget]
a} :: ListTargetsForSecurityProfileResponse) ((Maybe [SecurityProfileTarget]
  -> f (Maybe [SecurityProfileTarget]))
 -> ListTargetsForSecurityProfileResponse
 -> f ListTargetsForSecurityProfileResponse)
-> ((Maybe [SecurityProfileTarget]
     -> f (Maybe [SecurityProfileTarget]))
    -> Maybe [SecurityProfileTarget]
    -> f (Maybe [SecurityProfileTarget]))
-> (Maybe [SecurityProfileTarget]
    -> f (Maybe [SecurityProfileTarget]))
-> ListTargetsForSecurityProfileResponse
-> f ListTargetsForSecurityProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SecurityProfileTarget]
  [SecurityProfileTarget]
  [SecurityProfileTarget]
  [SecurityProfileTarget]
-> Iso
     (Maybe [SecurityProfileTarget])
     (Maybe [SecurityProfileTarget])
     (Maybe [SecurityProfileTarget])
     (Maybe [SecurityProfileTarget])
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
  [SecurityProfileTarget]
  [SecurityProfileTarget]
  [SecurityProfileTarget]
  [SecurityProfileTarget]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    ListTargetsForSecurityProfileResponse