{-# 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 Amazonka.GameLift.Types.MatchedPlayerSession
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GameSessionConnectionInfo = GameSessionConnectionInfo'
{
GameSessionConnectionInfo -> Maybe [MatchedPlayerSession]
matchedPlayerSessions :: Prelude.Maybe [MatchedPlayerSession],
GameSessionConnectionInfo -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
GameSessionConnectionInfo -> Maybe Text
gameSessionArn :: Prelude.Maybe Prelude.Text,
GameSessionConnectionInfo -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text,
GameSessionConnectionInfo -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural
}
deriving (GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool
(GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool)
-> (GameSessionConnectionInfo -> GameSessionConnectionInfo -> Bool)
-> Eq GameSessionConnectionInfo
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]
(Int -> ReadS GameSessionConnectionInfo)
-> ReadS [GameSessionConnectionInfo]
-> ReadPrec GameSessionConnectionInfo
-> ReadPrec [GameSessionConnectionInfo]
-> Read 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
(Int -> GameSessionConnectionInfo -> ShowS)
-> (GameSessionConnectionInfo -> String)
-> ([GameSessionConnectionInfo] -> ShowS)
-> Show GameSessionConnectionInfo
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.
GameSessionConnectionInfo -> Rep GameSessionConnectionInfo x)
-> (forall x.
Rep GameSessionConnectionInfo x -> GameSessionConnectionInfo)
-> Generic GameSessionConnectionInfo
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' :: Maybe [MatchedPlayerSession]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSessionConnectionInfo
GameSessionConnectionInfo'
{ $sel:matchedPlayerSessions:GameSessionConnectionInfo' :: Maybe [MatchedPlayerSession]
matchedPlayerSessions =
Maybe [MatchedPlayerSession]
forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:GameSessionConnectionInfo' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionArn:GameSessionConnectionInfo' :: Maybe Text
gameSessionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dnsName:GameSessionConnectionInfo' :: Maybe Text
dnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:port:GameSessionConnectionInfo' :: Maybe Natural
port = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
gameSessionConnectionInfo_matchedPlayerSessions :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe [MatchedPlayerSession])
gameSessionConnectionInfo_matchedPlayerSessions :: (Maybe [MatchedPlayerSession] -> f (Maybe [MatchedPlayerSession]))
-> GameSessionConnectionInfo -> f GameSessionConnectionInfo
gameSessionConnectionInfo_matchedPlayerSessions = (GameSessionConnectionInfo -> Maybe [MatchedPlayerSession])
-> (GameSessionConnectionInfo
-> Maybe [MatchedPlayerSession] -> GameSessionConnectionInfo)
-> Lens
GameSessionConnectionInfo
GameSessionConnectionInfo
(Maybe [MatchedPlayerSession])
(Maybe [MatchedPlayerSession])
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) ((Maybe [MatchedPlayerSession] -> f (Maybe [MatchedPlayerSession]))
-> GameSessionConnectionInfo -> f GameSessionConnectionInfo)
-> ((Maybe [MatchedPlayerSession]
-> f (Maybe [MatchedPlayerSession]))
-> Maybe [MatchedPlayerSession]
-> f (Maybe [MatchedPlayerSession]))
-> (Maybe [MatchedPlayerSession]
-> f (Maybe [MatchedPlayerSession]))
-> GameSessionConnectionInfo
-> f GameSessionConnectionInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MatchedPlayerSession]
[MatchedPlayerSession]
[MatchedPlayerSession]
[MatchedPlayerSession]
-> Iso
(Maybe [MatchedPlayerSession])
(Maybe [MatchedPlayerSession])
(Maybe [MatchedPlayerSession])
(Maybe [MatchedPlayerSession])
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 AnIso
[MatchedPlayerSession]
[MatchedPlayerSession]
[MatchedPlayerSession]
[MatchedPlayerSession]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
gameSessionConnectionInfo_ipAddress :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Text)
gameSessionConnectionInfo_ipAddress :: (Maybe Text -> f (Maybe Text))
-> GameSessionConnectionInfo -> f GameSessionConnectionInfo
gameSessionConnectionInfo_ipAddress = (GameSessionConnectionInfo -> Maybe Text)
-> (GameSessionConnectionInfo
-> Maybe Text -> GameSessionConnectionInfo)
-> Lens
GameSessionConnectionInfo
GameSessionConnectionInfo
(Maybe Text)
(Maybe Text)
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_gameSessionArn :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Text)
gameSessionConnectionInfo_gameSessionArn :: (Maybe Text -> f (Maybe Text))
-> GameSessionConnectionInfo -> f GameSessionConnectionInfo
gameSessionConnectionInfo_gameSessionArn = (GameSessionConnectionInfo -> Maybe Text)
-> (GameSessionConnectionInfo
-> Maybe Text -> GameSessionConnectionInfo)
-> Lens
GameSessionConnectionInfo
GameSessionConnectionInfo
(Maybe Text)
(Maybe Text)
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_dnsName :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Text)
gameSessionConnectionInfo_dnsName :: (Maybe Text -> f (Maybe Text))
-> GameSessionConnectionInfo -> f GameSessionConnectionInfo
gameSessionConnectionInfo_dnsName = (GameSessionConnectionInfo -> Maybe Text)
-> (GameSessionConnectionInfo
-> Maybe Text -> GameSessionConnectionInfo)
-> Lens
GameSessionConnectionInfo
GameSessionConnectionInfo
(Maybe Text)
(Maybe Text)
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_port :: Lens.Lens' GameSessionConnectionInfo (Prelude.Maybe Prelude.Natural)
gameSessionConnectionInfo_port :: (Maybe Natural -> f (Maybe Natural))
-> GameSessionConnectionInfo -> f GameSessionConnectionInfo
gameSessionConnectionInfo_port = (GameSessionConnectionInfo -> Maybe Natural)
-> (GameSessionConnectionInfo
-> Maybe Natural -> GameSessionConnectionInfo)
-> Lens
GameSessionConnectionInfo
GameSessionConnectionInfo
(Maybe Natural)
(Maybe Natural)
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 Core.FromJSON GameSessionConnectionInfo where
parseJSON :: Value -> Parser GameSessionConnectionInfo
parseJSON =
String
-> (Object -> Parser GameSessionConnectionInfo)
-> Value
-> Parser GameSessionConnectionInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GameSessionConnectionInfo"
( \Object
x ->
Maybe [MatchedPlayerSession]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSessionConnectionInfo
GameSessionConnectionInfo'
(Maybe [MatchedPlayerSession]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSessionConnectionInfo)
-> Parser (Maybe [MatchedPlayerSession])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSessionConnectionInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MatchedPlayerSession]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MatchedPlayerSessions"
Parser (Maybe (Maybe [MatchedPlayerSession]))
-> Maybe [MatchedPlayerSession]
-> Parser (Maybe [MatchedPlayerSession])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MatchedPlayerSession]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSessionConnectionInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Natural -> GameSessionConnectionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpAddress")
Parser
(Maybe Text
-> Maybe Text -> Maybe Natural -> GameSessionConnectionInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Natural -> GameSessionConnectionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GameSessionArn")
Parser (Maybe Text -> Maybe Natural -> GameSessionConnectionInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Natural -> GameSessionConnectionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DnsName")
Parser (Maybe Natural -> GameSessionConnectionInfo)
-> Parser (Maybe Natural) -> Parser GameSessionConnectionInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Port")
)
instance Prelude.Hashable GameSessionConnectionInfo
instance Prelude.NFData GameSessionConnectionInfo