{-# 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.StopFleetActions
(
StopFleetActions (..),
newStopFleetActions,
stopFleetActions_location,
stopFleetActions_fleetId,
stopFleetActions_actions,
StopFleetActionsResponse (..),
newStopFleetActionsResponse,
stopFleetActionsResponse_fleetArn,
stopFleetActionsResponse_fleetId,
stopFleetActionsResponse_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 StopFleetActions = StopFleetActions'
{
StopFleetActions -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
StopFleetActions -> Text
fleetId :: Prelude.Text,
StopFleetActions -> NonEmpty FleetAction
actions :: Prelude.NonEmpty FleetAction
}
deriving (StopFleetActions -> StopFleetActions -> Bool
(StopFleetActions -> StopFleetActions -> Bool)
-> (StopFleetActions -> StopFleetActions -> Bool)
-> Eq StopFleetActions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopFleetActions -> StopFleetActions -> Bool
$c/= :: StopFleetActions -> StopFleetActions -> Bool
== :: StopFleetActions -> StopFleetActions -> Bool
$c== :: StopFleetActions -> StopFleetActions -> Bool
Prelude.Eq, ReadPrec [StopFleetActions]
ReadPrec StopFleetActions
Int -> ReadS StopFleetActions
ReadS [StopFleetActions]
(Int -> ReadS StopFleetActions)
-> ReadS [StopFleetActions]
-> ReadPrec StopFleetActions
-> ReadPrec [StopFleetActions]
-> Read StopFleetActions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopFleetActions]
$creadListPrec :: ReadPrec [StopFleetActions]
readPrec :: ReadPrec StopFleetActions
$creadPrec :: ReadPrec StopFleetActions
readList :: ReadS [StopFleetActions]
$creadList :: ReadS [StopFleetActions]
readsPrec :: Int -> ReadS StopFleetActions
$creadsPrec :: Int -> ReadS StopFleetActions
Prelude.Read, Int -> StopFleetActions -> ShowS
[StopFleetActions] -> ShowS
StopFleetActions -> String
(Int -> StopFleetActions -> ShowS)
-> (StopFleetActions -> String)
-> ([StopFleetActions] -> ShowS)
-> Show StopFleetActions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopFleetActions] -> ShowS
$cshowList :: [StopFleetActions] -> ShowS
show :: StopFleetActions -> String
$cshow :: StopFleetActions -> String
showsPrec :: Int -> StopFleetActions -> ShowS
$cshowsPrec :: Int -> StopFleetActions -> ShowS
Prelude.Show, (forall x. StopFleetActions -> Rep StopFleetActions x)
-> (forall x. Rep StopFleetActions x -> StopFleetActions)
-> Generic StopFleetActions
forall x. Rep StopFleetActions x -> StopFleetActions
forall x. StopFleetActions -> Rep StopFleetActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopFleetActions x -> StopFleetActions
$cfrom :: forall x. StopFleetActions -> Rep StopFleetActions x
Prelude.Generic)
newStopFleetActions ::
Prelude.Text ->
Prelude.NonEmpty FleetAction ->
StopFleetActions
newStopFleetActions :: Text -> NonEmpty FleetAction -> StopFleetActions
newStopFleetActions Text
pFleetId_ NonEmpty FleetAction
pActions_ =
StopFleetActions' :: Maybe Text -> Text -> NonEmpty FleetAction -> StopFleetActions
StopFleetActions'
{ $sel:location:StopFleetActions' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:StopFleetActions' :: Text
fleetId = Text
pFleetId_,
$sel:actions:StopFleetActions' :: 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_
}
stopFleetActions_location :: Lens.Lens' StopFleetActions (Prelude.Maybe Prelude.Text)
stopFleetActions_location :: (Maybe Text -> f (Maybe Text))
-> StopFleetActions -> f StopFleetActions
stopFleetActions_location = (StopFleetActions -> Maybe Text)
-> (StopFleetActions -> Maybe Text -> StopFleetActions)
-> Lens StopFleetActions StopFleetActions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFleetActions' {Maybe Text
location :: Maybe Text
$sel:location:StopFleetActions' :: StopFleetActions -> Maybe Text
location} -> Maybe Text
location) (\s :: StopFleetActions
s@StopFleetActions' {} Maybe Text
a -> StopFleetActions
s {$sel:location:StopFleetActions' :: Maybe Text
location = Maybe Text
a} :: StopFleetActions)
stopFleetActions_fleetId :: Lens.Lens' StopFleetActions Prelude.Text
stopFleetActions_fleetId :: (Text -> f Text) -> StopFleetActions -> f StopFleetActions
stopFleetActions_fleetId = (StopFleetActions -> Text)
-> (StopFleetActions -> Text -> StopFleetActions)
-> Lens StopFleetActions StopFleetActions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFleetActions' {Text
fleetId :: Text
$sel:fleetId:StopFleetActions' :: StopFleetActions -> Text
fleetId} -> Text
fleetId) (\s :: StopFleetActions
s@StopFleetActions' {} Text
a -> StopFleetActions
s {$sel:fleetId:StopFleetActions' :: Text
fleetId = Text
a} :: StopFleetActions)
stopFleetActions_actions :: Lens.Lens' StopFleetActions (Prelude.NonEmpty FleetAction)
stopFleetActions_actions :: (NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> StopFleetActions -> f StopFleetActions
stopFleetActions_actions = (StopFleetActions -> NonEmpty FleetAction)
-> (StopFleetActions -> NonEmpty FleetAction -> StopFleetActions)
-> Lens
StopFleetActions
StopFleetActions
(NonEmpty FleetAction)
(NonEmpty FleetAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFleetActions' {NonEmpty FleetAction
actions :: NonEmpty FleetAction
$sel:actions:StopFleetActions' :: StopFleetActions -> NonEmpty FleetAction
actions} -> NonEmpty FleetAction
actions) (\s :: StopFleetActions
s@StopFleetActions' {} NonEmpty FleetAction
a -> StopFleetActions
s {$sel:actions:StopFleetActions' :: NonEmpty FleetAction
actions = NonEmpty FleetAction
a} :: StopFleetActions) ((NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> StopFleetActions -> f StopFleetActions)
-> ((NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> (NonEmpty FleetAction -> f (NonEmpty FleetAction))
-> StopFleetActions
-> f StopFleetActions
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 StopFleetActions where
type
AWSResponse StopFleetActions =
StopFleetActionsResponse
request :: StopFleetActions -> Request StopFleetActions
request = Service -> StopFleetActions -> Request StopFleetActions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopFleetActions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopFleetActions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopFleetActions))
-> Logger
-> Service
-> Proxy StopFleetActions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopFleetActions)))
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 -> StopFleetActionsResponse
StopFleetActionsResponse'
(Maybe Text -> Maybe Text -> Int -> StopFleetActionsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> StopFleetActionsResponse)
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 -> StopFleetActionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StopFleetActionsResponse)
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 -> StopFleetActionsResponse)
-> Either String Int -> Either String StopFleetActionsResponse
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 StopFleetActions
instance Prelude.NFData StopFleetActions
instance Core.ToHeaders StopFleetActions where
toHeaders :: StopFleetActions -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopFleetActions -> 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.StopFleetActions" :: 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 StopFleetActions where
toJSON :: StopFleetActions -> Value
toJSON StopFleetActions' {Maybe Text
NonEmpty FleetAction
Text
actions :: NonEmpty FleetAction
fleetId :: Text
location :: Maybe Text
$sel:actions:StopFleetActions' :: StopFleetActions -> NonEmpty FleetAction
$sel:fleetId:StopFleetActions' :: StopFleetActions -> Text
$sel:location:StopFleetActions' :: StopFleetActions -> 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 StopFleetActions where
toPath :: StopFleetActions -> ByteString
toPath = ByteString -> StopFleetActions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopFleetActions where
toQuery :: StopFleetActions -> QueryString
toQuery = QueryString -> StopFleetActions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopFleetActionsResponse = StopFleetActionsResponse'
{
StopFleetActionsResponse -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
StopFleetActionsResponse -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
StopFleetActionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopFleetActionsResponse -> StopFleetActionsResponse -> Bool
(StopFleetActionsResponse -> StopFleetActionsResponse -> Bool)
-> (StopFleetActionsResponse -> StopFleetActionsResponse -> Bool)
-> Eq StopFleetActionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopFleetActionsResponse -> StopFleetActionsResponse -> Bool
$c/= :: StopFleetActionsResponse -> StopFleetActionsResponse -> Bool
== :: StopFleetActionsResponse -> StopFleetActionsResponse -> Bool
$c== :: StopFleetActionsResponse -> StopFleetActionsResponse -> Bool
Prelude.Eq, ReadPrec [StopFleetActionsResponse]
ReadPrec StopFleetActionsResponse
Int -> ReadS StopFleetActionsResponse
ReadS [StopFleetActionsResponse]
(Int -> ReadS StopFleetActionsResponse)
-> ReadS [StopFleetActionsResponse]
-> ReadPrec StopFleetActionsResponse
-> ReadPrec [StopFleetActionsResponse]
-> Read StopFleetActionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopFleetActionsResponse]
$creadListPrec :: ReadPrec [StopFleetActionsResponse]
readPrec :: ReadPrec StopFleetActionsResponse
$creadPrec :: ReadPrec StopFleetActionsResponse
readList :: ReadS [StopFleetActionsResponse]
$creadList :: ReadS [StopFleetActionsResponse]
readsPrec :: Int -> ReadS StopFleetActionsResponse
$creadsPrec :: Int -> ReadS StopFleetActionsResponse
Prelude.Read, Int -> StopFleetActionsResponse -> ShowS
[StopFleetActionsResponse] -> ShowS
StopFleetActionsResponse -> String
(Int -> StopFleetActionsResponse -> ShowS)
-> (StopFleetActionsResponse -> String)
-> ([StopFleetActionsResponse] -> ShowS)
-> Show StopFleetActionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopFleetActionsResponse] -> ShowS
$cshowList :: [StopFleetActionsResponse] -> ShowS
show :: StopFleetActionsResponse -> String
$cshow :: StopFleetActionsResponse -> String
showsPrec :: Int -> StopFleetActionsResponse -> ShowS
$cshowsPrec :: Int -> StopFleetActionsResponse -> ShowS
Prelude.Show, (forall x.
StopFleetActionsResponse -> Rep StopFleetActionsResponse x)
-> (forall x.
Rep StopFleetActionsResponse x -> StopFleetActionsResponse)
-> Generic StopFleetActionsResponse
forall x.
Rep StopFleetActionsResponse x -> StopFleetActionsResponse
forall x.
StopFleetActionsResponse -> Rep StopFleetActionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopFleetActionsResponse x -> StopFleetActionsResponse
$cfrom :: forall x.
StopFleetActionsResponse -> Rep StopFleetActionsResponse x
Prelude.Generic)
newStopFleetActionsResponse ::
Prelude.Int ->
StopFleetActionsResponse
newStopFleetActionsResponse :: Int -> StopFleetActionsResponse
newStopFleetActionsResponse Int
pHttpStatus_ =
StopFleetActionsResponse' :: Maybe Text -> Maybe Text -> Int -> StopFleetActionsResponse
StopFleetActionsResponse'
{ $sel:fleetArn:StopFleetActionsResponse' :: Maybe Text
fleetArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:StopFleetActionsResponse' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopFleetActionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopFleetActionsResponse_fleetArn :: Lens.Lens' StopFleetActionsResponse (Prelude.Maybe Prelude.Text)
stopFleetActionsResponse_fleetArn :: (Maybe Text -> f (Maybe Text))
-> StopFleetActionsResponse -> f StopFleetActionsResponse
stopFleetActionsResponse_fleetArn = (StopFleetActionsResponse -> Maybe Text)
-> (StopFleetActionsResponse
-> Maybe Text -> StopFleetActionsResponse)
-> Lens
StopFleetActionsResponse
StopFleetActionsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFleetActionsResponse' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:StopFleetActionsResponse' :: StopFleetActionsResponse -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: StopFleetActionsResponse
s@StopFleetActionsResponse' {} Maybe Text
a -> StopFleetActionsResponse
s {$sel:fleetArn:StopFleetActionsResponse' :: Maybe Text
fleetArn = Maybe Text
a} :: StopFleetActionsResponse)
stopFleetActionsResponse_fleetId :: Lens.Lens' StopFleetActionsResponse (Prelude.Maybe Prelude.Text)
stopFleetActionsResponse_fleetId :: (Maybe Text -> f (Maybe Text))
-> StopFleetActionsResponse -> f StopFleetActionsResponse
stopFleetActionsResponse_fleetId = (StopFleetActionsResponse -> Maybe Text)
-> (StopFleetActionsResponse
-> Maybe Text -> StopFleetActionsResponse)
-> Lens
StopFleetActionsResponse
StopFleetActionsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFleetActionsResponse' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:StopFleetActionsResponse' :: StopFleetActionsResponse -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: StopFleetActionsResponse
s@StopFleetActionsResponse' {} Maybe Text
a -> StopFleetActionsResponse
s {$sel:fleetId:StopFleetActionsResponse' :: Maybe Text
fleetId = Maybe Text
a} :: StopFleetActionsResponse)
stopFleetActionsResponse_httpStatus :: Lens.Lens' StopFleetActionsResponse Prelude.Int
stopFleetActionsResponse_httpStatus :: (Int -> f Int)
-> StopFleetActionsResponse -> f StopFleetActionsResponse
stopFleetActionsResponse_httpStatus = (StopFleetActionsResponse -> Int)
-> (StopFleetActionsResponse -> Int -> StopFleetActionsResponse)
-> Lens StopFleetActionsResponse StopFleetActionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopFleetActionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopFleetActionsResponse' :: StopFleetActionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopFleetActionsResponse
s@StopFleetActionsResponse' {} Int
a -> StopFleetActionsResponse
s {$sel:httpStatus:StopFleetActionsResponse' :: Int
httpStatus = Int
a} :: StopFleetActionsResponse)
instance Prelude.NFData StopFleetActionsResponse