{-# 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.ECR.Types.LifecyclePolicyPreviewSummary
-- 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.ECR.Types.LifecyclePolicyPreviewSummary where

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

-- | The summary of the lifecycle policy preview request.
--
-- /See:/ 'newLifecyclePolicyPreviewSummary' smart constructor.
data LifecyclePolicyPreviewSummary = LifecyclePolicyPreviewSummary'
  { -- | The number of expiring images.
    LifecyclePolicyPreviewSummary -> Maybe Natural
expiringImageTotalCount :: Prelude.Maybe Prelude.Natural
  }
  deriving (LifecyclePolicyPreviewSummary
-> LifecyclePolicyPreviewSummary -> Bool
(LifecyclePolicyPreviewSummary
 -> LifecyclePolicyPreviewSummary -> Bool)
-> (LifecyclePolicyPreviewSummary
    -> LifecyclePolicyPreviewSummary -> Bool)
-> Eq LifecyclePolicyPreviewSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LifecyclePolicyPreviewSummary
-> LifecyclePolicyPreviewSummary -> Bool
$c/= :: LifecyclePolicyPreviewSummary
-> LifecyclePolicyPreviewSummary -> Bool
== :: LifecyclePolicyPreviewSummary
-> LifecyclePolicyPreviewSummary -> Bool
$c== :: LifecyclePolicyPreviewSummary
-> LifecyclePolicyPreviewSummary -> Bool
Prelude.Eq, ReadPrec [LifecyclePolicyPreviewSummary]
ReadPrec LifecyclePolicyPreviewSummary
Int -> ReadS LifecyclePolicyPreviewSummary
ReadS [LifecyclePolicyPreviewSummary]
(Int -> ReadS LifecyclePolicyPreviewSummary)
-> ReadS [LifecyclePolicyPreviewSummary]
-> ReadPrec LifecyclePolicyPreviewSummary
-> ReadPrec [LifecyclePolicyPreviewSummary]
-> Read LifecyclePolicyPreviewSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LifecyclePolicyPreviewSummary]
$creadListPrec :: ReadPrec [LifecyclePolicyPreviewSummary]
readPrec :: ReadPrec LifecyclePolicyPreviewSummary
$creadPrec :: ReadPrec LifecyclePolicyPreviewSummary
readList :: ReadS [LifecyclePolicyPreviewSummary]
$creadList :: ReadS [LifecyclePolicyPreviewSummary]
readsPrec :: Int -> ReadS LifecyclePolicyPreviewSummary
$creadsPrec :: Int -> ReadS LifecyclePolicyPreviewSummary
Prelude.Read, Int -> LifecyclePolicyPreviewSummary -> ShowS
[LifecyclePolicyPreviewSummary] -> ShowS
LifecyclePolicyPreviewSummary -> String
(Int -> LifecyclePolicyPreviewSummary -> ShowS)
-> (LifecyclePolicyPreviewSummary -> String)
-> ([LifecyclePolicyPreviewSummary] -> ShowS)
-> Show LifecyclePolicyPreviewSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LifecyclePolicyPreviewSummary] -> ShowS
$cshowList :: [LifecyclePolicyPreviewSummary] -> ShowS
show :: LifecyclePolicyPreviewSummary -> String
$cshow :: LifecyclePolicyPreviewSummary -> String
showsPrec :: Int -> LifecyclePolicyPreviewSummary -> ShowS
$cshowsPrec :: Int -> LifecyclePolicyPreviewSummary -> ShowS
Prelude.Show, (forall x.
 LifecyclePolicyPreviewSummary
 -> Rep LifecyclePolicyPreviewSummary x)
-> (forall x.
    Rep LifecyclePolicyPreviewSummary x
    -> LifecyclePolicyPreviewSummary)
-> Generic LifecyclePolicyPreviewSummary
forall x.
Rep LifecyclePolicyPreviewSummary x
-> LifecyclePolicyPreviewSummary
forall x.
LifecyclePolicyPreviewSummary
-> Rep LifecyclePolicyPreviewSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LifecyclePolicyPreviewSummary x
-> LifecyclePolicyPreviewSummary
$cfrom :: forall x.
LifecyclePolicyPreviewSummary
-> Rep LifecyclePolicyPreviewSummary x
Prelude.Generic)

-- |
-- Create a value of 'LifecyclePolicyPreviewSummary' 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:
--
-- 'expiringImageTotalCount', 'lifecyclePolicyPreviewSummary_expiringImageTotalCount' - The number of expiring images.
newLifecyclePolicyPreviewSummary ::
  LifecyclePolicyPreviewSummary
newLifecyclePolicyPreviewSummary :: LifecyclePolicyPreviewSummary
newLifecyclePolicyPreviewSummary =
  LifecyclePolicyPreviewSummary' :: Maybe Natural -> LifecyclePolicyPreviewSummary
LifecyclePolicyPreviewSummary'
    { $sel:expiringImageTotalCount:LifecyclePolicyPreviewSummary' :: Maybe Natural
expiringImageTotalCount =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of expiring images.
lifecyclePolicyPreviewSummary_expiringImageTotalCount :: Lens.Lens' LifecyclePolicyPreviewSummary (Prelude.Maybe Prelude.Natural)
lifecyclePolicyPreviewSummary_expiringImageTotalCount :: (Maybe Natural -> f (Maybe Natural))
-> LifecyclePolicyPreviewSummary -> f LifecyclePolicyPreviewSummary
lifecyclePolicyPreviewSummary_expiringImageTotalCount = (LifecyclePolicyPreviewSummary -> Maybe Natural)
-> (LifecyclePolicyPreviewSummary
    -> Maybe Natural -> LifecyclePolicyPreviewSummary)
-> Lens
     LifecyclePolicyPreviewSummary
     LifecyclePolicyPreviewSummary
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicyPreviewSummary' {Maybe Natural
expiringImageTotalCount :: Maybe Natural
$sel:expiringImageTotalCount:LifecyclePolicyPreviewSummary' :: LifecyclePolicyPreviewSummary -> Maybe Natural
expiringImageTotalCount} -> Maybe Natural
expiringImageTotalCount) (\s :: LifecyclePolicyPreviewSummary
s@LifecyclePolicyPreviewSummary' {} Maybe Natural
a -> LifecyclePolicyPreviewSummary
s {$sel:expiringImageTotalCount:LifecyclePolicyPreviewSummary' :: Maybe Natural
expiringImageTotalCount = Maybe Natural
a} :: LifecyclePolicyPreviewSummary)

instance Core.FromJSON LifecyclePolicyPreviewSummary where
  parseJSON :: Value -> Parser LifecyclePolicyPreviewSummary
parseJSON =
    String
-> (Object -> Parser LifecyclePolicyPreviewSummary)
-> Value
-> Parser LifecyclePolicyPreviewSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LifecyclePolicyPreviewSummary"
      ( \Object
x ->
          Maybe Natural -> LifecyclePolicyPreviewSummary
LifecyclePolicyPreviewSummary'
            (Maybe Natural -> LifecyclePolicyPreviewSummary)
-> Parser (Maybe Natural) -> Parser LifecyclePolicyPreviewSummary
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"expiringImageTotalCount")
      )

instance
  Prelude.Hashable
    LifecyclePolicyPreviewSummary

instance Prelude.NFData LifecyclePolicyPreviewSummary