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