{-# 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.Firehose.Types.DynamicPartitioningConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types.RetryOptions
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DynamicPartitioningConfiguration = DynamicPartitioningConfiguration'
{
DynamicPartitioningConfiguration -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
DynamicPartitioningConfiguration -> Maybe RetryOptions
retryOptions :: Prelude.Maybe RetryOptions
}
deriving (DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool
(DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool)
-> (DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool)
-> Eq DynamicPartitioningConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool
$c/= :: DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool
== :: DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool
$c== :: DynamicPartitioningConfiguration
-> DynamicPartitioningConfiguration -> Bool
Prelude.Eq, ReadPrec [DynamicPartitioningConfiguration]
ReadPrec DynamicPartitioningConfiguration
Int -> ReadS DynamicPartitioningConfiguration
ReadS [DynamicPartitioningConfiguration]
(Int -> ReadS DynamicPartitioningConfiguration)
-> ReadS [DynamicPartitioningConfiguration]
-> ReadPrec DynamicPartitioningConfiguration
-> ReadPrec [DynamicPartitioningConfiguration]
-> Read DynamicPartitioningConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DynamicPartitioningConfiguration]
$creadListPrec :: ReadPrec [DynamicPartitioningConfiguration]
readPrec :: ReadPrec DynamicPartitioningConfiguration
$creadPrec :: ReadPrec DynamicPartitioningConfiguration
readList :: ReadS [DynamicPartitioningConfiguration]
$creadList :: ReadS [DynamicPartitioningConfiguration]
readsPrec :: Int -> ReadS DynamicPartitioningConfiguration
$creadsPrec :: Int -> ReadS DynamicPartitioningConfiguration
Prelude.Read, Int -> DynamicPartitioningConfiguration -> ShowS
[DynamicPartitioningConfiguration] -> ShowS
DynamicPartitioningConfiguration -> String
(Int -> DynamicPartitioningConfiguration -> ShowS)
-> (DynamicPartitioningConfiguration -> String)
-> ([DynamicPartitioningConfiguration] -> ShowS)
-> Show DynamicPartitioningConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DynamicPartitioningConfiguration] -> ShowS
$cshowList :: [DynamicPartitioningConfiguration] -> ShowS
show :: DynamicPartitioningConfiguration -> String
$cshow :: DynamicPartitioningConfiguration -> String
showsPrec :: Int -> DynamicPartitioningConfiguration -> ShowS
$cshowsPrec :: Int -> DynamicPartitioningConfiguration -> ShowS
Prelude.Show, (forall x.
DynamicPartitioningConfiguration
-> Rep DynamicPartitioningConfiguration x)
-> (forall x.
Rep DynamicPartitioningConfiguration x
-> DynamicPartitioningConfiguration)
-> Generic DynamicPartitioningConfiguration
forall x.
Rep DynamicPartitioningConfiguration x
-> DynamicPartitioningConfiguration
forall x.
DynamicPartitioningConfiguration
-> Rep DynamicPartitioningConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DynamicPartitioningConfiguration x
-> DynamicPartitioningConfiguration
$cfrom :: forall x.
DynamicPartitioningConfiguration
-> Rep DynamicPartitioningConfiguration x
Prelude.Generic)
newDynamicPartitioningConfiguration ::
DynamicPartitioningConfiguration
newDynamicPartitioningConfiguration :: DynamicPartitioningConfiguration
newDynamicPartitioningConfiguration =
DynamicPartitioningConfiguration' :: Maybe Bool
-> Maybe RetryOptions -> DynamicPartitioningConfiguration
DynamicPartitioningConfiguration'
{ $sel:enabled:DynamicPartitioningConfiguration' :: Maybe Bool
enabled =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:retryOptions:DynamicPartitioningConfiguration' :: Maybe RetryOptions
retryOptions = Maybe RetryOptions
forall a. Maybe a
Prelude.Nothing
}
dynamicPartitioningConfiguration_enabled :: Lens.Lens' DynamicPartitioningConfiguration (Prelude.Maybe Prelude.Bool)
dynamicPartitioningConfiguration_enabled :: (Maybe Bool -> f (Maybe Bool))
-> DynamicPartitioningConfiguration
-> f DynamicPartitioningConfiguration
dynamicPartitioningConfiguration_enabled = (DynamicPartitioningConfiguration -> Maybe Bool)
-> (DynamicPartitioningConfiguration
-> Maybe Bool -> DynamicPartitioningConfiguration)
-> Lens
DynamicPartitioningConfiguration
DynamicPartitioningConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DynamicPartitioningConfiguration' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:DynamicPartitioningConfiguration' :: DynamicPartitioningConfiguration -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: DynamicPartitioningConfiguration
s@DynamicPartitioningConfiguration' {} Maybe Bool
a -> DynamicPartitioningConfiguration
s {$sel:enabled:DynamicPartitioningConfiguration' :: Maybe Bool
enabled = Maybe Bool
a} :: DynamicPartitioningConfiguration)
dynamicPartitioningConfiguration_retryOptions :: Lens.Lens' DynamicPartitioningConfiguration (Prelude.Maybe RetryOptions)
dynamicPartitioningConfiguration_retryOptions :: (Maybe RetryOptions -> f (Maybe RetryOptions))
-> DynamicPartitioningConfiguration
-> f DynamicPartitioningConfiguration
dynamicPartitioningConfiguration_retryOptions = (DynamicPartitioningConfiguration -> Maybe RetryOptions)
-> (DynamicPartitioningConfiguration
-> Maybe RetryOptions -> DynamicPartitioningConfiguration)
-> Lens
DynamicPartitioningConfiguration
DynamicPartitioningConfiguration
(Maybe RetryOptions)
(Maybe RetryOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DynamicPartitioningConfiguration' {Maybe RetryOptions
retryOptions :: Maybe RetryOptions
$sel:retryOptions:DynamicPartitioningConfiguration' :: DynamicPartitioningConfiguration -> Maybe RetryOptions
retryOptions} -> Maybe RetryOptions
retryOptions) (\s :: DynamicPartitioningConfiguration
s@DynamicPartitioningConfiguration' {} Maybe RetryOptions
a -> DynamicPartitioningConfiguration
s {$sel:retryOptions:DynamicPartitioningConfiguration' :: Maybe RetryOptions
retryOptions = Maybe RetryOptions
a} :: DynamicPartitioningConfiguration)
instance
Core.FromJSON
DynamicPartitioningConfiguration
where
parseJSON :: Value -> Parser DynamicPartitioningConfiguration
parseJSON =
String
-> (Object -> Parser DynamicPartitioningConfiguration)
-> Value
-> Parser DynamicPartitioningConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DynamicPartitioningConfiguration"
( \Object
x ->
Maybe Bool
-> Maybe RetryOptions -> DynamicPartitioningConfiguration
DynamicPartitioningConfiguration'
(Maybe Bool
-> Maybe RetryOptions -> DynamicPartitioningConfiguration)
-> Parser (Maybe Bool)
-> Parser (Maybe RetryOptions -> DynamicPartitioningConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
Parser (Maybe RetryOptions -> DynamicPartitioningConfiguration)
-> Parser (Maybe RetryOptions)
-> Parser DynamicPartitioningConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RetryOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RetryOptions")
)
instance
Prelude.Hashable
DynamicPartitioningConfiguration
instance
Prelude.NFData
DynamicPartitioningConfiguration
instance Core.ToJSON DynamicPartitioningConfiguration where
toJSON :: DynamicPartitioningConfiguration -> Value
toJSON DynamicPartitioningConfiguration' {Maybe Bool
Maybe RetryOptions
retryOptions :: Maybe RetryOptions
enabled :: Maybe Bool
$sel:retryOptions:DynamicPartitioningConfiguration' :: DynamicPartitioningConfiguration -> Maybe RetryOptions
$sel:enabled:DynamicPartitioningConfiguration' :: DynamicPartitioningConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
(Text
"RetryOptions" Text -> RetryOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RetryOptions -> Pair) -> Maybe RetryOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetryOptions
retryOptions
]
)