{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GameLift.StartFleetActions
(
StartFleetActions (..),
newStartFleetActions,
startFleetActions_location,
startFleetActions_fleetId,
startFleetActions_actions,
StartFleetActionsResponse (..),
newStartFleetActionsResponse,
startFleetActionsResponse_fleetArn,
startFleetActionsResponse_fleetId,
startFleetActionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartFleetActions = StartFleetActions'
{
StartFleetActions -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
StartFleetActions -> Text
fleetId :: Prelude.Text,
StartFleetActions -> NonEmpty FleetAction
actions :: Prelude.NonEmpty FleetAction
}
deriving (StartFleetActions -> StartFleetActions -> Bool
(StartFleetActions -> StartFleetActions -> Bool)
-> (StartFleetActions -> StartFleetActions -> Bool)
-> Eq StartFleetActions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartFleetActions -> StartFleetActions -> Bool
$c/= :: StartFleetActions -> StartFleetActions -> Bool
== :: StartFleetActions -> StartFleetActions -> Bool
$c== :: StartFleetActions -> StartFleetActions -> Bool
Prelude.Eq, ReadPrec [StartFleetActions]
ReadPrec StartFleetActions
Int -> ReadS StartFleetActions
ReadS [StartFleetActions]
(Int -> ReadS StartFleetActions)
-> ReadS [StartFleetActions]
-> ReadPrec StartFleetActions
-> ReadPrec [StartFleetActions]
-> Read StartFleetActions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartFleetActions]
$creadListPrec :: ReadPrec [StartFleetActions]
readPrec :: ReadPrec StartFleetActions
$creadPrec :: ReadPrec StartFleetActions
readList :: ReadS [StartFleetActions]
$creadList :: ReadS [StartFleetActions]
readsPrec :: Int -> ReadS StartFleetActions
$creadsPrec :: Int -> ReadS StartFleetActions
Prelude.Read, Int -> StartFleetActions -> ShowS
[StartFleetActions] -> ShowS
StartFleetActions -> String
(Int -> StartFleetActions -> ShowS)
-> (StartFleetActions -> String)
-> ([StartFleetActions] -> ShowS)
-> Show StartFleetActions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartFleetActions] -> ShowS
$cshowList :: [StartFleetActions] -> ShowS
show :: StartFleetActions -> String
$cshow :: StartFleetActions -> String
showsPrec :: Int -> StartFleetActions -> ShowS
$cshowsPrec :: Int -> StartFleetActions -> ShowS
Prelude.Show, (forall x. StartFleetActions -> Rep StartFleetActions x)
-> (forall x. Rep StartFleetActions x -> StartFleetActions)
-> Generic StartFleetActions
forall x. Rep StartFleetActions x -> StartFleetActions
forall x. StartFleetActions -> Rep StartFleetActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartFleetActions x -> StartFleetActions
$cfrom :: forall x. StartFleetActions -> Rep StartFleetActions x
Prelude.Generic)
newStartFleetActions ::
Prelude.Text ->
Prelude.NonEmpty FleetAction ->
StartFleetActions
newStartFleetActions :: Text -> NonEmpty FleetAction -> StartFleetActions
newStartFleetActions Text
pFleetId_ NonEmpty FleetAction
pActions_ =
StartFleetActions' :: Maybe Text -> Text -> NonEmpty FleetAction -> StartFleetActions
StartFleetActions'
{ $sel:location:StartFleetActions' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:StartFleetActions' :: Text
fleetId = Text
pFleetId_,
$sel:actions:StartFleetActions' :: NonEmpty FleetAction
actions = Tagged (NonEmpty FleetAction) (Identity (NonEmpty FleetAction))
-> Tagged (NonEmpty FleetAction) (Identity (NonEmpty FleetAction))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty FleetAction) (Identity (NonEmpty FleetAction))
-> Tagged (NonEmpty FleetAction) (Identity (NonEmpty FleetAction)))
-> NonEmpty FleetAction -> NonEmpty FleetAction
forall t b. AReview t b -> b -> t
Lens.# NonEmpty FleetAction
pActions_
}
startFleetActions_location :: Lens.Lens' StartFleetActions (Prelude.Maybe Prelude.Text)
startFleetActions_location :: (Maybe Text -> f (Maybe Text))
-> StartFleetActions -> f StartFleetActions
startFleetActions_location = (StartFleetActions -> Maybe Text)
-> (StartFleetActions -> Maybe Text -> StartFleetActions)
-> Lens
StartFleetActions StartFleetActions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFleetActions' {Maybe Text
location :: Maybe Text
$sel:location:StartFleetActions' :: StartFleetActions -> Maybe Text
location} -> Maybe Text
location) (\s :: StartFleetActions
s@StartFleetActions' {} Maybe Text
a -> StartFleetActions
s {$sel:location:StartFleetActions' :: Maybe Text
location = Maybe Text
a} :: StartFleetActions)
startFleetActions_fleetId :: Lens.Lens' StartFleetActions Prelude.Text
startFleetActions_fleetId :: (Text -> f Text) -> StartFleetActions -> f StartFleetActions
startFleetActions_fleetId = (StartFleetActions -> Text)
-> (StartFleetActions -> Text -> StartFleetActions)
-> Lens StartFleetActions StartFleetActions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFleetActions' {Text
fleetId :: Text
$sel:fleetId:StartFleetActions' :: StartFleetActions -> Text
fleetId} -> Text
fleetId) (\s :: StartFleetActions
s@StartFleetActions' {} Text
a -> StartFleetActions
s {$sel:fleetId:StartFleetActions' :: Text
fleetId = Text
a} :: StartFleetActions)
startFleetActions_actions :: Lens.Lens' StartFleetActions (Prelude.NonEmpty FleetAction)
startFleetActions_actions :: (NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> StartFleetActions -> f StartFleetActions
startFleetActions_actions = (StartFleetActions -> NonEmpty FleetAction)
-> (StartFleetActions -> NonEmpty FleetAction -> StartFleetActions)
-> Lens
StartFleetActions
StartFleetActions
(NonEmpty FleetAction)
(NonEmpty FleetAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFleetActions' {NonEmpty FleetAction
actions :: NonEmpty FleetAction
$sel:actions:StartFleetActions' :: StartFleetActions -> NonEmpty FleetAction
actions} -> NonEmpty FleetAction
actions) (\s :: StartFleetActions
s@StartFleetActions' {} NonEmpty FleetAction
a -> StartFleetActions
s {$sel:actions:StartFleetActions' :: NonEmpty FleetAction
actions = NonEmpty FleetAction
a} :: StartFleetActions) ((NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> StartFleetActions -> f StartFleetActions)
-> ((NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> (NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> StartFleetActions
-> f StartFleetActions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> NonEmpty FleetAction -> f (NonEmpty FleetAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest StartFleetActions where
type
AWSResponse StartFleetActions =
StartFleetActionsResponse
request :: StartFleetActions -> Request StartFleetActions
request = Service -> StartFleetActions -> Request StartFleetActions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartFleetActions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartFleetActions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartFleetActions))
-> Logger
-> Service
-> Proxy StartFleetActions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartFleetActions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> StartFleetActionsResponse
StartFleetActionsResponse'
(Maybe Text -> Maybe Text -> Int -> StartFleetActionsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> StartFleetActionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FleetArn")
Either String (Maybe Text -> Int -> StartFleetActionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartFleetActionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FleetId")
Either String (Int -> StartFleetActionsResponse)
-> Either String Int -> Either String StartFleetActionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StartFleetActions
instance Prelude.NFData StartFleetActions
instance Core.ToHeaders StartFleetActions where
toHeaders :: StartFleetActions -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartFleetActions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"GameLift.StartFleetActions" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StartFleetActions where
toJSON :: StartFleetActions -> Value
toJSON StartFleetActions' {Maybe Text
NonEmpty FleetAction
Text
actions :: NonEmpty FleetAction
fleetId :: Text
location :: Maybe Text
$sel:actions:StartFleetActions' :: StartFleetActions -> NonEmpty FleetAction
$sel:fleetId:StartFleetActions' :: StartFleetActions -> Text
$sel:location:StartFleetActions' :: StartFleetActions -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
location,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Actions" Text -> NonEmpty FleetAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty FleetAction
actions)
]
)
instance Core.ToPath StartFleetActions where
toPath :: StartFleetActions -> ByteString
toPath = ByteString -> StartFleetActions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartFleetActions where
toQuery :: StartFleetActions -> QueryString
toQuery = QueryString -> StartFleetActions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartFleetActionsResponse = StartFleetActionsResponse'
{
StartFleetActionsResponse -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
StartFleetActionsResponse -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
StartFleetActionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartFleetActionsResponse -> StartFleetActionsResponse -> Bool
(StartFleetActionsResponse -> StartFleetActionsResponse -> Bool)
-> (StartFleetActionsResponse -> StartFleetActionsResponse -> Bool)
-> Eq StartFleetActionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartFleetActionsResponse -> StartFleetActionsResponse -> Bool
$c/= :: StartFleetActionsResponse -> StartFleetActionsResponse -> Bool
== :: StartFleetActionsResponse -> StartFleetActionsResponse -> Bool
$c== :: StartFleetActionsResponse -> StartFleetActionsResponse -> Bool
Prelude.Eq, ReadPrec [StartFleetActionsResponse]
ReadPrec StartFleetActionsResponse
Int -> ReadS StartFleetActionsResponse
ReadS [StartFleetActionsResponse]
(Int -> ReadS StartFleetActionsResponse)
-> ReadS [StartFleetActionsResponse]
-> ReadPrec StartFleetActionsResponse
-> ReadPrec [StartFleetActionsResponse]
-> Read StartFleetActionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartFleetActionsResponse]
$creadListPrec :: ReadPrec [StartFleetActionsResponse]
readPrec :: ReadPrec StartFleetActionsResponse
$creadPrec :: ReadPrec StartFleetActionsResponse
readList :: ReadS [StartFleetActionsResponse]
$creadList :: ReadS [StartFleetActionsResponse]
readsPrec :: Int -> ReadS StartFleetActionsResponse
$creadsPrec :: Int -> ReadS StartFleetActionsResponse
Prelude.Read, Int -> StartFleetActionsResponse -> ShowS
[StartFleetActionsResponse] -> ShowS
StartFleetActionsResponse -> String
(Int -> StartFleetActionsResponse -> ShowS)
-> (StartFleetActionsResponse -> String)
-> ([StartFleetActionsResponse] -> ShowS)
-> Show StartFleetActionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartFleetActionsResponse] -> ShowS
$cshowList :: [StartFleetActionsResponse] -> ShowS
show :: StartFleetActionsResponse -> String
$cshow :: StartFleetActionsResponse -> String
showsPrec :: Int -> StartFleetActionsResponse -> ShowS
$cshowsPrec :: Int -> StartFleetActionsResponse -> ShowS
Prelude.Show, (forall x.
StartFleetActionsResponse -> Rep StartFleetActionsResponse x)
-> (forall x.
Rep StartFleetActionsResponse x -> StartFleetActionsResponse)
-> Generic StartFleetActionsResponse
forall x.
Rep StartFleetActionsResponse x -> StartFleetActionsResponse
forall x.
StartFleetActionsResponse -> Rep StartFleetActionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartFleetActionsResponse x -> StartFleetActionsResponse
$cfrom :: forall x.
StartFleetActionsResponse -> Rep StartFleetActionsResponse x
Prelude.Generic)
newStartFleetActionsResponse ::
Prelude.Int ->
StartFleetActionsResponse
newStartFleetActionsResponse :: Int -> StartFleetActionsResponse
newStartFleetActionsResponse Int
pHttpStatus_ =
StartFleetActionsResponse' :: Maybe Text -> Maybe Text -> Int -> StartFleetActionsResponse
StartFleetActionsResponse'
{ $sel:fleetArn:StartFleetActionsResponse' :: Maybe Text
fleetArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:StartFleetActionsResponse' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartFleetActionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startFleetActionsResponse_fleetArn :: Lens.Lens' StartFleetActionsResponse (Prelude.Maybe Prelude.Text)
startFleetActionsResponse_fleetArn :: (Maybe Text -> f (Maybe Text))
-> StartFleetActionsResponse -> f StartFleetActionsResponse
startFleetActionsResponse_fleetArn = (StartFleetActionsResponse -> Maybe Text)
-> (StartFleetActionsResponse
-> Maybe Text -> StartFleetActionsResponse)
-> Lens
StartFleetActionsResponse
StartFleetActionsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFleetActionsResponse' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:StartFleetActionsResponse' :: StartFleetActionsResponse -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: StartFleetActionsResponse
s@StartFleetActionsResponse' {} Maybe Text
a -> StartFleetActionsResponse
s {$sel:fleetArn:StartFleetActionsResponse' :: Maybe Text
fleetArn = Maybe Text
a} :: StartFleetActionsResponse)
startFleetActionsResponse_fleetId :: Lens.Lens' StartFleetActionsResponse (Prelude.Maybe Prelude.Text)
startFleetActionsResponse_fleetId :: (Maybe Text -> f (Maybe Text))
-> StartFleetActionsResponse -> f StartFleetActionsResponse
startFleetActionsResponse_fleetId = (StartFleetActionsResponse -> Maybe Text)
-> (StartFleetActionsResponse
-> Maybe Text -> StartFleetActionsResponse)
-> Lens
StartFleetActionsResponse
StartFleetActionsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFleetActionsResponse' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:StartFleetActionsResponse' :: StartFleetActionsResponse -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: StartFleetActionsResponse
s@StartFleetActionsResponse' {} Maybe Text
a -> StartFleetActionsResponse
s {$sel:fleetId:StartFleetActionsResponse' :: Maybe Text
fleetId = Maybe Text
a} :: StartFleetActionsResponse)
startFleetActionsResponse_httpStatus :: Lens.Lens' StartFleetActionsResponse Prelude.Int
startFleetActionsResponse_httpStatus :: (Int -> f Int)
-> StartFleetActionsResponse -> f StartFleetActionsResponse
startFleetActionsResponse_httpStatus = (StartFleetActionsResponse -> Int)
-> (StartFleetActionsResponse -> Int -> StartFleetActionsResponse)
-> Lens StartFleetActionsResponse StartFleetActionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFleetActionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartFleetActionsResponse' :: StartFleetActionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartFleetActionsResponse
s@StartFleetActionsResponse' {} Int
a -> StartFleetActionsResponse
s {$sel:httpStatus:StartFleetActionsResponse' :: Int
httpStatus = Int
a} :: StartFleetActionsResponse)
instance Prelude.NFData StartFleetActionsResponse