{-# 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-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.InputConfiguration 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 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 :: Data.POSIX,
    -- | The last time the input was updated.
    InputConfiguration -> POSIX
lastUpdateTime :: Data.POSIX,
    -- | The status of the input.
    InputConfiguration -> InputStatus
status :: InputStatus
  }
  deriving (InputConfiguration -> InputConfiguration -> Bool
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]
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
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. 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'
      { $sel:inputDescription:InputConfiguration' :: Maybe Text
inputDescription =
          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 = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastUpdateTime:InputConfiguration' :: POSIX
lastUpdateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' InputConfiguration (Maybe Text)
inputConfiguration_inputDescription = 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 :: Lens' InputConfiguration Text
inputConfiguration_inputName = 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 :: Lens' InputConfiguration Text
inputConfiguration_inputArn = 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 :: Lens' InputConfiguration UTCTime
inputConfiguration_creationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

-- | The status of the input.
inputConfiguration_status :: Lens.Lens' InputConfiguration InputStatus
inputConfiguration_status :: Lens' InputConfiguration InputStatus
inputConfiguration_status = 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 Data.FromJSON InputConfiguration where
  parseJSON :: Value -> Parser InputConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InputConfiguration"
      ( \Object
x ->
          Maybe Text
-> Text
-> Text
-> POSIX
-> POSIX
-> InputStatus
-> InputConfiguration
InputConfiguration'
            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
"inputDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 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 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 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 a
Data..: Key
"status")
      )

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

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