{-# 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.SSM.Types.OpsItemEventSummary
-- 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.SSM.Types.OpsItemEventSummary 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
import Amazonka.SSM.Types.OpsItemIdentity

-- | Summary information about an OpsItem event or that associated an OpsItem
-- with a related item.
--
-- /See:/ 'newOpsItemEventSummary' smart constructor.
data OpsItemEventSummary = OpsItemEventSummary'
  { -- | Information about the user or resource that created the OpsItem event.
    OpsItemEventSummary -> Maybe OpsItemIdentity
createdBy :: Prelude.Maybe OpsItemIdentity,
    -- | The date and time the OpsItem event was created.
    OpsItemEventSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | Specific information about the OpsItem event.
    OpsItemEventSummary -> Maybe Text
detail :: Prelude.Maybe Prelude.Text,
    -- | The type of information provided as a detail.
    OpsItemEventSummary -> Maybe Text
detailType :: Prelude.Maybe Prelude.Text,
    -- | The ID of the OpsItem event.
    OpsItemEventSummary -> Maybe Text
eventId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the OpsItem.
    OpsItemEventSummary -> Maybe Text
opsItemId :: Prelude.Maybe Prelude.Text,
    -- | The source of the OpsItem event.
    OpsItemEventSummary -> Maybe Text
source :: Prelude.Maybe Prelude.Text
  }
  deriving (OpsItemEventSummary -> OpsItemEventSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsItemEventSummary -> OpsItemEventSummary -> Bool
$c/= :: OpsItemEventSummary -> OpsItemEventSummary -> Bool
== :: OpsItemEventSummary -> OpsItemEventSummary -> Bool
$c== :: OpsItemEventSummary -> OpsItemEventSummary -> Bool
Prelude.Eq, ReadPrec [OpsItemEventSummary]
ReadPrec OpsItemEventSummary
Int -> ReadS OpsItemEventSummary
ReadS [OpsItemEventSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsItemEventSummary]
$creadListPrec :: ReadPrec [OpsItemEventSummary]
readPrec :: ReadPrec OpsItemEventSummary
$creadPrec :: ReadPrec OpsItemEventSummary
readList :: ReadS [OpsItemEventSummary]
$creadList :: ReadS [OpsItemEventSummary]
readsPrec :: Int -> ReadS OpsItemEventSummary
$creadsPrec :: Int -> ReadS OpsItemEventSummary
Prelude.Read, Int -> OpsItemEventSummary -> ShowS
[OpsItemEventSummary] -> ShowS
OpsItemEventSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsItemEventSummary] -> ShowS
$cshowList :: [OpsItemEventSummary] -> ShowS
show :: OpsItemEventSummary -> String
$cshow :: OpsItemEventSummary -> String
showsPrec :: Int -> OpsItemEventSummary -> ShowS
$cshowsPrec :: Int -> OpsItemEventSummary -> ShowS
Prelude.Show, forall x. Rep OpsItemEventSummary x -> OpsItemEventSummary
forall x. OpsItemEventSummary -> Rep OpsItemEventSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpsItemEventSummary x -> OpsItemEventSummary
$cfrom :: forall x. OpsItemEventSummary -> Rep OpsItemEventSummary x
Prelude.Generic)

-- |
-- Create a value of 'OpsItemEventSummary' 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:
--
-- 'createdBy', 'opsItemEventSummary_createdBy' - Information about the user or resource that created the OpsItem event.
--
-- 'createdTime', 'opsItemEventSummary_createdTime' - The date and time the OpsItem event was created.
--
-- 'detail', 'opsItemEventSummary_detail' - Specific information about the OpsItem event.
--
-- 'detailType', 'opsItemEventSummary_detailType' - The type of information provided as a detail.
--
-- 'eventId', 'opsItemEventSummary_eventId' - The ID of the OpsItem event.
--
-- 'opsItemId', 'opsItemEventSummary_opsItemId' - The ID of the OpsItem.
--
-- 'source', 'opsItemEventSummary_source' - The source of the OpsItem event.
newOpsItemEventSummary ::
  OpsItemEventSummary
newOpsItemEventSummary :: OpsItemEventSummary
newOpsItemEventSummary =
  OpsItemEventSummary'
    { $sel:createdBy:OpsItemEventSummary' :: Maybe OpsItemIdentity
createdBy = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:OpsItemEventSummary' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:detail:OpsItemEventSummary' :: Maybe Text
detail = forall a. Maybe a
Prelude.Nothing,
      $sel:detailType:OpsItemEventSummary' :: Maybe Text
detailType = forall a. Maybe a
Prelude.Nothing,
      $sel:eventId:OpsItemEventSummary' :: Maybe Text
eventId = forall a. Maybe a
Prelude.Nothing,
      $sel:opsItemId:OpsItemEventSummary' :: Maybe Text
opsItemId = forall a. Maybe a
Prelude.Nothing,
      $sel:source:OpsItemEventSummary' :: Maybe Text
source = forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the user or resource that created the OpsItem event.
opsItemEventSummary_createdBy :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe OpsItemIdentity)
opsItemEventSummary_createdBy :: Lens' OpsItemEventSummary (Maybe OpsItemIdentity)
opsItemEventSummary_createdBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe OpsItemIdentity
createdBy :: Maybe OpsItemIdentity
$sel:createdBy:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe OpsItemIdentity
createdBy} -> Maybe OpsItemIdentity
createdBy) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe OpsItemIdentity
a -> OpsItemEventSummary
s {$sel:createdBy:OpsItemEventSummary' :: Maybe OpsItemIdentity
createdBy = Maybe OpsItemIdentity
a} :: OpsItemEventSummary)

-- | The date and time the OpsItem event was created.
opsItemEventSummary_createdTime :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.UTCTime)
opsItemEventSummary_createdTime :: Lens' OpsItemEventSummary (Maybe UTCTime)
opsItemEventSummary_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe POSIX
a -> OpsItemEventSummary
s {$sel:createdTime:OpsItemEventSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: OpsItemEventSummary) 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

-- | Specific information about the OpsItem event.
opsItemEventSummary_detail :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_detail :: Lens' OpsItemEventSummary (Maybe Text)
opsItemEventSummary_detail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe Text
detail :: Maybe Text
$sel:detail:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
detail} -> Maybe Text
detail) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe Text
a -> OpsItemEventSummary
s {$sel:detail:OpsItemEventSummary' :: Maybe Text
detail = Maybe Text
a} :: OpsItemEventSummary)

-- | The type of information provided as a detail.
opsItemEventSummary_detailType :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_detailType :: Lens' OpsItemEventSummary (Maybe Text)
opsItemEventSummary_detailType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe Text
detailType :: Maybe Text
$sel:detailType:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
detailType} -> Maybe Text
detailType) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe Text
a -> OpsItemEventSummary
s {$sel:detailType:OpsItemEventSummary' :: Maybe Text
detailType = Maybe Text
a} :: OpsItemEventSummary)

-- | The ID of the OpsItem event.
opsItemEventSummary_eventId :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_eventId :: Lens' OpsItemEventSummary (Maybe Text)
opsItemEventSummary_eventId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe Text
eventId :: Maybe Text
$sel:eventId:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
eventId} -> Maybe Text
eventId) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe Text
a -> OpsItemEventSummary
s {$sel:eventId:OpsItemEventSummary' :: Maybe Text
eventId = Maybe Text
a} :: OpsItemEventSummary)

-- | The ID of the OpsItem.
opsItemEventSummary_opsItemId :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_opsItemId :: Lens' OpsItemEventSummary (Maybe Text)
opsItemEventSummary_opsItemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe Text
opsItemId :: Maybe Text
$sel:opsItemId:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
opsItemId} -> Maybe Text
opsItemId) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe Text
a -> OpsItemEventSummary
s {$sel:opsItemId:OpsItemEventSummary' :: Maybe Text
opsItemId = Maybe Text
a} :: OpsItemEventSummary)

-- | The source of the OpsItem event.
opsItemEventSummary_source :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_source :: Lens' OpsItemEventSummary (Maybe Text)
opsItemEventSummary_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsItemEventSummary' {Maybe Text
source :: Maybe Text
$sel:source:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
source} -> Maybe Text
source) (\s :: OpsItemEventSummary
s@OpsItemEventSummary' {} Maybe Text
a -> OpsItemEventSummary
s {$sel:source:OpsItemEventSummary' :: Maybe Text
source = Maybe Text
a} :: OpsItemEventSummary)

instance Data.FromJSON OpsItemEventSummary where
  parseJSON :: Value -> Parser OpsItemEventSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OpsItemEventSummary"
      ( \Object
x ->
          Maybe OpsItemIdentity
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OpsItemEventSummary
OpsItemEventSummary'
            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
"CreatedBy")
            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
"Detail")
            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
"DetailType")
            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
"EventId")
            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
"OpsItemId")
            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
"Source")
      )

instance Prelude.Hashable OpsItemEventSummary where
  hashWithSalt :: Int -> OpsItemEventSummary -> Int
hashWithSalt Int
_salt OpsItemEventSummary' {Maybe Text
Maybe POSIX
Maybe OpsItemIdentity
source :: Maybe Text
opsItemId :: Maybe Text
eventId :: Maybe Text
detailType :: Maybe Text
detail :: Maybe Text
createdTime :: Maybe POSIX
createdBy :: Maybe OpsItemIdentity
$sel:source:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:opsItemId:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:eventId:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:detailType:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:detail:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:createdTime:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe POSIX
$sel:createdBy:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe OpsItemIdentity
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OpsItemIdentity
createdBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detailType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
opsItemId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
source

instance Prelude.NFData OpsItemEventSummary where
  rnf :: OpsItemEventSummary -> ()
rnf OpsItemEventSummary' {Maybe Text
Maybe POSIX
Maybe OpsItemIdentity
source :: Maybe Text
opsItemId :: Maybe Text
eventId :: Maybe Text
detailType :: Maybe Text
detail :: Maybe Text
createdTime :: Maybe POSIX
createdBy :: Maybe OpsItemIdentity
$sel:source:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:opsItemId:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:eventId:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:detailType:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:detail:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe Text
$sel:createdTime:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe POSIX
$sel:createdBy:OpsItemEventSummary' :: OpsItemEventSummary -> Maybe OpsItemIdentity
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe OpsItemIdentity
createdBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detailType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
opsItemId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
source