{-# 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.ComputeOptimizer.Types.ExportDestination where
import Amazonka.ComputeOptimizer.Types.S3Destination
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 ExportDestination = ExportDestination'
{
ExportDestination -> Maybe S3Destination
s3 :: Prelude.Maybe S3Destination
}
deriving (ExportDestination -> ExportDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportDestination -> ExportDestination -> Bool
$c/= :: ExportDestination -> ExportDestination -> Bool
== :: ExportDestination -> ExportDestination -> Bool
$c== :: ExportDestination -> ExportDestination -> Bool
Prelude.Eq, ReadPrec [ExportDestination]
ReadPrec ExportDestination
Int -> ReadS ExportDestination
ReadS [ExportDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportDestination]
$creadListPrec :: ReadPrec [ExportDestination]
readPrec :: ReadPrec ExportDestination
$creadPrec :: ReadPrec ExportDestination
readList :: ReadS [ExportDestination]
$creadList :: ReadS [ExportDestination]
readsPrec :: Int -> ReadS ExportDestination
$creadsPrec :: Int -> ReadS ExportDestination
Prelude.Read, Int -> ExportDestination -> ShowS
[ExportDestination] -> ShowS
ExportDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportDestination] -> ShowS
$cshowList :: [ExportDestination] -> ShowS
show :: ExportDestination -> String
$cshow :: ExportDestination -> String
showsPrec :: Int -> ExportDestination -> ShowS
$cshowsPrec :: Int -> ExportDestination -> ShowS
Prelude.Show, forall x. Rep ExportDestination x -> ExportDestination
forall x. ExportDestination -> Rep ExportDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportDestination x -> ExportDestination
$cfrom :: forall x. ExportDestination -> Rep ExportDestination x
Prelude.Generic)
newExportDestination ::
ExportDestination
newExportDestination :: ExportDestination
newExportDestination =
ExportDestination' {$sel:s3:ExportDestination' :: Maybe S3Destination
s3 = forall a. Maybe a
Prelude.Nothing}
exportDestination_s3 :: Lens.Lens' ExportDestination (Prelude.Maybe S3Destination)
exportDestination_s3 :: Lens' ExportDestination (Maybe S3Destination)
exportDestination_s3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportDestination' {Maybe S3Destination
s3 :: Maybe S3Destination
$sel:s3:ExportDestination' :: ExportDestination -> Maybe S3Destination
s3} -> Maybe S3Destination
s3) (\s :: ExportDestination
s@ExportDestination' {} Maybe S3Destination
a -> ExportDestination
s {$sel:s3:ExportDestination' :: Maybe S3Destination
s3 = Maybe S3Destination
a} :: ExportDestination)
instance Data.FromJSON ExportDestination where
parseJSON :: Value -> Parser ExportDestination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ExportDestination"
( \Object
x ->
Maybe S3Destination -> ExportDestination
ExportDestination' 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
"s3")
)
instance Prelude.Hashable ExportDestination where
hashWithSalt :: Int -> ExportDestination -> Int
hashWithSalt Int
_salt ExportDestination' {Maybe S3Destination
s3 :: Maybe S3Destination
$sel:s3:ExportDestination' :: ExportDestination -> Maybe S3Destination
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Destination
s3
instance Prelude.NFData ExportDestination where
rnf :: ExportDestination -> ()
rnf ExportDestination' {Maybe S3Destination
s3 :: Maybe S3Destination
$sel:s3:ExportDestination' :: ExportDestination -> Maybe S3Destination
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Destination
s3