{-# 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.Glue.Types.SecurityConfiguration
-- 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.Glue.Types.SecurityConfiguration where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.EncryptionConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies a security configuration.
--
-- /See:/ 'newSecurityConfiguration' smart constructor.
data SecurityConfiguration = SecurityConfiguration'
  { -- | The name of the security configuration.
    SecurityConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The encryption configuration associated with this security
    -- configuration.
    SecurityConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
    -- | The time at which this security configuration was created.
    SecurityConfiguration -> Maybe POSIX
createdTimeStamp :: Prelude.Maybe Core.POSIX
  }
  deriving (SecurityConfiguration -> SecurityConfiguration -> Bool
(SecurityConfiguration -> SecurityConfiguration -> Bool)
-> (SecurityConfiguration -> SecurityConfiguration -> Bool)
-> Eq SecurityConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityConfiguration -> SecurityConfiguration -> Bool
$c/= :: SecurityConfiguration -> SecurityConfiguration -> Bool
== :: SecurityConfiguration -> SecurityConfiguration -> Bool
$c== :: SecurityConfiguration -> SecurityConfiguration -> Bool
Prelude.Eq, ReadPrec [SecurityConfiguration]
ReadPrec SecurityConfiguration
Int -> ReadS SecurityConfiguration
ReadS [SecurityConfiguration]
(Int -> ReadS SecurityConfiguration)
-> ReadS [SecurityConfiguration]
-> ReadPrec SecurityConfiguration
-> ReadPrec [SecurityConfiguration]
-> Read SecurityConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityConfiguration]
$creadListPrec :: ReadPrec [SecurityConfiguration]
readPrec :: ReadPrec SecurityConfiguration
$creadPrec :: ReadPrec SecurityConfiguration
readList :: ReadS [SecurityConfiguration]
$creadList :: ReadS [SecurityConfiguration]
readsPrec :: Int -> ReadS SecurityConfiguration
$creadsPrec :: Int -> ReadS SecurityConfiguration
Prelude.Read, Int -> SecurityConfiguration -> ShowS
[SecurityConfiguration] -> ShowS
SecurityConfiguration -> String
(Int -> SecurityConfiguration -> ShowS)
-> (SecurityConfiguration -> String)
-> ([SecurityConfiguration] -> ShowS)
-> Show SecurityConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityConfiguration] -> ShowS
$cshowList :: [SecurityConfiguration] -> ShowS
show :: SecurityConfiguration -> String
$cshow :: SecurityConfiguration -> String
showsPrec :: Int -> SecurityConfiguration -> ShowS
$cshowsPrec :: Int -> SecurityConfiguration -> ShowS
Prelude.Show, (forall x. SecurityConfiguration -> Rep SecurityConfiguration x)
-> (forall x. Rep SecurityConfiguration x -> SecurityConfiguration)
-> Generic SecurityConfiguration
forall x. Rep SecurityConfiguration x -> SecurityConfiguration
forall x. SecurityConfiguration -> Rep SecurityConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecurityConfiguration x -> SecurityConfiguration
$cfrom :: forall x. SecurityConfiguration -> Rep SecurityConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'SecurityConfiguration' 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', 'securityConfiguration_name' - The name of the security configuration.
--
-- 'encryptionConfiguration', 'securityConfiguration_encryptionConfiguration' - The encryption configuration associated with this security
-- configuration.
--
-- 'createdTimeStamp', 'securityConfiguration_createdTimeStamp' - The time at which this security configuration was created.
newSecurityConfiguration ::
  SecurityConfiguration
newSecurityConfiguration :: SecurityConfiguration
newSecurityConfiguration =
  SecurityConfiguration' :: Maybe Text
-> Maybe EncryptionConfiguration
-> Maybe POSIX
-> SecurityConfiguration
SecurityConfiguration'
    { $sel:name:SecurityConfiguration' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionConfiguration:SecurityConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimeStamp:SecurityConfiguration' :: Maybe POSIX
createdTimeStamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the security configuration.
securityConfiguration_name :: Lens.Lens' SecurityConfiguration (Prelude.Maybe Prelude.Text)
securityConfiguration_name :: (Maybe Text -> f (Maybe Text))
-> SecurityConfiguration -> f SecurityConfiguration
securityConfiguration_name = (SecurityConfiguration -> Maybe Text)
-> (SecurityConfiguration -> Maybe Text -> SecurityConfiguration)
-> Lens
     SecurityConfiguration
     SecurityConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:SecurityConfiguration' :: SecurityConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: SecurityConfiguration
s@SecurityConfiguration' {} Maybe Text
a -> SecurityConfiguration
s {$sel:name:SecurityConfiguration' :: Maybe Text
name = Maybe Text
a} :: SecurityConfiguration)

-- | The encryption configuration associated with this security
-- configuration.
securityConfiguration_encryptionConfiguration :: Lens.Lens' SecurityConfiguration (Prelude.Maybe EncryptionConfiguration)
securityConfiguration_encryptionConfiguration :: (Maybe EncryptionConfiguration
 -> f (Maybe EncryptionConfiguration))
-> SecurityConfiguration -> f SecurityConfiguration
securityConfiguration_encryptionConfiguration = (SecurityConfiguration -> Maybe EncryptionConfiguration)
-> (SecurityConfiguration
    -> Maybe EncryptionConfiguration -> SecurityConfiguration)
-> Lens
     SecurityConfiguration
     SecurityConfiguration
     (Maybe EncryptionConfiguration)
     (Maybe EncryptionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfiguration' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:SecurityConfiguration' :: SecurityConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: SecurityConfiguration
s@SecurityConfiguration' {} Maybe EncryptionConfiguration
a -> SecurityConfiguration
s {$sel:encryptionConfiguration:SecurityConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: SecurityConfiguration)

-- | The time at which this security configuration was created.
securityConfiguration_createdTimeStamp :: Lens.Lens' SecurityConfiguration (Prelude.Maybe Prelude.UTCTime)
securityConfiguration_createdTimeStamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SecurityConfiguration -> f SecurityConfiguration
securityConfiguration_createdTimeStamp = (SecurityConfiguration -> Maybe POSIX)
-> (SecurityConfiguration -> Maybe POSIX -> SecurityConfiguration)
-> Lens
     SecurityConfiguration
     SecurityConfiguration
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfiguration' {Maybe POSIX
createdTimeStamp :: Maybe POSIX
$sel:createdTimeStamp:SecurityConfiguration' :: SecurityConfiguration -> Maybe POSIX
createdTimeStamp} -> Maybe POSIX
createdTimeStamp) (\s :: SecurityConfiguration
s@SecurityConfiguration' {} Maybe POSIX
a -> SecurityConfiguration
s {$sel:createdTimeStamp:SecurityConfiguration' :: Maybe POSIX
createdTimeStamp = Maybe POSIX
a} :: SecurityConfiguration) ((Maybe POSIX -> f (Maybe POSIX))
 -> SecurityConfiguration -> f SecurityConfiguration)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SecurityConfiguration
-> f SecurityConfiguration
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

instance Core.FromJSON SecurityConfiguration where
  parseJSON :: Value -> Parser SecurityConfiguration
parseJSON =
    String
-> (Object -> Parser SecurityConfiguration)
-> Value
-> Parser SecurityConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SecurityConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe EncryptionConfiguration
-> Maybe POSIX
-> SecurityConfiguration
SecurityConfiguration'
            (Maybe Text
 -> Maybe EncryptionConfiguration
 -> Maybe POSIX
 -> SecurityConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe EncryptionConfiguration
      -> Maybe POSIX -> SecurityConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe EncryptionConfiguration
   -> Maybe POSIX -> SecurityConfiguration)
-> Parser (Maybe EncryptionConfiguration)
-> Parser (Maybe POSIX -> SecurityConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EncryptionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionConfiguration")
            Parser (Maybe POSIX -> SecurityConfiguration)
-> Parser (Maybe POSIX) -> Parser SecurityConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTimeStamp")
      )

instance Prelude.Hashable SecurityConfiguration

instance Prelude.NFData SecurityConfiguration