{-# 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.UpdateStateMachine
-- 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)
--
-- Updates an existing state machine by modifying its @definition@,
-- @roleArn@, or @loggingConfiguration@. Running executions will continue
-- to use the previous @definition@ and @roleArn@. You must include at
-- least one of @definition@ or @roleArn@ or you will receive a
-- @MissingRequiredParameter@ error.
--
-- All @StartExecution@ calls within a few seconds will use the updated
-- @definition@ and @roleArn@. Executions started immediately after calling
-- @UpdateStateMachine@ may use the previous state machine @definition@ and
-- @roleArn@.
module Amazonka.StepFunctions.UpdateStateMachine
  ( -- * Creating a Request
    UpdateStateMachine (..),
    newUpdateStateMachine,

    -- * Request Lenses
    updateStateMachine_definition,
    updateStateMachine_tracingConfiguration,
    updateStateMachine_loggingConfiguration,
    updateStateMachine_roleArn,
    updateStateMachine_stateMachineArn,

    -- * Destructuring the Response
    UpdateStateMachineResponse (..),
    newUpdateStateMachineResponse,

    -- * Response Lenses
    updateStateMachineResponse_httpStatus,
    updateStateMachineResponse_updateDate,
  )
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:/ 'newUpdateStateMachine' smart constructor.
data UpdateStateMachine = UpdateStateMachine'
  { -- | 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>.
    UpdateStateMachine -> Maybe (Sensitive Text)
definition :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Selects whether AWS X-Ray tracing is enabled.
    UpdateStateMachine -> Maybe TracingConfiguration
tracingConfiguration :: Prelude.Maybe TracingConfiguration,
    -- | The @LoggingConfiguration@ data type is used to set CloudWatch Logs
    -- options.
    UpdateStateMachine -> Maybe LoggingConfiguration
loggingConfiguration :: Prelude.Maybe LoggingConfiguration,
    -- | The Amazon Resource Name (ARN) of the IAM role of the state machine.
    UpdateStateMachine -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the state machine.
    UpdateStateMachine -> Text
stateMachineArn :: Prelude.Text
  }
  deriving (UpdateStateMachine -> UpdateStateMachine -> Bool
(UpdateStateMachine -> UpdateStateMachine -> Bool)
-> (UpdateStateMachine -> UpdateStateMachine -> Bool)
-> Eq UpdateStateMachine
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStateMachine -> UpdateStateMachine -> Bool
$c/= :: UpdateStateMachine -> UpdateStateMachine -> Bool
== :: UpdateStateMachine -> UpdateStateMachine -> Bool
$c== :: UpdateStateMachine -> UpdateStateMachine -> Bool
Prelude.Eq, Int -> UpdateStateMachine -> ShowS
[UpdateStateMachine] -> ShowS
UpdateStateMachine -> String
(Int -> UpdateStateMachine -> ShowS)
-> (UpdateStateMachine -> String)
-> ([UpdateStateMachine] -> ShowS)
-> Show UpdateStateMachine
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStateMachine] -> ShowS
$cshowList :: [UpdateStateMachine] -> ShowS
show :: UpdateStateMachine -> String
$cshow :: UpdateStateMachine -> String
showsPrec :: Int -> UpdateStateMachine -> ShowS
$cshowsPrec :: Int -> UpdateStateMachine -> ShowS
Prelude.Show, (forall x. UpdateStateMachine -> Rep UpdateStateMachine x)
-> (forall x. Rep UpdateStateMachine x -> UpdateStateMachine)
-> Generic UpdateStateMachine
forall x. Rep UpdateStateMachine x -> UpdateStateMachine
forall x. UpdateStateMachine -> Rep UpdateStateMachine x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStateMachine x -> UpdateStateMachine
$cfrom :: forall x. UpdateStateMachine -> Rep UpdateStateMachine x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStateMachine' 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:
--
-- 'definition', 'updateStateMachine_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>.
--
-- 'tracingConfiguration', 'updateStateMachine_tracingConfiguration' - Selects whether AWS X-Ray tracing is enabled.
--
-- 'loggingConfiguration', 'updateStateMachine_loggingConfiguration' - The @LoggingConfiguration@ data type is used to set CloudWatch Logs
-- options.
--
-- 'roleArn', 'updateStateMachine_roleArn' - The Amazon Resource Name (ARN) of the IAM role of the state machine.
--
-- 'stateMachineArn', 'updateStateMachine_stateMachineArn' - The Amazon Resource Name (ARN) of the state machine.
newUpdateStateMachine ::
  -- | 'stateMachineArn'
  Prelude.Text ->
  UpdateStateMachine
newUpdateStateMachine :: Text -> UpdateStateMachine
newUpdateStateMachine Text
pStateMachineArn_ =
  UpdateStateMachine' :: Maybe (Sensitive Text)
-> Maybe TracingConfiguration
-> Maybe LoggingConfiguration
-> Maybe Text
-> Text
-> UpdateStateMachine
UpdateStateMachine'
    { $sel:definition:UpdateStateMachine' :: Maybe (Sensitive Text)
definition = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tracingConfiguration:UpdateStateMachine' :: Maybe TracingConfiguration
tracingConfiguration = Maybe TracingConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:loggingConfiguration:UpdateStateMachine' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:UpdateStateMachine' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateMachineArn:UpdateStateMachine' :: Text
stateMachineArn = Text
pStateMachineArn_
    }

-- | 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>.
updateStateMachine_definition :: Lens.Lens' UpdateStateMachine (Prelude.Maybe Prelude.Text)
updateStateMachine_definition :: (Maybe Text -> f (Maybe Text))
-> UpdateStateMachine -> f UpdateStateMachine
updateStateMachine_definition = (UpdateStateMachine -> Maybe (Sensitive Text))
-> (UpdateStateMachine
    -> Maybe (Sensitive Text) -> UpdateStateMachine)
-> Lens
     UpdateStateMachine
     UpdateStateMachine
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStateMachine' {Maybe (Sensitive Text)
definition :: Maybe (Sensitive Text)
$sel:definition:UpdateStateMachine' :: UpdateStateMachine -> Maybe (Sensitive Text)
definition} -> Maybe (Sensitive Text)
definition) (\s :: UpdateStateMachine
s@UpdateStateMachine' {} Maybe (Sensitive Text)
a -> UpdateStateMachine
s {$sel:definition:UpdateStateMachine' :: Maybe (Sensitive Text)
definition = Maybe (Sensitive Text)
a} :: UpdateStateMachine) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateStateMachine -> f UpdateStateMachine)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateStateMachine
-> f UpdateStateMachine
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

-- | The @LoggingConfiguration@ data type is used to set CloudWatch Logs
-- options.
updateStateMachine_loggingConfiguration :: Lens.Lens' UpdateStateMachine (Prelude.Maybe LoggingConfiguration)
updateStateMachine_loggingConfiguration :: (Maybe LoggingConfiguration -> f (Maybe LoggingConfiguration))
-> UpdateStateMachine -> f UpdateStateMachine
updateStateMachine_loggingConfiguration = (UpdateStateMachine -> Maybe LoggingConfiguration)
-> (UpdateStateMachine
    -> Maybe LoggingConfiguration -> UpdateStateMachine)
-> Lens
     UpdateStateMachine
     UpdateStateMachine
     (Maybe LoggingConfiguration)
     (Maybe LoggingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStateMachine' {Maybe LoggingConfiguration
loggingConfiguration :: Maybe LoggingConfiguration
$sel:loggingConfiguration:UpdateStateMachine' :: UpdateStateMachine -> Maybe LoggingConfiguration
loggingConfiguration} -> Maybe LoggingConfiguration
loggingConfiguration) (\s :: UpdateStateMachine
s@UpdateStateMachine' {} Maybe LoggingConfiguration
a -> UpdateStateMachine
s {$sel:loggingConfiguration:UpdateStateMachine' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
a} :: UpdateStateMachine)

-- | The Amazon Resource Name (ARN) of the IAM role of the state machine.
updateStateMachine_roleArn :: Lens.Lens' UpdateStateMachine (Prelude.Maybe Prelude.Text)
updateStateMachine_roleArn :: (Maybe Text -> f (Maybe Text))
-> UpdateStateMachine -> f UpdateStateMachine
updateStateMachine_roleArn = (UpdateStateMachine -> Maybe Text)
-> (UpdateStateMachine -> Maybe Text -> UpdateStateMachine)
-> Lens
     UpdateStateMachine UpdateStateMachine (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStateMachine' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:UpdateStateMachine' :: UpdateStateMachine -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: UpdateStateMachine
s@UpdateStateMachine' {} Maybe Text
a -> UpdateStateMachine
s {$sel:roleArn:UpdateStateMachine' :: Maybe Text
roleArn = Maybe Text
a} :: UpdateStateMachine)

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

instance Core.AWSRequest UpdateStateMachine where
  type
    AWSResponse UpdateStateMachine =
      UpdateStateMachineResponse
  request :: UpdateStateMachine -> Request UpdateStateMachine
request = Service -> UpdateStateMachine -> Request UpdateStateMachine
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateStateMachine
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateStateMachine)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateStateMachine))
-> Logger
-> Service
-> Proxy UpdateStateMachine
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateStateMachine)))
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 ->
          Int -> POSIX -> UpdateStateMachineResponse
UpdateStateMachineResponse'
            (Int -> POSIX -> UpdateStateMachineResponse)
-> Either String Int
-> Either String (POSIX -> UpdateStateMachineResponse)
forall (f :: * -> *) a b. Functor 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 (POSIX -> UpdateStateMachineResponse)
-> Either String POSIX -> Either String UpdateStateMachineResponse
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
"updateDate")
      )

instance Prelude.Hashable UpdateStateMachine

instance Prelude.NFData UpdateStateMachine

instance Core.ToHeaders UpdateStateMachine where
  toHeaders :: UpdateStateMachine -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateStateMachine -> 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.UpdateStateMachine" ::
                          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 UpdateStateMachine where
  toJSON :: UpdateStateMachine -> Value
toJSON UpdateStateMachine' {Maybe Text
Maybe (Sensitive Text)
Maybe LoggingConfiguration
Maybe TracingConfiguration
Text
stateMachineArn :: Text
roleArn :: Maybe Text
loggingConfiguration :: Maybe LoggingConfiguration
tracingConfiguration :: Maybe TracingConfiguration
definition :: Maybe (Sensitive Text)
$sel:stateMachineArn:UpdateStateMachine' :: UpdateStateMachine -> Text
$sel:roleArn:UpdateStateMachine' :: UpdateStateMachine -> Maybe Text
$sel:loggingConfiguration:UpdateStateMachine' :: UpdateStateMachine -> Maybe LoggingConfiguration
$sel:tracingConfiguration:UpdateStateMachine' :: UpdateStateMachine -> Maybe TracingConfiguration
$sel:definition:UpdateStateMachine' :: UpdateStateMachine -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"definition" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
definition,
            (Text
"tracingConfiguration" Text -> TracingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TracingConfiguration -> Pair)
-> Maybe TracingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TracingConfiguration
tracingConfiguration,
            (Text
"loggingConfiguration" Text -> LoggingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LoggingConfiguration -> Pair)
-> Maybe LoggingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoggingConfiguration
loggingConfiguration,
            (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleArn,
            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 UpdateStateMachine where
  toPath :: UpdateStateMachine -> ByteString
toPath = ByteString -> UpdateStateMachine -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateStateMachineResponse' smart constructor.
data UpdateStateMachineResponse = UpdateStateMachineResponse'
  { -- | The response's http status code.
    UpdateStateMachineResponse -> Int
httpStatus :: Prelude.Int,
    -- | The date and time the state machine was updated.
    UpdateStateMachineResponse -> POSIX
updateDate :: Core.POSIX
  }
  deriving (UpdateStateMachineResponse -> UpdateStateMachineResponse -> Bool
(UpdateStateMachineResponse -> UpdateStateMachineResponse -> Bool)
-> (UpdateStateMachineResponse
    -> UpdateStateMachineResponse -> Bool)
-> Eq UpdateStateMachineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStateMachineResponse -> UpdateStateMachineResponse -> Bool
$c/= :: UpdateStateMachineResponse -> UpdateStateMachineResponse -> Bool
== :: UpdateStateMachineResponse -> UpdateStateMachineResponse -> Bool
$c== :: UpdateStateMachineResponse -> UpdateStateMachineResponse -> Bool
Prelude.Eq, ReadPrec [UpdateStateMachineResponse]
ReadPrec UpdateStateMachineResponse
Int -> ReadS UpdateStateMachineResponse
ReadS [UpdateStateMachineResponse]
(Int -> ReadS UpdateStateMachineResponse)
-> ReadS [UpdateStateMachineResponse]
-> ReadPrec UpdateStateMachineResponse
-> ReadPrec [UpdateStateMachineResponse]
-> Read UpdateStateMachineResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStateMachineResponse]
$creadListPrec :: ReadPrec [UpdateStateMachineResponse]
readPrec :: ReadPrec UpdateStateMachineResponse
$creadPrec :: ReadPrec UpdateStateMachineResponse
readList :: ReadS [UpdateStateMachineResponse]
$creadList :: ReadS [UpdateStateMachineResponse]
readsPrec :: Int -> ReadS UpdateStateMachineResponse
$creadsPrec :: Int -> ReadS UpdateStateMachineResponse
Prelude.Read, Int -> UpdateStateMachineResponse -> ShowS
[UpdateStateMachineResponse] -> ShowS
UpdateStateMachineResponse -> String
(Int -> UpdateStateMachineResponse -> ShowS)
-> (UpdateStateMachineResponse -> String)
-> ([UpdateStateMachineResponse] -> ShowS)
-> Show UpdateStateMachineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStateMachineResponse] -> ShowS
$cshowList :: [UpdateStateMachineResponse] -> ShowS
show :: UpdateStateMachineResponse -> String
$cshow :: UpdateStateMachineResponse -> String
showsPrec :: Int -> UpdateStateMachineResponse -> ShowS
$cshowsPrec :: Int -> UpdateStateMachineResponse -> ShowS
Prelude.Show, (forall x.
 UpdateStateMachineResponse -> Rep UpdateStateMachineResponse x)
-> (forall x.
    Rep UpdateStateMachineResponse x -> UpdateStateMachineResponse)
-> Generic UpdateStateMachineResponse
forall x.
Rep UpdateStateMachineResponse x -> UpdateStateMachineResponse
forall x.
UpdateStateMachineResponse -> Rep UpdateStateMachineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateStateMachineResponse x -> UpdateStateMachineResponse
$cfrom :: forall x.
UpdateStateMachineResponse -> Rep UpdateStateMachineResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateStateMachineResponse' 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:
--
-- 'httpStatus', 'updateStateMachineResponse_httpStatus' - The response's http status code.
--
-- 'updateDate', 'updateStateMachineResponse_updateDate' - The date and time the state machine was updated.
newUpdateStateMachineResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'updateDate'
  Prelude.UTCTime ->
  UpdateStateMachineResponse
newUpdateStateMachineResponse :: Int -> UTCTime -> UpdateStateMachineResponse
newUpdateStateMachineResponse
  Int
pHttpStatus_
  UTCTime
pUpdateDate_ =
    UpdateStateMachineResponse' :: Int -> POSIX -> UpdateStateMachineResponse
UpdateStateMachineResponse'
      { $sel:httpStatus:UpdateStateMachineResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:updateDate:UpdateStateMachineResponse' :: POSIX
updateDate = 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
pUpdateDate_
      }

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

-- | The date and time the state machine was updated.
updateStateMachineResponse_updateDate :: Lens.Lens' UpdateStateMachineResponse Prelude.UTCTime
updateStateMachineResponse_updateDate :: (UTCTime -> f UTCTime)
-> UpdateStateMachineResponse -> f UpdateStateMachineResponse
updateStateMachineResponse_updateDate = (UpdateStateMachineResponse -> POSIX)
-> (UpdateStateMachineResponse
    -> POSIX -> UpdateStateMachineResponse)
-> Lens
     UpdateStateMachineResponse UpdateStateMachineResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStateMachineResponse' {POSIX
updateDate :: POSIX
$sel:updateDate:UpdateStateMachineResponse' :: UpdateStateMachineResponse -> POSIX
updateDate} -> POSIX
updateDate) (\s :: UpdateStateMachineResponse
s@UpdateStateMachineResponse' {} POSIX
a -> UpdateStateMachineResponse
s {$sel:updateDate:UpdateStateMachineResponse' :: POSIX
updateDate = POSIX
a} :: UpdateStateMachineResponse) ((POSIX -> f POSIX)
 -> UpdateStateMachineResponse -> f UpdateStateMachineResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> UpdateStateMachineResponse
-> f UpdateStateMachineResponse
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 UpdateStateMachineResponse