{-# 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.ComputeOptimizer.UpdateEnrollmentStatus
(
UpdateEnrollmentStatus (..),
newUpdateEnrollmentStatus,
updateEnrollmentStatus_includeMemberAccounts,
updateEnrollmentStatus_status,
UpdateEnrollmentStatusResponse (..),
newUpdateEnrollmentStatusResponse,
updateEnrollmentStatusResponse_status,
updateEnrollmentStatusResponse_statusReason,
updateEnrollmentStatusResponse_httpStatus,
)
where
import Amazonka.ComputeOptimizer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateEnrollmentStatus = UpdateEnrollmentStatus'
{
UpdateEnrollmentStatus -> Maybe Bool
includeMemberAccounts :: Prelude.Maybe Prelude.Bool,
UpdateEnrollmentStatus -> Status
status :: Status
}
deriving (UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
(UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool)
-> (UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool)
-> Eq UpdateEnrollmentStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
$c/= :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
== :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
$c== :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
Prelude.Eq, ReadPrec [UpdateEnrollmentStatus]
ReadPrec UpdateEnrollmentStatus
Int -> ReadS UpdateEnrollmentStatus
ReadS [UpdateEnrollmentStatus]
(Int -> ReadS UpdateEnrollmentStatus)
-> ReadS [UpdateEnrollmentStatus]
-> ReadPrec UpdateEnrollmentStatus
-> ReadPrec [UpdateEnrollmentStatus]
-> Read UpdateEnrollmentStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnrollmentStatus]
$creadListPrec :: ReadPrec [UpdateEnrollmentStatus]
readPrec :: ReadPrec UpdateEnrollmentStatus
$creadPrec :: ReadPrec UpdateEnrollmentStatus
readList :: ReadS [UpdateEnrollmentStatus]
$creadList :: ReadS [UpdateEnrollmentStatus]
readsPrec :: Int -> ReadS UpdateEnrollmentStatus
$creadsPrec :: Int -> ReadS UpdateEnrollmentStatus
Prelude.Read, Int -> UpdateEnrollmentStatus -> ShowS
[UpdateEnrollmentStatus] -> ShowS
UpdateEnrollmentStatus -> String
(Int -> UpdateEnrollmentStatus -> ShowS)
-> (UpdateEnrollmentStatus -> String)
-> ([UpdateEnrollmentStatus] -> ShowS)
-> Show UpdateEnrollmentStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnrollmentStatus] -> ShowS
$cshowList :: [UpdateEnrollmentStatus] -> ShowS
show :: UpdateEnrollmentStatus -> String
$cshow :: UpdateEnrollmentStatus -> String
showsPrec :: Int -> UpdateEnrollmentStatus -> ShowS
$cshowsPrec :: Int -> UpdateEnrollmentStatus -> ShowS
Prelude.Show, (forall x. UpdateEnrollmentStatus -> Rep UpdateEnrollmentStatus x)
-> (forall x.
Rep UpdateEnrollmentStatus x -> UpdateEnrollmentStatus)
-> Generic UpdateEnrollmentStatus
forall x. Rep UpdateEnrollmentStatus x -> UpdateEnrollmentStatus
forall x. UpdateEnrollmentStatus -> Rep UpdateEnrollmentStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEnrollmentStatus x -> UpdateEnrollmentStatus
$cfrom :: forall x. UpdateEnrollmentStatus -> Rep UpdateEnrollmentStatus x
Prelude.Generic)
newUpdateEnrollmentStatus ::
Status ->
UpdateEnrollmentStatus
newUpdateEnrollmentStatus :: Status -> UpdateEnrollmentStatus
newUpdateEnrollmentStatus Status
pStatus_ =
UpdateEnrollmentStatus' :: Maybe Bool -> Status -> UpdateEnrollmentStatus
UpdateEnrollmentStatus'
{ $sel:includeMemberAccounts:UpdateEnrollmentStatus' :: Maybe Bool
includeMemberAccounts =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:status:UpdateEnrollmentStatus' :: Status
status = Status
pStatus_
}
updateEnrollmentStatus_includeMemberAccounts :: Lens.Lens' UpdateEnrollmentStatus (Prelude.Maybe Prelude.Bool)
updateEnrollmentStatus_includeMemberAccounts :: (Maybe Bool -> f (Maybe Bool))
-> UpdateEnrollmentStatus -> f UpdateEnrollmentStatus
updateEnrollmentStatus_includeMemberAccounts = (UpdateEnrollmentStatus -> Maybe Bool)
-> (UpdateEnrollmentStatus -> Maybe Bool -> UpdateEnrollmentStatus)
-> Lens
UpdateEnrollmentStatus
UpdateEnrollmentStatus
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatus' {Maybe Bool
includeMemberAccounts :: Maybe Bool
$sel:includeMemberAccounts:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Maybe Bool
includeMemberAccounts} -> Maybe Bool
includeMemberAccounts) (\s :: UpdateEnrollmentStatus
s@UpdateEnrollmentStatus' {} Maybe Bool
a -> UpdateEnrollmentStatus
s {$sel:includeMemberAccounts:UpdateEnrollmentStatus' :: Maybe Bool
includeMemberAccounts = Maybe Bool
a} :: UpdateEnrollmentStatus)
updateEnrollmentStatus_status :: Lens.Lens' UpdateEnrollmentStatus Status
updateEnrollmentStatus_status :: (Status -> f Status)
-> UpdateEnrollmentStatus -> f UpdateEnrollmentStatus
updateEnrollmentStatus_status = (UpdateEnrollmentStatus -> Status)
-> (UpdateEnrollmentStatus -> Status -> UpdateEnrollmentStatus)
-> Lens UpdateEnrollmentStatus UpdateEnrollmentStatus Status Status
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatus' {Status
status :: Status
$sel:status:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Status
status} -> Status
status) (\s :: UpdateEnrollmentStatus
s@UpdateEnrollmentStatus' {} Status
a -> UpdateEnrollmentStatus
s {$sel:status:UpdateEnrollmentStatus' :: Status
status = Status
a} :: UpdateEnrollmentStatus)
instance Core.AWSRequest UpdateEnrollmentStatus where
type
AWSResponse UpdateEnrollmentStatus =
UpdateEnrollmentStatusResponse
request :: UpdateEnrollmentStatus -> Request UpdateEnrollmentStatus
request = Service -> UpdateEnrollmentStatus -> Request UpdateEnrollmentStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateEnrollmentStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEnrollmentStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateEnrollmentStatus))
-> Logger
-> Service
-> Proxy UpdateEnrollmentStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEnrollmentStatus)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Status -> Maybe Text -> Int -> UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse'
(Maybe Status
-> Maybe Text -> Int -> UpdateEnrollmentStatusResponse)
-> Either String (Maybe Status)
-> Either
String (Maybe Text -> Int -> UpdateEnrollmentStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Status)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
Either String (Maybe Text -> Int -> UpdateEnrollmentStatusResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateEnrollmentStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"statusReason")
Either String (Int -> UpdateEnrollmentStatusResponse)
-> Either String Int
-> Either String UpdateEnrollmentStatusResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateEnrollmentStatus
instance Prelude.NFData UpdateEnrollmentStatus
instance Core.ToHeaders UpdateEnrollmentStatus where
toHeaders :: UpdateEnrollmentStatus -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateEnrollmentStatus -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"ComputeOptimizerService.UpdateEnrollmentStatus" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateEnrollmentStatus where
toJSON :: UpdateEnrollmentStatus -> Value
toJSON UpdateEnrollmentStatus' {Maybe Bool
Status
status :: Status
includeMemberAccounts :: Maybe Bool
$sel:status:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Status
$sel:includeMemberAccounts:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"includeMemberAccounts" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeMemberAccounts,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"status" Text -> Status -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Status
status)
]
)
instance Core.ToPath UpdateEnrollmentStatus where
toPath :: UpdateEnrollmentStatus -> ByteString
toPath = ByteString -> UpdateEnrollmentStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateEnrollmentStatus where
toQuery :: UpdateEnrollmentStatus -> QueryString
toQuery = QueryString -> UpdateEnrollmentStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateEnrollmentStatusResponse = UpdateEnrollmentStatusResponse'
{
UpdateEnrollmentStatusResponse -> Maybe Status
status :: Prelude.Maybe Status,
UpdateEnrollmentStatusResponse -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
UpdateEnrollmentStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
(UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool)
-> (UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool)
-> Eq UpdateEnrollmentStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
$c/= :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
== :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
$c== :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEnrollmentStatusResponse]
ReadPrec UpdateEnrollmentStatusResponse
Int -> ReadS UpdateEnrollmentStatusResponse
ReadS [UpdateEnrollmentStatusResponse]
(Int -> ReadS UpdateEnrollmentStatusResponse)
-> ReadS [UpdateEnrollmentStatusResponse]
-> ReadPrec UpdateEnrollmentStatusResponse
-> ReadPrec [UpdateEnrollmentStatusResponse]
-> Read UpdateEnrollmentStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnrollmentStatusResponse]
$creadListPrec :: ReadPrec [UpdateEnrollmentStatusResponse]
readPrec :: ReadPrec UpdateEnrollmentStatusResponse
$creadPrec :: ReadPrec UpdateEnrollmentStatusResponse
readList :: ReadS [UpdateEnrollmentStatusResponse]
$creadList :: ReadS [UpdateEnrollmentStatusResponse]
readsPrec :: Int -> ReadS UpdateEnrollmentStatusResponse
$creadsPrec :: Int -> ReadS UpdateEnrollmentStatusResponse
Prelude.Read, Int -> UpdateEnrollmentStatusResponse -> ShowS
[UpdateEnrollmentStatusResponse] -> ShowS
UpdateEnrollmentStatusResponse -> String
(Int -> UpdateEnrollmentStatusResponse -> ShowS)
-> (UpdateEnrollmentStatusResponse -> String)
-> ([UpdateEnrollmentStatusResponse] -> ShowS)
-> Show UpdateEnrollmentStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnrollmentStatusResponse] -> ShowS
$cshowList :: [UpdateEnrollmentStatusResponse] -> ShowS
show :: UpdateEnrollmentStatusResponse -> String
$cshow :: UpdateEnrollmentStatusResponse -> String
showsPrec :: Int -> UpdateEnrollmentStatusResponse -> ShowS
$cshowsPrec :: Int -> UpdateEnrollmentStatusResponse -> ShowS
Prelude.Show, (forall x.
UpdateEnrollmentStatusResponse
-> Rep UpdateEnrollmentStatusResponse x)
-> (forall x.
Rep UpdateEnrollmentStatusResponse x
-> UpdateEnrollmentStatusResponse)
-> Generic UpdateEnrollmentStatusResponse
forall x.
Rep UpdateEnrollmentStatusResponse x
-> UpdateEnrollmentStatusResponse
forall x.
UpdateEnrollmentStatusResponse
-> Rep UpdateEnrollmentStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnrollmentStatusResponse x
-> UpdateEnrollmentStatusResponse
$cfrom :: forall x.
UpdateEnrollmentStatusResponse
-> Rep UpdateEnrollmentStatusResponse x
Prelude.Generic)
newUpdateEnrollmentStatusResponse ::
Prelude.Int ->
UpdateEnrollmentStatusResponse
newUpdateEnrollmentStatusResponse :: Int -> UpdateEnrollmentStatusResponse
newUpdateEnrollmentStatusResponse Int
pHttpStatus_ =
UpdateEnrollmentStatusResponse' :: Maybe Status -> Maybe Text -> Int -> UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse'
{ $sel:status:UpdateEnrollmentStatusResponse' :: Maybe Status
status =
Maybe Status
forall a. Maybe a
Prelude.Nothing,
$sel:statusReason:UpdateEnrollmentStatusResponse' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateEnrollmentStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateEnrollmentStatusResponse_status :: Lens.Lens' UpdateEnrollmentStatusResponse (Prelude.Maybe Status)
updateEnrollmentStatusResponse_status :: (Maybe Status -> f (Maybe Status))
-> UpdateEnrollmentStatusResponse
-> f UpdateEnrollmentStatusResponse
updateEnrollmentStatusResponse_status = (UpdateEnrollmentStatusResponse -> Maybe Status)
-> (UpdateEnrollmentStatusResponse
-> Maybe Status -> UpdateEnrollmentStatusResponse)
-> Lens
UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse
(Maybe Status)
(Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatusResponse' {Maybe Status
status :: Maybe Status
$sel:status:UpdateEnrollmentStatusResponse' :: UpdateEnrollmentStatusResponse -> Maybe Status
status} -> Maybe Status
status) (\s :: UpdateEnrollmentStatusResponse
s@UpdateEnrollmentStatusResponse' {} Maybe Status
a -> UpdateEnrollmentStatusResponse
s {$sel:status:UpdateEnrollmentStatusResponse' :: Maybe Status
status = Maybe Status
a} :: UpdateEnrollmentStatusResponse)
updateEnrollmentStatusResponse_statusReason :: Lens.Lens' UpdateEnrollmentStatusResponse (Prelude.Maybe Prelude.Text)
updateEnrollmentStatusResponse_statusReason :: (Maybe Text -> f (Maybe Text))
-> UpdateEnrollmentStatusResponse
-> f UpdateEnrollmentStatusResponse
updateEnrollmentStatusResponse_statusReason = (UpdateEnrollmentStatusResponse -> Maybe Text)
-> (UpdateEnrollmentStatusResponse
-> Maybe Text -> UpdateEnrollmentStatusResponse)
-> Lens
UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatusResponse' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:UpdateEnrollmentStatusResponse' :: UpdateEnrollmentStatusResponse -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: UpdateEnrollmentStatusResponse
s@UpdateEnrollmentStatusResponse' {} Maybe Text
a -> UpdateEnrollmentStatusResponse
s {$sel:statusReason:UpdateEnrollmentStatusResponse' :: Maybe Text
statusReason = Maybe Text
a} :: UpdateEnrollmentStatusResponse)
updateEnrollmentStatusResponse_httpStatus :: Lens.Lens' UpdateEnrollmentStatusResponse Prelude.Int
updateEnrollmentStatusResponse_httpStatus :: (Int -> f Int)
-> UpdateEnrollmentStatusResponse
-> f UpdateEnrollmentStatusResponse
updateEnrollmentStatusResponse_httpStatus = (UpdateEnrollmentStatusResponse -> Int)
-> (UpdateEnrollmentStatusResponse
-> Int -> UpdateEnrollmentStatusResponse)
-> Lens
UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEnrollmentStatusResponse' :: UpdateEnrollmentStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEnrollmentStatusResponse
s@UpdateEnrollmentStatusResponse' {} Int
a -> UpdateEnrollmentStatusResponse
s {$sel:httpStatus:UpdateEnrollmentStatusResponse' :: Int
httpStatus = Int
a} :: UpdateEnrollmentStatusResponse)
instance
Prelude.NFData
UpdateEnrollmentStatusResponse