{-# 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.SecurityProfileIdentifier
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.SecurityProfileIdentifier where

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

-- | Identifying information for a Device Defender security profile.
--
-- /See:/ 'newSecurityProfileIdentifier' smart constructor.
data SecurityProfileIdentifier = SecurityProfileIdentifier'
  { -- | The name you\'ve given to the security profile.
    SecurityProfileIdentifier -> Text
name :: Prelude.Text,
    -- | The ARN of the security profile.
    SecurityProfileIdentifier -> Text
arn :: Prelude.Text
  }
  deriving (SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool
$c/= :: SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool
== :: SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool
$c== :: SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool
Prelude.Eq, ReadPrec [SecurityProfileIdentifier]
ReadPrec SecurityProfileIdentifier
Int -> ReadS SecurityProfileIdentifier
ReadS [SecurityProfileIdentifier]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityProfileIdentifier]
$creadListPrec :: ReadPrec [SecurityProfileIdentifier]
readPrec :: ReadPrec SecurityProfileIdentifier
$creadPrec :: ReadPrec SecurityProfileIdentifier
readList :: ReadS [SecurityProfileIdentifier]
$creadList :: ReadS [SecurityProfileIdentifier]
readsPrec :: Int -> ReadS SecurityProfileIdentifier
$creadsPrec :: Int -> ReadS SecurityProfileIdentifier
Prelude.Read, Int -> SecurityProfileIdentifier -> ShowS
[SecurityProfileIdentifier] -> ShowS
SecurityProfileIdentifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityProfileIdentifier] -> ShowS
$cshowList :: [SecurityProfileIdentifier] -> ShowS
show :: SecurityProfileIdentifier -> String
$cshow :: SecurityProfileIdentifier -> String
showsPrec :: Int -> SecurityProfileIdentifier -> ShowS
$cshowsPrec :: Int -> SecurityProfileIdentifier -> ShowS
Prelude.Show, forall x.
Rep SecurityProfileIdentifier x -> SecurityProfileIdentifier
forall x.
SecurityProfileIdentifier -> Rep SecurityProfileIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SecurityProfileIdentifier x -> SecurityProfileIdentifier
$cfrom :: forall x.
SecurityProfileIdentifier -> Rep SecurityProfileIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'SecurityProfileIdentifier' 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:
--
-- 'name', 'securityProfileIdentifier_name' - The name you\'ve given to the security profile.
--
-- 'arn', 'securityProfileIdentifier_arn' - The ARN of the security profile.
newSecurityProfileIdentifier ::
  -- | 'name'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  SecurityProfileIdentifier
newSecurityProfileIdentifier :: Text -> Text -> SecurityProfileIdentifier
newSecurityProfileIdentifier Text
pName_ Text
pArn_ =
  SecurityProfileIdentifier'
    { $sel:name:SecurityProfileIdentifier' :: Text
name = Text
pName_,
      $sel:arn:SecurityProfileIdentifier' :: Text
arn = Text
pArn_
    }

-- | The name you\'ve given to the security profile.
securityProfileIdentifier_name :: Lens.Lens' SecurityProfileIdentifier Prelude.Text
securityProfileIdentifier_name :: Lens' SecurityProfileIdentifier Text
securityProfileIdentifier_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityProfileIdentifier' {Text
name :: Text
$sel:name:SecurityProfileIdentifier' :: SecurityProfileIdentifier -> Text
name} -> Text
name) (\s :: SecurityProfileIdentifier
s@SecurityProfileIdentifier' {} Text
a -> SecurityProfileIdentifier
s {$sel:name:SecurityProfileIdentifier' :: Text
name = Text
a} :: SecurityProfileIdentifier)

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

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

instance Prelude.Hashable SecurityProfileIdentifier where
  hashWithSalt :: Int -> SecurityProfileIdentifier -> Int
hashWithSalt Int
_salt SecurityProfileIdentifier' {Text
arn :: Text
name :: Text
$sel:arn:SecurityProfileIdentifier' :: SecurityProfileIdentifier -> Text
$sel:name:SecurityProfileIdentifier' :: SecurityProfileIdentifier -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData SecurityProfileIdentifier where
  rnf :: SecurityProfileIdentifier -> ()
rnf SecurityProfileIdentifier' {Text
arn :: Text
name :: Text
$sel:arn:SecurityProfileIdentifier' :: SecurityProfileIdentifier -> Text
$sel:name:SecurityProfileIdentifier' :: SecurityProfileIdentifier -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn