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

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

-- |
-- Module      : Amazonka.StepFunctions.DescribeStateMachine
-- 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)
--
-- Describes a state machine.
--
-- This operation is eventually consistent. The results are best effort and
-- may not reflect very recent updates and changes.
module Amazonka.StepFunctions.DescribeStateMachine
  ( -- * Creating a Request
    DescribeStateMachine (..),
    newDescribeStateMachine,

    -- * Request Lenses
    describeStateMachine_stateMachineArn,

    -- * Destructuring the Response
    DescribeStateMachineResponse (..),
    newDescribeStateMachineResponse,

    -- * Response Lenses
    describeStateMachineResponse_status,
    describeStateMachineResponse_tracingConfiguration,
    describeStateMachineResponse_loggingConfiguration,
    describeStateMachineResponse_httpStatus,
    describeStateMachineResponse_stateMachineArn,
    describeStateMachineResponse_name,
    describeStateMachineResponse_definition,
    describeStateMachineResponse_roleArn,
    describeStateMachineResponse_type,
    describeStateMachineResponse_creationDate,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StepFunctions.Types

-- | /See:/ 'newDescribeStateMachine' smart constructor.
data DescribeStateMachine = DescribeStateMachine'
  { -- | The Amazon Resource Name (ARN) of the state machine to describe.
    DescribeStateMachine -> Text
stateMachineArn :: Prelude.Text
  }
  deriving (DescribeStateMachine -> DescribeStateMachine -> Bool
(DescribeStateMachine -> DescribeStateMachine -> Bool)
-> (DescribeStateMachine -> DescribeStateMachine -> Bool)
-> Eq DescribeStateMachine
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStateMachine -> DescribeStateMachine -> Bool
$c/= :: DescribeStateMachine -> DescribeStateMachine -> Bool
== :: DescribeStateMachine -> DescribeStateMachine -> Bool
$c== :: DescribeStateMachine -> DescribeStateMachine -> Bool
Prelude.Eq, ReadPrec [DescribeStateMachine]
ReadPrec DescribeStateMachine
Int -> ReadS DescribeStateMachine
ReadS [DescribeStateMachine]
(Int -> ReadS DescribeStateMachine)
-> ReadS [DescribeStateMachine]
-> ReadPrec DescribeStateMachine
-> ReadPrec [DescribeStateMachine]
-> Read DescribeStateMachine
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStateMachine]
$creadListPrec :: ReadPrec [DescribeStateMachine]
readPrec :: ReadPrec DescribeStateMachine
$creadPrec :: ReadPrec DescribeStateMachine
readList :: ReadS [DescribeStateMachine]
$creadList :: ReadS [DescribeStateMachine]
readsPrec :: Int -> ReadS DescribeStateMachine
$creadsPrec :: Int -> ReadS DescribeStateMachine
Prelude.Read, Int -> DescribeStateMachine -> ShowS
[DescribeStateMachine] -> ShowS
DescribeStateMachine -> String
(Int -> DescribeStateMachine -> ShowS)
-> (DescribeStateMachine -> String)
-> ([DescribeStateMachine] -> ShowS)
-> Show DescribeStateMachine
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStateMachine] -> ShowS
$cshowList :: [DescribeStateMachine] -> ShowS
show :: DescribeStateMachine -> String
$cshow :: DescribeStateMachine -> String
showsPrec :: Int -> DescribeStateMachine -> ShowS
$cshowsPrec :: Int -> DescribeStateMachine -> ShowS
Prelude.Show, (forall x. DescribeStateMachine -> Rep DescribeStateMachine x)
-> (forall x. Rep DescribeStateMachine x -> DescribeStateMachine)
-> Generic DescribeStateMachine
forall x. Rep DescribeStateMachine x -> DescribeStateMachine
forall x. DescribeStateMachine -> Rep DescribeStateMachine x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeStateMachine x -> DescribeStateMachine
$cfrom :: forall x. DescribeStateMachine -> Rep DescribeStateMachine x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStateMachine' 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:
--
-- 'stateMachineArn', 'describeStateMachine_stateMachineArn' - The Amazon Resource Name (ARN) of the state machine to describe.
newDescribeStateMachine ::
  -- | 'stateMachineArn'
  Prelude.Text ->
  DescribeStateMachine
newDescribeStateMachine :: Text -> DescribeStateMachine
newDescribeStateMachine Text
pStateMachineArn_ =
  DescribeStateMachine' :: Text -> DescribeStateMachine
DescribeStateMachine'
    { $sel:stateMachineArn:DescribeStateMachine' :: Text
stateMachineArn =
        Text
pStateMachineArn_
    }

-- | The Amazon Resource Name (ARN) of the state machine to describe.
describeStateMachine_stateMachineArn :: Lens.Lens' DescribeStateMachine Prelude.Text
describeStateMachine_stateMachineArn :: (Text -> f Text) -> DescribeStateMachine -> f DescribeStateMachine
describeStateMachine_stateMachineArn = (DescribeStateMachine -> Text)
-> (DescribeStateMachine -> Text -> DescribeStateMachine)
-> Lens DescribeStateMachine DescribeStateMachine Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachine' {Text
stateMachineArn :: Text
$sel:stateMachineArn:DescribeStateMachine' :: DescribeStateMachine -> Text
stateMachineArn} -> Text
stateMachineArn) (\s :: DescribeStateMachine
s@DescribeStateMachine' {} Text
a -> DescribeStateMachine
s {$sel:stateMachineArn:DescribeStateMachine' :: Text
stateMachineArn = Text
a} :: DescribeStateMachine)

instance Core.AWSRequest DescribeStateMachine where
  type
    AWSResponse DescribeStateMachine =
      DescribeStateMachineResponse
  request :: DescribeStateMachine -> Request DescribeStateMachine
request = Service -> DescribeStateMachine -> Request DescribeStateMachine
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeStateMachine
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeStateMachine)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeStateMachine))
-> Logger
-> Service
-> Proxy DescribeStateMachine
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeStateMachine)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe StateMachineStatus
-> Maybe TracingConfiguration
-> Maybe LoggingConfiguration
-> Int
-> Text
-> Text
-> Sensitive Text
-> Text
-> StateMachineType
-> POSIX
-> DescribeStateMachineResponse
DescribeStateMachineResponse'
            (Maybe StateMachineStatus
 -> Maybe TracingConfiguration
 -> Maybe LoggingConfiguration
 -> Int
 -> Text
 -> Text
 -> Sensitive Text
 -> Text
 -> StateMachineType
 -> POSIX
 -> DescribeStateMachineResponse)
-> Either String (Maybe StateMachineStatus)
-> Either
     String
     (Maybe TracingConfiguration
      -> Maybe LoggingConfiguration
      -> Int
      -> Text
      -> Text
      -> Sensitive Text
      -> Text
      -> StateMachineType
      -> POSIX
      -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe StateMachineStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe TracingConfiguration
   -> Maybe LoggingConfiguration
   -> Int
   -> Text
   -> Text
   -> Sensitive Text
   -> Text
   -> StateMachineType
   -> POSIX
   -> DescribeStateMachineResponse)
-> Either String (Maybe TracingConfiguration)
-> Either
     String
     (Maybe LoggingConfiguration
      -> Int
      -> Text
      -> Text
      -> Sensitive Text
      -> Text
      -> StateMachineType
      -> POSIX
      -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe TracingConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tracingConfiguration")
            Either
  String
  (Maybe LoggingConfiguration
   -> Int
   -> Text
   -> Text
   -> Sensitive Text
   -> Text
   -> StateMachineType
   -> POSIX
   -> DescribeStateMachineResponse)
-> Either String (Maybe LoggingConfiguration)
-> Either
     String
     (Int
      -> Text
      -> Text
      -> Sensitive Text
      -> Text
      -> StateMachineType
      -> POSIX
      -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe LoggingConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"loggingConfiguration")
            Either
  String
  (Int
   -> Text
   -> Text
   -> Sensitive Text
   -> Text
   -> StateMachineType
   -> POSIX
   -> DescribeStateMachineResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text
      -> Sensitive Text
      -> Text
      -> StateMachineType
      -> POSIX
      -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  (Text
   -> Text
   -> Sensitive Text
   -> Text
   -> StateMachineType
   -> POSIX
   -> DescribeStateMachineResponse)
-> Either String Text
-> Either
     String
     (Text
      -> Sensitive Text
      -> Text
      -> StateMachineType
      -> POSIX
      -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"stateMachineArn")
            Either
  String
  (Text
   -> Sensitive Text
   -> Text
   -> StateMachineType
   -> POSIX
   -> DescribeStateMachineResponse)
-> Either String Text
-> Either
     String
     (Sensitive Text
      -> Text
      -> StateMachineType
      -> POSIX
      -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"name")
            Either
  String
  (Sensitive Text
   -> Text
   -> StateMachineType
   -> POSIX
   -> DescribeStateMachineResponse)
-> Either String (Sensitive Text)
-> Either
     String
     (Text -> StateMachineType -> POSIX -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"definition")
            Either
  String
  (Text -> StateMachineType -> POSIX -> DescribeStateMachineResponse)
-> Either String Text
-> Either
     String (StateMachineType -> POSIX -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"roleArn")
            Either
  String (StateMachineType -> POSIX -> DescribeStateMachineResponse)
-> Either String StateMachineType
-> Either String (POSIX -> DescribeStateMachineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String StateMachineType
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"type")
            Either String (POSIX -> DescribeStateMachineResponse)
-> Either String POSIX
-> Either String DescribeStateMachineResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"creationDate")
      )

instance Prelude.Hashable DescribeStateMachine

instance Prelude.NFData DescribeStateMachine

instance Core.ToHeaders DescribeStateMachine where
  toHeaders :: DescribeStateMachine -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeStateMachine -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSStepFunctions.DescribeStateMachine" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

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

instance Core.ToPath DescribeStateMachine where
  toPath :: DescribeStateMachine -> ByteString
toPath = ByteString -> DescribeStateMachine -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeStateMachine where
  toQuery :: DescribeStateMachine -> QueryString
toQuery = QueryString -> DescribeStateMachine -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeStateMachineResponse' smart constructor.
data DescribeStateMachineResponse = DescribeStateMachineResponse'
  { -- | The current status of the state machine.
    DescribeStateMachineResponse -> Maybe StateMachineStatus
status :: Prelude.Maybe StateMachineStatus,
    -- | Selects whether AWS X-Ray tracing is enabled.
    DescribeStateMachineResponse -> Maybe TracingConfiguration
tracingConfiguration :: Prelude.Maybe TracingConfiguration,
    DescribeStateMachineResponse -> Maybe LoggingConfiguration
loggingConfiguration :: Prelude.Maybe LoggingConfiguration,
    -- | The response's http status code.
    DescribeStateMachineResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) that identifies the state machine.
    DescribeStateMachineResponse -> Text
stateMachineArn :: Prelude.Text,
    -- | The name of the state machine.
    --
    -- A name must /not/ contain:
    --
    -- -   white space
    --
    -- -   brackets @\< > { } [ ]@
    --
    -- -   wildcard characters @? *@
    --
    -- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
    --
    -- -   control characters (@U+0000-001F@, @U+007F-009F@)
    --
    -- To enable logging with CloudWatch Logs, the name should only contain
    -- 0-9, A-Z, a-z, - and _.
    DescribeStateMachineResponse -> Text
name :: Prelude.Text,
    -- | The Amazon States Language definition of the state machine. See
    -- <https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html Amazon States Language>.
    DescribeStateMachineResponse -> Sensitive Text
definition :: Core.Sensitive Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM role used when creating this
    -- state machine. (The IAM role maintains security by granting Step
    -- Functions access to AWS resources.)
    DescribeStateMachineResponse -> Text
roleArn :: Prelude.Text,
    -- | The @type@ of the state machine (@STANDARD@ or @EXPRESS@).
    DescribeStateMachineResponse -> StateMachineType
type' :: StateMachineType,
    -- | The date the state machine is created.
    DescribeStateMachineResponse -> POSIX
creationDate :: Core.POSIX
  }
  deriving (DescribeStateMachineResponse
-> DescribeStateMachineResponse -> Bool
(DescribeStateMachineResponse
 -> DescribeStateMachineResponse -> Bool)
-> (DescribeStateMachineResponse
    -> DescribeStateMachineResponse -> Bool)
-> Eq DescribeStateMachineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStateMachineResponse
-> DescribeStateMachineResponse -> Bool
$c/= :: DescribeStateMachineResponse
-> DescribeStateMachineResponse -> Bool
== :: DescribeStateMachineResponse
-> DescribeStateMachineResponse -> Bool
$c== :: DescribeStateMachineResponse
-> DescribeStateMachineResponse -> Bool
Prelude.Eq, Int -> DescribeStateMachineResponse -> ShowS
[DescribeStateMachineResponse] -> ShowS
DescribeStateMachineResponse -> String
(Int -> DescribeStateMachineResponse -> ShowS)
-> (DescribeStateMachineResponse -> String)
-> ([DescribeStateMachineResponse] -> ShowS)
-> Show DescribeStateMachineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStateMachineResponse] -> ShowS
$cshowList :: [DescribeStateMachineResponse] -> ShowS
show :: DescribeStateMachineResponse -> String
$cshow :: DescribeStateMachineResponse -> String
showsPrec :: Int -> DescribeStateMachineResponse -> ShowS
$cshowsPrec :: Int -> DescribeStateMachineResponse -> ShowS
Prelude.Show, (forall x.
 DescribeStateMachineResponse -> Rep DescribeStateMachineResponse x)
-> (forall x.
    Rep DescribeStateMachineResponse x -> DescribeStateMachineResponse)
-> Generic DescribeStateMachineResponse
forall x.
Rep DescribeStateMachineResponse x -> DescribeStateMachineResponse
forall x.
DescribeStateMachineResponse -> Rep DescribeStateMachineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStateMachineResponse x -> DescribeStateMachineResponse
$cfrom :: forall x.
DescribeStateMachineResponse -> Rep DescribeStateMachineResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStateMachineResponse' 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:
--
-- 'status', 'describeStateMachineResponse_status' - The current status of the state machine.
--
-- 'tracingConfiguration', 'describeStateMachineResponse_tracingConfiguration' - Selects whether AWS X-Ray tracing is enabled.
--
-- 'loggingConfiguration', 'describeStateMachineResponse_loggingConfiguration' - Undocumented member.
--
-- 'httpStatus', 'describeStateMachineResponse_httpStatus' - The response's http status code.
--
-- 'stateMachineArn', 'describeStateMachineResponse_stateMachineArn' - The Amazon Resource Name (ARN) that identifies the state machine.
--
-- 'name', 'describeStateMachineResponse_name' - The name of the state machine.
--
-- A name must /not/ contain:
--
-- -   white space
--
-- -   brackets @\< > { } [ ]@
--
-- -   wildcard characters @? *@
--
-- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
--
-- -   control characters (@U+0000-001F@, @U+007F-009F@)
--
-- To enable logging with CloudWatch Logs, the name should only contain
-- 0-9, A-Z, a-z, - and _.
--
-- 'definition', 'describeStateMachineResponse_definition' - The Amazon States Language definition of the state machine. See
-- <https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html Amazon States Language>.
--
-- 'roleArn', 'describeStateMachineResponse_roleArn' - The Amazon Resource Name (ARN) of the IAM role used when creating this
-- state machine. (The IAM role maintains security by granting Step
-- Functions access to AWS resources.)
--
-- 'type'', 'describeStateMachineResponse_type' - The @type@ of the state machine (@STANDARD@ or @EXPRESS@).
--
-- 'creationDate', 'describeStateMachineResponse_creationDate' - The date the state machine is created.
newDescribeStateMachineResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'stateMachineArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'definition'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'type''
  StateMachineType ->
  -- | 'creationDate'
  Prelude.UTCTime ->
  DescribeStateMachineResponse
newDescribeStateMachineResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> StateMachineType
-> UTCTime
-> DescribeStateMachineResponse
newDescribeStateMachineResponse
  Int
pHttpStatus_
  Text
pStateMachineArn_
  Text
pName_
  Text
pDefinition_
  Text
pRoleArn_
  StateMachineType
pType_
  UTCTime
pCreationDate_ =
    DescribeStateMachineResponse' :: Maybe StateMachineStatus
-> Maybe TracingConfiguration
-> Maybe LoggingConfiguration
-> Int
-> Text
-> Text
-> Sensitive Text
-> Text
-> StateMachineType
-> POSIX
-> DescribeStateMachineResponse
DescribeStateMachineResponse'
      { $sel:status:DescribeStateMachineResponse' :: Maybe StateMachineStatus
status =
          Maybe StateMachineStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:tracingConfiguration:DescribeStateMachineResponse' :: Maybe TracingConfiguration
tracingConfiguration = Maybe TracingConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:loggingConfiguration:DescribeStateMachineResponse' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeStateMachineResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:stateMachineArn:DescribeStateMachineResponse' :: Text
stateMachineArn = Text
pStateMachineArn_,
        $sel:name:DescribeStateMachineResponse' :: Text
name = Text
pName_,
        $sel:definition:DescribeStateMachineResponse' :: Sensitive Text
definition =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pDefinition_,
        $sel:roleArn:DescribeStateMachineResponse' :: Text
roleArn = Text
pRoleArn_,
        $sel:type':DescribeStateMachineResponse' :: StateMachineType
type' = StateMachineType
pType_,
        $sel:creationDate:DescribeStateMachineResponse' :: POSIX
creationDate =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_
      }

-- | The current status of the state machine.
describeStateMachineResponse_status :: Lens.Lens' DescribeStateMachineResponse (Prelude.Maybe StateMachineStatus)
describeStateMachineResponse_status :: (Maybe StateMachineStatus -> f (Maybe StateMachineStatus))
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_status = (DescribeStateMachineResponse -> Maybe StateMachineStatus)
-> (DescribeStateMachineResponse
    -> Maybe StateMachineStatus -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse
     DescribeStateMachineResponse
     (Maybe StateMachineStatus)
     (Maybe StateMachineStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Maybe StateMachineStatus
status :: Maybe StateMachineStatus
$sel:status:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Maybe StateMachineStatus
status} -> Maybe StateMachineStatus
status) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Maybe StateMachineStatus
a -> DescribeStateMachineResponse
s {$sel:status:DescribeStateMachineResponse' :: Maybe StateMachineStatus
status = Maybe StateMachineStatus
a} :: DescribeStateMachineResponse)

-- | Selects whether AWS X-Ray tracing is enabled.
describeStateMachineResponse_tracingConfiguration :: Lens.Lens' DescribeStateMachineResponse (Prelude.Maybe TracingConfiguration)
describeStateMachineResponse_tracingConfiguration :: (Maybe TracingConfiguration -> f (Maybe TracingConfiguration))
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_tracingConfiguration = (DescribeStateMachineResponse -> Maybe TracingConfiguration)
-> (DescribeStateMachineResponse
    -> Maybe TracingConfiguration -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse
     DescribeStateMachineResponse
     (Maybe TracingConfiguration)
     (Maybe TracingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Maybe TracingConfiguration
tracingConfiguration :: Maybe TracingConfiguration
$sel:tracingConfiguration:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Maybe TracingConfiguration
tracingConfiguration} -> Maybe TracingConfiguration
tracingConfiguration) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Maybe TracingConfiguration
a -> DescribeStateMachineResponse
s {$sel:tracingConfiguration:DescribeStateMachineResponse' :: Maybe TracingConfiguration
tracingConfiguration = Maybe TracingConfiguration
a} :: DescribeStateMachineResponse)

-- | Undocumented member.
describeStateMachineResponse_loggingConfiguration :: Lens.Lens' DescribeStateMachineResponse (Prelude.Maybe LoggingConfiguration)
describeStateMachineResponse_loggingConfiguration :: (Maybe LoggingConfiguration -> f (Maybe LoggingConfiguration))
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_loggingConfiguration = (DescribeStateMachineResponse -> Maybe LoggingConfiguration)
-> (DescribeStateMachineResponse
    -> Maybe LoggingConfiguration -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse
     DescribeStateMachineResponse
     (Maybe LoggingConfiguration)
     (Maybe LoggingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Maybe LoggingConfiguration
loggingConfiguration :: Maybe LoggingConfiguration
$sel:loggingConfiguration:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Maybe LoggingConfiguration
loggingConfiguration} -> Maybe LoggingConfiguration
loggingConfiguration) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Maybe LoggingConfiguration
a -> DescribeStateMachineResponse
s {$sel:loggingConfiguration:DescribeStateMachineResponse' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
a} :: DescribeStateMachineResponse)

-- | The response's http status code.
describeStateMachineResponse_httpStatus :: Lens.Lens' DescribeStateMachineResponse Prelude.Int
describeStateMachineResponse_httpStatus :: (Int -> f Int)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_httpStatus = (DescribeStateMachineResponse -> Int)
-> (DescribeStateMachineResponse
    -> Int -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse DescribeStateMachineResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Int
a -> DescribeStateMachineResponse
s {$sel:httpStatus:DescribeStateMachineResponse' :: Int
httpStatus = Int
a} :: DescribeStateMachineResponse)

-- | The Amazon Resource Name (ARN) that identifies the state machine.
describeStateMachineResponse_stateMachineArn :: Lens.Lens' DescribeStateMachineResponse Prelude.Text
describeStateMachineResponse_stateMachineArn :: (Text -> f Text)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_stateMachineArn = (DescribeStateMachineResponse -> Text)
-> (DescribeStateMachineResponse
    -> Text -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse DescribeStateMachineResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Text
stateMachineArn :: Text
$sel:stateMachineArn:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Text
stateMachineArn} -> Text
stateMachineArn) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Text
a -> DescribeStateMachineResponse
s {$sel:stateMachineArn:DescribeStateMachineResponse' :: Text
stateMachineArn = Text
a} :: DescribeStateMachineResponse)

-- | The name of the state machine.
--
-- A name must /not/ contain:
--
-- -   white space
--
-- -   brackets @\< > { } [ ]@
--
-- -   wildcard characters @? *@
--
-- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
--
-- -   control characters (@U+0000-001F@, @U+007F-009F@)
--
-- To enable logging with CloudWatch Logs, the name should only contain
-- 0-9, A-Z, a-z, - and _.
describeStateMachineResponse_name :: Lens.Lens' DescribeStateMachineResponse Prelude.Text
describeStateMachineResponse_name :: (Text -> f Text)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_name = (DescribeStateMachineResponse -> Text)
-> (DescribeStateMachineResponse
    -> Text -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse DescribeStateMachineResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Text
name :: Text
$sel:name:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Text
name} -> Text
name) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Text
a -> DescribeStateMachineResponse
s {$sel:name:DescribeStateMachineResponse' :: Text
name = Text
a} :: DescribeStateMachineResponse)

-- | The Amazon States Language definition of the state machine. See
-- <https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html Amazon States Language>.
describeStateMachineResponse_definition :: Lens.Lens' DescribeStateMachineResponse Prelude.Text
describeStateMachineResponse_definition :: (Text -> f Text)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_definition = (DescribeStateMachineResponse -> Sensitive Text)
-> (DescribeStateMachineResponse
    -> Sensitive Text -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse
     DescribeStateMachineResponse
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Sensitive Text
definition :: Sensitive Text
$sel:definition:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Sensitive Text
definition} -> Sensitive Text
definition) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Sensitive Text
a -> DescribeStateMachineResponse
s {$sel:definition:DescribeStateMachineResponse' :: Sensitive Text
definition = Sensitive Text
a} :: DescribeStateMachineResponse) ((Sensitive Text -> f (Sensitive Text))
 -> DescribeStateMachineResponse -> f DescribeStateMachineResponse)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> DescribeStateMachineResponse
-> f DescribeStateMachineResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The Amazon Resource Name (ARN) of the IAM role used when creating this
-- state machine. (The IAM role maintains security by granting Step
-- Functions access to AWS resources.)
describeStateMachineResponse_roleArn :: Lens.Lens' DescribeStateMachineResponse Prelude.Text
describeStateMachineResponse_roleArn :: (Text -> f Text)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_roleArn = (DescribeStateMachineResponse -> Text)
-> (DescribeStateMachineResponse
    -> Text -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse DescribeStateMachineResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {Text
roleArn :: Text
$sel:roleArn:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> Text
roleArn} -> Text
roleArn) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} Text
a -> DescribeStateMachineResponse
s {$sel:roleArn:DescribeStateMachineResponse' :: Text
roleArn = Text
a} :: DescribeStateMachineResponse)

-- | The @type@ of the state machine (@STANDARD@ or @EXPRESS@).
describeStateMachineResponse_type :: Lens.Lens' DescribeStateMachineResponse StateMachineType
describeStateMachineResponse_type :: (StateMachineType -> f StateMachineType)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_type = (DescribeStateMachineResponse -> StateMachineType)
-> (DescribeStateMachineResponse
    -> StateMachineType -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse
     DescribeStateMachineResponse
     StateMachineType
     StateMachineType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {StateMachineType
type' :: StateMachineType
$sel:type':DescribeStateMachineResponse' :: DescribeStateMachineResponse -> StateMachineType
type'} -> StateMachineType
type') (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} StateMachineType
a -> DescribeStateMachineResponse
s {$sel:type':DescribeStateMachineResponse' :: StateMachineType
type' = StateMachineType
a} :: DescribeStateMachineResponse)

-- | The date the state machine is created.
describeStateMachineResponse_creationDate :: Lens.Lens' DescribeStateMachineResponse Prelude.UTCTime
describeStateMachineResponse_creationDate :: (UTCTime -> f UTCTime)
-> DescribeStateMachineResponse -> f DescribeStateMachineResponse
describeStateMachineResponse_creationDate = (DescribeStateMachineResponse -> POSIX)
-> (DescribeStateMachineResponse
    -> POSIX -> DescribeStateMachineResponse)
-> Lens
     DescribeStateMachineResponse
     DescribeStateMachineResponse
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStateMachineResponse' {POSIX
creationDate :: POSIX
$sel:creationDate:DescribeStateMachineResponse' :: DescribeStateMachineResponse -> POSIX
creationDate} -> POSIX
creationDate) (\s :: DescribeStateMachineResponse
s@DescribeStateMachineResponse' {} POSIX
a -> DescribeStateMachineResponse
s {$sel:creationDate:DescribeStateMachineResponse' :: POSIX
creationDate = POSIX
a} :: DescribeStateMachineResponse) ((POSIX -> f POSIX)
 -> DescribeStateMachineResponse -> f DescribeStateMachineResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeStateMachineResponse
-> f DescribeStateMachineResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData DescribeStateMachineResponse