{-# 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-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.SSM.Types.OpsItemEventSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | The ID of the OpsItem.
    OpsItemEventSummary -> Maybe Text
opsItemId :: Prelude.Maybe Prelude.Text,
    -- | The date and time the OpsItem event was created.
    OpsItemEventSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | Information about the user or resource that created the OpsItem event.
    OpsItemEventSummary -> Maybe OpsItemIdentity
createdBy :: Prelude.Maybe OpsItemIdentity,
    -- | The type of information provided as a detail.
    OpsItemEventSummary -> Maybe Text
detailType :: Prelude.Maybe Prelude.Text,
    -- | The source of the OpsItem event.
    OpsItemEventSummary -> Maybe Text
source :: Prelude.Maybe Prelude.Text,
    -- | Specific information about the OpsItem event.
    OpsItemEventSummary -> Maybe Text
detail :: Prelude.Maybe Prelude.Text,
    -- | The ID of the OpsItem event.
    OpsItemEventSummary -> Maybe Text
eventId :: Prelude.Maybe Prelude.Text
  }
  deriving (OpsItemEventSummary -> OpsItemEventSummary -> Bool
(OpsItemEventSummary -> OpsItemEventSummary -> Bool)
-> (OpsItemEventSummary -> OpsItemEventSummary -> Bool)
-> Eq OpsItemEventSummary
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]
(Int -> ReadS OpsItemEventSummary)
-> ReadS [OpsItemEventSummary]
-> ReadPrec OpsItemEventSummary
-> ReadPrec [OpsItemEventSummary]
-> Read 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
(Int -> OpsItemEventSummary -> ShowS)
-> (OpsItemEventSummary -> String)
-> ([OpsItemEventSummary] -> ShowS)
-> Show OpsItemEventSummary
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. OpsItemEventSummary -> Rep OpsItemEventSummary x)
-> (forall x. Rep OpsItemEventSummary x -> OpsItemEventSummary)
-> Generic OpsItemEventSummary
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:
--
-- 'opsItemId', 'opsItemEventSummary_opsItemId' - The ID of the OpsItem.
--
-- 'createdTime', 'opsItemEventSummary_createdTime' - The date and time the OpsItem event was created.
--
-- 'createdBy', 'opsItemEventSummary_createdBy' - Information about the user or resource that created the OpsItem event.
--
-- 'detailType', 'opsItemEventSummary_detailType' - The type of information provided as a detail.
--
-- 'source', 'opsItemEventSummary_source' - The source of the OpsItem event.
--
-- 'detail', 'opsItemEventSummary_detail' - Specific information about the OpsItem event.
--
-- 'eventId', 'opsItemEventSummary_eventId' - The ID of the OpsItem event.
newOpsItemEventSummary ::
  OpsItemEventSummary
newOpsItemEventSummary :: OpsItemEventSummary
newOpsItemEventSummary =
  OpsItemEventSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe OpsItemIdentity
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OpsItemEventSummary
OpsItemEventSummary'
    { $sel:opsItemId:OpsItemEventSummary' :: Maybe Text
opsItemId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:OpsItemEventSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:OpsItemEventSummary' :: Maybe OpsItemIdentity
createdBy = Maybe OpsItemIdentity
forall a. Maybe a
Prelude.Nothing,
      $sel:detailType:OpsItemEventSummary' :: Maybe Text
detailType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:source:OpsItemEventSummary' :: Maybe Text
source = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:detail:OpsItemEventSummary' :: Maybe Text
detail = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventId:OpsItemEventSummary' :: Maybe Text
eventId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the OpsItem.
opsItemEventSummary_opsItemId :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_opsItemId :: (Maybe Text -> f (Maybe Text))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_opsItemId = (OpsItemEventSummary -> Maybe Text)
-> (OpsItemEventSummary -> Maybe Text -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary OpsItemEventSummary (Maybe Text) (Maybe Text)
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 date and time the OpsItem event was created.
opsItemEventSummary_createdTime :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.UTCTime)
opsItemEventSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_createdTime = (OpsItemEventSummary -> Maybe POSIX)
-> (OpsItemEventSummary -> Maybe POSIX -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary OpsItemEventSummary (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> OpsItemEventSummary -> f OpsItemEventSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> OpsItemEventSummary
-> f OpsItemEventSummary
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

-- | Information about the user or resource that created the OpsItem event.
opsItemEventSummary_createdBy :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe OpsItemIdentity)
opsItemEventSummary_createdBy :: (Maybe OpsItemIdentity -> f (Maybe OpsItemIdentity))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_createdBy = (OpsItemEventSummary -> Maybe OpsItemIdentity)
-> (OpsItemEventSummary
    -> Maybe OpsItemIdentity -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary
     OpsItemEventSummary
     (Maybe OpsItemIdentity)
     (Maybe OpsItemIdentity)
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 type of information provided as a detail.
opsItemEventSummary_detailType :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_detailType :: (Maybe Text -> f (Maybe Text))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_detailType = (OpsItemEventSummary -> Maybe Text)
-> (OpsItemEventSummary -> Maybe Text -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary OpsItemEventSummary (Maybe Text) (Maybe Text)
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 source of the OpsItem event.
opsItemEventSummary_source :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_source :: (Maybe Text -> f (Maybe Text))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_source = (OpsItemEventSummary -> Maybe Text)
-> (OpsItemEventSummary -> Maybe Text -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary OpsItemEventSummary (Maybe Text) (Maybe Text)
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)

-- | Specific information about the OpsItem event.
opsItemEventSummary_detail :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_detail :: (Maybe Text -> f (Maybe Text))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_detail = (OpsItemEventSummary -> Maybe Text)
-> (OpsItemEventSummary -> Maybe Text -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary OpsItemEventSummary (Maybe Text) (Maybe Text)
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 ID of the OpsItem event.
opsItemEventSummary_eventId :: Lens.Lens' OpsItemEventSummary (Prelude.Maybe Prelude.Text)
opsItemEventSummary_eventId :: (Maybe Text -> f (Maybe Text))
-> OpsItemEventSummary -> f OpsItemEventSummary
opsItemEventSummary_eventId = (OpsItemEventSummary -> Maybe Text)
-> (OpsItemEventSummary -> Maybe Text -> OpsItemEventSummary)
-> Lens
     OpsItemEventSummary OpsItemEventSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON OpsItemEventSummary where
  parseJSON :: Value -> Parser OpsItemEventSummary
parseJSON =
    String
-> (Object -> Parser OpsItemEventSummary)
-> Value
-> Parser OpsItemEventSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OpsItemEventSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe OpsItemIdentity
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OpsItemEventSummary
OpsItemEventSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe OpsItemIdentity
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> OpsItemEventSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe OpsItemIdentity
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> OpsItemEventSummary)
forall (f :: * -> *) a b. Functor 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
"OpsItemId")
            Parser
  (Maybe POSIX
   -> Maybe OpsItemIdentity
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> OpsItemEventSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe OpsItemIdentity
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> OpsItemEventSummary)
forall (f :: * -> *) a b. Applicative f => 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
"CreatedTime")
            Parser
  (Maybe OpsItemIdentity
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> OpsItemEventSummary)
-> Parser (Maybe OpsItemIdentity)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> OpsItemEventSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OpsItemIdentity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedBy")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> OpsItemEventSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> OpsItemEventSummary)
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
"DetailType")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> OpsItemEventSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> OpsItemEventSummary)
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
"Source")
            Parser (Maybe Text -> Maybe Text -> OpsItemEventSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OpsItemEventSummary)
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
"Detail")
            Parser (Maybe Text -> OpsItemEventSummary)
-> Parser (Maybe Text) -> Parser OpsItemEventSummary
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
"EventId")
      )

instance Prelude.Hashable OpsItemEventSummary

instance Prelude.NFData OpsItemEventSummary