{-# 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.Glue.CreateWorkflow
-- 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)
--
-- Creates a new workflow.
module Amazonka.Glue.CreateWorkflow
  ( -- * Creating a Request
    CreateWorkflow (..),
    newCreateWorkflow,

    -- * Request Lenses
    createWorkflow_maxConcurrentRuns,
    createWorkflow_defaultRunProperties,
    createWorkflow_description,
    createWorkflow_tags,
    createWorkflow_name,

    -- * Destructuring the Response
    CreateWorkflowResponse (..),
    newCreateWorkflowResponse,

    -- * Response Lenses
    createWorkflowResponse_name,
    createWorkflowResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateWorkflow' smart constructor.
data CreateWorkflow = CreateWorkflow'
  { -- | You can use this parameter to prevent unwanted multiple updates to data,
    -- to control costs, or in some cases, to prevent exceeding the maximum
    -- number of concurrent runs of any of the component jobs. If you leave
    -- this parameter blank, there is no limit to the number of concurrent
    -- workflow runs.
    CreateWorkflow -> Maybe Int
maxConcurrentRuns :: Prelude.Maybe Prelude.Int,
    -- | A collection of properties to be used as part of each execution of the
    -- workflow.
    CreateWorkflow -> Maybe (HashMap Text Text)
defaultRunProperties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A description of the workflow.
    CreateWorkflow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to be used with this workflow.
    CreateWorkflow -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name to be assigned to the workflow. It should be unique within your
    -- account.
    CreateWorkflow -> Text
name :: Prelude.Text
  }
  deriving (CreateWorkflow -> CreateWorkflow -> Bool
(CreateWorkflow -> CreateWorkflow -> Bool)
-> (CreateWorkflow -> CreateWorkflow -> Bool) -> Eq CreateWorkflow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkflow -> CreateWorkflow -> Bool
$c/= :: CreateWorkflow -> CreateWorkflow -> Bool
== :: CreateWorkflow -> CreateWorkflow -> Bool
$c== :: CreateWorkflow -> CreateWorkflow -> Bool
Prelude.Eq, ReadPrec [CreateWorkflow]
ReadPrec CreateWorkflow
Int -> ReadS CreateWorkflow
ReadS [CreateWorkflow]
(Int -> ReadS CreateWorkflow)
-> ReadS [CreateWorkflow]
-> ReadPrec CreateWorkflow
-> ReadPrec [CreateWorkflow]
-> Read CreateWorkflow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkflow]
$creadListPrec :: ReadPrec [CreateWorkflow]
readPrec :: ReadPrec CreateWorkflow
$creadPrec :: ReadPrec CreateWorkflow
readList :: ReadS [CreateWorkflow]
$creadList :: ReadS [CreateWorkflow]
readsPrec :: Int -> ReadS CreateWorkflow
$creadsPrec :: Int -> ReadS CreateWorkflow
Prelude.Read, Int -> CreateWorkflow -> ShowS
[CreateWorkflow] -> ShowS
CreateWorkflow -> String
(Int -> CreateWorkflow -> ShowS)
-> (CreateWorkflow -> String)
-> ([CreateWorkflow] -> ShowS)
-> Show CreateWorkflow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkflow] -> ShowS
$cshowList :: [CreateWorkflow] -> ShowS
show :: CreateWorkflow -> String
$cshow :: CreateWorkflow -> String
showsPrec :: Int -> CreateWorkflow -> ShowS
$cshowsPrec :: Int -> CreateWorkflow -> ShowS
Prelude.Show, (forall x. CreateWorkflow -> Rep CreateWorkflow x)
-> (forall x. Rep CreateWorkflow x -> CreateWorkflow)
-> Generic CreateWorkflow
forall x. Rep CreateWorkflow x -> CreateWorkflow
forall x. CreateWorkflow -> Rep CreateWorkflow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkflow x -> CreateWorkflow
$cfrom :: forall x. CreateWorkflow -> Rep CreateWorkflow x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkflow' 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:
--
-- 'maxConcurrentRuns', 'createWorkflow_maxConcurrentRuns' - You can use this parameter to prevent unwanted multiple updates to data,
-- to control costs, or in some cases, to prevent exceeding the maximum
-- number of concurrent runs of any of the component jobs. If you leave
-- this parameter blank, there is no limit to the number of concurrent
-- workflow runs.
--
-- 'defaultRunProperties', 'createWorkflow_defaultRunProperties' - A collection of properties to be used as part of each execution of the
-- workflow.
--
-- 'description', 'createWorkflow_description' - A description of the workflow.
--
-- 'tags', 'createWorkflow_tags' - The tags to be used with this workflow.
--
-- 'name', 'createWorkflow_name' - The name to be assigned to the workflow. It should be unique within your
-- account.
newCreateWorkflow ::
  -- | 'name'
  Prelude.Text ->
  CreateWorkflow
newCreateWorkflow :: Text -> CreateWorkflow
newCreateWorkflow Text
pName_ =
  CreateWorkflow' :: Maybe Int
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> CreateWorkflow
CreateWorkflow'
    { $sel:maxConcurrentRuns:CreateWorkflow' :: Maybe Int
maxConcurrentRuns =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRunProperties:CreateWorkflow' :: Maybe (HashMap Text Text)
defaultRunProperties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateWorkflow' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorkflow' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateWorkflow' :: Text
name = Text
pName_
    }

-- | You can use this parameter to prevent unwanted multiple updates to data,
-- to control costs, or in some cases, to prevent exceeding the maximum
-- number of concurrent runs of any of the component jobs. If you leave
-- this parameter blank, there is no limit to the number of concurrent
-- workflow runs.
createWorkflow_maxConcurrentRuns :: Lens.Lens' CreateWorkflow (Prelude.Maybe Prelude.Int)
createWorkflow_maxConcurrentRuns :: (Maybe Int -> f (Maybe Int)) -> CreateWorkflow -> f CreateWorkflow
createWorkflow_maxConcurrentRuns = (CreateWorkflow -> Maybe Int)
-> (CreateWorkflow -> Maybe Int -> CreateWorkflow)
-> Lens CreateWorkflow CreateWorkflow (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflow' {Maybe Int
maxConcurrentRuns :: Maybe Int
$sel:maxConcurrentRuns:CreateWorkflow' :: CreateWorkflow -> Maybe Int
maxConcurrentRuns} -> Maybe Int
maxConcurrentRuns) (\s :: CreateWorkflow
s@CreateWorkflow' {} Maybe Int
a -> CreateWorkflow
s {$sel:maxConcurrentRuns:CreateWorkflow' :: Maybe Int
maxConcurrentRuns = Maybe Int
a} :: CreateWorkflow)

-- | A collection of properties to be used as part of each execution of the
-- workflow.
createWorkflow_defaultRunProperties :: Lens.Lens' CreateWorkflow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorkflow_defaultRunProperties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkflow -> f CreateWorkflow
createWorkflow_defaultRunProperties = (CreateWorkflow -> Maybe (HashMap Text Text))
-> (CreateWorkflow -> Maybe (HashMap Text Text) -> CreateWorkflow)
-> Lens
     CreateWorkflow
     CreateWorkflow
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflow' {Maybe (HashMap Text Text)
defaultRunProperties :: Maybe (HashMap Text Text)
$sel:defaultRunProperties:CreateWorkflow' :: CreateWorkflow -> Maybe (HashMap Text Text)
defaultRunProperties} -> Maybe (HashMap Text Text)
defaultRunProperties) (\s :: CreateWorkflow
s@CreateWorkflow' {} Maybe (HashMap Text Text)
a -> CreateWorkflow
s {$sel:defaultRunProperties:CreateWorkflow' :: Maybe (HashMap Text Text)
defaultRunProperties = Maybe (HashMap Text Text)
a} :: CreateWorkflow) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorkflow -> f CreateWorkflow)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkflow
-> f CreateWorkflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of the workflow.
createWorkflow_description :: Lens.Lens' CreateWorkflow (Prelude.Maybe Prelude.Text)
createWorkflow_description :: (Maybe Text -> f (Maybe Text))
-> CreateWorkflow -> f CreateWorkflow
createWorkflow_description = (CreateWorkflow -> Maybe Text)
-> (CreateWorkflow -> Maybe Text -> CreateWorkflow)
-> Lens CreateWorkflow CreateWorkflow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflow' {Maybe Text
description :: Maybe Text
$sel:description:CreateWorkflow' :: CreateWorkflow -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateWorkflow
s@CreateWorkflow' {} Maybe Text
a -> CreateWorkflow
s {$sel:description:CreateWorkflow' :: Maybe Text
description = Maybe Text
a} :: CreateWorkflow)

-- | The tags to be used with this workflow.
createWorkflow_tags :: Lens.Lens' CreateWorkflow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorkflow_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkflow -> f CreateWorkflow
createWorkflow_tags = (CreateWorkflow -> Maybe (HashMap Text Text))
-> (CreateWorkflow -> Maybe (HashMap Text Text) -> CreateWorkflow)
-> Lens
     CreateWorkflow
     CreateWorkflow
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflow' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorkflow' :: CreateWorkflow -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorkflow
s@CreateWorkflow' {} Maybe (HashMap Text Text)
a -> CreateWorkflow
s {$sel:tags:CreateWorkflow' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorkflow) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorkflow -> f CreateWorkflow)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkflow
-> f CreateWorkflow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name to be assigned to the workflow. It should be unique within your
-- account.
createWorkflow_name :: Lens.Lens' CreateWorkflow Prelude.Text
createWorkflow_name :: (Text -> f Text) -> CreateWorkflow -> f CreateWorkflow
createWorkflow_name = (CreateWorkflow -> Text)
-> (CreateWorkflow -> Text -> CreateWorkflow)
-> Lens CreateWorkflow CreateWorkflow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflow' {Text
name :: Text
$sel:name:CreateWorkflow' :: CreateWorkflow -> Text
name} -> Text
name) (\s :: CreateWorkflow
s@CreateWorkflow' {} Text
a -> CreateWorkflow
s {$sel:name:CreateWorkflow' :: Text
name = Text
a} :: CreateWorkflow)

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

instance Prelude.NFData CreateWorkflow

instance Core.ToHeaders CreateWorkflow where
  toHeaders :: CreateWorkflow -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkflow -> 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
"AWSGlue.CreateWorkflow" :: 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 CreateWorkflow where
  toJSON :: CreateWorkflow -> Value
toJSON CreateWorkflow' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
defaultRunProperties :: Maybe (HashMap Text Text)
maxConcurrentRuns :: Maybe Int
$sel:name:CreateWorkflow' :: CreateWorkflow -> Text
$sel:tags:CreateWorkflow' :: CreateWorkflow -> Maybe (HashMap Text Text)
$sel:description:CreateWorkflow' :: CreateWorkflow -> Maybe Text
$sel:defaultRunProperties:CreateWorkflow' :: CreateWorkflow -> Maybe (HashMap Text Text)
$sel:maxConcurrentRuns:CreateWorkflow' :: CreateWorkflow -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MaxConcurrentRuns" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxConcurrentRuns,
            (Text
"DefaultRunProperties" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
defaultRunProperties,
            (Text
"Description" 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
description,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newCreateWorkflowResponse' smart constructor.
data CreateWorkflowResponse = CreateWorkflowResponse'
  { -- | The name of the workflow which was provided as part of the request.
    CreateWorkflowResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWorkflowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorkflowResponse -> CreateWorkflowResponse -> Bool
(CreateWorkflowResponse -> CreateWorkflowResponse -> Bool)
-> (CreateWorkflowResponse -> CreateWorkflowResponse -> Bool)
-> Eq CreateWorkflowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkflowResponse -> CreateWorkflowResponse -> Bool
$c/= :: CreateWorkflowResponse -> CreateWorkflowResponse -> Bool
== :: CreateWorkflowResponse -> CreateWorkflowResponse -> Bool
$c== :: CreateWorkflowResponse -> CreateWorkflowResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkflowResponse]
ReadPrec CreateWorkflowResponse
Int -> ReadS CreateWorkflowResponse
ReadS [CreateWorkflowResponse]
(Int -> ReadS CreateWorkflowResponse)
-> ReadS [CreateWorkflowResponse]
-> ReadPrec CreateWorkflowResponse
-> ReadPrec [CreateWorkflowResponse]
-> Read CreateWorkflowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkflowResponse]
$creadListPrec :: ReadPrec [CreateWorkflowResponse]
readPrec :: ReadPrec CreateWorkflowResponse
$creadPrec :: ReadPrec CreateWorkflowResponse
readList :: ReadS [CreateWorkflowResponse]
$creadList :: ReadS [CreateWorkflowResponse]
readsPrec :: Int -> ReadS CreateWorkflowResponse
$creadsPrec :: Int -> ReadS CreateWorkflowResponse
Prelude.Read, Int -> CreateWorkflowResponse -> ShowS
[CreateWorkflowResponse] -> ShowS
CreateWorkflowResponse -> String
(Int -> CreateWorkflowResponse -> ShowS)
-> (CreateWorkflowResponse -> String)
-> ([CreateWorkflowResponse] -> ShowS)
-> Show CreateWorkflowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkflowResponse] -> ShowS
$cshowList :: [CreateWorkflowResponse] -> ShowS
show :: CreateWorkflowResponse -> String
$cshow :: CreateWorkflowResponse -> String
showsPrec :: Int -> CreateWorkflowResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkflowResponse -> ShowS
Prelude.Show, (forall x. CreateWorkflowResponse -> Rep CreateWorkflowResponse x)
-> (forall x.
    Rep CreateWorkflowResponse x -> CreateWorkflowResponse)
-> Generic CreateWorkflowResponse
forall x. Rep CreateWorkflowResponse x -> CreateWorkflowResponse
forall x. CreateWorkflowResponse -> Rep CreateWorkflowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkflowResponse x -> CreateWorkflowResponse
$cfrom :: forall x. CreateWorkflowResponse -> Rep CreateWorkflowResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkflowResponse' 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:
--
-- 'name', 'createWorkflowResponse_name' - The name of the workflow which was provided as part of the request.
--
-- 'httpStatus', 'createWorkflowResponse_httpStatus' - The response's http status code.
newCreateWorkflowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorkflowResponse
newCreateWorkflowResponse :: Int -> CreateWorkflowResponse
newCreateWorkflowResponse Int
pHttpStatus_ =
  CreateWorkflowResponse' :: Maybe Text -> Int -> CreateWorkflowResponse
CreateWorkflowResponse'
    { $sel:name:CreateWorkflowResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorkflowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the workflow which was provided as part of the request.
createWorkflowResponse_name :: Lens.Lens' CreateWorkflowResponse (Prelude.Maybe Prelude.Text)
createWorkflowResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateWorkflowResponse -> f CreateWorkflowResponse
createWorkflowResponse_name = (CreateWorkflowResponse -> Maybe Text)
-> (CreateWorkflowResponse -> Maybe Text -> CreateWorkflowResponse)
-> Lens
     CreateWorkflowResponse
     CreateWorkflowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkflowResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateWorkflowResponse' :: CreateWorkflowResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateWorkflowResponse
s@CreateWorkflowResponse' {} Maybe Text
a -> CreateWorkflowResponse
s {$sel:name:CreateWorkflowResponse' :: Maybe Text
name = Maybe Text
a} :: CreateWorkflowResponse)

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

instance Prelude.NFData CreateWorkflowResponse