{-# 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-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.SecurityProfileIdentifier where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool)
-> (SecurityProfileIdentifier -> SecurityProfileIdentifier -> Bool)
-> Eq SecurityProfileIdentifier
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]
(Int -> ReadS SecurityProfileIdentifier)
-> ReadS [SecurityProfileIdentifier]
-> ReadPrec SecurityProfileIdentifier
-> ReadPrec [SecurityProfileIdentifier]
-> Read 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
(Int -> SecurityProfileIdentifier -> ShowS)
-> (SecurityProfileIdentifier -> String)
-> ([SecurityProfileIdentifier] -> ShowS)
-> Show SecurityProfileIdentifier
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.
 SecurityProfileIdentifier -> Rep SecurityProfileIdentifier x)
-> (forall x.
    Rep SecurityProfileIdentifier x -> SecurityProfileIdentifier)
-> Generic SecurityProfileIdentifier
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' :: Text -> Text -> SecurityProfileIdentifier
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 :: (Text -> f Text)
-> SecurityProfileIdentifier -> f SecurityProfileIdentifier
securityProfileIdentifier_name = (SecurityProfileIdentifier -> Text)
-> (SecurityProfileIdentifier -> Text -> SecurityProfileIdentifier)
-> Lens
     SecurityProfileIdentifier SecurityProfileIdentifier Text Text
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 :: (Text -> f Text)
-> SecurityProfileIdentifier -> f SecurityProfileIdentifier
securityProfileIdentifier_arn = (SecurityProfileIdentifier -> Text)
-> (SecurityProfileIdentifier -> Text -> SecurityProfileIdentifier)
-> Lens
     SecurityProfileIdentifier SecurityProfileIdentifier Text Text
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 Core.FromJSON SecurityProfileIdentifier where
  parseJSON :: Value -> Parser SecurityProfileIdentifier
parseJSON =
    String
-> (Object -> Parser SecurityProfileIdentifier)
-> Value
-> Parser SecurityProfileIdentifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SecurityProfileIdentifier"
      ( \Object
x ->
          Text -> Text -> SecurityProfileIdentifier
SecurityProfileIdentifier'
            (Text -> Text -> SecurityProfileIdentifier)
-> Parser Text -> Parser (Text -> SecurityProfileIdentifier)
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
"name") Parser (Text -> SecurityProfileIdentifier)
-> Parser Text -> Parser SecurityProfileIdentifier
forall (f :: * -> *) a b. Applicative f => 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 SecurityProfileIdentifier

instance Prelude.NFData SecurityProfileIdentifier