{-# 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.LocationAttributes where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.FleetAction
import Amazonka.GameLift.Types.LocationState
import Amazonka.GameLift.Types.LocationUpdateStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocationAttributes = LocationAttributes'
{
LocationAttributes -> Maybe (NonEmpty FleetAction)
stoppedActions :: Prelude.Maybe (Prelude.NonEmpty FleetAction),
LocationAttributes -> Maybe LocationState
locationState :: Prelude.Maybe LocationState,
LocationAttributes -> Maybe LocationUpdateStatus
updateStatus :: Prelude.Maybe LocationUpdateStatus
}
deriving (LocationAttributes -> LocationAttributes -> Bool
(LocationAttributes -> LocationAttributes -> Bool)
-> (LocationAttributes -> LocationAttributes -> Bool)
-> Eq LocationAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocationAttributes -> LocationAttributes -> Bool
$c/= :: LocationAttributes -> LocationAttributes -> Bool
== :: LocationAttributes -> LocationAttributes -> Bool
$c== :: LocationAttributes -> LocationAttributes -> Bool
Prelude.Eq, ReadPrec [LocationAttributes]
ReadPrec LocationAttributes
Int -> ReadS LocationAttributes
ReadS [LocationAttributes]
(Int -> ReadS LocationAttributes)
-> ReadS [LocationAttributes]
-> ReadPrec LocationAttributes
-> ReadPrec [LocationAttributes]
-> Read LocationAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocationAttributes]
$creadListPrec :: ReadPrec [LocationAttributes]
readPrec :: ReadPrec LocationAttributes
$creadPrec :: ReadPrec LocationAttributes
readList :: ReadS [LocationAttributes]
$creadList :: ReadS [LocationAttributes]
readsPrec :: Int -> ReadS LocationAttributes
$creadsPrec :: Int -> ReadS LocationAttributes
Prelude.Read, Int -> LocationAttributes -> ShowS
[LocationAttributes] -> ShowS
LocationAttributes -> String
(Int -> LocationAttributes -> ShowS)
-> (LocationAttributes -> String)
-> ([LocationAttributes] -> ShowS)
-> Show LocationAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocationAttributes] -> ShowS
$cshowList :: [LocationAttributes] -> ShowS
show :: LocationAttributes -> String
$cshow :: LocationAttributes -> String
showsPrec :: Int -> LocationAttributes -> ShowS
$cshowsPrec :: Int -> LocationAttributes -> ShowS
Prelude.Show, (forall x. LocationAttributes -> Rep LocationAttributes x)
-> (forall x. Rep LocationAttributes x -> LocationAttributes)
-> Generic LocationAttributes
forall x. Rep LocationAttributes x -> LocationAttributes
forall x. LocationAttributes -> Rep LocationAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocationAttributes x -> LocationAttributes
$cfrom :: forall x. LocationAttributes -> Rep LocationAttributes x
Prelude.Generic)
newLocationAttributes ::
LocationAttributes
newLocationAttributes :: LocationAttributes
newLocationAttributes =
LocationAttributes' :: Maybe (NonEmpty FleetAction)
-> Maybe LocationState
-> Maybe LocationUpdateStatus
-> LocationAttributes
LocationAttributes'
{ $sel:stoppedActions:LocationAttributes' :: Maybe (NonEmpty FleetAction)
stoppedActions =
Maybe (NonEmpty FleetAction)
forall a. Maybe a
Prelude.Nothing,
$sel:locationState:LocationAttributes' :: Maybe LocationState
locationState = Maybe LocationState
forall a. Maybe a
Prelude.Nothing,
$sel:updateStatus:LocationAttributes' :: Maybe LocationUpdateStatus
updateStatus = Maybe LocationUpdateStatus
forall a. Maybe a
Prelude.Nothing
}
locationAttributes_stoppedActions :: Lens.Lens' LocationAttributes (Prelude.Maybe (Prelude.NonEmpty FleetAction))
locationAttributes_stoppedActions :: (Maybe (NonEmpty FleetAction) -> f (Maybe (NonEmpty FleetAction)))
-> LocationAttributes -> f LocationAttributes
locationAttributes_stoppedActions = (LocationAttributes -> Maybe (NonEmpty FleetAction))
-> (LocationAttributes
-> Maybe (NonEmpty FleetAction) -> LocationAttributes)
-> Lens
LocationAttributes
LocationAttributes
(Maybe (NonEmpty FleetAction))
(Maybe (NonEmpty FleetAction))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationAttributes' {Maybe (NonEmpty FleetAction)
stoppedActions :: Maybe (NonEmpty FleetAction)
$sel:stoppedActions:LocationAttributes' :: LocationAttributes -> Maybe (NonEmpty FleetAction)
stoppedActions} -> Maybe (NonEmpty FleetAction)
stoppedActions) (\s :: LocationAttributes
s@LocationAttributes' {} Maybe (NonEmpty FleetAction)
a -> LocationAttributes
s {$sel:stoppedActions:LocationAttributes' :: Maybe (NonEmpty FleetAction)
stoppedActions = Maybe (NonEmpty FleetAction)
a} :: LocationAttributes) ((Maybe (NonEmpty FleetAction) -> f (Maybe (NonEmpty FleetAction)))
-> LocationAttributes -> f LocationAttributes)
-> ((Maybe (NonEmpty FleetAction)
-> f (Maybe (NonEmpty FleetAction)))
-> Maybe (NonEmpty FleetAction)
-> f (Maybe (NonEmpty FleetAction)))
-> (Maybe (NonEmpty FleetAction)
-> f (Maybe (NonEmpty FleetAction)))
-> LocationAttributes
-> f LocationAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty FleetAction)
(NonEmpty FleetAction)
(NonEmpty FleetAction)
(NonEmpty FleetAction)
-> Iso
(Maybe (NonEmpty FleetAction))
(Maybe (NonEmpty FleetAction))
(Maybe (NonEmpty FleetAction))
(Maybe (NonEmpty FleetAction))
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
(NonEmpty FleetAction)
(NonEmpty FleetAction)
(NonEmpty FleetAction)
(NonEmpty FleetAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
locationAttributes_locationState :: Lens.Lens' LocationAttributes (Prelude.Maybe LocationState)
locationAttributes_locationState :: (Maybe LocationState -> f (Maybe LocationState))
-> LocationAttributes -> f LocationAttributes
locationAttributes_locationState = (LocationAttributes -> Maybe LocationState)
-> (LocationAttributes
-> Maybe LocationState -> LocationAttributes)
-> Lens
LocationAttributes
LocationAttributes
(Maybe LocationState)
(Maybe LocationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationAttributes' {Maybe LocationState
locationState :: Maybe LocationState
$sel:locationState:LocationAttributes' :: LocationAttributes -> Maybe LocationState
locationState} -> Maybe LocationState
locationState) (\s :: LocationAttributes
s@LocationAttributes' {} Maybe LocationState
a -> LocationAttributes
s {$sel:locationState:LocationAttributes' :: Maybe LocationState
locationState = Maybe LocationState
a} :: LocationAttributes)
locationAttributes_updateStatus :: Lens.Lens' LocationAttributes (Prelude.Maybe LocationUpdateStatus)
locationAttributes_updateStatus :: (Maybe LocationUpdateStatus -> f (Maybe LocationUpdateStatus))
-> LocationAttributes -> f LocationAttributes
locationAttributes_updateStatus = (LocationAttributes -> Maybe LocationUpdateStatus)
-> (LocationAttributes
-> Maybe LocationUpdateStatus -> LocationAttributes)
-> Lens
LocationAttributes
LocationAttributes
(Maybe LocationUpdateStatus)
(Maybe LocationUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationAttributes' {Maybe LocationUpdateStatus
updateStatus :: Maybe LocationUpdateStatus
$sel:updateStatus:LocationAttributes' :: LocationAttributes -> Maybe LocationUpdateStatus
updateStatus} -> Maybe LocationUpdateStatus
updateStatus) (\s :: LocationAttributes
s@LocationAttributes' {} Maybe LocationUpdateStatus
a -> LocationAttributes
s {$sel:updateStatus:LocationAttributes' :: Maybe LocationUpdateStatus
updateStatus = Maybe LocationUpdateStatus
a} :: LocationAttributes)
instance Core.FromJSON LocationAttributes where
parseJSON :: Value -> Parser LocationAttributes
parseJSON =
String
-> (Object -> Parser LocationAttributes)
-> Value
-> Parser LocationAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LocationAttributes"
( \Object
x ->
Maybe (NonEmpty FleetAction)
-> Maybe LocationState
-> Maybe LocationUpdateStatus
-> LocationAttributes
LocationAttributes'
(Maybe (NonEmpty FleetAction)
-> Maybe LocationState
-> Maybe LocationUpdateStatus
-> LocationAttributes)
-> Parser (Maybe (NonEmpty FleetAction))
-> Parser
(Maybe LocationState
-> Maybe LocationUpdateStatus -> LocationAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty FleetAction))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StoppedActions")
Parser
(Maybe LocationState
-> Maybe LocationUpdateStatus -> LocationAttributes)
-> Parser (Maybe LocationState)
-> Parser (Maybe LocationUpdateStatus -> LocationAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LocationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LocationState")
Parser (Maybe LocationUpdateStatus -> LocationAttributes)
-> Parser (Maybe LocationUpdateStatus) -> Parser LocationAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LocationUpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdateStatus")
)
instance Prelude.Hashable LocationAttributes
instance Prelude.NFData LocationAttributes