{-# 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.Transfer.Types.ListedWorkflow
-- 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.Transfer.Types.ListedWorkflow 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

-- | Contains the identifier, text description, and Amazon Resource Name
-- (ARN) for the workflow.
--
-- /See:/ 'newListedWorkflow' smart constructor.
data ListedWorkflow = ListedWorkflow'
  { -- | Specifies the unique Amazon Resource Name (ARN) for the workflow.
    ListedWorkflow -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Specifies the text description for the workflow.
    ListedWorkflow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the workflow.
    ListedWorkflow -> Maybe Text
workflowId :: Prelude.Maybe Prelude.Text
  }
  deriving (ListedWorkflow -> ListedWorkflow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListedWorkflow -> ListedWorkflow -> Bool
$c/= :: ListedWorkflow -> ListedWorkflow -> Bool
== :: ListedWorkflow -> ListedWorkflow -> Bool
$c== :: ListedWorkflow -> ListedWorkflow -> Bool
Prelude.Eq, ReadPrec [ListedWorkflow]
ReadPrec ListedWorkflow
Int -> ReadS ListedWorkflow
ReadS [ListedWorkflow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListedWorkflow]
$creadListPrec :: ReadPrec [ListedWorkflow]
readPrec :: ReadPrec ListedWorkflow
$creadPrec :: ReadPrec ListedWorkflow
readList :: ReadS [ListedWorkflow]
$creadList :: ReadS [ListedWorkflow]
readsPrec :: Int -> ReadS ListedWorkflow
$creadsPrec :: Int -> ReadS ListedWorkflow
Prelude.Read, Int -> ListedWorkflow -> ShowS
[ListedWorkflow] -> ShowS
ListedWorkflow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListedWorkflow] -> ShowS
$cshowList :: [ListedWorkflow] -> ShowS
show :: ListedWorkflow -> String
$cshow :: ListedWorkflow -> String
showsPrec :: Int -> ListedWorkflow -> ShowS
$cshowsPrec :: Int -> ListedWorkflow -> ShowS
Prelude.Show, forall x. Rep ListedWorkflow x -> ListedWorkflow
forall x. ListedWorkflow -> Rep ListedWorkflow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListedWorkflow x -> ListedWorkflow
$cfrom :: forall x. ListedWorkflow -> Rep ListedWorkflow x
Prelude.Generic)

-- |
-- Create a value of 'ListedWorkflow' 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:
--
-- 'arn', 'listedWorkflow_arn' - Specifies the unique Amazon Resource Name (ARN) for the workflow.
--
-- 'description', 'listedWorkflow_description' - Specifies the text description for the workflow.
--
-- 'workflowId', 'listedWorkflow_workflowId' - A unique identifier for the workflow.
newListedWorkflow ::
  ListedWorkflow
newListedWorkflow :: ListedWorkflow
newListedWorkflow =
  ListedWorkflow'
    { $sel:arn:ListedWorkflow' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ListedWorkflow' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:workflowId:ListedWorkflow' :: Maybe Text
workflowId = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the unique Amazon Resource Name (ARN) for the workflow.
listedWorkflow_arn :: Lens.Lens' ListedWorkflow (Prelude.Maybe Prelude.Text)
listedWorkflow_arn :: Lens' ListedWorkflow (Maybe Text)
listedWorkflow_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedWorkflow' {Maybe Text
arn :: Maybe Text
$sel:arn:ListedWorkflow' :: ListedWorkflow -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ListedWorkflow
s@ListedWorkflow' {} Maybe Text
a -> ListedWorkflow
s {$sel:arn:ListedWorkflow' :: Maybe Text
arn = Maybe Text
a} :: ListedWorkflow)

-- | Specifies the text description for the workflow.
listedWorkflow_description :: Lens.Lens' ListedWorkflow (Prelude.Maybe Prelude.Text)
listedWorkflow_description :: Lens' ListedWorkflow (Maybe Text)
listedWorkflow_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedWorkflow' {Maybe Text
description :: Maybe Text
$sel:description:ListedWorkflow' :: ListedWorkflow -> Maybe Text
description} -> Maybe Text
description) (\s :: ListedWorkflow
s@ListedWorkflow' {} Maybe Text
a -> ListedWorkflow
s {$sel:description:ListedWorkflow' :: Maybe Text
description = Maybe Text
a} :: ListedWorkflow)

-- | A unique identifier for the workflow.
listedWorkflow_workflowId :: Lens.Lens' ListedWorkflow (Prelude.Maybe Prelude.Text)
listedWorkflow_workflowId :: Lens' ListedWorkflow (Maybe Text)
listedWorkflow_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedWorkflow' {Maybe Text
workflowId :: Maybe Text
$sel:workflowId:ListedWorkflow' :: ListedWorkflow -> Maybe Text
workflowId} -> Maybe Text
workflowId) (\s :: ListedWorkflow
s@ListedWorkflow' {} Maybe Text
a -> ListedWorkflow
s {$sel:workflowId:ListedWorkflow' :: Maybe Text
workflowId = Maybe Text
a} :: ListedWorkflow)

instance Data.FromJSON ListedWorkflow where
  parseJSON :: Value -> Parser ListedWorkflow
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListedWorkflow"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ListedWorkflow
ListedWorkflow'
            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
"Arn")
            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
"Description")
            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
"WorkflowId")
      )

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

instance Prelude.NFData ListedWorkflow where
  rnf :: ListedWorkflow -> ()
rnf ListedWorkflow' {Maybe Text
workflowId :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:workflowId:ListedWorkflow' :: ListedWorkflow -> Maybe Text
$sel:description:ListedWorkflow' :: ListedWorkflow -> Maybe Text
$sel:arn:ListedWorkflow' :: ListedWorkflow -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      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 Text
workflowId