{-# 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.GuardDuty.Types.Destination where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types.DestinationType
import Amazonka.GuardDuty.Types.PublishingStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Destination = Destination'
{
Destination -> Text
destinationId :: Prelude.Text,
Destination -> DestinationType
destinationType :: DestinationType,
Destination -> PublishingStatus
status :: PublishingStatus
}
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 ::
Prelude.Text ->
DestinationType ->
PublishingStatus ->
Destination
newDestination :: Text -> DestinationType -> PublishingStatus -> Destination
newDestination
Text
pDestinationId_
DestinationType
pDestinationType_
PublishingStatus
pStatus_ =
Destination' :: Text -> DestinationType -> PublishingStatus -> Destination
Destination'
{ $sel:destinationId:Destination' :: Text
destinationId = Text
pDestinationId_,
$sel:destinationType:Destination' :: DestinationType
destinationType = DestinationType
pDestinationType_,
$sel:status:Destination' :: PublishingStatus
status = PublishingStatus
pStatus_
}
destination_destinationId :: Lens.Lens' Destination Prelude.Text
destination_destinationId :: (Text -> f Text) -> Destination -> f Destination
destination_destinationId = (Destination -> Text)
-> (Destination -> Text -> Destination)
-> Lens Destination Destination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Text
destinationId :: Text
$sel:destinationId:Destination' :: Destination -> Text
destinationId} -> Text
destinationId) (\s :: Destination
s@Destination' {} Text
a -> Destination
s {$sel:destinationId:Destination' :: Text
destinationId = Text
a} :: Destination)
destination_destinationType :: Lens.Lens' Destination DestinationType
destination_destinationType :: (DestinationType -> f DestinationType)
-> Destination -> f Destination
destination_destinationType = (Destination -> DestinationType)
-> (Destination -> DestinationType -> Destination)
-> Lens Destination Destination DestinationType DestinationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {DestinationType
destinationType :: DestinationType
$sel:destinationType:Destination' :: Destination -> DestinationType
destinationType} -> DestinationType
destinationType) (\s :: Destination
s@Destination' {} DestinationType
a -> Destination
s {$sel:destinationType:Destination' :: DestinationType
destinationType = DestinationType
a} :: Destination)
destination_status :: Lens.Lens' Destination PublishingStatus
destination_status :: (PublishingStatus -> f PublishingStatus)
-> Destination -> f Destination
destination_status = (Destination -> PublishingStatus)
-> (Destination -> PublishingStatus -> Destination)
-> Lens Destination Destination PublishingStatus PublishingStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {PublishingStatus
status :: PublishingStatus
$sel:status:Destination' :: Destination -> PublishingStatus
status} -> PublishingStatus
status) (\s :: Destination
s@Destination' {} PublishingStatus
a -> Destination
s {$sel:status:Destination' :: PublishingStatus
status = PublishingStatus
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 ->
Text -> DestinationType -> PublishingStatus -> Destination
Destination'
(Text -> DestinationType -> PublishingStatus -> Destination)
-> Parser Text
-> Parser (DestinationType -> PublishingStatus -> Destination)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destinationId")
Parser (DestinationType -> PublishingStatus -> Destination)
-> Parser DestinationType
-> Parser (PublishingStatus -> Destination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DestinationType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destinationType")
Parser (PublishingStatus -> Destination)
-> Parser PublishingStatus -> Parser Destination
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PublishingStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
)
instance Prelude.Hashable Destination
instance Prelude.NFData Destination