{-# 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.GameLift.UpdateRuntimeConfiguration
(
UpdateRuntimeConfiguration (..),
newUpdateRuntimeConfiguration,
updateRuntimeConfiguration_fleetId,
updateRuntimeConfiguration_runtimeConfiguration,
UpdateRuntimeConfigurationResponse (..),
newUpdateRuntimeConfigurationResponse,
updateRuntimeConfigurationResponse_runtimeConfiguration,
updateRuntimeConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
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 UpdateRuntimeConfiguration = UpdateRuntimeConfiguration'
{
UpdateRuntimeConfiguration -> Text
fleetId :: Prelude.Text,
UpdateRuntimeConfiguration -> RuntimeConfiguration
runtimeConfiguration :: RuntimeConfiguration
}
deriving (UpdateRuntimeConfiguration -> UpdateRuntimeConfiguration -> Bool
(UpdateRuntimeConfiguration -> UpdateRuntimeConfiguration -> Bool)
-> (UpdateRuntimeConfiguration
-> UpdateRuntimeConfiguration -> Bool)
-> Eq UpdateRuntimeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRuntimeConfiguration -> UpdateRuntimeConfiguration -> Bool
$c/= :: UpdateRuntimeConfiguration -> UpdateRuntimeConfiguration -> Bool
== :: UpdateRuntimeConfiguration -> UpdateRuntimeConfiguration -> Bool
$c== :: UpdateRuntimeConfiguration -> UpdateRuntimeConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateRuntimeConfiguration]
ReadPrec UpdateRuntimeConfiguration
Int -> ReadS UpdateRuntimeConfiguration
ReadS [UpdateRuntimeConfiguration]
(Int -> ReadS UpdateRuntimeConfiguration)
-> ReadS [UpdateRuntimeConfiguration]
-> ReadPrec UpdateRuntimeConfiguration
-> ReadPrec [UpdateRuntimeConfiguration]
-> Read UpdateRuntimeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRuntimeConfiguration]
$creadListPrec :: ReadPrec [UpdateRuntimeConfiguration]
readPrec :: ReadPrec UpdateRuntimeConfiguration
$creadPrec :: ReadPrec UpdateRuntimeConfiguration
readList :: ReadS [UpdateRuntimeConfiguration]
$creadList :: ReadS [UpdateRuntimeConfiguration]
readsPrec :: Int -> ReadS UpdateRuntimeConfiguration
$creadsPrec :: Int -> ReadS UpdateRuntimeConfiguration
Prelude.Read, Int -> UpdateRuntimeConfiguration -> ShowS
[UpdateRuntimeConfiguration] -> ShowS
UpdateRuntimeConfiguration -> String
(Int -> UpdateRuntimeConfiguration -> ShowS)
-> (UpdateRuntimeConfiguration -> String)
-> ([UpdateRuntimeConfiguration] -> ShowS)
-> Show UpdateRuntimeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRuntimeConfiguration] -> ShowS
$cshowList :: [UpdateRuntimeConfiguration] -> ShowS
show :: UpdateRuntimeConfiguration -> String
$cshow :: UpdateRuntimeConfiguration -> String
showsPrec :: Int -> UpdateRuntimeConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateRuntimeConfiguration -> ShowS
Prelude.Show, (forall x.
UpdateRuntimeConfiguration -> Rep UpdateRuntimeConfiguration x)
-> (forall x.
Rep UpdateRuntimeConfiguration x -> UpdateRuntimeConfiguration)
-> Generic UpdateRuntimeConfiguration
forall x.
Rep UpdateRuntimeConfiguration x -> UpdateRuntimeConfiguration
forall x.
UpdateRuntimeConfiguration -> Rep UpdateRuntimeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRuntimeConfiguration x -> UpdateRuntimeConfiguration
$cfrom :: forall x.
UpdateRuntimeConfiguration -> Rep UpdateRuntimeConfiguration x
Prelude.Generic)
newUpdateRuntimeConfiguration ::
Prelude.Text ->
RuntimeConfiguration ->
UpdateRuntimeConfiguration
newUpdateRuntimeConfiguration :: Text -> RuntimeConfiguration -> UpdateRuntimeConfiguration
newUpdateRuntimeConfiguration
Text
pFleetId_
RuntimeConfiguration
pRuntimeConfiguration_ =
UpdateRuntimeConfiguration' :: Text -> RuntimeConfiguration -> UpdateRuntimeConfiguration
UpdateRuntimeConfiguration'
{ $sel:fleetId:UpdateRuntimeConfiguration' :: Text
fleetId = Text
pFleetId_,
$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: RuntimeConfiguration
runtimeConfiguration = RuntimeConfiguration
pRuntimeConfiguration_
}
updateRuntimeConfiguration_fleetId :: Lens.Lens' UpdateRuntimeConfiguration Prelude.Text
updateRuntimeConfiguration_fleetId :: (Text -> f Text)
-> UpdateRuntimeConfiguration -> f UpdateRuntimeConfiguration
updateRuntimeConfiguration_fleetId = (UpdateRuntimeConfiguration -> Text)
-> (UpdateRuntimeConfiguration
-> Text -> UpdateRuntimeConfiguration)
-> Lens
UpdateRuntimeConfiguration UpdateRuntimeConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuntimeConfiguration' {Text
fleetId :: Text
$sel:fleetId:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> Text
fleetId} -> Text
fleetId) (\s :: UpdateRuntimeConfiguration
s@UpdateRuntimeConfiguration' {} Text
a -> UpdateRuntimeConfiguration
s {$sel:fleetId:UpdateRuntimeConfiguration' :: Text
fleetId = Text
a} :: UpdateRuntimeConfiguration)
updateRuntimeConfiguration_runtimeConfiguration :: Lens.Lens' UpdateRuntimeConfiguration RuntimeConfiguration
updateRuntimeConfiguration_runtimeConfiguration :: (RuntimeConfiguration -> f RuntimeConfiguration)
-> UpdateRuntimeConfiguration -> f UpdateRuntimeConfiguration
updateRuntimeConfiguration_runtimeConfiguration = (UpdateRuntimeConfiguration -> RuntimeConfiguration)
-> (UpdateRuntimeConfiguration
-> RuntimeConfiguration -> UpdateRuntimeConfiguration)
-> Lens
UpdateRuntimeConfiguration
UpdateRuntimeConfiguration
RuntimeConfiguration
RuntimeConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuntimeConfiguration' {RuntimeConfiguration
runtimeConfiguration :: RuntimeConfiguration
$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> RuntimeConfiguration
runtimeConfiguration} -> RuntimeConfiguration
runtimeConfiguration) (\s :: UpdateRuntimeConfiguration
s@UpdateRuntimeConfiguration' {} RuntimeConfiguration
a -> UpdateRuntimeConfiguration
s {$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: RuntimeConfiguration
runtimeConfiguration = RuntimeConfiguration
a} :: UpdateRuntimeConfiguration)
instance Core.AWSRequest UpdateRuntimeConfiguration where
type
AWSResponse UpdateRuntimeConfiguration =
UpdateRuntimeConfigurationResponse
request :: UpdateRuntimeConfiguration -> Request UpdateRuntimeConfiguration
request = Service
-> UpdateRuntimeConfiguration -> Request UpdateRuntimeConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRuntimeConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateRuntimeConfiguration))
-> Logger
-> Service
-> Proxy UpdateRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRuntimeConfiguration)))
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 RuntimeConfiguration
-> Int -> UpdateRuntimeConfigurationResponse
UpdateRuntimeConfigurationResponse'
(Maybe RuntimeConfiguration
-> Int -> UpdateRuntimeConfigurationResponse)
-> Either String (Maybe RuntimeConfiguration)
-> Either String (Int -> UpdateRuntimeConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RuntimeConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RuntimeConfiguration")
Either String (Int -> UpdateRuntimeConfigurationResponse)
-> Either String Int
-> Either String UpdateRuntimeConfigurationResponse
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 UpdateRuntimeConfiguration
instance Prelude.NFData UpdateRuntimeConfiguration
instance Core.ToHeaders UpdateRuntimeConfiguration where
toHeaders :: UpdateRuntimeConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateRuntimeConfiguration -> 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
"GameLift.UpdateRuntimeConfiguration" ::
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 UpdateRuntimeConfiguration where
toJSON :: UpdateRuntimeConfiguration -> Value
toJSON UpdateRuntimeConfiguration' {Text
RuntimeConfiguration
runtimeConfiguration :: RuntimeConfiguration
fleetId :: Text
$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> RuntimeConfiguration
$sel:fleetId:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"RuntimeConfiguration"
Text -> RuntimeConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RuntimeConfiguration
runtimeConfiguration
)
]
)
instance Core.ToPath UpdateRuntimeConfiguration where
toPath :: UpdateRuntimeConfiguration -> ByteString
toPath = ByteString -> UpdateRuntimeConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateRuntimeConfiguration where
toQuery :: UpdateRuntimeConfiguration -> QueryString
toQuery = QueryString -> UpdateRuntimeConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRuntimeConfigurationResponse = UpdateRuntimeConfigurationResponse'
{
UpdateRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
runtimeConfiguration :: Prelude.Maybe RuntimeConfiguration,
UpdateRuntimeConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool
(UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool)
-> (UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool)
-> Eq UpdateRuntimeConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool
$c/= :: UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool
== :: UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool
$c== :: UpdateRuntimeConfigurationResponse
-> UpdateRuntimeConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRuntimeConfigurationResponse]
ReadPrec UpdateRuntimeConfigurationResponse
Int -> ReadS UpdateRuntimeConfigurationResponse
ReadS [UpdateRuntimeConfigurationResponse]
(Int -> ReadS UpdateRuntimeConfigurationResponse)
-> ReadS [UpdateRuntimeConfigurationResponse]
-> ReadPrec UpdateRuntimeConfigurationResponse
-> ReadPrec [UpdateRuntimeConfigurationResponse]
-> Read UpdateRuntimeConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRuntimeConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateRuntimeConfigurationResponse]
readPrec :: ReadPrec UpdateRuntimeConfigurationResponse
$creadPrec :: ReadPrec UpdateRuntimeConfigurationResponse
readList :: ReadS [UpdateRuntimeConfigurationResponse]
$creadList :: ReadS [UpdateRuntimeConfigurationResponse]
readsPrec :: Int -> ReadS UpdateRuntimeConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateRuntimeConfigurationResponse
Prelude.Read, Int -> UpdateRuntimeConfigurationResponse -> ShowS
[UpdateRuntimeConfigurationResponse] -> ShowS
UpdateRuntimeConfigurationResponse -> String
(Int -> UpdateRuntimeConfigurationResponse -> ShowS)
-> (UpdateRuntimeConfigurationResponse -> String)
-> ([UpdateRuntimeConfigurationResponse] -> ShowS)
-> Show UpdateRuntimeConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRuntimeConfigurationResponse] -> ShowS
$cshowList :: [UpdateRuntimeConfigurationResponse] -> ShowS
show :: UpdateRuntimeConfigurationResponse -> String
$cshow :: UpdateRuntimeConfigurationResponse -> String
showsPrec :: Int -> UpdateRuntimeConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateRuntimeConfigurationResponse -> ShowS
Prelude.Show, (forall x.
UpdateRuntimeConfigurationResponse
-> Rep UpdateRuntimeConfigurationResponse x)
-> (forall x.
Rep UpdateRuntimeConfigurationResponse x
-> UpdateRuntimeConfigurationResponse)
-> Generic UpdateRuntimeConfigurationResponse
forall x.
Rep UpdateRuntimeConfigurationResponse x
-> UpdateRuntimeConfigurationResponse
forall x.
UpdateRuntimeConfigurationResponse
-> Rep UpdateRuntimeConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRuntimeConfigurationResponse x
-> UpdateRuntimeConfigurationResponse
$cfrom :: forall x.
UpdateRuntimeConfigurationResponse
-> Rep UpdateRuntimeConfigurationResponse x
Prelude.Generic)
newUpdateRuntimeConfigurationResponse ::
Prelude.Int ->
UpdateRuntimeConfigurationResponse
newUpdateRuntimeConfigurationResponse :: Int -> UpdateRuntimeConfigurationResponse
newUpdateRuntimeConfigurationResponse Int
pHttpStatus_ =
UpdateRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
-> Int -> UpdateRuntimeConfigurationResponse
UpdateRuntimeConfigurationResponse'
{ $sel:runtimeConfiguration:UpdateRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration =
Maybe RuntimeConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateRuntimeConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateRuntimeConfigurationResponse_runtimeConfiguration :: Lens.Lens' UpdateRuntimeConfigurationResponse (Prelude.Maybe RuntimeConfiguration)
updateRuntimeConfigurationResponse_runtimeConfiguration :: (Maybe RuntimeConfiguration -> f (Maybe RuntimeConfiguration))
-> UpdateRuntimeConfigurationResponse
-> f UpdateRuntimeConfigurationResponse
updateRuntimeConfigurationResponse_runtimeConfiguration = (UpdateRuntimeConfigurationResponse -> Maybe RuntimeConfiguration)
-> (UpdateRuntimeConfigurationResponse
-> Maybe RuntimeConfiguration
-> UpdateRuntimeConfigurationResponse)
-> Lens
UpdateRuntimeConfigurationResponse
UpdateRuntimeConfigurationResponse
(Maybe RuntimeConfiguration)
(Maybe RuntimeConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuntimeConfigurationResponse' {Maybe RuntimeConfiguration
runtimeConfiguration :: Maybe RuntimeConfiguration
$sel:runtimeConfiguration:UpdateRuntimeConfigurationResponse' :: UpdateRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
runtimeConfiguration} -> Maybe RuntimeConfiguration
runtimeConfiguration) (\s :: UpdateRuntimeConfigurationResponse
s@UpdateRuntimeConfigurationResponse' {} Maybe RuntimeConfiguration
a -> UpdateRuntimeConfigurationResponse
s {$sel:runtimeConfiguration:UpdateRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration = Maybe RuntimeConfiguration
a} :: UpdateRuntimeConfigurationResponse)
updateRuntimeConfigurationResponse_httpStatus :: Lens.Lens' UpdateRuntimeConfigurationResponse Prelude.Int
updateRuntimeConfigurationResponse_httpStatus :: (Int -> f Int)
-> UpdateRuntimeConfigurationResponse
-> f UpdateRuntimeConfigurationResponse
updateRuntimeConfigurationResponse_httpStatus = (UpdateRuntimeConfigurationResponse -> Int)
-> (UpdateRuntimeConfigurationResponse
-> Int -> UpdateRuntimeConfigurationResponse)
-> Lens
UpdateRuntimeConfigurationResponse
UpdateRuntimeConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuntimeConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRuntimeConfigurationResponse' :: UpdateRuntimeConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRuntimeConfigurationResponse
s@UpdateRuntimeConfigurationResponse' {} Int
a -> UpdateRuntimeConfigurationResponse
s {$sel:httpStatus:UpdateRuntimeConfigurationResponse' :: Int
httpStatus = Int
a} :: UpdateRuntimeConfigurationResponse)
instance
Prelude.NFData
UpdateRuntimeConfigurationResponse