{-# 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.LicenseManager.Types.AutomatedDiscoveryInformation
-- 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.LicenseManager.Types.AutomatedDiscoveryInformation where

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

-- | Describes automated discovery.
--
-- /See:/ 'newAutomatedDiscoveryInformation' smart constructor.
data AutomatedDiscoveryInformation = AutomatedDiscoveryInformation'
  { -- | Time that automated discovery last ran.
    AutomatedDiscoveryInformation -> Maybe POSIX
lastRunTime :: Prelude.Maybe Core.POSIX
  }
  deriving (AutomatedDiscoveryInformation
-> AutomatedDiscoveryInformation -> Bool
(AutomatedDiscoveryInformation
 -> AutomatedDiscoveryInformation -> Bool)
-> (AutomatedDiscoveryInformation
    -> AutomatedDiscoveryInformation -> Bool)
-> Eq AutomatedDiscoveryInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutomatedDiscoveryInformation
-> AutomatedDiscoveryInformation -> Bool
$c/= :: AutomatedDiscoveryInformation
-> AutomatedDiscoveryInformation -> Bool
== :: AutomatedDiscoveryInformation
-> AutomatedDiscoveryInformation -> Bool
$c== :: AutomatedDiscoveryInformation
-> AutomatedDiscoveryInformation -> Bool
Prelude.Eq, ReadPrec [AutomatedDiscoveryInformation]
ReadPrec AutomatedDiscoveryInformation
Int -> ReadS AutomatedDiscoveryInformation
ReadS [AutomatedDiscoveryInformation]
(Int -> ReadS AutomatedDiscoveryInformation)
-> ReadS [AutomatedDiscoveryInformation]
-> ReadPrec AutomatedDiscoveryInformation
-> ReadPrec [AutomatedDiscoveryInformation]
-> Read AutomatedDiscoveryInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutomatedDiscoveryInformation]
$creadListPrec :: ReadPrec [AutomatedDiscoveryInformation]
readPrec :: ReadPrec AutomatedDiscoveryInformation
$creadPrec :: ReadPrec AutomatedDiscoveryInformation
readList :: ReadS [AutomatedDiscoveryInformation]
$creadList :: ReadS [AutomatedDiscoveryInformation]
readsPrec :: Int -> ReadS AutomatedDiscoveryInformation
$creadsPrec :: Int -> ReadS AutomatedDiscoveryInformation
Prelude.Read, Int -> AutomatedDiscoveryInformation -> ShowS
[AutomatedDiscoveryInformation] -> ShowS
AutomatedDiscoveryInformation -> String
(Int -> AutomatedDiscoveryInformation -> ShowS)
-> (AutomatedDiscoveryInformation -> String)
-> ([AutomatedDiscoveryInformation] -> ShowS)
-> Show AutomatedDiscoveryInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutomatedDiscoveryInformation] -> ShowS
$cshowList :: [AutomatedDiscoveryInformation] -> ShowS
show :: AutomatedDiscoveryInformation -> String
$cshow :: AutomatedDiscoveryInformation -> String
showsPrec :: Int -> AutomatedDiscoveryInformation -> ShowS
$cshowsPrec :: Int -> AutomatedDiscoveryInformation -> ShowS
Prelude.Show, (forall x.
 AutomatedDiscoveryInformation
 -> Rep AutomatedDiscoveryInformation x)
-> (forall x.
    Rep AutomatedDiscoveryInformation x
    -> AutomatedDiscoveryInformation)
-> Generic AutomatedDiscoveryInformation
forall x.
Rep AutomatedDiscoveryInformation x
-> AutomatedDiscoveryInformation
forall x.
AutomatedDiscoveryInformation
-> Rep AutomatedDiscoveryInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutomatedDiscoveryInformation x
-> AutomatedDiscoveryInformation
$cfrom :: forall x.
AutomatedDiscoveryInformation
-> Rep AutomatedDiscoveryInformation x
Prelude.Generic)

-- |
-- Create a value of 'AutomatedDiscoveryInformation' 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:
--
-- 'lastRunTime', 'automatedDiscoveryInformation_lastRunTime' - Time that automated discovery last ran.
newAutomatedDiscoveryInformation ::
  AutomatedDiscoveryInformation
newAutomatedDiscoveryInformation :: AutomatedDiscoveryInformation
newAutomatedDiscoveryInformation =
  AutomatedDiscoveryInformation' :: Maybe POSIX -> AutomatedDiscoveryInformation
AutomatedDiscoveryInformation'
    { $sel:lastRunTime:AutomatedDiscoveryInformation' :: Maybe POSIX
lastRunTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | Time that automated discovery last ran.
automatedDiscoveryInformation_lastRunTime :: Lens.Lens' AutomatedDiscoveryInformation (Prelude.Maybe Prelude.UTCTime)
automatedDiscoveryInformation_lastRunTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AutomatedDiscoveryInformation -> f AutomatedDiscoveryInformation
automatedDiscoveryInformation_lastRunTime = (AutomatedDiscoveryInformation -> Maybe POSIX)
-> (AutomatedDiscoveryInformation
    -> Maybe POSIX -> AutomatedDiscoveryInformation)
-> Lens
     AutomatedDiscoveryInformation
     AutomatedDiscoveryInformation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomatedDiscoveryInformation' {Maybe POSIX
lastRunTime :: Maybe POSIX
$sel:lastRunTime:AutomatedDiscoveryInformation' :: AutomatedDiscoveryInformation -> Maybe POSIX
lastRunTime} -> Maybe POSIX
lastRunTime) (\s :: AutomatedDiscoveryInformation
s@AutomatedDiscoveryInformation' {} Maybe POSIX
a -> AutomatedDiscoveryInformation
s {$sel:lastRunTime:AutomatedDiscoveryInformation' :: Maybe POSIX
lastRunTime = Maybe POSIX
a} :: AutomatedDiscoveryInformation) ((Maybe POSIX -> f (Maybe POSIX))
 -> AutomatedDiscoveryInformation
 -> f AutomatedDiscoveryInformation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AutomatedDiscoveryInformation
-> f AutomatedDiscoveryInformation
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

instance Core.FromJSON AutomatedDiscoveryInformation where
  parseJSON :: Value -> Parser AutomatedDiscoveryInformation
parseJSON =
    String
-> (Object -> Parser AutomatedDiscoveryInformation)
-> Value
-> Parser AutomatedDiscoveryInformation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutomatedDiscoveryInformation"
      ( \Object
x ->
          Maybe POSIX -> AutomatedDiscoveryInformation
AutomatedDiscoveryInformation'
            (Maybe POSIX -> AutomatedDiscoveryInformation)
-> Parser (Maybe POSIX) -> Parser AutomatedDiscoveryInformation
forall (f :: * -> *) a b. Functor 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
"LastRunTime")
      )

instance
  Prelude.Hashable
    AutomatedDiscoveryInformation

instance Prelude.NFData AutomatedDiscoveryInformation