{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GameLift.Types.GameSessionConnectionInfo 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.MatchedPlayerSession
import qualified Amazonka.Prelude as Prelude
data GameSessionConnectionInfo = GameSessionConnectionInfo'
{
GameSessionConnectionInfo -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text,
GameSessionConnectionInfo -> Maybe Text
gameSessionArn :: Prelude.Maybe Prelude.Text,
GameSessionConnectionInfo -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
GameSessionConnectionInfo -> Maybe [MatchedPlayerSession]
matchedPlayerSessions :: Prelude.Maybe [MatchedPlayerSession],
GameSessionConnectionInfo -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural
}
deriving (GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool
$c/= :: GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool
== :: GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool
$c== :: GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool
Prelude.Eq, ReadPrec [GameSessionConnectionInfo]
ReadPrec GameSessionConnectionInfo
Int -> ReadS GameSessionConnectionInfo
ReadS [GameSessionConnectionInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameSessionConnectionInfo]
$creadListPrec :: ReadPrec [GameSessionConnectionInfo]
readPrec :: ReadPrec GameSessionConnectionInfo
$creadPrec :: ReadPrec GameSessionConnectionInfo
readList :: ReadS [GameSessionConnectionInfo]
$creadList :: ReadS [GameSessionConnectionInfo]
readsPrec :: Int -> ReadS GameSessionConnectionInfo
$creadsPrec :: Int -> ReadS GameSessionConnectionInfo
Prelude.Read, Int -> GameSessionConnectionInfo -> ShowS
[GameSessionConnectionInfo] -> ShowS
GameSessionConnectionInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameSessionConnectionInfo] -> ShowS
$cshowList :: [GameSessionConnectionInfo] -> ShowS
show :: GameSessionConnectionInfo -> String
$cshow :: GameSessionConnectionInfo -> String
showsPrec :: Int -> GameSessionConnectionInfo -> ShowS
$cshowsPrec :: Int -> GameSessionConnectionInfo -> ShowS
Prelude.Show, forall x.
Rep GameSessionConnectionInfo x -> GameSessionConnectionInfo
forall x.
GameSessionConnectionInfo -> Rep GameSessionConnectionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GameSessionConnectionInfo x -> GameSessionConnectionInfo
$cfrom :: forall x.
GameSessionConnectionInfo -> Rep GameSessionConnectionInfo x
Prelude.Generic)
newGameSessionConnectionInfo ::
GameSessionConnectionInfo
newGameSessionConnectionInfo :: GameSessionConnectionInfo
newGameSessionConnectionInfo =
GameSessionConnectionInfo'
{ $sel:dnsName:GameSessionConnectionInfo' :: Maybe Text
dnsName =
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionArn:GameSessionConnectionInfo' :: Maybe Text
gameSessionArn = forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:GameSessionConnectionInfo' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
$sel:matchedPlayerSessions:GameSessionConnectionInfo' :: Maybe [MatchedPlayerSession]
matchedPlayerSessions = forall a. Maybe a
Prelude.Nothing,
$sel:port:GameSessionConnectionInfo' :: Maybe Natural
port = forall a. Maybe a
Prelude.Nothing
}
gameSessionConnectionInfo_dnsName :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Text)
gameSessionConnectionInfo_dnsName :: Lens' GameSessionConnectionInfo (Maybe Text)
gameSessionConnectionInfo_dnsName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionConnectionInfo' {Maybe Text
dnsName :: Maybe Text
$sel:dnsName:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
dnsName} -> Maybe Text
dnsName) (\s :: GameSessionConnectionInfo
s@GameSessionConnectionInfo' {} Maybe Text
a -> GameSessionConnectionInfo
s {$sel:dnsName:GameSessionConnectionInfo' :: Maybe Text
dnsName = Maybe Text
a} :: GameSessionConnectionInfo)
gameSessionConnectionInfo_gameSessionArn :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Text)
gameSessionConnectionInfo_gameSessionArn :: Lens' GameSessionConnectionInfo (Maybe Text)
gameSessionConnectionInfo_gameSessionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionConnectionInfo' {Maybe Text
gameSessionArn :: Maybe Text
$sel:gameSessionArn:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
gameSessionArn} -> Maybe Text
gameSessionArn) (\s :: GameSessionConnectionInfo
s@GameSessionConnectionInfo' {} Maybe Text
a -> GameSessionConnectionInfo
s {$sel:gameSessionArn:GameSessionConnectionInfo' :: Maybe Text
gameSessionArn = Maybe Text
a} :: GameSessionConnectionInfo)
gameSessionConnectionInfo_ipAddress :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Text)
gameSessionConnectionInfo_ipAddress :: Lens' GameSessionConnectionInfo (Maybe Text)
gameSessionConnectionInfo_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionConnectionInfo' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: GameSessionConnectionInfo
s@GameSessionConnectionInfo' {} Maybe Text
a -> GameSessionConnectionInfo
s {$sel:ipAddress:GameSessionConnectionInfo' :: Maybe Text
ipAddress = Maybe Text
a} :: GameSessionConnectionInfo)
gameSessionConnectionInfo_matchedPlayerSessions :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe [MatchedPlayerSession])
gameSessionConnectionInfo_matchedPlayerSessions :: Lens' GameSessionConnectionInfo (Maybe [MatchedPlayerSession])
gameSessionConnectionInfo_matchedPlayerSessions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionConnectionInfo' {Maybe [MatchedPlayerSession]
matchedPlayerSessions :: Maybe [MatchedPlayerSession]
$sel:matchedPlayerSessions:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe [MatchedPlayerSession]
matchedPlayerSessions} -> Maybe [MatchedPlayerSession]
matchedPlayerSessions) (\s :: GameSessionConnectionInfo
s@GameSessionConnectionInfo' {} Maybe [MatchedPlayerSession]
a -> GameSessionConnectionInfo
s {$sel:matchedPlayerSessions:GameSessionConnectionInfo' :: Maybe [MatchedPlayerSession]
matchedPlayerSessions = Maybe [MatchedPlayerSession]
a} :: GameSessionConnectionInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
gameSessionConnectionInfo_port :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Natural)
gameSessionConnectionInfo_port :: Lens' GameSessionConnectionInfo (Maybe Natural)
gameSessionConnectionInfo_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionConnectionInfo' {Maybe Natural
port :: Maybe Natural
$sel:port:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Natural
port} -> Maybe Natural
port) (\s :: GameSessionConnectionInfo
s@GameSessionConnectionInfo' {} Maybe Natural
a -> GameSessionConnectionInfo
s {$sel:port:GameSessionConnectionInfo' :: Maybe Natural
port = Maybe Natural
a} :: GameSessionConnectionInfo)
instance Data.FromJSON GameSessionConnectionInfo where
parseJSON :: Value -> Parser GameSessionConnectionInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GameSessionConnectionInfo"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [MatchedPlayerSession]
-> Maybe Natural
-> GameSessionConnectionInfo
GameSessionConnectionInfo'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DnsName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GameSessionArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IpAddress")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MatchedPlayerSessions"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Port")
)
instance Prelude.Hashable GameSessionConnectionInfo where
hashWithSalt :: Int -> GameSessionConnectionInfo -> Int
hashWithSalt Int
_salt GameSessionConnectionInfo' {Maybe Natural
Maybe [MatchedPlayerSession]
Maybe Text
port :: Maybe Natural
matchedPlayerSessions :: Maybe [MatchedPlayerSession]
ipAddress :: Maybe Text
gameSessionArn :: Maybe Text
dnsName :: Maybe Text
$sel:port:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Natural
$sel:matchedPlayerSessions:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe [MatchedPlayerSession]
$sel:ipAddress:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
$sel:gameSessionArn:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
$sel:dnsName:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dnsName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameSessionArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MatchedPlayerSession]
matchedPlayerSessions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
port
instance Prelude.NFData GameSessionConnectionInfo where
rnf :: GameSessionConnectionInfo -> ()
rnf GameSessionConnectionInfo' {Maybe Natural
Maybe [MatchedPlayerSession]
Maybe Text
port :: Maybe Natural
matchedPlayerSessions :: Maybe [MatchedPlayerSession]
ipAddress :: Maybe Text
gameSessionArn :: Maybe Text
dnsName :: Maybe Text
$sel:port:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Natural
$sel:matchedPlayerSessions:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe [MatchedPlayerSession]
$sel:ipAddress:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
$sel:gameSessionArn:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
$sel:dnsName:GameSessionConnectionInfo' :: GameSessionConnectionInfo -> Maybe Text
..} =
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
gameSessionArn
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 [MatchedPlayerSession]
matchedPlayerSessions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
port