{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.Types.MatchmakingTicket
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GameLift.Types.MatchmakingTicket 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.GameSessionConnectionInfo
import Amazonka.GameLift.Types.MatchmakingConfigurationStatus
import Amazonka.GameLift.Types.Player
import qualified Amazonka.Prelude as Prelude

-- | Ticket generated to track the progress of a matchmaking request. Each
-- ticket is uniquely identified by a ticket ID, supplied by the requester,
-- when creating a matchmaking request.
--
-- /See:/ 'newMatchmakingTicket' smart constructor.
data MatchmakingTicket = MatchmakingTicket'
  { -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- associated with the GameLift matchmaking configuration resource that is
    -- used with this ticket.
    MatchmakingTicket -> Maybe Text
configurationArn :: Prelude.Maybe Prelude.Text,
    -- | Name of the matchmaking configuration that is used with this ticket.
    -- Matchmaking configurations determine how players are grouped into a
    -- match and how a new game session is created for the match.
    MatchmakingTicket -> Maybe Text
configurationName :: Prelude.Maybe Prelude.Text,
    -- | Time stamp indicating when the matchmaking request stopped being
    -- processed due to successful completion, timeout, or cancellation. Format
    -- is a number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    MatchmakingTicket -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
    -- | Average amount of time (in seconds) that players are currently waiting
    -- for a match. If there is not enough recent data, this property may be
    -- empty.
    MatchmakingTicket -> Maybe Natural
estimatedWaitTime :: Prelude.Maybe Prelude.Natural,
    -- | Connection information for a new game session. Once a match is made, the
    -- FlexMatch engine creates a new game session for it. This information is
    -- added to the matchmaking ticket, which you can be retrieve by calling
    -- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeMatchmaking.html DescribeMatchmaking>
    -- .
    MatchmakingTicket -> Maybe GameSessionConnectionInfo
gameSessionConnectionInfo :: Prelude.Maybe GameSessionConnectionInfo,
    -- | A set of @Player@ objects, each representing a player to find matches
    -- for. Players are identified by a unique player ID and may include
    -- latency data for use during matchmaking. If the ticket is in status
    -- @COMPLETED@, the @Player@ objects include the team the players were
    -- assigned to in the resulting match.
    MatchmakingTicket -> Maybe [Player]
players :: Prelude.Maybe [Player],
    -- | Time stamp indicating when this matchmaking request was received. Format
    -- is a number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    MatchmakingTicket -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | Current status of the matchmaking request.
    --
    -- -   __QUEUED__ -- The matchmaking request has been received and is
    --     currently waiting to be processed.
    --
    -- -   __SEARCHING__ -- The matchmaking request is currently being
    --     processed.
    --
    -- -   __REQUIRES_ACCEPTANCE__ -- A match has been proposed and the players
    --     must accept the match. This status is used only with requests that
    --     use a matchmaking configuration with a player acceptance
    --     requirement.
    --
    -- -   __PLACING__ -- The FlexMatch engine has matched players and is in
    --     the process of placing a new game session for the match.
    --
    -- -   __COMPLETED__ -- Players have been matched and a game session is
    --     ready to host the players. A ticket in this state contains the
    --     necessary connection information for players.
    --
    -- -   __FAILED__ -- The matchmaking request was not completed.
    --
    -- -   __CANCELLED__ -- The matchmaking request was canceled. This may be
    --     the result of a @StopMatchmaking@ operation or a proposed match that
    --     one or more players failed to accept.
    --
    -- -   __TIMED_OUT__ -- The matchmaking request was not successful within
    --     the duration specified in the matchmaking configuration.
    --
    -- Matchmaking requests that fail to successfully complete (statuses
    -- FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with
    -- new ticket IDs.
    MatchmakingTicket -> Maybe MatchmakingConfigurationStatus
status :: Prelude.Maybe MatchmakingConfigurationStatus,
    -- | Additional information about the current status.
    MatchmakingTicket -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | Code to explain the current status. For example, a status reason may
    -- indicate when a ticket has returned to @SEARCHING@ status after a
    -- proposed match fails to receive player acceptances.
    MatchmakingTicket -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for a matchmaking ticket.
    MatchmakingTicket -> Maybe Text
ticketId :: Prelude.Maybe Prelude.Text
  }
  deriving (MatchmakingTicket -> MatchmakingTicket -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchmakingTicket -> MatchmakingTicket -> Bool
$c/= :: MatchmakingTicket -> MatchmakingTicket -> Bool
== :: MatchmakingTicket -> MatchmakingTicket -> Bool
$c== :: MatchmakingTicket -> MatchmakingTicket -> Bool
Prelude.Eq, ReadPrec [MatchmakingTicket]
ReadPrec MatchmakingTicket
Int -> ReadS MatchmakingTicket
ReadS [MatchmakingTicket]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MatchmakingTicket]
$creadListPrec :: ReadPrec [MatchmakingTicket]
readPrec :: ReadPrec MatchmakingTicket
$creadPrec :: ReadPrec MatchmakingTicket
readList :: ReadS [MatchmakingTicket]
$creadList :: ReadS [MatchmakingTicket]
readsPrec :: Int -> ReadS MatchmakingTicket
$creadsPrec :: Int -> ReadS MatchmakingTicket
Prelude.Read, Int -> MatchmakingTicket -> ShowS
[MatchmakingTicket] -> ShowS
MatchmakingTicket -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MatchmakingTicket] -> ShowS
$cshowList :: [MatchmakingTicket] -> ShowS
show :: MatchmakingTicket -> String
$cshow :: MatchmakingTicket -> String
showsPrec :: Int -> MatchmakingTicket -> ShowS
$cshowsPrec :: Int -> MatchmakingTicket -> ShowS
Prelude.Show, forall x. Rep MatchmakingTicket x -> MatchmakingTicket
forall x. MatchmakingTicket -> Rep MatchmakingTicket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MatchmakingTicket x -> MatchmakingTicket
$cfrom :: forall x. MatchmakingTicket -> Rep MatchmakingTicket x
Prelude.Generic)

-- |
-- Create a value of 'MatchmakingTicket' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'configurationArn', 'matchmakingTicket_configurationArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- associated with the GameLift matchmaking configuration resource that is
-- used with this ticket.
--
-- 'configurationName', 'matchmakingTicket_configurationName' - Name of the matchmaking configuration that is used with this ticket.
-- Matchmaking configurations determine how players are grouped into a
-- match and how a new game session is created for the match.
--
-- 'endTime', 'matchmakingTicket_endTime' - Time stamp indicating when the matchmaking request stopped being
-- processed due to successful completion, timeout, or cancellation. Format
-- is a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'estimatedWaitTime', 'matchmakingTicket_estimatedWaitTime' - Average amount of time (in seconds) that players are currently waiting
-- for a match. If there is not enough recent data, this property may be
-- empty.
--
-- 'gameSessionConnectionInfo', 'matchmakingTicket_gameSessionConnectionInfo' - Connection information for a new game session. Once a match is made, the
-- FlexMatch engine creates a new game session for it. This information is
-- added to the matchmaking ticket, which you can be retrieve by calling
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeMatchmaking.html DescribeMatchmaking>
-- .
--
-- 'players', 'matchmakingTicket_players' - A set of @Player@ objects, each representing a player to find matches
-- for. Players are identified by a unique player ID and may include
-- latency data for use during matchmaking. If the ticket is in status
-- @COMPLETED@, the @Player@ objects include the team the players were
-- assigned to in the resulting match.
--
-- 'startTime', 'matchmakingTicket_startTime' - Time stamp indicating when this matchmaking request was received. Format
-- is a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'status', 'matchmakingTicket_status' - Current status of the matchmaking request.
--
-- -   __QUEUED__ -- The matchmaking request has been received and is
--     currently waiting to be processed.
--
-- -   __SEARCHING__ -- The matchmaking request is currently being
--     processed.
--
-- -   __REQUIRES_ACCEPTANCE__ -- A match has been proposed and the players
--     must accept the match. This status is used only with requests that
--     use a matchmaking configuration with a player acceptance
--     requirement.
--
-- -   __PLACING__ -- The FlexMatch engine has matched players and is in
--     the process of placing a new game session for the match.
--
-- -   __COMPLETED__ -- Players have been matched and a game session is
--     ready to host the players. A ticket in this state contains the
--     necessary connection information for players.
--
-- -   __FAILED__ -- The matchmaking request was not completed.
--
-- -   __CANCELLED__ -- The matchmaking request was canceled. This may be
--     the result of a @StopMatchmaking@ operation or a proposed match that
--     one or more players failed to accept.
--
-- -   __TIMED_OUT__ -- The matchmaking request was not successful within
--     the duration specified in the matchmaking configuration.
--
-- Matchmaking requests that fail to successfully complete (statuses
-- FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with
-- new ticket IDs.
--
-- 'statusMessage', 'matchmakingTicket_statusMessage' - Additional information about the current status.
--
-- 'statusReason', 'matchmakingTicket_statusReason' - Code to explain the current status. For example, a status reason may
-- indicate when a ticket has returned to @SEARCHING@ status after a
-- proposed match fails to receive player acceptances.
--
-- 'ticketId', 'matchmakingTicket_ticketId' - A unique identifier for a matchmaking ticket.
newMatchmakingTicket ::
  MatchmakingTicket
newMatchmakingTicket :: MatchmakingTicket
newMatchmakingTicket =
  MatchmakingTicket'
    { $sel:configurationArn:MatchmakingTicket' :: Maybe Text
configurationArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:configurationName:MatchmakingTicket' :: Maybe Text
configurationName = forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:MatchmakingTicket' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:estimatedWaitTime:MatchmakingTicket' :: Maybe Natural
estimatedWaitTime = forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionConnectionInfo:MatchmakingTicket' :: Maybe GameSessionConnectionInfo
gameSessionConnectionInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:players:MatchmakingTicket' :: Maybe [Player]
players = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:MatchmakingTicket' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:MatchmakingTicket' :: Maybe MatchmakingConfigurationStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:MatchmakingTicket' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:MatchmakingTicket' :: Maybe Text
statusReason = forall a. Maybe a
Prelude.Nothing,
      $sel:ticketId:MatchmakingTicket' :: Maybe Text
ticketId = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- associated with the GameLift matchmaking configuration resource that is
-- used with this ticket.
matchmakingTicket_configurationArn :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.Text)
matchmakingTicket_configurationArn :: Lens' MatchmakingTicket (Maybe Text)
matchmakingTicket_configurationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe Text
configurationArn :: Maybe Text
$sel:configurationArn:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
configurationArn} -> Maybe Text
configurationArn) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe Text
a -> MatchmakingTicket
s {$sel:configurationArn:MatchmakingTicket' :: Maybe Text
configurationArn = Maybe Text
a} :: MatchmakingTicket)

-- | Name of the matchmaking configuration that is used with this ticket.
-- Matchmaking configurations determine how players are grouped into a
-- match and how a new game session is created for the match.
matchmakingTicket_configurationName :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.Text)
matchmakingTicket_configurationName :: Lens' MatchmakingTicket (Maybe Text)
matchmakingTicket_configurationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe Text
configurationName :: Maybe Text
$sel:configurationName:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
configurationName} -> Maybe Text
configurationName) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe Text
a -> MatchmakingTicket
s {$sel:configurationName:MatchmakingTicket' :: Maybe Text
configurationName = Maybe Text
a} :: MatchmakingTicket)

-- | Time stamp indicating when the matchmaking request stopped being
-- processed due to successful completion, timeout, or cancellation. Format
-- is a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
matchmakingTicket_endTime :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.UTCTime)
matchmakingTicket_endTime :: Lens' MatchmakingTicket (Maybe UTCTime)
matchmakingTicket_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe POSIX
a -> MatchmakingTicket
s {$sel:endTime:MatchmakingTicket' :: Maybe POSIX
endTime = Maybe POSIX
a} :: MatchmakingTicket) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Average amount of time (in seconds) that players are currently waiting
-- for a match. If there is not enough recent data, this property may be
-- empty.
matchmakingTicket_estimatedWaitTime :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.Natural)
matchmakingTicket_estimatedWaitTime :: Lens' MatchmakingTicket (Maybe Natural)
matchmakingTicket_estimatedWaitTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe Natural
estimatedWaitTime :: Maybe Natural
$sel:estimatedWaitTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe Natural
estimatedWaitTime} -> Maybe Natural
estimatedWaitTime) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe Natural
a -> MatchmakingTicket
s {$sel:estimatedWaitTime:MatchmakingTicket' :: Maybe Natural
estimatedWaitTime = Maybe Natural
a} :: MatchmakingTicket)

-- | Connection information for a new game session. Once a match is made, the
-- FlexMatch engine creates a new game session for it. This information is
-- added to the matchmaking ticket, which you can be retrieve by calling
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeMatchmaking.html DescribeMatchmaking>
-- .
matchmakingTicket_gameSessionConnectionInfo :: Lens.Lens' MatchmakingTicket (Prelude.Maybe GameSessionConnectionInfo)
matchmakingTicket_gameSessionConnectionInfo :: Lens' MatchmakingTicket (Maybe GameSessionConnectionInfo)
matchmakingTicket_gameSessionConnectionInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe GameSessionConnectionInfo
gameSessionConnectionInfo :: Maybe GameSessionConnectionInfo
$sel:gameSessionConnectionInfo:MatchmakingTicket' :: MatchmakingTicket -> Maybe GameSessionConnectionInfo
gameSessionConnectionInfo} -> Maybe GameSessionConnectionInfo
gameSessionConnectionInfo) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe GameSessionConnectionInfo
a -> MatchmakingTicket
s {$sel:gameSessionConnectionInfo:MatchmakingTicket' :: Maybe GameSessionConnectionInfo
gameSessionConnectionInfo = Maybe GameSessionConnectionInfo
a} :: MatchmakingTicket)

-- | A set of @Player@ objects, each representing a player to find matches
-- for. Players are identified by a unique player ID and may include
-- latency data for use during matchmaking. If the ticket is in status
-- @COMPLETED@, the @Player@ objects include the team the players were
-- assigned to in the resulting match.
matchmakingTicket_players :: Lens.Lens' MatchmakingTicket (Prelude.Maybe [Player])
matchmakingTicket_players :: Lens' MatchmakingTicket (Maybe [Player])
matchmakingTicket_players = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe [Player]
players :: Maybe [Player]
$sel:players:MatchmakingTicket' :: MatchmakingTicket -> Maybe [Player]
players} -> Maybe [Player]
players) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe [Player]
a -> MatchmakingTicket
s {$sel:players:MatchmakingTicket' :: Maybe [Player]
players = Maybe [Player]
a} :: MatchmakingTicket) 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

-- | Time stamp indicating when this matchmaking request was received. Format
-- is a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
matchmakingTicket_startTime :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.UTCTime)
matchmakingTicket_startTime :: Lens' MatchmakingTicket (Maybe UTCTime)
matchmakingTicket_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe POSIX
a -> MatchmakingTicket
s {$sel:startTime:MatchmakingTicket' :: Maybe POSIX
startTime = Maybe POSIX
a} :: MatchmakingTicket) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Current status of the matchmaking request.
--
-- -   __QUEUED__ -- The matchmaking request has been received and is
--     currently waiting to be processed.
--
-- -   __SEARCHING__ -- The matchmaking request is currently being
--     processed.
--
-- -   __REQUIRES_ACCEPTANCE__ -- A match has been proposed and the players
--     must accept the match. This status is used only with requests that
--     use a matchmaking configuration with a player acceptance
--     requirement.
--
-- -   __PLACING__ -- The FlexMatch engine has matched players and is in
--     the process of placing a new game session for the match.
--
-- -   __COMPLETED__ -- Players have been matched and a game session is
--     ready to host the players. A ticket in this state contains the
--     necessary connection information for players.
--
-- -   __FAILED__ -- The matchmaking request was not completed.
--
-- -   __CANCELLED__ -- The matchmaking request was canceled. This may be
--     the result of a @StopMatchmaking@ operation or a proposed match that
--     one or more players failed to accept.
--
-- -   __TIMED_OUT__ -- The matchmaking request was not successful within
--     the duration specified in the matchmaking configuration.
--
-- Matchmaking requests that fail to successfully complete (statuses
-- FAILED, CANCELLED, TIMED_OUT) can be resubmitted as new requests with
-- new ticket IDs.
matchmakingTicket_status :: Lens.Lens' MatchmakingTicket (Prelude.Maybe MatchmakingConfigurationStatus)
matchmakingTicket_status :: Lens' MatchmakingTicket (Maybe MatchmakingConfigurationStatus)
matchmakingTicket_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe MatchmakingConfigurationStatus
status :: Maybe MatchmakingConfigurationStatus
$sel:status:MatchmakingTicket' :: MatchmakingTicket -> Maybe MatchmakingConfigurationStatus
status} -> Maybe MatchmakingConfigurationStatus
status) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe MatchmakingConfigurationStatus
a -> MatchmakingTicket
s {$sel:status:MatchmakingTicket' :: Maybe MatchmakingConfigurationStatus
status = Maybe MatchmakingConfigurationStatus
a} :: MatchmakingTicket)

-- | Additional information about the current status.
matchmakingTicket_statusMessage :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.Text)
matchmakingTicket_statusMessage :: Lens' MatchmakingTicket (Maybe Text)
matchmakingTicket_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe Text
a -> MatchmakingTicket
s {$sel:statusMessage:MatchmakingTicket' :: Maybe Text
statusMessage = Maybe Text
a} :: MatchmakingTicket)

-- | Code to explain the current status. For example, a status reason may
-- indicate when a ticket has returned to @SEARCHING@ status after a
-- proposed match fails to receive player acceptances.
matchmakingTicket_statusReason :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.Text)
matchmakingTicket_statusReason :: Lens' MatchmakingTicket (Maybe Text)
matchmakingTicket_statusReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe Text
a -> MatchmakingTicket
s {$sel:statusReason:MatchmakingTicket' :: Maybe Text
statusReason = Maybe Text
a} :: MatchmakingTicket)

-- | A unique identifier for a matchmaking ticket.
matchmakingTicket_ticketId :: Lens.Lens' MatchmakingTicket (Prelude.Maybe Prelude.Text)
matchmakingTicket_ticketId :: Lens' MatchmakingTicket (Maybe Text)
matchmakingTicket_ticketId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchmakingTicket' {Maybe Text
ticketId :: Maybe Text
$sel:ticketId:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
ticketId} -> Maybe Text
ticketId) (\s :: MatchmakingTicket
s@MatchmakingTicket' {} Maybe Text
a -> MatchmakingTicket
s {$sel:ticketId:MatchmakingTicket' :: Maybe Text
ticketId = Maybe Text
a} :: MatchmakingTicket)

instance Data.FromJSON MatchmakingTicket where
  parseJSON :: Value -> Parser MatchmakingTicket
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MatchmakingTicket"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe GameSessionConnectionInfo
-> Maybe [Player]
-> Maybe POSIX
-> Maybe MatchmakingConfigurationStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MatchmakingTicket
MatchmakingTicket'
            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
"ConfigurationArn")
            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
"ConfigurationName")
            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
"EndTime")
            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
"EstimatedWaitTime")
            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
"GameSessionConnectionInfo")
            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
"Players" 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
"StartTime")
            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
"Status")
            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
"StatusMessage")
            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
"StatusReason")
            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
"TicketId")
      )

instance Prelude.Hashable MatchmakingTicket where
  hashWithSalt :: Int -> MatchmakingTicket -> Int
hashWithSalt Int
_salt MatchmakingTicket' {Maybe Natural
Maybe [Player]
Maybe Text
Maybe POSIX
Maybe GameSessionConnectionInfo
Maybe MatchmakingConfigurationStatus
ticketId :: Maybe Text
statusReason :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe MatchmakingConfigurationStatus
startTime :: Maybe POSIX
players :: Maybe [Player]
gameSessionConnectionInfo :: Maybe GameSessionConnectionInfo
estimatedWaitTime :: Maybe Natural
endTime :: Maybe POSIX
configurationName :: Maybe Text
configurationArn :: Maybe Text
$sel:ticketId:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:statusReason:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:statusMessage:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:status:MatchmakingTicket' :: MatchmakingTicket -> Maybe MatchmakingConfigurationStatus
$sel:startTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe POSIX
$sel:players:MatchmakingTicket' :: MatchmakingTicket -> Maybe [Player]
$sel:gameSessionConnectionInfo:MatchmakingTicket' :: MatchmakingTicket -> Maybe GameSessionConnectionInfo
$sel:estimatedWaitTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe Natural
$sel:endTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe POSIX
$sel:configurationName:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:configurationArn:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
estimatedWaitTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameSessionConnectionInfo
gameSessionConnectionInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Player]
players
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MatchmakingConfigurationStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ticketId

instance Prelude.NFData MatchmakingTicket where
  rnf :: MatchmakingTicket -> ()
rnf MatchmakingTicket' {Maybe Natural
Maybe [Player]
Maybe Text
Maybe POSIX
Maybe GameSessionConnectionInfo
Maybe MatchmakingConfigurationStatus
ticketId :: Maybe Text
statusReason :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe MatchmakingConfigurationStatus
startTime :: Maybe POSIX
players :: Maybe [Player]
gameSessionConnectionInfo :: Maybe GameSessionConnectionInfo
estimatedWaitTime :: Maybe Natural
endTime :: Maybe POSIX
configurationName :: Maybe Text
configurationArn :: Maybe Text
$sel:ticketId:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:statusReason:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:statusMessage:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:status:MatchmakingTicket' :: MatchmakingTicket -> Maybe MatchmakingConfigurationStatus
$sel:startTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe POSIX
$sel:players:MatchmakingTicket' :: MatchmakingTicket -> Maybe [Player]
$sel:gameSessionConnectionInfo:MatchmakingTicket' :: MatchmakingTicket -> Maybe GameSessionConnectionInfo
$sel:estimatedWaitTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe Natural
$sel:endTime:MatchmakingTicket' :: MatchmakingTicket -> Maybe POSIX
$sel:configurationName:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
$sel:configurationArn:MatchmakingTicket' :: MatchmakingTicket -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
estimatedWaitTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GameSessionConnectionInfo
gameSessionConnectionInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Player]
players
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MatchmakingConfigurationStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ticketId