{-# 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.Evidently.Types.OnlineAbConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data OnlineAbConfig = OnlineAbConfig'
{
OnlineAbConfig -> Maybe Text
controlTreatmentName :: Prelude.Maybe Prelude.Text,
OnlineAbConfig -> Maybe (HashMap Text Natural)
treatmentWeights :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Natural)
}
deriving (OnlineAbConfig -> OnlineAbConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OnlineAbConfig -> OnlineAbConfig -> Bool
$c/= :: OnlineAbConfig -> OnlineAbConfig -> Bool
== :: OnlineAbConfig -> OnlineAbConfig -> Bool
$c== :: OnlineAbConfig -> OnlineAbConfig -> Bool
Prelude.Eq, ReadPrec [OnlineAbConfig]
ReadPrec OnlineAbConfig
Int -> ReadS OnlineAbConfig
ReadS [OnlineAbConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OnlineAbConfig]
$creadListPrec :: ReadPrec [OnlineAbConfig]
readPrec :: ReadPrec OnlineAbConfig
$creadPrec :: ReadPrec OnlineAbConfig
readList :: ReadS [OnlineAbConfig]
$creadList :: ReadS [OnlineAbConfig]
readsPrec :: Int -> ReadS OnlineAbConfig
$creadsPrec :: Int -> ReadS OnlineAbConfig
Prelude.Read, Int -> OnlineAbConfig -> ShowS
[OnlineAbConfig] -> ShowS
OnlineAbConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OnlineAbConfig] -> ShowS
$cshowList :: [OnlineAbConfig] -> ShowS
show :: OnlineAbConfig -> String
$cshow :: OnlineAbConfig -> String
showsPrec :: Int -> OnlineAbConfig -> ShowS
$cshowsPrec :: Int -> OnlineAbConfig -> ShowS
Prelude.Show, forall x. Rep OnlineAbConfig x -> OnlineAbConfig
forall x. OnlineAbConfig -> Rep OnlineAbConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OnlineAbConfig x -> OnlineAbConfig
$cfrom :: forall x. OnlineAbConfig -> Rep OnlineAbConfig x
Prelude.Generic)
newOnlineAbConfig ::
OnlineAbConfig
newOnlineAbConfig :: OnlineAbConfig
newOnlineAbConfig =
OnlineAbConfig'
{ $sel:controlTreatmentName:OnlineAbConfig' :: Maybe Text
controlTreatmentName =
forall a. Maybe a
Prelude.Nothing,
$sel:treatmentWeights:OnlineAbConfig' :: Maybe (HashMap Text Natural)
treatmentWeights = forall a. Maybe a
Prelude.Nothing
}
onlineAbConfig_controlTreatmentName :: Lens.Lens' OnlineAbConfig (Prelude.Maybe Prelude.Text)
onlineAbConfig_controlTreatmentName :: Lens' OnlineAbConfig (Maybe Text)
onlineAbConfig_controlTreatmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OnlineAbConfig' {Maybe Text
controlTreatmentName :: Maybe Text
$sel:controlTreatmentName:OnlineAbConfig' :: OnlineAbConfig -> Maybe Text
controlTreatmentName} -> Maybe Text
controlTreatmentName) (\s :: OnlineAbConfig
s@OnlineAbConfig' {} Maybe Text
a -> OnlineAbConfig
s {$sel:controlTreatmentName:OnlineAbConfig' :: Maybe Text
controlTreatmentName = Maybe Text
a} :: OnlineAbConfig)
onlineAbConfig_treatmentWeights :: Lens.Lens' OnlineAbConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Natural))
onlineAbConfig_treatmentWeights :: Lens' OnlineAbConfig (Maybe (HashMap Text Natural))
onlineAbConfig_treatmentWeights = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OnlineAbConfig' {Maybe (HashMap Text Natural)
treatmentWeights :: Maybe (HashMap Text Natural)
$sel:treatmentWeights:OnlineAbConfig' :: OnlineAbConfig -> Maybe (HashMap Text Natural)
treatmentWeights} -> Maybe (HashMap Text Natural)
treatmentWeights) (\s :: OnlineAbConfig
s@OnlineAbConfig' {} Maybe (HashMap Text Natural)
a -> OnlineAbConfig
s {$sel:treatmentWeights:OnlineAbConfig' :: Maybe (HashMap Text Natural)
treatmentWeights = Maybe (HashMap Text Natural)
a} :: OnlineAbConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable OnlineAbConfig where
hashWithSalt :: Int -> OnlineAbConfig -> Int
hashWithSalt Int
_salt OnlineAbConfig' {Maybe Text
Maybe (HashMap Text Natural)
treatmentWeights :: Maybe (HashMap Text Natural)
controlTreatmentName :: Maybe Text
$sel:treatmentWeights:OnlineAbConfig' :: OnlineAbConfig -> Maybe (HashMap Text Natural)
$sel:controlTreatmentName:OnlineAbConfig' :: OnlineAbConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
controlTreatmentName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Natural)
treatmentWeights
instance Prelude.NFData OnlineAbConfig where
rnf :: OnlineAbConfig -> ()
rnf OnlineAbConfig' {Maybe Text
Maybe (HashMap Text Natural)
treatmentWeights :: Maybe (HashMap Text Natural)
controlTreatmentName :: Maybe Text
$sel:treatmentWeights:OnlineAbConfig' :: OnlineAbConfig -> Maybe (HashMap Text Natural)
$sel:controlTreatmentName:OnlineAbConfig' :: OnlineAbConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
controlTreatmentName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Natural)
treatmentWeights
instance Data.ToJSON OnlineAbConfig where
toJSON :: OnlineAbConfig -> Value
toJSON OnlineAbConfig' {Maybe Text
Maybe (HashMap Text Natural)
treatmentWeights :: Maybe (HashMap Text Natural)
controlTreatmentName :: Maybe Text
$sel:treatmentWeights:OnlineAbConfig' :: OnlineAbConfig -> Maybe (HashMap Text Natural)
$sel:controlTreatmentName:OnlineAbConfig' :: OnlineAbConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"controlTreatmentName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
controlTreatmentName,
(Key
"treatmentWeights" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Natural)
treatmentWeights
]
)