{-# 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.Kafka.Types.Unauthenticated where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Unauthenticated = Unauthenticated'
{
Unauthenticated -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
}
deriving (Unauthenticated -> Unauthenticated -> Bool
(Unauthenticated -> Unauthenticated -> Bool)
-> (Unauthenticated -> Unauthenticated -> Bool)
-> Eq Unauthenticated
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Unauthenticated -> Unauthenticated -> Bool
$c/= :: Unauthenticated -> Unauthenticated -> Bool
== :: Unauthenticated -> Unauthenticated -> Bool
$c== :: Unauthenticated -> Unauthenticated -> Bool
Prelude.Eq, ReadPrec [Unauthenticated]
ReadPrec Unauthenticated
Int -> ReadS Unauthenticated
ReadS [Unauthenticated]
(Int -> ReadS Unauthenticated)
-> ReadS [Unauthenticated]
-> ReadPrec Unauthenticated
-> ReadPrec [Unauthenticated]
-> Read Unauthenticated
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Unauthenticated]
$creadListPrec :: ReadPrec [Unauthenticated]
readPrec :: ReadPrec Unauthenticated
$creadPrec :: ReadPrec Unauthenticated
readList :: ReadS [Unauthenticated]
$creadList :: ReadS [Unauthenticated]
readsPrec :: Int -> ReadS Unauthenticated
$creadsPrec :: Int -> ReadS Unauthenticated
Prelude.Read, Int -> Unauthenticated -> ShowS
[Unauthenticated] -> ShowS
Unauthenticated -> String
(Int -> Unauthenticated -> ShowS)
-> (Unauthenticated -> String)
-> ([Unauthenticated] -> ShowS)
-> Show Unauthenticated
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Unauthenticated] -> ShowS
$cshowList :: [Unauthenticated] -> ShowS
show :: Unauthenticated -> String
$cshow :: Unauthenticated -> String
showsPrec :: Int -> Unauthenticated -> ShowS
$cshowsPrec :: Int -> Unauthenticated -> ShowS
Prelude.Show, (forall x. Unauthenticated -> Rep Unauthenticated x)
-> (forall x. Rep Unauthenticated x -> Unauthenticated)
-> Generic Unauthenticated
forall x. Rep Unauthenticated x -> Unauthenticated
forall x. Unauthenticated -> Rep Unauthenticated x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Unauthenticated x -> Unauthenticated
$cfrom :: forall x. Unauthenticated -> Rep Unauthenticated x
Prelude.Generic)
newUnauthenticated ::
Unauthenticated
newUnauthenticated :: Unauthenticated
newUnauthenticated =
Unauthenticated' :: Maybe Bool -> Unauthenticated
Unauthenticated' {$sel:enabled:Unauthenticated' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing}
unauthenticated_enabled :: Lens.Lens' Unauthenticated (Prelude.Maybe Prelude.Bool)
unauthenticated_enabled :: (Maybe Bool -> f (Maybe Bool))
-> Unauthenticated -> f Unauthenticated
unauthenticated_enabled = (Unauthenticated -> Maybe Bool)
-> (Unauthenticated -> Maybe Bool -> Unauthenticated)
-> Lens Unauthenticated Unauthenticated (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Unauthenticated' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:Unauthenticated' :: Unauthenticated -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: Unauthenticated
s@Unauthenticated' {} Maybe Bool
a -> Unauthenticated
s {$sel:enabled:Unauthenticated' :: Maybe Bool
enabled = Maybe Bool
a} :: Unauthenticated)
instance Core.FromJSON Unauthenticated where
parseJSON :: Value -> Parser Unauthenticated
parseJSON =
String
-> (Object -> Parser Unauthenticated)
-> Value
-> Parser Unauthenticated
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Unauthenticated"
( \Object
x ->
Maybe Bool -> Unauthenticated
Unauthenticated' (Maybe Bool -> Unauthenticated)
-> Parser (Maybe Bool) -> Parser Unauthenticated
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")
)
instance Prelude.Hashable Unauthenticated
instance Prelude.NFData Unauthenticated
instance Core.ToJSON Unauthenticated where
toJSON :: Unauthenticated -> Value
toJSON Unauthenticated' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:Unauthenticated' :: Unauthenticated -> 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]
)