{-# 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.VirtualGatewayFileAccessLog where
import Amazonka.AppMesh.Types.LoggingFormat
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 VirtualGatewayFileAccessLog = VirtualGatewayFileAccessLog'
{
VirtualGatewayFileAccessLog -> Maybe LoggingFormat
format :: Prelude.Maybe LoggingFormat,
VirtualGatewayFileAccessLog -> Text
path :: Prelude.Text
}
deriving (VirtualGatewayFileAccessLog -> VirtualGatewayFileAccessLog -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualGatewayFileAccessLog -> VirtualGatewayFileAccessLog -> Bool
$c/= :: VirtualGatewayFileAccessLog -> VirtualGatewayFileAccessLog -> Bool
== :: VirtualGatewayFileAccessLog -> VirtualGatewayFileAccessLog -> Bool
$c== :: VirtualGatewayFileAccessLog -> VirtualGatewayFileAccessLog -> Bool
Prelude.Eq, ReadPrec [VirtualGatewayFileAccessLog]
ReadPrec VirtualGatewayFileAccessLog
Int -> ReadS VirtualGatewayFileAccessLog
ReadS [VirtualGatewayFileAccessLog]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VirtualGatewayFileAccessLog]
$creadListPrec :: ReadPrec [VirtualGatewayFileAccessLog]
readPrec :: ReadPrec VirtualGatewayFileAccessLog
$creadPrec :: ReadPrec VirtualGatewayFileAccessLog
readList :: ReadS [VirtualGatewayFileAccessLog]
$creadList :: ReadS [VirtualGatewayFileAccessLog]
readsPrec :: Int -> ReadS VirtualGatewayFileAccessLog
$creadsPrec :: Int -> ReadS VirtualGatewayFileAccessLog
Prelude.Read, Int -> VirtualGatewayFileAccessLog -> ShowS
[VirtualGatewayFileAccessLog] -> ShowS
VirtualGatewayFileAccessLog -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualGatewayFileAccessLog] -> ShowS
$cshowList :: [VirtualGatewayFileAccessLog] -> ShowS
show :: VirtualGatewayFileAccessLog -> String
$cshow :: VirtualGatewayFileAccessLog -> String
showsPrec :: Int -> VirtualGatewayFileAccessLog -> ShowS
$cshowsPrec :: Int -> VirtualGatewayFileAccessLog -> ShowS
Prelude.Show, forall x.
Rep VirtualGatewayFileAccessLog x -> VirtualGatewayFileAccessLog
forall x.
VirtualGatewayFileAccessLog -> Rep VirtualGatewayFileAccessLog x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VirtualGatewayFileAccessLog x -> VirtualGatewayFileAccessLog
$cfrom :: forall x.
VirtualGatewayFileAccessLog -> Rep VirtualGatewayFileAccessLog x
Prelude.Generic)
newVirtualGatewayFileAccessLog ::
Prelude.Text ->
VirtualGatewayFileAccessLog
newVirtualGatewayFileAccessLog :: Text -> VirtualGatewayFileAccessLog
newVirtualGatewayFileAccessLog Text
pPath_ =
VirtualGatewayFileAccessLog'
{ $sel:format:VirtualGatewayFileAccessLog' :: Maybe LoggingFormat
format =
forall a. Maybe a
Prelude.Nothing,
$sel:path:VirtualGatewayFileAccessLog' :: Text
path = Text
pPath_
}
virtualGatewayFileAccessLog_format :: Lens.Lens' VirtualGatewayFileAccessLog (Prelude.Maybe LoggingFormat)
virtualGatewayFileAccessLog_format :: Lens' VirtualGatewayFileAccessLog (Maybe LoggingFormat)
virtualGatewayFileAccessLog_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayFileAccessLog' {Maybe LoggingFormat
format :: Maybe LoggingFormat
$sel:format:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Maybe LoggingFormat
format} -> Maybe LoggingFormat
format) (\s :: VirtualGatewayFileAccessLog
s@VirtualGatewayFileAccessLog' {} Maybe LoggingFormat
a -> VirtualGatewayFileAccessLog
s {$sel:format:VirtualGatewayFileAccessLog' :: Maybe LoggingFormat
format = Maybe LoggingFormat
a} :: VirtualGatewayFileAccessLog)
virtualGatewayFileAccessLog_path :: Lens.Lens' VirtualGatewayFileAccessLog Prelude.Text
virtualGatewayFileAccessLog_path :: Lens' VirtualGatewayFileAccessLog Text
virtualGatewayFileAccessLog_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayFileAccessLog' {Text
path :: Text
$sel:path:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Text
path} -> Text
path) (\s :: VirtualGatewayFileAccessLog
s@VirtualGatewayFileAccessLog' {} Text
a -> VirtualGatewayFileAccessLog
s {$sel:path:VirtualGatewayFileAccessLog' :: Text
path = Text
a} :: VirtualGatewayFileAccessLog)
instance Data.FromJSON VirtualGatewayFileAccessLog where
parseJSON :: Value -> Parser VirtualGatewayFileAccessLog
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"VirtualGatewayFileAccessLog"
( \Object
x ->
Maybe LoggingFormat -> Text -> VirtualGatewayFileAccessLog
VirtualGatewayFileAccessLog'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"format")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"path")
)
instance Prelude.Hashable VirtualGatewayFileAccessLog where
hashWithSalt :: Int -> VirtualGatewayFileAccessLog -> Int
hashWithSalt Int
_salt VirtualGatewayFileAccessLog' {Maybe LoggingFormat
Text
path :: Text
format :: Maybe LoggingFormat
$sel:path:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Text
$sel:format:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Maybe LoggingFormat
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoggingFormat
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
path
instance Prelude.NFData VirtualGatewayFileAccessLog where
rnf :: VirtualGatewayFileAccessLog -> ()
rnf VirtualGatewayFileAccessLog' {Maybe LoggingFormat
Text
path :: Text
format :: Maybe LoggingFormat
$sel:path:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Text
$sel:format:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Maybe LoggingFormat
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe LoggingFormat
format seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
path
instance Data.ToJSON VirtualGatewayFileAccessLog where
toJSON :: VirtualGatewayFileAccessLog -> Value
toJSON VirtualGatewayFileAccessLog' {Maybe LoggingFormat
Text
path :: Text
format :: Maybe LoggingFormat
$sel:path:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Text
$sel:format:VirtualGatewayFileAccessLog' :: VirtualGatewayFileAccessLog -> Maybe LoggingFormat
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"format" 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 LoggingFormat
format,
forall a. a -> Maybe a
Prelude.Just (Key
"path" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
path)
]
)