{-# 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.SSM.StartChangeRequestExecution
-- 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)
--
-- Creates a change request for Change Manager. The Automation runbooks
-- specified in the change request run only after all required approvals
-- for the change request have been received.
module Amazonka.SSM.StartChangeRequestExecution
  ( -- * Creating a Request
    StartChangeRequestExecution (..),
    newStartChangeRequestExecution,

    -- * Request Lenses
    startChangeRequestExecution_scheduledTime,
    startChangeRequestExecution_changeDetails,
    startChangeRequestExecution_clientToken,
    startChangeRequestExecution_autoApprove,
    startChangeRequestExecution_scheduledEndTime,
    startChangeRequestExecution_parameters,
    startChangeRequestExecution_documentVersion,
    startChangeRequestExecution_changeRequestName,
    startChangeRequestExecution_tags,
    startChangeRequestExecution_documentName,
    startChangeRequestExecution_runbooks,

    -- * Destructuring the Response
    StartChangeRequestExecutionResponse (..),
    newStartChangeRequestExecutionResponse,

    -- * Response Lenses
    startChangeRequestExecutionResponse_automationExecutionId,
    startChangeRequestExecutionResponse_httpStatus,
  )
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.SSM.Types

-- | /See:/ 'newStartChangeRequestExecution' smart constructor.
data StartChangeRequestExecution = StartChangeRequestExecution'
  { -- | The date and time specified in the change request to run the Automation
    -- runbooks.
    --
    -- The Automation runbooks specified for the runbook workflow can\'t run
    -- until all required approvals for the change request have been received.
    StartChangeRequestExecution -> Maybe POSIX
scheduledTime :: Prelude.Maybe Core.POSIX,
    -- | User-provided details about the change. If no details are provided,
    -- content specified in the __Template information__ section of the
    -- associated change template is added.
    StartChangeRequestExecution -> Maybe Text
changeDetails :: Prelude.Maybe Prelude.Text,
    -- | The user-provided idempotency token. The token must be unique, is case
    -- insensitive, enforces the UUID format, and can\'t be reused.
    StartChangeRequestExecution -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the change request can be approved automatically
    -- without the need for manual approvals.
    --
    -- If @AutoApprovable@ is enabled in a change template, then setting
    -- @AutoApprove@ to @true@ in @StartChangeRequestExecution@ creates a
    -- change request that bypasses approver review.
    --
    -- Change Calendar restrictions are not bypassed in this scenario. If the
    -- state of an associated calendar is @CLOSED@, change freeze approvers
    -- must still grant permission for this change request to run. If they
    -- don\'t, the change won\'t be processed until the calendar state is again
    -- @OPEN@.
    StartChangeRequestExecution -> Maybe Bool
autoApprove :: Prelude.Maybe Prelude.Bool,
    -- | The time that the requester expects the runbook workflow related to the
    -- change request to complete. The time is an estimate only that the
    -- requester provides for reviewers.
    StartChangeRequestExecution -> Maybe POSIX
scheduledEndTime :: Prelude.Maybe Core.POSIX,
    -- | A key-value map of parameters that match the declared parameters in the
    -- change template document.
    StartChangeRequestExecution -> Maybe (HashMap Text [Text])
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The version of the change template document to run during the runbook
    -- workflow.
    StartChangeRequestExecution -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the change request associated with the runbook workflow to
    -- be run.
    StartChangeRequestExecution -> Maybe Text
changeRequestName :: Prelude.Maybe Prelude.Text,
    -- | Optional metadata that you assign to a resource. You can specify a
    -- maximum of five tags for a change request. Tags enable you to categorize
    -- a resource in different ways, such as by purpose, owner, or environment.
    -- For example, you might want to tag a change request to identify an
    -- environment or target Amazon Web Services Region. In this case, you
    -- could specify the following key-value pairs:
    --
    -- -   @Key=Environment,Value=Production@
    --
    -- -   @Key=Region,Value=us-east-2@
    StartChangeRequestExecution -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the change template document to run during the runbook
    -- workflow.
    StartChangeRequestExecution -> Text
documentName :: Prelude.Text,
    -- | Information about the Automation runbooks that are run during the
    -- runbook workflow.
    --
    -- The Automation runbooks specified for the runbook workflow can\'t run
    -- until all required approvals for the change request have been received.
    StartChangeRequestExecution -> NonEmpty Runbook
runbooks :: Prelude.NonEmpty Runbook
  }
  deriving (StartChangeRequestExecution -> StartChangeRequestExecution -> Bool
(StartChangeRequestExecution
 -> StartChangeRequestExecution -> Bool)
-> (StartChangeRequestExecution
    -> StartChangeRequestExecution -> Bool)
-> Eq StartChangeRequestExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartChangeRequestExecution -> StartChangeRequestExecution -> Bool
$c/= :: StartChangeRequestExecution -> StartChangeRequestExecution -> Bool
== :: StartChangeRequestExecution -> StartChangeRequestExecution -> Bool
$c== :: StartChangeRequestExecution -> StartChangeRequestExecution -> Bool
Prelude.Eq, ReadPrec [StartChangeRequestExecution]
ReadPrec StartChangeRequestExecution
Int -> ReadS StartChangeRequestExecution
ReadS [StartChangeRequestExecution]
(Int -> ReadS StartChangeRequestExecution)
-> ReadS [StartChangeRequestExecution]
-> ReadPrec StartChangeRequestExecution
-> ReadPrec [StartChangeRequestExecution]
-> Read StartChangeRequestExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartChangeRequestExecution]
$creadListPrec :: ReadPrec [StartChangeRequestExecution]
readPrec :: ReadPrec StartChangeRequestExecution
$creadPrec :: ReadPrec StartChangeRequestExecution
readList :: ReadS [StartChangeRequestExecution]
$creadList :: ReadS [StartChangeRequestExecution]
readsPrec :: Int -> ReadS StartChangeRequestExecution
$creadsPrec :: Int -> ReadS StartChangeRequestExecution
Prelude.Read, Int -> StartChangeRequestExecution -> ShowS
[StartChangeRequestExecution] -> ShowS
StartChangeRequestExecution -> String
(Int -> StartChangeRequestExecution -> ShowS)
-> (StartChangeRequestExecution -> String)
-> ([StartChangeRequestExecution] -> ShowS)
-> Show StartChangeRequestExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartChangeRequestExecution] -> ShowS
$cshowList :: [StartChangeRequestExecution] -> ShowS
show :: StartChangeRequestExecution -> String
$cshow :: StartChangeRequestExecution -> String
showsPrec :: Int -> StartChangeRequestExecution -> ShowS
$cshowsPrec :: Int -> StartChangeRequestExecution -> ShowS
Prelude.Show, (forall x.
 StartChangeRequestExecution -> Rep StartChangeRequestExecution x)
-> (forall x.
    Rep StartChangeRequestExecution x -> StartChangeRequestExecution)
-> Generic StartChangeRequestExecution
forall x.
Rep StartChangeRequestExecution x -> StartChangeRequestExecution
forall x.
StartChangeRequestExecution -> Rep StartChangeRequestExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartChangeRequestExecution x -> StartChangeRequestExecution
$cfrom :: forall x.
StartChangeRequestExecution -> Rep StartChangeRequestExecution x
Prelude.Generic)

-- |
-- Create a value of 'StartChangeRequestExecution' 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:
--
-- 'scheduledTime', 'startChangeRequestExecution_scheduledTime' - The date and time specified in the change request to run the Automation
-- runbooks.
--
-- The Automation runbooks specified for the runbook workflow can\'t run
-- until all required approvals for the change request have been received.
--
-- 'changeDetails', 'startChangeRequestExecution_changeDetails' - User-provided details about the change. If no details are provided,
-- content specified in the __Template information__ section of the
-- associated change template is added.
--
-- 'clientToken', 'startChangeRequestExecution_clientToken' - The user-provided idempotency token. The token must be unique, is case
-- insensitive, enforces the UUID format, and can\'t be reused.
--
-- 'autoApprove', 'startChangeRequestExecution_autoApprove' - Indicates whether the change request can be approved automatically
-- without the need for manual approvals.
--
-- If @AutoApprovable@ is enabled in a change template, then setting
-- @AutoApprove@ to @true@ in @StartChangeRequestExecution@ creates a
-- change request that bypasses approver review.
--
-- Change Calendar restrictions are not bypassed in this scenario. If the
-- state of an associated calendar is @CLOSED@, change freeze approvers
-- must still grant permission for this change request to run. If they
-- don\'t, the change won\'t be processed until the calendar state is again
-- @OPEN@.
--
-- 'scheduledEndTime', 'startChangeRequestExecution_scheduledEndTime' - The time that the requester expects the runbook workflow related to the
-- change request to complete. The time is an estimate only that the
-- requester provides for reviewers.
--
-- 'parameters', 'startChangeRequestExecution_parameters' - A key-value map of parameters that match the declared parameters in the
-- change template document.
--
-- 'documentVersion', 'startChangeRequestExecution_documentVersion' - The version of the change template document to run during the runbook
-- workflow.
--
-- 'changeRequestName', 'startChangeRequestExecution_changeRequestName' - The name of the change request associated with the runbook workflow to
-- be run.
--
-- 'tags', 'startChangeRequestExecution_tags' - Optional metadata that you assign to a resource. You can specify a
-- maximum of five tags for a change request. Tags enable you to categorize
-- a resource in different ways, such as by purpose, owner, or environment.
-- For example, you might want to tag a change request to identify an
-- environment or target Amazon Web Services Region. In this case, you
-- could specify the following key-value pairs:
--
-- -   @Key=Environment,Value=Production@
--
-- -   @Key=Region,Value=us-east-2@
--
-- 'documentName', 'startChangeRequestExecution_documentName' - The name of the change template document to run during the runbook
-- workflow.
--
-- 'runbooks', 'startChangeRequestExecution_runbooks' - Information about the Automation runbooks that are run during the
-- runbook workflow.
--
-- The Automation runbooks specified for the runbook workflow can\'t run
-- until all required approvals for the change request have been received.
newStartChangeRequestExecution ::
  -- | 'documentName'
  Prelude.Text ->
  -- | 'runbooks'
  Prelude.NonEmpty Runbook ->
  StartChangeRequestExecution
newStartChangeRequestExecution :: Text -> NonEmpty Runbook -> StartChangeRequestExecution
newStartChangeRequestExecution
  Text
pDocumentName_
  NonEmpty Runbook
pRunbooks_ =
    StartChangeRequestExecution' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> NonEmpty Runbook
-> StartChangeRequestExecution
StartChangeRequestExecution'
      { $sel:scheduledTime:StartChangeRequestExecution' :: Maybe POSIX
scheduledTime =
          Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:changeDetails:StartChangeRequestExecution' :: Maybe Text
changeDetails = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:StartChangeRequestExecution' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:autoApprove:StartChangeRequestExecution' :: Maybe Bool
autoApprove = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:scheduledEndTime:StartChangeRequestExecution' :: Maybe POSIX
scheduledEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:parameters:StartChangeRequestExecution' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
        $sel:documentVersion:StartChangeRequestExecution' :: Maybe Text
documentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:changeRequestName:StartChangeRequestExecution' :: Maybe Text
changeRequestName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:StartChangeRequestExecution' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:documentName:StartChangeRequestExecution' :: Text
documentName = Text
pDocumentName_,
        $sel:runbooks:StartChangeRequestExecution' :: NonEmpty Runbook
runbooks = Tagged (NonEmpty Runbook) (Identity (NonEmpty Runbook))
-> Tagged (NonEmpty Runbook) (Identity (NonEmpty Runbook))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Runbook) (Identity (NonEmpty Runbook))
 -> Tagged (NonEmpty Runbook) (Identity (NonEmpty Runbook)))
-> NonEmpty Runbook -> NonEmpty Runbook
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Runbook
pRunbooks_
      }

-- | The date and time specified in the change request to run the Automation
-- runbooks.
--
-- The Automation runbooks specified for the runbook workflow can\'t run
-- until all required approvals for the change request have been received.
startChangeRequestExecution_scheduledTime :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.UTCTime)
startChangeRequestExecution_scheduledTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_scheduledTime = (StartChangeRequestExecution -> Maybe POSIX)
-> (StartChangeRequestExecution
    -> Maybe POSIX -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe POSIX
scheduledTime :: Maybe POSIX
$sel:scheduledTime:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe POSIX
scheduledTime} -> Maybe POSIX
scheduledTime) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe POSIX
a -> StartChangeRequestExecution
s {$sel:scheduledTime:StartChangeRequestExecution' :: Maybe POSIX
scheduledTime = Maybe POSIX
a} :: StartChangeRequestExecution) ((Maybe POSIX -> f (Maybe POSIX))
 -> StartChangeRequestExecution -> f StartChangeRequestExecution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartChangeRequestExecution
-> f StartChangeRequestExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | User-provided details about the change. If no details are provided,
-- content specified in the __Template information__ section of the
-- associated change template is added.
startChangeRequestExecution_changeDetails :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.Text)
startChangeRequestExecution_changeDetails :: (Maybe Text -> f (Maybe Text))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_changeDetails = (StartChangeRequestExecution -> Maybe Text)
-> (StartChangeRequestExecution
    -> Maybe Text -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe Text
changeDetails :: Maybe Text
$sel:changeDetails:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
changeDetails} -> Maybe Text
changeDetails) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe Text
a -> StartChangeRequestExecution
s {$sel:changeDetails:StartChangeRequestExecution' :: Maybe Text
changeDetails = Maybe Text
a} :: StartChangeRequestExecution)

-- | The user-provided idempotency token. The token must be unique, is case
-- insensitive, enforces the UUID format, and can\'t be reused.
startChangeRequestExecution_clientToken :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.Text)
startChangeRequestExecution_clientToken :: (Maybe Text -> f (Maybe Text))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_clientToken = (StartChangeRequestExecution -> Maybe Text)
-> (StartChangeRequestExecution
    -> Maybe Text -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe Text
a -> StartChangeRequestExecution
s {$sel:clientToken:StartChangeRequestExecution' :: Maybe Text
clientToken = Maybe Text
a} :: StartChangeRequestExecution)

-- | Indicates whether the change request can be approved automatically
-- without the need for manual approvals.
--
-- If @AutoApprovable@ is enabled in a change template, then setting
-- @AutoApprove@ to @true@ in @StartChangeRequestExecution@ creates a
-- change request that bypasses approver review.
--
-- Change Calendar restrictions are not bypassed in this scenario. If the
-- state of an associated calendar is @CLOSED@, change freeze approvers
-- must still grant permission for this change request to run. If they
-- don\'t, the change won\'t be processed until the calendar state is again
-- @OPEN@.
startChangeRequestExecution_autoApprove :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.Bool)
startChangeRequestExecution_autoApprove :: (Maybe Bool -> f (Maybe Bool))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_autoApprove = (StartChangeRequestExecution -> Maybe Bool)
-> (StartChangeRequestExecution
    -> Maybe Bool -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe Bool
autoApprove :: Maybe Bool
$sel:autoApprove:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Bool
autoApprove} -> Maybe Bool
autoApprove) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe Bool
a -> StartChangeRequestExecution
s {$sel:autoApprove:StartChangeRequestExecution' :: Maybe Bool
autoApprove = Maybe Bool
a} :: StartChangeRequestExecution)

-- | The time that the requester expects the runbook workflow related to the
-- change request to complete. The time is an estimate only that the
-- requester provides for reviewers.
startChangeRequestExecution_scheduledEndTime :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.UTCTime)
startChangeRequestExecution_scheduledEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_scheduledEndTime = (StartChangeRequestExecution -> Maybe POSIX)
-> (StartChangeRequestExecution
    -> Maybe POSIX -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe POSIX
scheduledEndTime :: Maybe POSIX
$sel:scheduledEndTime:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe POSIX
scheduledEndTime} -> Maybe POSIX
scheduledEndTime) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe POSIX
a -> StartChangeRequestExecution
s {$sel:scheduledEndTime:StartChangeRequestExecution' :: Maybe POSIX
scheduledEndTime = Maybe POSIX
a} :: StartChangeRequestExecution) ((Maybe POSIX -> f (Maybe POSIX))
 -> StartChangeRequestExecution -> f StartChangeRequestExecution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartChangeRequestExecution
-> f StartChangeRequestExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A key-value map of parameters that match the declared parameters in the
-- change template document.
startChangeRequestExecution_parameters :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
startChangeRequestExecution_parameters :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_parameters = (StartChangeRequestExecution -> Maybe (HashMap Text [Text]))
-> (StartChangeRequestExecution
    -> Maybe (HashMap Text [Text]) -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
$sel:parameters:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe (HashMap Text [Text])
parameters} -> Maybe (HashMap Text [Text])
parameters) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe (HashMap Text [Text])
a -> StartChangeRequestExecution
s {$sel:parameters:StartChangeRequestExecution' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
a} :: StartChangeRequestExecution) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> StartChangeRequestExecution -> f StartChangeRequestExecution)
-> ((Maybe (HashMap Text [Text])
     -> f (Maybe (HashMap Text [Text])))
    -> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> StartChangeRequestExecution
-> f StartChangeRequestExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
-> Iso
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [Text]))
     (Maybe (HashMap Text [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
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
  (HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The version of the change template document to run during the runbook
-- workflow.
startChangeRequestExecution_documentVersion :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.Text)
startChangeRequestExecution_documentVersion :: (Maybe Text -> f (Maybe Text))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_documentVersion = (StartChangeRequestExecution -> Maybe Text)
-> (StartChangeRequestExecution
    -> Maybe Text -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe Text
a -> StartChangeRequestExecution
s {$sel:documentVersion:StartChangeRequestExecution' :: Maybe Text
documentVersion = Maybe Text
a} :: StartChangeRequestExecution)

-- | The name of the change request associated with the runbook workflow to
-- be run.
startChangeRequestExecution_changeRequestName :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe Prelude.Text)
startChangeRequestExecution_changeRequestName :: (Maybe Text -> f (Maybe Text))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_changeRequestName = (StartChangeRequestExecution -> Maybe Text)
-> (StartChangeRequestExecution
    -> Maybe Text -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe Text
changeRequestName :: Maybe Text
$sel:changeRequestName:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
changeRequestName} -> Maybe Text
changeRequestName) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe Text
a -> StartChangeRequestExecution
s {$sel:changeRequestName:StartChangeRequestExecution' :: Maybe Text
changeRequestName = Maybe Text
a} :: StartChangeRequestExecution)

-- | Optional metadata that you assign to a resource. You can specify a
-- maximum of five tags for a change request. Tags enable you to categorize
-- a resource in different ways, such as by purpose, owner, or environment.
-- For example, you might want to tag a change request to identify an
-- environment or target Amazon Web Services Region. In this case, you
-- could specify the following key-value pairs:
--
-- -   @Key=Environment,Value=Production@
--
-- -   @Key=Region,Value=us-east-2@
startChangeRequestExecution_tags :: Lens.Lens' StartChangeRequestExecution (Prelude.Maybe [Tag])
startChangeRequestExecution_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_tags = (StartChangeRequestExecution -> Maybe [Tag])
-> (StartChangeRequestExecution
    -> Maybe [Tag] -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Maybe [Tag]
a -> StartChangeRequestExecution
s {$sel:tags:StartChangeRequestExecution' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: StartChangeRequestExecution) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> StartChangeRequestExecution -> f StartChangeRequestExecution)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> StartChangeRequestExecution
-> f StartChangeRequestExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the change template document to run during the runbook
-- workflow.
startChangeRequestExecution_documentName :: Lens.Lens' StartChangeRequestExecution Prelude.Text
startChangeRequestExecution_documentName :: (Text -> f Text)
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_documentName = (StartChangeRequestExecution -> Text)
-> (StartChangeRequestExecution
    -> Text -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution StartChangeRequestExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {Text
documentName :: Text
$sel:documentName:StartChangeRequestExecution' :: StartChangeRequestExecution -> Text
documentName} -> Text
documentName) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} Text
a -> StartChangeRequestExecution
s {$sel:documentName:StartChangeRequestExecution' :: Text
documentName = Text
a} :: StartChangeRequestExecution)

-- | Information about the Automation runbooks that are run during the
-- runbook workflow.
--
-- The Automation runbooks specified for the runbook workflow can\'t run
-- until all required approvals for the change request have been received.
startChangeRequestExecution_runbooks :: Lens.Lens' StartChangeRequestExecution (Prelude.NonEmpty Runbook)
startChangeRequestExecution_runbooks :: (NonEmpty Runbook -> f (NonEmpty Runbook))
-> StartChangeRequestExecution -> f StartChangeRequestExecution
startChangeRequestExecution_runbooks = (StartChangeRequestExecution -> NonEmpty Runbook)
-> (StartChangeRequestExecution
    -> NonEmpty Runbook -> StartChangeRequestExecution)
-> Lens
     StartChangeRequestExecution
     StartChangeRequestExecution
     (NonEmpty Runbook)
     (NonEmpty Runbook)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecution' {NonEmpty Runbook
runbooks :: NonEmpty Runbook
$sel:runbooks:StartChangeRequestExecution' :: StartChangeRequestExecution -> NonEmpty Runbook
runbooks} -> NonEmpty Runbook
runbooks) (\s :: StartChangeRequestExecution
s@StartChangeRequestExecution' {} NonEmpty Runbook
a -> StartChangeRequestExecution
s {$sel:runbooks:StartChangeRequestExecution' :: NonEmpty Runbook
runbooks = NonEmpty Runbook
a} :: StartChangeRequestExecution) ((NonEmpty Runbook -> f (NonEmpty Runbook))
 -> StartChangeRequestExecution -> f StartChangeRequestExecution)
-> ((NonEmpty Runbook -> f (NonEmpty Runbook))
    -> NonEmpty Runbook -> f (NonEmpty Runbook))
-> (NonEmpty Runbook -> f (NonEmpty Runbook))
-> StartChangeRequestExecution
-> f StartChangeRequestExecution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Runbook -> f (NonEmpty Runbook))
-> NonEmpty Runbook -> f (NonEmpty Runbook)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest StartChangeRequestExecution where
  type
    AWSResponse StartChangeRequestExecution =
      StartChangeRequestExecutionResponse
  request :: StartChangeRequestExecution -> Request StartChangeRequestExecution
request = Service
-> StartChangeRequestExecution
-> Request StartChangeRequestExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartChangeRequestExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartChangeRequestExecution)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartChangeRequestExecution))
-> Logger
-> Service
-> Proxy StartChangeRequestExecution
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartChangeRequestExecution)))
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 Text -> Int -> StartChangeRequestExecutionResponse
StartChangeRequestExecutionResponse'
            (Maybe Text -> Int -> StartChangeRequestExecutionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartChangeRequestExecutionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AutomationExecutionId")
            Either String (Int -> StartChangeRequestExecutionResponse)
-> Either String Int
-> Either String StartChangeRequestExecutionResponse
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))
      )

instance Prelude.Hashable StartChangeRequestExecution

instance Prelude.NFData StartChangeRequestExecution

instance Core.ToHeaders StartChangeRequestExecution where
  toHeaders :: StartChangeRequestExecution -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartChangeRequestExecution -> 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
"AmazonSSM.StartChangeRequestExecution" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON StartChangeRequestExecution where
  toJSON :: StartChangeRequestExecution -> Value
toJSON StartChangeRequestExecution' {Maybe Bool
Maybe [Tag]
Maybe Text
Maybe (HashMap Text [Text])
Maybe POSIX
NonEmpty Runbook
Text
runbooks :: NonEmpty Runbook
documentName :: Text
tags :: Maybe [Tag]
changeRequestName :: Maybe Text
documentVersion :: Maybe Text
parameters :: Maybe (HashMap Text [Text])
scheduledEndTime :: Maybe POSIX
autoApprove :: Maybe Bool
clientToken :: Maybe Text
changeDetails :: Maybe Text
scheduledTime :: Maybe POSIX
$sel:runbooks:StartChangeRequestExecution' :: StartChangeRequestExecution -> NonEmpty Runbook
$sel:documentName:StartChangeRequestExecution' :: StartChangeRequestExecution -> Text
$sel:tags:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe [Tag]
$sel:changeRequestName:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
$sel:documentVersion:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
$sel:parameters:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe (HashMap Text [Text])
$sel:scheduledEndTime:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe POSIX
$sel:autoApprove:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Bool
$sel:clientToken:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
$sel:changeDetails:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe Text
$sel:scheduledTime:StartChangeRequestExecution' :: StartChangeRequestExecution -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ScheduledTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
scheduledTime,
            (Text
"ChangeDetails" 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
changeDetails,
            (Text
"ClientToken" 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
clientToken,
            (Text
"AutoApprove" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoApprove,
            (Text
"ScheduledEndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
scheduledEndTime,
            (Text
"Parameters" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
parameters,
            (Text
"DocumentVersion" 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
documentVersion,
            (Text
"ChangeRequestName" 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
changeRequestName,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DocumentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
documentName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Runbooks" Text -> NonEmpty Runbook -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Runbook
runbooks)
          ]
      )

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

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

-- | /See:/ 'newStartChangeRequestExecutionResponse' smart constructor.
data StartChangeRequestExecutionResponse = StartChangeRequestExecutionResponse'
  { -- | The unique ID of a runbook workflow operation. (A runbook workflow is a
    -- type of Automation operation.)
    StartChangeRequestExecutionResponse -> Maybe Text
automationExecutionId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartChangeRequestExecutionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartChangeRequestExecutionResponse
-> StartChangeRequestExecutionResponse -> Bool
(StartChangeRequestExecutionResponse
 -> StartChangeRequestExecutionResponse -> Bool)
-> (StartChangeRequestExecutionResponse
    -> StartChangeRequestExecutionResponse -> Bool)
-> Eq StartChangeRequestExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartChangeRequestExecutionResponse
-> StartChangeRequestExecutionResponse -> Bool
$c/= :: StartChangeRequestExecutionResponse
-> StartChangeRequestExecutionResponse -> Bool
== :: StartChangeRequestExecutionResponse
-> StartChangeRequestExecutionResponse -> Bool
$c== :: StartChangeRequestExecutionResponse
-> StartChangeRequestExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StartChangeRequestExecutionResponse]
ReadPrec StartChangeRequestExecutionResponse
Int -> ReadS StartChangeRequestExecutionResponse
ReadS [StartChangeRequestExecutionResponse]
(Int -> ReadS StartChangeRequestExecutionResponse)
-> ReadS [StartChangeRequestExecutionResponse]
-> ReadPrec StartChangeRequestExecutionResponse
-> ReadPrec [StartChangeRequestExecutionResponse]
-> Read StartChangeRequestExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartChangeRequestExecutionResponse]
$creadListPrec :: ReadPrec [StartChangeRequestExecutionResponse]
readPrec :: ReadPrec StartChangeRequestExecutionResponse
$creadPrec :: ReadPrec StartChangeRequestExecutionResponse
readList :: ReadS [StartChangeRequestExecutionResponse]
$creadList :: ReadS [StartChangeRequestExecutionResponse]
readsPrec :: Int -> ReadS StartChangeRequestExecutionResponse
$creadsPrec :: Int -> ReadS StartChangeRequestExecutionResponse
Prelude.Read, Int -> StartChangeRequestExecutionResponse -> ShowS
[StartChangeRequestExecutionResponse] -> ShowS
StartChangeRequestExecutionResponse -> String
(Int -> StartChangeRequestExecutionResponse -> ShowS)
-> (StartChangeRequestExecutionResponse -> String)
-> ([StartChangeRequestExecutionResponse] -> ShowS)
-> Show StartChangeRequestExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartChangeRequestExecutionResponse] -> ShowS
$cshowList :: [StartChangeRequestExecutionResponse] -> ShowS
show :: StartChangeRequestExecutionResponse -> String
$cshow :: StartChangeRequestExecutionResponse -> String
showsPrec :: Int -> StartChangeRequestExecutionResponse -> ShowS
$cshowsPrec :: Int -> StartChangeRequestExecutionResponse -> ShowS
Prelude.Show, (forall x.
 StartChangeRequestExecutionResponse
 -> Rep StartChangeRequestExecutionResponse x)
-> (forall x.
    Rep StartChangeRequestExecutionResponse x
    -> StartChangeRequestExecutionResponse)
-> Generic StartChangeRequestExecutionResponse
forall x.
Rep StartChangeRequestExecutionResponse x
-> StartChangeRequestExecutionResponse
forall x.
StartChangeRequestExecutionResponse
-> Rep StartChangeRequestExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartChangeRequestExecutionResponse x
-> StartChangeRequestExecutionResponse
$cfrom :: forall x.
StartChangeRequestExecutionResponse
-> Rep StartChangeRequestExecutionResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartChangeRequestExecutionResponse' 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:
--
-- 'automationExecutionId', 'startChangeRequestExecutionResponse_automationExecutionId' - The unique ID of a runbook workflow operation. (A runbook workflow is a
-- type of Automation operation.)
--
-- 'httpStatus', 'startChangeRequestExecutionResponse_httpStatus' - The response's http status code.
newStartChangeRequestExecutionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartChangeRequestExecutionResponse
newStartChangeRequestExecutionResponse :: Int -> StartChangeRequestExecutionResponse
newStartChangeRequestExecutionResponse Int
pHttpStatus_ =
  StartChangeRequestExecutionResponse' :: Maybe Text -> Int -> StartChangeRequestExecutionResponse
StartChangeRequestExecutionResponse'
    { $sel:automationExecutionId:StartChangeRequestExecutionResponse' :: Maybe Text
automationExecutionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartChangeRequestExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique ID of a runbook workflow operation. (A runbook workflow is a
-- type of Automation operation.)
startChangeRequestExecutionResponse_automationExecutionId :: Lens.Lens' StartChangeRequestExecutionResponse (Prelude.Maybe Prelude.Text)
startChangeRequestExecutionResponse_automationExecutionId :: (Maybe Text -> f (Maybe Text))
-> StartChangeRequestExecutionResponse
-> f StartChangeRequestExecutionResponse
startChangeRequestExecutionResponse_automationExecutionId = (StartChangeRequestExecutionResponse -> Maybe Text)
-> (StartChangeRequestExecutionResponse
    -> Maybe Text -> StartChangeRequestExecutionResponse)
-> Lens
     StartChangeRequestExecutionResponse
     StartChangeRequestExecutionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeRequestExecutionResponse' {Maybe Text
automationExecutionId :: Maybe Text
$sel:automationExecutionId:StartChangeRequestExecutionResponse' :: StartChangeRequestExecutionResponse -> Maybe Text
automationExecutionId} -> Maybe Text
automationExecutionId) (\s :: StartChangeRequestExecutionResponse
s@StartChangeRequestExecutionResponse' {} Maybe Text
a -> StartChangeRequestExecutionResponse
s {$sel:automationExecutionId:StartChangeRequestExecutionResponse' :: Maybe Text
automationExecutionId = Maybe Text
a} :: StartChangeRequestExecutionResponse)

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

instance
  Prelude.NFData
    StartChangeRequestExecutionResponse