{-# 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.EMR.Types.SecurityConfigurationSummary
-- 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.EMR.Types.SecurityConfigurationSummary where

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

-- | The creation date and time, and name, of a security configuration.
--
-- /See:/ 'newSecurityConfigurationSummary' smart constructor.
data SecurityConfigurationSummary = SecurityConfigurationSummary'
  { -- | The name of the security configuration.
    SecurityConfigurationSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date and time the security configuration was created.
    SecurityConfigurationSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX
  }
  deriving (SecurityConfigurationSummary
-> SecurityConfigurationSummary -> Bool
(SecurityConfigurationSummary
 -> SecurityConfigurationSummary -> Bool)
-> (SecurityConfigurationSummary
    -> SecurityConfigurationSummary -> Bool)
-> Eq SecurityConfigurationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityConfigurationSummary
-> SecurityConfigurationSummary -> Bool
$c/= :: SecurityConfigurationSummary
-> SecurityConfigurationSummary -> Bool
== :: SecurityConfigurationSummary
-> SecurityConfigurationSummary -> Bool
$c== :: SecurityConfigurationSummary
-> SecurityConfigurationSummary -> Bool
Prelude.Eq, ReadPrec [SecurityConfigurationSummary]
ReadPrec SecurityConfigurationSummary
Int -> ReadS SecurityConfigurationSummary
ReadS [SecurityConfigurationSummary]
(Int -> ReadS SecurityConfigurationSummary)
-> ReadS [SecurityConfigurationSummary]
-> ReadPrec SecurityConfigurationSummary
-> ReadPrec [SecurityConfigurationSummary]
-> Read SecurityConfigurationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityConfigurationSummary]
$creadListPrec :: ReadPrec [SecurityConfigurationSummary]
readPrec :: ReadPrec SecurityConfigurationSummary
$creadPrec :: ReadPrec SecurityConfigurationSummary
readList :: ReadS [SecurityConfigurationSummary]
$creadList :: ReadS [SecurityConfigurationSummary]
readsPrec :: Int -> ReadS SecurityConfigurationSummary
$creadsPrec :: Int -> ReadS SecurityConfigurationSummary
Prelude.Read, Int -> SecurityConfigurationSummary -> ShowS
[SecurityConfigurationSummary] -> ShowS
SecurityConfigurationSummary -> String
(Int -> SecurityConfigurationSummary -> ShowS)
-> (SecurityConfigurationSummary -> String)
-> ([SecurityConfigurationSummary] -> ShowS)
-> Show SecurityConfigurationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityConfigurationSummary] -> ShowS
$cshowList :: [SecurityConfigurationSummary] -> ShowS
show :: SecurityConfigurationSummary -> String
$cshow :: SecurityConfigurationSummary -> String
showsPrec :: Int -> SecurityConfigurationSummary -> ShowS
$cshowsPrec :: Int -> SecurityConfigurationSummary -> ShowS
Prelude.Show, (forall x.
 SecurityConfigurationSummary -> Rep SecurityConfigurationSummary x)
-> (forall x.
    Rep SecurityConfigurationSummary x -> SecurityConfigurationSummary)
-> Generic SecurityConfigurationSummary
forall x.
Rep SecurityConfigurationSummary x -> SecurityConfigurationSummary
forall x.
SecurityConfigurationSummary -> Rep SecurityConfigurationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SecurityConfigurationSummary x -> SecurityConfigurationSummary
$cfrom :: forall x.
SecurityConfigurationSummary -> Rep SecurityConfigurationSummary x
Prelude.Generic)

-- |
-- Create a value of 'SecurityConfigurationSummary' 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', 'securityConfigurationSummary_name' - The name of the security configuration.
--
-- 'creationDateTime', 'securityConfigurationSummary_creationDateTime' - The date and time the security configuration was created.
newSecurityConfigurationSummary ::
  SecurityConfigurationSummary
newSecurityConfigurationSummary :: SecurityConfigurationSummary
newSecurityConfigurationSummary =
  SecurityConfigurationSummary' :: Maybe Text -> Maybe POSIX -> SecurityConfigurationSummary
SecurityConfigurationSummary'
    { $sel:name:SecurityConfigurationSummary' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:SecurityConfigurationSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The date and time the security configuration was created.
securityConfigurationSummary_creationDateTime :: Lens.Lens' SecurityConfigurationSummary (Prelude.Maybe Prelude.UTCTime)
securityConfigurationSummary_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SecurityConfigurationSummary -> f SecurityConfigurationSummary
securityConfigurationSummary_creationDateTime = (SecurityConfigurationSummary -> Maybe POSIX)
-> (SecurityConfigurationSummary
    -> Maybe POSIX -> SecurityConfigurationSummary)
-> Lens
     SecurityConfigurationSummary
     SecurityConfigurationSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityConfigurationSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:SecurityConfigurationSummary' :: SecurityConfigurationSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: SecurityConfigurationSummary
s@SecurityConfigurationSummary' {} Maybe POSIX
a -> SecurityConfigurationSummary
s {$sel:creationDateTime:SecurityConfigurationSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: SecurityConfigurationSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> SecurityConfigurationSummary -> f SecurityConfigurationSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SecurityConfigurationSummary
-> f SecurityConfigurationSummary
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 SecurityConfigurationSummary where
  parseJSON :: Value -> Parser SecurityConfigurationSummary
parseJSON =
    String
-> (Object -> Parser SecurityConfigurationSummary)
-> Value
-> Parser SecurityConfigurationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SecurityConfigurationSummary"
      ( \Object
x ->
          Maybe Text -> Maybe POSIX -> SecurityConfigurationSummary
SecurityConfigurationSummary'
            (Maybe Text -> Maybe POSIX -> SecurityConfigurationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> SecurityConfigurationSummary)
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 POSIX -> SecurityConfigurationSummary)
-> Parser (Maybe POSIX) -> Parser SecurityConfigurationSummary
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
"CreationDateTime")
      )

instance
  Prelude.Hashable
    SecurityConfigurationSummary

instance Prelude.NFData SecurityConfigurationSummary