{-# 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.FraudDetector.Types.EntityType
-- 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.FraudDetector.Types.EntityType where

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

-- | The entity type details.
--
-- /See:/ 'newEntityType' smart constructor.
data EntityType = EntityType'
  { -- | Timestamp of when the entity type was last updated.
    EntityType -> Maybe Text
lastUpdatedTime :: Prelude.Maybe Prelude.Text,
    -- | The entity type ARN.
    EntityType -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Timestamp of when the entity type was created.
    EntityType -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The entity type name.
    EntityType -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The entity type description.
    EntityType -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (EntityType -> EntityType -> Bool
(EntityType -> EntityType -> Bool)
-> (EntityType -> EntityType -> Bool) -> Eq EntityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityType -> EntityType -> Bool
$c/= :: EntityType -> EntityType -> Bool
== :: EntityType -> EntityType -> Bool
$c== :: EntityType -> EntityType -> Bool
Prelude.Eq, ReadPrec [EntityType]
ReadPrec EntityType
Int -> ReadS EntityType
ReadS [EntityType]
(Int -> ReadS EntityType)
-> ReadS [EntityType]
-> ReadPrec EntityType
-> ReadPrec [EntityType]
-> Read EntityType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityType]
$creadListPrec :: ReadPrec [EntityType]
readPrec :: ReadPrec EntityType
$creadPrec :: ReadPrec EntityType
readList :: ReadS [EntityType]
$creadList :: ReadS [EntityType]
readsPrec :: Int -> ReadS EntityType
$creadsPrec :: Int -> ReadS EntityType
Prelude.Read, Int -> EntityType -> ShowS
[EntityType] -> ShowS
EntityType -> String
(Int -> EntityType -> ShowS)
-> (EntityType -> String)
-> ([EntityType] -> ShowS)
-> Show EntityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityType] -> ShowS
$cshowList :: [EntityType] -> ShowS
show :: EntityType -> String
$cshow :: EntityType -> String
showsPrec :: Int -> EntityType -> ShowS
$cshowsPrec :: Int -> EntityType -> ShowS
Prelude.Show, (forall x. EntityType -> Rep EntityType x)
-> (forall x. Rep EntityType x -> EntityType) -> Generic EntityType
forall x. Rep EntityType x -> EntityType
forall x. EntityType -> Rep EntityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntityType x -> EntityType
$cfrom :: forall x. EntityType -> Rep EntityType x
Prelude.Generic)

-- |
-- Create a value of 'EntityType' 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:
--
-- 'lastUpdatedTime', 'entityType_lastUpdatedTime' - Timestamp of when the entity type was last updated.
--
-- 'arn', 'entityType_arn' - The entity type ARN.
--
-- 'createdTime', 'entityType_createdTime' - Timestamp of when the entity type was created.
--
-- 'name', 'entityType_name' - The entity type name.
--
-- 'description', 'entityType_description' - The entity type description.
newEntityType ::
  EntityType
newEntityType :: EntityType
newEntityType =
  EntityType' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EntityType
EntityType'
    { $sel:lastUpdatedTime:EntityType' :: Maybe Text
lastUpdatedTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:EntityType' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:EntityType' :: Maybe Text
createdTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:EntityType' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:EntityType' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Timestamp of when the entity type was last updated.
entityType_lastUpdatedTime :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_lastUpdatedTime :: (Maybe Text -> f (Maybe Text)) -> EntityType -> f EntityType
entityType_lastUpdatedTime = (EntityType -> Maybe Text)
-> (EntityType -> Maybe Text -> EntityType)
-> Lens EntityType EntityType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityType' {Maybe Text
lastUpdatedTime :: Maybe Text
$sel:lastUpdatedTime:EntityType' :: EntityType -> Maybe Text
lastUpdatedTime} -> Maybe Text
lastUpdatedTime) (\s :: EntityType
s@EntityType' {} Maybe Text
a -> EntityType
s {$sel:lastUpdatedTime:EntityType' :: Maybe Text
lastUpdatedTime = Maybe Text
a} :: EntityType)

-- | The entity type ARN.
entityType_arn :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_arn :: (Maybe Text -> f (Maybe Text)) -> EntityType -> f EntityType
entityType_arn = (EntityType -> Maybe Text)
-> (EntityType -> Maybe Text -> EntityType)
-> Lens EntityType EntityType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityType' {Maybe Text
arn :: Maybe Text
$sel:arn:EntityType' :: EntityType -> Maybe Text
arn} -> Maybe Text
arn) (\s :: EntityType
s@EntityType' {} Maybe Text
a -> EntityType
s {$sel:arn:EntityType' :: Maybe Text
arn = Maybe Text
a} :: EntityType)

-- | Timestamp of when the entity type was created.
entityType_createdTime :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_createdTime :: (Maybe Text -> f (Maybe Text)) -> EntityType -> f EntityType
entityType_createdTime = (EntityType -> Maybe Text)
-> (EntityType -> Maybe Text -> EntityType)
-> Lens EntityType EntityType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityType' {Maybe Text
createdTime :: Maybe Text
$sel:createdTime:EntityType' :: EntityType -> Maybe Text
createdTime} -> Maybe Text
createdTime) (\s :: EntityType
s@EntityType' {} Maybe Text
a -> EntityType
s {$sel:createdTime:EntityType' :: Maybe Text
createdTime = Maybe Text
a} :: EntityType)

-- | The entity type name.
entityType_name :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_name :: (Maybe Text -> f (Maybe Text)) -> EntityType -> f EntityType
entityType_name = (EntityType -> Maybe Text)
-> (EntityType -> Maybe Text -> EntityType)
-> Lens EntityType EntityType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityType' {Maybe Text
name :: Maybe Text
$sel:name:EntityType' :: EntityType -> Maybe Text
name} -> Maybe Text
name) (\s :: EntityType
s@EntityType' {} Maybe Text
a -> EntityType
s {$sel:name:EntityType' :: Maybe Text
name = Maybe Text
a} :: EntityType)

-- | The entity type description.
entityType_description :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_description :: (Maybe Text -> f (Maybe Text)) -> EntityType -> f EntityType
entityType_description = (EntityType -> Maybe Text)
-> (EntityType -> Maybe Text -> EntityType)
-> Lens EntityType EntityType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityType' {Maybe Text
description :: Maybe Text
$sel:description:EntityType' :: EntityType -> Maybe Text
description} -> Maybe Text
description) (\s :: EntityType
s@EntityType' {} Maybe Text
a -> EntityType
s {$sel:description:EntityType' :: Maybe Text
description = Maybe Text
a} :: EntityType)

instance Core.FromJSON EntityType where
  parseJSON :: Value -> Parser EntityType
parseJSON =
    String
-> (Object -> Parser EntityType) -> Value -> Parser EntityType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EntityType"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EntityType
EntityType'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> EntityType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> EntityType)
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
"lastUpdatedTime")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> EntityType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> EntityType)
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
"arn")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> EntityType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> EntityType)
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
"createdTime")
            Parser (Maybe Text -> Maybe Text -> EntityType)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EntityType)
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 -> EntityType)
-> Parser (Maybe Text) -> Parser EntityType
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 EntityType

instance Prelude.NFData EntityType