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