{-# 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.AllowListSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.AllowListSummary where

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

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

-- |
-- Create a value of 'AllowListSummary' 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', 'allowListSummary_arn' - The Amazon Resource Name (ARN) of the allow list.
--
-- 'createdAt', 'allowListSummary_createdAt' - The date and time, in UTC and extended ISO 8601 format, when the allow
-- list was created in Amazon Macie.
--
-- 'description', 'allowListSummary_description' - The custom description of the allow list.
--
-- 'id', 'allowListSummary_id' - The unique identifier for the allow list.
--
-- 'name', 'allowListSummary_name' - The custom name of the allow list.
--
-- 'updatedAt', 'allowListSummary_updatedAt' - The date and time, in UTC and extended ISO 8601 format, when the allow
-- list\'s settings were most recently changed in Amazon Macie.
newAllowListSummary ::
  AllowListSummary
newAllowListSummary :: AllowListSummary
newAllowListSummary =
  AllowListSummary'
    { $sel:arn:AllowListSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:AllowListSummary' :: Maybe ISO8601
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:description:AllowListSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:AllowListSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AllowListSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:AllowListSummary' :: Maybe ISO8601
updatedAt = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the allow list.
allowListSummary_arn :: Lens.Lens' AllowListSummary (Prelude.Maybe Prelude.Text)
allowListSummary_arn :: Lens' AllowListSummary (Maybe Text)
allowListSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowListSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:AllowListSummary' :: AllowListSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AllowListSummary
s@AllowListSummary' {} Maybe Text
a -> AllowListSummary
s {$sel:arn:AllowListSummary' :: Maybe Text
arn = Maybe Text
a} :: AllowListSummary)

-- | The date and time, in UTC and extended ISO 8601 format, when the allow
-- list was created in Amazon Macie.
allowListSummary_createdAt :: Lens.Lens' AllowListSummary (Prelude.Maybe Prelude.UTCTime)
allowListSummary_createdAt :: Lens' AllowListSummary (Maybe UTCTime)
allowListSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowListSummary' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:AllowListSummary' :: AllowListSummary -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: AllowListSummary
s@AllowListSummary' {} Maybe ISO8601
a -> AllowListSummary
s {$sel:createdAt:AllowListSummary' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: AllowListSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The custom description of the allow list.
allowListSummary_description :: Lens.Lens' AllowListSummary (Prelude.Maybe Prelude.Text)
allowListSummary_description :: Lens' AllowListSummary (Maybe Text)
allowListSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowListSummary' {Maybe Text
description :: Maybe Text
$sel:description:AllowListSummary' :: AllowListSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: AllowListSummary
s@AllowListSummary' {} Maybe Text
a -> AllowListSummary
s {$sel:description:AllowListSummary' :: Maybe Text
description = Maybe Text
a} :: AllowListSummary)

-- | The unique identifier for the allow list.
allowListSummary_id :: Lens.Lens' AllowListSummary (Prelude.Maybe Prelude.Text)
allowListSummary_id :: Lens' AllowListSummary (Maybe Text)
allowListSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowListSummary' {Maybe Text
id :: Maybe Text
$sel:id:AllowListSummary' :: AllowListSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: AllowListSummary
s@AllowListSummary' {} Maybe Text
a -> AllowListSummary
s {$sel:id:AllowListSummary' :: Maybe Text
id = Maybe Text
a} :: AllowListSummary)

-- | The custom name of the allow list.
allowListSummary_name :: Lens.Lens' AllowListSummary (Prelude.Maybe Prelude.Text)
allowListSummary_name :: Lens' AllowListSummary (Maybe Text)
allowListSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowListSummary' {Maybe Text
name :: Maybe Text
$sel:name:AllowListSummary' :: AllowListSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: AllowListSummary
s@AllowListSummary' {} Maybe Text
a -> AllowListSummary
s {$sel:name:AllowListSummary' :: Maybe Text
name = Maybe Text
a} :: AllowListSummary)

-- | The date and time, in UTC and extended ISO 8601 format, when the allow
-- list\'s settings were most recently changed in Amazon Macie.
allowListSummary_updatedAt :: Lens.Lens' AllowListSummary (Prelude.Maybe Prelude.UTCTime)
allowListSummary_updatedAt :: Lens' AllowListSummary (Maybe UTCTime)
allowListSummary_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowListSummary' {Maybe ISO8601
updatedAt :: Maybe ISO8601
$sel:updatedAt:AllowListSummary' :: AllowListSummary -> Maybe ISO8601
updatedAt} -> Maybe ISO8601
updatedAt) (\s :: AllowListSummary
s@AllowListSummary' {} Maybe ISO8601
a -> AllowListSummary
s {$sel:updatedAt:AllowListSummary' :: Maybe ISO8601
updatedAt = Maybe ISO8601
a} :: AllowListSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON AllowListSummary where
  parseJSON :: Value -> Parser AllowListSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AllowListSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> AllowListSummary
AllowListSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"updatedAt")
      )

instance Prelude.Hashable AllowListSummary where
  hashWithSalt :: Int -> AllowListSummary -> Int
hashWithSalt Int
_salt AllowListSummary' {Maybe Text
Maybe ISO8601
updatedAt :: Maybe ISO8601
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
createdAt :: Maybe ISO8601
arn :: Maybe Text
$sel:updatedAt:AllowListSummary' :: AllowListSummary -> Maybe ISO8601
$sel:name:AllowListSummary' :: AllowListSummary -> Maybe Text
$sel:id:AllowListSummary' :: AllowListSummary -> Maybe Text
$sel:description:AllowListSummary' :: AllowListSummary -> Maybe Text
$sel:createdAt:AllowListSummary' :: AllowListSummary -> Maybe ISO8601
$sel:arn:AllowListSummary' :: AllowListSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
updatedAt

instance Prelude.NFData AllowListSummary where
  rnf :: AllowListSummary -> ()
rnf AllowListSummary' {Maybe Text
Maybe ISO8601
updatedAt :: Maybe ISO8601
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
createdAt :: Maybe ISO8601
arn :: Maybe Text
$sel:updatedAt:AllowListSummary' :: AllowListSummary -> Maybe ISO8601
$sel:name:AllowListSummary' :: AllowListSummary -> Maybe Text
$sel:id:AllowListSummary' :: AllowListSummary -> Maybe Text
$sel:description:AllowListSummary' :: AllowListSummary -> Maybe Text
$sel:createdAt:AllowListSummary' :: AllowListSummary -> Maybe ISO8601
$sel:arn:AllowListSummary' :: AllowListSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
updatedAt