{-# 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.Glue.Types.DataQualityRulesetEvaluationRunDescription
-- 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.Glue.Types.DataQualityRulesetEvaluationRunDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.DataSource
import Amazonka.Glue.Types.TaskStatusType
import qualified Amazonka.Prelude as Prelude

-- | Describes the result of a data quality ruleset evaluation run.
--
-- /See:/ 'newDataQualityRulesetEvaluationRunDescription' smart constructor.
data DataQualityRulesetEvaluationRunDescription = DataQualityRulesetEvaluationRunDescription'
  { -- | The data source (an Glue table) associated with the run.
    DataQualityRulesetEvaluationRunDescription -> Maybe DataSource
dataSource :: Prelude.Maybe DataSource,
    -- | The unique run identifier associated with this run.
    DataQualityRulesetEvaluationRunDescription -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the run started.
    DataQualityRulesetEvaluationRunDescription -> Maybe POSIX
startedOn :: Prelude.Maybe Data.POSIX,
    -- | The status for this run.
    DataQualityRulesetEvaluationRunDescription -> Maybe TaskStatusType
status :: Prelude.Maybe TaskStatusType
  }
  deriving (DataQualityRulesetEvaluationRunDescription
-> DataQualityRulesetEvaluationRunDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataQualityRulesetEvaluationRunDescription
-> DataQualityRulesetEvaluationRunDescription -> Bool
$c/= :: DataQualityRulesetEvaluationRunDescription
-> DataQualityRulesetEvaluationRunDescription -> Bool
== :: DataQualityRulesetEvaluationRunDescription
-> DataQualityRulesetEvaluationRunDescription -> Bool
$c== :: DataQualityRulesetEvaluationRunDescription
-> DataQualityRulesetEvaluationRunDescription -> Bool
Prelude.Eq, ReadPrec [DataQualityRulesetEvaluationRunDescription]
ReadPrec DataQualityRulesetEvaluationRunDescription
Int -> ReadS DataQualityRulesetEvaluationRunDescription
ReadS [DataQualityRulesetEvaluationRunDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataQualityRulesetEvaluationRunDescription]
$creadListPrec :: ReadPrec [DataQualityRulesetEvaluationRunDescription]
readPrec :: ReadPrec DataQualityRulesetEvaluationRunDescription
$creadPrec :: ReadPrec DataQualityRulesetEvaluationRunDescription
readList :: ReadS [DataQualityRulesetEvaluationRunDescription]
$creadList :: ReadS [DataQualityRulesetEvaluationRunDescription]
readsPrec :: Int -> ReadS DataQualityRulesetEvaluationRunDescription
$creadsPrec :: Int -> ReadS DataQualityRulesetEvaluationRunDescription
Prelude.Read, Int -> DataQualityRulesetEvaluationRunDescription -> ShowS
[DataQualityRulesetEvaluationRunDescription] -> ShowS
DataQualityRulesetEvaluationRunDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataQualityRulesetEvaluationRunDescription] -> ShowS
$cshowList :: [DataQualityRulesetEvaluationRunDescription] -> ShowS
show :: DataQualityRulesetEvaluationRunDescription -> String
$cshow :: DataQualityRulesetEvaluationRunDescription -> String
showsPrec :: Int -> DataQualityRulesetEvaluationRunDescription -> ShowS
$cshowsPrec :: Int -> DataQualityRulesetEvaluationRunDescription -> ShowS
Prelude.Show, forall x.
Rep DataQualityRulesetEvaluationRunDescription x
-> DataQualityRulesetEvaluationRunDescription
forall x.
DataQualityRulesetEvaluationRunDescription
-> Rep DataQualityRulesetEvaluationRunDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataQualityRulesetEvaluationRunDescription x
-> DataQualityRulesetEvaluationRunDescription
$cfrom :: forall x.
DataQualityRulesetEvaluationRunDescription
-> Rep DataQualityRulesetEvaluationRunDescription x
Prelude.Generic)

-- |
-- Create a value of 'DataQualityRulesetEvaluationRunDescription' 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:
--
-- 'dataSource', 'dataQualityRulesetEvaluationRunDescription_dataSource' - The data source (an Glue table) associated with the run.
--
-- 'runId', 'dataQualityRulesetEvaluationRunDescription_runId' - The unique run identifier associated with this run.
--
-- 'startedOn', 'dataQualityRulesetEvaluationRunDescription_startedOn' - The date and time when the run started.
--
-- 'status', 'dataQualityRulesetEvaluationRunDescription_status' - The status for this run.
newDataQualityRulesetEvaluationRunDescription ::
  DataQualityRulesetEvaluationRunDescription
newDataQualityRulesetEvaluationRunDescription :: DataQualityRulesetEvaluationRunDescription
newDataQualityRulesetEvaluationRunDescription =
  DataQualityRulesetEvaluationRunDescription'
    { $sel:dataSource:DataQualityRulesetEvaluationRunDescription' :: Maybe DataSource
dataSource =
        forall a. Maybe a
Prelude.Nothing,
      $sel:runId:DataQualityRulesetEvaluationRunDescription' :: Maybe Text
runId = forall a. Maybe a
Prelude.Nothing,
      $sel:startedOn:DataQualityRulesetEvaluationRunDescription' :: Maybe POSIX
startedOn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DataQualityRulesetEvaluationRunDescription' :: Maybe TaskStatusType
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The data source (an Glue table) associated with the run.
dataQualityRulesetEvaluationRunDescription_dataSource :: Lens.Lens' DataQualityRulesetEvaluationRunDescription (Prelude.Maybe DataSource)
dataQualityRulesetEvaluationRunDescription_dataSource :: Lens' DataQualityRulesetEvaluationRunDescription (Maybe DataSource)
dataQualityRulesetEvaluationRunDescription_dataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityRulesetEvaluationRunDescription' {Maybe DataSource
dataSource :: Maybe DataSource
$sel:dataSource:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe DataSource
dataSource} -> Maybe DataSource
dataSource) (\s :: DataQualityRulesetEvaluationRunDescription
s@DataQualityRulesetEvaluationRunDescription' {} Maybe DataSource
a -> DataQualityRulesetEvaluationRunDescription
s {$sel:dataSource:DataQualityRulesetEvaluationRunDescription' :: Maybe DataSource
dataSource = Maybe DataSource
a} :: DataQualityRulesetEvaluationRunDescription)

-- | The unique run identifier associated with this run.
dataQualityRulesetEvaluationRunDescription_runId :: Lens.Lens' DataQualityRulesetEvaluationRunDescription (Prelude.Maybe Prelude.Text)
dataQualityRulesetEvaluationRunDescription_runId :: Lens' DataQualityRulesetEvaluationRunDescription (Maybe Text)
dataQualityRulesetEvaluationRunDescription_runId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityRulesetEvaluationRunDescription' {Maybe Text
runId :: Maybe Text
$sel:runId:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe Text
runId} -> Maybe Text
runId) (\s :: DataQualityRulesetEvaluationRunDescription
s@DataQualityRulesetEvaluationRunDescription' {} Maybe Text
a -> DataQualityRulesetEvaluationRunDescription
s {$sel:runId:DataQualityRulesetEvaluationRunDescription' :: Maybe Text
runId = Maybe Text
a} :: DataQualityRulesetEvaluationRunDescription)

-- | The date and time when the run started.
dataQualityRulesetEvaluationRunDescription_startedOn :: Lens.Lens' DataQualityRulesetEvaluationRunDescription (Prelude.Maybe Prelude.UTCTime)
dataQualityRulesetEvaluationRunDescription_startedOn :: Lens' DataQualityRulesetEvaluationRunDescription (Maybe UTCTime)
dataQualityRulesetEvaluationRunDescription_startedOn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityRulesetEvaluationRunDescription' {Maybe POSIX
startedOn :: Maybe POSIX
$sel:startedOn:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe POSIX
startedOn} -> Maybe POSIX
startedOn) (\s :: DataQualityRulesetEvaluationRunDescription
s@DataQualityRulesetEvaluationRunDescription' {} Maybe POSIX
a -> DataQualityRulesetEvaluationRunDescription
s {$sel:startedOn:DataQualityRulesetEvaluationRunDescription' :: Maybe POSIX
startedOn = Maybe POSIX
a} :: DataQualityRulesetEvaluationRunDescription) 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 status for this run.
dataQualityRulesetEvaluationRunDescription_status :: Lens.Lens' DataQualityRulesetEvaluationRunDescription (Prelude.Maybe TaskStatusType)
dataQualityRulesetEvaluationRunDescription_status :: Lens'
  DataQualityRulesetEvaluationRunDescription (Maybe TaskStatusType)
dataQualityRulesetEvaluationRunDescription_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityRulesetEvaluationRunDescription' {Maybe TaskStatusType
status :: Maybe TaskStatusType
$sel:status:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe TaskStatusType
status} -> Maybe TaskStatusType
status) (\s :: DataQualityRulesetEvaluationRunDescription
s@DataQualityRulesetEvaluationRunDescription' {} Maybe TaskStatusType
a -> DataQualityRulesetEvaluationRunDescription
s {$sel:status:DataQualityRulesetEvaluationRunDescription' :: Maybe TaskStatusType
status = Maybe TaskStatusType
a} :: DataQualityRulesetEvaluationRunDescription)

instance
  Data.FromJSON
    DataQualityRulesetEvaluationRunDescription
  where
  parseJSON :: Value -> Parser DataQualityRulesetEvaluationRunDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DataQualityRulesetEvaluationRunDescription"
      ( \Object
x ->
          Maybe DataSource
-> Maybe Text
-> Maybe POSIX
-> Maybe TaskStatusType
-> DataQualityRulesetEvaluationRunDescription
DataQualityRulesetEvaluationRunDescription'
            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
"DataSource")
            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
"RunId")
            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
"StartedOn")
            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
"Status")
      )

instance
  Prelude.Hashable
    DataQualityRulesetEvaluationRunDescription
  where
  hashWithSalt :: Int -> DataQualityRulesetEvaluationRunDescription -> Int
hashWithSalt
    Int
_salt
    DataQualityRulesetEvaluationRunDescription' {Maybe Text
Maybe POSIX
Maybe DataSource
Maybe TaskStatusType
status :: Maybe TaskStatusType
startedOn :: Maybe POSIX
runId :: Maybe Text
dataSource :: Maybe DataSource
$sel:status:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe TaskStatusType
$sel:startedOn:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe POSIX
$sel:runId:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe Text
$sel:dataSource:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe DataSource
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataSource
dataSource
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
runId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startedOn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TaskStatusType
status

instance
  Prelude.NFData
    DataQualityRulesetEvaluationRunDescription
  where
  rnf :: DataQualityRulesetEvaluationRunDescription -> ()
rnf DataQualityRulesetEvaluationRunDescription' {Maybe Text
Maybe POSIX
Maybe DataSource
Maybe TaskStatusType
status :: Maybe TaskStatusType
startedOn :: Maybe POSIX
runId :: Maybe Text
dataSource :: Maybe DataSource
$sel:status:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe TaskStatusType
$sel:startedOn:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe POSIX
$sel:runId:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe Text
$sel:dataSource:DataQualityRulesetEvaluationRunDescription' :: DataQualityRulesetEvaluationRunDescription -> Maybe DataSource
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DataSource
dataSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
runId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startedOn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TaskStatusType
status