{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DataSync.StartTaskExecution
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts a specific invocation of a task. A @TaskExecution@ value
-- represents an individual run of a task. Each task can have at most one
-- @TaskExecution@ at a time.
--
-- @TaskExecution@ has the following transition phases: INITIALIZING |
-- PREPARING | TRANSFERRING | VERIFYING | SUCCESS\/FAILURE.
--
-- For detailed information, see the Task Execution section in the
-- Components and Terminology topic in the /DataSync User Guide/.
module Amazonka.DataSync.StartTaskExecution
  ( -- * Creating a Request
    StartTaskExecution (..),
    newStartTaskExecution,

    -- * Request Lenses
    startTaskExecution_overrideOptions,
    startTaskExecution_includes,
    startTaskExecution_excludes,
    startTaskExecution_taskArn,

    -- * Destructuring the Response
    StartTaskExecutionResponse (..),
    newStartTaskExecutionResponse,

    -- * Response Lenses
    startTaskExecutionResponse_taskExecutionArn,
    startTaskExecutionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataSync.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

-- | StartTaskExecutionRequest
--
-- /See:/ 'newStartTaskExecution' smart constructor.
data StartTaskExecution = StartTaskExecution'
  { StartTaskExecution -> Maybe Options
overrideOptions :: Prelude.Maybe Options,
    -- | A list of filter rules that determines which files to include when
    -- running a task. The pattern should contain a single filter string that
    -- consists of the patterns to include. The patterns are delimited by \"|\"
    -- (that is, a pipe). For example: @\"\/folder1|\/folder2\"@
    StartTaskExecution -> Maybe [FilterRule]
includes :: Prelude.Maybe [FilterRule],
    -- | A list of filter rules that determines which files to exclude from a
    -- task. The list should contain a single filter string that consists of
    -- the patterns to exclude. The patterns are delimited by \"|\" (that is, a
    -- pipe), for example, @\"\/folder1|\/folder2\"@.
    StartTaskExecution -> Maybe [FilterRule]
excludes :: Prelude.Maybe [FilterRule],
    -- | The Amazon Resource Name (ARN) of the task to start.
    StartTaskExecution -> Text
taskArn :: Prelude.Text
  }
  deriving (StartTaskExecution -> StartTaskExecution -> Bool
(StartTaskExecution -> StartTaskExecution -> Bool)
-> (StartTaskExecution -> StartTaskExecution -> Bool)
-> Eq StartTaskExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTaskExecution -> StartTaskExecution -> Bool
$c/= :: StartTaskExecution -> StartTaskExecution -> Bool
== :: StartTaskExecution -> StartTaskExecution -> Bool
$c== :: StartTaskExecution -> StartTaskExecution -> Bool
Prelude.Eq, ReadPrec [StartTaskExecution]
ReadPrec StartTaskExecution
Int -> ReadS StartTaskExecution
ReadS [StartTaskExecution]
(Int -> ReadS StartTaskExecution)
-> ReadS [StartTaskExecution]
-> ReadPrec StartTaskExecution
-> ReadPrec [StartTaskExecution]
-> Read StartTaskExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTaskExecution]
$creadListPrec :: ReadPrec [StartTaskExecution]
readPrec :: ReadPrec StartTaskExecution
$creadPrec :: ReadPrec StartTaskExecution
readList :: ReadS [StartTaskExecution]
$creadList :: ReadS [StartTaskExecution]
readsPrec :: Int -> ReadS StartTaskExecution
$creadsPrec :: Int -> ReadS StartTaskExecution
Prelude.Read, Int -> StartTaskExecution -> ShowS
[StartTaskExecution] -> ShowS
StartTaskExecution -> String
(Int -> StartTaskExecution -> ShowS)
-> (StartTaskExecution -> String)
-> ([StartTaskExecution] -> ShowS)
-> Show StartTaskExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTaskExecution] -> ShowS
$cshowList :: [StartTaskExecution] -> ShowS
show :: StartTaskExecution -> String
$cshow :: StartTaskExecution -> String
showsPrec :: Int -> StartTaskExecution -> ShowS
$cshowsPrec :: Int -> StartTaskExecution -> ShowS
Prelude.Show, (forall x. StartTaskExecution -> Rep StartTaskExecution x)
-> (forall x. Rep StartTaskExecution x -> StartTaskExecution)
-> Generic StartTaskExecution
forall x. Rep StartTaskExecution x -> StartTaskExecution
forall x. StartTaskExecution -> Rep StartTaskExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTaskExecution x -> StartTaskExecution
$cfrom :: forall x. StartTaskExecution -> Rep StartTaskExecution x
Prelude.Generic)

-- |
-- Create a value of 'StartTaskExecution' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'overrideOptions', 'startTaskExecution_overrideOptions' - Undocumented member.
--
-- 'includes', 'startTaskExecution_includes' - A list of filter rules that determines which files to include when
-- running a task. The pattern should contain a single filter string that
-- consists of the patterns to include. The patterns are delimited by \"|\"
-- (that is, a pipe). For example: @\"\/folder1|\/folder2\"@
--
-- 'excludes', 'startTaskExecution_excludes' - A list of filter rules that determines which files to exclude from a
-- task. The list should contain a single filter string that consists of
-- the patterns to exclude. The patterns are delimited by \"|\" (that is, a
-- pipe), for example, @\"\/folder1|\/folder2\"@.
--
-- 'taskArn', 'startTaskExecution_taskArn' - The Amazon Resource Name (ARN) of the task to start.
newStartTaskExecution ::
  -- | 'taskArn'
  Prelude.Text ->
  StartTaskExecution
newStartTaskExecution :: Text -> StartTaskExecution
newStartTaskExecution Text
pTaskArn_ =
  StartTaskExecution' :: Maybe Options
-> Maybe [FilterRule]
-> Maybe [FilterRule]
-> Text
-> StartTaskExecution
StartTaskExecution'
    { $sel:overrideOptions:StartTaskExecution' :: Maybe Options
overrideOptions =
        Maybe Options
forall a. Maybe a
Prelude.Nothing,
      $sel:includes:StartTaskExecution' :: Maybe [FilterRule]
includes = Maybe [FilterRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:excludes:StartTaskExecution' :: Maybe [FilterRule]
excludes = Maybe [FilterRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskArn:StartTaskExecution' :: Text
taskArn = Text
pTaskArn_
    }

-- | Undocumented member.
startTaskExecution_overrideOptions :: Lens.Lens' StartTaskExecution (Prelude.Maybe Options)
startTaskExecution_overrideOptions :: (Maybe Options -> f (Maybe Options))
-> StartTaskExecution -> f StartTaskExecution
startTaskExecution_overrideOptions = (StartTaskExecution -> Maybe Options)
-> (StartTaskExecution -> Maybe Options -> StartTaskExecution)
-> Lens
     StartTaskExecution
     StartTaskExecution
     (Maybe Options)
     (Maybe Options)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskExecution' {Maybe Options
overrideOptions :: Maybe Options
$sel:overrideOptions:StartTaskExecution' :: StartTaskExecution -> Maybe Options
overrideOptions} -> Maybe Options
overrideOptions) (\s :: StartTaskExecution
s@StartTaskExecution' {} Maybe Options
a -> StartTaskExecution
s {$sel:overrideOptions:StartTaskExecution' :: Maybe Options
overrideOptions = Maybe Options
a} :: StartTaskExecution)

-- | A list of filter rules that determines which files to include when
-- running a task. The pattern should contain a single filter string that
-- consists of the patterns to include. The patterns are delimited by \"|\"
-- (that is, a pipe). For example: @\"\/folder1|\/folder2\"@
startTaskExecution_includes :: Lens.Lens' StartTaskExecution (Prelude.Maybe [FilterRule])
startTaskExecution_includes :: (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> StartTaskExecution -> f StartTaskExecution
startTaskExecution_includes = (StartTaskExecution -> Maybe [FilterRule])
-> (StartTaskExecution -> Maybe [FilterRule] -> StartTaskExecution)
-> Lens
     StartTaskExecution
     StartTaskExecution
     (Maybe [FilterRule])
     (Maybe [FilterRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskExecution' {Maybe [FilterRule]
includes :: Maybe [FilterRule]
$sel:includes:StartTaskExecution' :: StartTaskExecution -> Maybe [FilterRule]
includes} -> Maybe [FilterRule]
includes) (\s :: StartTaskExecution
s@StartTaskExecution' {} Maybe [FilterRule]
a -> StartTaskExecution
s {$sel:includes:StartTaskExecution' :: Maybe [FilterRule]
includes = Maybe [FilterRule]
a} :: StartTaskExecution) ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
 -> StartTaskExecution -> f StartTaskExecution)
-> ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
    -> Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> StartTaskExecution
-> f StartTaskExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FilterRule] [FilterRule] [FilterRule] [FilterRule]
-> Iso
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
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 [FilterRule] [FilterRule] [FilterRule] [FilterRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of filter rules that determines which files to exclude from a
-- task. The list should contain a single filter string that consists of
-- the patterns to exclude. The patterns are delimited by \"|\" (that is, a
-- pipe), for example, @\"\/folder1|\/folder2\"@.
startTaskExecution_excludes :: Lens.Lens' StartTaskExecution (Prelude.Maybe [FilterRule])
startTaskExecution_excludes :: (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> StartTaskExecution -> f StartTaskExecution
startTaskExecution_excludes = (StartTaskExecution -> Maybe [FilterRule])
-> (StartTaskExecution -> Maybe [FilterRule] -> StartTaskExecution)
-> Lens
     StartTaskExecution
     StartTaskExecution
     (Maybe [FilterRule])
     (Maybe [FilterRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskExecution' {Maybe [FilterRule]
excludes :: Maybe [FilterRule]
$sel:excludes:StartTaskExecution' :: StartTaskExecution -> Maybe [FilterRule]
excludes} -> Maybe [FilterRule]
excludes) (\s :: StartTaskExecution
s@StartTaskExecution' {} Maybe [FilterRule]
a -> StartTaskExecution
s {$sel:excludes:StartTaskExecution' :: Maybe [FilterRule]
excludes = Maybe [FilterRule]
a} :: StartTaskExecution) ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
 -> StartTaskExecution -> f StartTaskExecution)
-> ((Maybe [FilterRule] -> f (Maybe [FilterRule]))
    -> Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> (Maybe [FilterRule] -> f (Maybe [FilterRule]))
-> StartTaskExecution
-> f StartTaskExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FilterRule] [FilterRule] [FilterRule] [FilterRule]
-> Iso
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
     (Maybe [FilterRule])
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 [FilterRule] [FilterRule] [FilterRule] [FilterRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the task to start.
startTaskExecution_taskArn :: Lens.Lens' StartTaskExecution Prelude.Text
startTaskExecution_taskArn :: (Text -> f Text) -> StartTaskExecution -> f StartTaskExecution
startTaskExecution_taskArn = (StartTaskExecution -> Text)
-> (StartTaskExecution -> Text -> StartTaskExecution)
-> Lens StartTaskExecution StartTaskExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskExecution' {Text
taskArn :: Text
$sel:taskArn:StartTaskExecution' :: StartTaskExecution -> Text
taskArn} -> Text
taskArn) (\s :: StartTaskExecution
s@StartTaskExecution' {} Text
a -> StartTaskExecution
s {$sel:taskArn:StartTaskExecution' :: Text
taskArn = Text
a} :: StartTaskExecution)

instance Core.AWSRequest StartTaskExecution where
  type
    AWSResponse StartTaskExecution =
      StartTaskExecutionResponse
  request :: StartTaskExecution -> Request StartTaskExecution
request = Service -> StartTaskExecution -> Request StartTaskExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartTaskExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartTaskExecution)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartTaskExecution))
-> Logger
-> Service
-> Proxy StartTaskExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartTaskExecution)))
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 -> Int -> StartTaskExecutionResponse
StartTaskExecutionResponse'
            (Maybe Text -> Int -> StartTaskExecutionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartTaskExecutionResponse)
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
"TaskExecutionArn")
            Either String (Int -> StartTaskExecutionResponse)
-> Either String Int -> Either String StartTaskExecutionResponse
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 StartTaskExecution

instance Prelude.NFData StartTaskExecution

instance Core.ToHeaders StartTaskExecution where
  toHeaders :: StartTaskExecution -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartTaskExecution -> 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
"FmrsService.StartTaskExecution" ::
                          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 StartTaskExecution where
  toJSON :: StartTaskExecution -> Value
toJSON StartTaskExecution' {Maybe [FilterRule]
Maybe Options
Text
taskArn :: Text
excludes :: Maybe [FilterRule]
includes :: Maybe [FilterRule]
overrideOptions :: Maybe Options
$sel:taskArn:StartTaskExecution' :: StartTaskExecution -> Text
$sel:excludes:StartTaskExecution' :: StartTaskExecution -> Maybe [FilterRule]
$sel:includes:StartTaskExecution' :: StartTaskExecution -> Maybe [FilterRule]
$sel:overrideOptions:StartTaskExecution' :: StartTaskExecution -> Maybe Options
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"OverrideOptions" Text -> Options -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Options -> Pair) -> Maybe Options -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Options
overrideOptions,
            (Text
"Includes" Text -> [FilterRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FilterRule] -> Pair) -> Maybe [FilterRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FilterRule]
includes,
            (Text
"Excludes" Text -> [FilterRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FilterRule] -> Pair) -> Maybe [FilterRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FilterRule]
excludes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskArn)
          ]
      )

instance Core.ToPath StartTaskExecution where
  toPath :: StartTaskExecution -> ByteString
toPath = ByteString -> StartTaskExecution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery StartTaskExecution where
  toQuery :: StartTaskExecution -> QueryString
toQuery = QueryString -> StartTaskExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | StartTaskExecutionResponse
--
-- /See:/ 'newStartTaskExecutionResponse' smart constructor.
data StartTaskExecutionResponse = StartTaskExecutionResponse'
  { -- | The Amazon Resource Name (ARN) of the specific task execution that was
    -- started.
    StartTaskExecutionResponse -> Maybe Text
taskExecutionArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartTaskExecutionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartTaskExecutionResponse -> StartTaskExecutionResponse -> Bool
(StartTaskExecutionResponse -> StartTaskExecutionResponse -> Bool)
-> (StartTaskExecutionResponse
    -> StartTaskExecutionResponse -> Bool)
-> Eq StartTaskExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTaskExecutionResponse -> StartTaskExecutionResponse -> Bool
$c/= :: StartTaskExecutionResponse -> StartTaskExecutionResponse -> Bool
== :: StartTaskExecutionResponse -> StartTaskExecutionResponse -> Bool
$c== :: StartTaskExecutionResponse -> StartTaskExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StartTaskExecutionResponse]
ReadPrec StartTaskExecutionResponse
Int -> ReadS StartTaskExecutionResponse
ReadS [StartTaskExecutionResponse]
(Int -> ReadS StartTaskExecutionResponse)
-> ReadS [StartTaskExecutionResponse]
-> ReadPrec StartTaskExecutionResponse
-> ReadPrec [StartTaskExecutionResponse]
-> Read StartTaskExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTaskExecutionResponse]
$creadListPrec :: ReadPrec [StartTaskExecutionResponse]
readPrec :: ReadPrec StartTaskExecutionResponse
$creadPrec :: ReadPrec StartTaskExecutionResponse
readList :: ReadS [StartTaskExecutionResponse]
$creadList :: ReadS [StartTaskExecutionResponse]
readsPrec :: Int -> ReadS StartTaskExecutionResponse
$creadsPrec :: Int -> ReadS StartTaskExecutionResponse
Prelude.Read, Int -> StartTaskExecutionResponse -> ShowS
[StartTaskExecutionResponse] -> ShowS
StartTaskExecutionResponse -> String
(Int -> StartTaskExecutionResponse -> ShowS)
-> (StartTaskExecutionResponse -> String)
-> ([StartTaskExecutionResponse] -> ShowS)
-> Show StartTaskExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTaskExecutionResponse] -> ShowS
$cshowList :: [StartTaskExecutionResponse] -> ShowS
show :: StartTaskExecutionResponse -> String
$cshow :: StartTaskExecutionResponse -> String
showsPrec :: Int -> StartTaskExecutionResponse -> ShowS
$cshowsPrec :: Int -> StartTaskExecutionResponse -> ShowS
Prelude.Show, (forall x.
 StartTaskExecutionResponse -> Rep StartTaskExecutionResponse x)
-> (forall x.
    Rep StartTaskExecutionResponse x -> StartTaskExecutionResponse)
-> Generic StartTaskExecutionResponse
forall x.
Rep StartTaskExecutionResponse x -> StartTaskExecutionResponse
forall x.
StartTaskExecutionResponse -> Rep StartTaskExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartTaskExecutionResponse x -> StartTaskExecutionResponse
$cfrom :: forall x.
StartTaskExecutionResponse -> Rep StartTaskExecutionResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartTaskExecutionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'taskExecutionArn', 'startTaskExecutionResponse_taskExecutionArn' - The Amazon Resource Name (ARN) of the specific task execution that was
-- started.
--
-- 'httpStatus', 'startTaskExecutionResponse_httpStatus' - The response's http status code.
newStartTaskExecutionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartTaskExecutionResponse
newStartTaskExecutionResponse :: Int -> StartTaskExecutionResponse
newStartTaskExecutionResponse Int
pHttpStatus_ =
  StartTaskExecutionResponse' :: Maybe Text -> Int -> StartTaskExecutionResponse
StartTaskExecutionResponse'
    { $sel:taskExecutionArn:StartTaskExecutionResponse' :: Maybe Text
taskExecutionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartTaskExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the specific task execution that was
-- started.
startTaskExecutionResponse_taskExecutionArn :: Lens.Lens' StartTaskExecutionResponse (Prelude.Maybe Prelude.Text)
startTaskExecutionResponse_taskExecutionArn :: (Maybe Text -> f (Maybe Text))
-> StartTaskExecutionResponse -> f StartTaskExecutionResponse
startTaskExecutionResponse_taskExecutionArn = (StartTaskExecutionResponse -> Maybe Text)
-> (StartTaskExecutionResponse
    -> Maybe Text -> StartTaskExecutionResponse)
-> Lens
     StartTaskExecutionResponse
     StartTaskExecutionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskExecutionResponse' {Maybe Text
taskExecutionArn :: Maybe Text
$sel:taskExecutionArn:StartTaskExecutionResponse' :: StartTaskExecutionResponse -> Maybe Text
taskExecutionArn} -> Maybe Text
taskExecutionArn) (\s :: StartTaskExecutionResponse
s@StartTaskExecutionResponse' {} Maybe Text
a -> StartTaskExecutionResponse
s {$sel:taskExecutionArn:StartTaskExecutionResponse' :: Maybe Text
taskExecutionArn = Maybe Text
a} :: StartTaskExecutionResponse)

-- | The response's http status code.
startTaskExecutionResponse_httpStatus :: Lens.Lens' StartTaskExecutionResponse Prelude.Int
startTaskExecutionResponse_httpStatus :: (Int -> f Int)
-> StartTaskExecutionResponse -> f StartTaskExecutionResponse
startTaskExecutionResponse_httpStatus = (StartTaskExecutionResponse -> Int)
-> (StartTaskExecutionResponse
    -> Int -> StartTaskExecutionResponse)
-> Lens
     StartTaskExecutionResponse StartTaskExecutionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTaskExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartTaskExecutionResponse' :: StartTaskExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartTaskExecutionResponse
s@StartTaskExecutionResponse' {} Int
a -> StartTaskExecutionResponse
s {$sel:httpStatus:StartTaskExecutionResponse' :: Int
httpStatus = Int
a} :: StartTaskExecutionResponse)

instance Prelude.NFData StartTaskExecutionResponse