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

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

-- | Properties that describe the Amazon Web Services principal that created
-- the @BlockPublicAccessConfiguration@ using the
-- @PutBlockPublicAccessConfiguration@ action as well as the date and time
-- that the configuration was created. Each time a configuration for block
-- public access is updated, Amazon EMR updates this metadata.
--
-- /See:/ 'newBlockPublicAccessConfigurationMetadata' smart constructor.
data BlockPublicAccessConfigurationMetadata = BlockPublicAccessConfigurationMetadata'
  { -- | The date and time that the configuration was created.
    BlockPublicAccessConfigurationMetadata -> POSIX
creationDateTime :: Core.POSIX,
    -- | The Amazon Resource Name that created or last modified the
    -- configuration.
    BlockPublicAccessConfigurationMetadata -> Text
createdByArn :: Prelude.Text
  }
  deriving (BlockPublicAccessConfigurationMetadata
-> BlockPublicAccessConfigurationMetadata -> Bool
(BlockPublicAccessConfigurationMetadata
 -> BlockPublicAccessConfigurationMetadata -> Bool)
-> (BlockPublicAccessConfigurationMetadata
    -> BlockPublicAccessConfigurationMetadata -> Bool)
-> Eq BlockPublicAccessConfigurationMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BlockPublicAccessConfigurationMetadata
-> BlockPublicAccessConfigurationMetadata -> Bool
$c/= :: BlockPublicAccessConfigurationMetadata
-> BlockPublicAccessConfigurationMetadata -> Bool
== :: BlockPublicAccessConfigurationMetadata
-> BlockPublicAccessConfigurationMetadata -> Bool
$c== :: BlockPublicAccessConfigurationMetadata
-> BlockPublicAccessConfigurationMetadata -> Bool
Prelude.Eq, ReadPrec [BlockPublicAccessConfigurationMetadata]
ReadPrec BlockPublicAccessConfigurationMetadata
Int -> ReadS BlockPublicAccessConfigurationMetadata
ReadS [BlockPublicAccessConfigurationMetadata]
(Int -> ReadS BlockPublicAccessConfigurationMetadata)
-> ReadS [BlockPublicAccessConfigurationMetadata]
-> ReadPrec BlockPublicAccessConfigurationMetadata
-> ReadPrec [BlockPublicAccessConfigurationMetadata]
-> Read BlockPublicAccessConfigurationMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BlockPublicAccessConfigurationMetadata]
$creadListPrec :: ReadPrec [BlockPublicAccessConfigurationMetadata]
readPrec :: ReadPrec BlockPublicAccessConfigurationMetadata
$creadPrec :: ReadPrec BlockPublicAccessConfigurationMetadata
readList :: ReadS [BlockPublicAccessConfigurationMetadata]
$creadList :: ReadS [BlockPublicAccessConfigurationMetadata]
readsPrec :: Int -> ReadS BlockPublicAccessConfigurationMetadata
$creadsPrec :: Int -> ReadS BlockPublicAccessConfigurationMetadata
Prelude.Read, Int -> BlockPublicAccessConfigurationMetadata -> ShowS
[BlockPublicAccessConfigurationMetadata] -> ShowS
BlockPublicAccessConfigurationMetadata -> String
(Int -> BlockPublicAccessConfigurationMetadata -> ShowS)
-> (BlockPublicAccessConfigurationMetadata -> String)
-> ([BlockPublicAccessConfigurationMetadata] -> ShowS)
-> Show BlockPublicAccessConfigurationMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BlockPublicAccessConfigurationMetadata] -> ShowS
$cshowList :: [BlockPublicAccessConfigurationMetadata] -> ShowS
show :: BlockPublicAccessConfigurationMetadata -> String
$cshow :: BlockPublicAccessConfigurationMetadata -> String
showsPrec :: Int -> BlockPublicAccessConfigurationMetadata -> ShowS
$cshowsPrec :: Int -> BlockPublicAccessConfigurationMetadata -> ShowS
Prelude.Show, (forall x.
 BlockPublicAccessConfigurationMetadata
 -> Rep BlockPublicAccessConfigurationMetadata x)
-> (forall x.
    Rep BlockPublicAccessConfigurationMetadata x
    -> BlockPublicAccessConfigurationMetadata)
-> Generic BlockPublicAccessConfigurationMetadata
forall x.
Rep BlockPublicAccessConfigurationMetadata x
-> BlockPublicAccessConfigurationMetadata
forall x.
BlockPublicAccessConfigurationMetadata
-> Rep BlockPublicAccessConfigurationMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BlockPublicAccessConfigurationMetadata x
-> BlockPublicAccessConfigurationMetadata
$cfrom :: forall x.
BlockPublicAccessConfigurationMetadata
-> Rep BlockPublicAccessConfigurationMetadata x
Prelude.Generic)

-- |
-- Create a value of 'BlockPublicAccessConfigurationMetadata' 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:
--
-- 'creationDateTime', 'blockPublicAccessConfigurationMetadata_creationDateTime' - The date and time that the configuration was created.
--
-- 'createdByArn', 'blockPublicAccessConfigurationMetadata_createdByArn' - The Amazon Resource Name that created or last modified the
-- configuration.
newBlockPublicAccessConfigurationMetadata ::
  -- | 'creationDateTime'
  Prelude.UTCTime ->
  -- | 'createdByArn'
  Prelude.Text ->
  BlockPublicAccessConfigurationMetadata
newBlockPublicAccessConfigurationMetadata :: UTCTime -> Text -> BlockPublicAccessConfigurationMetadata
newBlockPublicAccessConfigurationMetadata
  UTCTime
pCreationDateTime_
  Text
pCreatedByArn_ =
    BlockPublicAccessConfigurationMetadata' :: POSIX -> Text -> BlockPublicAccessConfigurationMetadata
BlockPublicAccessConfigurationMetadata'
      { $sel:creationDateTime:BlockPublicAccessConfigurationMetadata' :: POSIX
creationDateTime =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
            (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDateTime_,
        $sel:createdByArn:BlockPublicAccessConfigurationMetadata' :: Text
createdByArn = Text
pCreatedByArn_
      }

-- | The date and time that the configuration was created.
blockPublicAccessConfigurationMetadata_creationDateTime :: Lens.Lens' BlockPublicAccessConfigurationMetadata Prelude.UTCTime
blockPublicAccessConfigurationMetadata_creationDateTime :: (UTCTime -> f UTCTime)
-> BlockPublicAccessConfigurationMetadata
-> f BlockPublicAccessConfigurationMetadata
blockPublicAccessConfigurationMetadata_creationDateTime = (BlockPublicAccessConfigurationMetadata -> POSIX)
-> (BlockPublicAccessConfigurationMetadata
    -> POSIX -> BlockPublicAccessConfigurationMetadata)
-> Lens
     BlockPublicAccessConfigurationMetadata
     BlockPublicAccessConfigurationMetadata
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlockPublicAccessConfigurationMetadata' {POSIX
creationDateTime :: POSIX
$sel:creationDateTime:BlockPublicAccessConfigurationMetadata' :: BlockPublicAccessConfigurationMetadata -> POSIX
creationDateTime} -> POSIX
creationDateTime) (\s :: BlockPublicAccessConfigurationMetadata
s@BlockPublicAccessConfigurationMetadata' {} POSIX
a -> BlockPublicAccessConfigurationMetadata
s {$sel:creationDateTime:BlockPublicAccessConfigurationMetadata' :: POSIX
creationDateTime = POSIX
a} :: BlockPublicAccessConfigurationMetadata) ((POSIX -> f POSIX)
 -> BlockPublicAccessConfigurationMetadata
 -> f BlockPublicAccessConfigurationMetadata)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> BlockPublicAccessConfigurationMetadata
-> f BlockPublicAccessConfigurationMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name that created or last modified the
-- configuration.
blockPublicAccessConfigurationMetadata_createdByArn :: Lens.Lens' BlockPublicAccessConfigurationMetadata Prelude.Text
blockPublicAccessConfigurationMetadata_createdByArn :: (Text -> f Text)
-> BlockPublicAccessConfigurationMetadata
-> f BlockPublicAccessConfigurationMetadata
blockPublicAccessConfigurationMetadata_createdByArn = (BlockPublicAccessConfigurationMetadata -> Text)
-> (BlockPublicAccessConfigurationMetadata
    -> Text -> BlockPublicAccessConfigurationMetadata)
-> Lens
     BlockPublicAccessConfigurationMetadata
     BlockPublicAccessConfigurationMetadata
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlockPublicAccessConfigurationMetadata' {Text
createdByArn :: Text
$sel:createdByArn:BlockPublicAccessConfigurationMetadata' :: BlockPublicAccessConfigurationMetadata -> Text
createdByArn} -> Text
createdByArn) (\s :: BlockPublicAccessConfigurationMetadata
s@BlockPublicAccessConfigurationMetadata' {} Text
a -> BlockPublicAccessConfigurationMetadata
s {$sel:createdByArn:BlockPublicAccessConfigurationMetadata' :: Text
createdByArn = Text
a} :: BlockPublicAccessConfigurationMetadata)

instance
  Core.FromJSON
    BlockPublicAccessConfigurationMetadata
  where
  parseJSON :: Value -> Parser BlockPublicAccessConfigurationMetadata
parseJSON =
    String
-> (Object -> Parser BlockPublicAccessConfigurationMetadata)
-> Value
-> Parser BlockPublicAccessConfigurationMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BlockPublicAccessConfigurationMetadata"
      ( \Object
x ->
          POSIX -> Text -> BlockPublicAccessConfigurationMetadata
BlockPublicAccessConfigurationMetadata'
            (POSIX -> Text -> BlockPublicAccessConfigurationMetadata)
-> Parser POSIX
-> Parser (Text -> BlockPublicAccessConfigurationMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationDateTime")
            Parser (Text -> BlockPublicAccessConfigurationMetadata)
-> Parser Text -> Parser BlockPublicAccessConfigurationMetadata
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
"CreatedByArn")
      )

instance
  Prelude.Hashable
    BlockPublicAccessConfigurationMetadata

instance
  Prelude.NFData
    BlockPublicAccessConfigurationMetadata