{-# 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.GetWorkflowRuns
(
GetWorkflowRuns (..),
newGetWorkflowRuns,
getWorkflowRuns_includeGraph,
getWorkflowRuns_maxResults,
getWorkflowRuns_nextToken,
getWorkflowRuns_name,
GetWorkflowRunsResponse (..),
newGetWorkflowRunsResponse,
getWorkflowRunsResponse_nextToken,
getWorkflowRunsResponse_runs,
getWorkflowRunsResponse_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 GetWorkflowRuns = GetWorkflowRuns'
{
GetWorkflowRuns -> Maybe Bool
includeGraph :: Prelude.Maybe Prelude.Bool,
GetWorkflowRuns -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
GetWorkflowRuns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetWorkflowRuns -> Text
name :: Prelude.Text
}
deriving (GetWorkflowRuns -> GetWorkflowRuns -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkflowRuns -> GetWorkflowRuns -> Bool
$c/= :: GetWorkflowRuns -> GetWorkflowRuns -> Bool
== :: GetWorkflowRuns -> GetWorkflowRuns -> Bool
$c== :: GetWorkflowRuns -> GetWorkflowRuns -> Bool
Prelude.Eq, ReadPrec [GetWorkflowRuns]
ReadPrec GetWorkflowRuns
Int -> ReadS GetWorkflowRuns
ReadS [GetWorkflowRuns]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWorkflowRuns]
$creadListPrec :: ReadPrec [GetWorkflowRuns]
readPrec :: ReadPrec GetWorkflowRuns
$creadPrec :: ReadPrec GetWorkflowRuns
readList :: ReadS [GetWorkflowRuns]
$creadList :: ReadS [GetWorkflowRuns]
readsPrec :: Int -> ReadS GetWorkflowRuns
$creadsPrec :: Int -> ReadS GetWorkflowRuns
Prelude.Read, Int -> GetWorkflowRuns -> ShowS
[GetWorkflowRuns] -> ShowS
GetWorkflowRuns -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkflowRuns] -> ShowS
$cshowList :: [GetWorkflowRuns] -> ShowS
show :: GetWorkflowRuns -> String
$cshow :: GetWorkflowRuns -> String
showsPrec :: Int -> GetWorkflowRuns -> ShowS
$cshowsPrec :: Int -> GetWorkflowRuns -> ShowS
Prelude.Show, forall x. Rep GetWorkflowRuns x -> GetWorkflowRuns
forall x. GetWorkflowRuns -> Rep GetWorkflowRuns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkflowRuns x -> GetWorkflowRuns
$cfrom :: forall x. GetWorkflowRuns -> Rep GetWorkflowRuns x
Prelude.Generic)
newGetWorkflowRuns ::
Prelude.Text ->
GetWorkflowRuns
newGetWorkflowRuns :: Text -> GetWorkflowRuns
newGetWorkflowRuns Text
pName_ =
GetWorkflowRuns'
{ $sel:includeGraph:GetWorkflowRuns' :: Maybe Bool
includeGraph = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetWorkflowRuns' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetWorkflowRuns' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:name:GetWorkflowRuns' :: Text
name = Text
pName_
}
getWorkflowRuns_includeGraph :: Lens.Lens' GetWorkflowRuns (Prelude.Maybe Prelude.Bool)
getWorkflowRuns_includeGraph :: Lens' GetWorkflowRuns (Maybe Bool)
getWorkflowRuns_includeGraph = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRuns' {Maybe Bool
includeGraph :: Maybe Bool
$sel:includeGraph:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Bool
includeGraph} -> Maybe Bool
includeGraph) (\s :: GetWorkflowRuns
s@GetWorkflowRuns' {} Maybe Bool
a -> GetWorkflowRuns
s {$sel:includeGraph:GetWorkflowRuns' :: Maybe Bool
includeGraph = Maybe Bool
a} :: GetWorkflowRuns)
getWorkflowRuns_maxResults :: Lens.Lens' GetWorkflowRuns (Prelude.Maybe Prelude.Natural)
getWorkflowRuns_maxResults :: Lens' GetWorkflowRuns (Maybe Natural)
getWorkflowRuns_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRuns' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetWorkflowRuns
s@GetWorkflowRuns' {} Maybe Natural
a -> GetWorkflowRuns
s {$sel:maxResults:GetWorkflowRuns' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetWorkflowRuns)
getWorkflowRuns_nextToken :: Lens.Lens' GetWorkflowRuns (Prelude.Maybe Prelude.Text)
getWorkflowRuns_nextToken :: Lens' GetWorkflowRuns (Maybe Text)
getWorkflowRuns_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRuns' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetWorkflowRuns
s@GetWorkflowRuns' {} Maybe Text
a -> GetWorkflowRuns
s {$sel:nextToken:GetWorkflowRuns' :: Maybe Text
nextToken = Maybe Text
a} :: GetWorkflowRuns)
getWorkflowRuns_name :: Lens.Lens' GetWorkflowRuns Prelude.Text
getWorkflowRuns_name :: Lens' GetWorkflowRuns Text
getWorkflowRuns_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRuns' {Text
name :: Text
$sel:name:GetWorkflowRuns' :: GetWorkflowRuns -> Text
name} -> Text
name) (\s :: GetWorkflowRuns
s@GetWorkflowRuns' {} Text
a -> GetWorkflowRuns
s {$sel:name:GetWorkflowRuns' :: Text
name = Text
a} :: GetWorkflowRuns)
instance Core.AWSRequest GetWorkflowRuns where
type
AWSResponse GetWorkflowRuns =
GetWorkflowRunsResponse
request :: (Service -> Service) -> GetWorkflowRuns -> Request GetWorkflowRuns
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 GetWorkflowRuns
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetWorkflowRuns)))
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 (NonEmpty WorkflowRun) -> Int -> GetWorkflowRunsResponse
GetWorkflowRunsResponse'
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
"NextToken")
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
"Runs")
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 GetWorkflowRuns where
hashWithSalt :: Int -> GetWorkflowRuns -> Int
hashWithSalt Int
_salt GetWorkflowRuns' {Maybe Bool
Maybe Natural
Maybe Text
Text
name :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
includeGraph :: Maybe Bool
$sel:name:GetWorkflowRuns' :: GetWorkflowRuns -> Text
$sel:nextToken:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Text
$sel:maxResults:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Natural
$sel:includeGraph:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeGraph
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData GetWorkflowRuns where
rnf :: GetWorkflowRuns -> ()
rnf GetWorkflowRuns' {Maybe Bool
Maybe Natural
Maybe Text
Text
name :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
includeGraph :: Maybe Bool
$sel:name:GetWorkflowRuns' :: GetWorkflowRuns -> Text
$sel:nextToken:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Text
$sel:maxResults:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Natural
$sel:includeGraph:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeGraph
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders GetWorkflowRuns where
toHeaders :: GetWorkflowRuns -> 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.GetWorkflowRuns" :: 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 GetWorkflowRuns where
toJSON :: GetWorkflowRuns -> Value
toJSON GetWorkflowRuns' {Maybe Bool
Maybe Natural
Maybe Text
Text
name :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
includeGraph :: Maybe Bool
$sel:name:GetWorkflowRuns' :: GetWorkflowRuns -> Text
$sel:nextToken:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Text
$sel:maxResults:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Natural
$sel:includeGraph:GetWorkflowRuns' :: GetWorkflowRuns -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"IncludeGraph" 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 Bool
includeGraph,
(Key
"MaxResults" 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
maxResults,
(Key
"NextToken" 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
nextToken,
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 GetWorkflowRuns where
toPath :: GetWorkflowRuns -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetWorkflowRuns where
toQuery :: GetWorkflowRuns -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetWorkflowRunsResponse = GetWorkflowRunsResponse'
{
GetWorkflowRunsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetWorkflowRunsResponse -> Maybe (NonEmpty WorkflowRun)
runs :: Prelude.Maybe (Prelude.NonEmpty WorkflowRun),
GetWorkflowRunsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetWorkflowRunsResponse -> GetWorkflowRunsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkflowRunsResponse -> GetWorkflowRunsResponse -> Bool
$c/= :: GetWorkflowRunsResponse -> GetWorkflowRunsResponse -> Bool
== :: GetWorkflowRunsResponse -> GetWorkflowRunsResponse -> Bool
$c== :: GetWorkflowRunsResponse -> GetWorkflowRunsResponse -> Bool
Prelude.Eq, ReadPrec [GetWorkflowRunsResponse]
ReadPrec GetWorkflowRunsResponse
Int -> ReadS GetWorkflowRunsResponse
ReadS [GetWorkflowRunsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWorkflowRunsResponse]
$creadListPrec :: ReadPrec [GetWorkflowRunsResponse]
readPrec :: ReadPrec GetWorkflowRunsResponse
$creadPrec :: ReadPrec GetWorkflowRunsResponse
readList :: ReadS [GetWorkflowRunsResponse]
$creadList :: ReadS [GetWorkflowRunsResponse]
readsPrec :: Int -> ReadS GetWorkflowRunsResponse
$creadsPrec :: Int -> ReadS GetWorkflowRunsResponse
Prelude.Read, Int -> GetWorkflowRunsResponse -> ShowS
[GetWorkflowRunsResponse] -> ShowS
GetWorkflowRunsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkflowRunsResponse] -> ShowS
$cshowList :: [GetWorkflowRunsResponse] -> ShowS
show :: GetWorkflowRunsResponse -> String
$cshow :: GetWorkflowRunsResponse -> String
showsPrec :: Int -> GetWorkflowRunsResponse -> ShowS
$cshowsPrec :: Int -> GetWorkflowRunsResponse -> ShowS
Prelude.Show, forall x. Rep GetWorkflowRunsResponse x -> GetWorkflowRunsResponse
forall x. GetWorkflowRunsResponse -> Rep GetWorkflowRunsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkflowRunsResponse x -> GetWorkflowRunsResponse
$cfrom :: forall x. GetWorkflowRunsResponse -> Rep GetWorkflowRunsResponse x
Prelude.Generic)
newGetWorkflowRunsResponse ::
Prelude.Int ->
GetWorkflowRunsResponse
newGetWorkflowRunsResponse :: Int -> GetWorkflowRunsResponse
newGetWorkflowRunsResponse Int
pHttpStatus_ =
GetWorkflowRunsResponse'
{ $sel:nextToken:GetWorkflowRunsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:runs:GetWorkflowRunsResponse' :: Maybe (NonEmpty WorkflowRun)
runs = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetWorkflowRunsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getWorkflowRunsResponse_nextToken :: Lens.Lens' GetWorkflowRunsResponse (Prelude.Maybe Prelude.Text)
getWorkflowRunsResponse_nextToken :: Lens' GetWorkflowRunsResponse (Maybe Text)
getWorkflowRunsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRunsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetWorkflowRunsResponse' :: GetWorkflowRunsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetWorkflowRunsResponse
s@GetWorkflowRunsResponse' {} Maybe Text
a -> GetWorkflowRunsResponse
s {$sel:nextToken:GetWorkflowRunsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetWorkflowRunsResponse)
getWorkflowRunsResponse_runs :: Lens.Lens' GetWorkflowRunsResponse (Prelude.Maybe (Prelude.NonEmpty WorkflowRun))
getWorkflowRunsResponse_runs :: Lens' GetWorkflowRunsResponse (Maybe (NonEmpty WorkflowRun))
getWorkflowRunsResponse_runs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRunsResponse' {Maybe (NonEmpty WorkflowRun)
runs :: Maybe (NonEmpty WorkflowRun)
$sel:runs:GetWorkflowRunsResponse' :: GetWorkflowRunsResponse -> Maybe (NonEmpty WorkflowRun)
runs} -> Maybe (NonEmpty WorkflowRun)
runs) (\s :: GetWorkflowRunsResponse
s@GetWorkflowRunsResponse' {} Maybe (NonEmpty WorkflowRun)
a -> GetWorkflowRunsResponse
s {$sel:runs:GetWorkflowRunsResponse' :: Maybe (NonEmpty WorkflowRun)
runs = Maybe (NonEmpty WorkflowRun)
a} :: GetWorkflowRunsResponse) 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
getWorkflowRunsResponse_httpStatus :: Lens.Lens' GetWorkflowRunsResponse Prelude.Int
getWorkflowRunsResponse_httpStatus :: Lens' GetWorkflowRunsResponse Int
getWorkflowRunsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkflowRunsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetWorkflowRunsResponse' :: GetWorkflowRunsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetWorkflowRunsResponse
s@GetWorkflowRunsResponse' {} Int
a -> GetWorkflowRunsResponse
s {$sel:httpStatus:GetWorkflowRunsResponse' :: Int
httpStatus = Int
a} :: GetWorkflowRunsResponse)
instance Prelude.NFData GetWorkflowRunsResponse where
rnf :: GetWorkflowRunsResponse -> ()
rnf GetWorkflowRunsResponse' {Int
Maybe (NonEmpty WorkflowRun)
Maybe Text
httpStatus :: Int
runs :: Maybe (NonEmpty WorkflowRun)
nextToken :: Maybe Text
$sel:httpStatus:GetWorkflowRunsResponse' :: GetWorkflowRunsResponse -> Int
$sel:runs:GetWorkflowRunsResponse' :: GetWorkflowRunsResponse -> Maybe (NonEmpty WorkflowRun)
$sel:nextToken:GetWorkflowRunsResponse' :: GetWorkflowRunsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty WorkflowRun)
runs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus