{-# 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.LocationState where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.FleetStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocationState = LocationState'
{
LocationState -> Maybe FleetStatus
status :: Prelude.Maybe FleetStatus,
LocationState -> Maybe Text
location :: Prelude.Maybe Prelude.Text
}
deriving (LocationState -> LocationState -> Bool
(LocationState -> LocationState -> Bool)
-> (LocationState -> LocationState -> Bool) -> Eq LocationState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocationState -> LocationState -> Bool
$c/= :: LocationState -> LocationState -> Bool
== :: LocationState -> LocationState -> Bool
$c== :: LocationState -> LocationState -> Bool
Prelude.Eq, ReadPrec [LocationState]
ReadPrec LocationState
Int -> ReadS LocationState
ReadS [LocationState]
(Int -> ReadS LocationState)
-> ReadS [LocationState]
-> ReadPrec LocationState
-> ReadPrec [LocationState]
-> Read LocationState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocationState]
$creadListPrec :: ReadPrec [LocationState]
readPrec :: ReadPrec LocationState
$creadPrec :: ReadPrec LocationState
readList :: ReadS [LocationState]
$creadList :: ReadS [LocationState]
readsPrec :: Int -> ReadS LocationState
$creadsPrec :: Int -> ReadS LocationState
Prelude.Read, Int -> LocationState -> ShowS
[LocationState] -> ShowS
LocationState -> String
(Int -> LocationState -> ShowS)
-> (LocationState -> String)
-> ([LocationState] -> ShowS)
-> Show LocationState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocationState] -> ShowS
$cshowList :: [LocationState] -> ShowS
show :: LocationState -> String
$cshow :: LocationState -> String
showsPrec :: Int -> LocationState -> ShowS
$cshowsPrec :: Int -> LocationState -> ShowS
Prelude.Show, (forall x. LocationState -> Rep LocationState x)
-> (forall x. Rep LocationState x -> LocationState)
-> Generic LocationState
forall x. Rep LocationState x -> LocationState
forall x. LocationState -> Rep LocationState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocationState x -> LocationState
$cfrom :: forall x. LocationState -> Rep LocationState x
Prelude.Generic)
newLocationState ::
LocationState
newLocationState :: LocationState
newLocationState =
LocationState' :: Maybe FleetStatus -> Maybe Text -> LocationState
LocationState'
{ $sel:status:LocationState' :: Maybe FleetStatus
status = Maybe FleetStatus
forall a. Maybe a
Prelude.Nothing,
$sel:location:LocationState' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
locationState_status :: Lens.Lens' LocationState (Prelude.Maybe FleetStatus)
locationState_status :: (Maybe FleetStatus -> f (Maybe FleetStatus))
-> LocationState -> f LocationState
locationState_status = (LocationState -> Maybe FleetStatus)
-> (LocationState -> Maybe FleetStatus -> LocationState)
-> Lens
LocationState LocationState (Maybe FleetStatus) (Maybe FleetStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationState' {Maybe FleetStatus
status :: Maybe FleetStatus
$sel:status:LocationState' :: LocationState -> Maybe FleetStatus
status} -> Maybe FleetStatus
status) (\s :: LocationState
s@LocationState' {} Maybe FleetStatus
a -> LocationState
s {$sel:status:LocationState' :: Maybe FleetStatus
status = Maybe FleetStatus
a} :: LocationState)
locationState_location :: Lens.Lens' LocationState (Prelude.Maybe Prelude.Text)
locationState_location :: (Maybe Text -> f (Maybe Text)) -> LocationState -> f LocationState
locationState_location = (LocationState -> Maybe Text)
-> (LocationState -> Maybe Text -> LocationState)
-> Lens LocationState LocationState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationState' {Maybe Text
location :: Maybe Text
$sel:location:LocationState' :: LocationState -> Maybe Text
location} -> Maybe Text
location) (\s :: LocationState
s@LocationState' {} Maybe Text
a -> LocationState
s {$sel:location:LocationState' :: Maybe Text
location = Maybe Text
a} :: LocationState)
instance Core.FromJSON LocationState where
parseJSON :: Value -> Parser LocationState
parseJSON =
String
-> (Object -> Parser LocationState)
-> Value
-> Parser LocationState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LocationState"
( \Object
x ->
Maybe FleetStatus -> Maybe Text -> LocationState
LocationState'
(Maybe FleetStatus -> Maybe Text -> LocationState)
-> Parser (Maybe FleetStatus)
-> Parser (Maybe Text -> LocationState)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FleetStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser (Maybe Text -> LocationState)
-> Parser (Maybe Text) -> Parser LocationState
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
"Location")
)
instance Prelude.Hashable LocationState
instance Prelude.NFData LocationState