{-# 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.DescribedExecution
-- 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.DescribedExecution 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.Transfer.Types.ExecutionResults
import Amazonka.Transfer.Types.ExecutionStatus
import Amazonka.Transfer.Types.FileLocation
import Amazonka.Transfer.Types.LoggingConfiguration
import Amazonka.Transfer.Types.PosixProfile
import Amazonka.Transfer.Types.ServiceMetadata

-- | The details for an execution object.
--
-- /See:/ 'newDescribedExecution' smart constructor.
data DescribedExecution = DescribedExecution'
  { -- | A unique identifier for the execution of a workflow.
    DescribedExecution -> Maybe Text
executionId :: Prelude.Maybe Prelude.Text,
    -- | The IAM role associated with the execution.
    DescribedExecution -> Maybe Text
executionRole :: Prelude.Maybe Prelude.Text,
    -- | A structure that describes the Amazon S3 or EFS file location. This is
    -- the file location when the execution begins: if the file is being
    -- copied, this is the initial (as opposed to destination) file location.
    DescribedExecution -> Maybe FileLocation
initialFileLocation :: Prelude.Maybe FileLocation,
    -- | The IAM logging role associated with the execution.
    DescribedExecution -> Maybe LoggingConfiguration
loggingConfiguration :: Prelude.Maybe LoggingConfiguration,
    DescribedExecution -> Maybe PosixProfile
posixProfile :: Prelude.Maybe PosixProfile,
    -- | A structure that describes the execution results. This includes a list
    -- of the steps along with the details of each step, error type and message
    -- (if any), and the @OnExceptionSteps@ structure.
    DescribedExecution -> Maybe ExecutionResults
results :: Prelude.Maybe ExecutionResults,
    -- | A container object for the session details that are associated with a
    -- workflow.
    DescribedExecution -> Maybe ServiceMetadata
serviceMetadata :: Prelude.Maybe ServiceMetadata,
    -- | The status is one of the execution. Can be in progress, completed,
    -- exception encountered, or handling the exception.
    DescribedExecution -> Maybe ExecutionStatus
status :: Prelude.Maybe ExecutionStatus
  }
  deriving (DescribedExecution -> DescribedExecution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribedExecution -> DescribedExecution -> Bool
$c/= :: DescribedExecution -> DescribedExecution -> Bool
== :: DescribedExecution -> DescribedExecution -> Bool
$c== :: DescribedExecution -> DescribedExecution -> Bool
Prelude.Eq, ReadPrec [DescribedExecution]
ReadPrec DescribedExecution
Int -> ReadS DescribedExecution
ReadS [DescribedExecution]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribedExecution]
$creadListPrec :: ReadPrec [DescribedExecution]
readPrec :: ReadPrec DescribedExecution
$creadPrec :: ReadPrec DescribedExecution
readList :: ReadS [DescribedExecution]
$creadList :: ReadS [DescribedExecution]
readsPrec :: Int -> ReadS DescribedExecution
$creadsPrec :: Int -> ReadS DescribedExecution
Prelude.Read, Int -> DescribedExecution -> ShowS
[DescribedExecution] -> ShowS
DescribedExecution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribedExecution] -> ShowS
$cshowList :: [DescribedExecution] -> ShowS
show :: DescribedExecution -> String
$cshow :: DescribedExecution -> String
showsPrec :: Int -> DescribedExecution -> ShowS
$cshowsPrec :: Int -> DescribedExecution -> ShowS
Prelude.Show, forall x. Rep DescribedExecution x -> DescribedExecution
forall x. DescribedExecution -> Rep DescribedExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribedExecution x -> DescribedExecution
$cfrom :: forall x. DescribedExecution -> Rep DescribedExecution x
Prelude.Generic)

-- |
-- Create a value of 'DescribedExecution' 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:
--
-- 'executionId', 'describedExecution_executionId' - A unique identifier for the execution of a workflow.
--
-- 'executionRole', 'describedExecution_executionRole' - The IAM role associated with the execution.
--
-- 'initialFileLocation', 'describedExecution_initialFileLocation' - A structure that describes the Amazon S3 or EFS file location. This is
-- the file location when the execution begins: if the file is being
-- copied, this is the initial (as opposed to destination) file location.
--
-- 'loggingConfiguration', 'describedExecution_loggingConfiguration' - The IAM logging role associated with the execution.
--
-- 'posixProfile', 'describedExecution_posixProfile' - Undocumented member.
--
-- 'results', 'describedExecution_results' - A structure that describes the execution results. This includes a list
-- of the steps along with the details of each step, error type and message
-- (if any), and the @OnExceptionSteps@ structure.
--
-- 'serviceMetadata', 'describedExecution_serviceMetadata' - A container object for the session details that are associated with a
-- workflow.
--
-- 'status', 'describedExecution_status' - The status is one of the execution. Can be in progress, completed,
-- exception encountered, or handling the exception.
newDescribedExecution ::
  DescribedExecution
newDescribedExecution :: DescribedExecution
newDescribedExecution =
  DescribedExecution'
    { $sel:executionId:DescribedExecution' :: Maybe Text
executionId = forall a. Maybe a
Prelude.Nothing,
      $sel:executionRole:DescribedExecution' :: Maybe Text
executionRole = forall a. Maybe a
Prelude.Nothing,
      $sel:initialFileLocation:DescribedExecution' :: Maybe FileLocation
initialFileLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:loggingConfiguration:DescribedExecution' :: Maybe LoggingConfiguration
loggingConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:posixProfile:DescribedExecution' :: Maybe PosixProfile
posixProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:results:DescribedExecution' :: Maybe ExecutionResults
results = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceMetadata:DescribedExecution' :: Maybe ServiceMetadata
serviceMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribedExecution' :: Maybe ExecutionStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for the execution of a workflow.
describedExecution_executionId :: Lens.Lens' DescribedExecution (Prelude.Maybe Prelude.Text)
describedExecution_executionId :: Lens' DescribedExecution (Maybe Text)
describedExecution_executionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe Text
executionId :: Maybe Text
$sel:executionId:DescribedExecution' :: DescribedExecution -> Maybe Text
executionId} -> Maybe Text
executionId) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe Text
a -> DescribedExecution
s {$sel:executionId:DescribedExecution' :: Maybe Text
executionId = Maybe Text
a} :: DescribedExecution)

-- | The IAM role associated with the execution.
describedExecution_executionRole :: Lens.Lens' DescribedExecution (Prelude.Maybe Prelude.Text)
describedExecution_executionRole :: Lens' DescribedExecution (Maybe Text)
describedExecution_executionRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe Text
executionRole :: Maybe Text
$sel:executionRole:DescribedExecution' :: DescribedExecution -> Maybe Text
executionRole} -> Maybe Text
executionRole) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe Text
a -> DescribedExecution
s {$sel:executionRole:DescribedExecution' :: Maybe Text
executionRole = Maybe Text
a} :: DescribedExecution)

-- | A structure that describes the Amazon S3 or EFS file location. This is
-- the file location when the execution begins: if the file is being
-- copied, this is the initial (as opposed to destination) file location.
describedExecution_initialFileLocation :: Lens.Lens' DescribedExecution (Prelude.Maybe FileLocation)
describedExecution_initialFileLocation :: Lens' DescribedExecution (Maybe FileLocation)
describedExecution_initialFileLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe FileLocation
initialFileLocation :: Maybe FileLocation
$sel:initialFileLocation:DescribedExecution' :: DescribedExecution -> Maybe FileLocation
initialFileLocation} -> Maybe FileLocation
initialFileLocation) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe FileLocation
a -> DescribedExecution
s {$sel:initialFileLocation:DescribedExecution' :: Maybe FileLocation
initialFileLocation = Maybe FileLocation
a} :: DescribedExecution)

-- | The IAM logging role associated with the execution.
describedExecution_loggingConfiguration :: Lens.Lens' DescribedExecution (Prelude.Maybe LoggingConfiguration)
describedExecution_loggingConfiguration :: Lens' DescribedExecution (Maybe LoggingConfiguration)
describedExecution_loggingConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe LoggingConfiguration
loggingConfiguration :: Maybe LoggingConfiguration
$sel:loggingConfiguration:DescribedExecution' :: DescribedExecution -> Maybe LoggingConfiguration
loggingConfiguration} -> Maybe LoggingConfiguration
loggingConfiguration) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe LoggingConfiguration
a -> DescribedExecution
s {$sel:loggingConfiguration:DescribedExecution' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
a} :: DescribedExecution)

-- | Undocumented member.
describedExecution_posixProfile :: Lens.Lens' DescribedExecution (Prelude.Maybe PosixProfile)
describedExecution_posixProfile :: Lens' DescribedExecution (Maybe PosixProfile)
describedExecution_posixProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe PosixProfile
posixProfile :: Maybe PosixProfile
$sel:posixProfile:DescribedExecution' :: DescribedExecution -> Maybe PosixProfile
posixProfile} -> Maybe PosixProfile
posixProfile) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe PosixProfile
a -> DescribedExecution
s {$sel:posixProfile:DescribedExecution' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
a} :: DescribedExecution)

-- | A structure that describes the execution results. This includes a list
-- of the steps along with the details of each step, error type and message
-- (if any), and the @OnExceptionSteps@ structure.
describedExecution_results :: Lens.Lens' DescribedExecution (Prelude.Maybe ExecutionResults)
describedExecution_results :: Lens' DescribedExecution (Maybe ExecutionResults)
describedExecution_results = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe ExecutionResults
results :: Maybe ExecutionResults
$sel:results:DescribedExecution' :: DescribedExecution -> Maybe ExecutionResults
results} -> Maybe ExecutionResults
results) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe ExecutionResults
a -> DescribedExecution
s {$sel:results:DescribedExecution' :: Maybe ExecutionResults
results = Maybe ExecutionResults
a} :: DescribedExecution)

-- | A container object for the session details that are associated with a
-- workflow.
describedExecution_serviceMetadata :: Lens.Lens' DescribedExecution (Prelude.Maybe ServiceMetadata)
describedExecution_serviceMetadata :: Lens' DescribedExecution (Maybe ServiceMetadata)
describedExecution_serviceMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe ServiceMetadata
serviceMetadata :: Maybe ServiceMetadata
$sel:serviceMetadata:DescribedExecution' :: DescribedExecution -> Maybe ServiceMetadata
serviceMetadata} -> Maybe ServiceMetadata
serviceMetadata) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe ServiceMetadata
a -> DescribedExecution
s {$sel:serviceMetadata:DescribedExecution' :: Maybe ServiceMetadata
serviceMetadata = Maybe ServiceMetadata
a} :: DescribedExecution)

-- | The status is one of the execution. Can be in progress, completed,
-- exception encountered, or handling the exception.
describedExecution_status :: Lens.Lens' DescribedExecution (Prelude.Maybe ExecutionStatus)
describedExecution_status :: Lens' DescribedExecution (Maybe ExecutionStatus)
describedExecution_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedExecution' {Maybe ExecutionStatus
status :: Maybe ExecutionStatus
$sel:status:DescribedExecution' :: DescribedExecution -> Maybe ExecutionStatus
status} -> Maybe ExecutionStatus
status) (\s :: DescribedExecution
s@DescribedExecution' {} Maybe ExecutionStatus
a -> DescribedExecution
s {$sel:status:DescribedExecution' :: Maybe ExecutionStatus
status = Maybe ExecutionStatus
a} :: DescribedExecution)

instance Data.FromJSON DescribedExecution where
  parseJSON :: Value -> Parser DescribedExecution
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DescribedExecution"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe FileLocation
-> Maybe LoggingConfiguration
-> Maybe PosixProfile
-> Maybe ExecutionResults
-> Maybe ServiceMetadata
-> Maybe ExecutionStatus
-> DescribedExecution
DescribedExecution'
            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
"ExecutionId")
            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
"ExecutionRole")
            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
"InitialFileLocation")
            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
"LoggingConfiguration")
            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
"PosixProfile")
            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
"Results")
            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
"ServiceMetadata")
            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
"Status")
      )

instance Prelude.Hashable DescribedExecution where
  hashWithSalt :: Int -> DescribedExecution -> Int
hashWithSalt Int
_salt DescribedExecution' {Maybe Text
Maybe ExecutionStatus
Maybe LoggingConfiguration
Maybe PosixProfile
Maybe FileLocation
Maybe ServiceMetadata
Maybe ExecutionResults
status :: Maybe ExecutionStatus
serviceMetadata :: Maybe ServiceMetadata
results :: Maybe ExecutionResults
posixProfile :: Maybe PosixProfile
loggingConfiguration :: Maybe LoggingConfiguration
initialFileLocation :: Maybe FileLocation
executionRole :: Maybe Text
executionId :: Maybe Text
$sel:status:DescribedExecution' :: DescribedExecution -> Maybe ExecutionStatus
$sel:serviceMetadata:DescribedExecution' :: DescribedExecution -> Maybe ServiceMetadata
$sel:results:DescribedExecution' :: DescribedExecution -> Maybe ExecutionResults
$sel:posixProfile:DescribedExecution' :: DescribedExecution -> Maybe PosixProfile
$sel:loggingConfiguration:DescribedExecution' :: DescribedExecution -> Maybe LoggingConfiguration
$sel:initialFileLocation:DescribedExecution' :: DescribedExecution -> Maybe FileLocation
$sel:executionRole:DescribedExecution' :: DescribedExecution -> Maybe Text
$sel:executionId:DescribedExecution' :: DescribedExecution -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
executionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
executionRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileLocation
initialFileLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoggingConfiguration
loggingConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PosixProfile
posixProfile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExecutionResults
results
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceMetadata
serviceMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExecutionStatus
status

instance Prelude.NFData DescribedExecution where
  rnf :: DescribedExecution -> ()
rnf DescribedExecution' {Maybe Text
Maybe ExecutionStatus
Maybe LoggingConfiguration
Maybe PosixProfile
Maybe FileLocation
Maybe ServiceMetadata
Maybe ExecutionResults
status :: Maybe ExecutionStatus
serviceMetadata :: Maybe ServiceMetadata
results :: Maybe ExecutionResults
posixProfile :: Maybe PosixProfile
loggingConfiguration :: Maybe LoggingConfiguration
initialFileLocation :: Maybe FileLocation
executionRole :: Maybe Text
executionId :: Maybe Text
$sel:status:DescribedExecution' :: DescribedExecution -> Maybe ExecutionStatus
$sel:serviceMetadata:DescribedExecution' :: DescribedExecution -> Maybe ServiceMetadata
$sel:results:DescribedExecution' :: DescribedExecution -> Maybe ExecutionResults
$sel:posixProfile:DescribedExecution' :: DescribedExecution -> Maybe PosixProfile
$sel:loggingConfiguration:DescribedExecution' :: DescribedExecution -> Maybe LoggingConfiguration
$sel:initialFileLocation:DescribedExecution' :: DescribedExecution -> Maybe FileLocation
$sel:executionRole:DescribedExecution' :: DescribedExecution -> Maybe Text
$sel:executionId:DescribedExecution' :: DescribedExecution -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
executionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
executionRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FileLocation
initialFileLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoggingConfiguration
loggingConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PosixProfile
posixProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExecutionResults
results
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceMetadata
serviceMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExecutionStatus
status