{-# 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.InventoryDeletionSummary
-- 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.InventoryDeletionSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.InventoryDeletionSummaryItem

-- | Information about the delete operation.
--
-- /See:/ 'newInventoryDeletionSummary' smart constructor.
data InventoryDeletionSummary = InventoryDeletionSummary'
  { -- | Remaining number of items to delete.
    InventoryDeletionSummary -> Maybe Int
remainingCount :: Prelude.Maybe Prelude.Int,
    -- | A list of counts and versions for deleted items.
    InventoryDeletionSummary -> Maybe [InventoryDeletionSummaryItem]
summaryItems :: Prelude.Maybe [InventoryDeletionSummaryItem],
    -- | The total number of items to delete. This count doesn\'t change during
    -- the delete operation.
    InventoryDeletionSummary -> Maybe Int
totalCount :: Prelude.Maybe Prelude.Int
  }
  deriving (InventoryDeletionSummary -> InventoryDeletionSummary -> Bool
(InventoryDeletionSummary -> InventoryDeletionSummary -> Bool)
-> (InventoryDeletionSummary -> InventoryDeletionSummary -> Bool)
-> Eq InventoryDeletionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryDeletionSummary -> InventoryDeletionSummary -> Bool
$c/= :: InventoryDeletionSummary -> InventoryDeletionSummary -> Bool
== :: InventoryDeletionSummary -> InventoryDeletionSummary -> Bool
$c== :: InventoryDeletionSummary -> InventoryDeletionSummary -> Bool
Prelude.Eq, ReadPrec [InventoryDeletionSummary]
ReadPrec InventoryDeletionSummary
Int -> ReadS InventoryDeletionSummary
ReadS [InventoryDeletionSummary]
(Int -> ReadS InventoryDeletionSummary)
-> ReadS [InventoryDeletionSummary]
-> ReadPrec InventoryDeletionSummary
-> ReadPrec [InventoryDeletionSummary]
-> Read InventoryDeletionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryDeletionSummary]
$creadListPrec :: ReadPrec [InventoryDeletionSummary]
readPrec :: ReadPrec InventoryDeletionSummary
$creadPrec :: ReadPrec InventoryDeletionSummary
readList :: ReadS [InventoryDeletionSummary]
$creadList :: ReadS [InventoryDeletionSummary]
readsPrec :: Int -> ReadS InventoryDeletionSummary
$creadsPrec :: Int -> ReadS InventoryDeletionSummary
Prelude.Read, Int -> InventoryDeletionSummary -> ShowS
[InventoryDeletionSummary] -> ShowS
InventoryDeletionSummary -> String
(Int -> InventoryDeletionSummary -> ShowS)
-> (InventoryDeletionSummary -> String)
-> ([InventoryDeletionSummary] -> ShowS)
-> Show InventoryDeletionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryDeletionSummary] -> ShowS
$cshowList :: [InventoryDeletionSummary] -> ShowS
show :: InventoryDeletionSummary -> String
$cshow :: InventoryDeletionSummary -> String
showsPrec :: Int -> InventoryDeletionSummary -> ShowS
$cshowsPrec :: Int -> InventoryDeletionSummary -> ShowS
Prelude.Show, (forall x.
 InventoryDeletionSummary -> Rep InventoryDeletionSummary x)
-> (forall x.
    Rep InventoryDeletionSummary x -> InventoryDeletionSummary)
-> Generic InventoryDeletionSummary
forall x.
Rep InventoryDeletionSummary x -> InventoryDeletionSummary
forall x.
InventoryDeletionSummary -> Rep InventoryDeletionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InventoryDeletionSummary x -> InventoryDeletionSummary
$cfrom :: forall x.
InventoryDeletionSummary -> Rep InventoryDeletionSummary x
Prelude.Generic)

-- |
-- Create a value of 'InventoryDeletionSummary' 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:
--
-- 'remainingCount', 'inventoryDeletionSummary_remainingCount' - Remaining number of items to delete.
--
-- 'summaryItems', 'inventoryDeletionSummary_summaryItems' - A list of counts and versions for deleted items.
--
-- 'totalCount', 'inventoryDeletionSummary_totalCount' - The total number of items to delete. This count doesn\'t change during
-- the delete operation.
newInventoryDeletionSummary ::
  InventoryDeletionSummary
newInventoryDeletionSummary :: InventoryDeletionSummary
newInventoryDeletionSummary =
  InventoryDeletionSummary' :: Maybe Int
-> Maybe [InventoryDeletionSummaryItem]
-> Maybe Int
-> InventoryDeletionSummary
InventoryDeletionSummary'
    { $sel:remainingCount:InventoryDeletionSummary' :: Maybe Int
remainingCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:summaryItems:InventoryDeletionSummary' :: Maybe [InventoryDeletionSummaryItem]
summaryItems = Maybe [InventoryDeletionSummaryItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:totalCount:InventoryDeletionSummary' :: Maybe Int
totalCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Remaining number of items to delete.
inventoryDeletionSummary_remainingCount :: Lens.Lens' InventoryDeletionSummary (Prelude.Maybe Prelude.Int)
inventoryDeletionSummary_remainingCount :: (Maybe Int -> f (Maybe Int))
-> InventoryDeletionSummary -> f InventoryDeletionSummary
inventoryDeletionSummary_remainingCount = (InventoryDeletionSummary -> Maybe Int)
-> (InventoryDeletionSummary
    -> Maybe Int -> InventoryDeletionSummary)
-> Lens
     InventoryDeletionSummary
     InventoryDeletionSummary
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryDeletionSummary' {Maybe Int
remainingCount :: Maybe Int
$sel:remainingCount:InventoryDeletionSummary' :: InventoryDeletionSummary -> Maybe Int
remainingCount} -> Maybe Int
remainingCount) (\s :: InventoryDeletionSummary
s@InventoryDeletionSummary' {} Maybe Int
a -> InventoryDeletionSummary
s {$sel:remainingCount:InventoryDeletionSummary' :: Maybe Int
remainingCount = Maybe Int
a} :: InventoryDeletionSummary)

-- | A list of counts and versions for deleted items.
inventoryDeletionSummary_summaryItems :: Lens.Lens' InventoryDeletionSummary (Prelude.Maybe [InventoryDeletionSummaryItem])
inventoryDeletionSummary_summaryItems :: (Maybe [InventoryDeletionSummaryItem]
 -> f (Maybe [InventoryDeletionSummaryItem]))
-> InventoryDeletionSummary -> f InventoryDeletionSummary
inventoryDeletionSummary_summaryItems = (InventoryDeletionSummary -> Maybe [InventoryDeletionSummaryItem])
-> (InventoryDeletionSummary
    -> Maybe [InventoryDeletionSummaryItem]
    -> InventoryDeletionSummary)
-> Lens
     InventoryDeletionSummary
     InventoryDeletionSummary
     (Maybe [InventoryDeletionSummaryItem])
     (Maybe [InventoryDeletionSummaryItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryDeletionSummary' {Maybe [InventoryDeletionSummaryItem]
summaryItems :: Maybe [InventoryDeletionSummaryItem]
$sel:summaryItems:InventoryDeletionSummary' :: InventoryDeletionSummary -> Maybe [InventoryDeletionSummaryItem]
summaryItems} -> Maybe [InventoryDeletionSummaryItem]
summaryItems) (\s :: InventoryDeletionSummary
s@InventoryDeletionSummary' {} Maybe [InventoryDeletionSummaryItem]
a -> InventoryDeletionSummary
s {$sel:summaryItems:InventoryDeletionSummary' :: Maybe [InventoryDeletionSummaryItem]
summaryItems = Maybe [InventoryDeletionSummaryItem]
a} :: InventoryDeletionSummary) ((Maybe [InventoryDeletionSummaryItem]
  -> f (Maybe [InventoryDeletionSummaryItem]))
 -> InventoryDeletionSummary -> f InventoryDeletionSummary)
-> ((Maybe [InventoryDeletionSummaryItem]
     -> f (Maybe [InventoryDeletionSummaryItem]))
    -> Maybe [InventoryDeletionSummaryItem]
    -> f (Maybe [InventoryDeletionSummaryItem]))
-> (Maybe [InventoryDeletionSummaryItem]
    -> f (Maybe [InventoryDeletionSummaryItem]))
-> InventoryDeletionSummary
-> f InventoryDeletionSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InventoryDeletionSummaryItem]
  [InventoryDeletionSummaryItem]
  [InventoryDeletionSummaryItem]
  [InventoryDeletionSummaryItem]
-> Iso
     (Maybe [InventoryDeletionSummaryItem])
     (Maybe [InventoryDeletionSummaryItem])
     (Maybe [InventoryDeletionSummaryItem])
     (Maybe [InventoryDeletionSummaryItem])
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
  [InventoryDeletionSummaryItem]
  [InventoryDeletionSummaryItem]
  [InventoryDeletionSummaryItem]
  [InventoryDeletionSummaryItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The total number of items to delete. This count doesn\'t change during
-- the delete operation.
inventoryDeletionSummary_totalCount :: Lens.Lens' InventoryDeletionSummary (Prelude.Maybe Prelude.Int)
inventoryDeletionSummary_totalCount :: (Maybe Int -> f (Maybe Int))
-> InventoryDeletionSummary -> f InventoryDeletionSummary
inventoryDeletionSummary_totalCount = (InventoryDeletionSummary -> Maybe Int)
-> (InventoryDeletionSummary
    -> Maybe Int -> InventoryDeletionSummary)
-> Lens
     InventoryDeletionSummary
     InventoryDeletionSummary
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryDeletionSummary' {Maybe Int
totalCount :: Maybe Int
$sel:totalCount:InventoryDeletionSummary' :: InventoryDeletionSummary -> Maybe Int
totalCount} -> Maybe Int
totalCount) (\s :: InventoryDeletionSummary
s@InventoryDeletionSummary' {} Maybe Int
a -> InventoryDeletionSummary
s {$sel:totalCount:InventoryDeletionSummary' :: Maybe Int
totalCount = Maybe Int
a} :: InventoryDeletionSummary)

instance Core.FromJSON InventoryDeletionSummary where
  parseJSON :: Value -> Parser InventoryDeletionSummary
parseJSON =
    String
-> (Object -> Parser InventoryDeletionSummary)
-> Value
-> Parser InventoryDeletionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InventoryDeletionSummary"
      ( \Object
x ->
          Maybe Int
-> Maybe [InventoryDeletionSummaryItem]
-> Maybe Int
-> InventoryDeletionSummary
InventoryDeletionSummary'
            (Maybe Int
 -> Maybe [InventoryDeletionSummaryItem]
 -> Maybe Int
 -> InventoryDeletionSummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe [InventoryDeletionSummaryItem]
      -> Maybe Int -> InventoryDeletionSummary)
forall (f :: * -> *) a b. Functor 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
"RemainingCount")
            Parser
  (Maybe [InventoryDeletionSummaryItem]
   -> Maybe Int -> InventoryDeletionSummary)
-> Parser (Maybe [InventoryDeletionSummaryItem])
-> Parser (Maybe Int -> InventoryDeletionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [InventoryDeletionSummaryItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SummaryItems" Parser (Maybe (Maybe [InventoryDeletionSummaryItem]))
-> Maybe [InventoryDeletionSummaryItem]
-> Parser (Maybe [InventoryDeletionSummaryItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [InventoryDeletionSummaryItem]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Int -> InventoryDeletionSummary)
-> Parser (Maybe Int) -> Parser InventoryDeletionSummary
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
"TotalCount")
      )

instance Prelude.Hashable InventoryDeletionSummary

instance Prelude.NFData InventoryDeletionSummary