{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transfer.Types.ListedWorkflow where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the ID, 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,
    -- | A unique identifier for the workflow.
    ListedWorkflow -> Maybe Text
workflowId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the text description for the workflow.
    ListedWorkflow -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ListedWorkflow -> ListedWorkflow -> Bool
(ListedWorkflow -> ListedWorkflow -> Bool)
-> (ListedWorkflow -> ListedWorkflow -> Bool) -> Eq ListedWorkflow
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]
(Int -> ReadS ListedWorkflow)
-> ReadS [ListedWorkflow]
-> ReadPrec ListedWorkflow
-> ReadPrec [ListedWorkflow]
-> Read 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
(Int -> ListedWorkflow -> ShowS)
-> (ListedWorkflow -> String)
-> ([ListedWorkflow] -> ShowS)
-> Show ListedWorkflow
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. ListedWorkflow -> Rep ListedWorkflow x)
-> (forall x. Rep ListedWorkflow x -> ListedWorkflow)
-> Generic ListedWorkflow
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.
--
-- 'workflowId', 'listedWorkflow_workflowId' - A unique identifier for the workflow.
--
-- 'description', 'listedWorkflow_description' - Specifies the text description for the workflow.
newListedWorkflow ::
  ListedWorkflow
newListedWorkflow :: ListedWorkflow
newListedWorkflow =
  ListedWorkflow' :: Maybe Text -> Maybe Text -> Maybe Text -> ListedWorkflow
ListedWorkflow'
    { $sel:arn:ListedWorkflow' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workflowId:ListedWorkflow' :: Maybe Text
workflowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ListedWorkflow' :: Maybe Text
description = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ListedWorkflow -> f ListedWorkflow
listedWorkflow_arn = (ListedWorkflow -> Maybe Text)
-> (ListedWorkflow -> Maybe Text -> ListedWorkflow)
-> Lens ListedWorkflow ListedWorkflow (Maybe Text) (Maybe Text)
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)

-- | A unique identifier for the workflow.
listedWorkflow_workflowId :: Lens.Lens' ListedWorkflow (Prelude.Maybe Prelude.Text)
listedWorkflow_workflowId :: (Maybe Text -> f (Maybe Text))
-> ListedWorkflow -> f ListedWorkflow
listedWorkflow_workflowId = (ListedWorkflow -> Maybe Text)
-> (ListedWorkflow -> Maybe Text -> ListedWorkflow)
-> Lens ListedWorkflow ListedWorkflow (Maybe Text) (Maybe Text)
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)

-- | Specifies the text description for the workflow.
listedWorkflow_description :: Lens.Lens' ListedWorkflow (Prelude.Maybe Prelude.Text)
listedWorkflow_description :: (Maybe Text -> f (Maybe Text))
-> ListedWorkflow -> f ListedWorkflow
listedWorkflow_description = (ListedWorkflow -> Maybe Text)
-> (ListedWorkflow -> Maybe Text -> ListedWorkflow)
-> Lens ListedWorkflow ListedWorkflow (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON ListedWorkflow where
  parseJSON :: Value -> Parser ListedWorkflow
parseJSON =
    String
-> (Object -> Parser ListedWorkflow)
-> Value
-> Parser ListedWorkflow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListedWorkflow"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ListedWorkflow
ListedWorkflow'
            (Maybe Text -> Maybe Text -> Maybe Text -> ListedWorkflow)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ListedWorkflow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser (Maybe Text -> Maybe Text -> ListedWorkflow)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ListedWorkflow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkflowId")
            Parser (Maybe Text -> ListedWorkflow)
-> Parser (Maybe Text) -> Parser ListedWorkflow
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
      )

instance Prelude.Hashable ListedWorkflow

instance Prelude.NFData ListedWorkflow