{-# 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.DescribeSecurityProfile
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about a 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 DescribeSecurityProfile>
-- action.
module Amazonka.IoT.DescribeSecurityProfile
  ( -- * Creating a Request
    DescribeSecurityProfile (..),
    newDescribeSecurityProfile,

    -- * Request Lenses
    describeSecurityProfile_securityProfileName,

    -- * Destructuring the Response
    DescribeSecurityProfileResponse (..),
    newDescribeSecurityProfileResponse,

    -- * Response Lenses
    describeSecurityProfileResponse_additionalMetricsToRetain,
    describeSecurityProfileResponse_additionalMetricsToRetainV2,
    describeSecurityProfileResponse_alertTargets,
    describeSecurityProfileResponse_behaviors,
    describeSecurityProfileResponse_creationDate,
    describeSecurityProfileResponse_lastModifiedDate,
    describeSecurityProfileResponse_securityProfileArn,
    describeSecurityProfileResponse_securityProfileDescription,
    describeSecurityProfileResponse_securityProfileName,
    describeSecurityProfileResponse_version,
    describeSecurityProfileResponse_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:/ 'newDescribeSecurityProfile' smart constructor.
data DescribeSecurityProfile = DescribeSecurityProfile'
  { -- | The name of the security profile whose information you want to get.
    DescribeSecurityProfile -> Text
securityProfileName :: Prelude.Text
  }
  deriving (DescribeSecurityProfile -> DescribeSecurityProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSecurityProfile -> DescribeSecurityProfile -> Bool
$c/= :: DescribeSecurityProfile -> DescribeSecurityProfile -> Bool
== :: DescribeSecurityProfile -> DescribeSecurityProfile -> Bool
$c== :: DescribeSecurityProfile -> DescribeSecurityProfile -> Bool
Prelude.Eq, ReadPrec [DescribeSecurityProfile]
ReadPrec DescribeSecurityProfile
Int -> ReadS DescribeSecurityProfile
ReadS [DescribeSecurityProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSecurityProfile]
$creadListPrec :: ReadPrec [DescribeSecurityProfile]
readPrec :: ReadPrec DescribeSecurityProfile
$creadPrec :: ReadPrec DescribeSecurityProfile
readList :: ReadS [DescribeSecurityProfile]
$creadList :: ReadS [DescribeSecurityProfile]
readsPrec :: Int -> ReadS DescribeSecurityProfile
$creadsPrec :: Int -> ReadS DescribeSecurityProfile
Prelude.Read, Int -> DescribeSecurityProfile -> ShowS
[DescribeSecurityProfile] -> ShowS
DescribeSecurityProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSecurityProfile] -> ShowS
$cshowList :: [DescribeSecurityProfile] -> ShowS
show :: DescribeSecurityProfile -> String
$cshow :: DescribeSecurityProfile -> String
showsPrec :: Int -> DescribeSecurityProfile -> ShowS
$cshowsPrec :: Int -> DescribeSecurityProfile -> ShowS
Prelude.Show, forall x. Rep DescribeSecurityProfile x -> DescribeSecurityProfile
forall x. DescribeSecurityProfile -> Rep DescribeSecurityProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeSecurityProfile x -> DescribeSecurityProfile
$cfrom :: forall x. DescribeSecurityProfile -> Rep DescribeSecurityProfile x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSecurityProfile' 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:
--
-- 'securityProfileName', 'describeSecurityProfile_securityProfileName' - The name of the security profile whose information you want to get.
newDescribeSecurityProfile ::
  -- | 'securityProfileName'
  Prelude.Text ->
  DescribeSecurityProfile
newDescribeSecurityProfile :: Text -> DescribeSecurityProfile
newDescribeSecurityProfile Text
pSecurityProfileName_ =
  DescribeSecurityProfile'
    { $sel:securityProfileName:DescribeSecurityProfile' :: Text
securityProfileName =
        Text
pSecurityProfileName_
    }

-- | The name of the security profile whose information you want to get.
describeSecurityProfile_securityProfileName :: Lens.Lens' DescribeSecurityProfile Prelude.Text
describeSecurityProfile_securityProfileName :: Lens' DescribeSecurityProfile Text
describeSecurityProfile_securityProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:DescribeSecurityProfile' :: DescribeSecurityProfile -> Text
securityProfileName} -> Text
securityProfileName) (\s :: DescribeSecurityProfile
s@DescribeSecurityProfile' {} Text
a -> DescribeSecurityProfile
s {$sel:securityProfileName:DescribeSecurityProfile' :: Text
securityProfileName = Text
a} :: DescribeSecurityProfile)

instance Core.AWSRequest DescribeSecurityProfile where
  type
    AWSResponse DescribeSecurityProfile =
      DescribeSecurityProfileResponse
  request :: (Service -> Service)
-> DescribeSecurityProfile -> Request DescribeSecurityProfile
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 DescribeSecurityProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeSecurityProfile)))
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 [MetricToRetain]
-> Maybe (HashMap AlertTargetType AlertTarget)
-> Maybe [Behavior]
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Int
-> DescribeSecurityProfileResponse
DescribeSecurityProfileResponse'
            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
"additionalMetricsToRetain"
                            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.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"additionalMetricsToRetainV2"
                            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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"alertTargets" 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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"behaviors" 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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"creationDate")
            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
"lastModifiedDate")
            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
"securityProfileArn")
            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
"securityProfileDescription")
            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
"securityProfileName")
            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
"version")
            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 DescribeSecurityProfile where
  hashWithSalt :: Int -> DescribeSecurityProfile -> Int
hashWithSalt Int
_salt DescribeSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:DescribeSecurityProfile' :: DescribeSecurityProfile -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
securityProfileName

instance Prelude.NFData DescribeSecurityProfile where
  rnf :: DescribeSecurityProfile -> ()
rnf DescribeSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:DescribeSecurityProfile' :: DescribeSecurityProfile -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
securityProfileName

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

instance Data.ToPath DescribeSecurityProfile where
  toPath :: DescribeSecurityProfile -> ByteString
toPath DescribeSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:DescribeSecurityProfile' :: DescribeSecurityProfile -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/security-profiles/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
securityProfileName
      ]

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

-- | /See:/ 'newDescribeSecurityProfileResponse' smart constructor.
data DescribeSecurityProfileResponse = DescribeSecurityProfileResponse'
  { -- | /Please use DescribeSecurityProfileResponse$additionalMetricsToRetainV2
    -- instead./
    --
    -- A list of metrics whose data is retained (stored). By default, data is
    -- retained for any metric used in the profile\'s @behaviors@, but it is
    -- also retained for any metric specified here.
    DescribeSecurityProfileResponse -> Maybe [Text]
additionalMetricsToRetain :: Prelude.Maybe [Prelude.Text],
    -- | A list of metrics whose data is retained (stored). By default, data is
    -- retained for any metric used in the profile\'s behaviors, but it is also
    -- retained for any metric specified here.
    DescribeSecurityProfileResponse -> Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Prelude.Maybe [MetricToRetain],
    -- | Where the alerts are sent. (Alerts are always sent to the console.)
    DescribeSecurityProfileResponse
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget),
    -- | Specifies the behaviors that, when violated by a device (thing), cause
    -- an alert.
    DescribeSecurityProfileResponse -> Maybe [Behavior]
behaviors :: Prelude.Maybe [Behavior],
    -- | The time the security profile was created.
    DescribeSecurityProfileResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The time the security profile was last modified.
    DescribeSecurityProfileResponse -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the security profile.
    DescribeSecurityProfileResponse -> Maybe Text
securityProfileArn :: Prelude.Maybe Prelude.Text,
    -- | A description of the security profile (associated with the security
    -- profile when it was created or updated).
    DescribeSecurityProfileResponse -> Maybe Text
securityProfileDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the security profile.
    DescribeSecurityProfileResponse -> Maybe Text
securityProfileName :: Prelude.Maybe Prelude.Text,
    -- | The version of the security profile. A new version is generated whenever
    -- the security profile is updated.
    DescribeSecurityProfileResponse -> Maybe Integer
version :: Prelude.Maybe Prelude.Integer,
    -- | The response's http status code.
    DescribeSecurityProfileResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeSecurityProfileResponse
-> DescribeSecurityProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSecurityProfileResponse
-> DescribeSecurityProfileResponse -> Bool
$c/= :: DescribeSecurityProfileResponse
-> DescribeSecurityProfileResponse -> Bool
== :: DescribeSecurityProfileResponse
-> DescribeSecurityProfileResponse -> Bool
$c== :: DescribeSecurityProfileResponse
-> DescribeSecurityProfileResponse -> Bool
Prelude.Eq, ReadPrec [DescribeSecurityProfileResponse]
ReadPrec DescribeSecurityProfileResponse
Int -> ReadS DescribeSecurityProfileResponse
ReadS [DescribeSecurityProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSecurityProfileResponse]
$creadListPrec :: ReadPrec [DescribeSecurityProfileResponse]
readPrec :: ReadPrec DescribeSecurityProfileResponse
$creadPrec :: ReadPrec DescribeSecurityProfileResponse
readList :: ReadS [DescribeSecurityProfileResponse]
$creadList :: ReadS [DescribeSecurityProfileResponse]
readsPrec :: Int -> ReadS DescribeSecurityProfileResponse
$creadsPrec :: Int -> ReadS DescribeSecurityProfileResponse
Prelude.Read, Int -> DescribeSecurityProfileResponse -> ShowS
[DescribeSecurityProfileResponse] -> ShowS
DescribeSecurityProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSecurityProfileResponse] -> ShowS
$cshowList :: [DescribeSecurityProfileResponse] -> ShowS
show :: DescribeSecurityProfileResponse -> String
$cshow :: DescribeSecurityProfileResponse -> String
showsPrec :: Int -> DescribeSecurityProfileResponse -> ShowS
$cshowsPrec :: Int -> DescribeSecurityProfileResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeSecurityProfileResponse x
-> DescribeSecurityProfileResponse
forall x.
DescribeSecurityProfileResponse
-> Rep DescribeSecurityProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSecurityProfileResponse x
-> DescribeSecurityProfileResponse
$cfrom :: forall x.
DescribeSecurityProfileResponse
-> Rep DescribeSecurityProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSecurityProfileResponse' 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:
--
-- 'additionalMetricsToRetain', 'describeSecurityProfileResponse_additionalMetricsToRetain' - /Please use DescribeSecurityProfileResponse$additionalMetricsToRetainV2
-- instead./
--
-- A list of metrics whose data is retained (stored). By default, data is
-- retained for any metric used in the profile\'s @behaviors@, but it is
-- also retained for any metric specified here.
--
-- 'additionalMetricsToRetainV2', 'describeSecurityProfileResponse_additionalMetricsToRetainV2' - A list of metrics whose data is retained (stored). By default, data is
-- retained for any metric used in the profile\'s behaviors, but it is also
-- retained for any metric specified here.
--
-- 'alertTargets', 'describeSecurityProfileResponse_alertTargets' - Where the alerts are sent. (Alerts are always sent to the console.)
--
-- 'behaviors', 'describeSecurityProfileResponse_behaviors' - Specifies the behaviors that, when violated by a device (thing), cause
-- an alert.
--
-- 'creationDate', 'describeSecurityProfileResponse_creationDate' - The time the security profile was created.
--
-- 'lastModifiedDate', 'describeSecurityProfileResponse_lastModifiedDate' - The time the security profile was last modified.
--
-- 'securityProfileArn', 'describeSecurityProfileResponse_securityProfileArn' - The ARN of the security profile.
--
-- 'securityProfileDescription', 'describeSecurityProfileResponse_securityProfileDescription' - A description of the security profile (associated with the security
-- profile when it was created or updated).
--
-- 'securityProfileName', 'describeSecurityProfileResponse_securityProfileName' - The name of the security profile.
--
-- 'version', 'describeSecurityProfileResponse_version' - The version of the security profile. A new version is generated whenever
-- the security profile is updated.
--
-- 'httpStatus', 'describeSecurityProfileResponse_httpStatus' - The response's http status code.
newDescribeSecurityProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeSecurityProfileResponse
newDescribeSecurityProfileResponse :: Int -> DescribeSecurityProfileResponse
newDescribeSecurityProfileResponse Int
pHttpStatus_ =
  DescribeSecurityProfileResponse'
    { $sel:additionalMetricsToRetain:DescribeSecurityProfileResponse' :: Maybe [Text]
additionalMetricsToRetain =
        forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetricsToRetainV2:DescribeSecurityProfileResponse' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 =
        forall a. Maybe a
Prelude.Nothing,
      $sel:alertTargets:DescribeSecurityProfileResponse' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets = forall a. Maybe a
Prelude.Nothing,
      $sel:behaviors:DescribeSecurityProfileResponse' :: Maybe [Behavior]
behaviors = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:DescribeSecurityProfileResponse' :: Maybe POSIX
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:DescribeSecurityProfileResponse' :: Maybe POSIX
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileArn:DescribeSecurityProfileResponse' :: Maybe Text
securityProfileArn = forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileDescription:DescribeSecurityProfileResponse' :: Maybe Text
securityProfileDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:DescribeSecurityProfileResponse' :: Maybe Text
securityProfileName = forall a. Maybe a
Prelude.Nothing,
      $sel:version:DescribeSecurityProfileResponse' :: Maybe Integer
version = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeSecurityProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | /Please use DescribeSecurityProfileResponse$additionalMetricsToRetainV2
-- instead./
--
-- A list of metrics whose data is retained (stored). By default, data is
-- retained for any metric used in the profile\'s @behaviors@, but it is
-- also retained for any metric specified here.
describeSecurityProfileResponse_additionalMetricsToRetain :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe [Prelude.Text])
describeSecurityProfileResponse_additionalMetricsToRetain :: Lens' DescribeSecurityProfileResponse (Maybe [Text])
describeSecurityProfileResponse_additionalMetricsToRetain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe [Text]
additionalMetricsToRetain :: Maybe [Text]
$sel:additionalMetricsToRetain:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe [Text]
additionalMetricsToRetain} -> Maybe [Text]
additionalMetricsToRetain) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe [Text]
a -> DescribeSecurityProfileResponse
s {$sel:additionalMetricsToRetain:DescribeSecurityProfileResponse' :: Maybe [Text]
additionalMetricsToRetain = Maybe [Text]
a} :: DescribeSecurityProfileResponse) 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

-- | A list of metrics whose data is retained (stored). By default, data is
-- retained for any metric used in the profile\'s behaviors, but it is also
-- retained for any metric specified here.
describeSecurityProfileResponse_additionalMetricsToRetainV2 :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe [MetricToRetain])
describeSecurityProfileResponse_additionalMetricsToRetainV2 :: Lens' DescribeSecurityProfileResponse (Maybe [MetricToRetain])
describeSecurityProfileResponse_additionalMetricsToRetainV2 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
$sel:additionalMetricsToRetainV2:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe [MetricToRetain]
additionalMetricsToRetainV2} -> Maybe [MetricToRetain]
additionalMetricsToRetainV2) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe [MetricToRetain]
a -> DescribeSecurityProfileResponse
s {$sel:additionalMetricsToRetainV2:DescribeSecurityProfileResponse' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 = Maybe [MetricToRetain]
a} :: DescribeSecurityProfileResponse) 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

-- | Where the alerts are sent. (Alerts are always sent to the console.)
describeSecurityProfileResponse_alertTargets :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget))
describeSecurityProfileResponse_alertTargets :: Lens'
  DescribeSecurityProfileResponse
  (Maybe (HashMap AlertTargetType AlertTarget))
describeSecurityProfileResponse_alertTargets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:alertTargets:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets} -> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe (HashMap AlertTargetType AlertTarget)
a -> DescribeSecurityProfileResponse
s {$sel:alertTargets:DescribeSecurityProfileResponse' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets = Maybe (HashMap AlertTargetType AlertTarget)
a} :: DescribeSecurityProfileResponse) 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

-- | Specifies the behaviors that, when violated by a device (thing), cause
-- an alert.
describeSecurityProfileResponse_behaviors :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe [Behavior])
describeSecurityProfileResponse_behaviors :: Lens' DescribeSecurityProfileResponse (Maybe [Behavior])
describeSecurityProfileResponse_behaviors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe [Behavior]
behaviors :: Maybe [Behavior]
$sel:behaviors:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe [Behavior]
behaviors} -> Maybe [Behavior]
behaviors) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe [Behavior]
a -> DescribeSecurityProfileResponse
s {$sel:behaviors:DescribeSecurityProfileResponse' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
a} :: DescribeSecurityProfileResponse) 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 time the security profile was created.
describeSecurityProfileResponse_creationDate :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe Prelude.UTCTime)
describeSecurityProfileResponse_creationDate :: Lens' DescribeSecurityProfileResponse (Maybe UTCTime)
describeSecurityProfileResponse_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe POSIX
a -> DescribeSecurityProfileResponse
s {$sel:creationDate:DescribeSecurityProfileResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: DescribeSecurityProfileResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The time the security profile was last modified.
describeSecurityProfileResponse_lastModifiedDate :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe Prelude.UTCTime)
describeSecurityProfileResponse_lastModifiedDate :: Lens' DescribeSecurityProfileResponse (Maybe UTCTime)
describeSecurityProfileResponse_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe POSIX
a -> DescribeSecurityProfileResponse
s {$sel:lastModifiedDate:DescribeSecurityProfileResponse' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: DescribeSecurityProfileResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the security profile.
describeSecurityProfileResponse_securityProfileArn :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe Prelude.Text)
describeSecurityProfileResponse_securityProfileArn :: Lens' DescribeSecurityProfileResponse (Maybe Text)
describeSecurityProfileResponse_securityProfileArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe Text
securityProfileArn :: Maybe Text
$sel:securityProfileArn:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Text
securityProfileArn} -> Maybe Text
securityProfileArn) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe Text
a -> DescribeSecurityProfileResponse
s {$sel:securityProfileArn:DescribeSecurityProfileResponse' :: Maybe Text
securityProfileArn = Maybe Text
a} :: DescribeSecurityProfileResponse)

-- | A description of the security profile (associated with the security
-- profile when it was created or updated).
describeSecurityProfileResponse_securityProfileDescription :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe Prelude.Text)
describeSecurityProfileResponse_securityProfileDescription :: Lens' DescribeSecurityProfileResponse (Maybe Text)
describeSecurityProfileResponse_securityProfileDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe Text
securityProfileDescription :: Maybe Text
$sel:securityProfileDescription:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Text
securityProfileDescription} -> Maybe Text
securityProfileDescription) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe Text
a -> DescribeSecurityProfileResponse
s {$sel:securityProfileDescription:DescribeSecurityProfileResponse' :: Maybe Text
securityProfileDescription = Maybe Text
a} :: DescribeSecurityProfileResponse)

-- | The name of the security profile.
describeSecurityProfileResponse_securityProfileName :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe Prelude.Text)
describeSecurityProfileResponse_securityProfileName :: Lens' DescribeSecurityProfileResponse (Maybe Text)
describeSecurityProfileResponse_securityProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe Text
securityProfileName :: Maybe Text
$sel:securityProfileName:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Text
securityProfileName} -> Maybe Text
securityProfileName) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe Text
a -> DescribeSecurityProfileResponse
s {$sel:securityProfileName:DescribeSecurityProfileResponse' :: Maybe Text
securityProfileName = Maybe Text
a} :: DescribeSecurityProfileResponse)

-- | The version of the security profile. A new version is generated whenever
-- the security profile is updated.
describeSecurityProfileResponse_version :: Lens.Lens' DescribeSecurityProfileResponse (Prelude.Maybe Prelude.Integer)
describeSecurityProfileResponse_version :: Lens' DescribeSecurityProfileResponse (Maybe Integer)
describeSecurityProfileResponse_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSecurityProfileResponse' {Maybe Integer
version :: Maybe Integer
$sel:version:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Integer
version} -> Maybe Integer
version) (\s :: DescribeSecurityProfileResponse
s@DescribeSecurityProfileResponse' {} Maybe Integer
a -> DescribeSecurityProfileResponse
s {$sel:version:DescribeSecurityProfileResponse' :: Maybe Integer
version = Maybe Integer
a} :: DescribeSecurityProfileResponse)

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

instance
  Prelude.NFData
    DescribeSecurityProfileResponse
  where
  rnf :: DescribeSecurityProfileResponse -> ()
rnf DescribeSecurityProfileResponse' {Int
Maybe Integer
Maybe [Text]
Maybe [MetricToRetain]
Maybe [Behavior]
Maybe Text
Maybe (HashMap AlertTargetType AlertTarget)
Maybe POSIX
httpStatus :: Int
version :: Maybe Integer
securityProfileName :: Maybe Text
securityProfileDescription :: Maybe Text
securityProfileArn :: Maybe Text
lastModifiedDate :: Maybe POSIX
creationDate :: Maybe POSIX
behaviors :: Maybe [Behavior]
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
additionalMetricsToRetain :: Maybe [Text]
$sel:httpStatus:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Int
$sel:version:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Integer
$sel:securityProfileName:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Text
$sel:securityProfileDescription:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Text
$sel:securityProfileArn:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe Text
$sel:lastModifiedDate:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe POSIX
$sel:creationDate:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe POSIX
$sel:behaviors:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe [Behavior]
$sel:alertTargets:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse
-> Maybe (HashMap AlertTargetType AlertTarget)
$sel:additionalMetricsToRetainV2:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe [MetricToRetain]
$sel:additionalMetricsToRetain:DescribeSecurityProfileResponse' :: DescribeSecurityProfileResponse -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
additionalMetricsToRetain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [MetricToRetain]
additionalMetricsToRetainV2
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap AlertTargetType AlertTarget)
alertTargets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Behavior]
behaviors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityProfileArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityProfileDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityProfileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus