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