{-# 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.RegisterCompute
(
RegisterCompute (..),
newRegisterCompute,
registerCompute_certificatePath,
registerCompute_dnsName,
registerCompute_ipAddress,
registerCompute_location,
registerCompute_fleetId,
registerCompute_computeName,
RegisterComputeResponse (..),
newRegisterComputeResponse,
registerComputeResponse_compute,
registerComputeResponse_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 RegisterCompute = RegisterCompute'
{
RegisterCompute -> Maybe Text
certificatePath :: Prelude.Maybe Prelude.Text,
RegisterCompute -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text,
RegisterCompute -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
RegisterCompute -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
RegisterCompute -> Text
fleetId :: Prelude.Text,
RegisterCompute -> Text
computeName :: Prelude.Text
}
deriving (RegisterCompute -> RegisterCompute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterCompute -> RegisterCompute -> Bool
$c/= :: RegisterCompute -> RegisterCompute -> Bool
== :: RegisterCompute -> RegisterCompute -> Bool
$c== :: RegisterCompute -> RegisterCompute -> Bool
Prelude.Eq, ReadPrec [RegisterCompute]
ReadPrec RegisterCompute
Int -> ReadS RegisterCompute
ReadS [RegisterCompute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterCompute]
$creadListPrec :: ReadPrec [RegisterCompute]
readPrec :: ReadPrec RegisterCompute
$creadPrec :: ReadPrec RegisterCompute
readList :: ReadS [RegisterCompute]
$creadList :: ReadS [RegisterCompute]
readsPrec :: Int -> ReadS RegisterCompute
$creadsPrec :: Int -> ReadS RegisterCompute
Prelude.Read, Int -> RegisterCompute -> ShowS
[RegisterCompute] -> ShowS
RegisterCompute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterCompute] -> ShowS
$cshowList :: [RegisterCompute] -> ShowS
show :: RegisterCompute -> String
$cshow :: RegisterCompute -> String
showsPrec :: Int -> RegisterCompute -> ShowS
$cshowsPrec :: Int -> RegisterCompute -> ShowS
Prelude.Show, forall x. Rep RegisterCompute x -> RegisterCompute
forall x. RegisterCompute -> Rep RegisterCompute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterCompute x -> RegisterCompute
$cfrom :: forall x. RegisterCompute -> Rep RegisterCompute x
Prelude.Generic)
newRegisterCompute ::
Prelude.Text ->
Prelude.Text ->
RegisterCompute
newRegisterCompute :: Text -> Text -> RegisterCompute
newRegisterCompute Text
pFleetId_ Text
pComputeName_ =
RegisterCompute'
{ $sel:certificatePath:RegisterCompute' :: Maybe Text
certificatePath = forall a. Maybe a
Prelude.Nothing,
$sel:dnsName:RegisterCompute' :: Maybe Text
dnsName = forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:RegisterCompute' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
$sel:location:RegisterCompute' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:RegisterCompute' :: Text
fleetId = Text
pFleetId_,
$sel:computeName:RegisterCompute' :: Text
computeName = Text
pComputeName_
}
registerCompute_certificatePath :: Lens.Lens' RegisterCompute (Prelude.Maybe Prelude.Text)
registerCompute_certificatePath :: Lens' RegisterCompute (Maybe Text)
registerCompute_certificatePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCompute' {Maybe Text
certificatePath :: Maybe Text
$sel:certificatePath:RegisterCompute' :: RegisterCompute -> Maybe Text
certificatePath} -> Maybe Text
certificatePath) (\s :: RegisterCompute
s@RegisterCompute' {} Maybe Text
a -> RegisterCompute
s {$sel:certificatePath:RegisterCompute' :: Maybe Text
certificatePath = Maybe Text
a} :: RegisterCompute)
registerCompute_dnsName :: Lens.Lens' RegisterCompute (Prelude.Maybe Prelude.Text)
registerCompute_dnsName :: Lens' RegisterCompute (Maybe Text)
registerCompute_dnsName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCompute' {Maybe Text
dnsName :: Maybe Text
$sel:dnsName:RegisterCompute' :: RegisterCompute -> Maybe Text
dnsName} -> Maybe Text
dnsName) (\s :: RegisterCompute
s@RegisterCompute' {} Maybe Text
a -> RegisterCompute
s {$sel:dnsName:RegisterCompute' :: Maybe Text
dnsName = Maybe Text
a} :: RegisterCompute)
registerCompute_ipAddress :: Lens.Lens' RegisterCompute (Prelude.Maybe Prelude.Text)
registerCompute_ipAddress :: Lens' RegisterCompute (Maybe Text)
registerCompute_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCompute' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:RegisterCompute' :: RegisterCompute -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: RegisterCompute
s@RegisterCompute' {} Maybe Text
a -> RegisterCompute
s {$sel:ipAddress:RegisterCompute' :: Maybe Text
ipAddress = Maybe Text
a} :: RegisterCompute)
registerCompute_location :: Lens.Lens' RegisterCompute (Prelude.Maybe Prelude.Text)
registerCompute_location :: Lens' RegisterCompute (Maybe Text)
registerCompute_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCompute' {Maybe Text
location :: Maybe Text
$sel:location:RegisterCompute' :: RegisterCompute -> Maybe Text
location} -> Maybe Text
location) (\s :: RegisterCompute
s@RegisterCompute' {} Maybe Text
a -> RegisterCompute
s {$sel:location:RegisterCompute' :: Maybe Text
location = Maybe Text
a} :: RegisterCompute)
registerCompute_fleetId :: Lens.Lens' RegisterCompute Prelude.Text
registerCompute_fleetId :: Lens' RegisterCompute Text
registerCompute_fleetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCompute' {Text
fleetId :: Text
$sel:fleetId:RegisterCompute' :: RegisterCompute -> Text
fleetId} -> Text
fleetId) (\s :: RegisterCompute
s@RegisterCompute' {} Text
a -> RegisterCompute
s {$sel:fleetId:RegisterCompute' :: Text
fleetId = Text
a} :: RegisterCompute)
registerCompute_computeName :: Lens.Lens' RegisterCompute Prelude.Text
registerCompute_computeName :: Lens' RegisterCompute Text
registerCompute_computeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCompute' {Text
computeName :: Text
$sel:computeName:RegisterCompute' :: RegisterCompute -> Text
computeName} -> Text
computeName) (\s :: RegisterCompute
s@RegisterCompute' {} Text
a -> RegisterCompute
s {$sel:computeName:RegisterCompute' :: Text
computeName = Text
a} :: RegisterCompute)
instance Core.AWSRequest RegisterCompute where
type
AWSResponse RegisterCompute =
RegisterComputeResponse
request :: (Service -> Service) -> RegisterCompute -> Request RegisterCompute
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 RegisterCompute
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterCompute)))
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 Compute -> Int -> RegisterComputeResponse
RegisterComputeResponse'
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
"Compute")
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 RegisterCompute where
hashWithSalt :: Int -> RegisterCompute -> Int
hashWithSalt Int
_salt RegisterCompute' {Maybe Text
Text
computeName :: Text
fleetId :: Text
location :: Maybe Text
ipAddress :: Maybe Text
dnsName :: Maybe Text
certificatePath :: Maybe Text
$sel:computeName:RegisterCompute' :: RegisterCompute -> Text
$sel:fleetId:RegisterCompute' :: RegisterCompute -> Text
$sel:location:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:ipAddress:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:dnsName:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:certificatePath:RegisterCompute' :: RegisterCompute -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificatePath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dnsName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fleetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
computeName
instance Prelude.NFData RegisterCompute where
rnf :: RegisterCompute -> ()
rnf RegisterCompute' {Maybe Text
Text
computeName :: Text
fleetId :: Text
location :: Maybe Text
ipAddress :: Maybe Text
dnsName :: Maybe Text
certificatePath :: Maybe Text
$sel:computeName:RegisterCompute' :: RegisterCompute -> Text
$sel:fleetId:RegisterCompute' :: RegisterCompute -> Text
$sel:location:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:ipAddress:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:dnsName:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:certificatePath:RegisterCompute' :: RegisterCompute -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificatePath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dnsName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
computeName
instance Data.ToHeaders RegisterCompute where
toHeaders :: RegisterCompute -> 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.RegisterCompute" :: 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 RegisterCompute where
toJSON :: RegisterCompute -> Value
toJSON RegisterCompute' {Maybe Text
Text
computeName :: Text
fleetId :: Text
location :: Maybe Text
ipAddress :: Maybe Text
dnsName :: Maybe Text
certificatePath :: Maybe Text
$sel:computeName:RegisterCompute' :: RegisterCompute -> Text
$sel:fleetId:RegisterCompute' :: RegisterCompute -> Text
$sel:location:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:ipAddress:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:dnsName:RegisterCompute' :: RegisterCompute -> Maybe Text
$sel:certificatePath:RegisterCompute' :: RegisterCompute -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CertificatePath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificatePath,
(Key
"DnsName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dnsName,
(Key
"IpAddress" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ipAddress,
(Key
"Location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
location,
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
"ComputeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
computeName)
]
)
instance Data.ToPath RegisterCompute where
toPath :: RegisterCompute -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery RegisterCompute where
toQuery :: RegisterCompute -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data RegisterComputeResponse = RegisterComputeResponse'
{
RegisterComputeResponse -> Maybe Compute
compute :: Prelude.Maybe Compute,
RegisterComputeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RegisterComputeResponse -> RegisterComputeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterComputeResponse -> RegisterComputeResponse -> Bool
$c/= :: RegisterComputeResponse -> RegisterComputeResponse -> Bool
== :: RegisterComputeResponse -> RegisterComputeResponse -> Bool
$c== :: RegisterComputeResponse -> RegisterComputeResponse -> Bool
Prelude.Eq, ReadPrec [RegisterComputeResponse]
ReadPrec RegisterComputeResponse
Int -> ReadS RegisterComputeResponse
ReadS [RegisterComputeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterComputeResponse]
$creadListPrec :: ReadPrec [RegisterComputeResponse]
readPrec :: ReadPrec RegisterComputeResponse
$creadPrec :: ReadPrec RegisterComputeResponse
readList :: ReadS [RegisterComputeResponse]
$creadList :: ReadS [RegisterComputeResponse]
readsPrec :: Int -> ReadS RegisterComputeResponse
$creadsPrec :: Int -> ReadS RegisterComputeResponse
Prelude.Read, Int -> RegisterComputeResponse -> ShowS
[RegisterComputeResponse] -> ShowS
RegisterComputeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterComputeResponse] -> ShowS
$cshowList :: [RegisterComputeResponse] -> ShowS
show :: RegisterComputeResponse -> String
$cshow :: RegisterComputeResponse -> String
showsPrec :: Int -> RegisterComputeResponse -> ShowS
$cshowsPrec :: Int -> RegisterComputeResponse -> ShowS
Prelude.Show, forall x. Rep RegisterComputeResponse x -> RegisterComputeResponse
forall x. RegisterComputeResponse -> Rep RegisterComputeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterComputeResponse x -> RegisterComputeResponse
$cfrom :: forall x. RegisterComputeResponse -> Rep RegisterComputeResponse x
Prelude.Generic)
newRegisterComputeResponse ::
Prelude.Int ->
RegisterComputeResponse
newRegisterComputeResponse :: Int -> RegisterComputeResponse
newRegisterComputeResponse Int
pHttpStatus_ =
RegisterComputeResponse'
{ $sel:compute:RegisterComputeResponse' :: Maybe Compute
compute = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RegisterComputeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
registerComputeResponse_compute :: Lens.Lens' RegisterComputeResponse (Prelude.Maybe Compute)
registerComputeResponse_compute :: Lens' RegisterComputeResponse (Maybe Compute)
registerComputeResponse_compute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterComputeResponse' {Maybe Compute
compute :: Maybe Compute
$sel:compute:RegisterComputeResponse' :: RegisterComputeResponse -> Maybe Compute
compute} -> Maybe Compute
compute) (\s :: RegisterComputeResponse
s@RegisterComputeResponse' {} Maybe Compute
a -> RegisterComputeResponse
s {$sel:compute:RegisterComputeResponse' :: Maybe Compute
compute = Maybe Compute
a} :: RegisterComputeResponse)
registerComputeResponse_httpStatus :: Lens.Lens' RegisterComputeResponse Prelude.Int
registerComputeResponse_httpStatus :: Lens' RegisterComputeResponse Int
registerComputeResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterComputeResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterComputeResponse' :: RegisterComputeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterComputeResponse
s@RegisterComputeResponse' {} Int
a -> RegisterComputeResponse
s {$sel:httpStatus:RegisterComputeResponse' :: Int
httpStatus = Int
a} :: RegisterComputeResponse)
instance Prelude.NFData RegisterComputeResponse where
rnf :: RegisterComputeResponse -> ()
rnf RegisterComputeResponse' {Int
Maybe Compute
httpStatus :: Int
compute :: Maybe Compute
$sel:httpStatus:RegisterComputeResponse' :: RegisterComputeResponse -> Int
$sel:compute:RegisterComputeResponse' :: RegisterComputeResponse -> Maybe Compute
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Compute
compute
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus