{-# 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.WellArchitected.Types.MilestoneSummary
-- 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.WellArchitected.Types.MilestoneSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.WorkloadSummary

-- | A milestone summary return object.
--
-- /See:/ 'newMilestoneSummary' smart constructor.
data MilestoneSummary = MilestoneSummary'
  { MilestoneSummary -> Maybe Natural
milestoneNumber :: Prelude.Maybe Prelude.Natural,
    MilestoneSummary -> Maybe Text
milestoneName :: Prelude.Maybe Prelude.Text,
    MilestoneSummary -> Maybe POSIX
recordedAt :: Prelude.Maybe Core.POSIX,
    MilestoneSummary -> Maybe WorkloadSummary
workloadSummary :: Prelude.Maybe WorkloadSummary
  }
  deriving (MilestoneSummary -> MilestoneSummary -> Bool
(MilestoneSummary -> MilestoneSummary -> Bool)
-> (MilestoneSummary -> MilestoneSummary -> Bool)
-> Eq MilestoneSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MilestoneSummary -> MilestoneSummary -> Bool
$c/= :: MilestoneSummary -> MilestoneSummary -> Bool
== :: MilestoneSummary -> MilestoneSummary -> Bool
$c== :: MilestoneSummary -> MilestoneSummary -> Bool
Prelude.Eq, ReadPrec [MilestoneSummary]
ReadPrec MilestoneSummary
Int -> ReadS MilestoneSummary
ReadS [MilestoneSummary]
(Int -> ReadS MilestoneSummary)
-> ReadS [MilestoneSummary]
-> ReadPrec MilestoneSummary
-> ReadPrec [MilestoneSummary]
-> Read MilestoneSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MilestoneSummary]
$creadListPrec :: ReadPrec [MilestoneSummary]
readPrec :: ReadPrec MilestoneSummary
$creadPrec :: ReadPrec MilestoneSummary
readList :: ReadS [MilestoneSummary]
$creadList :: ReadS [MilestoneSummary]
readsPrec :: Int -> ReadS MilestoneSummary
$creadsPrec :: Int -> ReadS MilestoneSummary
Prelude.Read, Int -> MilestoneSummary -> ShowS
[MilestoneSummary] -> ShowS
MilestoneSummary -> String
(Int -> MilestoneSummary -> ShowS)
-> (MilestoneSummary -> String)
-> ([MilestoneSummary] -> ShowS)
-> Show MilestoneSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MilestoneSummary] -> ShowS
$cshowList :: [MilestoneSummary] -> ShowS
show :: MilestoneSummary -> String
$cshow :: MilestoneSummary -> String
showsPrec :: Int -> MilestoneSummary -> ShowS
$cshowsPrec :: Int -> MilestoneSummary -> ShowS
Prelude.Show, (forall x. MilestoneSummary -> Rep MilestoneSummary x)
-> (forall x. Rep MilestoneSummary x -> MilestoneSummary)
-> Generic MilestoneSummary
forall x. Rep MilestoneSummary x -> MilestoneSummary
forall x. MilestoneSummary -> Rep MilestoneSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MilestoneSummary x -> MilestoneSummary
$cfrom :: forall x. MilestoneSummary -> Rep MilestoneSummary x
Prelude.Generic)

-- |
-- Create a value of 'MilestoneSummary' 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:
--
-- 'milestoneNumber', 'milestoneSummary_milestoneNumber' - Undocumented member.
--
-- 'milestoneName', 'milestoneSummary_milestoneName' - Undocumented member.
--
-- 'recordedAt', 'milestoneSummary_recordedAt' - Undocumented member.
--
-- 'workloadSummary', 'milestoneSummary_workloadSummary' - Undocumented member.
newMilestoneSummary ::
  MilestoneSummary
newMilestoneSummary :: MilestoneSummary
newMilestoneSummary =
  MilestoneSummary' :: Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe WorkloadSummary
-> MilestoneSummary
MilestoneSummary'
    { $sel:milestoneNumber:MilestoneSummary' :: Maybe Natural
milestoneNumber =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:milestoneName:MilestoneSummary' :: Maybe Text
milestoneName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recordedAt:MilestoneSummary' :: Maybe POSIX
recordedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:workloadSummary:MilestoneSummary' :: Maybe WorkloadSummary
workloadSummary = Maybe WorkloadSummary
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
milestoneSummary_milestoneNumber :: Lens.Lens' MilestoneSummary (Prelude.Maybe Prelude.Natural)
milestoneSummary_milestoneNumber :: (Maybe Natural -> f (Maybe Natural))
-> MilestoneSummary -> f MilestoneSummary
milestoneSummary_milestoneNumber = (MilestoneSummary -> Maybe Natural)
-> (MilestoneSummary -> Maybe Natural -> MilestoneSummary)
-> Lens
     MilestoneSummary MilestoneSummary (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MilestoneSummary' {Maybe Natural
milestoneNumber :: Maybe Natural
$sel:milestoneNumber:MilestoneSummary' :: MilestoneSummary -> Maybe Natural
milestoneNumber} -> Maybe Natural
milestoneNumber) (\s :: MilestoneSummary
s@MilestoneSummary' {} Maybe Natural
a -> MilestoneSummary
s {$sel:milestoneNumber:MilestoneSummary' :: Maybe Natural
milestoneNumber = Maybe Natural
a} :: MilestoneSummary)

-- | Undocumented member.
milestoneSummary_milestoneName :: Lens.Lens' MilestoneSummary (Prelude.Maybe Prelude.Text)
milestoneSummary_milestoneName :: (Maybe Text -> f (Maybe Text))
-> MilestoneSummary -> f MilestoneSummary
milestoneSummary_milestoneName = (MilestoneSummary -> Maybe Text)
-> (MilestoneSummary -> Maybe Text -> MilestoneSummary)
-> Lens MilestoneSummary MilestoneSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MilestoneSummary' {Maybe Text
milestoneName :: Maybe Text
$sel:milestoneName:MilestoneSummary' :: MilestoneSummary -> Maybe Text
milestoneName} -> Maybe Text
milestoneName) (\s :: MilestoneSummary
s@MilestoneSummary' {} Maybe Text
a -> MilestoneSummary
s {$sel:milestoneName:MilestoneSummary' :: Maybe Text
milestoneName = Maybe Text
a} :: MilestoneSummary)

-- | Undocumented member.
milestoneSummary_recordedAt :: Lens.Lens' MilestoneSummary (Prelude.Maybe Prelude.UTCTime)
milestoneSummary_recordedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MilestoneSummary -> f MilestoneSummary
milestoneSummary_recordedAt = (MilestoneSummary -> Maybe POSIX)
-> (MilestoneSummary -> Maybe POSIX -> MilestoneSummary)
-> Lens
     MilestoneSummary MilestoneSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MilestoneSummary' {Maybe POSIX
recordedAt :: Maybe POSIX
$sel:recordedAt:MilestoneSummary' :: MilestoneSummary -> Maybe POSIX
recordedAt} -> Maybe POSIX
recordedAt) (\s :: MilestoneSummary
s@MilestoneSummary' {} Maybe POSIX
a -> MilestoneSummary
s {$sel:recordedAt:MilestoneSummary' :: Maybe POSIX
recordedAt = Maybe POSIX
a} :: MilestoneSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> MilestoneSummary -> f MilestoneSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MilestoneSummary
-> f MilestoneSummary
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

-- | Undocumented member.
milestoneSummary_workloadSummary :: Lens.Lens' MilestoneSummary (Prelude.Maybe WorkloadSummary)
milestoneSummary_workloadSummary :: (Maybe WorkloadSummary -> f (Maybe WorkloadSummary))
-> MilestoneSummary -> f MilestoneSummary
milestoneSummary_workloadSummary = (MilestoneSummary -> Maybe WorkloadSummary)
-> (MilestoneSummary -> Maybe WorkloadSummary -> MilestoneSummary)
-> Lens
     MilestoneSummary
     MilestoneSummary
     (Maybe WorkloadSummary)
     (Maybe WorkloadSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MilestoneSummary' {Maybe WorkloadSummary
workloadSummary :: Maybe WorkloadSummary
$sel:workloadSummary:MilestoneSummary' :: MilestoneSummary -> Maybe WorkloadSummary
workloadSummary} -> Maybe WorkloadSummary
workloadSummary) (\s :: MilestoneSummary
s@MilestoneSummary' {} Maybe WorkloadSummary
a -> MilestoneSummary
s {$sel:workloadSummary:MilestoneSummary' :: Maybe WorkloadSummary
workloadSummary = Maybe WorkloadSummary
a} :: MilestoneSummary)

instance Core.FromJSON MilestoneSummary where
  parseJSON :: Value -> Parser MilestoneSummary
parseJSON =
    String
-> (Object -> Parser MilestoneSummary)
-> Value
-> Parser MilestoneSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MilestoneSummary"
      ( \Object
x ->
          Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe WorkloadSummary
-> MilestoneSummary
MilestoneSummary'
            (Maybe Natural
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe WorkloadSummary
 -> MilestoneSummary)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe WorkloadSummary -> MilestoneSummary)
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
"MilestoneNumber")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe WorkloadSummary -> MilestoneSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe WorkloadSummary -> MilestoneSummary)
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
"MilestoneName")
            Parser (Maybe POSIX -> Maybe WorkloadSummary -> MilestoneSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe WorkloadSummary -> MilestoneSummary)
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
"RecordedAt")
            Parser (Maybe WorkloadSummary -> MilestoneSummary)
-> Parser (Maybe WorkloadSummary) -> Parser MilestoneSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkloadSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkloadSummary")
      )

instance Prelude.Hashable MilestoneSummary

instance Prelude.NFData MilestoneSummary