{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:attributeValue:UpdateServerEngineAttributes' :: Maybe Text
attributeValue =
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 :: Lens' UpdateServerEngineAttributes (Maybe Text)
updateServerEngineAttributes_attributeValue = 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 :: Lens' UpdateServerEngineAttributes Text
updateServerEngineAttributes_serverName = 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 :: Lens' UpdateServerEngineAttributes Text
updateServerEngineAttributes_attributeName = 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 :: (Service -> Service)
-> UpdateServerEngineAttributes
-> Request UpdateServerEngineAttributes
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateServerEngineAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServerEngineAttributes)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Server -> Int -> UpdateServerEngineAttributesResponse
UpdateServerEngineAttributesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Server")
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
UpdateServerEngineAttributes
where
hashWithSalt :: Int -> UpdateServerEngineAttributes -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attributeName
instance Prelude.NFData UpdateServerEngineAttributes where
rnf :: UpdateServerEngineAttributes -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
attributeName
instance Data.ToHeaders UpdateServerEngineAttributes where
toHeaders :: UpdateServerEngineAttributes -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OpsWorksCM_V2016_11_01.UpdateServerEngineAttributes" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AttributeValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attributeValue,
forall a. a -> Maybe a
Prelude.Just (Key
"ServerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverName),
forall a. a -> Maybe a
Prelude.Just
(Key
"AttributeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
attributeName)
]
)
instance Data.ToPath UpdateServerEngineAttributes where
toPath :: UpdateServerEngineAttributes -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateServerEngineAttributes where
toQuery :: UpdateServerEngineAttributes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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
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.
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'
{ $sel:server:UpdateServerEngineAttributesResponse' :: Maybe Server
server =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateServerEngineAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateServerEngineAttributesResponse_server :: Lens.Lens' UpdateServerEngineAttributesResponse (Prelude.Maybe Server)
updateServerEngineAttributesResponse_server :: Lens' UpdateServerEngineAttributesResponse (Maybe Server)
updateServerEngineAttributesResponse_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 :: Lens' UpdateServerEngineAttributesResponse Int
updateServerEngineAttributesResponse_httpStatus = 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
where
rnf :: UpdateServerEngineAttributesResponse -> ()
rnf UpdateServerEngineAttributesResponse' {Int
Maybe Server
httpStatus :: Int
server :: Maybe Server
$sel:httpStatus:UpdateServerEngineAttributesResponse' :: UpdateServerEngineAttributesResponse -> Int
$sel:server:UpdateServerEngineAttributesResponse' :: UpdateServerEngineAttributesResponse -> Maybe Server
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Server
server
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus