{-# 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 #-}
module Amazonka.Forecast.Types.InputDataConfig where
import qualified Amazonka.Core as Core
import Amazonka.Forecast.Types.SupplementaryFeature
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputDataConfig = InputDataConfig'
{
InputDataConfig -> Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures :: Prelude.Maybe (Prelude.NonEmpty SupplementaryFeature),
InputDataConfig -> Text
datasetGroupArn :: Prelude.Text
}
deriving (InputDataConfig -> InputDataConfig -> Bool
(InputDataConfig -> InputDataConfig -> Bool)
-> (InputDataConfig -> InputDataConfig -> Bool)
-> Eq InputDataConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputDataConfig -> InputDataConfig -> Bool
$c/= :: InputDataConfig -> InputDataConfig -> Bool
== :: InputDataConfig -> InputDataConfig -> Bool
$c== :: InputDataConfig -> InputDataConfig -> Bool
Prelude.Eq, ReadPrec [InputDataConfig]
ReadPrec InputDataConfig
Int -> ReadS InputDataConfig
ReadS [InputDataConfig]
(Int -> ReadS InputDataConfig)
-> ReadS [InputDataConfig]
-> ReadPrec InputDataConfig
-> ReadPrec [InputDataConfig]
-> Read InputDataConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputDataConfig]
$creadListPrec :: ReadPrec [InputDataConfig]
readPrec :: ReadPrec InputDataConfig
$creadPrec :: ReadPrec InputDataConfig
readList :: ReadS [InputDataConfig]
$creadList :: ReadS [InputDataConfig]
readsPrec :: Int -> ReadS InputDataConfig
$creadsPrec :: Int -> ReadS InputDataConfig
Prelude.Read, Int -> InputDataConfig -> ShowS
[InputDataConfig] -> ShowS
InputDataConfig -> String
(Int -> InputDataConfig -> ShowS)
-> (InputDataConfig -> String)
-> ([InputDataConfig] -> ShowS)
-> Show InputDataConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputDataConfig] -> ShowS
$cshowList :: [InputDataConfig] -> ShowS
show :: InputDataConfig -> String
$cshow :: InputDataConfig -> String
showsPrec :: Int -> InputDataConfig -> ShowS
$cshowsPrec :: Int -> InputDataConfig -> ShowS
Prelude.Show, (forall x. InputDataConfig -> Rep InputDataConfig x)
-> (forall x. Rep InputDataConfig x -> InputDataConfig)
-> Generic InputDataConfig
forall x. Rep InputDataConfig x -> InputDataConfig
forall x. InputDataConfig -> Rep InputDataConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputDataConfig x -> InputDataConfig
$cfrom :: forall x. InputDataConfig -> Rep InputDataConfig x
Prelude.Generic)
newInputDataConfig ::
Prelude.Text ->
InputDataConfig
newInputDataConfig :: Text -> InputDataConfig
newInputDataConfig Text
pDatasetGroupArn_ =
InputDataConfig' :: Maybe (NonEmpty SupplementaryFeature) -> Text -> InputDataConfig
InputDataConfig'
{ $sel:supplementaryFeatures:InputDataConfig' :: Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures =
Maybe (NonEmpty SupplementaryFeature)
forall a. Maybe a
Prelude.Nothing,
$sel:datasetGroupArn:InputDataConfig' :: Text
datasetGroupArn = Text
pDatasetGroupArn_
}
inputDataConfig_supplementaryFeatures :: Lens.Lens' InputDataConfig (Prelude.Maybe (Prelude.NonEmpty SupplementaryFeature))
inputDataConfig_supplementaryFeatures :: (Maybe (NonEmpty SupplementaryFeature)
-> f (Maybe (NonEmpty SupplementaryFeature)))
-> InputDataConfig -> f InputDataConfig
inputDataConfig_supplementaryFeatures = (InputDataConfig -> Maybe (NonEmpty SupplementaryFeature))
-> (InputDataConfig
-> Maybe (NonEmpty SupplementaryFeature) -> InputDataConfig)
-> Lens
InputDataConfig
InputDataConfig
(Maybe (NonEmpty SupplementaryFeature))
(Maybe (NonEmpty SupplementaryFeature))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDataConfig' {Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures :: Maybe (NonEmpty SupplementaryFeature)
$sel:supplementaryFeatures:InputDataConfig' :: InputDataConfig -> Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures} -> Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures) (\s :: InputDataConfig
s@InputDataConfig' {} Maybe (NonEmpty SupplementaryFeature)
a -> InputDataConfig
s {$sel:supplementaryFeatures:InputDataConfig' :: Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures = Maybe (NonEmpty SupplementaryFeature)
a} :: InputDataConfig) ((Maybe (NonEmpty SupplementaryFeature)
-> f (Maybe (NonEmpty SupplementaryFeature)))
-> InputDataConfig -> f InputDataConfig)
-> ((Maybe (NonEmpty SupplementaryFeature)
-> f (Maybe (NonEmpty SupplementaryFeature)))
-> Maybe (NonEmpty SupplementaryFeature)
-> f (Maybe (NonEmpty SupplementaryFeature)))
-> (Maybe (NonEmpty SupplementaryFeature)
-> f (Maybe (NonEmpty SupplementaryFeature)))
-> InputDataConfig
-> f InputDataConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty SupplementaryFeature)
(NonEmpty SupplementaryFeature)
(NonEmpty SupplementaryFeature)
(NonEmpty SupplementaryFeature)
-> Iso
(Maybe (NonEmpty SupplementaryFeature))
(Maybe (NonEmpty SupplementaryFeature))
(Maybe (NonEmpty SupplementaryFeature))
(Maybe (NonEmpty SupplementaryFeature))
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 AnIso
(NonEmpty SupplementaryFeature)
(NonEmpty SupplementaryFeature)
(NonEmpty SupplementaryFeature)
(NonEmpty SupplementaryFeature)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
inputDataConfig_datasetGroupArn :: Lens.Lens' InputDataConfig Prelude.Text
inputDataConfig_datasetGroupArn :: (Text -> f Text) -> InputDataConfig -> f InputDataConfig
inputDataConfig_datasetGroupArn = (InputDataConfig -> Text)
-> (InputDataConfig -> Text -> InputDataConfig)
-> Lens InputDataConfig InputDataConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDataConfig' {Text
datasetGroupArn :: Text
$sel:datasetGroupArn:InputDataConfig' :: InputDataConfig -> Text
datasetGroupArn} -> Text
datasetGroupArn) (\s :: InputDataConfig
s@InputDataConfig' {} Text
a -> InputDataConfig
s {$sel:datasetGroupArn:InputDataConfig' :: Text
datasetGroupArn = Text
a} :: InputDataConfig)
instance Core.FromJSON InputDataConfig where
parseJSON :: Value -> Parser InputDataConfig
parseJSON =
String
-> (Object -> Parser InputDataConfig)
-> Value
-> Parser InputDataConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputDataConfig"
( \Object
x ->
Maybe (NonEmpty SupplementaryFeature) -> Text -> InputDataConfig
InputDataConfig'
(Maybe (NonEmpty SupplementaryFeature) -> Text -> InputDataConfig)
-> Parser (Maybe (NonEmpty SupplementaryFeature))
-> Parser (Text -> InputDataConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty SupplementaryFeature))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SupplementaryFeatures")
Parser (Text -> InputDataConfig)
-> Parser Text -> Parser InputDataConfig
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
"DatasetGroupArn")
)
instance Prelude.Hashable InputDataConfig
instance Prelude.NFData InputDataConfig
instance Core.ToJSON InputDataConfig where
toJSON :: InputDataConfig -> Value
toJSON InputDataConfig' {Maybe (NonEmpty SupplementaryFeature)
Text
datasetGroupArn :: Text
supplementaryFeatures :: Maybe (NonEmpty SupplementaryFeature)
$sel:datasetGroupArn:InputDataConfig' :: InputDataConfig -> Text
$sel:supplementaryFeatures:InputDataConfig' :: InputDataConfig -> Maybe (NonEmpty SupplementaryFeature)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SupplementaryFeatures" Text -> NonEmpty SupplementaryFeature -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty SupplementaryFeature -> Pair)
-> Maybe (NonEmpty SupplementaryFeature) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SupplementaryFeature)
supplementaryFeatures,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DatasetGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetGroupArn)
]
)