{-# 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.MacieV2.Types.CustomDataIdentifierSummary
-- 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.MacieV2.Types.CustomDataIdentifierSummary where

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

-- | Provides information about a custom data identifier.
--
-- /See:/ 'newCustomDataIdentifierSummary' smart constructor.
data CustomDataIdentifierSummary = CustomDataIdentifierSummary'
  { -- | The Amazon Resource Name (ARN) of the custom data identifier.
    CustomDataIdentifierSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in UTC and extended ISO 8601 format, when the custom
    -- data identifier was created.
    CustomDataIdentifierSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The custom name of the custom data identifier.
    CustomDataIdentifierSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the custom data identifier.
    CustomDataIdentifierSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The custom description of the custom data identifier.
    CustomDataIdentifierSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomDataIdentifierSummary -> CustomDataIdentifierSummary -> Bool
(CustomDataIdentifierSummary
 -> CustomDataIdentifierSummary -> Bool)
-> (CustomDataIdentifierSummary
    -> CustomDataIdentifierSummary -> Bool)
-> Eq CustomDataIdentifierSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomDataIdentifierSummary -> CustomDataIdentifierSummary -> Bool
$c/= :: CustomDataIdentifierSummary -> CustomDataIdentifierSummary -> Bool
== :: CustomDataIdentifierSummary -> CustomDataIdentifierSummary -> Bool
$c== :: CustomDataIdentifierSummary -> CustomDataIdentifierSummary -> Bool
Prelude.Eq, ReadPrec [CustomDataIdentifierSummary]
ReadPrec CustomDataIdentifierSummary
Int -> ReadS CustomDataIdentifierSummary
ReadS [CustomDataIdentifierSummary]
(Int -> ReadS CustomDataIdentifierSummary)
-> ReadS [CustomDataIdentifierSummary]
-> ReadPrec CustomDataIdentifierSummary
-> ReadPrec [CustomDataIdentifierSummary]
-> Read CustomDataIdentifierSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomDataIdentifierSummary]
$creadListPrec :: ReadPrec [CustomDataIdentifierSummary]
readPrec :: ReadPrec CustomDataIdentifierSummary
$creadPrec :: ReadPrec CustomDataIdentifierSummary
readList :: ReadS [CustomDataIdentifierSummary]
$creadList :: ReadS [CustomDataIdentifierSummary]
readsPrec :: Int -> ReadS CustomDataIdentifierSummary
$creadsPrec :: Int -> ReadS CustomDataIdentifierSummary
Prelude.Read, Int -> CustomDataIdentifierSummary -> ShowS
[CustomDataIdentifierSummary] -> ShowS
CustomDataIdentifierSummary -> String
(Int -> CustomDataIdentifierSummary -> ShowS)
-> (CustomDataIdentifierSummary -> String)
-> ([CustomDataIdentifierSummary] -> ShowS)
-> Show CustomDataIdentifierSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomDataIdentifierSummary] -> ShowS
$cshowList :: [CustomDataIdentifierSummary] -> ShowS
show :: CustomDataIdentifierSummary -> String
$cshow :: CustomDataIdentifierSummary -> String
showsPrec :: Int -> CustomDataIdentifierSummary -> ShowS
$cshowsPrec :: Int -> CustomDataIdentifierSummary -> ShowS
Prelude.Show, (forall x.
 CustomDataIdentifierSummary -> Rep CustomDataIdentifierSummary x)
-> (forall x.
    Rep CustomDataIdentifierSummary x -> CustomDataIdentifierSummary)
-> Generic CustomDataIdentifierSummary
forall x.
Rep CustomDataIdentifierSummary x -> CustomDataIdentifierSummary
forall x.
CustomDataIdentifierSummary -> Rep CustomDataIdentifierSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomDataIdentifierSummary x -> CustomDataIdentifierSummary
$cfrom :: forall x.
CustomDataIdentifierSummary -> Rep CustomDataIdentifierSummary x
Prelude.Generic)

-- |
-- Create a value of 'CustomDataIdentifierSummary' 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:
--
-- 'arn', 'customDataIdentifierSummary_arn' - The Amazon Resource Name (ARN) of the custom data identifier.
--
-- 'createdAt', 'customDataIdentifierSummary_createdAt' - The date and time, in UTC and extended ISO 8601 format, when the custom
-- data identifier was created.
--
-- 'name', 'customDataIdentifierSummary_name' - The custom name of the custom data identifier.
--
-- 'id', 'customDataIdentifierSummary_id' - The unique identifier for the custom data identifier.
--
-- 'description', 'customDataIdentifierSummary_description' - The custom description of the custom data identifier.
newCustomDataIdentifierSummary ::
  CustomDataIdentifierSummary
newCustomDataIdentifierSummary :: CustomDataIdentifierSummary
newCustomDataIdentifierSummary =
  CustomDataIdentifierSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomDataIdentifierSummary
CustomDataIdentifierSummary'
    { $sel:arn:CustomDataIdentifierSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CustomDataIdentifierSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CustomDataIdentifierSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CustomDataIdentifierSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CustomDataIdentifierSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the custom data identifier.
customDataIdentifierSummary_arn :: Lens.Lens' CustomDataIdentifierSummary (Prelude.Maybe Prelude.Text)
customDataIdentifierSummary_arn :: (Maybe Text -> f (Maybe Text))
-> CustomDataIdentifierSummary -> f CustomDataIdentifierSummary
customDataIdentifierSummary_arn = (CustomDataIdentifierSummary -> Maybe Text)
-> (CustomDataIdentifierSummary
    -> Maybe Text -> CustomDataIdentifierSummary)
-> Lens
     CustomDataIdentifierSummary
     CustomDataIdentifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDataIdentifierSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:CustomDataIdentifierSummary' :: CustomDataIdentifierSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CustomDataIdentifierSummary
s@CustomDataIdentifierSummary' {} Maybe Text
a -> CustomDataIdentifierSummary
s {$sel:arn:CustomDataIdentifierSummary' :: Maybe Text
arn = Maybe Text
a} :: CustomDataIdentifierSummary)

-- | The date and time, in UTC and extended ISO 8601 format, when the custom
-- data identifier was created.
customDataIdentifierSummary_createdAt :: Lens.Lens' CustomDataIdentifierSummary (Prelude.Maybe Prelude.UTCTime)
customDataIdentifierSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CustomDataIdentifierSummary -> f CustomDataIdentifierSummary
customDataIdentifierSummary_createdAt = (CustomDataIdentifierSummary -> Maybe POSIX)
-> (CustomDataIdentifierSummary
    -> Maybe POSIX -> CustomDataIdentifierSummary)
-> Lens
     CustomDataIdentifierSummary
     CustomDataIdentifierSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDataIdentifierSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:CustomDataIdentifierSummary' :: CustomDataIdentifierSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: CustomDataIdentifierSummary
s@CustomDataIdentifierSummary' {} Maybe POSIX
a -> CustomDataIdentifierSummary
s {$sel:createdAt:CustomDataIdentifierSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: CustomDataIdentifierSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> CustomDataIdentifierSummary -> f CustomDataIdentifierSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CustomDataIdentifierSummary
-> f CustomDataIdentifierSummary
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

-- | The custom name of the custom data identifier.
customDataIdentifierSummary_name :: Lens.Lens' CustomDataIdentifierSummary (Prelude.Maybe Prelude.Text)
customDataIdentifierSummary_name :: (Maybe Text -> f (Maybe Text))
-> CustomDataIdentifierSummary -> f CustomDataIdentifierSummary
customDataIdentifierSummary_name = (CustomDataIdentifierSummary -> Maybe Text)
-> (CustomDataIdentifierSummary
    -> Maybe Text -> CustomDataIdentifierSummary)
-> Lens
     CustomDataIdentifierSummary
     CustomDataIdentifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDataIdentifierSummary' {Maybe Text
name :: Maybe Text
$sel:name:CustomDataIdentifierSummary' :: CustomDataIdentifierSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: CustomDataIdentifierSummary
s@CustomDataIdentifierSummary' {} Maybe Text
a -> CustomDataIdentifierSummary
s {$sel:name:CustomDataIdentifierSummary' :: Maybe Text
name = Maybe Text
a} :: CustomDataIdentifierSummary)

-- | The unique identifier for the custom data identifier.
customDataIdentifierSummary_id :: Lens.Lens' CustomDataIdentifierSummary (Prelude.Maybe Prelude.Text)
customDataIdentifierSummary_id :: (Maybe Text -> f (Maybe Text))
-> CustomDataIdentifierSummary -> f CustomDataIdentifierSummary
customDataIdentifierSummary_id = (CustomDataIdentifierSummary -> Maybe Text)
-> (CustomDataIdentifierSummary
    -> Maybe Text -> CustomDataIdentifierSummary)
-> Lens
     CustomDataIdentifierSummary
     CustomDataIdentifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDataIdentifierSummary' {Maybe Text
id :: Maybe Text
$sel:id:CustomDataIdentifierSummary' :: CustomDataIdentifierSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: CustomDataIdentifierSummary
s@CustomDataIdentifierSummary' {} Maybe Text
a -> CustomDataIdentifierSummary
s {$sel:id:CustomDataIdentifierSummary' :: Maybe Text
id = Maybe Text
a} :: CustomDataIdentifierSummary)

-- | The custom description of the custom data identifier.
customDataIdentifierSummary_description :: Lens.Lens' CustomDataIdentifierSummary (Prelude.Maybe Prelude.Text)
customDataIdentifierSummary_description :: (Maybe Text -> f (Maybe Text))
-> CustomDataIdentifierSummary -> f CustomDataIdentifierSummary
customDataIdentifierSummary_description = (CustomDataIdentifierSummary -> Maybe Text)
-> (CustomDataIdentifierSummary
    -> Maybe Text -> CustomDataIdentifierSummary)
-> Lens
     CustomDataIdentifierSummary
     CustomDataIdentifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDataIdentifierSummary' {Maybe Text
description :: Maybe Text
$sel:description:CustomDataIdentifierSummary' :: CustomDataIdentifierSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: CustomDataIdentifierSummary
s@CustomDataIdentifierSummary' {} Maybe Text
a -> CustomDataIdentifierSummary
s {$sel:description:CustomDataIdentifierSummary' :: Maybe Text
description = Maybe Text
a} :: CustomDataIdentifierSummary)

instance Core.FromJSON CustomDataIdentifierSummary where
  parseJSON :: Value -> Parser CustomDataIdentifierSummary
parseJSON =
    String
-> (Object -> Parser CustomDataIdentifierSummary)
-> Value
-> Parser CustomDataIdentifierSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomDataIdentifierSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomDataIdentifierSummary
CustomDataIdentifierSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> CustomDataIdentifierSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CustomDataIdentifierSummary)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CustomDataIdentifierSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> CustomDataIdentifierSummary)
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
"createdAt")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> CustomDataIdentifierSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> CustomDataIdentifierSummary)
forall (f :: * -> *) a b. Applicative f => 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 Text -> Maybe Text -> CustomDataIdentifierSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> CustomDataIdentifierSummary)
forall (f :: * -> *) a b. Applicative f => 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
"id")
            Parser (Maybe Text -> CustomDataIdentifierSummary)
-> Parser (Maybe Text) -> Parser CustomDataIdentifierSummary
forall (f :: * -> *) a b. Applicative f => 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
"description")
      )

instance Prelude.Hashable CustomDataIdentifierSummary

instance Prelude.NFData CustomDataIdentifierSummary