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