{-# 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.LookoutEquipment.Types.InferenceInputConfiguration
-- 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.LookoutEquipment.Types.InferenceInputConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutEquipment.Types.InferenceInputNameConfiguration
import Amazonka.LookoutEquipment.Types.InferenceS3InputConfiguration
import qualified Amazonka.Prelude as Prelude

-- | Specifies configuration information for the input data for the
-- inference, including S3 location of input data..
--
-- /See:/ 'newInferenceInputConfiguration' smart constructor.
data InferenceInputConfiguration = InferenceInputConfiguration'
  { -- | Indicates the difference between your time zone and Greenwich Mean Time
    -- (GMT).
    InferenceInputConfiguration -> Maybe Text
inputTimeZoneOffset :: Prelude.Maybe Prelude.Text,
    -- | Specifies configuration information for the input data for the
    -- inference, including S3 location of input data..
    InferenceInputConfiguration -> Maybe InferenceS3InputConfiguration
s3InputConfiguration :: Prelude.Maybe InferenceS3InputConfiguration,
    -- | Specifies configuration information for the input data for the
    -- inference, including timestamp format and delimiter.
    InferenceInputConfiguration
-> Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration :: Prelude.Maybe InferenceInputNameConfiguration
  }
  deriving (InferenceInputConfiguration -> InferenceInputConfiguration -> Bool
(InferenceInputConfiguration
 -> InferenceInputConfiguration -> Bool)
-> (InferenceInputConfiguration
    -> InferenceInputConfiguration -> Bool)
-> Eq InferenceInputConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InferenceInputConfiguration -> InferenceInputConfiguration -> Bool
$c/= :: InferenceInputConfiguration -> InferenceInputConfiguration -> Bool
== :: InferenceInputConfiguration -> InferenceInputConfiguration -> Bool
$c== :: InferenceInputConfiguration -> InferenceInputConfiguration -> Bool
Prelude.Eq, ReadPrec [InferenceInputConfiguration]
ReadPrec InferenceInputConfiguration
Int -> ReadS InferenceInputConfiguration
ReadS [InferenceInputConfiguration]
(Int -> ReadS InferenceInputConfiguration)
-> ReadS [InferenceInputConfiguration]
-> ReadPrec InferenceInputConfiguration
-> ReadPrec [InferenceInputConfiguration]
-> Read InferenceInputConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InferenceInputConfiguration]
$creadListPrec :: ReadPrec [InferenceInputConfiguration]
readPrec :: ReadPrec InferenceInputConfiguration
$creadPrec :: ReadPrec InferenceInputConfiguration
readList :: ReadS [InferenceInputConfiguration]
$creadList :: ReadS [InferenceInputConfiguration]
readsPrec :: Int -> ReadS InferenceInputConfiguration
$creadsPrec :: Int -> ReadS InferenceInputConfiguration
Prelude.Read, Int -> InferenceInputConfiguration -> ShowS
[InferenceInputConfiguration] -> ShowS
InferenceInputConfiguration -> String
(Int -> InferenceInputConfiguration -> ShowS)
-> (InferenceInputConfiguration -> String)
-> ([InferenceInputConfiguration] -> ShowS)
-> Show InferenceInputConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InferenceInputConfiguration] -> ShowS
$cshowList :: [InferenceInputConfiguration] -> ShowS
show :: InferenceInputConfiguration -> String
$cshow :: InferenceInputConfiguration -> String
showsPrec :: Int -> InferenceInputConfiguration -> ShowS
$cshowsPrec :: Int -> InferenceInputConfiguration -> ShowS
Prelude.Show, (forall x.
 InferenceInputConfiguration -> Rep InferenceInputConfiguration x)
-> (forall x.
    Rep InferenceInputConfiguration x -> InferenceInputConfiguration)
-> Generic InferenceInputConfiguration
forall x.
Rep InferenceInputConfiguration x -> InferenceInputConfiguration
forall x.
InferenceInputConfiguration -> Rep InferenceInputConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InferenceInputConfiguration x -> InferenceInputConfiguration
$cfrom :: forall x.
InferenceInputConfiguration -> Rep InferenceInputConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'InferenceInputConfiguration' 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:
--
-- 'inputTimeZoneOffset', 'inferenceInputConfiguration_inputTimeZoneOffset' - Indicates the difference between your time zone and Greenwich Mean Time
-- (GMT).
--
-- 's3InputConfiguration', 'inferenceInputConfiguration_s3InputConfiguration' - Specifies configuration information for the input data for the
-- inference, including S3 location of input data..
--
-- 'inferenceInputNameConfiguration', 'inferenceInputConfiguration_inferenceInputNameConfiguration' - Specifies configuration information for the input data for the
-- inference, including timestamp format and delimiter.
newInferenceInputConfiguration ::
  InferenceInputConfiguration
newInferenceInputConfiguration :: InferenceInputConfiguration
newInferenceInputConfiguration =
  InferenceInputConfiguration' :: Maybe Text
-> Maybe InferenceS3InputConfiguration
-> Maybe InferenceInputNameConfiguration
-> InferenceInputConfiguration
InferenceInputConfiguration'
    { $sel:inputTimeZoneOffset:InferenceInputConfiguration' :: Maybe Text
inputTimeZoneOffset =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3InputConfiguration:InferenceInputConfiguration' :: Maybe InferenceS3InputConfiguration
s3InputConfiguration = Maybe InferenceS3InputConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:inferenceInputNameConfiguration:InferenceInputConfiguration' :: Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration =
        Maybe InferenceInputNameConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the difference between your time zone and Greenwich Mean Time
-- (GMT).
inferenceInputConfiguration_inputTimeZoneOffset :: Lens.Lens' InferenceInputConfiguration (Prelude.Maybe Prelude.Text)
inferenceInputConfiguration_inputTimeZoneOffset :: (Maybe Text -> f (Maybe Text))
-> InferenceInputConfiguration -> f InferenceInputConfiguration
inferenceInputConfiguration_inputTimeZoneOffset = (InferenceInputConfiguration -> Maybe Text)
-> (InferenceInputConfiguration
    -> Maybe Text -> InferenceInputConfiguration)
-> Lens
     InferenceInputConfiguration
     InferenceInputConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceInputConfiguration' {Maybe Text
inputTimeZoneOffset :: Maybe Text
$sel:inputTimeZoneOffset:InferenceInputConfiguration' :: InferenceInputConfiguration -> Maybe Text
inputTimeZoneOffset} -> Maybe Text
inputTimeZoneOffset) (\s :: InferenceInputConfiguration
s@InferenceInputConfiguration' {} Maybe Text
a -> InferenceInputConfiguration
s {$sel:inputTimeZoneOffset:InferenceInputConfiguration' :: Maybe Text
inputTimeZoneOffset = Maybe Text
a} :: InferenceInputConfiguration)

-- | Specifies configuration information for the input data for the
-- inference, including S3 location of input data..
inferenceInputConfiguration_s3InputConfiguration :: Lens.Lens' InferenceInputConfiguration (Prelude.Maybe InferenceS3InputConfiguration)
inferenceInputConfiguration_s3InputConfiguration :: (Maybe InferenceS3InputConfiguration
 -> f (Maybe InferenceS3InputConfiguration))
-> InferenceInputConfiguration -> f InferenceInputConfiguration
inferenceInputConfiguration_s3InputConfiguration = (InferenceInputConfiguration
 -> Maybe InferenceS3InputConfiguration)
-> (InferenceInputConfiguration
    -> Maybe InferenceS3InputConfiguration
    -> InferenceInputConfiguration)
-> Lens
     InferenceInputConfiguration
     InferenceInputConfiguration
     (Maybe InferenceS3InputConfiguration)
     (Maybe InferenceS3InputConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceInputConfiguration' {Maybe InferenceS3InputConfiguration
s3InputConfiguration :: Maybe InferenceS3InputConfiguration
$sel:s3InputConfiguration:InferenceInputConfiguration' :: InferenceInputConfiguration -> Maybe InferenceS3InputConfiguration
s3InputConfiguration} -> Maybe InferenceS3InputConfiguration
s3InputConfiguration) (\s :: InferenceInputConfiguration
s@InferenceInputConfiguration' {} Maybe InferenceS3InputConfiguration
a -> InferenceInputConfiguration
s {$sel:s3InputConfiguration:InferenceInputConfiguration' :: Maybe InferenceS3InputConfiguration
s3InputConfiguration = Maybe InferenceS3InputConfiguration
a} :: InferenceInputConfiguration)

-- | Specifies configuration information for the input data for the
-- inference, including timestamp format and delimiter.
inferenceInputConfiguration_inferenceInputNameConfiguration :: Lens.Lens' InferenceInputConfiguration (Prelude.Maybe InferenceInputNameConfiguration)
inferenceInputConfiguration_inferenceInputNameConfiguration :: (Maybe InferenceInputNameConfiguration
 -> f (Maybe InferenceInputNameConfiguration))
-> InferenceInputConfiguration -> f InferenceInputConfiguration
inferenceInputConfiguration_inferenceInputNameConfiguration = (InferenceInputConfiguration
 -> Maybe InferenceInputNameConfiguration)
-> (InferenceInputConfiguration
    -> Maybe InferenceInputNameConfiguration
    -> InferenceInputConfiguration)
-> Lens
     InferenceInputConfiguration
     InferenceInputConfiguration
     (Maybe InferenceInputNameConfiguration)
     (Maybe InferenceInputNameConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceInputConfiguration' {Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration :: Maybe InferenceInputNameConfiguration
$sel:inferenceInputNameConfiguration:InferenceInputConfiguration' :: InferenceInputConfiguration
-> Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration} -> Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration) (\s :: InferenceInputConfiguration
s@InferenceInputConfiguration' {} Maybe InferenceInputNameConfiguration
a -> InferenceInputConfiguration
s {$sel:inferenceInputNameConfiguration:InferenceInputConfiguration' :: Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration = Maybe InferenceInputNameConfiguration
a} :: InferenceInputConfiguration)

instance Core.FromJSON InferenceInputConfiguration where
  parseJSON :: Value -> Parser InferenceInputConfiguration
parseJSON =
    String
-> (Object -> Parser InferenceInputConfiguration)
-> Value
-> Parser InferenceInputConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InferenceInputConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe InferenceS3InputConfiguration
-> Maybe InferenceInputNameConfiguration
-> InferenceInputConfiguration
InferenceInputConfiguration'
            (Maybe Text
 -> Maybe InferenceS3InputConfiguration
 -> Maybe InferenceInputNameConfiguration
 -> InferenceInputConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe InferenceS3InputConfiguration
      -> Maybe InferenceInputNameConfiguration
      -> InferenceInputConfiguration)
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
"InputTimeZoneOffset")
            Parser
  (Maybe InferenceS3InputConfiguration
   -> Maybe InferenceInputNameConfiguration
   -> InferenceInputConfiguration)
-> Parser (Maybe InferenceS3InputConfiguration)
-> Parser
     (Maybe InferenceInputNameConfiguration
      -> InferenceInputConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InferenceS3InputConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3InputConfiguration")
            Parser
  (Maybe InferenceInputNameConfiguration
   -> InferenceInputConfiguration)
-> Parser (Maybe InferenceInputNameConfiguration)
-> Parser InferenceInputConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InferenceInputNameConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InferenceInputNameConfiguration")
      )

instance Prelude.Hashable InferenceInputConfiguration

instance Prelude.NFData InferenceInputConfiguration

instance Core.ToJSON InferenceInputConfiguration where
  toJSON :: InferenceInputConfiguration -> Value
toJSON InferenceInputConfiguration' {Maybe Text
Maybe InferenceInputNameConfiguration
Maybe InferenceS3InputConfiguration
inferenceInputNameConfiguration :: Maybe InferenceInputNameConfiguration
s3InputConfiguration :: Maybe InferenceS3InputConfiguration
inputTimeZoneOffset :: Maybe Text
$sel:inferenceInputNameConfiguration:InferenceInputConfiguration' :: InferenceInputConfiguration
-> Maybe InferenceInputNameConfiguration
$sel:s3InputConfiguration:InferenceInputConfiguration' :: InferenceInputConfiguration -> Maybe InferenceS3InputConfiguration
$sel:inputTimeZoneOffset:InferenceInputConfiguration' :: InferenceInputConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"InputTimeZoneOffset" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
inputTimeZoneOffset,
            (Text
"S3InputConfiguration" Text -> InferenceS3InputConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InferenceS3InputConfiguration -> Pair)
-> Maybe InferenceS3InputConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InferenceS3InputConfiguration
s3InputConfiguration,
            (Text
"InferenceInputNameConfiguration" Text -> InferenceInputNameConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InferenceInputNameConfiguration -> Pair)
-> Maybe InferenceInputNameConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InferenceInputNameConfiguration
inferenceInputNameConfiguration
          ]
      )