{-# 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.CloudWatchLogs.Types.Destination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Destination = Destination'
{
Destination -> Maybe Text
targetArn :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Natural
creationTime :: Prelude.Maybe Prelude.Natural,
Destination -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Text
accessPolicy :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Text
destinationName :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (Destination -> Destination -> Bool
(Destination -> Destination -> Bool)
-> (Destination -> Destination -> Bool) -> Eq Destination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Destination -> Destination -> Bool
$c/= :: Destination -> Destination -> Bool
== :: Destination -> Destination -> Bool
$c== :: Destination -> Destination -> Bool
Prelude.Eq, ReadPrec [Destination]
ReadPrec Destination
Int -> ReadS Destination
ReadS [Destination]
(Int -> ReadS Destination)
-> ReadS [Destination]
-> ReadPrec Destination
-> ReadPrec [Destination]
-> Read Destination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Destination]
$creadListPrec :: ReadPrec [Destination]
readPrec :: ReadPrec Destination
$creadPrec :: ReadPrec Destination
readList :: ReadS [Destination]
$creadList :: ReadS [Destination]
readsPrec :: Int -> ReadS Destination
$creadsPrec :: Int -> ReadS Destination
Prelude.Read, Int -> Destination -> ShowS
[Destination] -> ShowS
Destination -> String
(Int -> Destination -> ShowS)
-> (Destination -> String)
-> ([Destination] -> ShowS)
-> Show Destination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Destination] -> ShowS
$cshowList :: [Destination] -> ShowS
show :: Destination -> String
$cshow :: Destination -> String
showsPrec :: Int -> Destination -> ShowS
$cshowsPrec :: Int -> Destination -> ShowS
Prelude.Show, (forall x. Destination -> Rep Destination x)
-> (forall x. Rep Destination x -> Destination)
-> Generic Destination
forall x. Rep Destination x -> Destination
forall x. Destination -> Rep Destination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Destination x -> Destination
$cfrom :: forall x. Destination -> Rep Destination x
Prelude.Generic)
newDestination ::
Destination
newDestination :: Destination
newDestination =
Destination' :: Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destination
Destination'
{ $sel:targetArn:Destination' :: Maybe Text
targetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:Destination' :: Maybe Natural
creationTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Destination' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessPolicy:Destination' :: Maybe Text
accessPolicy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationName:Destination' :: Maybe Text
destinationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:Destination' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
destination_targetArn :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_targetArn :: (Maybe Text -> f (Maybe Text)) -> Destination -> f Destination
destination_targetArn = (Destination -> Maybe Text)
-> (Destination -> Maybe Text -> Destination)
-> Lens Destination Destination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
targetArn :: Maybe Text
$sel:targetArn:Destination' :: Destination -> Maybe Text
targetArn} -> Maybe Text
targetArn) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:targetArn:Destination' :: Maybe Text
targetArn = Maybe Text
a} :: Destination)
destination_creationTime :: Lens.Lens' Destination (Prelude.Maybe Prelude.Natural)
destination_creationTime :: (Maybe Natural -> f (Maybe Natural))
-> Destination -> f Destination
destination_creationTime = (Destination -> Maybe Natural)
-> (Destination -> Maybe Natural -> Destination)
-> Lens Destination Destination (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Natural
creationTime :: Maybe Natural
$sel:creationTime:Destination' :: Destination -> Maybe Natural
creationTime} -> Maybe Natural
creationTime) (\s :: Destination
s@Destination' {} Maybe Natural
a -> Destination
s {$sel:creationTime:Destination' :: Maybe Natural
creationTime = Maybe Natural
a} :: Destination)
destination_arn :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_arn :: (Maybe Text -> f (Maybe Text)) -> Destination -> f Destination
destination_arn = (Destination -> Maybe Text)
-> (Destination -> Maybe Text -> Destination)
-> Lens Destination Destination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
arn :: Maybe Text
$sel:arn:Destination' :: Destination -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:arn:Destination' :: Maybe Text
arn = Maybe Text
a} :: Destination)
destination_accessPolicy :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_accessPolicy :: (Maybe Text -> f (Maybe Text)) -> Destination -> f Destination
destination_accessPolicy = (Destination -> Maybe Text)
-> (Destination -> Maybe Text -> Destination)
-> Lens Destination Destination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
accessPolicy :: Maybe Text
$sel:accessPolicy:Destination' :: Destination -> Maybe Text
accessPolicy} -> Maybe Text
accessPolicy) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:accessPolicy:Destination' :: Maybe Text
accessPolicy = Maybe Text
a} :: Destination)
destination_destinationName :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_destinationName :: (Maybe Text -> f (Maybe Text)) -> Destination -> f Destination
destination_destinationName = (Destination -> Maybe Text)
-> (Destination -> Maybe Text -> Destination)
-> Lens Destination Destination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
destinationName :: Maybe Text
$sel:destinationName:Destination' :: Destination -> Maybe Text
destinationName} -> Maybe Text
destinationName) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:destinationName:Destination' :: Maybe Text
destinationName = Maybe Text
a} :: Destination)
destination_roleArn :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_roleArn :: (Maybe Text -> f (Maybe Text)) -> Destination -> f Destination
destination_roleArn = (Destination -> Maybe Text)
-> (Destination -> Maybe Text -> Destination)
-> Lens Destination Destination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:Destination' :: Destination -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:roleArn:Destination' :: Maybe Text
roleArn = Maybe Text
a} :: Destination)
instance Core.FromJSON Destination where
parseJSON :: Value -> Parser Destination
parseJSON =
String
-> (Object -> Parser Destination) -> Value -> Parser Destination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Destination"
( \Object
x ->
Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destination
Destination'
(Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destination)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destination)
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
"targetArn")
Parser
(Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destination)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Destination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Destination)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Destination)
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
"arn")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Destination)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Destination)
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
"accessPolicy")
Parser (Maybe Text -> Maybe Text -> Destination)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Destination)
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
"destinationName")
Parser (Maybe Text -> Destination)
-> Parser (Maybe Text) -> Parser Destination
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
"roleArn")
)
instance Prelude.Hashable Destination
instance Prelude.NFData Destination