{-# 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.Omics.StartRun
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts a run.
module Amazonka.Omics.StartRun
  ( -- * Creating a Request
    StartRun (..),
    newStartRun,

    -- * Request Lenses
    startRun_logLevel,
    startRun_name,
    startRun_outputUri,
    startRun_parameters,
    startRun_priority,
    startRun_runGroupId,
    startRun_runId,
    startRun_storageCapacity,
    startRun_tags,
    startRun_workflowId,
    startRun_workflowType,
    startRun_requestId,
    startRun_roleArn,

    -- * Destructuring the Response
    StartRunResponse (..),
    newStartRunResponse,

    -- * Response Lenses
    startRunResponse_arn,
    startRunResponse_id,
    startRunResponse_status,
    startRunResponse_tags,
    startRunResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Omics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newStartRun' smart constructor.
data StartRun = StartRun'
  { -- | A log level for the run.
    StartRun -> Maybe RunLogLevel
logLevel :: Prelude.Maybe RunLogLevel,
    -- | A name for the run.
    StartRun -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An output URI for the run.
    StartRun -> Maybe Text
outputUri :: Prelude.Maybe Prelude.Text,
    -- | Parameters for the run.
    StartRun -> Maybe RunParameters
parameters :: Prelude.Maybe RunParameters,
    -- | A priority for the run.
    StartRun -> Maybe Natural
priority :: Prelude.Maybe Prelude.Natural,
    -- | The run\'s group ID.
    StartRun -> Maybe Text
runGroupId :: Prelude.Maybe Prelude.Text,
    -- | The run\'s ID.
    StartRun -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
    -- | A storage capacity for the run.
    StartRun -> Maybe Natural
storageCapacity :: Prelude.Maybe Prelude.Natural,
    -- | Tags for the run.
    StartRun -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The run\'s workflow ID.
    StartRun -> Maybe Text
workflowId :: Prelude.Maybe Prelude.Text,
    -- | The run\'s workflows type.
    StartRun -> Maybe WorkflowType
workflowType :: Prelude.Maybe WorkflowType,
    -- | A request ID for the run.
    StartRun -> Text
requestId :: Prelude.Text,
    -- | A service role for the run.
    StartRun -> Text
roleArn :: Prelude.Text
  }
  deriving (StartRun -> StartRun -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRun -> StartRun -> Bool
$c/= :: StartRun -> StartRun -> Bool
== :: StartRun -> StartRun -> Bool
$c== :: StartRun -> StartRun -> Bool
Prelude.Eq, ReadPrec [StartRun]
ReadPrec StartRun
Int -> ReadS StartRun
ReadS [StartRun]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRun]
$creadListPrec :: ReadPrec [StartRun]
readPrec :: ReadPrec StartRun
$creadPrec :: ReadPrec StartRun
readList :: ReadS [StartRun]
$creadList :: ReadS [StartRun]
readsPrec :: Int -> ReadS StartRun
$creadsPrec :: Int -> ReadS StartRun
Prelude.Read, Int -> StartRun -> ShowS
[StartRun] -> ShowS
StartRun -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRun] -> ShowS
$cshowList :: [StartRun] -> ShowS
show :: StartRun -> String
$cshow :: StartRun -> String
showsPrec :: Int -> StartRun -> ShowS
$cshowsPrec :: Int -> StartRun -> ShowS
Prelude.Show, forall x. Rep StartRun x -> StartRun
forall x. StartRun -> Rep StartRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartRun x -> StartRun
$cfrom :: forall x. StartRun -> Rep StartRun x
Prelude.Generic)

-- |
-- Create a value of 'StartRun' 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:
--
-- 'logLevel', 'startRun_logLevel' - A log level for the run.
--
-- 'name', 'startRun_name' - A name for the run.
--
-- 'outputUri', 'startRun_outputUri' - An output URI for the run.
--
-- 'parameters', 'startRun_parameters' - Parameters for the run.
--
-- 'priority', 'startRun_priority' - A priority for the run.
--
-- 'runGroupId', 'startRun_runGroupId' - The run\'s group ID.
--
-- 'runId', 'startRun_runId' - The run\'s ID.
--
-- 'storageCapacity', 'startRun_storageCapacity' - A storage capacity for the run.
--
-- 'tags', 'startRun_tags' - Tags for the run.
--
-- 'workflowId', 'startRun_workflowId' - The run\'s workflow ID.
--
-- 'workflowType', 'startRun_workflowType' - The run\'s workflows type.
--
-- 'requestId', 'startRun_requestId' - A request ID for the run.
--
-- 'roleArn', 'startRun_roleArn' - A service role for the run.
newStartRun ::
  -- | 'requestId'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  StartRun
newStartRun :: Text -> Text -> StartRun
newStartRun Text
pRequestId_ Text
pRoleArn_ =
  StartRun'
    { $sel:logLevel:StartRun' :: Maybe RunLogLevel
logLevel = forall a. Maybe a
Prelude.Nothing,
      $sel:name:StartRun' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:outputUri:StartRun' :: Maybe Text
outputUri = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:StartRun' :: Maybe RunParameters
parameters = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:StartRun' :: Maybe Natural
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:runGroupId:StartRun' :: Maybe Text
runGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:runId:StartRun' :: Maybe Text
runId = forall a. Maybe a
Prelude.Nothing,
      $sel:storageCapacity:StartRun' :: Maybe Natural
storageCapacity = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartRun' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:workflowId:StartRun' :: Maybe Text
workflowId = forall a. Maybe a
Prelude.Nothing,
      $sel:workflowType:StartRun' :: Maybe WorkflowType
workflowType = forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:StartRun' :: Text
requestId = Text
pRequestId_,
      $sel:roleArn:StartRun' :: Text
roleArn = Text
pRoleArn_
    }

-- | A log level for the run.
startRun_logLevel :: Lens.Lens' StartRun (Prelude.Maybe RunLogLevel)
startRun_logLevel :: Lens' StartRun (Maybe RunLogLevel)
startRun_logLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe RunLogLevel
logLevel :: Maybe RunLogLevel
$sel:logLevel:StartRun' :: StartRun -> Maybe RunLogLevel
logLevel} -> Maybe RunLogLevel
logLevel) (\s :: StartRun
s@StartRun' {} Maybe RunLogLevel
a -> StartRun
s {$sel:logLevel:StartRun' :: Maybe RunLogLevel
logLevel = Maybe RunLogLevel
a} :: StartRun)

-- | A name for the run.
startRun_name :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Text)
startRun_name :: Lens' StartRun (Maybe Text)
startRun_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Text
name :: Maybe Text
$sel:name:StartRun' :: StartRun -> Maybe Text
name} -> Maybe Text
name) (\s :: StartRun
s@StartRun' {} Maybe Text
a -> StartRun
s {$sel:name:StartRun' :: Maybe Text
name = Maybe Text
a} :: StartRun)

-- | An output URI for the run.
startRun_outputUri :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Text)
startRun_outputUri :: Lens' StartRun (Maybe Text)
startRun_outputUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Text
outputUri :: Maybe Text
$sel:outputUri:StartRun' :: StartRun -> Maybe Text
outputUri} -> Maybe Text
outputUri) (\s :: StartRun
s@StartRun' {} Maybe Text
a -> StartRun
s {$sel:outputUri:StartRun' :: Maybe Text
outputUri = Maybe Text
a} :: StartRun)

-- | Parameters for the run.
startRun_parameters :: Lens.Lens' StartRun (Prelude.Maybe RunParameters)
startRun_parameters :: Lens' StartRun (Maybe RunParameters)
startRun_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe RunParameters
parameters :: Maybe RunParameters
$sel:parameters:StartRun' :: StartRun -> Maybe RunParameters
parameters} -> Maybe RunParameters
parameters) (\s :: StartRun
s@StartRun' {} Maybe RunParameters
a -> StartRun
s {$sel:parameters:StartRun' :: Maybe RunParameters
parameters = Maybe RunParameters
a} :: StartRun)

-- | A priority for the run.
startRun_priority :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Natural)
startRun_priority :: Lens' StartRun (Maybe Natural)
startRun_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Natural
priority :: Maybe Natural
$sel:priority:StartRun' :: StartRun -> Maybe Natural
priority} -> Maybe Natural
priority) (\s :: StartRun
s@StartRun' {} Maybe Natural
a -> StartRun
s {$sel:priority:StartRun' :: Maybe Natural
priority = Maybe Natural
a} :: StartRun)

-- | The run\'s group ID.
startRun_runGroupId :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Text)
startRun_runGroupId :: Lens' StartRun (Maybe Text)
startRun_runGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Text
runGroupId :: Maybe Text
$sel:runGroupId:StartRun' :: StartRun -> Maybe Text
runGroupId} -> Maybe Text
runGroupId) (\s :: StartRun
s@StartRun' {} Maybe Text
a -> StartRun
s {$sel:runGroupId:StartRun' :: Maybe Text
runGroupId = Maybe Text
a} :: StartRun)

-- | The run\'s ID.
startRun_runId :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Text)
startRun_runId :: Lens' StartRun (Maybe Text)
startRun_runId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Text
runId :: Maybe Text
$sel:runId:StartRun' :: StartRun -> Maybe Text
runId} -> Maybe Text
runId) (\s :: StartRun
s@StartRun' {} Maybe Text
a -> StartRun
s {$sel:runId:StartRun' :: Maybe Text
runId = Maybe Text
a} :: StartRun)

-- | A storage capacity for the run.
startRun_storageCapacity :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Natural)
startRun_storageCapacity :: Lens' StartRun (Maybe Natural)
startRun_storageCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Natural
storageCapacity :: Maybe Natural
$sel:storageCapacity:StartRun' :: StartRun -> Maybe Natural
storageCapacity} -> Maybe Natural
storageCapacity) (\s :: StartRun
s@StartRun' {} Maybe Natural
a -> StartRun
s {$sel:storageCapacity:StartRun' :: Maybe Natural
storageCapacity = Maybe Natural
a} :: StartRun)

-- | Tags for the run.
startRun_tags :: Lens.Lens' StartRun (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startRun_tags :: Lens' StartRun (Maybe (HashMap Text Text))
startRun_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:StartRun' :: StartRun -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: StartRun
s@StartRun' {} Maybe (HashMap Text Text)
a -> StartRun
s {$sel:tags:StartRun' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: StartRun) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The run\'s workflow ID.
startRun_workflowId :: Lens.Lens' StartRun (Prelude.Maybe Prelude.Text)
startRun_workflowId :: Lens' StartRun (Maybe Text)
startRun_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe Text
workflowId :: Maybe Text
$sel:workflowId:StartRun' :: StartRun -> Maybe Text
workflowId} -> Maybe Text
workflowId) (\s :: StartRun
s@StartRun' {} Maybe Text
a -> StartRun
s {$sel:workflowId:StartRun' :: Maybe Text
workflowId = Maybe Text
a} :: StartRun)

-- | The run\'s workflows type.
startRun_workflowType :: Lens.Lens' StartRun (Prelude.Maybe WorkflowType)
startRun_workflowType :: Lens' StartRun (Maybe WorkflowType)
startRun_workflowType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Maybe WorkflowType
workflowType :: Maybe WorkflowType
$sel:workflowType:StartRun' :: StartRun -> Maybe WorkflowType
workflowType} -> Maybe WorkflowType
workflowType) (\s :: StartRun
s@StartRun' {} Maybe WorkflowType
a -> StartRun
s {$sel:workflowType:StartRun' :: Maybe WorkflowType
workflowType = Maybe WorkflowType
a} :: StartRun)

-- | A request ID for the run.
startRun_requestId :: Lens.Lens' StartRun Prelude.Text
startRun_requestId :: Lens' StartRun Text
startRun_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Text
requestId :: Text
$sel:requestId:StartRun' :: StartRun -> Text
requestId} -> Text
requestId) (\s :: StartRun
s@StartRun' {} Text
a -> StartRun
s {$sel:requestId:StartRun' :: Text
requestId = Text
a} :: StartRun)

-- | A service role for the run.
startRun_roleArn :: Lens.Lens' StartRun Prelude.Text
startRun_roleArn :: Lens' StartRun Text
startRun_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRun' {Text
roleArn :: Text
$sel:roleArn:StartRun' :: StartRun -> Text
roleArn} -> Text
roleArn) (\s :: StartRun
s@StartRun' {} Text
a -> StartRun
s {$sel:roleArn:StartRun' :: Text
roleArn = Text
a} :: StartRun)

instance Core.AWSRequest StartRun where
  type AWSResponse StartRun = StartRunResponse
  request :: (Service -> Service) -> StartRun -> Request StartRun
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartRun)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe RunStatus
-> Maybe (HashMap Text Text)
-> Int
-> StartRunResponse
StartRunResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable StartRun where
  hashWithSalt :: Int -> StartRun -> Int
hashWithSalt Int
_salt StartRun' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe RunLogLevel
Maybe RunParameters
Maybe WorkflowType
Text
roleArn :: Text
requestId :: Text
workflowType :: Maybe WorkflowType
workflowId :: Maybe Text
tags :: Maybe (HashMap Text Text)
storageCapacity :: Maybe Natural
runId :: Maybe Text
runGroupId :: Maybe Text
priority :: Maybe Natural
parameters :: Maybe RunParameters
outputUri :: Maybe Text
name :: Maybe Text
logLevel :: Maybe RunLogLevel
$sel:roleArn:StartRun' :: StartRun -> Text
$sel:requestId:StartRun' :: StartRun -> Text
$sel:workflowType:StartRun' :: StartRun -> Maybe WorkflowType
$sel:workflowId:StartRun' :: StartRun -> Maybe Text
$sel:tags:StartRun' :: StartRun -> Maybe (HashMap Text Text)
$sel:storageCapacity:StartRun' :: StartRun -> Maybe Natural
$sel:runId:StartRun' :: StartRun -> Maybe Text
$sel:runGroupId:StartRun' :: StartRun -> Maybe Text
$sel:priority:StartRun' :: StartRun -> Maybe Natural
$sel:parameters:StartRun' :: StartRun -> Maybe RunParameters
$sel:outputUri:StartRun' :: StartRun -> Maybe Text
$sel:name:StartRun' :: StartRun -> Maybe Text
$sel:logLevel:StartRun' :: StartRun -> Maybe RunLogLevel
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RunLogLevel
logLevel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputUri
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RunParameters
parameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
runGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
runId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
storageCapacity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workflowId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowType
workflowType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
requestId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData StartRun where
  rnf :: StartRun -> ()
rnf StartRun' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe RunLogLevel
Maybe RunParameters
Maybe WorkflowType
Text
roleArn :: Text
requestId :: Text
workflowType :: Maybe WorkflowType
workflowId :: Maybe Text
tags :: Maybe (HashMap Text Text)
storageCapacity :: Maybe Natural
runId :: Maybe Text
runGroupId :: Maybe Text
priority :: Maybe Natural
parameters :: Maybe RunParameters
outputUri :: Maybe Text
name :: Maybe Text
logLevel :: Maybe RunLogLevel
$sel:roleArn:StartRun' :: StartRun -> Text
$sel:requestId:StartRun' :: StartRun -> Text
$sel:workflowType:StartRun' :: StartRun -> Maybe WorkflowType
$sel:workflowId:StartRun' :: StartRun -> Maybe Text
$sel:tags:StartRun' :: StartRun -> Maybe (HashMap Text Text)
$sel:storageCapacity:StartRun' :: StartRun -> Maybe Natural
$sel:runId:StartRun' :: StartRun -> Maybe Text
$sel:runGroupId:StartRun' :: StartRun -> Maybe Text
$sel:priority:StartRun' :: StartRun -> Maybe Natural
$sel:parameters:StartRun' :: StartRun -> Maybe RunParameters
$sel:outputUri:StartRun' :: StartRun -> Maybe Text
$sel:name:StartRun' :: StartRun -> Maybe Text
$sel:logLevel:StartRun' :: StartRun -> Maybe RunLogLevel
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RunLogLevel
logLevel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RunParameters
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
runGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
runId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
storageCapacity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workflowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowType
workflowType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

instance Data.ToHeaders StartRun where
  toHeaders :: StartRun -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON StartRun where
  toJSON :: StartRun -> Value
toJSON StartRun' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe RunLogLevel
Maybe RunParameters
Maybe WorkflowType
Text
roleArn :: Text
requestId :: Text
workflowType :: Maybe WorkflowType
workflowId :: Maybe Text
tags :: Maybe (HashMap Text Text)
storageCapacity :: Maybe Natural
runId :: Maybe Text
runGroupId :: Maybe Text
priority :: Maybe Natural
parameters :: Maybe RunParameters
outputUri :: Maybe Text
name :: Maybe Text
logLevel :: Maybe RunLogLevel
$sel:roleArn:StartRun' :: StartRun -> Text
$sel:requestId:StartRun' :: StartRun -> Text
$sel:workflowType:StartRun' :: StartRun -> Maybe WorkflowType
$sel:workflowId:StartRun' :: StartRun -> Maybe Text
$sel:tags:StartRun' :: StartRun -> Maybe (HashMap Text Text)
$sel:storageCapacity:StartRun' :: StartRun -> Maybe Natural
$sel:runId:StartRun' :: StartRun -> Maybe Text
$sel:runGroupId:StartRun' :: StartRun -> Maybe Text
$sel:priority:StartRun' :: StartRun -> Maybe Natural
$sel:parameters:StartRun' :: StartRun -> Maybe RunParameters
$sel:outputUri:StartRun' :: StartRun -> Maybe Text
$sel:name:StartRun' :: StartRun -> Maybe Text
$sel:logLevel:StartRun' :: StartRun -> Maybe RunLogLevel
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"logLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RunLogLevel
logLevel,
            (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"outputUri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outputUri,
            (Key
"parameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RunParameters
parameters,
            (Key
"priority" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
priority,
            (Key
"runGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
runGroupId,
            (Key
"runId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
runId,
            (Key
"storageCapacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
storageCapacity,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            (Key
"workflowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
workflowId,
            (Key
"workflowType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkflowType
workflowType,
            forall a. a -> Maybe a
Prelude.Just (Key
"requestId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
requestId),
            forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
          ]
      )

instance Data.ToPath StartRun where
  toPath :: StartRun -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/run"

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

-- | /See:/ 'newStartRunResponse' smart constructor.
data StartRunResponse = StartRunResponse'
  { -- | The run\'s ARN.
    StartRunResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The run\'s ID.
    StartRunResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The run\'s status.
    StartRunResponse -> Maybe RunStatus
status :: Prelude.Maybe RunStatus,
    -- | The run\'s tags.
    StartRunResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    StartRunResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartRunResponse -> StartRunResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRunResponse -> StartRunResponse -> Bool
$c/= :: StartRunResponse -> StartRunResponse -> Bool
== :: StartRunResponse -> StartRunResponse -> Bool
$c== :: StartRunResponse -> StartRunResponse -> Bool
Prelude.Eq, ReadPrec [StartRunResponse]
ReadPrec StartRunResponse
Int -> ReadS StartRunResponse
ReadS [StartRunResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRunResponse]
$creadListPrec :: ReadPrec [StartRunResponse]
readPrec :: ReadPrec StartRunResponse
$creadPrec :: ReadPrec StartRunResponse
readList :: ReadS [StartRunResponse]
$creadList :: ReadS [StartRunResponse]
readsPrec :: Int -> ReadS StartRunResponse
$creadsPrec :: Int -> ReadS StartRunResponse
Prelude.Read, Int -> StartRunResponse -> ShowS
[StartRunResponse] -> ShowS
StartRunResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRunResponse] -> ShowS
$cshowList :: [StartRunResponse] -> ShowS
show :: StartRunResponse -> String
$cshow :: StartRunResponse -> String
showsPrec :: Int -> StartRunResponse -> ShowS
$cshowsPrec :: Int -> StartRunResponse -> ShowS
Prelude.Show, forall x. Rep StartRunResponse x -> StartRunResponse
forall x. StartRunResponse -> Rep StartRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartRunResponse x -> StartRunResponse
$cfrom :: forall x. StartRunResponse -> Rep StartRunResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartRunResponse' 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:
--
-- 'arn', 'startRunResponse_arn' - The run\'s ARN.
--
-- 'id', 'startRunResponse_id' - The run\'s ID.
--
-- 'status', 'startRunResponse_status' - The run\'s status.
--
-- 'tags', 'startRunResponse_tags' - The run\'s tags.
--
-- 'httpStatus', 'startRunResponse_httpStatus' - The response's http status code.
newStartRunResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartRunResponse
newStartRunResponse :: Int -> StartRunResponse
newStartRunResponse Int
pHttpStatus_ =
  StartRunResponse'
    { $sel:arn:StartRunResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:StartRunResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:status:StartRunResponse' :: Maybe RunStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StartRunResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartRunResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The run\'s ARN.
startRunResponse_arn :: Lens.Lens' StartRunResponse (Prelude.Maybe Prelude.Text)
startRunResponse_arn :: Lens' StartRunResponse (Maybe Text)
startRunResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRunResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:StartRunResponse' :: StartRunResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: StartRunResponse
s@StartRunResponse' {} Maybe Text
a -> StartRunResponse
s {$sel:arn:StartRunResponse' :: Maybe Text
arn = Maybe Text
a} :: StartRunResponse)

-- | The run\'s ID.
startRunResponse_id :: Lens.Lens' StartRunResponse (Prelude.Maybe Prelude.Text)
startRunResponse_id :: Lens' StartRunResponse (Maybe Text)
startRunResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRunResponse' {Maybe Text
id :: Maybe Text
$sel:id:StartRunResponse' :: StartRunResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: StartRunResponse
s@StartRunResponse' {} Maybe Text
a -> StartRunResponse
s {$sel:id:StartRunResponse' :: Maybe Text
id = Maybe Text
a} :: StartRunResponse)

-- | The run\'s status.
startRunResponse_status :: Lens.Lens' StartRunResponse (Prelude.Maybe RunStatus)
startRunResponse_status :: Lens' StartRunResponse (Maybe RunStatus)
startRunResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRunResponse' {Maybe RunStatus
status :: Maybe RunStatus
$sel:status:StartRunResponse' :: StartRunResponse -> Maybe RunStatus
status} -> Maybe RunStatus
status) (\s :: StartRunResponse
s@StartRunResponse' {} Maybe RunStatus
a -> StartRunResponse
s {$sel:status:StartRunResponse' :: Maybe RunStatus
status = Maybe RunStatus
a} :: StartRunResponse)

-- | The run\'s tags.
startRunResponse_tags :: Lens.Lens' StartRunResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startRunResponse_tags :: Lens' StartRunResponse (Maybe (HashMap Text Text))
startRunResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRunResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:StartRunResponse' :: StartRunResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: StartRunResponse
s@StartRunResponse' {} Maybe (HashMap Text Text)
a -> StartRunResponse
s {$sel:tags:StartRunResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: StartRunResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData StartRunResponse where
  rnf :: StartRunResponse -> ()
rnf StartRunResponse' {Int
Maybe Text
Maybe (HashMap Text Text)
Maybe RunStatus
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
status :: Maybe RunStatus
id :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:StartRunResponse' :: StartRunResponse -> Int
$sel:tags:StartRunResponse' :: StartRunResponse -> Maybe (HashMap Text Text)
$sel:status:StartRunResponse' :: StartRunResponse -> Maybe RunStatus
$sel:id:StartRunResponse' :: StartRunResponse -> Maybe Text
$sel:arn:StartRunResponse' :: StartRunResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RunStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus