{-# 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.OpsWorksCM.UpdateServerEngineAttributes
(
UpdateServerEngineAttributes (..),
newUpdateServerEngineAttributes,
updateServerEngineAttributes_attributeValue,
updateServerEngineAttributes_serverName,
updateServerEngineAttributes_attributeName,
UpdateServerEngineAttributesResponse (..),
newUpdateServerEngineAttributesResponse,
updateServerEngineAttributesResponse_server,
updateServerEngineAttributesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorksCM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateServerEngineAttributes = UpdateServerEngineAttributes'
{
UpdateServerEngineAttributes -> Maybe Text
attributeValue :: Prelude.Maybe Prelude.Text,
UpdateServerEngineAttributes -> Text
serverName :: Prelude.Text,
UpdateServerEngineAttributes -> Text
attributeName :: Prelude.Text
}
deriving (UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool
(UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool)
-> (UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool)
-> Eq UpdateServerEngineAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool
$c/= :: UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool
== :: UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool
$c== :: UpdateServerEngineAttributes
-> UpdateServerEngineAttributes -> Bool
Prelude.Eq, ReadPrec [UpdateServerEngineAttributes]
ReadPrec UpdateServerEngineAttributes
Int -> ReadS UpdateServerEngineAttributes
ReadS [UpdateServerEngineAttributes]
(Int -> ReadS UpdateServerEngineAttributes)
-> ReadS [UpdateServerEngineAttributes]
-> ReadPrec UpdateServerEngineAttributes
-> ReadPrec [UpdateServerEngineAttributes]
-> Read UpdateServerEngineAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServerEngineAttributes]
$creadListPrec :: ReadPrec [UpdateServerEngineAttributes]
readPrec :: ReadPrec UpdateServerEngineAttributes
$creadPrec :: ReadPrec UpdateServerEngineAttributes
readList :: ReadS [UpdateServerEngineAttributes]
$creadList :: ReadS [UpdateServerEngineAttributes]
readsPrec :: Int -> ReadS UpdateServerEngineAttributes
$creadsPrec :: Int -> ReadS UpdateServerEngineAttributes
Prelude.Read, Int -> UpdateServerEngineAttributes -> ShowS
[UpdateServerEngineAttributes] -> ShowS
UpdateServerEngineAttributes -> String
(Int -> UpdateServerEngineAttributes -> ShowS)
-> (UpdateServerEngineAttributes -> String)
-> ([UpdateServerEngineAttributes] -> ShowS)
-> Show UpdateServerEngineAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServerEngineAttributes] -> ShowS
$cshowList :: [UpdateServerEngineAttributes] -> ShowS
show :: UpdateServerEngineAttributes -> String
$cshow :: UpdateServerEngineAttributes -> String
showsPrec :: Int -> UpdateServerEngineAttributes -> ShowS
$cshowsPrec :: Int -> UpdateServerEngineAttributes -> ShowS
Prelude.Show, (forall x.
UpdateServerEngineAttributes -> Rep UpdateServerEngineAttributes x)
-> (forall x.
Rep UpdateServerEngineAttributes x -> UpdateServerEngineAttributes)
-> Generic UpdateServerEngineAttributes
forall x.
Rep UpdateServerEngineAttributes x -> UpdateServerEngineAttributes
forall x.
UpdateServerEngineAttributes -> Rep UpdateServerEngineAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServerEngineAttributes x -> UpdateServerEngineAttributes
$cfrom :: forall x.
UpdateServerEngineAttributes -> Rep UpdateServerEngineAttributes x
Prelude.Generic)
newUpdateServerEngineAttributes ::
Prelude.Text ->
Prelude.Text ->
UpdateServerEngineAttributes
newUpdateServerEngineAttributes :: Text -> Text -> UpdateServerEngineAttributes
newUpdateServerEngineAttributes
Text
pServerName_
Text
pAttributeName_ =
UpdateServerEngineAttributes' :: Maybe Text -> Text -> Text -> UpdateServerEngineAttributes
UpdateServerEngineAttributes'
{ $sel:attributeValue:UpdateServerEngineAttributes' :: Maybe Text
attributeValue =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serverName:UpdateServerEngineAttributes' :: Text
serverName = Text
pServerName_,
$sel:attributeName:UpdateServerEngineAttributes' :: Text
attributeName = Text
pAttributeName_
}
updateServerEngineAttributes_attributeValue :: Lens.Lens' UpdateServerEngineAttributes (Prelude.Maybe Prelude.Text)
updateServerEngineAttributes_attributeValue :: (Maybe Text -> f (Maybe Text))
-> UpdateServerEngineAttributes -> f UpdateServerEngineAttributes
updateServerEngineAttributes_attributeValue = (UpdateServerEngineAttributes -> Maybe Text)
-> (UpdateServerEngineAttributes
-> Maybe Text -> UpdateServerEngineAttributes)
-> Lens
UpdateServerEngineAttributes
UpdateServerEngineAttributes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerEngineAttributes' {Maybe Text
attributeValue :: Maybe Text
$sel:attributeValue:UpdateServerEngineAttributes' :: UpdateServerEngineAttributes -> Maybe Text
attributeValue} -> Maybe Text
attributeValue) (\s :: UpdateServerEngineAttributes
s@UpdateServerEngineAttributes' {} Maybe Text
a -> UpdateServerEngineAttributes
s {$sel:attributeValue:UpdateServerEngineAttributes' :: Maybe Text
attributeValue = Maybe Text
a} :: UpdateServerEngineAttributes)
updateServerEngineAttributes_serverName :: Lens.Lens' UpdateServerEngineAttributes Prelude.Text
updateServerEngineAttributes_serverName :: (Text -> f Text)
-> UpdateServerEngineAttributes -> f UpdateServerEngineAttributes
updateServerEngineAttributes_serverName = (UpdateServerEngineAttributes -> Text)
-> (UpdateServerEngineAttributes
-> Text -> UpdateServerEngineAttributes)
-> Lens
UpdateServerEngineAttributes UpdateServerEngineAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerEngineAttributes' {Text
serverName :: Text
$sel:serverName:UpdateServerEngineAttributes' :: UpdateServerEngineAttributes -> Text
serverName} -> Text
serverName) (\s :: UpdateServerEngineAttributes
s@UpdateServerEngineAttributes' {} Text
a -> UpdateServerEngineAttributes
s {$sel:serverName:UpdateServerEngineAttributes' :: Text
serverName = Text
a} :: UpdateServerEngineAttributes)
updateServerEngineAttributes_attributeName :: Lens.Lens' UpdateServerEngineAttributes Prelude.Text
updateServerEngineAttributes_attributeName :: (Text -> f Text)
-> UpdateServerEngineAttributes -> f UpdateServerEngineAttributes
updateServerEngineAttributes_attributeName = (UpdateServerEngineAttributes -> Text)
-> (UpdateServerEngineAttributes
-> Text -> UpdateServerEngineAttributes)
-> Lens
UpdateServerEngineAttributes UpdateServerEngineAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerEngineAttributes' {Text
attributeName :: Text
$sel:attributeName:UpdateServerEngineAttributes' :: UpdateServerEngineAttributes -> Text
attributeName} -> Text
attributeName) (\s :: UpdateServerEngineAttributes
s@UpdateServerEngineAttributes' {} Text
a -> UpdateServerEngineAttributes
s {$sel:attributeName:UpdateServerEngineAttributes' :: Text
attributeName = Text
a} :: UpdateServerEngineAttributes)
instance Core.AWSRequest UpdateServerEngineAttributes where
type
AWSResponse UpdateServerEngineAttributes =
UpdateServerEngineAttributesResponse
request :: UpdateServerEngineAttributes
-> Request UpdateServerEngineAttributes
request = Service
-> UpdateServerEngineAttributes
-> Request UpdateServerEngineAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateServerEngineAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServerEngineAttributes)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateServerEngineAttributes))
-> Logger
-> Service
-> Proxy UpdateServerEngineAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServerEngineAttributes)))
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 Server -> Int -> UpdateServerEngineAttributesResponse
UpdateServerEngineAttributesResponse'
(Maybe Server -> Int -> UpdateServerEngineAttributesResponse)
-> Either String (Maybe Server)
-> Either String (Int -> UpdateServerEngineAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Server)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Server")
Either String (Int -> UpdateServerEngineAttributesResponse)
-> Either String Int
-> Either String UpdateServerEngineAttributesResponse
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
UpdateServerEngineAttributes
instance Prelude.NFData UpdateServerEngineAttributes
instance Core.ToHeaders UpdateServerEngineAttributes where
toHeaders :: UpdateServerEngineAttributes -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateServerEngineAttributes -> 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
"OpsWorksCM_V2016_11_01.UpdateServerEngineAttributes" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateServerEngineAttributes where
toJSON :: UpdateServerEngineAttributes -> Value
toJSON UpdateServerEngineAttributes' {Maybe Text
Text
attributeName :: Text
serverName :: Text
attributeValue :: Maybe Text
$sel:attributeName:UpdateServerEngineAttributes' :: UpdateServerEngineAttributes -> Text
$sel:serverName:UpdateServerEngineAttributes' :: UpdateServerEngineAttributes -> Text
$sel:attributeValue:UpdateServerEngineAttributes' :: UpdateServerEngineAttributes -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AttributeValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attributeValue,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
attributeName)
]
)
instance Core.ToPath UpdateServerEngineAttributes where
toPath :: UpdateServerEngineAttributes -> ByteString
toPath = ByteString -> UpdateServerEngineAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateServerEngineAttributes where
toQuery :: UpdateServerEngineAttributes -> QueryString
toQuery = QueryString -> UpdateServerEngineAttributes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateServerEngineAttributesResponse = UpdateServerEngineAttributesResponse'
{
UpdateServerEngineAttributesResponse -> Maybe Server
server :: Prelude.Maybe Server,
UpdateServerEngineAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool
(UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool)
-> (UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool)
-> Eq UpdateServerEngineAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool
$c/= :: UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool
== :: UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool
$c== :: UpdateServerEngineAttributesResponse
-> UpdateServerEngineAttributesResponse -> Bool
Prelude.Eq, Int -> UpdateServerEngineAttributesResponse -> ShowS
[UpdateServerEngineAttributesResponse] -> ShowS
UpdateServerEngineAttributesResponse -> String
(Int -> UpdateServerEngineAttributesResponse -> ShowS)
-> (UpdateServerEngineAttributesResponse -> String)
-> ([UpdateServerEngineAttributesResponse] -> ShowS)
-> Show UpdateServerEngineAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServerEngineAttributesResponse] -> ShowS
$cshowList :: [UpdateServerEngineAttributesResponse] -> ShowS
show :: UpdateServerEngineAttributesResponse -> String
$cshow :: UpdateServerEngineAttributesResponse -> String
showsPrec :: Int -> UpdateServerEngineAttributesResponse -> ShowS
$cshowsPrec :: Int -> UpdateServerEngineAttributesResponse -> ShowS
Prelude.Show, (forall x.
UpdateServerEngineAttributesResponse
-> Rep UpdateServerEngineAttributesResponse x)
-> (forall x.
Rep UpdateServerEngineAttributesResponse x
-> UpdateServerEngineAttributesResponse)
-> Generic UpdateServerEngineAttributesResponse
forall x.
Rep UpdateServerEngineAttributesResponse x
-> UpdateServerEngineAttributesResponse
forall x.
UpdateServerEngineAttributesResponse
-> Rep UpdateServerEngineAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServerEngineAttributesResponse x
-> UpdateServerEngineAttributesResponse
$cfrom :: forall x.
UpdateServerEngineAttributesResponse
-> Rep UpdateServerEngineAttributesResponse x
Prelude.Generic)
newUpdateServerEngineAttributesResponse ::
Prelude.Int ->
UpdateServerEngineAttributesResponse
newUpdateServerEngineAttributesResponse :: Int -> UpdateServerEngineAttributesResponse
newUpdateServerEngineAttributesResponse Int
pHttpStatus_ =
UpdateServerEngineAttributesResponse' :: Maybe Server -> Int -> UpdateServerEngineAttributesResponse
UpdateServerEngineAttributesResponse'
{ $sel:server:UpdateServerEngineAttributesResponse' :: Maybe Server
server =
Maybe Server
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateServerEngineAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateServerEngineAttributesResponse_server :: Lens.Lens' UpdateServerEngineAttributesResponse (Prelude.Maybe Server)
updateServerEngineAttributesResponse_server :: (Maybe Server -> f (Maybe Server))
-> UpdateServerEngineAttributesResponse
-> f UpdateServerEngineAttributesResponse
updateServerEngineAttributesResponse_server = (UpdateServerEngineAttributesResponse -> Maybe Server)
-> (UpdateServerEngineAttributesResponse
-> Maybe Server -> UpdateServerEngineAttributesResponse)
-> Lens
UpdateServerEngineAttributesResponse
UpdateServerEngineAttributesResponse
(Maybe Server)
(Maybe Server)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerEngineAttributesResponse' {Maybe Server
server :: Maybe Server
$sel:server:UpdateServerEngineAttributesResponse' :: UpdateServerEngineAttributesResponse -> Maybe Server
server} -> Maybe Server
server) (\s :: UpdateServerEngineAttributesResponse
s@UpdateServerEngineAttributesResponse' {} Maybe Server
a -> UpdateServerEngineAttributesResponse
s {$sel:server:UpdateServerEngineAttributesResponse' :: Maybe Server
server = Maybe Server
a} :: UpdateServerEngineAttributesResponse)
updateServerEngineAttributesResponse_httpStatus :: Lens.Lens' UpdateServerEngineAttributesResponse Prelude.Int
updateServerEngineAttributesResponse_httpStatus :: (Int -> f Int)
-> UpdateServerEngineAttributesResponse
-> f UpdateServerEngineAttributesResponse
updateServerEngineAttributesResponse_httpStatus = (UpdateServerEngineAttributesResponse -> Int)
-> (UpdateServerEngineAttributesResponse
-> Int -> UpdateServerEngineAttributesResponse)
-> Lens
UpdateServerEngineAttributesResponse
UpdateServerEngineAttributesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerEngineAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServerEngineAttributesResponse' :: UpdateServerEngineAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServerEngineAttributesResponse
s@UpdateServerEngineAttributesResponse' {} Int
a -> UpdateServerEngineAttributesResponse
s {$sel:httpStatus:UpdateServerEngineAttributesResponse' :: Int
httpStatus = Int
a} :: UpdateServerEngineAttributesResponse)
instance
Prelude.NFData
UpdateServerEngineAttributesResponse