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