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