{-# 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.LookoutEquipment.Types.LargeTimestampGaps
-- 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.LookoutEquipment.Types.LargeTimestampGaps where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutEquipment.Types.StatisticalIssueStatus
import qualified Amazonka.Prelude as Prelude

-- | Entity that comprises information on large gaps between consecutive
-- timestamps in data.
--
-- /See:/ 'newLargeTimestampGaps' smart constructor.
data LargeTimestampGaps = LargeTimestampGaps'
  { -- | Indicates the size of the largest timestamp gap, in days.
    LargeTimestampGaps -> Maybe Int
maxTimestampGapInDays :: Prelude.Maybe Prelude.Int,
    -- | Indicates the number of large timestamp gaps, if there are any.
    LargeTimestampGaps -> Maybe Int
numberOfLargeTimestampGaps :: Prelude.Maybe Prelude.Int,
    -- | Indicates whether there is a potential data issue related to large gaps
    -- in timestamps.
    LargeTimestampGaps -> StatisticalIssueStatus
status :: StatisticalIssueStatus
  }
  deriving (LargeTimestampGaps -> LargeTimestampGaps -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LargeTimestampGaps -> LargeTimestampGaps -> Bool
$c/= :: LargeTimestampGaps -> LargeTimestampGaps -> Bool
== :: LargeTimestampGaps -> LargeTimestampGaps -> Bool
$c== :: LargeTimestampGaps -> LargeTimestampGaps -> Bool
Prelude.Eq, ReadPrec [LargeTimestampGaps]
ReadPrec LargeTimestampGaps
Int -> ReadS LargeTimestampGaps
ReadS [LargeTimestampGaps]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LargeTimestampGaps]
$creadListPrec :: ReadPrec [LargeTimestampGaps]
readPrec :: ReadPrec LargeTimestampGaps
$creadPrec :: ReadPrec LargeTimestampGaps
readList :: ReadS [LargeTimestampGaps]
$creadList :: ReadS [LargeTimestampGaps]
readsPrec :: Int -> ReadS LargeTimestampGaps
$creadsPrec :: Int -> ReadS LargeTimestampGaps
Prelude.Read, Int -> LargeTimestampGaps -> ShowS
[LargeTimestampGaps] -> ShowS
LargeTimestampGaps -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LargeTimestampGaps] -> ShowS
$cshowList :: [LargeTimestampGaps] -> ShowS
show :: LargeTimestampGaps -> String
$cshow :: LargeTimestampGaps -> String
showsPrec :: Int -> LargeTimestampGaps -> ShowS
$cshowsPrec :: Int -> LargeTimestampGaps -> ShowS
Prelude.Show, forall x. Rep LargeTimestampGaps x -> LargeTimestampGaps
forall x. LargeTimestampGaps -> Rep LargeTimestampGaps x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LargeTimestampGaps x -> LargeTimestampGaps
$cfrom :: forall x. LargeTimestampGaps -> Rep LargeTimestampGaps x
Prelude.Generic)

-- |
-- Create a value of 'LargeTimestampGaps' 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:
--
-- 'maxTimestampGapInDays', 'largeTimestampGaps_maxTimestampGapInDays' - Indicates the size of the largest timestamp gap, in days.
--
-- 'numberOfLargeTimestampGaps', 'largeTimestampGaps_numberOfLargeTimestampGaps' - Indicates the number of large timestamp gaps, if there are any.
--
-- 'status', 'largeTimestampGaps_status' - Indicates whether there is a potential data issue related to large gaps
-- in timestamps.
newLargeTimestampGaps ::
  -- | 'status'
  StatisticalIssueStatus ->
  LargeTimestampGaps
newLargeTimestampGaps :: StatisticalIssueStatus -> LargeTimestampGaps
newLargeTimestampGaps StatisticalIssueStatus
pStatus_ =
  LargeTimestampGaps'
    { $sel:maxTimestampGapInDays:LargeTimestampGaps' :: Maybe Int
maxTimestampGapInDays =
        forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfLargeTimestampGaps:LargeTimestampGaps' :: Maybe Int
numberOfLargeTimestampGaps = forall a. Maybe a
Prelude.Nothing,
      $sel:status:LargeTimestampGaps' :: StatisticalIssueStatus
status = StatisticalIssueStatus
pStatus_
    }

-- | Indicates the size of the largest timestamp gap, in days.
largeTimestampGaps_maxTimestampGapInDays :: Lens.Lens' LargeTimestampGaps (Prelude.Maybe Prelude.Int)
largeTimestampGaps_maxTimestampGapInDays :: Lens' LargeTimestampGaps (Maybe Int)
largeTimestampGaps_maxTimestampGapInDays = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LargeTimestampGaps' {Maybe Int
maxTimestampGapInDays :: Maybe Int
$sel:maxTimestampGapInDays:LargeTimestampGaps' :: LargeTimestampGaps -> Maybe Int
maxTimestampGapInDays} -> Maybe Int
maxTimestampGapInDays) (\s :: LargeTimestampGaps
s@LargeTimestampGaps' {} Maybe Int
a -> LargeTimestampGaps
s {$sel:maxTimestampGapInDays:LargeTimestampGaps' :: Maybe Int
maxTimestampGapInDays = Maybe Int
a} :: LargeTimestampGaps)

-- | Indicates the number of large timestamp gaps, if there are any.
largeTimestampGaps_numberOfLargeTimestampGaps :: Lens.Lens' LargeTimestampGaps (Prelude.Maybe Prelude.Int)
largeTimestampGaps_numberOfLargeTimestampGaps :: Lens' LargeTimestampGaps (Maybe Int)
largeTimestampGaps_numberOfLargeTimestampGaps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LargeTimestampGaps' {Maybe Int
numberOfLargeTimestampGaps :: Maybe Int
$sel:numberOfLargeTimestampGaps:LargeTimestampGaps' :: LargeTimestampGaps -> Maybe Int
numberOfLargeTimestampGaps} -> Maybe Int
numberOfLargeTimestampGaps) (\s :: LargeTimestampGaps
s@LargeTimestampGaps' {} Maybe Int
a -> LargeTimestampGaps
s {$sel:numberOfLargeTimestampGaps:LargeTimestampGaps' :: Maybe Int
numberOfLargeTimestampGaps = Maybe Int
a} :: LargeTimestampGaps)

-- | Indicates whether there is a potential data issue related to large gaps
-- in timestamps.
largeTimestampGaps_status :: Lens.Lens' LargeTimestampGaps StatisticalIssueStatus
largeTimestampGaps_status :: Lens' LargeTimestampGaps StatisticalIssueStatus
largeTimestampGaps_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LargeTimestampGaps' {StatisticalIssueStatus
status :: StatisticalIssueStatus
$sel:status:LargeTimestampGaps' :: LargeTimestampGaps -> StatisticalIssueStatus
status} -> StatisticalIssueStatus
status) (\s :: LargeTimestampGaps
s@LargeTimestampGaps' {} StatisticalIssueStatus
a -> LargeTimestampGaps
s {$sel:status:LargeTimestampGaps' :: StatisticalIssueStatus
status = StatisticalIssueStatus
a} :: LargeTimestampGaps)

instance Data.FromJSON LargeTimestampGaps where
  parseJSON :: Value -> Parser LargeTimestampGaps
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LargeTimestampGaps"
      ( \Object
x ->
          Maybe Int
-> Maybe Int -> StatisticalIssueStatus -> LargeTimestampGaps
LargeTimestampGaps'
            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
"MaxTimestampGapInDays")
            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
"NumberOfLargeTimestampGaps")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
      )

instance Prelude.Hashable LargeTimestampGaps where
  hashWithSalt :: Int -> LargeTimestampGaps -> Int
hashWithSalt Int
_salt LargeTimestampGaps' {Maybe Int
StatisticalIssueStatus
status :: StatisticalIssueStatus
numberOfLargeTimestampGaps :: Maybe Int
maxTimestampGapInDays :: Maybe Int
$sel:status:LargeTimestampGaps' :: LargeTimestampGaps -> StatisticalIssueStatus
$sel:numberOfLargeTimestampGaps:LargeTimestampGaps' :: LargeTimestampGaps -> Maybe Int
$sel:maxTimestampGapInDays:LargeTimestampGaps' :: LargeTimestampGaps -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxTimestampGapInDays
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfLargeTimestampGaps
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StatisticalIssueStatus
status

instance Prelude.NFData LargeTimestampGaps where
  rnf :: LargeTimestampGaps -> ()
rnf LargeTimestampGaps' {Maybe Int
StatisticalIssueStatus
status :: StatisticalIssueStatus
numberOfLargeTimestampGaps :: Maybe Int
maxTimestampGapInDays :: Maybe Int
$sel:status:LargeTimestampGaps' :: LargeTimestampGaps -> StatisticalIssueStatus
$sel:numberOfLargeTimestampGaps:LargeTimestampGaps' :: LargeTimestampGaps -> Maybe Int
$sel:maxTimestampGapInDays:LargeTimestampGaps' :: LargeTimestampGaps -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxTimestampGapInDays
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfLargeTimestampGaps
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StatisticalIssueStatus
status