{-# 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.CloudTrail.Types.Destination where
import Amazonka.CloudTrail.Types.DestinationType
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 -> DestinationType
type' :: DestinationType,
Destination -> Text
location :: 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 ::
DestinationType ->
Prelude.Text ->
Destination
newDestination :: DestinationType -> Text -> Destination
newDestination DestinationType
pType_ Text
pLocation_ =
Destination' {$sel:type':Destination' :: DestinationType
type' = DestinationType
pType_, $sel:location:Destination' :: Text
location = Text
pLocation_}
destination_type :: Lens.Lens' Destination DestinationType
destination_type :: Lens' Destination DestinationType
destination_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {DestinationType
type' :: DestinationType
$sel:type':Destination' :: Destination -> DestinationType
type'} -> DestinationType
type') (\s :: Destination
s@Destination' {} DestinationType
a -> Destination
s {$sel:type':Destination' :: DestinationType
type' = DestinationType
a} :: Destination)
destination_location :: Lens.Lens' Destination Prelude.Text
destination_location :: Lens' Destination Text
destination_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Text
location :: Text
$sel:location:Destination' :: Destination -> Text
location} -> Text
location) (\s :: Destination
s@Destination' {} Text
a -> Destination
s {$sel:location:Destination' :: Text
location = 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 ->
DestinationType -> 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 a
Data..: Key
"Type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Location")
)
instance Prelude.Hashable Destination where
hashWithSalt :: Int -> Destination -> Int
hashWithSalt Int
_salt Destination' {Text
DestinationType
location :: Text
type' :: DestinationType
$sel:location:Destination' :: Destination -> Text
$sel:type':Destination' :: Destination -> DestinationType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DestinationType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
location
instance Prelude.NFData Destination where
rnf :: Destination -> ()
rnf Destination' {Text
DestinationType
location :: Text
type' :: DestinationType
$sel:location:Destination' :: Destination -> Text
$sel:type':Destination' :: Destination -> DestinationType
..} =
forall a. NFData a => a -> ()
Prelude.rnf DestinationType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
location