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