{-# 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.IoTEvents.Types.InputSummary
-- 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.IoTEvents.Types.InputSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.Types.InputStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the input.
--
-- /See:/ 'newInputSummary' smart constructor.
data InputSummary = InputSummary'
  { -- | The time the input was created.
    InputSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the input.
    InputSummary -> Maybe InputStatus
status :: Prelude.Maybe InputStatus,
    -- | The name of the input.
    InputSummary -> Maybe Text
inputName :: Prelude.Maybe Prelude.Text,
    -- | A brief description of the input.
    InputSummary -> Maybe Text
inputDescription :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the input.
    InputSummary -> Maybe Text
inputArn :: Prelude.Maybe Prelude.Text,
    -- | The last time the input was updated.
    InputSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX
  }
  deriving (InputSummary -> InputSummary -> Bool
(InputSummary -> InputSummary -> Bool)
-> (InputSummary -> InputSummary -> Bool) -> Eq InputSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputSummary -> InputSummary -> Bool
$c/= :: InputSummary -> InputSummary -> Bool
== :: InputSummary -> InputSummary -> Bool
$c== :: InputSummary -> InputSummary -> Bool
Prelude.Eq, ReadPrec [InputSummary]
ReadPrec InputSummary
Int -> ReadS InputSummary
ReadS [InputSummary]
(Int -> ReadS InputSummary)
-> ReadS [InputSummary]
-> ReadPrec InputSummary
-> ReadPrec [InputSummary]
-> Read InputSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputSummary]
$creadListPrec :: ReadPrec [InputSummary]
readPrec :: ReadPrec InputSummary
$creadPrec :: ReadPrec InputSummary
readList :: ReadS [InputSummary]
$creadList :: ReadS [InputSummary]
readsPrec :: Int -> ReadS InputSummary
$creadsPrec :: Int -> ReadS InputSummary
Prelude.Read, Int -> InputSummary -> ShowS
[InputSummary] -> ShowS
InputSummary -> String
(Int -> InputSummary -> ShowS)
-> (InputSummary -> String)
-> ([InputSummary] -> ShowS)
-> Show InputSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputSummary] -> ShowS
$cshowList :: [InputSummary] -> ShowS
show :: InputSummary -> String
$cshow :: InputSummary -> String
showsPrec :: Int -> InputSummary -> ShowS
$cshowsPrec :: Int -> InputSummary -> ShowS
Prelude.Show, (forall x. InputSummary -> Rep InputSummary x)
-> (forall x. Rep InputSummary x -> InputSummary)
-> Generic InputSummary
forall x. Rep InputSummary x -> InputSummary
forall x. InputSummary -> Rep InputSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputSummary x -> InputSummary
$cfrom :: forall x. InputSummary -> Rep InputSummary x
Prelude.Generic)

-- |
-- Create a value of 'InputSummary' 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:
--
-- 'creationTime', 'inputSummary_creationTime' - The time the input was created.
--
-- 'status', 'inputSummary_status' - The status of the input.
--
-- 'inputName', 'inputSummary_inputName' - The name of the input.
--
-- 'inputDescription', 'inputSummary_inputDescription' - A brief description of the input.
--
-- 'inputArn', 'inputSummary_inputArn' - The ARN of the input.
--
-- 'lastUpdateTime', 'inputSummary_lastUpdateTime' - The last time the input was updated.
newInputSummary ::
  InputSummary
newInputSummary :: InputSummary
newInputSummary =
  InputSummary' :: Maybe POSIX
-> Maybe InputStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> InputSummary
InputSummary'
    { $sel:creationTime:InputSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:InputSummary' :: Maybe InputStatus
status = Maybe InputStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:inputName:InputSummary' :: Maybe Text
inputName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputDescription:InputSummary' :: Maybe Text
inputDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputArn:InputSummary' :: Maybe Text
inputArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:InputSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The time the input was created.
inputSummary_creationTime :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.UTCTime)
inputSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InputSummary -> f InputSummary
inputSummary_creationTime = (InputSummary -> Maybe POSIX)
-> (InputSummary -> Maybe POSIX -> InputSummary)
-> Lens InputSummary InputSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:InputSummary' :: InputSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: InputSummary
s@InputSummary' {} Maybe POSIX
a -> InputSummary
s {$sel:creationTime:InputSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: InputSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> InputSummary -> f InputSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InputSummary
-> f InputSummary
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

-- | The status of the input.
inputSummary_status :: Lens.Lens' InputSummary (Prelude.Maybe InputStatus)
inputSummary_status :: (Maybe InputStatus -> f (Maybe InputStatus))
-> InputSummary -> f InputSummary
inputSummary_status = (InputSummary -> Maybe InputStatus)
-> (InputSummary -> Maybe InputStatus -> InputSummary)
-> Lens
     InputSummary InputSummary (Maybe InputStatus) (Maybe InputStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSummary' {Maybe InputStatus
status :: Maybe InputStatus
$sel:status:InputSummary' :: InputSummary -> Maybe InputStatus
status} -> Maybe InputStatus
status) (\s :: InputSummary
s@InputSummary' {} Maybe InputStatus
a -> InputSummary
s {$sel:status:InputSummary' :: Maybe InputStatus
status = Maybe InputStatus
a} :: InputSummary)

-- | The name of the input.
inputSummary_inputName :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.Text)
inputSummary_inputName :: (Maybe Text -> f (Maybe Text)) -> InputSummary -> f InputSummary
inputSummary_inputName = (InputSummary -> Maybe Text)
-> (InputSummary -> Maybe Text -> InputSummary)
-> Lens InputSummary InputSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSummary' {Maybe Text
inputName :: Maybe Text
$sel:inputName:InputSummary' :: InputSummary -> Maybe Text
inputName} -> Maybe Text
inputName) (\s :: InputSummary
s@InputSummary' {} Maybe Text
a -> InputSummary
s {$sel:inputName:InputSummary' :: Maybe Text
inputName = Maybe Text
a} :: InputSummary)

-- | A brief description of the input.
inputSummary_inputDescription :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.Text)
inputSummary_inputDescription :: (Maybe Text -> f (Maybe Text)) -> InputSummary -> f InputSummary
inputSummary_inputDescription = (InputSummary -> Maybe Text)
-> (InputSummary -> Maybe Text -> InputSummary)
-> Lens InputSummary InputSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSummary' {Maybe Text
inputDescription :: Maybe Text
$sel:inputDescription:InputSummary' :: InputSummary -> Maybe Text
inputDescription} -> Maybe Text
inputDescription) (\s :: InputSummary
s@InputSummary' {} Maybe Text
a -> InputSummary
s {$sel:inputDescription:InputSummary' :: Maybe Text
inputDescription = Maybe Text
a} :: InputSummary)

-- | The ARN of the input.
inputSummary_inputArn :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.Text)
inputSummary_inputArn :: (Maybe Text -> f (Maybe Text)) -> InputSummary -> f InputSummary
inputSummary_inputArn = (InputSummary -> Maybe Text)
-> (InputSummary -> Maybe Text -> InputSummary)
-> Lens InputSummary InputSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSummary' {Maybe Text
inputArn :: Maybe Text
$sel:inputArn:InputSummary' :: InputSummary -> Maybe Text
inputArn} -> Maybe Text
inputArn) (\s :: InputSummary
s@InputSummary' {} Maybe Text
a -> InputSummary
s {$sel:inputArn:InputSummary' :: Maybe Text
inputArn = Maybe Text
a} :: InputSummary)

-- | The last time the input was updated.
inputSummary_lastUpdateTime :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.UTCTime)
inputSummary_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InputSummary -> f InputSummary
inputSummary_lastUpdateTime = (InputSummary -> Maybe POSIX)
-> (InputSummary -> Maybe POSIX -> InputSummary)
-> Lens InputSummary InputSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSummary' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:InputSummary' :: InputSummary -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: InputSummary
s@InputSummary' {} Maybe POSIX
a -> InputSummary
s {$sel:lastUpdateTime:InputSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: InputSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> InputSummary -> f InputSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InputSummary
-> f InputSummary
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 InputSummary where
  parseJSON :: Value -> Parser InputSummary
parseJSON =
    String
-> (Object -> Parser InputSummary) -> Value -> Parser InputSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InputSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe InputStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> InputSummary
InputSummary'
            (Maybe POSIX
 -> Maybe InputStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> InputSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe InputStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InputSummary)
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
"creationTime")
            Parser
  (Maybe InputStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InputSummary)
-> Parser (Maybe InputStatus)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe POSIX -> InputSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe POSIX -> InputSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> InputSummary)
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
"inputName")
            Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> InputSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> InputSummary)
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
"inputDescription")
            Parser (Maybe Text -> Maybe POSIX -> InputSummary)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> InputSummary)
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
"inputArn")
            Parser (Maybe POSIX -> InputSummary)
-> Parser (Maybe POSIX) -> Parser InputSummary
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
"lastUpdateTime")
      )

instance Prelude.Hashable InputSummary

instance Prelude.NFData InputSummary