{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Destination = Destination'
{
Destination -> Maybe Text
accessPolicy :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Natural
creationTime :: Prelude.Maybe Prelude.Natural,
Destination -> Maybe Text
destinationName :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
Destination -> Maybe Text
targetArn :: Prelude.Maybe Prelude.Text
}
deriving (Destination -> Destination -> Bool
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]
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
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. 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'
{ $sel:accessPolicy:Destination' :: Maybe Text
accessPolicy = forall a. Maybe a
Prelude.Nothing,
$sel:arn:Destination' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:Destination' :: Maybe Natural
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:destinationName:Destination' :: Maybe Text
destinationName = forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:Destination' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
$sel:targetArn:Destination' :: Maybe Text
targetArn = forall a. Maybe a
Prelude.Nothing
}
destination_accessPolicy :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_accessPolicy :: Lens' Destination (Maybe Text)
destination_accessPolicy = 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_arn :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_arn :: Lens' Destination (Maybe Text)
destination_arn = 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_creationTime :: Lens.Lens' Destination (Prelude.Maybe Prelude.Natural)
destination_creationTime :: Lens' Destination (Maybe Natural)
destination_creationTime = 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_destinationName :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_destinationName :: Lens' Destination (Maybe Text)
destination_destinationName = 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 :: Lens' Destination (Maybe Text)
destination_roleArn = 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)
destination_targetArn :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_targetArn :: Lens' Destination (Maybe Text)
destination_targetArn = 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)
instance Data.FromJSON Destination where
parseJSON :: Value -> Parser Destination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Destination"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Destination
Destination'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"accessPolicy")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"creationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"destinationName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"roleArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"targetArn")
)
instance Prelude.Hashable Destination where
hashWithSalt :: Int -> Destination -> Int
hashWithSalt Int
_salt Destination' {Maybe Natural
Maybe Text
targetArn :: Maybe Text
roleArn :: Maybe Text
destinationName :: Maybe Text
creationTime :: Maybe Natural
arn :: Maybe Text
accessPolicy :: Maybe Text
$sel:targetArn:Destination' :: Destination -> Maybe Text
$sel:roleArn:Destination' :: Destination -> Maybe Text
$sel:destinationName:Destination' :: Destination -> Maybe Text
$sel:creationTime:Destination' :: Destination -> Maybe Natural
$sel:arn:Destination' :: Destination -> Maybe Text
$sel:accessPolicy:Destination' :: Destination -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accessPolicy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetArn
instance Prelude.NFData Destination where
rnf :: Destination -> ()
rnf Destination' {Maybe Natural
Maybe Text
targetArn :: Maybe Text
roleArn :: Maybe Text
destinationName :: Maybe Text
creationTime :: Maybe Natural
arn :: Maybe Text
accessPolicy :: Maybe Text
$sel:targetArn:Destination' :: Destination -> Maybe Text
$sel:roleArn:Destination' :: Destination -> Maybe Text
$sel:destinationName:Destination' :: Destination -> Maybe Text
$sel:creationTime:Destination' :: Destination -> Maybe Natural
$sel:arn:Destination' :: Destination -> Maybe Text
$sel:accessPolicy:Destination' :: Destination -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accessPolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetArn