{-# 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.DescribeRuntimeConfiguration
(
DescribeRuntimeConfiguration (..),
newDescribeRuntimeConfiguration,
describeRuntimeConfiguration_fleetId,
DescribeRuntimeConfigurationResponse (..),
newDescribeRuntimeConfigurationResponse,
describeRuntimeConfigurationResponse_runtimeConfiguration,
describeRuntimeConfigurationResponse_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 DescribeRuntimeConfiguration = DescribeRuntimeConfiguration'
{
DescribeRuntimeConfiguration -> Text
fleetId :: Prelude.Text
}
deriving (DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool
(DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool)
-> (DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool)
-> Eq DescribeRuntimeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool
$c/= :: DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool
== :: DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool
$c== :: DescribeRuntimeConfiguration
-> DescribeRuntimeConfiguration -> Bool
Prelude.Eq, ReadPrec [DescribeRuntimeConfiguration]
ReadPrec DescribeRuntimeConfiguration
Int -> ReadS DescribeRuntimeConfiguration
ReadS [DescribeRuntimeConfiguration]
(Int -> ReadS DescribeRuntimeConfiguration)
-> ReadS [DescribeRuntimeConfiguration]
-> ReadPrec DescribeRuntimeConfiguration
-> ReadPrec [DescribeRuntimeConfiguration]
-> Read DescribeRuntimeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuntimeConfiguration]
$creadListPrec :: ReadPrec [DescribeRuntimeConfiguration]
readPrec :: ReadPrec DescribeRuntimeConfiguration
$creadPrec :: ReadPrec DescribeRuntimeConfiguration
readList :: ReadS [DescribeRuntimeConfiguration]
$creadList :: ReadS [DescribeRuntimeConfiguration]
readsPrec :: Int -> ReadS DescribeRuntimeConfiguration
$creadsPrec :: Int -> ReadS DescribeRuntimeConfiguration
Prelude.Read, Int -> DescribeRuntimeConfiguration -> ShowS
[DescribeRuntimeConfiguration] -> ShowS
DescribeRuntimeConfiguration -> String
(Int -> DescribeRuntimeConfiguration -> ShowS)
-> (DescribeRuntimeConfiguration -> String)
-> ([DescribeRuntimeConfiguration] -> ShowS)
-> Show DescribeRuntimeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuntimeConfiguration] -> ShowS
$cshowList :: [DescribeRuntimeConfiguration] -> ShowS
show :: DescribeRuntimeConfiguration -> String
$cshow :: DescribeRuntimeConfiguration -> String
showsPrec :: Int -> DescribeRuntimeConfiguration -> ShowS
$cshowsPrec :: Int -> DescribeRuntimeConfiguration -> ShowS
Prelude.Show, (forall x.
DescribeRuntimeConfiguration -> Rep DescribeRuntimeConfiguration x)
-> (forall x.
Rep DescribeRuntimeConfiguration x -> DescribeRuntimeConfiguration)
-> Generic DescribeRuntimeConfiguration
forall x.
Rep DescribeRuntimeConfiguration x -> DescribeRuntimeConfiguration
forall x.
DescribeRuntimeConfiguration -> Rep DescribeRuntimeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuntimeConfiguration x -> DescribeRuntimeConfiguration
$cfrom :: forall x.
DescribeRuntimeConfiguration -> Rep DescribeRuntimeConfiguration x
Prelude.Generic)
newDescribeRuntimeConfiguration ::
Prelude.Text ->
DescribeRuntimeConfiguration
newDescribeRuntimeConfiguration :: Text -> DescribeRuntimeConfiguration
newDescribeRuntimeConfiguration Text
pFleetId_ =
DescribeRuntimeConfiguration' :: Text -> DescribeRuntimeConfiguration
DescribeRuntimeConfiguration' {$sel:fleetId:DescribeRuntimeConfiguration' :: Text
fleetId = Text
pFleetId_}
describeRuntimeConfiguration_fleetId :: Lens.Lens' DescribeRuntimeConfiguration Prelude.Text
describeRuntimeConfiguration_fleetId :: (Text -> f Text)
-> DescribeRuntimeConfiguration -> f DescribeRuntimeConfiguration
describeRuntimeConfiguration_fleetId = (DescribeRuntimeConfiguration -> Text)
-> (DescribeRuntimeConfiguration
-> Text -> DescribeRuntimeConfiguration)
-> Lens
DescribeRuntimeConfiguration DescribeRuntimeConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuntimeConfiguration' {Text
fleetId :: Text
$sel:fleetId:DescribeRuntimeConfiguration' :: DescribeRuntimeConfiguration -> Text
fleetId} -> Text
fleetId) (\s :: DescribeRuntimeConfiguration
s@DescribeRuntimeConfiguration' {} Text
a -> DescribeRuntimeConfiguration
s {$sel:fleetId:DescribeRuntimeConfiguration' :: Text
fleetId = Text
a} :: DescribeRuntimeConfiguration)
instance Core.AWSRequest DescribeRuntimeConfiguration where
type
AWSResponse DescribeRuntimeConfiguration =
DescribeRuntimeConfigurationResponse
request :: DescribeRuntimeConfiguration
-> Request DescribeRuntimeConfiguration
request = Service
-> DescribeRuntimeConfiguration
-> Request DescribeRuntimeConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRuntimeConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRuntimeConfiguration))
-> Logger
-> Service
-> Proxy DescribeRuntimeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRuntimeConfiguration)))
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 -> DescribeRuntimeConfigurationResponse
DescribeRuntimeConfigurationResponse'
(Maybe RuntimeConfiguration
-> Int -> DescribeRuntimeConfigurationResponse)
-> Either String (Maybe RuntimeConfiguration)
-> Either String (Int -> DescribeRuntimeConfigurationResponse)
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 -> DescribeRuntimeConfigurationResponse)
-> Either String Int
-> Either String DescribeRuntimeConfigurationResponse
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
DescribeRuntimeConfiguration
instance Prelude.NFData DescribeRuntimeConfiguration
instance Core.ToHeaders DescribeRuntimeConfiguration where
toHeaders :: DescribeRuntimeConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeRuntimeConfiguration -> 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.DescribeRuntimeConfiguration" ::
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 DescribeRuntimeConfiguration where
toJSON :: DescribeRuntimeConfiguration -> Value
toJSON DescribeRuntimeConfiguration' {Text
fleetId :: Text
$sel:fleetId:DescribeRuntimeConfiguration' :: DescribeRuntimeConfiguration -> 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)]
)
instance Core.ToPath DescribeRuntimeConfiguration where
toPath :: DescribeRuntimeConfiguration -> ByteString
toPath = ByteString -> DescribeRuntimeConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeRuntimeConfiguration where
toQuery :: DescribeRuntimeConfiguration -> QueryString
toQuery = QueryString -> DescribeRuntimeConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRuntimeConfigurationResponse = DescribeRuntimeConfigurationResponse'
{
DescribeRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
runtimeConfiguration :: Prelude.Maybe RuntimeConfiguration,
DescribeRuntimeConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool
(DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool)
-> (DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool)
-> Eq DescribeRuntimeConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool
$c/= :: DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool
== :: DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool
$c== :: DescribeRuntimeConfigurationResponse
-> DescribeRuntimeConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRuntimeConfigurationResponse]
ReadPrec DescribeRuntimeConfigurationResponse
Int -> ReadS DescribeRuntimeConfigurationResponse
ReadS [DescribeRuntimeConfigurationResponse]
(Int -> ReadS DescribeRuntimeConfigurationResponse)
-> ReadS [DescribeRuntimeConfigurationResponse]
-> ReadPrec DescribeRuntimeConfigurationResponse
-> ReadPrec [DescribeRuntimeConfigurationResponse]
-> Read DescribeRuntimeConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuntimeConfigurationResponse]
$creadListPrec :: ReadPrec [DescribeRuntimeConfigurationResponse]
readPrec :: ReadPrec DescribeRuntimeConfigurationResponse
$creadPrec :: ReadPrec DescribeRuntimeConfigurationResponse
readList :: ReadS [DescribeRuntimeConfigurationResponse]
$creadList :: ReadS [DescribeRuntimeConfigurationResponse]
readsPrec :: Int -> ReadS DescribeRuntimeConfigurationResponse
$creadsPrec :: Int -> ReadS DescribeRuntimeConfigurationResponse
Prelude.Read, Int -> DescribeRuntimeConfigurationResponse -> ShowS
[DescribeRuntimeConfigurationResponse] -> ShowS
DescribeRuntimeConfigurationResponse -> String
(Int -> DescribeRuntimeConfigurationResponse -> ShowS)
-> (DescribeRuntimeConfigurationResponse -> String)
-> ([DescribeRuntimeConfigurationResponse] -> ShowS)
-> Show DescribeRuntimeConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuntimeConfigurationResponse] -> ShowS
$cshowList :: [DescribeRuntimeConfigurationResponse] -> ShowS
show :: DescribeRuntimeConfigurationResponse -> String
$cshow :: DescribeRuntimeConfigurationResponse -> String
showsPrec :: Int -> DescribeRuntimeConfigurationResponse -> ShowS
$cshowsPrec :: Int -> DescribeRuntimeConfigurationResponse -> ShowS
Prelude.Show, (forall x.
DescribeRuntimeConfigurationResponse
-> Rep DescribeRuntimeConfigurationResponse x)
-> (forall x.
Rep DescribeRuntimeConfigurationResponse x
-> DescribeRuntimeConfigurationResponse)
-> Generic DescribeRuntimeConfigurationResponse
forall x.
Rep DescribeRuntimeConfigurationResponse x
-> DescribeRuntimeConfigurationResponse
forall x.
DescribeRuntimeConfigurationResponse
-> Rep DescribeRuntimeConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuntimeConfigurationResponse x
-> DescribeRuntimeConfigurationResponse
$cfrom :: forall x.
DescribeRuntimeConfigurationResponse
-> Rep DescribeRuntimeConfigurationResponse x
Prelude.Generic)
newDescribeRuntimeConfigurationResponse ::
Prelude.Int ->
DescribeRuntimeConfigurationResponse
newDescribeRuntimeConfigurationResponse :: Int -> DescribeRuntimeConfigurationResponse
newDescribeRuntimeConfigurationResponse Int
pHttpStatus_ =
DescribeRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
-> Int -> DescribeRuntimeConfigurationResponse
DescribeRuntimeConfigurationResponse'
{ $sel:runtimeConfiguration:DescribeRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration =
Maybe RuntimeConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRuntimeConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRuntimeConfigurationResponse_runtimeConfiguration :: Lens.Lens' DescribeRuntimeConfigurationResponse (Prelude.Maybe RuntimeConfiguration)
describeRuntimeConfigurationResponse_runtimeConfiguration :: (Maybe RuntimeConfiguration -> f (Maybe RuntimeConfiguration))
-> DescribeRuntimeConfigurationResponse
-> f DescribeRuntimeConfigurationResponse
describeRuntimeConfigurationResponse_runtimeConfiguration = (DescribeRuntimeConfigurationResponse
-> Maybe RuntimeConfiguration)
-> (DescribeRuntimeConfigurationResponse
-> Maybe RuntimeConfiguration
-> DescribeRuntimeConfigurationResponse)
-> Lens
DescribeRuntimeConfigurationResponse
DescribeRuntimeConfigurationResponse
(Maybe RuntimeConfiguration)
(Maybe RuntimeConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuntimeConfigurationResponse' {Maybe RuntimeConfiguration
runtimeConfiguration :: Maybe RuntimeConfiguration
$sel:runtimeConfiguration:DescribeRuntimeConfigurationResponse' :: DescribeRuntimeConfigurationResponse -> Maybe RuntimeConfiguration
runtimeConfiguration} -> Maybe RuntimeConfiguration
runtimeConfiguration) (\s :: DescribeRuntimeConfigurationResponse
s@DescribeRuntimeConfigurationResponse' {} Maybe RuntimeConfiguration
a -> DescribeRuntimeConfigurationResponse
s {$sel:runtimeConfiguration:DescribeRuntimeConfigurationResponse' :: Maybe RuntimeConfiguration
runtimeConfiguration = Maybe RuntimeConfiguration
a} :: DescribeRuntimeConfigurationResponse)
describeRuntimeConfigurationResponse_httpStatus :: Lens.Lens' DescribeRuntimeConfigurationResponse Prelude.Int
describeRuntimeConfigurationResponse_httpStatus :: (Int -> f Int)
-> DescribeRuntimeConfigurationResponse
-> f DescribeRuntimeConfigurationResponse
describeRuntimeConfigurationResponse_httpStatus = (DescribeRuntimeConfigurationResponse -> Int)
-> (DescribeRuntimeConfigurationResponse
-> Int -> DescribeRuntimeConfigurationResponse)
-> Lens
DescribeRuntimeConfigurationResponse
DescribeRuntimeConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuntimeConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRuntimeConfigurationResponse' :: DescribeRuntimeConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRuntimeConfigurationResponse
s@DescribeRuntimeConfigurationResponse' {} Int
a -> DescribeRuntimeConfigurationResponse
s {$sel:httpStatus:DescribeRuntimeConfigurationResponse' :: Int
httpStatus = Int
a} :: DescribeRuntimeConfigurationResponse)
instance
Prelude.NFData
DescribeRuntimeConfigurationResponse