{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types
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
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]
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
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.
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'
{ $sel:fleetId:UpdateRuntimeConfiguration' :: Text
fleetId = Text
pFleetId_,
$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: RuntimeConfiguration
runtimeConfiguration = RuntimeConfiguration
pRuntimeConfiguration_
}
updateRuntimeConfiguration_fleetId :: Lens.Lens' UpdateRuntimeConfiguration Prelude.Text
updateRuntimeConfiguration_fleetId :: Lens' UpdateRuntimeConfiguration Text
updateRuntimeConfiguration_fleetId = 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 :: Lens' UpdateRuntimeConfiguration RuntimeConfiguration
updateRuntimeConfiguration_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 :: (Service -> Service)
-> UpdateRuntimeConfiguration -> Request UpdateRuntimeConfiguration
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 UpdateRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRuntimeConfiguration)))
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 RuntimeConfiguration
-> Int -> UpdateRuntimeConfigurationResponse
UpdateRuntimeConfigurationResponse'
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
"RuntimeConfiguration")
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 UpdateRuntimeConfiguration where
hashWithSalt :: Int -> UpdateRuntimeConfiguration -> Int
hashWithSalt Int
_salt UpdateRuntimeConfiguration' {Text
RuntimeConfiguration
runtimeConfiguration :: RuntimeConfiguration
fleetId :: Text
$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> RuntimeConfiguration
$sel:fleetId:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fleetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RuntimeConfiguration
runtimeConfiguration
instance Prelude.NFData UpdateRuntimeConfiguration where
rnf :: UpdateRuntimeConfiguration -> ()
rnf UpdateRuntimeConfiguration' {Text
RuntimeConfiguration
runtimeConfiguration :: RuntimeConfiguration
fleetId :: Text
$sel:runtimeConfiguration:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> RuntimeConfiguration
$sel:fleetId:UpdateRuntimeConfiguration' :: UpdateRuntimeConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
fleetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RuntimeConfiguration
runtimeConfiguration
instance Data.ToHeaders UpdateRuntimeConfiguration where
toHeaders :: UpdateRuntimeConfiguration -> 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
"GameLift.UpdateRuntimeConfiguration" ::
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 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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"FleetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fleetId),
forall a. a -> Maybe a
Prelude.Just
( Key
"RuntimeConfiguration"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RuntimeConfiguration
runtimeConfiguration
)
]
)
instance Data.ToPath UpdateRuntimeConfiguration where
toPath :: UpdateRuntimeConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateRuntimeConfiguration where
toQuery :: UpdateRuntimeConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:runtimeConfiguration:UpdateRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateRuntimeConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateRuntimeConfigurationResponse_runtimeConfiguration :: Lens.Lens' UpdateRuntimeConfigurationResponse (Prelude.Maybe RuntimeConfiguration)
updateRuntimeConfigurationResponse_runtimeConfiguration :: Lens'
UpdateRuntimeConfigurationResponse (Maybe RuntimeConfiguration)
updateRuntimeConfigurationResponse_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 :: Lens' UpdateRuntimeConfigurationResponse Int
updateRuntimeConfigurationResponse_httpStatus = 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
where
rnf :: UpdateRuntimeConfigurationResponse -> ()
rnf UpdateRuntimeConfigurationResponse' {Int
Maybe RuntimeConfiguration
httpStatus :: Int
runtimeConfiguration :: Maybe RuntimeConfiguration
$sel:httpStatus:UpdateRuntimeConfigurationResponse' :: UpdateRuntimeConfigurationResponse -> Int
$sel:runtimeConfiguration:UpdateRuntimeConfigurationResponse' :: UpdateRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RuntimeConfiguration
runtimeConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus