{-# 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.WorkflowExecutionFilter
-- 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.WorkflowExecutionFilter 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

-- | Used to filter the workflow executions in visibility APIs by their
-- @workflowId@.
--
-- /See:/ 'newWorkflowExecutionFilter' smart constructor.
data WorkflowExecutionFilter = WorkflowExecutionFilter'
  { -- | The workflowId to pass of match the criteria of this filter.
    WorkflowExecutionFilter -> Text
workflowId :: Prelude.Text
  }
  deriving (WorkflowExecutionFilter -> WorkflowExecutionFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowExecutionFilter -> WorkflowExecutionFilter -> Bool
$c/= :: WorkflowExecutionFilter -> WorkflowExecutionFilter -> Bool
== :: WorkflowExecutionFilter -> WorkflowExecutionFilter -> Bool
$c== :: WorkflowExecutionFilter -> WorkflowExecutionFilter -> Bool
Prelude.Eq, ReadPrec [WorkflowExecutionFilter]
ReadPrec WorkflowExecutionFilter
Int -> ReadS WorkflowExecutionFilter
ReadS [WorkflowExecutionFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowExecutionFilter]
$creadListPrec :: ReadPrec [WorkflowExecutionFilter]
readPrec :: ReadPrec WorkflowExecutionFilter
$creadPrec :: ReadPrec WorkflowExecutionFilter
readList :: ReadS [WorkflowExecutionFilter]
$creadList :: ReadS [WorkflowExecutionFilter]
readsPrec :: Int -> ReadS WorkflowExecutionFilter
$creadsPrec :: Int -> ReadS WorkflowExecutionFilter
Prelude.Read, Int -> WorkflowExecutionFilter -> ShowS
[WorkflowExecutionFilter] -> ShowS
WorkflowExecutionFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowExecutionFilter] -> ShowS
$cshowList :: [WorkflowExecutionFilter] -> ShowS
show :: WorkflowExecutionFilter -> String
$cshow :: WorkflowExecutionFilter -> String
showsPrec :: Int -> WorkflowExecutionFilter -> ShowS
$cshowsPrec :: Int -> WorkflowExecutionFilter -> ShowS
Prelude.Show, forall x. Rep WorkflowExecutionFilter x -> WorkflowExecutionFilter
forall x. WorkflowExecutionFilter -> Rep WorkflowExecutionFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowExecutionFilter x -> WorkflowExecutionFilter
$cfrom :: forall x. WorkflowExecutionFilter -> Rep WorkflowExecutionFilter x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowExecutionFilter' 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:
--
-- 'workflowId', 'workflowExecutionFilter_workflowId' - The workflowId to pass of match the criteria of this filter.
newWorkflowExecutionFilter ::
  -- | 'workflowId'
  Prelude.Text ->
  WorkflowExecutionFilter
newWorkflowExecutionFilter :: Text -> WorkflowExecutionFilter
newWorkflowExecutionFilter Text
pWorkflowId_ =
  WorkflowExecutionFilter' {$sel:workflowId:WorkflowExecutionFilter' :: Text
workflowId = Text
pWorkflowId_}

-- | The workflowId to pass of match the criteria of this filter.
workflowExecutionFilter_workflowId :: Lens.Lens' WorkflowExecutionFilter Prelude.Text
workflowExecutionFilter_workflowId :: Lens' WorkflowExecutionFilter Text
workflowExecutionFilter_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionFilter' {Text
workflowId :: Text
$sel:workflowId:WorkflowExecutionFilter' :: WorkflowExecutionFilter -> Text
workflowId} -> Text
workflowId) (\s :: WorkflowExecutionFilter
s@WorkflowExecutionFilter' {} Text
a -> WorkflowExecutionFilter
s {$sel:workflowId:WorkflowExecutionFilter' :: Text
workflowId = Text
a} :: WorkflowExecutionFilter)

instance Prelude.Hashable WorkflowExecutionFilter where
  hashWithSalt :: Int -> WorkflowExecutionFilter -> Int
hashWithSalt Int
_salt WorkflowExecutionFilter' {Text
workflowId :: Text
$sel:workflowId:WorkflowExecutionFilter' :: WorkflowExecutionFilter -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowId

instance Prelude.NFData WorkflowExecutionFilter where
  rnf :: WorkflowExecutionFilter -> ()
rnf WorkflowExecutionFilter' {Text
workflowId :: Text
$sel:workflowId:WorkflowExecutionFilter' :: WorkflowExecutionFilter -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
workflowId

instance Data.ToJSON WorkflowExecutionFilter where
  toJSON :: WorkflowExecutionFilter -> Value
toJSON WorkflowExecutionFilter' {Text
workflowId :: Text
$sel:workflowId:WorkflowExecutionFilter' :: WorkflowExecutionFilter -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"workflowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workflowId)]
      )