{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.SecurityProfileTarget
-- 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)
module Amazonka.IoT.Types.SecurityProfileTarget where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A target to which an alert is sent when a security profile behavior is
-- violated.
--
-- /See:/ 'newSecurityProfileTarget' smart constructor.
data SecurityProfileTarget = SecurityProfileTarget'
  { -- | The ARN of the security profile.
    SecurityProfileTarget -> Text
arn :: Prelude.Text
  }
  deriving (SecurityProfileTarget -> SecurityProfileTarget -> Bool
(SecurityProfileTarget -> SecurityProfileTarget -> Bool)
-> (SecurityProfileTarget -> SecurityProfileTarget -> Bool)
-> Eq SecurityProfileTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityProfileTarget -> SecurityProfileTarget -> Bool
$c/= :: SecurityProfileTarget -> SecurityProfileTarget -> Bool
== :: SecurityProfileTarget -> SecurityProfileTarget -> Bool
$c== :: SecurityProfileTarget -> SecurityProfileTarget -> Bool
Prelude.Eq, ReadPrec [SecurityProfileTarget]
ReadPrec SecurityProfileTarget
Int -> ReadS SecurityProfileTarget
ReadS [SecurityProfileTarget]
(Int -> ReadS SecurityProfileTarget)
-> ReadS [SecurityProfileTarget]
-> ReadPrec SecurityProfileTarget
-> ReadPrec [SecurityProfileTarget]
-> Read SecurityProfileTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityProfileTarget]
$creadListPrec :: ReadPrec [SecurityProfileTarget]
readPrec :: ReadPrec SecurityProfileTarget
$creadPrec :: ReadPrec SecurityProfileTarget
readList :: ReadS [SecurityProfileTarget]
$creadList :: ReadS [SecurityProfileTarget]
readsPrec :: Int -> ReadS SecurityProfileTarget
$creadsPrec :: Int -> ReadS SecurityProfileTarget
Prelude.Read, Int -> SecurityProfileTarget -> ShowS
[SecurityProfileTarget] -> ShowS
SecurityProfileTarget -> String
(Int -> SecurityProfileTarget -> ShowS)
-> (SecurityProfileTarget -> String)
-> ([SecurityProfileTarget] -> ShowS)
-> Show SecurityProfileTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityProfileTarget] -> ShowS
$cshowList :: [SecurityProfileTarget] -> ShowS
show :: SecurityProfileTarget -> String
$cshow :: SecurityProfileTarget -> String
showsPrec :: Int -> SecurityProfileTarget -> ShowS
$cshowsPrec :: Int -> SecurityProfileTarget -> ShowS
Prelude.Show, (forall x. SecurityProfileTarget -> Rep SecurityProfileTarget x)
-> (forall x. Rep SecurityProfileTarget x -> SecurityProfileTarget)
-> Generic SecurityProfileTarget
forall x. Rep SecurityProfileTarget x -> SecurityProfileTarget
forall x. SecurityProfileTarget -> Rep SecurityProfileTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityProfileTarget x -> SecurityProfileTarget
$cfrom :: forall x. SecurityProfileTarget -> Rep SecurityProfileTarget x
Prelude.Generic)

-- |
-- Create a value of 'SecurityProfileTarget' 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:
--
-- 'arn', 'securityProfileTarget_arn' - The ARN of the security profile.
newSecurityProfileTarget ::
  -- | 'arn'
  Prelude.Text ->
  SecurityProfileTarget
newSecurityProfileTarget :: Text -> SecurityProfileTarget
newSecurityProfileTarget Text
pArn_ =
  SecurityProfileTarget' :: Text -> SecurityProfileTarget
SecurityProfileTarget' {$sel:arn:SecurityProfileTarget' :: Text
arn = Text
pArn_}

-- | The ARN of the security profile.
securityProfileTarget_arn :: Lens.Lens' SecurityProfileTarget Prelude.Text
securityProfileTarget_arn :: (Text -> f Text)
-> SecurityProfileTarget -> f SecurityProfileTarget
securityProfileTarget_arn = (SecurityProfileTarget -> Text)
-> (SecurityProfileTarget -> Text -> SecurityProfileTarget)
-> Lens SecurityProfileTarget SecurityProfileTarget Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfileTarget' {Text
arn :: Text
$sel:arn:SecurityProfileTarget' :: SecurityProfileTarget -> Text
arn} -> Text
arn) (\s :: SecurityProfileTarget
s@SecurityProfileTarget' {} Text
a -> SecurityProfileTarget
s {$sel:arn:SecurityProfileTarget' :: Text
arn = Text
a} :: SecurityProfileTarget)

instance Core.FromJSON SecurityProfileTarget where
  parseJSON :: Value -> Parser SecurityProfileTarget
parseJSON =
    String
-> (Object -> Parser SecurityProfileTarget)
-> Value
-> Parser SecurityProfileTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SecurityProfileTarget"
      ( \Object
x ->
          Text -> SecurityProfileTarget
SecurityProfileTarget' (Text -> SecurityProfileTarget)
-> Parser Text -> Parser SecurityProfileTarget
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
      )

instance Prelude.Hashable SecurityProfileTarget

instance Prelude.NFData SecurityProfileTarget