{-# 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.UpdateSecurityProfile
-- 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)
--
-- Updates 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 UpdateSecurityProfile>
-- action.
module Amazonka.IoT.UpdateSecurityProfile
  ( -- * Creating a Request
    UpdateSecurityProfile (..),
    newUpdateSecurityProfile,

    -- * Request Lenses
    updateSecurityProfile_alertTargets,
    updateSecurityProfile_additionalMetricsToRetainV2,
    updateSecurityProfile_behaviors,
    updateSecurityProfile_expectedVersion,
    updateSecurityProfile_deleteAlertTargets,
    updateSecurityProfile_additionalMetricsToRetain,
    updateSecurityProfile_securityProfileDescription,
    updateSecurityProfile_deleteBehaviors,
    updateSecurityProfile_deleteAdditionalMetricsToRetain,
    updateSecurityProfile_securityProfileName,

    -- * Destructuring the Response
    UpdateSecurityProfileResponse (..),
    newUpdateSecurityProfileResponse,

    -- * Response Lenses
    updateSecurityProfileResponse_alertTargets,
    updateSecurityProfileResponse_additionalMetricsToRetainV2,
    updateSecurityProfileResponse_behaviors,
    updateSecurityProfileResponse_lastModifiedDate,
    updateSecurityProfileResponse_version,
    updateSecurityProfileResponse_securityProfileName,
    updateSecurityProfileResponse_creationDate,
    updateSecurityProfileResponse_additionalMetricsToRetain,
    updateSecurityProfileResponse_securityProfileArn,
    updateSecurityProfileResponse_securityProfileDescription,
    updateSecurityProfileResponse_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:/ 'newUpdateSecurityProfile' smart constructor.
data UpdateSecurityProfile = UpdateSecurityProfile'
  { -- | Where the alerts are sent. (Alerts are always sent to the console.)
    UpdateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget),
    -- | 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. Can be used with custom metrics;
    -- cannot be used with dimensions.
    UpdateSecurityProfile -> Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Prelude.Maybe [MetricToRetain],
    -- | Specifies the behaviors that, when violated by a device (thing), cause
    -- an alert.
    UpdateSecurityProfile -> Maybe [Behavior]
behaviors :: Prelude.Maybe [Behavior],
    -- | The expected version of the security profile. A new version is generated
    -- whenever the security profile is updated. If you specify a value that is
    -- different from the actual version, a @VersionConflictException@ is
    -- thrown.
    UpdateSecurityProfile -> Maybe Integer
expectedVersion :: Prelude.Maybe Prelude.Integer,
    -- | If true, delete all @alertTargets@ defined for this security profile. If
    -- any @alertTargets@ are defined in the current invocation, an exception
    -- occurs.
    UpdateSecurityProfile -> Maybe Bool
deleteAlertTargets :: Prelude.Maybe Prelude.Bool,
    -- | /Please use UpdateSecurityProfileRequest$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. Can be used with custom
    -- metrics; cannot be used with dimensions.
    UpdateSecurityProfile -> Maybe [Text]
additionalMetricsToRetain :: Prelude.Maybe [Prelude.Text],
    -- | A description of the security profile.
    UpdateSecurityProfile -> Maybe Text
securityProfileDescription :: Prelude.Maybe Prelude.Text,
    -- | If true, delete all @behaviors@ defined for this security profile. If
    -- any @behaviors@ are defined in the current invocation, an exception
    -- occurs.
    UpdateSecurityProfile -> Maybe Bool
deleteBehaviors :: Prelude.Maybe Prelude.Bool,
    -- | If true, delete all @additionalMetricsToRetain@ defined for this
    -- security profile. If any @additionalMetricsToRetain@ are defined in the
    -- current invocation, an exception occurs.
    UpdateSecurityProfile -> Maybe Bool
deleteAdditionalMetricsToRetain :: Prelude.Maybe Prelude.Bool,
    -- | The name of the security profile you want to update.
    UpdateSecurityProfile -> Text
securityProfileName :: Prelude.Text
  }
  deriving (UpdateSecurityProfile -> UpdateSecurityProfile -> Bool
(UpdateSecurityProfile -> UpdateSecurityProfile -> Bool)
-> (UpdateSecurityProfile -> UpdateSecurityProfile -> Bool)
-> Eq UpdateSecurityProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecurityProfile -> UpdateSecurityProfile -> Bool
$c/= :: UpdateSecurityProfile -> UpdateSecurityProfile -> Bool
== :: UpdateSecurityProfile -> UpdateSecurityProfile -> Bool
$c== :: UpdateSecurityProfile -> UpdateSecurityProfile -> Bool
Prelude.Eq, ReadPrec [UpdateSecurityProfile]
ReadPrec UpdateSecurityProfile
Int -> ReadS UpdateSecurityProfile
ReadS [UpdateSecurityProfile]
(Int -> ReadS UpdateSecurityProfile)
-> ReadS [UpdateSecurityProfile]
-> ReadPrec UpdateSecurityProfile
-> ReadPrec [UpdateSecurityProfile]
-> Read UpdateSecurityProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecurityProfile]
$creadListPrec :: ReadPrec [UpdateSecurityProfile]
readPrec :: ReadPrec UpdateSecurityProfile
$creadPrec :: ReadPrec UpdateSecurityProfile
readList :: ReadS [UpdateSecurityProfile]
$creadList :: ReadS [UpdateSecurityProfile]
readsPrec :: Int -> ReadS UpdateSecurityProfile
$creadsPrec :: Int -> ReadS UpdateSecurityProfile
Prelude.Read, Int -> UpdateSecurityProfile -> ShowS
[UpdateSecurityProfile] -> ShowS
UpdateSecurityProfile -> String
(Int -> UpdateSecurityProfile -> ShowS)
-> (UpdateSecurityProfile -> String)
-> ([UpdateSecurityProfile] -> ShowS)
-> Show UpdateSecurityProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecurityProfile] -> ShowS
$cshowList :: [UpdateSecurityProfile] -> ShowS
show :: UpdateSecurityProfile -> String
$cshow :: UpdateSecurityProfile -> String
showsPrec :: Int -> UpdateSecurityProfile -> ShowS
$cshowsPrec :: Int -> UpdateSecurityProfile -> ShowS
Prelude.Show, (forall x. UpdateSecurityProfile -> Rep UpdateSecurityProfile x)
-> (forall x. Rep UpdateSecurityProfile x -> UpdateSecurityProfile)
-> Generic UpdateSecurityProfile
forall x. Rep UpdateSecurityProfile x -> UpdateSecurityProfile
forall x. UpdateSecurityProfile -> Rep UpdateSecurityProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSecurityProfile x -> UpdateSecurityProfile
$cfrom :: forall x. UpdateSecurityProfile -> Rep UpdateSecurityProfile x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSecurityProfile' 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:
--
-- 'alertTargets', 'updateSecurityProfile_alertTargets' - Where the alerts are sent. (Alerts are always sent to the console.)
--
-- 'additionalMetricsToRetainV2', 'updateSecurityProfile_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. Can be used with custom metrics;
-- cannot be used with dimensions.
--
-- 'behaviors', 'updateSecurityProfile_behaviors' - Specifies the behaviors that, when violated by a device (thing), cause
-- an alert.
--
-- 'expectedVersion', 'updateSecurityProfile_expectedVersion' - The expected version of the security profile. A new version is generated
-- whenever the security profile is updated. If you specify a value that is
-- different from the actual version, a @VersionConflictException@ is
-- thrown.
--
-- 'deleteAlertTargets', 'updateSecurityProfile_deleteAlertTargets' - If true, delete all @alertTargets@ defined for this security profile. If
-- any @alertTargets@ are defined in the current invocation, an exception
-- occurs.
--
-- 'additionalMetricsToRetain', 'updateSecurityProfile_additionalMetricsToRetain' - /Please use UpdateSecurityProfileRequest$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. Can be used with custom
-- metrics; cannot be used with dimensions.
--
-- 'securityProfileDescription', 'updateSecurityProfile_securityProfileDescription' - A description of the security profile.
--
-- 'deleteBehaviors', 'updateSecurityProfile_deleteBehaviors' - If true, delete all @behaviors@ defined for this security profile. If
-- any @behaviors@ are defined in the current invocation, an exception
-- occurs.
--
-- 'deleteAdditionalMetricsToRetain', 'updateSecurityProfile_deleteAdditionalMetricsToRetain' - If true, delete all @additionalMetricsToRetain@ defined for this
-- security profile. If any @additionalMetricsToRetain@ are defined in the
-- current invocation, an exception occurs.
--
-- 'securityProfileName', 'updateSecurityProfile_securityProfileName' - The name of the security profile you want to update.
newUpdateSecurityProfile ::
  -- | 'securityProfileName'
  Prelude.Text ->
  UpdateSecurityProfile
newUpdateSecurityProfile :: Text -> UpdateSecurityProfile
newUpdateSecurityProfile Text
pSecurityProfileName_ =
  UpdateSecurityProfile' :: Maybe (HashMap AlertTargetType AlertTarget)
-> Maybe [MetricToRetain]
-> Maybe [Behavior]
-> Maybe Integer
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Text
-> UpdateSecurityProfile
UpdateSecurityProfile'
    { $sel:alertTargets:UpdateSecurityProfile' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets =
        Maybe (HashMap AlertTargetType AlertTarget)
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetricsToRetainV2:UpdateSecurityProfile' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 = Maybe [MetricToRetain]
forall a. Maybe a
Prelude.Nothing,
      $sel:behaviors:UpdateSecurityProfile' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedVersion:UpdateSecurityProfile' :: Maybe Integer
expectedVersion = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteAlertTargets:UpdateSecurityProfile' :: Maybe Bool
deleteAlertTargets = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetricsToRetain:UpdateSecurityProfile' :: Maybe [Text]
additionalMetricsToRetain = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileDescription:UpdateSecurityProfile' :: Maybe Text
securityProfileDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteBehaviors:UpdateSecurityProfile' :: Maybe Bool
deleteBehaviors = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteAdditionalMetricsToRetain:UpdateSecurityProfile' :: Maybe Bool
deleteAdditionalMetricsToRetain = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:UpdateSecurityProfile' :: Text
securityProfileName = Text
pSecurityProfileName_
    }

-- | Where the alerts are sent. (Alerts are always sent to the console.)
updateSecurityProfile_alertTargets :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget))
updateSecurityProfile_alertTargets :: (Maybe (HashMap AlertTargetType AlertTarget)
 -> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_alertTargets = (UpdateSecurityProfile
 -> Maybe (HashMap AlertTargetType AlertTarget))
-> (UpdateSecurityProfile
    -> Maybe (HashMap AlertTargetType AlertTarget)
    -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:alertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets} -> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe (HashMap AlertTargetType AlertTarget)
a -> UpdateSecurityProfile
s {$sel:alertTargets:UpdateSecurityProfile' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets = Maybe (HashMap AlertTargetType AlertTarget)
a} :: UpdateSecurityProfile) ((Maybe (HashMap AlertTargetType AlertTarget)
  -> f (Maybe (HashMap AlertTargetType AlertTarget)))
 -> UpdateSecurityProfile -> f UpdateSecurityProfile)
-> ((Maybe (HashMap AlertTargetType AlertTarget)
     -> f (Maybe (HashMap AlertTargetType AlertTarget)))
    -> Maybe (HashMap AlertTargetType AlertTarget)
    -> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> (Maybe (HashMap AlertTargetType AlertTarget)
    -> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> UpdateSecurityProfile
-> f UpdateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
-> Iso
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
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
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
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. Can be used with custom metrics;
-- cannot be used with dimensions.
updateSecurityProfile_additionalMetricsToRetainV2 :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe [MetricToRetain])
updateSecurityProfile_additionalMetricsToRetainV2 :: (Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_additionalMetricsToRetainV2 = (UpdateSecurityProfile -> Maybe [MetricToRetain])
-> (UpdateSecurityProfile
    -> Maybe [MetricToRetain] -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
$sel:additionalMetricsToRetainV2:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [MetricToRetain]
additionalMetricsToRetainV2} -> Maybe [MetricToRetain]
additionalMetricsToRetainV2) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe [MetricToRetain]
a -> UpdateSecurityProfile
s {$sel:additionalMetricsToRetainV2:UpdateSecurityProfile' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 = Maybe [MetricToRetain]
a} :: UpdateSecurityProfile) ((Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
 -> UpdateSecurityProfile -> f UpdateSecurityProfile)
-> ((Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
    -> Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> (Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> UpdateSecurityProfile
-> f UpdateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricToRetain] [MetricToRetain] [MetricToRetain] [MetricToRetain]
-> Iso
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
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
  [MetricToRetain] [MetricToRetain] [MetricToRetain] [MetricToRetain]
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.
updateSecurityProfile_behaviors :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe [Behavior])
updateSecurityProfile_behaviors :: (Maybe [Behavior] -> f (Maybe [Behavior]))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_behaviors = (UpdateSecurityProfile -> Maybe [Behavior])
-> (UpdateSecurityProfile
    -> Maybe [Behavior] -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe [Behavior])
     (Maybe [Behavior])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe [Behavior]
behaviors :: Maybe [Behavior]
$sel:behaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Behavior]
behaviors} -> Maybe [Behavior]
behaviors) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe [Behavior]
a -> UpdateSecurityProfile
s {$sel:behaviors:UpdateSecurityProfile' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
a} :: UpdateSecurityProfile) ((Maybe [Behavior] -> f (Maybe [Behavior]))
 -> UpdateSecurityProfile -> f UpdateSecurityProfile)
-> ((Maybe [Behavior] -> f (Maybe [Behavior]))
    -> Maybe [Behavior] -> f (Maybe [Behavior]))
-> (Maybe [Behavior] -> f (Maybe [Behavior]))
-> UpdateSecurityProfile
-> f UpdateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Behavior] [Behavior] [Behavior] [Behavior]
-> Iso
     (Maybe [Behavior])
     (Maybe [Behavior])
     (Maybe [Behavior])
     (Maybe [Behavior])
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 [Behavior] [Behavior] [Behavior] [Behavior]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The expected version of the security profile. A new version is generated
-- whenever the security profile is updated. If you specify a value that is
-- different from the actual version, a @VersionConflictException@ is
-- thrown.
updateSecurityProfile_expectedVersion :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe Prelude.Integer)
updateSecurityProfile_expectedVersion :: (Maybe Integer -> f (Maybe Integer))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_expectedVersion = (UpdateSecurityProfile -> Maybe Integer)
-> (UpdateSecurityProfile
    -> Maybe Integer -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe Integer
expectedVersion :: Maybe Integer
$sel:expectedVersion:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Integer
expectedVersion} -> Maybe Integer
expectedVersion) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe Integer
a -> UpdateSecurityProfile
s {$sel:expectedVersion:UpdateSecurityProfile' :: Maybe Integer
expectedVersion = Maybe Integer
a} :: UpdateSecurityProfile)

-- | If true, delete all @alertTargets@ defined for this security profile. If
-- any @alertTargets@ are defined in the current invocation, an exception
-- occurs.
updateSecurityProfile_deleteAlertTargets :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe Prelude.Bool)
updateSecurityProfile_deleteAlertTargets :: (Maybe Bool -> f (Maybe Bool))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_deleteAlertTargets = (UpdateSecurityProfile -> Maybe Bool)
-> (UpdateSecurityProfile -> Maybe Bool -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe Bool
deleteAlertTargets :: Maybe Bool
$sel:deleteAlertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
deleteAlertTargets} -> Maybe Bool
deleteAlertTargets) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe Bool
a -> UpdateSecurityProfile
s {$sel:deleteAlertTargets:UpdateSecurityProfile' :: Maybe Bool
deleteAlertTargets = Maybe Bool
a} :: UpdateSecurityProfile)

-- | /Please use UpdateSecurityProfileRequest$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. Can be used with custom
-- metrics; cannot be used with dimensions.
updateSecurityProfile_additionalMetricsToRetain :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe [Prelude.Text])
updateSecurityProfile_additionalMetricsToRetain :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_additionalMetricsToRetain = (UpdateSecurityProfile -> Maybe [Text])
-> (UpdateSecurityProfile -> Maybe [Text] -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe [Text]
additionalMetricsToRetain :: Maybe [Text]
$sel:additionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Text]
additionalMetricsToRetain} -> Maybe [Text]
additionalMetricsToRetain) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe [Text]
a -> UpdateSecurityProfile
s {$sel:additionalMetricsToRetain:UpdateSecurityProfile' :: Maybe [Text]
additionalMetricsToRetain = Maybe [Text]
a} :: UpdateSecurityProfile) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateSecurityProfile -> f UpdateSecurityProfile)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateSecurityProfile
-> f UpdateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of the security profile.
updateSecurityProfile_securityProfileDescription :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe Prelude.Text)
updateSecurityProfile_securityProfileDescription :: (Maybe Text -> f (Maybe Text))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_securityProfileDescription = (UpdateSecurityProfile -> Maybe Text)
-> (UpdateSecurityProfile -> Maybe Text -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe Text
securityProfileDescription :: Maybe Text
$sel:securityProfileDescription:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Text
securityProfileDescription} -> Maybe Text
securityProfileDescription) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe Text
a -> UpdateSecurityProfile
s {$sel:securityProfileDescription:UpdateSecurityProfile' :: Maybe Text
securityProfileDescription = Maybe Text
a} :: UpdateSecurityProfile)

-- | If true, delete all @behaviors@ defined for this security profile. If
-- any @behaviors@ are defined in the current invocation, an exception
-- occurs.
updateSecurityProfile_deleteBehaviors :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe Prelude.Bool)
updateSecurityProfile_deleteBehaviors :: (Maybe Bool -> f (Maybe Bool))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_deleteBehaviors = (UpdateSecurityProfile -> Maybe Bool)
-> (UpdateSecurityProfile -> Maybe Bool -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe Bool
deleteBehaviors :: Maybe Bool
$sel:deleteBehaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
deleteBehaviors} -> Maybe Bool
deleteBehaviors) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe Bool
a -> UpdateSecurityProfile
s {$sel:deleteBehaviors:UpdateSecurityProfile' :: Maybe Bool
deleteBehaviors = Maybe Bool
a} :: UpdateSecurityProfile)

-- | If true, delete all @additionalMetricsToRetain@ defined for this
-- security profile. If any @additionalMetricsToRetain@ are defined in the
-- current invocation, an exception occurs.
updateSecurityProfile_deleteAdditionalMetricsToRetain :: Lens.Lens' UpdateSecurityProfile (Prelude.Maybe Prelude.Bool)
updateSecurityProfile_deleteAdditionalMetricsToRetain :: (Maybe Bool -> f (Maybe Bool))
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_deleteAdditionalMetricsToRetain = (UpdateSecurityProfile -> Maybe Bool)
-> (UpdateSecurityProfile -> Maybe Bool -> UpdateSecurityProfile)
-> Lens
     UpdateSecurityProfile
     UpdateSecurityProfile
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Maybe Bool
deleteAdditionalMetricsToRetain :: Maybe Bool
$sel:deleteAdditionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
deleteAdditionalMetricsToRetain} -> Maybe Bool
deleteAdditionalMetricsToRetain) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Maybe Bool
a -> UpdateSecurityProfile
s {$sel:deleteAdditionalMetricsToRetain:UpdateSecurityProfile' :: Maybe Bool
deleteAdditionalMetricsToRetain = Maybe Bool
a} :: UpdateSecurityProfile)

-- | The name of the security profile you want to update.
updateSecurityProfile_securityProfileName :: Lens.Lens' UpdateSecurityProfile Prelude.Text
updateSecurityProfile_securityProfileName :: (Text -> f Text)
-> UpdateSecurityProfile -> f UpdateSecurityProfile
updateSecurityProfile_securityProfileName = (UpdateSecurityProfile -> Text)
-> (UpdateSecurityProfile -> Text -> UpdateSecurityProfile)
-> Lens UpdateSecurityProfile UpdateSecurityProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:UpdateSecurityProfile' :: UpdateSecurityProfile -> Text
securityProfileName} -> Text
securityProfileName) (\s :: UpdateSecurityProfile
s@UpdateSecurityProfile' {} Text
a -> UpdateSecurityProfile
s {$sel:securityProfileName:UpdateSecurityProfile' :: Text
securityProfileName = Text
a} :: UpdateSecurityProfile)

instance Core.AWSRequest UpdateSecurityProfile where
  type
    AWSResponse UpdateSecurityProfile =
      UpdateSecurityProfileResponse
  request :: UpdateSecurityProfile -> Request UpdateSecurityProfile
request = Service -> UpdateSecurityProfile -> Request UpdateSecurityProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateSecurityProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSecurityProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateSecurityProfile))
-> Logger
-> Service
-> Proxy UpdateSecurityProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSecurityProfile)))
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 (HashMap AlertTargetType AlertTarget)
-> Maybe [MetricToRetain]
-> Maybe [Behavior]
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateSecurityProfileResponse
UpdateSecurityProfileResponse'
            (Maybe (HashMap AlertTargetType AlertTarget)
 -> Maybe [MetricToRetain]
 -> Maybe [Behavior]
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateSecurityProfileResponse)
-> Either String (Maybe (HashMap AlertTargetType AlertTarget))
-> Either
     String
     (Maybe [MetricToRetain]
      -> Maybe [Behavior]
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either
     String (Maybe (Maybe (HashMap AlertTargetType AlertTarget)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alertTargets" Either String (Maybe (Maybe (HashMap AlertTargetType AlertTarget)))
-> Maybe (HashMap AlertTargetType AlertTarget)
-> Either String (Maybe (HashMap AlertTargetType AlertTarget))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap AlertTargetType AlertTarget)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [MetricToRetain]
   -> Maybe [Behavior]
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe [MetricToRetain])
-> Either
     String
     (Maybe [Behavior]
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [MetricToRetain]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"additionalMetricsToRetainV2"
                            Either String (Maybe (Maybe [MetricToRetain]))
-> Maybe [MetricToRetain] -> Either String (Maybe [MetricToRetain])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MetricToRetain]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [Behavior]
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe [Behavior])
-> Either
     String
     (Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Behavior]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"behaviors" Either String (Maybe (Maybe [Behavior]))
-> Maybe [Behavior] -> Either String (Maybe [Behavior])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Behavior]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Integer
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastModifiedDate")
            Either
  String
  (Maybe Integer
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"version")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
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
"securityProfileName")
            Either
  String
  (Maybe POSIX
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"creationDate")
            Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateSecurityProfileResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> UpdateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"additionalMetricsToRetain"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> UpdateSecurityProfileResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> UpdateSecurityProfileResponse)
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
"securityProfileArn")
            Either String (Maybe Text -> Int -> UpdateSecurityProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateSecurityProfileResponse)
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
"securityProfileDescription")
            Either String (Int -> UpdateSecurityProfileResponse)
-> Either String Int -> Either String UpdateSecurityProfileResponse
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 UpdateSecurityProfile

instance Prelude.NFData UpdateSecurityProfile

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

instance Core.ToJSON UpdateSecurityProfile where
  toJSON :: UpdateSecurityProfile -> Value
toJSON UpdateSecurityProfile' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [MetricToRetain]
Maybe [Behavior]
Maybe Text
Maybe (HashMap AlertTargetType AlertTarget)
Text
securityProfileName :: Text
deleteAdditionalMetricsToRetain :: Maybe Bool
deleteBehaviors :: Maybe Bool
securityProfileDescription :: Maybe Text
additionalMetricsToRetain :: Maybe [Text]
deleteAlertTargets :: Maybe Bool
expectedVersion :: Maybe Integer
behaviors :: Maybe [Behavior]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:securityProfileName:UpdateSecurityProfile' :: UpdateSecurityProfile -> Text
$sel:deleteAdditionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:deleteBehaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:securityProfileDescription:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Text
$sel:additionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Text]
$sel:deleteAlertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:expectedVersion:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Integer
$sel:behaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Behavior]
$sel:additionalMetricsToRetainV2:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [MetricToRetain]
$sel:alertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"alertTargets" Text -> HashMap AlertTargetType AlertTarget -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap AlertTargetType AlertTarget -> Pair)
-> Maybe (HashMap AlertTargetType AlertTarget) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets,
            (Text
"additionalMetricsToRetainV2" Text -> [MetricToRetain] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([MetricToRetain] -> Pair) -> Maybe [MetricToRetain] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricToRetain]
additionalMetricsToRetainV2,
            (Text
"behaviors" Text -> [Behavior] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Behavior] -> Pair) -> Maybe [Behavior] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Behavior]
behaviors,
            (Text
"deleteAlertTargets" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteAlertTargets,
            (Text
"additionalMetricsToRetain" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
additionalMetricsToRetain,
            (Text
"securityProfileDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
securityProfileDescription,
            (Text
"deleteBehaviors" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteBehaviors,
            (Text
"deleteAdditionalMetricsToRetain" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteAdditionalMetricsToRetain
          ]
      )

instance Core.ToPath UpdateSecurityProfile where
  toPath :: UpdateSecurityProfile -> ByteString
toPath UpdateSecurityProfile' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [MetricToRetain]
Maybe [Behavior]
Maybe Text
Maybe (HashMap AlertTargetType AlertTarget)
Text
securityProfileName :: Text
deleteAdditionalMetricsToRetain :: Maybe Bool
deleteBehaviors :: Maybe Bool
securityProfileDescription :: Maybe Text
additionalMetricsToRetain :: Maybe [Text]
deleteAlertTargets :: Maybe Bool
expectedVersion :: Maybe Integer
behaviors :: Maybe [Behavior]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:securityProfileName:UpdateSecurityProfile' :: UpdateSecurityProfile -> Text
$sel:deleteAdditionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:deleteBehaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:securityProfileDescription:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Text
$sel:additionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Text]
$sel:deleteAlertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:expectedVersion:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Integer
$sel:behaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Behavior]
$sel:additionalMetricsToRetainV2:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [MetricToRetain]
$sel:alertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
..} =
    [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
      ]

instance Core.ToQuery UpdateSecurityProfile where
  toQuery :: UpdateSecurityProfile -> QueryString
toQuery UpdateSecurityProfile' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [MetricToRetain]
Maybe [Behavior]
Maybe Text
Maybe (HashMap AlertTargetType AlertTarget)
Text
securityProfileName :: Text
deleteAdditionalMetricsToRetain :: Maybe Bool
deleteBehaviors :: Maybe Bool
securityProfileDescription :: Maybe Text
additionalMetricsToRetain :: Maybe [Text]
deleteAlertTargets :: Maybe Bool
expectedVersion :: Maybe Integer
behaviors :: Maybe [Behavior]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:securityProfileName:UpdateSecurityProfile' :: UpdateSecurityProfile -> Text
$sel:deleteAdditionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:deleteBehaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:securityProfileDescription:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Text
$sel:additionalMetricsToRetain:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Text]
$sel:deleteAlertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Bool
$sel:expectedVersion:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe Integer
$sel:behaviors:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [Behavior]
$sel:additionalMetricsToRetainV2:UpdateSecurityProfile' :: UpdateSecurityProfile -> Maybe [MetricToRetain]
$sel:alertTargets:UpdateSecurityProfile' :: UpdateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"expectedVersion" ByteString -> Maybe Integer -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Integer
expectedVersion]

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

-- |
-- Create a value of 'UpdateSecurityProfileResponse' 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:
--
-- 'alertTargets', 'updateSecurityProfileResponse_alertTargets' - Where the alerts are sent. (Alerts are always sent to the console.)
--
-- 'additionalMetricsToRetainV2', 'updateSecurityProfileResponse_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. Can be used with custom metrics;
-- cannot be used with dimensions.
--
-- 'behaviors', 'updateSecurityProfileResponse_behaviors' - Specifies the behaviors that, when violated by a device (thing), cause
-- an alert.
--
-- 'lastModifiedDate', 'updateSecurityProfileResponse_lastModifiedDate' - The time the security profile was last modified.
--
-- 'version', 'updateSecurityProfileResponse_version' - The updated version of the security profile.
--
-- 'securityProfileName', 'updateSecurityProfileResponse_securityProfileName' - The name of the security profile that was updated.
--
-- 'creationDate', 'updateSecurityProfileResponse_creationDate' - The time the security profile was created.
--
-- 'additionalMetricsToRetain', 'updateSecurityProfileResponse_additionalMetricsToRetain' - /Please use UpdateSecurityProfileResponse$additionalMetricsToRetainV2
-- instead./
--
-- A list of metrics whose data is retained (stored). By default, data is
-- retained for any metric used in the security profile\'s @behaviors@, but
-- it is also retained for any metric specified here.
--
-- 'securityProfileArn', 'updateSecurityProfileResponse_securityProfileArn' - The ARN of the security profile that was updated.
--
-- 'securityProfileDescription', 'updateSecurityProfileResponse_securityProfileDescription' - The description of the security profile.
--
-- 'httpStatus', 'updateSecurityProfileResponse_httpStatus' - The response's http status code.
newUpdateSecurityProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSecurityProfileResponse
newUpdateSecurityProfileResponse :: Int -> UpdateSecurityProfileResponse
newUpdateSecurityProfileResponse Int
pHttpStatus_ =
  UpdateSecurityProfileResponse' :: Maybe (HashMap AlertTargetType AlertTarget)
-> Maybe [MetricToRetain]
-> Maybe [Behavior]
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateSecurityProfileResponse
UpdateSecurityProfileResponse'
    { $sel:alertTargets:UpdateSecurityProfileResponse' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets =
        Maybe (HashMap AlertTargetType AlertTarget)
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetricsToRetainV2:UpdateSecurityProfileResponse' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 =
        Maybe [MetricToRetain]
forall a. Maybe a
Prelude.Nothing,
      $sel:behaviors:UpdateSecurityProfileResponse' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UpdateSecurityProfileResponse' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:version:UpdateSecurityProfileResponse' :: Maybe Integer
version = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:UpdateSecurityProfileResponse' :: Maybe Text
securityProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:UpdateSecurityProfileResponse' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetricsToRetain:UpdateSecurityProfileResponse' :: Maybe [Text]
additionalMetricsToRetain = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileArn:UpdateSecurityProfileResponse' :: Maybe Text
securityProfileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileDescription:UpdateSecurityProfileResponse' :: Maybe Text
securityProfileDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateSecurityProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Where the alerts are sent. (Alerts are always sent to the console.)
updateSecurityProfileResponse_alertTargets :: Lens.Lens' UpdateSecurityProfileResponse (Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget))
updateSecurityProfileResponse_alertTargets :: (Maybe (HashMap AlertTargetType AlertTarget)
 -> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> UpdateSecurityProfileResponse -> f UpdateSecurityProfileResponse
updateSecurityProfileResponse_alertTargets = (UpdateSecurityProfileResponse
 -> Maybe (HashMap AlertTargetType AlertTarget))
-> (UpdateSecurityProfileResponse
    -> Maybe (HashMap AlertTargetType AlertTarget)
    -> UpdateSecurityProfileResponse)
-> Lens
     UpdateSecurityProfileResponse
     UpdateSecurityProfileResponse
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfileResponse' {Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:alertTargets:UpdateSecurityProfileResponse' :: UpdateSecurityProfileResponse
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets} -> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets) (\s :: UpdateSecurityProfileResponse
s@UpdateSecurityProfileResponse' {} Maybe (HashMap AlertTargetType AlertTarget)
a -> UpdateSecurityProfileResponse
s {$sel:alertTargets:UpdateSecurityProfileResponse' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets = Maybe (HashMap AlertTargetType AlertTarget)
a} :: UpdateSecurityProfileResponse) ((Maybe (HashMap AlertTargetType AlertTarget)
  -> f (Maybe (HashMap AlertTargetType AlertTarget)))
 -> UpdateSecurityProfileResponse
 -> f UpdateSecurityProfileResponse)
-> ((Maybe (HashMap AlertTargetType AlertTarget)
     -> f (Maybe (HashMap AlertTargetType AlertTarget)))
    -> Maybe (HashMap AlertTargetType AlertTarget)
    -> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> (Maybe (HashMap AlertTargetType AlertTarget)
    -> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> UpdateSecurityProfileResponse
-> f UpdateSecurityProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
-> Iso
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
     (Maybe (HashMap AlertTargetType AlertTarget))
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
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
  (HashMap AlertTargetType AlertTarget)
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. Can be used with custom metrics;
-- cannot be used with dimensions.
updateSecurityProfileResponse_additionalMetricsToRetainV2 :: Lens.Lens' UpdateSecurityProfileResponse (Prelude.Maybe [MetricToRetain])
updateSecurityProfileResponse_additionalMetricsToRetainV2 :: (Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> UpdateSecurityProfileResponse -> f UpdateSecurityProfileResponse
updateSecurityProfileResponse_additionalMetricsToRetainV2 = (UpdateSecurityProfileResponse -> Maybe [MetricToRetain])
-> (UpdateSecurityProfileResponse
    -> Maybe [MetricToRetain] -> UpdateSecurityProfileResponse)
-> Lens
     UpdateSecurityProfileResponse
     UpdateSecurityProfileResponse
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfileResponse' {Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
$sel:additionalMetricsToRetainV2:UpdateSecurityProfileResponse' :: UpdateSecurityProfileResponse -> Maybe [MetricToRetain]
additionalMetricsToRetainV2} -> Maybe [MetricToRetain]
additionalMetricsToRetainV2) (\s :: UpdateSecurityProfileResponse
s@UpdateSecurityProfileResponse' {} Maybe [MetricToRetain]
a -> UpdateSecurityProfileResponse
s {$sel:additionalMetricsToRetainV2:UpdateSecurityProfileResponse' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 = Maybe [MetricToRetain]
a} :: UpdateSecurityProfileResponse) ((Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
 -> UpdateSecurityProfileResponse
 -> f UpdateSecurityProfileResponse)
-> ((Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
    -> Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> (Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> UpdateSecurityProfileResponse
-> f UpdateSecurityProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricToRetain] [MetricToRetain] [MetricToRetain] [MetricToRetain]
-> Iso
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
     (Maybe [MetricToRetain])
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
  [MetricToRetain] [MetricToRetain] [MetricToRetain] [MetricToRetain]
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.
updateSecurityProfileResponse_behaviors :: Lens.Lens' UpdateSecurityProfileResponse (Prelude.Maybe [Behavior])
updateSecurityProfileResponse_behaviors :: (Maybe [Behavior] -> f (Maybe [Behavior]))
-> UpdateSecurityProfileResponse -> f UpdateSecurityProfileResponse
updateSecurityProfileResponse_behaviors = (UpdateSecurityProfileResponse -> Maybe [Behavior])
-> (UpdateSecurityProfileResponse
    -> Maybe [Behavior] -> UpdateSecurityProfileResponse)
-> Lens
     UpdateSecurityProfileResponse
     UpdateSecurityProfileResponse
     (Maybe [Behavior])
     (Maybe [Behavior])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfileResponse' {Maybe [Behavior]
behaviors :: Maybe [Behavior]
$sel:behaviors:UpdateSecurityProfileResponse' :: UpdateSecurityProfileResponse -> Maybe [Behavior]
behaviors} -> Maybe [Behavior]
behaviors) (\s :: UpdateSecurityProfileResponse
s@UpdateSecurityProfileResponse' {} Maybe [Behavior]
a -> UpdateSecurityProfileResponse
s {$sel:behaviors:UpdateSecurityProfileResponse' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
a} :: UpdateSecurityProfileResponse) ((Maybe [Behavior] -> f (Maybe [Behavior]))
 -> UpdateSecurityProfileResponse
 -> f UpdateSecurityProfileResponse)
-> ((Maybe [Behavior] -> f (Maybe [Behavior]))
    -> Maybe [Behavior] -> f (Maybe [Behavior]))
-> (Maybe [Behavior] -> f (Maybe [Behavior]))
-> UpdateSecurityProfileResponse
-> f UpdateSecurityProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Behavior] [Behavior] [Behavior] [Behavior]
-> Iso
     (Maybe [Behavior])
     (Maybe [Behavior])
     (Maybe [Behavior])
     (Maybe [Behavior])
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 [Behavior] [Behavior] [Behavior] [Behavior]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The updated version of the security profile.
updateSecurityProfileResponse_version :: Lens.Lens' UpdateSecurityProfileResponse (Prelude.Maybe Prelude.Integer)
updateSecurityProfileResponse_version :: (Maybe Integer -> f (Maybe Integer))
-> UpdateSecurityProfileResponse -> f UpdateSecurityProfileResponse
updateSecurityProfileResponse_version = (UpdateSecurityProfileResponse -> Maybe Integer)
-> (UpdateSecurityProfileResponse
    -> Maybe Integer -> UpdateSecurityProfileResponse)
-> Lens
     UpdateSecurityProfileResponse
     UpdateSecurityProfileResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfileResponse' {Maybe Integer
version :: Maybe Integer
$sel:version:UpdateSecurityProfileResponse' :: UpdateSecurityProfileResponse -> Maybe Integer
version} -> Maybe Integer
version) (\s :: UpdateSecurityProfileResponse
s@UpdateSecurityProfileResponse' {} Maybe Integer
a -> UpdateSecurityProfileResponse
s {$sel:version:UpdateSecurityProfileResponse' :: Maybe Integer
version = Maybe Integer
a} :: UpdateSecurityProfileResponse)

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

-- | The time the security profile was created.
updateSecurityProfileResponse_creationDate :: Lens.Lens' UpdateSecurityProfileResponse (Prelude.Maybe Prelude.UTCTime)
updateSecurityProfileResponse_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateSecurityProfileResponse -> f UpdateSecurityProfileResponse
updateSecurityProfileResponse_creationDate = (UpdateSecurityProfileResponse -> Maybe POSIX)
-> (UpdateSecurityProfileResponse
    -> Maybe POSIX -> UpdateSecurityProfileResponse)
-> Lens
     UpdateSecurityProfileResponse
     UpdateSecurityProfileResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfileResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:UpdateSecurityProfileResponse' :: UpdateSecurityProfileResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: UpdateSecurityProfileResponse
s@UpdateSecurityProfileResponse' {} Maybe POSIX
a -> UpdateSecurityProfileResponse
s {$sel:creationDate:UpdateSecurityProfileResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: UpdateSecurityProfileResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateSecurityProfileResponse
 -> f UpdateSecurityProfileResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateSecurityProfileResponse
-> f UpdateSecurityProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

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

-- | The description of the security profile.
updateSecurityProfileResponse_securityProfileDescription :: Lens.Lens' UpdateSecurityProfileResponse (Prelude.Maybe Prelude.Text)
updateSecurityProfileResponse_securityProfileDescription :: (Maybe Text -> f (Maybe Text))
-> UpdateSecurityProfileResponse -> f UpdateSecurityProfileResponse
updateSecurityProfileResponse_securityProfileDescription = (UpdateSecurityProfileResponse -> Maybe Text)
-> (UpdateSecurityProfileResponse
    -> Maybe Text -> UpdateSecurityProfileResponse)
-> Lens
     UpdateSecurityProfileResponse
     UpdateSecurityProfileResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityProfileResponse' {Maybe Text
securityProfileDescription :: Maybe Text
$sel:securityProfileDescription:UpdateSecurityProfileResponse' :: UpdateSecurityProfileResponse -> Maybe Text
securityProfileDescription} -> Maybe Text
securityProfileDescription) (\s :: UpdateSecurityProfileResponse
s@UpdateSecurityProfileResponse' {} Maybe Text
a -> UpdateSecurityProfileResponse
s {$sel:securityProfileDescription:UpdateSecurityProfileResponse' :: Maybe Text
securityProfileDescription = Maybe Text
a} :: UpdateSecurityProfileResponse)

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

instance Prelude.NFData UpdateSecurityProfileResponse