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

-- | The entity type details.
--
-- /See:/ 'newEntityType' smart constructor.
data EntityType = EntityType'
  { -- | 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 description.
    EntityType -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Timestamp of when the entity type was last updated.
    EntityType -> Maybe Text
lastUpdatedTime :: Prelude.Maybe Prelude.Text,
    -- | The entity type name.
    EntityType -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (EntityType -> EntityType -> Bool
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]
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
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. 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:
--
-- 'arn', 'entityType_arn' - The entity type ARN.
--
-- 'createdTime', 'entityType_createdTime' - Timestamp of when the entity type was created.
--
-- 'description', 'entityType_description' - The entity type description.
--
-- 'lastUpdatedTime', 'entityType_lastUpdatedTime' - Timestamp of when the entity type was last updated.
--
-- 'name', 'entityType_name' - The entity type name.
newEntityType ::
  EntityType
newEntityType :: EntityType
newEntityType =
  EntityType'
    { $sel:arn:EntityType' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:EntityType' :: Maybe Text
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:EntityType' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:EntityType' :: Maybe Text
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:EntityType' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The entity type ARN.
entityType_arn :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_arn :: Lens' EntityType (Maybe Text)
entityType_arn = 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 :: Lens' EntityType (Maybe Text)
entityType_createdTime = 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 description.
entityType_description :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_description :: Lens' EntityType (Maybe Text)
entityType_description = 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)

-- | Timestamp of when the entity type was last updated.
entityType_lastUpdatedTime :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_lastUpdatedTime :: Lens' EntityType (Maybe Text)
entityType_lastUpdatedTime = 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 name.
entityType_name :: Lens.Lens' EntityType (Prelude.Maybe Prelude.Text)
entityType_name :: Lens' EntityType (Maybe Text)
entityType_name = 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)

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

instance Prelude.Hashable EntityType where
  hashWithSalt :: Int -> EntityType -> Int
hashWithSalt Int
_salt EntityType' {Maybe Text
name :: Maybe Text
lastUpdatedTime :: Maybe Text
description :: Maybe Text
createdTime :: Maybe Text
arn :: Maybe Text
$sel:name:EntityType' :: EntityType -> Maybe Text
$sel:lastUpdatedTime:EntityType' :: EntityType -> Maybe Text
$sel:description:EntityType' :: EntityType -> Maybe Text
$sel:createdTime:EntityType' :: EntityType -> Maybe Text
$sel:arn:EntityType' :: EntityType -> 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 Text
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData EntityType where
  rnf :: EntityType -> ()
rnf EntityType' {Maybe Text
name :: Maybe Text
lastUpdatedTime :: Maybe Text
description :: Maybe Text
createdTime :: Maybe Text
arn :: Maybe Text
$sel:name:EntityType' :: EntityType -> Maybe Text
$sel:lastUpdatedTime:EntityType' :: EntityType -> Maybe Text
$sel:description:EntityType' :: EntityType -> Maybe Text
$sel:createdTime:EntityType' :: EntityType -> Maybe Text
$sel:arn:EntityType' :: EntityType -> 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 Text
createdTime
      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
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name