{-# 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.ECS.StartTask
(
StartTask (..),
newStartTask,
startTask_overrides,
startTask_group,
startTask_cluster,
startTask_propagateTags,
startTask_enableECSManagedTags,
startTask_referenceId,
startTask_startedBy,
startTask_networkConfiguration,
startTask_enableExecuteCommand,
startTask_tags,
startTask_containerInstances,
startTask_taskDefinition,
StartTaskResponse (..),
newStartTaskResponse,
startTaskResponse_failures,
startTaskResponse_tasks,
startTaskResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ECS.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 StartTask = StartTask'
{
StartTask -> Maybe TaskOverride
overrides :: Prelude.Maybe TaskOverride,
StartTask -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
StartTask -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
StartTask -> Maybe PropagateTags
propagateTags :: Prelude.Maybe PropagateTags,
StartTask -> Maybe Bool
enableECSManagedTags :: Prelude.Maybe Prelude.Bool,
StartTask -> Maybe Text
referenceId :: Prelude.Maybe Prelude.Text,
StartTask -> Maybe Text
startedBy :: Prelude.Maybe Prelude.Text,
StartTask -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
StartTask -> Maybe Bool
enableExecuteCommand :: Prelude.Maybe Prelude.Bool,
StartTask -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
StartTask -> [Text]
containerInstances :: [Prelude.Text],
StartTask -> Text
taskDefinition :: Prelude.Text
}
deriving (StartTask -> StartTask -> Bool
(StartTask -> StartTask -> Bool)
-> (StartTask -> StartTask -> Bool) -> Eq StartTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTask -> StartTask -> Bool
$c/= :: StartTask -> StartTask -> Bool
== :: StartTask -> StartTask -> Bool
$c== :: StartTask -> StartTask -> Bool
Prelude.Eq, ReadPrec [StartTask]
ReadPrec StartTask
Int -> ReadS StartTask
ReadS [StartTask]
(Int -> ReadS StartTask)
-> ReadS [StartTask]
-> ReadPrec StartTask
-> ReadPrec [StartTask]
-> Read StartTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTask]
$creadListPrec :: ReadPrec [StartTask]
readPrec :: ReadPrec StartTask
$creadPrec :: ReadPrec StartTask
readList :: ReadS [StartTask]
$creadList :: ReadS [StartTask]
readsPrec :: Int -> ReadS StartTask
$creadsPrec :: Int -> ReadS StartTask
Prelude.Read, Int -> StartTask -> ShowS
[StartTask] -> ShowS
StartTask -> String
(Int -> StartTask -> ShowS)
-> (StartTask -> String)
-> ([StartTask] -> ShowS)
-> Show StartTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTask] -> ShowS
$cshowList :: [StartTask] -> ShowS
show :: StartTask -> String
$cshow :: StartTask -> String
showsPrec :: Int -> StartTask -> ShowS
$cshowsPrec :: Int -> StartTask -> ShowS
Prelude.Show, (forall x. StartTask -> Rep StartTask x)
-> (forall x. Rep StartTask x -> StartTask) -> Generic StartTask
forall x. Rep StartTask x -> StartTask
forall x. StartTask -> Rep StartTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTask x -> StartTask
$cfrom :: forall x. StartTask -> Rep StartTask x
Prelude.Generic)
newStartTask ::
Prelude.Text ->
StartTask
newStartTask :: Text -> StartTask
newStartTask Text
pTaskDefinition_ =
StartTask' :: Maybe TaskOverride
-> Maybe Text
-> Maybe Text
-> Maybe PropagateTags
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe NetworkConfiguration
-> Maybe Bool
-> Maybe [Tag]
-> [Text]
-> Text
-> StartTask
StartTask'
{ $sel:overrides:StartTask' :: Maybe TaskOverride
overrides = Maybe TaskOverride
forall a. Maybe a
Prelude.Nothing,
$sel:group':StartTask' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cluster:StartTask' :: Maybe Text
cluster = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:propagateTags:StartTask' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
forall a. Maybe a
Prelude.Nothing,
$sel:enableECSManagedTags:StartTask' :: Maybe Bool
enableECSManagedTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:referenceId:StartTask' :: Maybe Text
referenceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:startedBy:StartTask' :: Maybe Text
startedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:networkConfiguration:StartTask' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:enableExecuteCommand:StartTask' :: Maybe Bool
enableExecuteCommand = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tags:StartTask' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:containerInstances:StartTask' :: [Text]
containerInstances = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:taskDefinition:StartTask' :: Text
taskDefinition = Text
pTaskDefinition_
}
startTask_overrides :: Lens.Lens' StartTask (Prelude.Maybe TaskOverride)
startTask_overrides :: (Maybe TaskOverride -> f (Maybe TaskOverride))
-> StartTask -> f StartTask
startTask_overrides = (StartTask -> Maybe TaskOverride)
-> (StartTask -> Maybe TaskOverride -> StartTask)
-> Lens
StartTask StartTask (Maybe TaskOverride) (Maybe TaskOverride)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe TaskOverride
overrides :: Maybe TaskOverride
$sel:overrides:StartTask' :: StartTask -> Maybe TaskOverride
overrides} -> Maybe TaskOverride
overrides) (\s :: StartTask
s@StartTask' {} Maybe TaskOverride
a -> StartTask
s {$sel:overrides:StartTask' :: Maybe TaskOverride
overrides = Maybe TaskOverride
a} :: StartTask)
startTask_group :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_group :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_group = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
group' :: Maybe Text
$sel:group':StartTask' :: StartTask -> Maybe Text
group'} -> Maybe Text
group') (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:group':StartTask' :: Maybe Text
group' = Maybe Text
a} :: StartTask)
startTask_cluster :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_cluster :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_cluster = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
cluster :: Maybe Text
$sel:cluster:StartTask' :: StartTask -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:cluster:StartTask' :: Maybe Text
cluster = Maybe Text
a} :: StartTask)
startTask_propagateTags :: Lens.Lens' StartTask (Prelude.Maybe PropagateTags)
startTask_propagateTags :: (Maybe PropagateTags -> f (Maybe PropagateTags))
-> StartTask -> f StartTask
startTask_propagateTags = (StartTask -> Maybe PropagateTags)
-> (StartTask -> Maybe PropagateTags -> StartTask)
-> Lens
StartTask StartTask (Maybe PropagateTags) (Maybe PropagateTags)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe PropagateTags
propagateTags :: Maybe PropagateTags
$sel:propagateTags:StartTask' :: StartTask -> Maybe PropagateTags
propagateTags} -> Maybe PropagateTags
propagateTags) (\s :: StartTask
s@StartTask' {} Maybe PropagateTags
a -> StartTask
s {$sel:propagateTags:StartTask' :: Maybe PropagateTags
propagateTags = Maybe PropagateTags
a} :: StartTask)
startTask_enableECSManagedTags :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Bool)
startTask_enableECSManagedTags :: (Maybe Bool -> f (Maybe Bool)) -> StartTask -> f StartTask
startTask_enableECSManagedTags = (StartTask -> Maybe Bool)
-> (StartTask -> Maybe Bool -> StartTask)
-> Lens StartTask StartTask (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Bool
enableECSManagedTags :: Maybe Bool
$sel:enableECSManagedTags:StartTask' :: StartTask -> Maybe Bool
enableECSManagedTags} -> Maybe Bool
enableECSManagedTags) (\s :: StartTask
s@StartTask' {} Maybe Bool
a -> StartTask
s {$sel:enableECSManagedTags:StartTask' :: Maybe Bool
enableECSManagedTags = Maybe Bool
a} :: StartTask)
startTask_referenceId :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_referenceId :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_referenceId = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
referenceId :: Maybe Text
$sel:referenceId:StartTask' :: StartTask -> Maybe Text
referenceId} -> Maybe Text
referenceId) (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:referenceId:StartTask' :: Maybe Text
referenceId = Maybe Text
a} :: StartTask)
startTask_startedBy :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Text)
startTask_startedBy :: (Maybe Text -> f (Maybe Text)) -> StartTask -> f StartTask
startTask_startedBy = (StartTask -> Maybe Text)
-> (StartTask -> Maybe Text -> StartTask)
-> Lens StartTask StartTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Text
startedBy :: Maybe Text
$sel:startedBy:StartTask' :: StartTask -> Maybe Text
startedBy} -> Maybe Text
startedBy) (\s :: StartTask
s@StartTask' {} Maybe Text
a -> StartTask
s {$sel:startedBy:StartTask' :: Maybe Text
startedBy = Maybe Text
a} :: StartTask)
startTask_networkConfiguration :: Lens.Lens' StartTask (Prelude.Maybe NetworkConfiguration)
startTask_networkConfiguration :: (Maybe NetworkConfiguration -> f (Maybe NetworkConfiguration))
-> StartTask -> f StartTask
startTask_networkConfiguration = (StartTask -> Maybe NetworkConfiguration)
-> (StartTask -> Maybe NetworkConfiguration -> StartTask)
-> Lens
StartTask
StartTask
(Maybe NetworkConfiguration)
(Maybe NetworkConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:StartTask' :: StartTask -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: StartTask
s@StartTask' {} Maybe NetworkConfiguration
a -> StartTask
s {$sel:networkConfiguration:StartTask' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: StartTask)
startTask_enableExecuteCommand :: Lens.Lens' StartTask (Prelude.Maybe Prelude.Bool)
startTask_enableExecuteCommand :: (Maybe Bool -> f (Maybe Bool)) -> StartTask -> f StartTask
startTask_enableExecuteCommand = (StartTask -> Maybe Bool)
-> (StartTask -> Maybe Bool -> StartTask)
-> Lens StartTask StartTask (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe Bool
enableExecuteCommand :: Maybe Bool
$sel:enableExecuteCommand:StartTask' :: StartTask -> Maybe Bool
enableExecuteCommand} -> Maybe Bool
enableExecuteCommand) (\s :: StartTask
s@StartTask' {} Maybe Bool
a -> StartTask
s {$sel:enableExecuteCommand:StartTask' :: Maybe Bool
enableExecuteCommand = Maybe Bool
a} :: StartTask)
startTask_tags :: Lens.Lens' StartTask (Prelude.Maybe [Tag])
startTask_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> StartTask -> f StartTask
startTask_tags = (StartTask -> Maybe [Tag])
-> (StartTask -> Maybe [Tag] -> StartTask)
-> Lens StartTask StartTask (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:StartTask' :: StartTask -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: StartTask
s@StartTask' {} Maybe [Tag]
a -> StartTask
s {$sel:tags:StartTask' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: StartTask) ((Maybe [Tag] -> f (Maybe [Tag])) -> StartTask -> f StartTask)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> StartTask
-> f StartTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTask_containerInstances :: Lens.Lens' StartTask [Prelude.Text]
startTask_containerInstances :: ([Text] -> f [Text]) -> StartTask -> f StartTask
startTask_containerInstances = (StartTask -> [Text])
-> (StartTask -> [Text] -> StartTask)
-> Lens StartTask StartTask [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {[Text]
containerInstances :: [Text]
$sel:containerInstances:StartTask' :: StartTask -> [Text]
containerInstances} -> [Text]
containerInstances) (\s :: StartTask
s@StartTask' {} [Text]
a -> StartTask
s {$sel:containerInstances:StartTask' :: [Text]
containerInstances = [Text]
a} :: StartTask) (([Text] -> f [Text]) -> StartTask -> f StartTask)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> StartTask
-> f StartTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTask_taskDefinition :: Lens.Lens' StartTask Prelude.Text
startTask_taskDefinition :: (Text -> f Text) -> StartTask -> f StartTask
startTask_taskDefinition = (StartTask -> Text)
-> (StartTask -> Text -> StartTask)
-> Lens StartTask StartTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTask' {Text
taskDefinition :: Text
$sel:taskDefinition:StartTask' :: StartTask -> Text
taskDefinition} -> Text
taskDefinition) (\s :: StartTask
s@StartTask' {} Text
a -> StartTask
s {$sel:taskDefinition:StartTask' :: Text
taskDefinition = Text
a} :: StartTask)
instance Core.AWSRequest StartTask where
type AWSResponse StartTask = StartTaskResponse
request :: StartTask -> Request StartTask
request = Service -> StartTask -> Request StartTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartTask)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartTask))
-> Logger
-> Service
-> Proxy StartTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartTask)))
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 [Failure] -> Maybe [Task] -> Int -> StartTaskResponse
StartTaskResponse'
(Maybe [Failure] -> Maybe [Task] -> Int -> StartTaskResponse)
-> Either String (Maybe [Failure])
-> Either String (Maybe [Task] -> Int -> StartTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Failure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failures" Either String (Maybe (Maybe [Failure]))
-> Maybe [Failure] -> Either String (Maybe [Failure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Failure]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe [Task] -> Int -> StartTaskResponse)
-> Either String (Maybe [Task])
-> Either String (Int -> StartTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Task]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tasks" Either String (Maybe (Maybe [Task]))
-> Maybe [Task] -> Either String (Maybe [Task])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Task]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> StartTaskResponse)
-> Either String Int -> Either String StartTaskResponse
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 StartTask
instance Prelude.NFData StartTask
instance Core.ToHeaders StartTask where
toHeaders :: StartTask -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartTask -> 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
"AmazonEC2ContainerServiceV20141113.StartTask" ::
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 StartTask where
toJSON :: StartTask -> Value
toJSON StartTask' {[Text]
Maybe Bool
Maybe [Tag]
Maybe Text
Maybe NetworkConfiguration
Maybe PropagateTags
Maybe TaskOverride
Text
taskDefinition :: Text
containerInstances :: [Text]
tags :: Maybe [Tag]
enableExecuteCommand :: Maybe Bool
networkConfiguration :: Maybe NetworkConfiguration
startedBy :: Maybe Text
referenceId :: Maybe Text
enableECSManagedTags :: Maybe Bool
propagateTags :: Maybe PropagateTags
cluster :: Maybe Text
group' :: Maybe Text
overrides :: Maybe TaskOverride
$sel:taskDefinition:StartTask' :: StartTask -> Text
$sel:containerInstances:StartTask' :: StartTask -> [Text]
$sel:tags:StartTask' :: StartTask -> Maybe [Tag]
$sel:enableExecuteCommand:StartTask' :: StartTask -> Maybe Bool
$sel:networkConfiguration:StartTask' :: StartTask -> Maybe NetworkConfiguration
$sel:startedBy:StartTask' :: StartTask -> Maybe Text
$sel:referenceId:StartTask' :: StartTask -> Maybe Text
$sel:enableECSManagedTags:StartTask' :: StartTask -> Maybe Bool
$sel:propagateTags:StartTask' :: StartTask -> Maybe PropagateTags
$sel:cluster:StartTask' :: StartTask -> Maybe Text
$sel:group':StartTask' :: StartTask -> Maybe Text
$sel:overrides:StartTask' :: StartTask -> Maybe TaskOverride
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"overrides" Text -> TaskOverride -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskOverride -> Pair) -> Maybe TaskOverride -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskOverride
overrides,
(Text
"group" 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
group',
(Text
"cluster" 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
cluster,
(Text
"propagateTags" Text -> PropagateTags -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PropagateTags -> Pair) -> Maybe PropagateTags -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PropagateTags
propagateTags,
(Text
"enableECSManagedTags" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableECSManagedTags,
(Text
"referenceId" 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
referenceId,
(Text
"startedBy" 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
startedBy,
(Text
"networkConfiguration" Text -> NetworkConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NetworkConfiguration -> Pair)
-> Maybe NetworkConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkConfiguration
networkConfiguration,
(Text
"enableExecuteCommand" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableExecuteCommand,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"containerInstances" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
containerInstances),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"taskDefinition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskDefinition)
]
)
instance Core.ToPath StartTask where
toPath :: StartTask -> ByteString
toPath = ByteString -> StartTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartTask where
toQuery :: StartTask -> QueryString
toQuery = QueryString -> StartTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartTaskResponse = StartTaskResponse'
{
StartTaskResponse -> Maybe [Failure]
failures :: Prelude.Maybe [Failure],
StartTaskResponse -> Maybe [Task]
tasks :: Prelude.Maybe [Task],
StartTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartTaskResponse -> StartTaskResponse -> Bool
(StartTaskResponse -> StartTaskResponse -> Bool)
-> (StartTaskResponse -> StartTaskResponse -> Bool)
-> Eq StartTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTaskResponse -> StartTaskResponse -> Bool
$c/= :: StartTaskResponse -> StartTaskResponse -> Bool
== :: StartTaskResponse -> StartTaskResponse -> Bool
$c== :: StartTaskResponse -> StartTaskResponse -> Bool
Prelude.Eq, ReadPrec [StartTaskResponse]
ReadPrec StartTaskResponse
Int -> ReadS StartTaskResponse
ReadS [StartTaskResponse]
(Int -> ReadS StartTaskResponse)
-> ReadS [StartTaskResponse]
-> ReadPrec StartTaskResponse
-> ReadPrec [StartTaskResponse]
-> Read StartTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTaskResponse]
$creadListPrec :: ReadPrec [StartTaskResponse]
readPrec :: ReadPrec StartTaskResponse
$creadPrec :: ReadPrec StartTaskResponse
readList :: ReadS [StartTaskResponse]
$creadList :: ReadS [StartTaskResponse]
readsPrec :: Int -> ReadS StartTaskResponse
$creadsPrec :: Int -> ReadS StartTaskResponse
Prelude.Read, Int -> StartTaskResponse -> ShowS
[StartTaskResponse] -> ShowS
StartTaskResponse -> String
(Int -> StartTaskResponse -> ShowS)
-> (StartTaskResponse -> String)
-> ([StartTaskResponse] -> ShowS)
-> Show StartTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTaskResponse] -> ShowS
$cshowList :: [StartTaskResponse] -> ShowS
show :: StartTaskResponse -> String
$cshow :: StartTaskResponse -> String
showsPrec :: Int -> StartTaskResponse -> ShowS
$cshowsPrec :: Int -> StartTaskResponse -> ShowS
Prelude.Show, (forall x. StartTaskResponse -> Rep StartTaskResponse x)
-> (forall x. Rep StartTaskResponse x -> StartTaskResponse)
-> Generic StartTaskResponse
forall x. Rep StartTaskResponse x -> StartTaskResponse
forall x. StartTaskResponse -> Rep StartTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTaskResponse x -> StartTaskResponse
$cfrom :: forall x. StartTaskResponse -> Rep StartTaskResponse x
Prelude.Generic)
newStartTaskResponse ::
Prelude.Int ->
StartTaskResponse
newStartTaskResponse :: Int -> StartTaskResponse
newStartTaskResponse Int
pHttpStatus_ =
StartTaskResponse' :: Maybe [Failure] -> Maybe [Task] -> Int -> StartTaskResponse
StartTaskResponse'
{ $sel:failures:StartTaskResponse' :: Maybe [Failure]
failures = Maybe [Failure]
forall a. Maybe a
Prelude.Nothing,
$sel:tasks:StartTaskResponse' :: Maybe [Task]
tasks = Maybe [Task]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startTaskResponse_failures :: Lens.Lens' StartTaskResponse (Prelude.Maybe [Failure])
startTaskResponse_failures :: (Maybe [Failure] -> f (Maybe [Failure]))
-> StartTaskResponse -> f StartTaskResponse
startTaskResponse_failures = (StartTaskResponse -> Maybe [Failure])
-> (StartTaskResponse -> Maybe [Failure] -> StartTaskResponse)
-> Lens
StartTaskResponse
StartTaskResponse
(Maybe [Failure])
(Maybe [Failure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskResponse' {Maybe [Failure]
failures :: Maybe [Failure]
$sel:failures:StartTaskResponse' :: StartTaskResponse -> Maybe [Failure]
failures} -> Maybe [Failure]
failures) (\s :: StartTaskResponse
s@StartTaskResponse' {} Maybe [Failure]
a -> StartTaskResponse
s {$sel:failures:StartTaskResponse' :: Maybe [Failure]
failures = Maybe [Failure]
a} :: StartTaskResponse) ((Maybe [Failure] -> f (Maybe [Failure]))
-> StartTaskResponse -> f StartTaskResponse)
-> ((Maybe [Failure] -> f (Maybe [Failure]))
-> Maybe [Failure] -> f (Maybe [Failure]))
-> (Maybe [Failure] -> f (Maybe [Failure]))
-> StartTaskResponse
-> f StartTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Failure] [Failure] [Failure] [Failure]
-> Iso
(Maybe [Failure])
(Maybe [Failure])
(Maybe [Failure])
(Maybe [Failure])
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 [Failure] [Failure] [Failure] [Failure]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTaskResponse_tasks :: Lens.Lens' StartTaskResponse (Prelude.Maybe [Task])
startTaskResponse_tasks :: (Maybe [Task] -> f (Maybe [Task]))
-> StartTaskResponse -> f StartTaskResponse
startTaskResponse_tasks = (StartTaskResponse -> Maybe [Task])
-> (StartTaskResponse -> Maybe [Task] -> StartTaskResponse)
-> Lens
StartTaskResponse StartTaskResponse (Maybe [Task]) (Maybe [Task])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskResponse' {Maybe [Task]
tasks :: Maybe [Task]
$sel:tasks:StartTaskResponse' :: StartTaskResponse -> Maybe [Task]
tasks} -> Maybe [Task]
tasks) (\s :: StartTaskResponse
s@StartTaskResponse' {} Maybe [Task]
a -> StartTaskResponse
s {$sel:tasks:StartTaskResponse' :: Maybe [Task]
tasks = Maybe [Task]
a} :: StartTaskResponse) ((Maybe [Task] -> f (Maybe [Task]))
-> StartTaskResponse -> f StartTaskResponse)
-> ((Maybe [Task] -> f (Maybe [Task]))
-> Maybe [Task] -> f (Maybe [Task]))
-> (Maybe [Task] -> f (Maybe [Task]))
-> StartTaskResponse
-> f StartTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Task] [Task] [Task] [Task]
-> Iso (Maybe [Task]) (Maybe [Task]) (Maybe [Task]) (Maybe [Task])
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 [Task] [Task] [Task] [Task]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTaskResponse_httpStatus :: Lens.Lens' StartTaskResponse Prelude.Int
startTaskResponse_httpStatus :: (Int -> f Int) -> StartTaskResponse -> f StartTaskResponse
startTaskResponse_httpStatus = (StartTaskResponse -> Int)
-> (StartTaskResponse -> Int -> StartTaskResponse)
-> Lens StartTaskResponse StartTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartTaskResponse' :: StartTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartTaskResponse
s@StartTaskResponse' {} Int
a -> StartTaskResponse
s {$sel:httpStatus:StartTaskResponse' :: Int
httpStatus = Int
a} :: StartTaskResponse)
instance Prelude.NFData StartTaskResponse