{-# 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.AppStream.Types.ApplicationSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApplicationSettings = ApplicationSettings'
{
ApplicationSettings -> Maybe Text
settingsGroup :: Prelude.Maybe Prelude.Text,
ApplicationSettings -> Bool
enabled :: Prelude.Bool
}
deriving (ApplicationSettings -> ApplicationSettings -> Bool
(ApplicationSettings -> ApplicationSettings -> Bool)
-> (ApplicationSettings -> ApplicationSettings -> Bool)
-> Eq ApplicationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationSettings -> ApplicationSettings -> Bool
$c/= :: ApplicationSettings -> ApplicationSettings -> Bool
== :: ApplicationSettings -> ApplicationSettings -> Bool
$c== :: ApplicationSettings -> ApplicationSettings -> Bool
Prelude.Eq, ReadPrec [ApplicationSettings]
ReadPrec ApplicationSettings
Int -> ReadS ApplicationSettings
ReadS [ApplicationSettings]
(Int -> ReadS ApplicationSettings)
-> ReadS [ApplicationSettings]
-> ReadPrec ApplicationSettings
-> ReadPrec [ApplicationSettings]
-> Read ApplicationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationSettings]
$creadListPrec :: ReadPrec [ApplicationSettings]
readPrec :: ReadPrec ApplicationSettings
$creadPrec :: ReadPrec ApplicationSettings
readList :: ReadS [ApplicationSettings]
$creadList :: ReadS [ApplicationSettings]
readsPrec :: Int -> ReadS ApplicationSettings
$creadsPrec :: Int -> ReadS ApplicationSettings
Prelude.Read, Int -> ApplicationSettings -> ShowS
[ApplicationSettings] -> ShowS
ApplicationSettings -> String
(Int -> ApplicationSettings -> ShowS)
-> (ApplicationSettings -> String)
-> ([ApplicationSettings] -> ShowS)
-> Show ApplicationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationSettings] -> ShowS
$cshowList :: [ApplicationSettings] -> ShowS
show :: ApplicationSettings -> String
$cshow :: ApplicationSettings -> String
showsPrec :: Int -> ApplicationSettings -> ShowS
$cshowsPrec :: Int -> ApplicationSettings -> ShowS
Prelude.Show, (forall x. ApplicationSettings -> Rep ApplicationSettings x)
-> (forall x. Rep ApplicationSettings x -> ApplicationSettings)
-> Generic ApplicationSettings
forall x. Rep ApplicationSettings x -> ApplicationSettings
forall x. ApplicationSettings -> Rep ApplicationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApplicationSettings x -> ApplicationSettings
$cfrom :: forall x. ApplicationSettings -> Rep ApplicationSettings x
Prelude.Generic)
newApplicationSettings ::
Prelude.Bool ->
ApplicationSettings
newApplicationSettings :: Bool -> ApplicationSettings
newApplicationSettings Bool
pEnabled_ =
ApplicationSettings' :: Maybe Text -> Bool -> ApplicationSettings
ApplicationSettings'
{ $sel:settingsGroup:ApplicationSettings' :: Maybe Text
settingsGroup =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:ApplicationSettings' :: Bool
enabled = Bool
pEnabled_
}
applicationSettings_settingsGroup :: Lens.Lens' ApplicationSettings (Prelude.Maybe Prelude.Text)
applicationSettings_settingsGroup :: (Maybe Text -> f (Maybe Text))
-> ApplicationSettings -> f ApplicationSettings
applicationSettings_settingsGroup = (ApplicationSettings -> Maybe Text)
-> (ApplicationSettings -> Maybe Text -> ApplicationSettings)
-> Lens
ApplicationSettings ApplicationSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSettings' {Maybe Text
settingsGroup :: Maybe Text
$sel:settingsGroup:ApplicationSettings' :: ApplicationSettings -> Maybe Text
settingsGroup} -> Maybe Text
settingsGroup) (\s :: ApplicationSettings
s@ApplicationSettings' {} Maybe Text
a -> ApplicationSettings
s {$sel:settingsGroup:ApplicationSettings' :: Maybe Text
settingsGroup = Maybe Text
a} :: ApplicationSettings)
applicationSettings_enabled :: Lens.Lens' ApplicationSettings Prelude.Bool
applicationSettings_enabled :: (Bool -> f Bool) -> ApplicationSettings -> f ApplicationSettings
applicationSettings_enabled = (ApplicationSettings -> Bool)
-> (ApplicationSettings -> Bool -> ApplicationSettings)
-> Lens ApplicationSettings ApplicationSettings Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSettings' {Bool
enabled :: Bool
$sel:enabled:ApplicationSettings' :: ApplicationSettings -> Bool
enabled} -> Bool
enabled) (\s :: ApplicationSettings
s@ApplicationSettings' {} Bool
a -> ApplicationSettings
s {$sel:enabled:ApplicationSettings' :: Bool
enabled = Bool
a} :: ApplicationSettings)
instance Prelude.Hashable ApplicationSettings
instance Prelude.NFData ApplicationSettings
instance Core.ToJSON ApplicationSettings where
toJSON :: ApplicationSettings -> Value
toJSON ApplicationSettings' {Bool
Maybe Text
enabled :: Bool
settingsGroup :: Maybe Text
$sel:enabled:ApplicationSettings' :: ApplicationSettings -> Bool
$sel:settingsGroup:ApplicationSettings' :: ApplicationSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SettingsGroup" 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
settingsGroup,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
enabled)
]
)