{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.EC2.EnableEbsEncryptionByDefault
(
EnableEbsEncryptionByDefault (..),
newEnableEbsEncryptionByDefault,
enableEbsEncryptionByDefault_dryRun,
EnableEbsEncryptionByDefaultResponse (..),
newEnableEbsEncryptionByDefaultResponse,
enableEbsEncryptionByDefaultResponse_ebsEncryptionByDefault,
enableEbsEncryptionByDefaultResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data EnableEbsEncryptionByDefault = EnableEbsEncryptionByDefault'
{
EnableEbsEncryptionByDefault -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool
}
deriving (EnableEbsEncryptionByDefault
-> EnableEbsEncryptionByDefault -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableEbsEncryptionByDefault
-> EnableEbsEncryptionByDefault -> Bool
$c/= :: EnableEbsEncryptionByDefault
-> EnableEbsEncryptionByDefault -> Bool
== :: EnableEbsEncryptionByDefault
-> EnableEbsEncryptionByDefault -> Bool
$c== :: EnableEbsEncryptionByDefault
-> EnableEbsEncryptionByDefault -> Bool
Prelude.Eq, ReadPrec [EnableEbsEncryptionByDefault]
ReadPrec EnableEbsEncryptionByDefault
Int -> ReadS EnableEbsEncryptionByDefault
ReadS [EnableEbsEncryptionByDefault]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableEbsEncryptionByDefault]
$creadListPrec :: ReadPrec [EnableEbsEncryptionByDefault]
readPrec :: ReadPrec EnableEbsEncryptionByDefault
$creadPrec :: ReadPrec EnableEbsEncryptionByDefault
readList :: ReadS [EnableEbsEncryptionByDefault]
$creadList :: ReadS [EnableEbsEncryptionByDefault]
readsPrec :: Int -> ReadS EnableEbsEncryptionByDefault
$creadsPrec :: Int -> ReadS EnableEbsEncryptionByDefault
Prelude.Read, Int -> EnableEbsEncryptionByDefault -> ShowS
[EnableEbsEncryptionByDefault] -> ShowS
EnableEbsEncryptionByDefault -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableEbsEncryptionByDefault] -> ShowS
$cshowList :: [EnableEbsEncryptionByDefault] -> ShowS
show :: EnableEbsEncryptionByDefault -> String
$cshow :: EnableEbsEncryptionByDefault -> String
showsPrec :: Int -> EnableEbsEncryptionByDefault -> ShowS
$cshowsPrec :: Int -> EnableEbsEncryptionByDefault -> ShowS
Prelude.Show, forall x.
Rep EnableEbsEncryptionByDefault x -> EnableEbsEncryptionByDefault
forall x.
EnableEbsEncryptionByDefault -> Rep EnableEbsEncryptionByDefault x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableEbsEncryptionByDefault x -> EnableEbsEncryptionByDefault
$cfrom :: forall x.
EnableEbsEncryptionByDefault -> Rep EnableEbsEncryptionByDefault x
Prelude.Generic)
newEnableEbsEncryptionByDefault ::
EnableEbsEncryptionByDefault
newEnableEbsEncryptionByDefault :: EnableEbsEncryptionByDefault
newEnableEbsEncryptionByDefault =
EnableEbsEncryptionByDefault'
{ $sel:dryRun:EnableEbsEncryptionByDefault' :: Maybe Bool
dryRun =
forall a. Maybe a
Prelude.Nothing
}
enableEbsEncryptionByDefault_dryRun :: Lens.Lens' EnableEbsEncryptionByDefault (Prelude.Maybe Prelude.Bool)
enableEbsEncryptionByDefault_dryRun :: Lens' EnableEbsEncryptionByDefault (Maybe Bool)
enableEbsEncryptionByDefault_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableEbsEncryptionByDefault' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:EnableEbsEncryptionByDefault' :: EnableEbsEncryptionByDefault -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: EnableEbsEncryptionByDefault
s@EnableEbsEncryptionByDefault' {} Maybe Bool
a -> EnableEbsEncryptionByDefault
s {$sel:dryRun:EnableEbsEncryptionByDefault' :: Maybe Bool
dryRun = Maybe Bool
a} :: EnableEbsEncryptionByDefault)
instance Core.AWSRequest EnableEbsEncryptionByDefault where
type
AWSResponse EnableEbsEncryptionByDefault =
EnableEbsEncryptionByDefaultResponse
request :: (Service -> Service)
-> EnableEbsEncryptionByDefault
-> Request EnableEbsEncryptionByDefault
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy EnableEbsEncryptionByDefault
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableEbsEncryptionByDefault)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Bool -> Int -> EnableEbsEncryptionByDefaultResponse
EnableEbsEncryptionByDefaultResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ebsEncryptionByDefault")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
EnableEbsEncryptionByDefault
where
hashWithSalt :: Int -> EnableEbsEncryptionByDefault -> Int
hashWithSalt Int
_salt EnableEbsEncryptionByDefault' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:EnableEbsEncryptionByDefault' :: EnableEbsEncryptionByDefault -> Maybe Bool
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
instance Prelude.NFData EnableEbsEncryptionByDefault where
rnf :: EnableEbsEncryptionByDefault -> ()
rnf EnableEbsEncryptionByDefault' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:EnableEbsEncryptionByDefault' :: EnableEbsEncryptionByDefault -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
instance Data.ToHeaders EnableEbsEncryptionByDefault where
toHeaders :: EnableEbsEncryptionByDefault -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath EnableEbsEncryptionByDefault where
toPath :: EnableEbsEncryptionByDefault -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery EnableEbsEncryptionByDefault where
toQuery :: EnableEbsEncryptionByDefault -> QueryString
toQuery EnableEbsEncryptionByDefault' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:EnableEbsEncryptionByDefault' :: EnableEbsEncryptionByDefault -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"EnableEbsEncryptionByDefault" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun
]
data EnableEbsEncryptionByDefaultResponse = EnableEbsEncryptionByDefaultResponse'
{
EnableEbsEncryptionByDefaultResponse -> Maybe Bool
ebsEncryptionByDefault :: Prelude.Maybe Prelude.Bool,
EnableEbsEncryptionByDefaultResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableEbsEncryptionByDefaultResponse
-> EnableEbsEncryptionByDefaultResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableEbsEncryptionByDefaultResponse
-> EnableEbsEncryptionByDefaultResponse -> Bool
$c/= :: EnableEbsEncryptionByDefaultResponse
-> EnableEbsEncryptionByDefaultResponse -> Bool
== :: EnableEbsEncryptionByDefaultResponse
-> EnableEbsEncryptionByDefaultResponse -> Bool
$c== :: EnableEbsEncryptionByDefaultResponse
-> EnableEbsEncryptionByDefaultResponse -> Bool
Prelude.Eq, ReadPrec [EnableEbsEncryptionByDefaultResponse]
ReadPrec EnableEbsEncryptionByDefaultResponse
Int -> ReadS EnableEbsEncryptionByDefaultResponse
ReadS [EnableEbsEncryptionByDefaultResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableEbsEncryptionByDefaultResponse]
$creadListPrec :: ReadPrec [EnableEbsEncryptionByDefaultResponse]
readPrec :: ReadPrec EnableEbsEncryptionByDefaultResponse
$creadPrec :: ReadPrec EnableEbsEncryptionByDefaultResponse
readList :: ReadS [EnableEbsEncryptionByDefaultResponse]
$creadList :: ReadS [EnableEbsEncryptionByDefaultResponse]
readsPrec :: Int -> ReadS EnableEbsEncryptionByDefaultResponse
$creadsPrec :: Int -> ReadS EnableEbsEncryptionByDefaultResponse
Prelude.Read, Int -> EnableEbsEncryptionByDefaultResponse -> ShowS
[EnableEbsEncryptionByDefaultResponse] -> ShowS
EnableEbsEncryptionByDefaultResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableEbsEncryptionByDefaultResponse] -> ShowS
$cshowList :: [EnableEbsEncryptionByDefaultResponse] -> ShowS
show :: EnableEbsEncryptionByDefaultResponse -> String
$cshow :: EnableEbsEncryptionByDefaultResponse -> String
showsPrec :: Int -> EnableEbsEncryptionByDefaultResponse -> ShowS
$cshowsPrec :: Int -> EnableEbsEncryptionByDefaultResponse -> ShowS
Prelude.Show, forall x.
Rep EnableEbsEncryptionByDefaultResponse x
-> EnableEbsEncryptionByDefaultResponse
forall x.
EnableEbsEncryptionByDefaultResponse
-> Rep EnableEbsEncryptionByDefaultResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableEbsEncryptionByDefaultResponse x
-> EnableEbsEncryptionByDefaultResponse
$cfrom :: forall x.
EnableEbsEncryptionByDefaultResponse
-> Rep EnableEbsEncryptionByDefaultResponse x
Prelude.Generic)
newEnableEbsEncryptionByDefaultResponse ::
Prelude.Int ->
EnableEbsEncryptionByDefaultResponse
newEnableEbsEncryptionByDefaultResponse :: Int -> EnableEbsEncryptionByDefaultResponse
newEnableEbsEncryptionByDefaultResponse Int
pHttpStatus_ =
EnableEbsEncryptionByDefaultResponse'
{ $sel:ebsEncryptionByDefault:EnableEbsEncryptionByDefaultResponse' :: Maybe Bool
ebsEncryptionByDefault =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:EnableEbsEncryptionByDefaultResponse' :: Int
httpStatus = Int
pHttpStatus_
}
enableEbsEncryptionByDefaultResponse_ebsEncryptionByDefault :: Lens.Lens' EnableEbsEncryptionByDefaultResponse (Prelude.Maybe Prelude.Bool)
enableEbsEncryptionByDefaultResponse_ebsEncryptionByDefault :: Lens' EnableEbsEncryptionByDefaultResponse (Maybe Bool)
enableEbsEncryptionByDefaultResponse_ebsEncryptionByDefault = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableEbsEncryptionByDefaultResponse' {Maybe Bool
ebsEncryptionByDefault :: Maybe Bool
$sel:ebsEncryptionByDefault:EnableEbsEncryptionByDefaultResponse' :: EnableEbsEncryptionByDefaultResponse -> Maybe Bool
ebsEncryptionByDefault} -> Maybe Bool
ebsEncryptionByDefault) (\s :: EnableEbsEncryptionByDefaultResponse
s@EnableEbsEncryptionByDefaultResponse' {} Maybe Bool
a -> EnableEbsEncryptionByDefaultResponse
s {$sel:ebsEncryptionByDefault:EnableEbsEncryptionByDefaultResponse' :: Maybe Bool
ebsEncryptionByDefault = Maybe Bool
a} :: EnableEbsEncryptionByDefaultResponse)
enableEbsEncryptionByDefaultResponse_httpStatus :: Lens.Lens' EnableEbsEncryptionByDefaultResponse Prelude.Int
enableEbsEncryptionByDefaultResponse_httpStatus :: Lens' EnableEbsEncryptionByDefaultResponse Int
enableEbsEncryptionByDefaultResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableEbsEncryptionByDefaultResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableEbsEncryptionByDefaultResponse' :: EnableEbsEncryptionByDefaultResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableEbsEncryptionByDefaultResponse
s@EnableEbsEncryptionByDefaultResponse' {} Int
a -> EnableEbsEncryptionByDefaultResponse
s {$sel:httpStatus:EnableEbsEncryptionByDefaultResponse' :: Int
httpStatus = Int
a} :: EnableEbsEncryptionByDefaultResponse)
instance
Prelude.NFData
EnableEbsEncryptionByDefaultResponse
where
rnf :: EnableEbsEncryptionByDefaultResponse -> ()
rnf EnableEbsEncryptionByDefaultResponse' {Int
Maybe Bool
httpStatus :: Int
ebsEncryptionByDefault :: Maybe Bool
$sel:httpStatus:EnableEbsEncryptionByDefaultResponse' :: EnableEbsEncryptionByDefaultResponse -> Int
$sel:ebsEncryptionByDefault:EnableEbsEncryptionByDefaultResponse' :: EnableEbsEncryptionByDefaultResponse -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ebsEncryptionByDefault
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus