{-# 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.SecurityHub.Types.PatchSummary
-- 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.SecurityHub.Types.PatchSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides an overview of the patch compliance status for an instance
-- against a selected compliance standard.
--
-- /See:/ 'newPatchSummary' smart constructor.
data PatchSummary = PatchSummary'
  { -- | Indicates when the operation completed.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    PatchSummary -> Maybe Text
operationEndTime :: Prelude.Maybe Prelude.Text,
    -- | The reboot option specified for the instance.
    PatchSummary -> Maybe Text
rebootOption :: Prelude.Maybe Prelude.Text,
    -- | The type of patch operation performed. For Patch Manager, the values are
    -- @SCAN@ and @INSTALL@.
    PatchSummary -> Maybe Text
operation :: Prelude.Maybe Prelude.Text,
    -- | The number of patches that are installed but are also on a list of
    -- patches that the customer rejected.
    PatchSummary -> Maybe Int
installedRejectedCount :: Prelude.Maybe Prelude.Int,
    -- | The number of patches from the compliance standard that failed to
    -- install.
    PatchSummary -> Maybe Int
failedCount :: Prelude.Maybe Prelude.Int,
    -- | The number of installed patches that are not part of the compliance
    -- standard.
    PatchSummary -> Maybe Int
installedOtherCount :: Prelude.Maybe Prelude.Int,
    -- | The number of patches that are part of the compliance standard but are
    -- not installed. The count includes patches that failed to install.
    PatchSummary -> Maybe Int
missingCount :: Prelude.Maybe Prelude.Int,
    -- | Indicates when the operation started.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    PatchSummary -> Maybe Text
operationStartTime :: Prelude.Maybe Prelude.Text,
    -- | The number of patches from the compliance standard that were installed
    -- successfully.
    PatchSummary -> Maybe Int
installedCount :: Prelude.Maybe Prelude.Int,
    -- | The number of patches that were applied, but that require the instance
    -- to be rebooted in order to be marked as installed.
    PatchSummary -> Maybe Int
installedPendingReboot :: Prelude.Maybe Prelude.Int,
    -- | The identifier of the compliance standard that was used to determine the
    -- patch compliance status.
    PatchSummary -> Text
id :: Prelude.Text
  }
  deriving (PatchSummary -> PatchSummary -> Bool
(PatchSummary -> PatchSummary -> Bool)
-> (PatchSummary -> PatchSummary -> Bool) -> Eq PatchSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PatchSummary -> PatchSummary -> Bool
$c/= :: PatchSummary -> PatchSummary -> Bool
== :: PatchSummary -> PatchSummary -> Bool
$c== :: PatchSummary -> PatchSummary -> Bool
Prelude.Eq, ReadPrec [PatchSummary]
ReadPrec PatchSummary
Int -> ReadS PatchSummary
ReadS [PatchSummary]
(Int -> ReadS PatchSummary)
-> ReadS [PatchSummary]
-> ReadPrec PatchSummary
-> ReadPrec [PatchSummary]
-> Read PatchSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PatchSummary]
$creadListPrec :: ReadPrec [PatchSummary]
readPrec :: ReadPrec PatchSummary
$creadPrec :: ReadPrec PatchSummary
readList :: ReadS [PatchSummary]
$creadList :: ReadS [PatchSummary]
readsPrec :: Int -> ReadS PatchSummary
$creadsPrec :: Int -> ReadS PatchSummary
Prelude.Read, Int -> PatchSummary -> ShowS
[PatchSummary] -> ShowS
PatchSummary -> String
(Int -> PatchSummary -> ShowS)
-> (PatchSummary -> String)
-> ([PatchSummary] -> ShowS)
-> Show PatchSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PatchSummary] -> ShowS
$cshowList :: [PatchSummary] -> ShowS
show :: PatchSummary -> String
$cshow :: PatchSummary -> String
showsPrec :: Int -> PatchSummary -> ShowS
$cshowsPrec :: Int -> PatchSummary -> ShowS
Prelude.Show, (forall x. PatchSummary -> Rep PatchSummary x)
-> (forall x. Rep PatchSummary x -> PatchSummary)
-> Generic PatchSummary
forall x. Rep PatchSummary x -> PatchSummary
forall x. PatchSummary -> Rep PatchSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PatchSummary x -> PatchSummary
$cfrom :: forall x. PatchSummary -> Rep PatchSummary x
Prelude.Generic)

-- |
-- Create a value of 'PatchSummary' 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:
--
-- 'operationEndTime', 'patchSummary_operationEndTime' - Indicates when the operation completed.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'rebootOption', 'patchSummary_rebootOption' - The reboot option specified for the instance.
--
-- 'operation', 'patchSummary_operation' - The type of patch operation performed. For Patch Manager, the values are
-- @SCAN@ and @INSTALL@.
--
-- 'installedRejectedCount', 'patchSummary_installedRejectedCount' - The number of patches that are installed but are also on a list of
-- patches that the customer rejected.
--
-- 'failedCount', 'patchSummary_failedCount' - The number of patches from the compliance standard that failed to
-- install.
--
-- 'installedOtherCount', 'patchSummary_installedOtherCount' - The number of installed patches that are not part of the compliance
-- standard.
--
-- 'missingCount', 'patchSummary_missingCount' - The number of patches that are part of the compliance standard but are
-- not installed. The count includes patches that failed to install.
--
-- 'operationStartTime', 'patchSummary_operationStartTime' - Indicates when the operation started.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'installedCount', 'patchSummary_installedCount' - The number of patches from the compliance standard that were installed
-- successfully.
--
-- 'installedPendingReboot', 'patchSummary_installedPendingReboot' - The number of patches that were applied, but that require the instance
-- to be rebooted in order to be marked as installed.
--
-- 'id', 'patchSummary_id' - The identifier of the compliance standard that was used to determine the
-- patch compliance status.
newPatchSummary ::
  -- | 'id'
  Prelude.Text ->
  PatchSummary
newPatchSummary :: Text -> PatchSummary
newPatchSummary Text
pId_ =
  PatchSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Text
-> PatchSummary
PatchSummary'
    { $sel:operationEndTime:PatchSummary' :: Maybe Text
operationEndTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:rebootOption:PatchSummary' :: Maybe Text
rebootOption = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operation:PatchSummary' :: Maybe Text
operation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:installedRejectedCount:PatchSummary' :: Maybe Int
installedRejectedCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:failedCount:PatchSummary' :: Maybe Int
failedCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:installedOtherCount:PatchSummary' :: Maybe Int
installedOtherCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:missingCount:PatchSummary' :: Maybe Int
missingCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:operationStartTime:PatchSummary' :: Maybe Text
operationStartTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:installedCount:PatchSummary' :: Maybe Int
installedCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:installedPendingReboot:PatchSummary' :: Maybe Int
installedPendingReboot = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:id:PatchSummary' :: Text
id = Text
pId_
    }

-- | Indicates when the operation completed.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
patchSummary_operationEndTime :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Text)
patchSummary_operationEndTime :: (Maybe Text -> f (Maybe Text)) -> PatchSummary -> f PatchSummary
patchSummary_operationEndTime = (PatchSummary -> Maybe Text)
-> (PatchSummary -> Maybe Text -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Text
operationEndTime :: Maybe Text
$sel:operationEndTime:PatchSummary' :: PatchSummary -> Maybe Text
operationEndTime} -> Maybe Text
operationEndTime) (\s :: PatchSummary
s@PatchSummary' {} Maybe Text
a -> PatchSummary
s {$sel:operationEndTime:PatchSummary' :: Maybe Text
operationEndTime = Maybe Text
a} :: PatchSummary)

-- | The reboot option specified for the instance.
patchSummary_rebootOption :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Text)
patchSummary_rebootOption :: (Maybe Text -> f (Maybe Text)) -> PatchSummary -> f PatchSummary
patchSummary_rebootOption = (PatchSummary -> Maybe Text)
-> (PatchSummary -> Maybe Text -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Text
rebootOption :: Maybe Text
$sel:rebootOption:PatchSummary' :: PatchSummary -> Maybe Text
rebootOption} -> Maybe Text
rebootOption) (\s :: PatchSummary
s@PatchSummary' {} Maybe Text
a -> PatchSummary
s {$sel:rebootOption:PatchSummary' :: Maybe Text
rebootOption = Maybe Text
a} :: PatchSummary)

-- | The type of patch operation performed. For Patch Manager, the values are
-- @SCAN@ and @INSTALL@.
patchSummary_operation :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Text)
patchSummary_operation :: (Maybe Text -> f (Maybe Text)) -> PatchSummary -> f PatchSummary
patchSummary_operation = (PatchSummary -> Maybe Text)
-> (PatchSummary -> Maybe Text -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Text
operation :: Maybe Text
$sel:operation:PatchSummary' :: PatchSummary -> Maybe Text
operation} -> Maybe Text
operation) (\s :: PatchSummary
s@PatchSummary' {} Maybe Text
a -> PatchSummary
s {$sel:operation:PatchSummary' :: Maybe Text
operation = Maybe Text
a} :: PatchSummary)

-- | The number of patches that are installed but are also on a list of
-- patches that the customer rejected.
patchSummary_installedRejectedCount :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Int)
patchSummary_installedRejectedCount :: (Maybe Int -> f (Maybe Int)) -> PatchSummary -> f PatchSummary
patchSummary_installedRejectedCount = (PatchSummary -> Maybe Int)
-> (PatchSummary -> Maybe Int -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Int
installedRejectedCount :: Maybe Int
$sel:installedRejectedCount:PatchSummary' :: PatchSummary -> Maybe Int
installedRejectedCount} -> Maybe Int
installedRejectedCount) (\s :: PatchSummary
s@PatchSummary' {} Maybe Int
a -> PatchSummary
s {$sel:installedRejectedCount:PatchSummary' :: Maybe Int
installedRejectedCount = Maybe Int
a} :: PatchSummary)

-- | The number of patches from the compliance standard that failed to
-- install.
patchSummary_failedCount :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Int)
patchSummary_failedCount :: (Maybe Int -> f (Maybe Int)) -> PatchSummary -> f PatchSummary
patchSummary_failedCount = (PatchSummary -> Maybe Int)
-> (PatchSummary -> Maybe Int -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Int
failedCount :: Maybe Int
$sel:failedCount:PatchSummary' :: PatchSummary -> Maybe Int
failedCount} -> Maybe Int
failedCount) (\s :: PatchSummary
s@PatchSummary' {} Maybe Int
a -> PatchSummary
s {$sel:failedCount:PatchSummary' :: Maybe Int
failedCount = Maybe Int
a} :: PatchSummary)

-- | The number of installed patches that are not part of the compliance
-- standard.
patchSummary_installedOtherCount :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Int)
patchSummary_installedOtherCount :: (Maybe Int -> f (Maybe Int)) -> PatchSummary -> f PatchSummary
patchSummary_installedOtherCount = (PatchSummary -> Maybe Int)
-> (PatchSummary -> Maybe Int -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Int
installedOtherCount :: Maybe Int
$sel:installedOtherCount:PatchSummary' :: PatchSummary -> Maybe Int
installedOtherCount} -> Maybe Int
installedOtherCount) (\s :: PatchSummary
s@PatchSummary' {} Maybe Int
a -> PatchSummary
s {$sel:installedOtherCount:PatchSummary' :: Maybe Int
installedOtherCount = Maybe Int
a} :: PatchSummary)

-- | The number of patches that are part of the compliance standard but are
-- not installed. The count includes patches that failed to install.
patchSummary_missingCount :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Int)
patchSummary_missingCount :: (Maybe Int -> f (Maybe Int)) -> PatchSummary -> f PatchSummary
patchSummary_missingCount = (PatchSummary -> Maybe Int)
-> (PatchSummary -> Maybe Int -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Int
missingCount :: Maybe Int
$sel:missingCount:PatchSummary' :: PatchSummary -> Maybe Int
missingCount} -> Maybe Int
missingCount) (\s :: PatchSummary
s@PatchSummary' {} Maybe Int
a -> PatchSummary
s {$sel:missingCount:PatchSummary' :: Maybe Int
missingCount = Maybe Int
a} :: PatchSummary)

-- | Indicates when the operation started.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
patchSummary_operationStartTime :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Text)
patchSummary_operationStartTime :: (Maybe Text -> f (Maybe Text)) -> PatchSummary -> f PatchSummary
patchSummary_operationStartTime = (PatchSummary -> Maybe Text)
-> (PatchSummary -> Maybe Text -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Text
operationStartTime :: Maybe Text
$sel:operationStartTime:PatchSummary' :: PatchSummary -> Maybe Text
operationStartTime} -> Maybe Text
operationStartTime) (\s :: PatchSummary
s@PatchSummary' {} Maybe Text
a -> PatchSummary
s {$sel:operationStartTime:PatchSummary' :: Maybe Text
operationStartTime = Maybe Text
a} :: PatchSummary)

-- | The number of patches from the compliance standard that were installed
-- successfully.
patchSummary_installedCount :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Int)
patchSummary_installedCount :: (Maybe Int -> f (Maybe Int)) -> PatchSummary -> f PatchSummary
patchSummary_installedCount = (PatchSummary -> Maybe Int)
-> (PatchSummary -> Maybe Int -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Int
installedCount :: Maybe Int
$sel:installedCount:PatchSummary' :: PatchSummary -> Maybe Int
installedCount} -> Maybe Int
installedCount) (\s :: PatchSummary
s@PatchSummary' {} Maybe Int
a -> PatchSummary
s {$sel:installedCount:PatchSummary' :: Maybe Int
installedCount = Maybe Int
a} :: PatchSummary)

-- | The number of patches that were applied, but that require the instance
-- to be rebooted in order to be marked as installed.
patchSummary_installedPendingReboot :: Lens.Lens' PatchSummary (Prelude.Maybe Prelude.Int)
patchSummary_installedPendingReboot :: (Maybe Int -> f (Maybe Int)) -> PatchSummary -> f PatchSummary
patchSummary_installedPendingReboot = (PatchSummary -> Maybe Int)
-> (PatchSummary -> Maybe Int -> PatchSummary)
-> Lens PatchSummary PatchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Maybe Int
installedPendingReboot :: Maybe Int
$sel:installedPendingReboot:PatchSummary' :: PatchSummary -> Maybe Int
installedPendingReboot} -> Maybe Int
installedPendingReboot) (\s :: PatchSummary
s@PatchSummary' {} Maybe Int
a -> PatchSummary
s {$sel:installedPendingReboot:PatchSummary' :: Maybe Int
installedPendingReboot = Maybe Int
a} :: PatchSummary)

-- | The identifier of the compliance standard that was used to determine the
-- patch compliance status.
patchSummary_id :: Lens.Lens' PatchSummary Prelude.Text
patchSummary_id :: (Text -> f Text) -> PatchSummary -> f PatchSummary
patchSummary_id = (PatchSummary -> Text)
-> (PatchSummary -> Text -> PatchSummary)
-> Lens PatchSummary PatchSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PatchSummary' {Text
id :: Text
$sel:id:PatchSummary' :: PatchSummary -> Text
id} -> Text
id) (\s :: PatchSummary
s@PatchSummary' {} Text
a -> PatchSummary
s {$sel:id:PatchSummary' :: Text
id = Text
a} :: PatchSummary)

instance Core.FromJSON PatchSummary where
  parseJSON :: Value -> Parser PatchSummary
parseJSON =
    String
-> (Object -> Parser PatchSummary) -> Value -> Parser PatchSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PatchSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Text
-> PatchSummary
PatchSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Text
 -> PatchSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> PatchSummary)
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
"OperationEndTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> PatchSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> PatchSummary)
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
"RebootOption")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> PatchSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> PatchSummary)
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
"Operation")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> PatchSummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> PatchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstalledRejectedCount")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> PatchSummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> PatchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailedCount")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> PatchSummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text -> Maybe Int -> Maybe Int -> Text -> PatchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstalledOtherCount")
            Parser
  (Maybe Int
   -> Maybe Text -> Maybe Int -> Maybe Int -> Text -> PatchSummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text -> Maybe Int -> Maybe Int -> Text -> PatchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MissingCount")
            Parser
  (Maybe Text -> Maybe Int -> Maybe Int -> Text -> PatchSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Int -> Text -> PatchSummary)
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
"OperationStartTime")
            Parser (Maybe Int -> Maybe Int -> Text -> PatchSummary)
-> Parser (Maybe Int) -> Parser (Maybe Int -> Text -> PatchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstalledCount")
            Parser (Maybe Int -> Text -> PatchSummary)
-> Parser (Maybe Int) -> Parser (Text -> PatchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstalledPendingReboot")
            Parser (Text -> PatchSummary) -> Parser Text -> Parser PatchSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
      )

instance Prelude.Hashable PatchSummary

instance Prelude.NFData PatchSummary

instance Core.ToJSON PatchSummary where
  toJSON :: PatchSummary -> Value
toJSON PatchSummary' {Maybe Int
Maybe Text
Text
id :: Text
installedPendingReboot :: Maybe Int
installedCount :: Maybe Int
operationStartTime :: Maybe Text
missingCount :: Maybe Int
installedOtherCount :: Maybe Int
failedCount :: Maybe Int
installedRejectedCount :: Maybe Int
operation :: Maybe Text
rebootOption :: Maybe Text
operationEndTime :: Maybe Text
$sel:id:PatchSummary' :: PatchSummary -> Text
$sel:installedPendingReboot:PatchSummary' :: PatchSummary -> Maybe Int
$sel:installedCount:PatchSummary' :: PatchSummary -> Maybe Int
$sel:operationStartTime:PatchSummary' :: PatchSummary -> Maybe Text
$sel:missingCount:PatchSummary' :: PatchSummary -> Maybe Int
$sel:installedOtherCount:PatchSummary' :: PatchSummary -> Maybe Int
$sel:failedCount:PatchSummary' :: PatchSummary -> Maybe Int
$sel:installedRejectedCount:PatchSummary' :: PatchSummary -> Maybe Int
$sel:operation:PatchSummary' :: PatchSummary -> Maybe Text
$sel:rebootOption:PatchSummary' :: PatchSummary -> Maybe Text
$sel:operationEndTime:PatchSummary' :: PatchSummary -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"OperationEndTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
operationEndTime,
            (Text
"RebootOption" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rebootOption,
            (Text
"Operation" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
operation,
            (Text
"InstalledRejectedCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
installedRejectedCount,
            (Text
"FailedCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
failedCount,
            (Text
"InstalledOtherCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
installedOtherCount,
            (Text
"MissingCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
missingCount,
            (Text
"OperationStartTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
operationStartTime,
            (Text
"InstalledCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
installedCount,
            (Text
"InstalledPendingReboot" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
installedPendingReboot,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
          ]
      )