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

-- |
-- Create a value of 'InputConfiguration' 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:
--
-- 'inputDescription', 'inputConfiguration_inputDescription' - A brief description of the input.
--
-- 'inputName', 'inputConfiguration_inputName' - The name of the input.
--
-- 'inputArn', 'inputConfiguration_inputArn' - The ARN of the input.
--
-- 'creationTime', 'inputConfiguration_creationTime' - The time the input was created.
--
-- 'lastUpdateTime', 'inputConfiguration_lastUpdateTime' - The last time the input was updated.
--
-- 'status', 'inputConfiguration_status' - The status of the input.
newInputConfiguration ::
  -- | 'inputName'
  Prelude.Text ->
  -- | 'inputArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastUpdateTime'
  Prelude.UTCTime ->
  -- | 'status'
  InputStatus ->
  InputConfiguration
newInputConfiguration :: Text
-> Text -> UTCTime -> UTCTime -> InputStatus -> InputConfiguration
newInputConfiguration
  Text
pInputName_
  Text
pInputArn_
  UTCTime
pCreationTime_
  UTCTime
pLastUpdateTime_
  InputStatus
pStatus_ =
    InputConfiguration' :: Maybe Text
-> Text
-> Text
-> POSIX
-> POSIX
-> InputStatus
-> InputConfiguration
InputConfiguration'
      { $sel:inputDescription:InputConfiguration' :: Maybe Text
inputDescription =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:inputName:InputConfiguration' :: Text
inputName = Text
pInputName_,
        $sel:inputArn:InputConfiguration' :: Text
inputArn = Text
pInputArn_,
        $sel:creationTime:InputConfiguration' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastUpdateTime:InputConfiguration' :: POSIX
lastUpdateTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdateTime_,
        $sel:status:InputConfiguration' :: InputStatus
status = InputStatus
pStatus_
      }

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

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

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

-- | The time the input was created.
inputConfiguration_creationTime :: Lens.Lens' InputConfiguration Prelude.UTCTime
inputConfiguration_creationTime :: (UTCTime -> f UTCTime)
-> InputConfiguration -> f InputConfiguration
inputConfiguration_creationTime = (InputConfiguration -> POSIX)
-> (InputConfiguration -> POSIX -> InputConfiguration)
-> Lens InputConfiguration InputConfiguration POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {POSIX
creationTime :: POSIX
$sel:creationTime:InputConfiguration' :: InputConfiguration -> POSIX
creationTime} -> POSIX
creationTime) (\s :: InputConfiguration
s@InputConfiguration' {} POSIX
a -> InputConfiguration
s {$sel:creationTime:InputConfiguration' :: POSIX
creationTime = POSIX
a} :: InputConfiguration) ((POSIX -> f POSIX) -> InputConfiguration -> f InputConfiguration)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> InputConfiguration
-> f InputConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The last time the input was updated.
inputConfiguration_lastUpdateTime :: Lens.Lens' InputConfiguration Prelude.UTCTime
inputConfiguration_lastUpdateTime :: (UTCTime -> f UTCTime)
-> InputConfiguration -> f InputConfiguration
inputConfiguration_lastUpdateTime = (InputConfiguration -> POSIX)
-> (InputConfiguration -> POSIX -> InputConfiguration)
-> Lens InputConfiguration InputConfiguration POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {POSIX
lastUpdateTime :: POSIX
$sel:lastUpdateTime:InputConfiguration' :: InputConfiguration -> POSIX
lastUpdateTime} -> POSIX
lastUpdateTime) (\s :: InputConfiguration
s@InputConfiguration' {} POSIX
a -> InputConfiguration
s {$sel:lastUpdateTime:InputConfiguration' :: POSIX
lastUpdateTime = POSIX
a} :: InputConfiguration) ((POSIX -> f POSIX) -> InputConfiguration -> f InputConfiguration)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> InputConfiguration
-> f InputConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Core.FromJSON InputConfiguration where
  parseJSON :: Value -> Parser InputConfiguration
parseJSON =
    String
-> (Object -> Parser InputConfiguration)
-> Value
-> Parser InputConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InputConfiguration"
      ( \Object
x ->
          Maybe Text
-> Text
-> Text
-> POSIX
-> POSIX
-> InputStatus
-> InputConfiguration
InputConfiguration'
            (Maybe Text
 -> Text
 -> Text
 -> POSIX
 -> POSIX
 -> InputStatus
 -> InputConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Text -> POSIX -> POSIX -> InputStatus -> InputConfiguration)
forall (f :: * -> *) a b. Functor 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
  (Text
   -> Text -> POSIX -> POSIX -> InputStatus -> InputConfiguration)
-> Parser Text
-> Parser
     (Text -> POSIX -> POSIX -> InputStatus -> InputConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"inputName")
            Parser
  (Text -> POSIX -> POSIX -> InputStatus -> InputConfiguration)
-> Parser Text
-> Parser (POSIX -> POSIX -> InputStatus -> InputConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"inputArn")
            Parser (POSIX -> POSIX -> InputStatus -> InputConfiguration)
-> Parser POSIX
-> Parser (POSIX -> InputStatus -> InputConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"creationTime")
            Parser (POSIX -> InputStatus -> InputConfiguration)
-> Parser POSIX -> Parser (InputStatus -> InputConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lastUpdateTime")
            Parser (InputStatus -> InputConfiguration)
-> Parser InputStatus -> Parser InputConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser InputStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
      )

instance Prelude.Hashable InputConfiguration

instance Prelude.NFData InputConfiguration