{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTEvents.Types.InputSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEvents.Types.InputStatus
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 Data.POSIX,
    -- | The ARN of the input.
    InputSummary -> Maybe Text
inputArn :: Prelude.Maybe Prelude.Text,
    -- | A brief description of the input.
    InputSummary -> Maybe Text
inputDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the input.
    InputSummary -> Maybe Text
inputName :: Prelude.Maybe Prelude.Text,
    -- | The last time the input was updated.
    InputSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the input.
    InputSummary -> Maybe InputStatus
status :: Prelude.Maybe InputStatus
  }
  deriving (InputSummary -> InputSummary -> Bool
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]
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
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. 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.
--
-- 'inputArn', 'inputSummary_inputArn' - The ARN of the input.
--
-- 'inputDescription', 'inputSummary_inputDescription' - A brief description of the input.
--
-- 'inputName', 'inputSummary_inputName' - The name of the input.
--
-- 'lastUpdateTime', 'inputSummary_lastUpdateTime' - The last time the input was updated.
--
-- 'status', 'inputSummary_status' - The status of the input.
newInputSummary ::
  InputSummary
newInputSummary :: InputSummary
newInputSummary =
  InputSummary'
    { $sel:creationTime:InputSummary' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:inputArn:InputSummary' :: Maybe Text
inputArn = forall a. Maybe a
Prelude.Nothing,
      $sel:inputDescription:InputSummary' :: Maybe Text
inputDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:inputName:InputSummary' :: Maybe Text
inputName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:InputSummary' :: Maybe POSIX
lastUpdateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:InputSummary' :: Maybe InputStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The time the input was created.
inputSummary_creationTime :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.UTCTime)
inputSummary_creationTime :: Lens' InputSummary (Maybe UTCTime)
inputSummary_creationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the input.
inputSummary_inputArn :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.Text)
inputSummary_inputArn :: Lens' InputSummary (Maybe Text)
inputSummary_inputArn = 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)

-- | A brief description of the input.
inputSummary_inputDescription :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.Text)
inputSummary_inputDescription :: Lens' InputSummary (Maybe Text)
inputSummary_inputDescription = 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 name of the input.
inputSummary_inputName :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.Text)
inputSummary_inputName :: Lens' InputSummary (Maybe Text)
inputSummary_inputName = 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)

-- | The last time the input was updated.
inputSummary_lastUpdateTime :: Lens.Lens' InputSummary (Prelude.Maybe Prelude.UTCTime)
inputSummary_lastUpdateTime :: Lens' InputSummary (Maybe UTCTime)
inputSummary_lastUpdateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status of the input.
inputSummary_status :: Lens.Lens' InputSummary (Prelude.Maybe InputStatus)
inputSummary_status :: Lens' InputSummary (Maybe InputStatus)
inputSummary_status = 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)

instance Data.FromJSON InputSummary where
  parseJSON :: Value -> Parser InputSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InputSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe InputStatus
-> InputSummary
InputSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"creationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"inputArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"inputDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"inputName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
      )

instance Prelude.Hashable InputSummary where
  hashWithSalt :: Int -> InputSummary -> Int
hashWithSalt Int
_salt InputSummary' {Maybe Text
Maybe POSIX
Maybe InputStatus
status :: Maybe InputStatus
lastUpdateTime :: Maybe POSIX
inputName :: Maybe Text
inputDescription :: Maybe Text
inputArn :: Maybe Text
creationTime :: Maybe POSIX
$sel:status:InputSummary' :: InputSummary -> Maybe InputStatus
$sel:lastUpdateTime:InputSummary' :: InputSummary -> Maybe POSIX
$sel:inputName:InputSummary' :: InputSummary -> Maybe Text
$sel:inputDescription:InputSummary' :: InputSummary -> Maybe Text
$sel:inputArn:InputSummary' :: InputSummary -> Maybe Text
$sel:creationTime:InputSummary' :: InputSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inputArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inputDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inputName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputStatus
status

instance Prelude.NFData InputSummary where
  rnf :: InputSummary -> ()
rnf InputSummary' {Maybe Text
Maybe POSIX
Maybe InputStatus
status :: Maybe InputStatus
lastUpdateTime :: Maybe POSIX
inputName :: Maybe Text
inputDescription :: Maybe Text
inputArn :: Maybe Text
creationTime :: Maybe POSIX
$sel:status:InputSummary' :: InputSummary -> Maybe InputStatus
$sel:lastUpdateTime:InputSummary' :: InputSummary -> Maybe POSIX
$sel:inputName:InputSummary' :: InputSummary -> Maybe Text
$sel:inputDescription:InputSummary' :: InputSummary -> Maybe Text
$sel:inputArn:InputSummary' :: InputSummary -> Maybe Text
$sel:creationTime:InputSummary' :: InputSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inputArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inputDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inputName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InputStatus
status