{-# 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.Glue.UpdateWorkflow
(
UpdateWorkflow (..),
newUpdateWorkflow,
updateWorkflow_defaultRunProperties,
updateWorkflow_description,
updateWorkflow_maxConcurrentRuns,
updateWorkflow_name,
UpdateWorkflowResponse (..),
newUpdateWorkflowResponse,
updateWorkflowResponse_name,
updateWorkflowResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateWorkflow = UpdateWorkflow'
{
UpdateWorkflow -> Maybe (HashMap Text Text)
defaultRunProperties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateWorkflow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateWorkflow -> Maybe Int
maxConcurrentRuns :: Prelude.Maybe Prelude.Int,
UpdateWorkflow -> Text
name :: Prelude.Text
}
deriving (UpdateWorkflow -> UpdateWorkflow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkflow -> UpdateWorkflow -> Bool
$c/= :: UpdateWorkflow -> UpdateWorkflow -> Bool
== :: UpdateWorkflow -> UpdateWorkflow -> Bool
$c== :: UpdateWorkflow -> UpdateWorkflow -> Bool
Prelude.Eq, ReadPrec [UpdateWorkflow]
ReadPrec UpdateWorkflow
Int -> ReadS UpdateWorkflow
ReadS [UpdateWorkflow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWorkflow]
$creadListPrec :: ReadPrec [UpdateWorkflow]
readPrec :: ReadPrec UpdateWorkflow
$creadPrec :: ReadPrec UpdateWorkflow
readList :: ReadS [UpdateWorkflow]
$creadList :: ReadS [UpdateWorkflow]
readsPrec :: Int -> ReadS UpdateWorkflow
$creadsPrec :: Int -> ReadS UpdateWorkflow
Prelude.Read, Int -> UpdateWorkflow -> ShowS
[UpdateWorkflow] -> ShowS
UpdateWorkflow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkflow] -> ShowS
$cshowList :: [UpdateWorkflow] -> ShowS
show :: UpdateWorkflow -> String
$cshow :: UpdateWorkflow -> String
showsPrec :: Int -> UpdateWorkflow -> ShowS
$cshowsPrec :: Int -> UpdateWorkflow -> ShowS
Prelude.Show, forall x. Rep UpdateWorkflow x -> UpdateWorkflow
forall x. UpdateWorkflow -> Rep UpdateWorkflow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWorkflow x -> UpdateWorkflow
$cfrom :: forall x. UpdateWorkflow -> Rep UpdateWorkflow x
Prelude.Generic)
newUpdateWorkflow ::
Prelude.Text ->
UpdateWorkflow
newUpdateWorkflow :: Text -> UpdateWorkflow
newUpdateWorkflow Text
pName_ =
UpdateWorkflow'
{ $sel:defaultRunProperties:UpdateWorkflow' :: Maybe (HashMap Text Text)
defaultRunProperties =
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateWorkflow' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:maxConcurrentRuns:UpdateWorkflow' :: Maybe Int
maxConcurrentRuns = forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateWorkflow' :: Text
name = Text
pName_
}
updateWorkflow_defaultRunProperties :: Lens.Lens' UpdateWorkflow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateWorkflow_defaultRunProperties :: Lens' UpdateWorkflow (Maybe (HashMap Text Text))
updateWorkflow_defaultRunProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkflow' {Maybe (HashMap Text Text)
defaultRunProperties :: Maybe (HashMap Text Text)
$sel:defaultRunProperties:UpdateWorkflow' :: UpdateWorkflow -> Maybe (HashMap Text Text)
defaultRunProperties} -> Maybe (HashMap Text Text)
defaultRunProperties) (\s :: UpdateWorkflow
s@UpdateWorkflow' {} Maybe (HashMap Text Text)
a -> UpdateWorkflow
s {$sel:defaultRunProperties:UpdateWorkflow' :: Maybe (HashMap Text Text)
defaultRunProperties = Maybe (HashMap Text Text)
a} :: UpdateWorkflow) 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
updateWorkflow_description :: Lens.Lens' UpdateWorkflow (Prelude.Maybe Prelude.Text)
updateWorkflow_description :: Lens' UpdateWorkflow (Maybe Text)
updateWorkflow_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkflow' {Maybe Text
description :: Maybe Text
$sel:description:UpdateWorkflow' :: UpdateWorkflow -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateWorkflow
s@UpdateWorkflow' {} Maybe Text
a -> UpdateWorkflow
s {$sel:description:UpdateWorkflow' :: Maybe Text
description = Maybe Text
a} :: UpdateWorkflow)
updateWorkflow_maxConcurrentRuns :: Lens.Lens' UpdateWorkflow (Prelude.Maybe Prelude.Int)
updateWorkflow_maxConcurrentRuns :: Lens' UpdateWorkflow (Maybe Int)
updateWorkflow_maxConcurrentRuns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkflow' {Maybe Int
maxConcurrentRuns :: Maybe Int
$sel:maxConcurrentRuns:UpdateWorkflow' :: UpdateWorkflow -> Maybe Int
maxConcurrentRuns} -> Maybe Int
maxConcurrentRuns) (\s :: UpdateWorkflow
s@UpdateWorkflow' {} Maybe Int
a -> UpdateWorkflow
s {$sel:maxConcurrentRuns:UpdateWorkflow' :: Maybe Int
maxConcurrentRuns = Maybe Int
a} :: UpdateWorkflow)
updateWorkflow_name :: Lens.Lens' UpdateWorkflow Prelude.Text
updateWorkflow_name :: Lens' UpdateWorkflow Text
updateWorkflow_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkflow' {Text
name :: Text
$sel:name:UpdateWorkflow' :: UpdateWorkflow -> Text
name} -> Text
name) (\s :: UpdateWorkflow
s@UpdateWorkflow' {} Text
a -> UpdateWorkflow
s {$sel:name:UpdateWorkflow' :: Text
name = Text
a} :: UpdateWorkflow)
instance Core.AWSRequest UpdateWorkflow where
type
AWSResponse UpdateWorkflow =
UpdateWorkflowResponse
request :: (Service -> Service) -> UpdateWorkflow -> Request UpdateWorkflow
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 UpdateWorkflow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateWorkflow)))
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 -> Int -> UpdateWorkflowResponse
UpdateWorkflowResponse'
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
"Name")
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 UpdateWorkflow where
hashWithSalt :: Int -> UpdateWorkflow -> Int
hashWithSalt Int
_salt UpdateWorkflow' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
name :: Text
maxConcurrentRuns :: Maybe Int
description :: Maybe Text
defaultRunProperties :: Maybe (HashMap Text Text)
$sel:name:UpdateWorkflow' :: UpdateWorkflow -> Text
$sel:maxConcurrentRuns:UpdateWorkflow' :: UpdateWorkflow -> Maybe Int
$sel:description:UpdateWorkflow' :: UpdateWorkflow -> Maybe Text
$sel:defaultRunProperties:UpdateWorkflow' :: UpdateWorkflow -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
defaultRunProperties
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxConcurrentRuns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData UpdateWorkflow where
rnf :: UpdateWorkflow -> ()
rnf UpdateWorkflow' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
name :: Text
maxConcurrentRuns :: Maybe Int
description :: Maybe Text
defaultRunProperties :: Maybe (HashMap Text Text)
$sel:name:UpdateWorkflow' :: UpdateWorkflow -> Text
$sel:maxConcurrentRuns:UpdateWorkflow' :: UpdateWorkflow -> Maybe Int
$sel:description:UpdateWorkflow' :: UpdateWorkflow -> Maybe Text
$sel:defaultRunProperties:UpdateWorkflow' :: UpdateWorkflow -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
defaultRunProperties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxConcurrentRuns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders UpdateWorkflow where
toHeaders :: UpdateWorkflow -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AWSGlue.UpdateWorkflow" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateWorkflow where
toJSON :: UpdateWorkflow -> Value
toJSON UpdateWorkflow' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
name :: Text
maxConcurrentRuns :: Maybe Int
description :: Maybe Text
defaultRunProperties :: Maybe (HashMap Text Text)
$sel:name:UpdateWorkflow' :: UpdateWorkflow -> Text
$sel:maxConcurrentRuns:UpdateWorkflow' :: UpdateWorkflow -> Maybe Int
$sel:description:UpdateWorkflow' :: UpdateWorkflow -> Maybe Text
$sel:defaultRunProperties:UpdateWorkflow' :: UpdateWorkflow -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DefaultRunProperties" 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)
defaultRunProperties,
(Key
"Description" 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
description,
(Key
"MaxConcurrentRuns" 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 Int
maxConcurrentRuns,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)
instance Data.ToPath UpdateWorkflow where
toPath :: UpdateWorkflow -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateWorkflow where
toQuery :: UpdateWorkflow -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateWorkflowResponse = UpdateWorkflowResponse'
{
UpdateWorkflowResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateWorkflowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateWorkflowResponse -> UpdateWorkflowResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWorkflowResponse -> UpdateWorkflowResponse -> Bool
$c/= :: UpdateWorkflowResponse -> UpdateWorkflowResponse -> Bool
== :: UpdateWorkflowResponse -> UpdateWorkflowResponse -> Bool
$c== :: UpdateWorkflowResponse -> UpdateWorkflowResponse -> Bool
Prelude.Eq, ReadPrec [UpdateWorkflowResponse]
ReadPrec UpdateWorkflowResponse
Int -> ReadS UpdateWorkflowResponse
ReadS [UpdateWorkflowResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWorkflowResponse]
$creadListPrec :: ReadPrec [UpdateWorkflowResponse]
readPrec :: ReadPrec UpdateWorkflowResponse
$creadPrec :: ReadPrec UpdateWorkflowResponse
readList :: ReadS [UpdateWorkflowResponse]
$creadList :: ReadS [UpdateWorkflowResponse]
readsPrec :: Int -> ReadS UpdateWorkflowResponse
$creadsPrec :: Int -> ReadS UpdateWorkflowResponse
Prelude.Read, Int -> UpdateWorkflowResponse -> ShowS
[UpdateWorkflowResponse] -> ShowS
UpdateWorkflowResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWorkflowResponse] -> ShowS
$cshowList :: [UpdateWorkflowResponse] -> ShowS
show :: UpdateWorkflowResponse -> String
$cshow :: UpdateWorkflowResponse -> String
showsPrec :: Int -> UpdateWorkflowResponse -> ShowS
$cshowsPrec :: Int -> UpdateWorkflowResponse -> ShowS
Prelude.Show, forall x. Rep UpdateWorkflowResponse x -> UpdateWorkflowResponse
forall x. UpdateWorkflowResponse -> Rep UpdateWorkflowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWorkflowResponse x -> UpdateWorkflowResponse
$cfrom :: forall x. UpdateWorkflowResponse -> Rep UpdateWorkflowResponse x
Prelude.Generic)
newUpdateWorkflowResponse ::
Prelude.Int ->
UpdateWorkflowResponse
newUpdateWorkflowResponse :: Int -> UpdateWorkflowResponse
newUpdateWorkflowResponse Int
pHttpStatus_ =
UpdateWorkflowResponse'
{ $sel:name:UpdateWorkflowResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateWorkflowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateWorkflowResponse_name :: Lens.Lens' UpdateWorkflowResponse (Prelude.Maybe Prelude.Text)
updateWorkflowResponse_name :: Lens' UpdateWorkflowResponse (Maybe Text)
updateWorkflowResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkflowResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateWorkflowResponse' :: UpdateWorkflowResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateWorkflowResponse
s@UpdateWorkflowResponse' {} Maybe Text
a -> UpdateWorkflowResponse
s {$sel:name:UpdateWorkflowResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateWorkflowResponse)
updateWorkflowResponse_httpStatus :: Lens.Lens' UpdateWorkflowResponse Prelude.Int
updateWorkflowResponse_httpStatus :: Lens' UpdateWorkflowResponse Int
updateWorkflowResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWorkflowResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateWorkflowResponse' :: UpdateWorkflowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateWorkflowResponse
s@UpdateWorkflowResponse' {} Int
a -> UpdateWorkflowResponse
s {$sel:httpStatus:UpdateWorkflowResponse' :: Int
httpStatus = Int
a} :: UpdateWorkflowResponse)
instance Prelude.NFData UpdateWorkflowResponse where
rnf :: UpdateWorkflowResponse -> ()
rnf UpdateWorkflowResponse' {Int
Maybe Text
httpStatus :: Int
name :: Maybe Text
$sel:httpStatus:UpdateWorkflowResponse' :: UpdateWorkflowResponse -> Int
$sel:name:UpdateWorkflowResponse' :: UpdateWorkflowResponse -> Maybe Text
..} =
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 Int
httpStatus