{-# 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.CloudWatchLogs.Types.RejectedLogEventsInfo
-- 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.CloudWatchLogs.Types.RejectedLogEventsInfo 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

-- | Represents the rejected events.
--
-- /See:/ 'newRejectedLogEventsInfo' smart constructor.
data RejectedLogEventsInfo = RejectedLogEventsInfo'
  { -- | The expired log events.
    RejectedLogEventsInfo -> Maybe Int
expiredLogEventEndIndex :: Prelude.Maybe Prelude.Int,
    -- | The log events that are too new.
    RejectedLogEventsInfo -> Maybe Int
tooNewLogEventStartIndex :: Prelude.Maybe Prelude.Int,
    -- | The log events that are dated too far in the past.
    RejectedLogEventsInfo -> Maybe Int
tooOldLogEventEndIndex :: Prelude.Maybe Prelude.Int
  }
  deriving (RejectedLogEventsInfo -> RejectedLogEventsInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectedLogEventsInfo -> RejectedLogEventsInfo -> Bool
$c/= :: RejectedLogEventsInfo -> RejectedLogEventsInfo -> Bool
== :: RejectedLogEventsInfo -> RejectedLogEventsInfo -> Bool
$c== :: RejectedLogEventsInfo -> RejectedLogEventsInfo -> Bool
Prelude.Eq, ReadPrec [RejectedLogEventsInfo]
ReadPrec RejectedLogEventsInfo
Int -> ReadS RejectedLogEventsInfo
ReadS [RejectedLogEventsInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectedLogEventsInfo]
$creadListPrec :: ReadPrec [RejectedLogEventsInfo]
readPrec :: ReadPrec RejectedLogEventsInfo
$creadPrec :: ReadPrec RejectedLogEventsInfo
readList :: ReadS [RejectedLogEventsInfo]
$creadList :: ReadS [RejectedLogEventsInfo]
readsPrec :: Int -> ReadS RejectedLogEventsInfo
$creadsPrec :: Int -> ReadS RejectedLogEventsInfo
Prelude.Read, Int -> RejectedLogEventsInfo -> ShowS
[RejectedLogEventsInfo] -> ShowS
RejectedLogEventsInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectedLogEventsInfo] -> ShowS
$cshowList :: [RejectedLogEventsInfo] -> ShowS
show :: RejectedLogEventsInfo -> String
$cshow :: RejectedLogEventsInfo -> String
showsPrec :: Int -> RejectedLogEventsInfo -> ShowS
$cshowsPrec :: Int -> RejectedLogEventsInfo -> ShowS
Prelude.Show, forall x. Rep RejectedLogEventsInfo x -> RejectedLogEventsInfo
forall x. RejectedLogEventsInfo -> Rep RejectedLogEventsInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RejectedLogEventsInfo x -> RejectedLogEventsInfo
$cfrom :: forall x. RejectedLogEventsInfo -> Rep RejectedLogEventsInfo x
Prelude.Generic)

-- |
-- Create a value of 'RejectedLogEventsInfo' 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:
--
-- 'expiredLogEventEndIndex', 'rejectedLogEventsInfo_expiredLogEventEndIndex' - The expired log events.
--
-- 'tooNewLogEventStartIndex', 'rejectedLogEventsInfo_tooNewLogEventStartIndex' - The log events that are too new.
--
-- 'tooOldLogEventEndIndex', 'rejectedLogEventsInfo_tooOldLogEventEndIndex' - The log events that are dated too far in the past.
newRejectedLogEventsInfo ::
  RejectedLogEventsInfo
newRejectedLogEventsInfo :: RejectedLogEventsInfo
newRejectedLogEventsInfo =
  RejectedLogEventsInfo'
    { $sel:expiredLogEventEndIndex:RejectedLogEventsInfo' :: Maybe Int
expiredLogEventEndIndex =
        forall a. Maybe a
Prelude.Nothing,
      $sel:tooNewLogEventStartIndex:RejectedLogEventsInfo' :: Maybe Int
tooNewLogEventStartIndex = forall a. Maybe a
Prelude.Nothing,
      $sel:tooOldLogEventEndIndex:RejectedLogEventsInfo' :: Maybe Int
tooOldLogEventEndIndex = forall a. Maybe a
Prelude.Nothing
    }

-- | The expired log events.
rejectedLogEventsInfo_expiredLogEventEndIndex :: Lens.Lens' RejectedLogEventsInfo (Prelude.Maybe Prelude.Int)
rejectedLogEventsInfo_expiredLogEventEndIndex :: Lens' RejectedLogEventsInfo (Maybe Int)
rejectedLogEventsInfo_expiredLogEventEndIndex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectedLogEventsInfo' {Maybe Int
expiredLogEventEndIndex :: Maybe Int
$sel:expiredLogEventEndIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
expiredLogEventEndIndex} -> Maybe Int
expiredLogEventEndIndex) (\s :: RejectedLogEventsInfo
s@RejectedLogEventsInfo' {} Maybe Int
a -> RejectedLogEventsInfo
s {$sel:expiredLogEventEndIndex:RejectedLogEventsInfo' :: Maybe Int
expiredLogEventEndIndex = Maybe Int
a} :: RejectedLogEventsInfo)

-- | The log events that are too new.
rejectedLogEventsInfo_tooNewLogEventStartIndex :: Lens.Lens' RejectedLogEventsInfo (Prelude.Maybe Prelude.Int)
rejectedLogEventsInfo_tooNewLogEventStartIndex :: Lens' RejectedLogEventsInfo (Maybe Int)
rejectedLogEventsInfo_tooNewLogEventStartIndex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectedLogEventsInfo' {Maybe Int
tooNewLogEventStartIndex :: Maybe Int
$sel:tooNewLogEventStartIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
tooNewLogEventStartIndex} -> Maybe Int
tooNewLogEventStartIndex) (\s :: RejectedLogEventsInfo
s@RejectedLogEventsInfo' {} Maybe Int
a -> RejectedLogEventsInfo
s {$sel:tooNewLogEventStartIndex:RejectedLogEventsInfo' :: Maybe Int
tooNewLogEventStartIndex = Maybe Int
a} :: RejectedLogEventsInfo)

-- | The log events that are dated too far in the past.
rejectedLogEventsInfo_tooOldLogEventEndIndex :: Lens.Lens' RejectedLogEventsInfo (Prelude.Maybe Prelude.Int)
rejectedLogEventsInfo_tooOldLogEventEndIndex :: Lens' RejectedLogEventsInfo (Maybe Int)
rejectedLogEventsInfo_tooOldLogEventEndIndex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectedLogEventsInfo' {Maybe Int
tooOldLogEventEndIndex :: Maybe Int
$sel:tooOldLogEventEndIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
tooOldLogEventEndIndex} -> Maybe Int
tooOldLogEventEndIndex) (\s :: RejectedLogEventsInfo
s@RejectedLogEventsInfo' {} Maybe Int
a -> RejectedLogEventsInfo
s {$sel:tooOldLogEventEndIndex:RejectedLogEventsInfo' :: Maybe Int
tooOldLogEventEndIndex = Maybe Int
a} :: RejectedLogEventsInfo)

instance Data.FromJSON RejectedLogEventsInfo where
  parseJSON :: Value -> Parser RejectedLogEventsInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RejectedLogEventsInfo"
      ( \Object
x ->
          Maybe Int -> Maybe Int -> Maybe Int -> RejectedLogEventsInfo
RejectedLogEventsInfo'
            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
"expiredLogEventEndIndex")
            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
"tooNewLogEventStartIndex")
            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
"tooOldLogEventEndIndex")
      )

instance Prelude.Hashable RejectedLogEventsInfo where
  hashWithSalt :: Int -> RejectedLogEventsInfo -> Int
hashWithSalt Int
_salt RejectedLogEventsInfo' {Maybe Int
tooOldLogEventEndIndex :: Maybe Int
tooNewLogEventStartIndex :: Maybe Int
expiredLogEventEndIndex :: Maybe Int
$sel:tooOldLogEventEndIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
$sel:tooNewLogEventStartIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
$sel:expiredLogEventEndIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
expiredLogEventEndIndex
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
tooNewLogEventStartIndex
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
tooOldLogEventEndIndex

instance Prelude.NFData RejectedLogEventsInfo where
  rnf :: RejectedLogEventsInfo -> ()
rnf RejectedLogEventsInfo' {Maybe Int
tooOldLogEventEndIndex :: Maybe Int
tooNewLogEventStartIndex :: Maybe Int
expiredLogEventEndIndex :: Maybe Int
$sel:tooOldLogEventEndIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
$sel:tooNewLogEventStartIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
$sel:expiredLogEventEndIndex:RejectedLogEventsInfo' :: RejectedLogEventsInfo -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
expiredLogEventEndIndex
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
tooNewLogEventStartIndex
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
tooOldLogEventEndIndex