{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.NetworkFirewall.DescribeLoggingConfiguration
(
DescribeLoggingConfiguration (..),
newDescribeLoggingConfiguration,
describeLoggingConfiguration_firewallArn,
describeLoggingConfiguration_firewallName,
DescribeLoggingConfigurationResponse (..),
newDescribeLoggingConfigurationResponse,
describeLoggingConfigurationResponse_firewallArn,
describeLoggingConfigurationResponse_loggingConfiguration,
describeLoggingConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeLoggingConfiguration = DescribeLoggingConfiguration'
{
DescribeLoggingConfiguration -> Maybe Text
firewallArn :: Prelude.Maybe Prelude.Text,
DescribeLoggingConfiguration -> Maybe Text
firewallName :: Prelude.Maybe Prelude.Text
}
deriving (DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool
(DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool)
-> (DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool)
-> Eq DescribeLoggingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool
$c/= :: DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool
== :: DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool
$c== :: DescribeLoggingConfiguration
-> DescribeLoggingConfiguration -> Bool
Prelude.Eq, ReadPrec [DescribeLoggingConfiguration]
ReadPrec DescribeLoggingConfiguration
Int -> ReadS DescribeLoggingConfiguration
ReadS [DescribeLoggingConfiguration]
(Int -> ReadS DescribeLoggingConfiguration)
-> ReadS [DescribeLoggingConfiguration]
-> ReadPrec DescribeLoggingConfiguration
-> ReadPrec [DescribeLoggingConfiguration]
-> Read DescribeLoggingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLoggingConfiguration]
$creadListPrec :: ReadPrec [DescribeLoggingConfiguration]
readPrec :: ReadPrec DescribeLoggingConfiguration
$creadPrec :: ReadPrec DescribeLoggingConfiguration
readList :: ReadS [DescribeLoggingConfiguration]
$creadList :: ReadS [DescribeLoggingConfiguration]
readsPrec :: Int -> ReadS DescribeLoggingConfiguration
$creadsPrec :: Int -> ReadS DescribeLoggingConfiguration
Prelude.Read, Int -> DescribeLoggingConfiguration -> ShowS
[DescribeLoggingConfiguration] -> ShowS
DescribeLoggingConfiguration -> String
(Int -> DescribeLoggingConfiguration -> ShowS)
-> (DescribeLoggingConfiguration -> String)
-> ([DescribeLoggingConfiguration] -> ShowS)
-> Show DescribeLoggingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLoggingConfiguration] -> ShowS
$cshowList :: [DescribeLoggingConfiguration] -> ShowS
show :: DescribeLoggingConfiguration -> String
$cshow :: DescribeLoggingConfiguration -> String
showsPrec :: Int -> DescribeLoggingConfiguration -> ShowS
$cshowsPrec :: Int -> DescribeLoggingConfiguration -> ShowS
Prelude.Show, (forall x.
DescribeLoggingConfiguration -> Rep DescribeLoggingConfiguration x)
-> (forall x.
Rep DescribeLoggingConfiguration x -> DescribeLoggingConfiguration)
-> Generic DescribeLoggingConfiguration
forall x.
Rep DescribeLoggingConfiguration x -> DescribeLoggingConfiguration
forall x.
DescribeLoggingConfiguration -> Rep DescribeLoggingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLoggingConfiguration x -> DescribeLoggingConfiguration
$cfrom :: forall x.
DescribeLoggingConfiguration -> Rep DescribeLoggingConfiguration x
Prelude.Generic)
newDescribeLoggingConfiguration ::
DescribeLoggingConfiguration
newDescribeLoggingConfiguration :: DescribeLoggingConfiguration
newDescribeLoggingConfiguration =
DescribeLoggingConfiguration' :: Maybe Text -> Maybe Text -> DescribeLoggingConfiguration
DescribeLoggingConfiguration'
{ $sel:firewallArn:DescribeLoggingConfiguration' :: Maybe Text
firewallArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:firewallName:DescribeLoggingConfiguration' :: Maybe Text
firewallName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeLoggingConfiguration_firewallArn :: Lens.Lens' DescribeLoggingConfiguration (Prelude.Maybe Prelude.Text)
describeLoggingConfiguration_firewallArn :: (Maybe Text -> f (Maybe Text))
-> DescribeLoggingConfiguration -> f DescribeLoggingConfiguration
describeLoggingConfiguration_firewallArn = (DescribeLoggingConfiguration -> Maybe Text)
-> (DescribeLoggingConfiguration
-> Maybe Text -> DescribeLoggingConfiguration)
-> Lens
DescribeLoggingConfiguration
DescribeLoggingConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingConfiguration' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:DescribeLoggingConfiguration' :: DescribeLoggingConfiguration -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: DescribeLoggingConfiguration
s@DescribeLoggingConfiguration' {} Maybe Text
a -> DescribeLoggingConfiguration
s {$sel:firewallArn:DescribeLoggingConfiguration' :: Maybe Text
firewallArn = Maybe Text
a} :: DescribeLoggingConfiguration)
describeLoggingConfiguration_firewallName :: Lens.Lens' DescribeLoggingConfiguration (Prelude.Maybe Prelude.Text)
describeLoggingConfiguration_firewallName :: (Maybe Text -> f (Maybe Text))
-> DescribeLoggingConfiguration -> f DescribeLoggingConfiguration
describeLoggingConfiguration_firewallName = (DescribeLoggingConfiguration -> Maybe Text)
-> (DescribeLoggingConfiguration
-> Maybe Text -> DescribeLoggingConfiguration)
-> Lens
DescribeLoggingConfiguration
DescribeLoggingConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingConfiguration' {Maybe Text
firewallName :: Maybe Text
$sel:firewallName:DescribeLoggingConfiguration' :: DescribeLoggingConfiguration -> Maybe Text
firewallName} -> Maybe Text
firewallName) (\s :: DescribeLoggingConfiguration
s@DescribeLoggingConfiguration' {} Maybe Text
a -> DescribeLoggingConfiguration
s {$sel:firewallName:DescribeLoggingConfiguration' :: Maybe Text
firewallName = Maybe Text
a} :: DescribeLoggingConfiguration)
instance Core.AWSRequest DescribeLoggingConfiguration where
type
AWSResponse DescribeLoggingConfiguration =
DescribeLoggingConfigurationResponse
request :: DescribeLoggingConfiguration
-> Request DescribeLoggingConfiguration
request = Service
-> DescribeLoggingConfiguration
-> Request DescribeLoggingConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeLoggingConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLoggingConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeLoggingConfiguration))
-> Logger
-> Service
-> Proxy DescribeLoggingConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLoggingConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe LoggingConfiguration
-> Int
-> DescribeLoggingConfigurationResponse
DescribeLoggingConfigurationResponse'
(Maybe Text
-> Maybe LoggingConfiguration
-> Int
-> DescribeLoggingConfigurationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe LoggingConfiguration
-> Int -> DescribeLoggingConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FirewallArn")
Either
String
(Maybe LoggingConfiguration
-> Int -> DescribeLoggingConfigurationResponse)
-> Either String (Maybe LoggingConfiguration)
-> Either String (Int -> DescribeLoggingConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe LoggingConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LoggingConfiguration")
Either String (Int -> DescribeLoggingConfigurationResponse)
-> Either String Int
-> Either String DescribeLoggingConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
DescribeLoggingConfiguration
instance Prelude.NFData DescribeLoggingConfiguration
instance Core.ToHeaders DescribeLoggingConfiguration where
toHeaders :: DescribeLoggingConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeLoggingConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"NetworkFirewall_20201112.DescribeLoggingConfiguration" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeLoggingConfiguration where
toJSON :: DescribeLoggingConfiguration -> Value
toJSON DescribeLoggingConfiguration' {Maybe Text
firewallName :: Maybe Text
firewallArn :: Maybe Text
$sel:firewallName:DescribeLoggingConfiguration' :: DescribeLoggingConfiguration -> Maybe Text
$sel:firewallArn:DescribeLoggingConfiguration' :: DescribeLoggingConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FirewallArn" 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
firewallArn,
(Text
"FirewallName" 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
firewallName
]
)
instance Core.ToPath DescribeLoggingConfiguration where
toPath :: DescribeLoggingConfiguration -> ByteString
toPath = ByteString -> DescribeLoggingConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeLoggingConfiguration where
toQuery :: DescribeLoggingConfiguration -> QueryString
toQuery = QueryString -> DescribeLoggingConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeLoggingConfigurationResponse = DescribeLoggingConfigurationResponse'
{
DescribeLoggingConfigurationResponse -> Maybe Text
firewallArn :: Prelude.Maybe Prelude.Text,
DescribeLoggingConfigurationResponse -> Maybe LoggingConfiguration
loggingConfiguration :: Prelude.Maybe LoggingConfiguration,
DescribeLoggingConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool
(DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool)
-> (DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool)
-> Eq DescribeLoggingConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool
$c/= :: DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool
== :: DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool
$c== :: DescribeLoggingConfigurationResponse
-> DescribeLoggingConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeLoggingConfigurationResponse]
ReadPrec DescribeLoggingConfigurationResponse
Int -> ReadS DescribeLoggingConfigurationResponse
ReadS [DescribeLoggingConfigurationResponse]
(Int -> ReadS DescribeLoggingConfigurationResponse)
-> ReadS [DescribeLoggingConfigurationResponse]
-> ReadPrec DescribeLoggingConfigurationResponse
-> ReadPrec [DescribeLoggingConfigurationResponse]
-> Read DescribeLoggingConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLoggingConfigurationResponse]
$creadListPrec :: ReadPrec [DescribeLoggingConfigurationResponse]
readPrec :: ReadPrec DescribeLoggingConfigurationResponse
$creadPrec :: ReadPrec DescribeLoggingConfigurationResponse
readList :: ReadS [DescribeLoggingConfigurationResponse]
$creadList :: ReadS [DescribeLoggingConfigurationResponse]
readsPrec :: Int -> ReadS DescribeLoggingConfigurationResponse
$creadsPrec :: Int -> ReadS DescribeLoggingConfigurationResponse
Prelude.Read, Int -> DescribeLoggingConfigurationResponse -> ShowS
[DescribeLoggingConfigurationResponse] -> ShowS
DescribeLoggingConfigurationResponse -> String
(Int -> DescribeLoggingConfigurationResponse -> ShowS)
-> (DescribeLoggingConfigurationResponse -> String)
-> ([DescribeLoggingConfigurationResponse] -> ShowS)
-> Show DescribeLoggingConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLoggingConfigurationResponse] -> ShowS
$cshowList :: [DescribeLoggingConfigurationResponse] -> ShowS
show :: DescribeLoggingConfigurationResponse -> String
$cshow :: DescribeLoggingConfigurationResponse -> String
showsPrec :: Int -> DescribeLoggingConfigurationResponse -> ShowS
$cshowsPrec :: Int -> DescribeLoggingConfigurationResponse -> ShowS
Prelude.Show, (forall x.
DescribeLoggingConfigurationResponse
-> Rep DescribeLoggingConfigurationResponse x)
-> (forall x.
Rep DescribeLoggingConfigurationResponse x
-> DescribeLoggingConfigurationResponse)
-> Generic DescribeLoggingConfigurationResponse
forall x.
Rep DescribeLoggingConfigurationResponse x
-> DescribeLoggingConfigurationResponse
forall x.
DescribeLoggingConfigurationResponse
-> Rep DescribeLoggingConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLoggingConfigurationResponse x
-> DescribeLoggingConfigurationResponse
$cfrom :: forall x.
DescribeLoggingConfigurationResponse
-> Rep DescribeLoggingConfigurationResponse x
Prelude.Generic)
newDescribeLoggingConfigurationResponse ::
Prelude.Int ->
DescribeLoggingConfigurationResponse
newDescribeLoggingConfigurationResponse :: Int -> DescribeLoggingConfigurationResponse
newDescribeLoggingConfigurationResponse Int
pHttpStatus_ =
DescribeLoggingConfigurationResponse' :: Maybe Text
-> Maybe LoggingConfiguration
-> Int
-> DescribeLoggingConfigurationResponse
DescribeLoggingConfigurationResponse'
{ $sel:firewallArn:DescribeLoggingConfigurationResponse' :: Maybe Text
firewallArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:loggingConfiguration:DescribeLoggingConfigurationResponse' :: Maybe LoggingConfiguration
loggingConfiguration =
Maybe LoggingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeLoggingConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeLoggingConfigurationResponse_firewallArn :: Lens.Lens' DescribeLoggingConfigurationResponse (Prelude.Maybe Prelude.Text)
describeLoggingConfigurationResponse_firewallArn :: (Maybe Text -> f (Maybe Text))
-> DescribeLoggingConfigurationResponse
-> f DescribeLoggingConfigurationResponse
describeLoggingConfigurationResponse_firewallArn = (DescribeLoggingConfigurationResponse -> Maybe Text)
-> (DescribeLoggingConfigurationResponse
-> Maybe Text -> DescribeLoggingConfigurationResponse)
-> Lens
DescribeLoggingConfigurationResponse
DescribeLoggingConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingConfigurationResponse' {Maybe Text
firewallArn :: Maybe Text
$sel:firewallArn:DescribeLoggingConfigurationResponse' :: DescribeLoggingConfigurationResponse -> Maybe Text
firewallArn} -> Maybe Text
firewallArn) (\s :: DescribeLoggingConfigurationResponse
s@DescribeLoggingConfigurationResponse' {} Maybe Text
a -> DescribeLoggingConfigurationResponse
s {$sel:firewallArn:DescribeLoggingConfigurationResponse' :: Maybe Text
firewallArn = Maybe Text
a} :: DescribeLoggingConfigurationResponse)
describeLoggingConfigurationResponse_loggingConfiguration :: Lens.Lens' DescribeLoggingConfigurationResponse (Prelude.Maybe LoggingConfiguration)
describeLoggingConfigurationResponse_loggingConfiguration :: (Maybe LoggingConfiguration -> f (Maybe LoggingConfiguration))
-> DescribeLoggingConfigurationResponse
-> f DescribeLoggingConfigurationResponse
describeLoggingConfigurationResponse_loggingConfiguration = (DescribeLoggingConfigurationResponse
-> Maybe LoggingConfiguration)
-> (DescribeLoggingConfigurationResponse
-> Maybe LoggingConfiguration
-> DescribeLoggingConfigurationResponse)
-> Lens
DescribeLoggingConfigurationResponse
DescribeLoggingConfigurationResponse
(Maybe LoggingConfiguration)
(Maybe LoggingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingConfigurationResponse' {Maybe LoggingConfiguration
loggingConfiguration :: Maybe LoggingConfiguration
$sel:loggingConfiguration:DescribeLoggingConfigurationResponse' :: DescribeLoggingConfigurationResponse -> Maybe LoggingConfiguration
loggingConfiguration} -> Maybe LoggingConfiguration
loggingConfiguration) (\s :: DescribeLoggingConfigurationResponse
s@DescribeLoggingConfigurationResponse' {} Maybe LoggingConfiguration
a -> DescribeLoggingConfigurationResponse
s {$sel:loggingConfiguration:DescribeLoggingConfigurationResponse' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
a} :: DescribeLoggingConfigurationResponse)
describeLoggingConfigurationResponse_httpStatus :: Lens.Lens' DescribeLoggingConfigurationResponse Prelude.Int
describeLoggingConfigurationResponse_httpStatus :: (Int -> f Int)
-> DescribeLoggingConfigurationResponse
-> f DescribeLoggingConfigurationResponse
describeLoggingConfigurationResponse_httpStatus = (DescribeLoggingConfigurationResponse -> Int)
-> (DescribeLoggingConfigurationResponse
-> Int -> DescribeLoggingConfigurationResponse)
-> Lens
DescribeLoggingConfigurationResponse
DescribeLoggingConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeLoggingConfigurationResponse' :: DescribeLoggingConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeLoggingConfigurationResponse
s@DescribeLoggingConfigurationResponse' {} Int
a -> DescribeLoggingConfigurationResponse
s {$sel:httpStatus:DescribeLoggingConfigurationResponse' :: Int
httpStatus = Int
a} :: DescribeLoggingConfigurationResponse)
instance
Prelude.NFData
DescribeLoggingConfigurationResponse