{-# 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.InferenceInputNameConfiguration
-- 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.InferenceInputNameConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies configuration information for the input data for the
-- inference, including timestamp format and delimiter.
--
-- /See:/ 'newInferenceInputNameConfiguration' smart constructor.
data InferenceInputNameConfiguration = InferenceInputNameConfiguration'
  { -- | The format of the timestamp, whether Epoch time, or standard, with or
    -- without hyphens (-).
    InferenceInputNameConfiguration -> Maybe Text
timestampFormat :: Prelude.Maybe Prelude.Text,
    -- | Indicates the delimiter character used between items in the data.
    InferenceInputNameConfiguration -> Maybe Text
componentTimestampDelimiter :: Prelude.Maybe Prelude.Text
  }
  deriving (InferenceInputNameConfiguration
-> InferenceInputNameConfiguration -> Bool
(InferenceInputNameConfiguration
 -> InferenceInputNameConfiguration -> Bool)
-> (InferenceInputNameConfiguration
    -> InferenceInputNameConfiguration -> Bool)
-> Eq InferenceInputNameConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InferenceInputNameConfiguration
-> InferenceInputNameConfiguration -> Bool
$c/= :: InferenceInputNameConfiguration
-> InferenceInputNameConfiguration -> Bool
== :: InferenceInputNameConfiguration
-> InferenceInputNameConfiguration -> Bool
$c== :: InferenceInputNameConfiguration
-> InferenceInputNameConfiguration -> Bool
Prelude.Eq, ReadPrec [InferenceInputNameConfiguration]
ReadPrec InferenceInputNameConfiguration
Int -> ReadS InferenceInputNameConfiguration
ReadS [InferenceInputNameConfiguration]
(Int -> ReadS InferenceInputNameConfiguration)
-> ReadS [InferenceInputNameConfiguration]
-> ReadPrec InferenceInputNameConfiguration
-> ReadPrec [InferenceInputNameConfiguration]
-> Read InferenceInputNameConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InferenceInputNameConfiguration]
$creadListPrec :: ReadPrec [InferenceInputNameConfiguration]
readPrec :: ReadPrec InferenceInputNameConfiguration
$creadPrec :: ReadPrec InferenceInputNameConfiguration
readList :: ReadS [InferenceInputNameConfiguration]
$creadList :: ReadS [InferenceInputNameConfiguration]
readsPrec :: Int -> ReadS InferenceInputNameConfiguration
$creadsPrec :: Int -> ReadS InferenceInputNameConfiguration
Prelude.Read, Int -> InferenceInputNameConfiguration -> ShowS
[InferenceInputNameConfiguration] -> ShowS
InferenceInputNameConfiguration -> String
(Int -> InferenceInputNameConfiguration -> ShowS)
-> (InferenceInputNameConfiguration -> String)
-> ([InferenceInputNameConfiguration] -> ShowS)
-> Show InferenceInputNameConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InferenceInputNameConfiguration] -> ShowS
$cshowList :: [InferenceInputNameConfiguration] -> ShowS
show :: InferenceInputNameConfiguration -> String
$cshow :: InferenceInputNameConfiguration -> String
showsPrec :: Int -> InferenceInputNameConfiguration -> ShowS
$cshowsPrec :: Int -> InferenceInputNameConfiguration -> ShowS
Prelude.Show, (forall x.
 InferenceInputNameConfiguration
 -> Rep InferenceInputNameConfiguration x)
-> (forall x.
    Rep InferenceInputNameConfiguration x
    -> InferenceInputNameConfiguration)
-> Generic InferenceInputNameConfiguration
forall x.
Rep InferenceInputNameConfiguration x
-> InferenceInputNameConfiguration
forall x.
InferenceInputNameConfiguration
-> Rep InferenceInputNameConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InferenceInputNameConfiguration x
-> InferenceInputNameConfiguration
$cfrom :: forall x.
InferenceInputNameConfiguration
-> Rep InferenceInputNameConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'InferenceInputNameConfiguration' 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:
--
-- 'timestampFormat', 'inferenceInputNameConfiguration_timestampFormat' - The format of the timestamp, whether Epoch time, or standard, with or
-- without hyphens (-).
--
-- 'componentTimestampDelimiter', 'inferenceInputNameConfiguration_componentTimestampDelimiter' - Indicates the delimiter character used between items in the data.
newInferenceInputNameConfiguration ::
  InferenceInputNameConfiguration
newInferenceInputNameConfiguration :: InferenceInputNameConfiguration
newInferenceInputNameConfiguration =
  InferenceInputNameConfiguration' :: Maybe Text -> Maybe Text -> InferenceInputNameConfiguration
InferenceInputNameConfiguration'
    { $sel:timestampFormat:InferenceInputNameConfiguration' :: Maybe Text
timestampFormat =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:componentTimestampDelimiter:InferenceInputNameConfiguration' :: Maybe Text
componentTimestampDelimiter =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The format of the timestamp, whether Epoch time, or standard, with or
-- without hyphens (-).
inferenceInputNameConfiguration_timestampFormat :: Lens.Lens' InferenceInputNameConfiguration (Prelude.Maybe Prelude.Text)
inferenceInputNameConfiguration_timestampFormat :: (Maybe Text -> f (Maybe Text))
-> InferenceInputNameConfiguration
-> f InferenceInputNameConfiguration
inferenceInputNameConfiguration_timestampFormat = (InferenceInputNameConfiguration -> Maybe Text)
-> (InferenceInputNameConfiguration
    -> Maybe Text -> InferenceInputNameConfiguration)
-> Lens
     InferenceInputNameConfiguration
     InferenceInputNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceInputNameConfiguration' {Maybe Text
timestampFormat :: Maybe Text
$sel:timestampFormat:InferenceInputNameConfiguration' :: InferenceInputNameConfiguration -> Maybe Text
timestampFormat} -> Maybe Text
timestampFormat) (\s :: InferenceInputNameConfiguration
s@InferenceInputNameConfiguration' {} Maybe Text
a -> InferenceInputNameConfiguration
s {$sel:timestampFormat:InferenceInputNameConfiguration' :: Maybe Text
timestampFormat = Maybe Text
a} :: InferenceInputNameConfiguration)

-- | Indicates the delimiter character used between items in the data.
inferenceInputNameConfiguration_componentTimestampDelimiter :: Lens.Lens' InferenceInputNameConfiguration (Prelude.Maybe Prelude.Text)
inferenceInputNameConfiguration_componentTimestampDelimiter :: (Maybe Text -> f (Maybe Text))
-> InferenceInputNameConfiguration
-> f InferenceInputNameConfiguration
inferenceInputNameConfiguration_componentTimestampDelimiter = (InferenceInputNameConfiguration -> Maybe Text)
-> (InferenceInputNameConfiguration
    -> Maybe Text -> InferenceInputNameConfiguration)
-> Lens
     InferenceInputNameConfiguration
     InferenceInputNameConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceInputNameConfiguration' {Maybe Text
componentTimestampDelimiter :: Maybe Text
$sel:componentTimestampDelimiter:InferenceInputNameConfiguration' :: InferenceInputNameConfiguration -> Maybe Text
componentTimestampDelimiter} -> Maybe Text
componentTimestampDelimiter) (\s :: InferenceInputNameConfiguration
s@InferenceInputNameConfiguration' {} Maybe Text
a -> InferenceInputNameConfiguration
s {$sel:componentTimestampDelimiter:InferenceInputNameConfiguration' :: Maybe Text
componentTimestampDelimiter = Maybe Text
a} :: InferenceInputNameConfiguration)

instance
  Core.FromJSON
    InferenceInputNameConfiguration
  where
  parseJSON :: Value -> Parser InferenceInputNameConfiguration
parseJSON =
    String
-> (Object -> Parser InferenceInputNameConfiguration)
-> Value
-> Parser InferenceInputNameConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InferenceInputNameConfiguration"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> InferenceInputNameConfiguration
InferenceInputNameConfiguration'
            (Maybe Text -> Maybe Text -> InferenceInputNameConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> InferenceInputNameConfiguration)
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
"TimestampFormat")
            Parser (Maybe Text -> InferenceInputNameConfiguration)
-> Parser (Maybe Text) -> Parser InferenceInputNameConfiguration
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
"ComponentTimestampDelimiter")
      )

instance
  Prelude.Hashable
    InferenceInputNameConfiguration

instance
  Prelude.NFData
    InferenceInputNameConfiguration

instance Core.ToJSON InferenceInputNameConfiguration where
  toJSON :: InferenceInputNameConfiguration -> Value
toJSON InferenceInputNameConfiguration' {Maybe Text
componentTimestampDelimiter :: Maybe Text
timestampFormat :: Maybe Text
$sel:componentTimestampDelimiter:InferenceInputNameConfiguration' :: InferenceInputNameConfiguration -> Maybe Text
$sel:timestampFormat:InferenceInputNameConfiguration' :: InferenceInputNameConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TimestampFormat" 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
timestampFormat,
            (Text
"ComponentTimestampDelimiter" 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
componentTimestampDelimiter
          ]
      )