{-# 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.CustomerProfiles.ListWorkflows
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Query to list all workflows.
module Amazonka.CustomerProfiles.ListWorkflows
  ( -- * Creating a Request
    ListWorkflows (..),
    newListWorkflows,

    -- * Request Lenses
    listWorkflows_maxResults,
    listWorkflows_nextToken,
    listWorkflows_queryEndDate,
    listWorkflows_queryStartDate,
    listWorkflows_status,
    listWorkflows_workflowType,
    listWorkflows_domainName,

    -- * Destructuring the Response
    ListWorkflowsResponse (..),
    newListWorkflowsResponse,

    -- * Response Lenses
    listWorkflowsResponse_items,
    listWorkflowsResponse_nextToken,
    listWorkflowsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListWorkflows' smart constructor.
data ListWorkflows = ListWorkflows'
  { -- | The maximum number of results to return per page.
    ListWorkflows -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListWorkflows -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Retrieve workflows ended after timestamp.
    ListWorkflows -> Maybe POSIX
queryEndDate :: Prelude.Maybe Data.POSIX,
    -- | Retrieve workflows started after timestamp.
    ListWorkflows -> Maybe POSIX
queryStartDate :: Prelude.Maybe Data.POSIX,
    -- | Status of workflow execution.
    ListWorkflows -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The type of workflow. The only supported value is APPFLOW_INTEGRATION.
    ListWorkflows -> Maybe WorkflowType
workflowType :: Prelude.Maybe WorkflowType,
    -- | The unique name of the domain.
    ListWorkflows -> Text
domainName :: Prelude.Text
  }
  deriving (ListWorkflows -> ListWorkflows -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkflows -> ListWorkflows -> Bool
$c/= :: ListWorkflows -> ListWorkflows -> Bool
== :: ListWorkflows -> ListWorkflows -> Bool
$c== :: ListWorkflows -> ListWorkflows -> Bool
Prelude.Eq, ReadPrec [ListWorkflows]
ReadPrec ListWorkflows
Int -> ReadS ListWorkflows
ReadS [ListWorkflows]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkflows]
$creadListPrec :: ReadPrec [ListWorkflows]
readPrec :: ReadPrec ListWorkflows
$creadPrec :: ReadPrec ListWorkflows
readList :: ReadS [ListWorkflows]
$creadList :: ReadS [ListWorkflows]
readsPrec :: Int -> ReadS ListWorkflows
$creadsPrec :: Int -> ReadS ListWorkflows
Prelude.Read, Int -> ListWorkflows -> ShowS
[ListWorkflows] -> ShowS
ListWorkflows -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkflows] -> ShowS
$cshowList :: [ListWorkflows] -> ShowS
show :: ListWorkflows -> String
$cshow :: ListWorkflows -> String
showsPrec :: Int -> ListWorkflows -> ShowS
$cshowsPrec :: Int -> ListWorkflows -> ShowS
Prelude.Show, forall x. Rep ListWorkflows x -> ListWorkflows
forall x. ListWorkflows -> Rep ListWorkflows x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkflows x -> ListWorkflows
$cfrom :: forall x. ListWorkflows -> Rep ListWorkflows x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkflows' 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:
--
-- 'maxResults', 'listWorkflows_maxResults' - The maximum number of results to return per page.
--
-- 'nextToken', 'listWorkflows_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'queryEndDate', 'listWorkflows_queryEndDate' - Retrieve workflows ended after timestamp.
--
-- 'queryStartDate', 'listWorkflows_queryStartDate' - Retrieve workflows started after timestamp.
--
-- 'status', 'listWorkflows_status' - Status of workflow execution.
--
-- 'workflowType', 'listWorkflows_workflowType' - The type of workflow. The only supported value is APPFLOW_INTEGRATION.
--
-- 'domainName', 'listWorkflows_domainName' - The unique name of the domain.
newListWorkflows ::
  -- | 'domainName'
  Prelude.Text ->
  ListWorkflows
newListWorkflows :: Text -> ListWorkflows
newListWorkflows Text
pDomainName_ =
  ListWorkflows'
    { $sel:maxResults:ListWorkflows' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorkflows' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:queryEndDate:ListWorkflows' :: Maybe POSIX
queryEndDate = forall a. Maybe a
Prelude.Nothing,
      $sel:queryStartDate:ListWorkflows' :: Maybe POSIX
queryStartDate = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListWorkflows' :: Maybe Status
status = forall a. Maybe a
Prelude.Nothing,
      $sel:workflowType:ListWorkflows' :: Maybe WorkflowType
workflowType = forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:ListWorkflows' :: Text
domainName = Text
pDomainName_
    }

-- | The maximum number of results to return per page.
listWorkflows_maxResults :: Lens.Lens' ListWorkflows (Prelude.Maybe Prelude.Natural)
listWorkflows_maxResults :: Lens' ListWorkflows (Maybe Natural)
listWorkflows_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWorkflows' :: ListWorkflows -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWorkflows
s@ListWorkflows' {} Maybe Natural
a -> ListWorkflows
s {$sel:maxResults:ListWorkflows' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWorkflows)

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listWorkflows_nextToken :: Lens.Lens' ListWorkflows (Prelude.Maybe Prelude.Text)
listWorkflows_nextToken :: Lens' ListWorkflows (Maybe Text)
listWorkflows_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkflows' :: ListWorkflows -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkflows
s@ListWorkflows' {} Maybe Text
a -> ListWorkflows
s {$sel:nextToken:ListWorkflows' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkflows)

-- | Retrieve workflows ended after timestamp.
listWorkflows_queryEndDate :: Lens.Lens' ListWorkflows (Prelude.Maybe Prelude.UTCTime)
listWorkflows_queryEndDate :: Lens' ListWorkflows (Maybe UTCTime)
listWorkflows_queryEndDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Maybe POSIX
queryEndDate :: Maybe POSIX
$sel:queryEndDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
queryEndDate} -> Maybe POSIX
queryEndDate) (\s :: ListWorkflows
s@ListWorkflows' {} Maybe POSIX
a -> ListWorkflows
s {$sel:queryEndDate:ListWorkflows' :: Maybe POSIX
queryEndDate = Maybe POSIX
a} :: ListWorkflows) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Retrieve workflows started after timestamp.
listWorkflows_queryStartDate :: Lens.Lens' ListWorkflows (Prelude.Maybe Prelude.UTCTime)
listWorkflows_queryStartDate :: Lens' ListWorkflows (Maybe UTCTime)
listWorkflows_queryStartDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Maybe POSIX
queryStartDate :: Maybe POSIX
$sel:queryStartDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
queryStartDate} -> Maybe POSIX
queryStartDate) (\s :: ListWorkflows
s@ListWorkflows' {} Maybe POSIX
a -> ListWorkflows
s {$sel:queryStartDate:ListWorkflows' :: Maybe POSIX
queryStartDate = Maybe POSIX
a} :: ListWorkflows) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Status of workflow execution.
listWorkflows_status :: Lens.Lens' ListWorkflows (Prelude.Maybe Status)
listWorkflows_status :: Lens' ListWorkflows (Maybe Status)
listWorkflows_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Maybe Status
status :: Maybe Status
$sel:status:ListWorkflows' :: ListWorkflows -> Maybe Status
status} -> Maybe Status
status) (\s :: ListWorkflows
s@ListWorkflows' {} Maybe Status
a -> ListWorkflows
s {$sel:status:ListWorkflows' :: Maybe Status
status = Maybe Status
a} :: ListWorkflows)

-- | The type of workflow. The only supported value is APPFLOW_INTEGRATION.
listWorkflows_workflowType :: Lens.Lens' ListWorkflows (Prelude.Maybe WorkflowType)
listWorkflows_workflowType :: Lens' ListWorkflows (Maybe WorkflowType)
listWorkflows_workflowType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Maybe WorkflowType
workflowType :: Maybe WorkflowType
$sel:workflowType:ListWorkflows' :: ListWorkflows -> Maybe WorkflowType
workflowType} -> Maybe WorkflowType
workflowType) (\s :: ListWorkflows
s@ListWorkflows' {} Maybe WorkflowType
a -> ListWorkflows
s {$sel:workflowType:ListWorkflows' :: Maybe WorkflowType
workflowType = Maybe WorkflowType
a} :: ListWorkflows)

-- | The unique name of the domain.
listWorkflows_domainName :: Lens.Lens' ListWorkflows Prelude.Text
listWorkflows_domainName :: Lens' ListWorkflows Text
listWorkflows_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflows' {Text
domainName :: Text
$sel:domainName:ListWorkflows' :: ListWorkflows -> Text
domainName} -> Text
domainName) (\s :: ListWorkflows
s@ListWorkflows' {} Text
a -> ListWorkflows
s {$sel:domainName:ListWorkflows' :: Text
domainName = Text
a} :: ListWorkflows)

instance Core.AWSRequest ListWorkflows where
  type
    AWSResponse ListWorkflows =
      ListWorkflowsResponse
  request :: (Service -> Service) -> ListWorkflows -> Request ListWorkflows
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 ListWorkflows
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListWorkflows)))
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 [ListWorkflowsItem]
-> Maybe Text -> Int -> ListWorkflowsResponse
ListWorkflowsResponse'
            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
"Items" 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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListWorkflows where
  hashWithSalt :: Int -> ListWorkflows -> Int
hashWithSalt Int
_salt ListWorkflows' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe Status
Maybe WorkflowType
Text
domainName :: Text
workflowType :: Maybe WorkflowType
status :: Maybe Status
queryStartDate :: Maybe POSIX
queryEndDate :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListWorkflows' :: ListWorkflows -> Text
$sel:workflowType:ListWorkflows' :: ListWorkflows -> Maybe WorkflowType
$sel:status:ListWorkflows' :: ListWorkflows -> Maybe Status
$sel:queryStartDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:queryEndDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:nextToken:ListWorkflows' :: ListWorkflows -> Maybe Text
$sel:maxResults:ListWorkflows' :: ListWorkflows -> Maybe Natural
..} =
    Int
_salt
      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` Maybe POSIX
queryEndDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
queryStartDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Status
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowType
workflowType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName

instance Prelude.NFData ListWorkflows where
  rnf :: ListWorkflows -> ()
rnf ListWorkflows' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe Status
Maybe WorkflowType
Text
domainName :: Text
workflowType :: Maybe WorkflowType
status :: Maybe Status
queryStartDate :: Maybe POSIX
queryEndDate :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListWorkflows' :: ListWorkflows -> Text
$sel:workflowType:ListWorkflows' :: ListWorkflows -> Maybe WorkflowType
$sel:status:ListWorkflows' :: ListWorkflows -> Maybe Status
$sel:queryStartDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:queryEndDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:nextToken:ListWorkflows' :: ListWorkflows -> Maybe Text
$sel:maxResults:ListWorkflows' :: ListWorkflows -> Maybe Natural
..} =
    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 Maybe POSIX
queryEndDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
queryStartDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Status
status
      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
domainName

instance Data.ToHeaders ListWorkflows where
  toHeaders :: ListWorkflows -> 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 ListWorkflows where
  toJSON :: ListWorkflows -> Value
toJSON ListWorkflows' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe Status
Maybe WorkflowType
Text
domainName :: Text
workflowType :: Maybe WorkflowType
status :: Maybe Status
queryStartDate :: Maybe POSIX
queryEndDate :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListWorkflows' :: ListWorkflows -> Text
$sel:workflowType:ListWorkflows' :: ListWorkflows -> Maybe WorkflowType
$sel:status:ListWorkflows' :: ListWorkflows -> Maybe Status
$sel:queryStartDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:queryEndDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:nextToken:ListWorkflows' :: ListWorkflows -> Maybe Text
$sel:maxResults:ListWorkflows' :: ListWorkflows -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"QueryEndDate" 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 POSIX
queryEndDate,
            (Key
"QueryStartDate" 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 POSIX
queryStartDate,
            (Key
"Status" 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 Status
status,
            (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
          ]
      )

instance Data.ToPath ListWorkflows where
  toPath :: ListWorkflows -> ByteString
toPath ListWorkflows' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe Status
Maybe WorkflowType
Text
domainName :: Text
workflowType :: Maybe WorkflowType
status :: Maybe Status
queryStartDate :: Maybe POSIX
queryEndDate :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListWorkflows' :: ListWorkflows -> Text
$sel:workflowType:ListWorkflows' :: ListWorkflows -> Maybe WorkflowType
$sel:status:ListWorkflows' :: ListWorkflows -> Maybe Status
$sel:queryStartDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:queryEndDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:nextToken:ListWorkflows' :: ListWorkflows -> Maybe Text
$sel:maxResults:ListWorkflows' :: ListWorkflows -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/domains/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainName, ByteString
"/workflows"]

instance Data.ToQuery ListWorkflows where
  toQuery :: ListWorkflows -> QueryString
toQuery ListWorkflows' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe Status
Maybe WorkflowType
Text
domainName :: Text
workflowType :: Maybe WorkflowType
status :: Maybe Status
queryStartDate :: Maybe POSIX
queryEndDate :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListWorkflows' :: ListWorkflows -> Text
$sel:workflowType:ListWorkflows' :: ListWorkflows -> Maybe WorkflowType
$sel:status:ListWorkflows' :: ListWorkflows -> Maybe Status
$sel:queryStartDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:queryEndDate:ListWorkflows' :: ListWorkflows -> Maybe POSIX
$sel:nextToken:ListWorkflows' :: ListWorkflows -> Maybe Text
$sel:maxResults:ListWorkflows' :: ListWorkflows -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"max-results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"next-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newListWorkflowsResponse' smart constructor.
data ListWorkflowsResponse = ListWorkflowsResponse'
  { -- | List containing workflow details.
    ListWorkflowsResponse -> Maybe [ListWorkflowsItem]
items :: Prelude.Maybe [ListWorkflowsItem],
    -- | If there are additional results, this is the token for the next set of
    -- results.
    ListWorkflowsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListWorkflowsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListWorkflowsResponse -> ListWorkflowsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkflowsResponse -> ListWorkflowsResponse -> Bool
$c/= :: ListWorkflowsResponse -> ListWorkflowsResponse -> Bool
== :: ListWorkflowsResponse -> ListWorkflowsResponse -> Bool
$c== :: ListWorkflowsResponse -> ListWorkflowsResponse -> Bool
Prelude.Eq, ReadPrec [ListWorkflowsResponse]
ReadPrec ListWorkflowsResponse
Int -> ReadS ListWorkflowsResponse
ReadS [ListWorkflowsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkflowsResponse]
$creadListPrec :: ReadPrec [ListWorkflowsResponse]
readPrec :: ReadPrec ListWorkflowsResponse
$creadPrec :: ReadPrec ListWorkflowsResponse
readList :: ReadS [ListWorkflowsResponse]
$creadList :: ReadS [ListWorkflowsResponse]
readsPrec :: Int -> ReadS ListWorkflowsResponse
$creadsPrec :: Int -> ReadS ListWorkflowsResponse
Prelude.Read, Int -> ListWorkflowsResponse -> ShowS
[ListWorkflowsResponse] -> ShowS
ListWorkflowsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkflowsResponse] -> ShowS
$cshowList :: [ListWorkflowsResponse] -> ShowS
show :: ListWorkflowsResponse -> String
$cshow :: ListWorkflowsResponse -> String
showsPrec :: Int -> ListWorkflowsResponse -> ShowS
$cshowsPrec :: Int -> ListWorkflowsResponse -> ShowS
Prelude.Show, forall x. Rep ListWorkflowsResponse x -> ListWorkflowsResponse
forall x. ListWorkflowsResponse -> Rep ListWorkflowsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkflowsResponse x -> ListWorkflowsResponse
$cfrom :: forall x. ListWorkflowsResponse -> Rep ListWorkflowsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkflowsResponse' 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:
--
-- 'items', 'listWorkflowsResponse_items' - List containing workflow details.
--
-- 'nextToken', 'listWorkflowsResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'httpStatus', 'listWorkflowsResponse_httpStatus' - The response's http status code.
newListWorkflowsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWorkflowsResponse
newListWorkflowsResponse :: Int -> ListWorkflowsResponse
newListWorkflowsResponse Int
pHttpStatus_ =
  ListWorkflowsResponse'
    { $sel:items:ListWorkflowsResponse' :: Maybe [ListWorkflowsItem]
items = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorkflowsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWorkflowsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | List containing workflow details.
listWorkflowsResponse_items :: Lens.Lens' ListWorkflowsResponse (Prelude.Maybe [ListWorkflowsItem])
listWorkflowsResponse_items :: Lens' ListWorkflowsResponse (Maybe [ListWorkflowsItem])
listWorkflowsResponse_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsResponse' {Maybe [ListWorkflowsItem]
items :: Maybe [ListWorkflowsItem]
$sel:items:ListWorkflowsResponse' :: ListWorkflowsResponse -> Maybe [ListWorkflowsItem]
items} -> Maybe [ListWorkflowsItem]
items) (\s :: ListWorkflowsResponse
s@ListWorkflowsResponse' {} Maybe [ListWorkflowsItem]
a -> ListWorkflowsResponse
s {$sel:items:ListWorkflowsResponse' :: Maybe [ListWorkflowsItem]
items = Maybe [ListWorkflowsItem]
a} :: ListWorkflowsResponse) 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

-- | If there are additional results, this is the token for the next set of
-- results.
listWorkflowsResponse_nextToken :: Lens.Lens' ListWorkflowsResponse (Prelude.Maybe Prelude.Text)
listWorkflowsResponse_nextToken :: Lens' ListWorkflowsResponse (Maybe Text)
listWorkflowsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkflowsResponse' :: ListWorkflowsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkflowsResponse
s@ListWorkflowsResponse' {} Maybe Text
a -> ListWorkflowsResponse
s {$sel:nextToken:ListWorkflowsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkflowsResponse)

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

instance Prelude.NFData ListWorkflowsResponse where
  rnf :: ListWorkflowsResponse -> ()
rnf ListWorkflowsResponse' {Int
Maybe [ListWorkflowsItem]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
items :: Maybe [ListWorkflowsItem]
$sel:httpStatus:ListWorkflowsResponse' :: ListWorkflowsResponse -> Int
$sel:nextToken:ListWorkflowsResponse' :: ListWorkflowsResponse -> Maybe Text
$sel:items:ListWorkflowsResponse' :: ListWorkflowsResponse -> Maybe [ListWorkflowsItem]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ListWorkflowsItem]
items
      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 Int
httpStatus