{-# 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.DescribeFleetLocationCapacity
(
DescribeFleetLocationCapacity (..),
newDescribeFleetLocationCapacity,
describeFleetLocationCapacity_fleetId,
describeFleetLocationCapacity_location,
DescribeFleetLocationCapacityResponse (..),
newDescribeFleetLocationCapacityResponse,
describeFleetLocationCapacityResponse_fleetCapacity,
describeFleetLocationCapacityResponse_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 DescribeFleetLocationCapacity = DescribeFleetLocationCapacity'
{
DescribeFleetLocationCapacity -> Text
fleetId :: Prelude.Text,
DescribeFleetLocationCapacity -> Text
location :: Prelude.Text
}
deriving (DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool
(DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool)
-> (DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool)
-> Eq DescribeFleetLocationCapacity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool
$c/= :: DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool
== :: DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool
$c== :: DescribeFleetLocationCapacity
-> DescribeFleetLocationCapacity -> Bool
Prelude.Eq, ReadPrec [DescribeFleetLocationCapacity]
ReadPrec DescribeFleetLocationCapacity
Int -> ReadS DescribeFleetLocationCapacity
ReadS [DescribeFleetLocationCapacity]
(Int -> ReadS DescribeFleetLocationCapacity)
-> ReadS [DescribeFleetLocationCapacity]
-> ReadPrec DescribeFleetLocationCapacity
-> ReadPrec [DescribeFleetLocationCapacity]
-> Read DescribeFleetLocationCapacity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetLocationCapacity]
$creadListPrec :: ReadPrec [DescribeFleetLocationCapacity]
readPrec :: ReadPrec DescribeFleetLocationCapacity
$creadPrec :: ReadPrec DescribeFleetLocationCapacity
readList :: ReadS [DescribeFleetLocationCapacity]
$creadList :: ReadS [DescribeFleetLocationCapacity]
readsPrec :: Int -> ReadS DescribeFleetLocationCapacity
$creadsPrec :: Int -> ReadS DescribeFleetLocationCapacity
Prelude.Read, Int -> DescribeFleetLocationCapacity -> ShowS
[DescribeFleetLocationCapacity] -> ShowS
DescribeFleetLocationCapacity -> String
(Int -> DescribeFleetLocationCapacity -> ShowS)
-> (DescribeFleetLocationCapacity -> String)
-> ([DescribeFleetLocationCapacity] -> ShowS)
-> Show DescribeFleetLocationCapacity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetLocationCapacity] -> ShowS
$cshowList :: [DescribeFleetLocationCapacity] -> ShowS
show :: DescribeFleetLocationCapacity -> String
$cshow :: DescribeFleetLocationCapacity -> String
showsPrec :: Int -> DescribeFleetLocationCapacity -> ShowS
$cshowsPrec :: Int -> DescribeFleetLocationCapacity -> ShowS
Prelude.Show, (forall x.
DescribeFleetLocationCapacity
-> Rep DescribeFleetLocationCapacity x)
-> (forall x.
Rep DescribeFleetLocationCapacity x
-> DescribeFleetLocationCapacity)
-> Generic DescribeFleetLocationCapacity
forall x.
Rep DescribeFleetLocationCapacity x
-> DescribeFleetLocationCapacity
forall x.
DescribeFleetLocationCapacity
-> Rep DescribeFleetLocationCapacity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFleetLocationCapacity x
-> DescribeFleetLocationCapacity
$cfrom :: forall x.
DescribeFleetLocationCapacity
-> Rep DescribeFleetLocationCapacity x
Prelude.Generic)
newDescribeFleetLocationCapacity ::
Prelude.Text ->
Prelude.Text ->
DescribeFleetLocationCapacity
newDescribeFleetLocationCapacity :: Text -> Text -> DescribeFleetLocationCapacity
newDescribeFleetLocationCapacity Text
pFleetId_ Text
pLocation_ =
DescribeFleetLocationCapacity' :: Text -> Text -> DescribeFleetLocationCapacity
DescribeFleetLocationCapacity'
{ $sel:fleetId:DescribeFleetLocationCapacity' :: Text
fleetId = Text
pFleetId_,
$sel:location:DescribeFleetLocationCapacity' :: Text
location = Text
pLocation_
}
describeFleetLocationCapacity_fleetId :: Lens.Lens' DescribeFleetLocationCapacity Prelude.Text
describeFleetLocationCapacity_fleetId :: (Text -> f Text)
-> DescribeFleetLocationCapacity -> f DescribeFleetLocationCapacity
describeFleetLocationCapacity_fleetId = (DescribeFleetLocationCapacity -> Text)
-> (DescribeFleetLocationCapacity
-> Text -> DescribeFleetLocationCapacity)
-> Lens
DescribeFleetLocationCapacity
DescribeFleetLocationCapacity
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationCapacity' {Text
fleetId :: Text
$sel:fleetId:DescribeFleetLocationCapacity' :: DescribeFleetLocationCapacity -> Text
fleetId} -> Text
fleetId) (\s :: DescribeFleetLocationCapacity
s@DescribeFleetLocationCapacity' {} Text
a -> DescribeFleetLocationCapacity
s {$sel:fleetId:DescribeFleetLocationCapacity' :: Text
fleetId = Text
a} :: DescribeFleetLocationCapacity)
describeFleetLocationCapacity_location :: Lens.Lens' DescribeFleetLocationCapacity Prelude.Text
describeFleetLocationCapacity_location :: (Text -> f Text)
-> DescribeFleetLocationCapacity -> f DescribeFleetLocationCapacity
describeFleetLocationCapacity_location = (DescribeFleetLocationCapacity -> Text)
-> (DescribeFleetLocationCapacity
-> Text -> DescribeFleetLocationCapacity)
-> Lens
DescribeFleetLocationCapacity
DescribeFleetLocationCapacity
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationCapacity' {Text
location :: Text
$sel:location:DescribeFleetLocationCapacity' :: DescribeFleetLocationCapacity -> Text
location} -> Text
location) (\s :: DescribeFleetLocationCapacity
s@DescribeFleetLocationCapacity' {} Text
a -> DescribeFleetLocationCapacity
s {$sel:location:DescribeFleetLocationCapacity' :: Text
location = Text
a} :: DescribeFleetLocationCapacity)
instance
Core.AWSRequest
DescribeFleetLocationCapacity
where
type
AWSResponse DescribeFleetLocationCapacity =
DescribeFleetLocationCapacityResponse
request :: DescribeFleetLocationCapacity
-> Request DescribeFleetLocationCapacity
request = Service
-> DescribeFleetLocationCapacity
-> Request DescribeFleetLocationCapacity
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFleetLocationCapacity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFleetLocationCapacity)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFleetLocationCapacity))
-> Logger
-> Service
-> Proxy DescribeFleetLocationCapacity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFleetLocationCapacity)))
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 FleetCapacity -> Int -> DescribeFleetLocationCapacityResponse
DescribeFleetLocationCapacityResponse'
(Maybe FleetCapacity
-> Int -> DescribeFleetLocationCapacityResponse)
-> Either String (Maybe FleetCapacity)
-> Either String (Int -> DescribeFleetLocationCapacityResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FleetCapacity)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FleetCapacity")
Either String (Int -> DescribeFleetLocationCapacityResponse)
-> Either String Int
-> Either String DescribeFleetLocationCapacityResponse
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
DescribeFleetLocationCapacity
instance Prelude.NFData DescribeFleetLocationCapacity
instance Core.ToHeaders DescribeFleetLocationCapacity where
toHeaders :: DescribeFleetLocationCapacity -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeFleetLocationCapacity -> 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.DescribeFleetLocationCapacity" ::
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 DescribeFleetLocationCapacity where
toJSON :: DescribeFleetLocationCapacity -> Value
toJSON DescribeFleetLocationCapacity' {Text
location :: Text
fleetId :: Text
$sel:location:DescribeFleetLocationCapacity' :: DescribeFleetLocationCapacity -> Text
$sel:fleetId:DescribeFleetLocationCapacity' :: DescribeFleetLocationCapacity -> 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
"Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
location)
]
)
instance Core.ToPath DescribeFleetLocationCapacity where
toPath :: DescribeFleetLocationCapacity -> ByteString
toPath = ByteString -> DescribeFleetLocationCapacity -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeFleetLocationCapacity where
toQuery :: DescribeFleetLocationCapacity -> QueryString
toQuery = QueryString -> DescribeFleetLocationCapacity -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeFleetLocationCapacityResponse = DescribeFleetLocationCapacityResponse'
{
DescribeFleetLocationCapacityResponse -> Maybe FleetCapacity
fleetCapacity :: Prelude.Maybe FleetCapacity,
DescribeFleetLocationCapacityResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool
(DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool)
-> (DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool)
-> Eq DescribeFleetLocationCapacityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool
$c/= :: DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool
== :: DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool
$c== :: DescribeFleetLocationCapacityResponse
-> DescribeFleetLocationCapacityResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFleetLocationCapacityResponse]
ReadPrec DescribeFleetLocationCapacityResponse
Int -> ReadS DescribeFleetLocationCapacityResponse
ReadS [DescribeFleetLocationCapacityResponse]
(Int -> ReadS DescribeFleetLocationCapacityResponse)
-> ReadS [DescribeFleetLocationCapacityResponse]
-> ReadPrec DescribeFleetLocationCapacityResponse
-> ReadPrec [DescribeFleetLocationCapacityResponse]
-> Read DescribeFleetLocationCapacityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetLocationCapacityResponse]
$creadListPrec :: ReadPrec [DescribeFleetLocationCapacityResponse]
readPrec :: ReadPrec DescribeFleetLocationCapacityResponse
$creadPrec :: ReadPrec DescribeFleetLocationCapacityResponse
readList :: ReadS [DescribeFleetLocationCapacityResponse]
$creadList :: ReadS [DescribeFleetLocationCapacityResponse]
readsPrec :: Int -> ReadS DescribeFleetLocationCapacityResponse
$creadsPrec :: Int -> ReadS DescribeFleetLocationCapacityResponse
Prelude.Read, Int -> DescribeFleetLocationCapacityResponse -> ShowS
[DescribeFleetLocationCapacityResponse] -> ShowS
DescribeFleetLocationCapacityResponse -> String
(Int -> DescribeFleetLocationCapacityResponse -> ShowS)
-> (DescribeFleetLocationCapacityResponse -> String)
-> ([DescribeFleetLocationCapacityResponse] -> ShowS)
-> Show DescribeFleetLocationCapacityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetLocationCapacityResponse] -> ShowS
$cshowList :: [DescribeFleetLocationCapacityResponse] -> ShowS
show :: DescribeFleetLocationCapacityResponse -> String
$cshow :: DescribeFleetLocationCapacityResponse -> String
showsPrec :: Int -> DescribeFleetLocationCapacityResponse -> ShowS
$cshowsPrec :: Int -> DescribeFleetLocationCapacityResponse -> ShowS
Prelude.Show, (forall x.
DescribeFleetLocationCapacityResponse
-> Rep DescribeFleetLocationCapacityResponse x)
-> (forall x.
Rep DescribeFleetLocationCapacityResponse x
-> DescribeFleetLocationCapacityResponse)
-> Generic DescribeFleetLocationCapacityResponse
forall x.
Rep DescribeFleetLocationCapacityResponse x
-> DescribeFleetLocationCapacityResponse
forall x.
DescribeFleetLocationCapacityResponse
-> Rep DescribeFleetLocationCapacityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFleetLocationCapacityResponse x
-> DescribeFleetLocationCapacityResponse
$cfrom :: forall x.
DescribeFleetLocationCapacityResponse
-> Rep DescribeFleetLocationCapacityResponse x
Prelude.Generic)
newDescribeFleetLocationCapacityResponse ::
Prelude.Int ->
DescribeFleetLocationCapacityResponse
newDescribeFleetLocationCapacityResponse :: Int -> DescribeFleetLocationCapacityResponse
newDescribeFleetLocationCapacityResponse Int
pHttpStatus_ =
DescribeFleetLocationCapacityResponse' :: Maybe FleetCapacity -> Int -> DescribeFleetLocationCapacityResponse
DescribeFleetLocationCapacityResponse'
{ $sel:fleetCapacity:DescribeFleetLocationCapacityResponse' :: Maybe FleetCapacity
fleetCapacity =
Maybe FleetCapacity
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFleetLocationCapacityResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFleetLocationCapacityResponse_fleetCapacity :: Lens.Lens' DescribeFleetLocationCapacityResponse (Prelude.Maybe FleetCapacity)
describeFleetLocationCapacityResponse_fleetCapacity :: (Maybe FleetCapacity -> f (Maybe FleetCapacity))
-> DescribeFleetLocationCapacityResponse
-> f DescribeFleetLocationCapacityResponse
describeFleetLocationCapacityResponse_fleetCapacity = (DescribeFleetLocationCapacityResponse -> Maybe FleetCapacity)
-> (DescribeFleetLocationCapacityResponse
-> Maybe FleetCapacity -> DescribeFleetLocationCapacityResponse)
-> Lens
DescribeFleetLocationCapacityResponse
DescribeFleetLocationCapacityResponse
(Maybe FleetCapacity)
(Maybe FleetCapacity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationCapacityResponse' {Maybe FleetCapacity
fleetCapacity :: Maybe FleetCapacity
$sel:fleetCapacity:DescribeFleetLocationCapacityResponse' :: DescribeFleetLocationCapacityResponse -> Maybe FleetCapacity
fleetCapacity} -> Maybe FleetCapacity
fleetCapacity) (\s :: DescribeFleetLocationCapacityResponse
s@DescribeFleetLocationCapacityResponse' {} Maybe FleetCapacity
a -> DescribeFleetLocationCapacityResponse
s {$sel:fleetCapacity:DescribeFleetLocationCapacityResponse' :: Maybe FleetCapacity
fleetCapacity = Maybe FleetCapacity
a} :: DescribeFleetLocationCapacityResponse)
describeFleetLocationCapacityResponse_httpStatus :: Lens.Lens' DescribeFleetLocationCapacityResponse Prelude.Int
describeFleetLocationCapacityResponse_httpStatus :: (Int -> f Int)
-> DescribeFleetLocationCapacityResponse
-> f DescribeFleetLocationCapacityResponse
describeFleetLocationCapacityResponse_httpStatus = (DescribeFleetLocationCapacityResponse -> Int)
-> (DescribeFleetLocationCapacityResponse
-> Int -> DescribeFleetLocationCapacityResponse)
-> Lens
DescribeFleetLocationCapacityResponse
DescribeFleetLocationCapacityResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationCapacityResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFleetLocationCapacityResponse' :: DescribeFleetLocationCapacityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFleetLocationCapacityResponse
s@DescribeFleetLocationCapacityResponse' {} Int
a -> DescribeFleetLocationCapacityResponse
s {$sel:httpStatus:DescribeFleetLocationCapacityResponse' :: Int
httpStatus = Int
a} :: DescribeFleetLocationCapacityResponse)
instance
Prelude.NFData
DescribeFleetLocationCapacityResponse