{-# 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.VoiceId.Types.Fraudster
-- 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.VoiceId.Types.Fraudster where

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

-- | Contains all the information about a fraudster.
--
-- /See:/ 'newFraudster' smart constructor.
data Fraudster = Fraudster'
  { -- | The timestamp when Voice ID identified the fraudster.
    Fraudster -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The service-generated identifier for the fraudster.
    Fraudster -> Maybe Text
generatedFraudsterId :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the domain containing the fraudster.
    Fraudster -> Maybe Text
domainId :: Prelude.Maybe Prelude.Text
  }
  deriving (Fraudster -> Fraudster -> Bool
(Fraudster -> Fraudster -> Bool)
-> (Fraudster -> Fraudster -> Bool) -> Eq Fraudster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Fraudster -> Fraudster -> Bool
$c/= :: Fraudster -> Fraudster -> Bool
== :: Fraudster -> Fraudster -> Bool
$c== :: Fraudster -> Fraudster -> Bool
Prelude.Eq, ReadPrec [Fraudster]
ReadPrec Fraudster
Int -> ReadS Fraudster
ReadS [Fraudster]
(Int -> ReadS Fraudster)
-> ReadS [Fraudster]
-> ReadPrec Fraudster
-> ReadPrec [Fraudster]
-> Read Fraudster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Fraudster]
$creadListPrec :: ReadPrec [Fraudster]
readPrec :: ReadPrec Fraudster
$creadPrec :: ReadPrec Fraudster
readList :: ReadS [Fraudster]
$creadList :: ReadS [Fraudster]
readsPrec :: Int -> ReadS Fraudster
$creadsPrec :: Int -> ReadS Fraudster
Prelude.Read, Int -> Fraudster -> ShowS
[Fraudster] -> ShowS
Fraudster -> String
(Int -> Fraudster -> ShowS)
-> (Fraudster -> String)
-> ([Fraudster] -> ShowS)
-> Show Fraudster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Fraudster] -> ShowS
$cshowList :: [Fraudster] -> ShowS
show :: Fraudster -> String
$cshow :: Fraudster -> String
showsPrec :: Int -> Fraudster -> ShowS
$cshowsPrec :: Int -> Fraudster -> ShowS
Prelude.Show, (forall x. Fraudster -> Rep Fraudster x)
-> (forall x. Rep Fraudster x -> Fraudster) -> Generic Fraudster
forall x. Rep Fraudster x -> Fraudster
forall x. Fraudster -> Rep Fraudster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Fraudster x -> Fraudster
$cfrom :: forall x. Fraudster -> Rep Fraudster x
Prelude.Generic)

-- |
-- Create a value of 'Fraudster' 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:
--
-- 'createdAt', 'fraudster_createdAt' - The timestamp when Voice ID identified the fraudster.
--
-- 'generatedFraudsterId', 'fraudster_generatedFraudsterId' - The service-generated identifier for the fraudster.
--
-- 'domainId', 'fraudster_domainId' - The identifier for the domain containing the fraudster.
newFraudster ::
  Fraudster
newFraudster :: Fraudster
newFraudster =
  Fraudster' :: Maybe POSIX -> Maybe Text -> Maybe Text -> Fraudster
Fraudster'
    { $sel:createdAt:Fraudster' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:generatedFraudsterId:Fraudster' :: Maybe Text
generatedFraudsterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainId:Fraudster' :: Maybe Text
domainId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The timestamp when Voice ID identified the fraudster.
fraudster_createdAt :: Lens.Lens' Fraudster (Prelude.Maybe Prelude.UTCTime)
fraudster_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Fraudster -> f Fraudster
fraudster_createdAt = (Fraudster -> Maybe POSIX)
-> (Fraudster -> Maybe POSIX -> Fraudster)
-> Lens Fraudster Fraudster (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fraudster' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Fraudster' :: Fraudster -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Fraudster
s@Fraudster' {} Maybe POSIX
a -> Fraudster
s {$sel:createdAt:Fraudster' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Fraudster) ((Maybe POSIX -> f (Maybe POSIX)) -> Fraudster -> f Fraudster)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Fraudster
-> f Fraudster
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 service-generated identifier for the fraudster.
fraudster_generatedFraudsterId :: Lens.Lens' Fraudster (Prelude.Maybe Prelude.Text)
fraudster_generatedFraudsterId :: (Maybe Text -> f (Maybe Text)) -> Fraudster -> f Fraudster
fraudster_generatedFraudsterId = (Fraudster -> Maybe Text)
-> (Fraudster -> Maybe Text -> Fraudster)
-> Lens Fraudster Fraudster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fraudster' {Maybe Text
generatedFraudsterId :: Maybe Text
$sel:generatedFraudsterId:Fraudster' :: Fraudster -> Maybe Text
generatedFraudsterId} -> Maybe Text
generatedFraudsterId) (\s :: Fraudster
s@Fraudster' {} Maybe Text
a -> Fraudster
s {$sel:generatedFraudsterId:Fraudster' :: Maybe Text
generatedFraudsterId = Maybe Text
a} :: Fraudster)

-- | The identifier for the domain containing the fraudster.
fraudster_domainId :: Lens.Lens' Fraudster (Prelude.Maybe Prelude.Text)
fraudster_domainId :: (Maybe Text -> f (Maybe Text)) -> Fraudster -> f Fraudster
fraudster_domainId = (Fraudster -> Maybe Text)
-> (Fraudster -> Maybe Text -> Fraudster)
-> Lens Fraudster Fraudster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fraudster' {Maybe Text
domainId :: Maybe Text
$sel:domainId:Fraudster' :: Fraudster -> Maybe Text
domainId} -> Maybe Text
domainId) (\s :: Fraudster
s@Fraudster' {} Maybe Text
a -> Fraudster
s {$sel:domainId:Fraudster' :: Maybe Text
domainId = Maybe Text
a} :: Fraudster)

instance Core.FromJSON Fraudster where
  parseJSON :: Value -> Parser Fraudster
parseJSON =
    String -> (Object -> Parser Fraudster) -> Value -> Parser Fraudster
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Fraudster"
      ( \Object
x ->
          Maybe POSIX -> Maybe Text -> Maybe Text -> Fraudster
Fraudster'
            (Maybe POSIX -> Maybe Text -> Maybe Text -> Fraudster)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Fraudster)
forall (f :: * -> *) a b. Functor 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 -> Fraudster)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Fraudster)
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
"GeneratedFraudsterId")
            Parser (Maybe Text -> Fraudster)
-> Parser (Maybe Text) -> Parser Fraudster
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
"DomainId")
      )

instance Prelude.Hashable Fraudster

instance Prelude.NFData Fraudster