{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SWF.Types.WorkflowExecutionInfos
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SWF.Types.WorkflowExecutionInfos where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.WorkflowExecutionInfo

-- | Contains a paginated list of information about workflow executions.
--
-- /See:/ 'newWorkflowExecutionInfos' smart constructor.
data WorkflowExecutionInfos = WorkflowExecutionInfos'
  { -- | If a @NextPageToken@ was returned by a previous call, there are more
    -- results available. To retrieve the next page of results, make the call
    -- again using the returned token in @nextPageToken@. Keep all other
    -- arguments unchanged.
    --
    -- The configured @maximumPageSize@ determines how many results can be
    -- returned in a single call.
    WorkflowExecutionInfos -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The list of workflow information structures.
    WorkflowExecutionInfos -> [WorkflowExecutionInfo]
executionInfos :: [WorkflowExecutionInfo]
  }
  deriving (WorkflowExecutionInfos -> WorkflowExecutionInfos -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowExecutionInfos -> WorkflowExecutionInfos -> Bool
$c/= :: WorkflowExecutionInfos -> WorkflowExecutionInfos -> Bool
== :: WorkflowExecutionInfos -> WorkflowExecutionInfos -> Bool
$c== :: WorkflowExecutionInfos -> WorkflowExecutionInfos -> Bool
Prelude.Eq, ReadPrec [WorkflowExecutionInfos]
ReadPrec WorkflowExecutionInfos
Int -> ReadS WorkflowExecutionInfos
ReadS [WorkflowExecutionInfos]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowExecutionInfos]
$creadListPrec :: ReadPrec [WorkflowExecutionInfos]
readPrec :: ReadPrec WorkflowExecutionInfos
$creadPrec :: ReadPrec WorkflowExecutionInfos
readList :: ReadS [WorkflowExecutionInfos]
$creadList :: ReadS [WorkflowExecutionInfos]
readsPrec :: Int -> ReadS WorkflowExecutionInfos
$creadsPrec :: Int -> ReadS WorkflowExecutionInfos
Prelude.Read, Int -> WorkflowExecutionInfos -> ShowS
[WorkflowExecutionInfos] -> ShowS
WorkflowExecutionInfos -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowExecutionInfos] -> ShowS
$cshowList :: [WorkflowExecutionInfos] -> ShowS
show :: WorkflowExecutionInfos -> String
$cshow :: WorkflowExecutionInfos -> String
showsPrec :: Int -> WorkflowExecutionInfos -> ShowS
$cshowsPrec :: Int -> WorkflowExecutionInfos -> ShowS
Prelude.Show, forall x. Rep WorkflowExecutionInfos x -> WorkflowExecutionInfos
forall x. WorkflowExecutionInfos -> Rep WorkflowExecutionInfos x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowExecutionInfos x -> WorkflowExecutionInfos
$cfrom :: forall x. WorkflowExecutionInfos -> Rep WorkflowExecutionInfos x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowExecutionInfos' 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:
--
-- 'nextPageToken', 'workflowExecutionInfos_nextPageToken' - If a @NextPageToken@ was returned by a previous call, there are more
-- results available. To retrieve the next page of results, make the call
-- again using the returned token in @nextPageToken@. Keep all other
-- arguments unchanged.
--
-- The configured @maximumPageSize@ determines how many results can be
-- returned in a single call.
--
-- 'executionInfos', 'workflowExecutionInfos_executionInfos' - The list of workflow information structures.
newWorkflowExecutionInfos ::
  WorkflowExecutionInfos
newWorkflowExecutionInfos :: WorkflowExecutionInfos
newWorkflowExecutionInfos =
  WorkflowExecutionInfos'
    { $sel:nextPageToken:WorkflowExecutionInfos' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:executionInfos:WorkflowExecutionInfos' :: [WorkflowExecutionInfo]
executionInfos = forall a. Monoid a => a
Prelude.mempty
    }

-- | If a @NextPageToken@ was returned by a previous call, there are more
-- results available. To retrieve the next page of results, make the call
-- again using the returned token in @nextPageToken@. Keep all other
-- arguments unchanged.
--
-- The configured @maximumPageSize@ determines how many results can be
-- returned in a single call.
workflowExecutionInfos_nextPageToken :: Lens.Lens' WorkflowExecutionInfos (Prelude.Maybe Prelude.Text)
workflowExecutionInfos_nextPageToken :: Lens' WorkflowExecutionInfos (Maybe Text)
workflowExecutionInfos_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfos' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:WorkflowExecutionInfos' :: WorkflowExecutionInfos -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: WorkflowExecutionInfos
s@WorkflowExecutionInfos' {} Maybe Text
a -> WorkflowExecutionInfos
s {$sel:nextPageToken:WorkflowExecutionInfos' :: Maybe Text
nextPageToken = Maybe Text
a} :: WorkflowExecutionInfos)

-- | The list of workflow information structures.
workflowExecutionInfos_executionInfos :: Lens.Lens' WorkflowExecutionInfos [WorkflowExecutionInfo]
workflowExecutionInfos_executionInfos :: Lens' WorkflowExecutionInfos [WorkflowExecutionInfo]
workflowExecutionInfos_executionInfos = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfos' {[WorkflowExecutionInfo]
executionInfos :: [WorkflowExecutionInfo]
$sel:executionInfos:WorkflowExecutionInfos' :: WorkflowExecutionInfos -> [WorkflowExecutionInfo]
executionInfos} -> [WorkflowExecutionInfo]
executionInfos) (\s :: WorkflowExecutionInfos
s@WorkflowExecutionInfos' {} [WorkflowExecutionInfo]
a -> WorkflowExecutionInfos
s {$sel:executionInfos:WorkflowExecutionInfos' :: [WorkflowExecutionInfo]
executionInfos = [WorkflowExecutionInfo]
a} :: WorkflowExecutionInfos) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON WorkflowExecutionInfos where
  parseJSON :: Value -> Parser WorkflowExecutionInfos
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkflowExecutionInfos"
      ( \Object
x ->
          Maybe Text -> [WorkflowExecutionInfo] -> WorkflowExecutionInfos
WorkflowExecutionInfos'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"nextPageToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"executionInfos"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable WorkflowExecutionInfos where
  hashWithSalt :: Int -> WorkflowExecutionInfos -> Int
hashWithSalt Int
_salt WorkflowExecutionInfos' {[WorkflowExecutionInfo]
Maybe Text
executionInfos :: [WorkflowExecutionInfo]
nextPageToken :: Maybe Text
$sel:executionInfos:WorkflowExecutionInfos' :: WorkflowExecutionInfos -> [WorkflowExecutionInfo]
$sel:nextPageToken:WorkflowExecutionInfos' :: WorkflowExecutionInfos -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextPageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [WorkflowExecutionInfo]
executionInfos

instance Prelude.NFData WorkflowExecutionInfos where
  rnf :: WorkflowExecutionInfos -> ()
rnf WorkflowExecutionInfos' {[WorkflowExecutionInfo]
Maybe Text
executionInfos :: [WorkflowExecutionInfo]
nextPageToken :: Maybe Text
$sel:executionInfos:WorkflowExecutionInfos' :: WorkflowExecutionInfos -> [WorkflowExecutionInfo]
$sel:nextPageToken:WorkflowExecutionInfos' :: WorkflowExecutionInfos -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [WorkflowExecutionInfo]
executionInfos