{-# 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.AutoScaling.StartInstanceRefresh
-- 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)
--
-- Starts a new instance refresh operation. An instance refresh performs a
-- rolling replacement of all or some instances in an Auto Scaling group.
-- Each instance is terminated first and then replaced, which temporarily
-- reduces the capacity available within your Auto Scaling group.
--
-- This operation is part of the
-- <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html instance refresh feature>
-- in Amazon EC2 Auto Scaling, which helps you update instances in your
-- Auto Scaling group. This feature is helpful, for example, when you have
-- a new AMI or a new user data script. You just need to create a new
-- launch template that specifies the new AMI or user data script. Then
-- start an instance refresh to immediately begin the process of updating
-- instances in the group.
--
-- If the call succeeds, it creates a new instance refresh request with a
-- unique ID that you can use to track its progress. To query its status,
-- call the DescribeInstanceRefreshes API. To describe the instance
-- refreshes that have already run, call the DescribeInstanceRefreshes API.
-- To cancel an instance refresh operation in progress, use the
-- CancelInstanceRefresh API.
module Amazonka.AutoScaling.StartInstanceRefresh
  ( -- * Creating a Request
    StartInstanceRefresh (..),
    newStartInstanceRefresh,

    -- * Request Lenses
    startInstanceRefresh_preferences,
    startInstanceRefresh_strategy,
    startInstanceRefresh_desiredConfiguration,
    startInstanceRefresh_autoScalingGroupName,

    -- * Destructuring the Response
    StartInstanceRefreshResponse (..),
    newStartInstanceRefreshResponse,

    -- * Response Lenses
    startInstanceRefreshResponse_instanceRefreshId,
    startInstanceRefreshResponse_httpStatus,
  )
where

import Amazonka.AutoScaling.Types
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

-- | /See:/ 'newStartInstanceRefresh' smart constructor.
data StartInstanceRefresh = StartInstanceRefresh'
  { -- | Set of preferences associated with the instance refresh request. If not
    -- provided, the default values are used.
    StartInstanceRefresh -> Maybe RefreshPreferences
preferences :: Prelude.Maybe RefreshPreferences,
    -- | The strategy to use for the instance refresh. The only valid value is
    -- @Rolling@.
    --
    -- A rolling update helps you update your instances gradually. A rolling
    -- update can fail due to failed health checks or if instances are on
    -- standby or are protected from scale in. If the rolling update process
    -- fails, any instances that are replaced are not rolled back to their
    -- previous configuration.
    StartInstanceRefresh -> Maybe RefreshStrategy
strategy :: Prelude.Maybe RefreshStrategy,
    -- | The desired configuration. For example, the desired configuration can
    -- specify a new launch template or a new version of the current launch
    -- template.
    --
    -- Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
    -- settings of the Auto Scaling group to reflect the new desired
    -- configuration.
    --
    -- When you specify a new launch template or a new version of the current
    -- launch template for your desired configuration, consider enabling the
    -- @SkipMatching@ property in preferences. If it\'s enabled, Amazon EC2
    -- Auto Scaling skips replacing instances that already use the specified
    -- launch template and version. This can help you reduce the number of
    -- replacements that are required to apply updates.
    StartInstanceRefresh -> Maybe DesiredConfiguration
desiredConfiguration :: Prelude.Maybe DesiredConfiguration,
    -- | The name of the Auto Scaling group.
    StartInstanceRefresh -> Text
autoScalingGroupName :: Prelude.Text
  }
  deriving (StartInstanceRefresh -> StartInstanceRefresh -> Bool
(StartInstanceRefresh -> StartInstanceRefresh -> Bool)
-> (StartInstanceRefresh -> StartInstanceRefresh -> Bool)
-> Eq StartInstanceRefresh
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartInstanceRefresh -> StartInstanceRefresh -> Bool
$c/= :: StartInstanceRefresh -> StartInstanceRefresh -> Bool
== :: StartInstanceRefresh -> StartInstanceRefresh -> Bool
$c== :: StartInstanceRefresh -> StartInstanceRefresh -> Bool
Prelude.Eq, ReadPrec [StartInstanceRefresh]
ReadPrec StartInstanceRefresh
Int -> ReadS StartInstanceRefresh
ReadS [StartInstanceRefresh]
(Int -> ReadS StartInstanceRefresh)
-> ReadS [StartInstanceRefresh]
-> ReadPrec StartInstanceRefresh
-> ReadPrec [StartInstanceRefresh]
-> Read StartInstanceRefresh
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartInstanceRefresh]
$creadListPrec :: ReadPrec [StartInstanceRefresh]
readPrec :: ReadPrec StartInstanceRefresh
$creadPrec :: ReadPrec StartInstanceRefresh
readList :: ReadS [StartInstanceRefresh]
$creadList :: ReadS [StartInstanceRefresh]
readsPrec :: Int -> ReadS StartInstanceRefresh
$creadsPrec :: Int -> ReadS StartInstanceRefresh
Prelude.Read, Int -> StartInstanceRefresh -> ShowS
[StartInstanceRefresh] -> ShowS
StartInstanceRefresh -> String
(Int -> StartInstanceRefresh -> ShowS)
-> (StartInstanceRefresh -> String)
-> ([StartInstanceRefresh] -> ShowS)
-> Show StartInstanceRefresh
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartInstanceRefresh] -> ShowS
$cshowList :: [StartInstanceRefresh] -> ShowS
show :: StartInstanceRefresh -> String
$cshow :: StartInstanceRefresh -> String
showsPrec :: Int -> StartInstanceRefresh -> ShowS
$cshowsPrec :: Int -> StartInstanceRefresh -> ShowS
Prelude.Show, (forall x. StartInstanceRefresh -> Rep StartInstanceRefresh x)
-> (forall x. Rep StartInstanceRefresh x -> StartInstanceRefresh)
-> Generic StartInstanceRefresh
forall x. Rep StartInstanceRefresh x -> StartInstanceRefresh
forall x. StartInstanceRefresh -> Rep StartInstanceRefresh x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartInstanceRefresh x -> StartInstanceRefresh
$cfrom :: forall x. StartInstanceRefresh -> Rep StartInstanceRefresh x
Prelude.Generic)

-- |
-- Create a value of 'StartInstanceRefresh' 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:
--
-- 'preferences', 'startInstanceRefresh_preferences' - Set of preferences associated with the instance refresh request. If not
-- provided, the default values are used.
--
-- 'strategy', 'startInstanceRefresh_strategy' - The strategy to use for the instance refresh. The only valid value is
-- @Rolling@.
--
-- A rolling update helps you update your instances gradually. A rolling
-- update can fail due to failed health checks or if instances are on
-- standby or are protected from scale in. If the rolling update process
-- fails, any instances that are replaced are not rolled back to their
-- previous configuration.
--
-- 'desiredConfiguration', 'startInstanceRefresh_desiredConfiguration' - The desired configuration. For example, the desired configuration can
-- specify a new launch template or a new version of the current launch
-- template.
--
-- Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
-- settings of the Auto Scaling group to reflect the new desired
-- configuration.
--
-- When you specify a new launch template or a new version of the current
-- launch template for your desired configuration, consider enabling the
-- @SkipMatching@ property in preferences. If it\'s enabled, Amazon EC2
-- Auto Scaling skips replacing instances that already use the specified
-- launch template and version. This can help you reduce the number of
-- replacements that are required to apply updates.
--
-- 'autoScalingGroupName', 'startInstanceRefresh_autoScalingGroupName' - The name of the Auto Scaling group.
newStartInstanceRefresh ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  StartInstanceRefresh
newStartInstanceRefresh :: Text -> StartInstanceRefresh
newStartInstanceRefresh Text
pAutoScalingGroupName_ =
  StartInstanceRefresh' :: Maybe RefreshPreferences
-> Maybe RefreshStrategy
-> Maybe DesiredConfiguration
-> Text
-> StartInstanceRefresh
StartInstanceRefresh'
    { $sel:preferences:StartInstanceRefresh' :: Maybe RefreshPreferences
preferences =
        Maybe RefreshPreferences
forall a. Maybe a
Prelude.Nothing,
      $sel:strategy:StartInstanceRefresh' :: Maybe RefreshStrategy
strategy = Maybe RefreshStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:desiredConfiguration:StartInstanceRefresh' :: Maybe DesiredConfiguration
desiredConfiguration = Maybe DesiredConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroupName:StartInstanceRefresh' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_
    }

-- | Set of preferences associated with the instance refresh request. If not
-- provided, the default values are used.
startInstanceRefresh_preferences :: Lens.Lens' StartInstanceRefresh (Prelude.Maybe RefreshPreferences)
startInstanceRefresh_preferences :: (Maybe RefreshPreferences -> f (Maybe RefreshPreferences))
-> StartInstanceRefresh -> f StartInstanceRefresh
startInstanceRefresh_preferences = (StartInstanceRefresh -> Maybe RefreshPreferences)
-> (StartInstanceRefresh
    -> Maybe RefreshPreferences -> StartInstanceRefresh)
-> Lens
     StartInstanceRefresh
     StartInstanceRefresh
     (Maybe RefreshPreferences)
     (Maybe RefreshPreferences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartInstanceRefresh' {Maybe RefreshPreferences
preferences :: Maybe RefreshPreferences
$sel:preferences:StartInstanceRefresh' :: StartInstanceRefresh -> Maybe RefreshPreferences
preferences} -> Maybe RefreshPreferences
preferences) (\s :: StartInstanceRefresh
s@StartInstanceRefresh' {} Maybe RefreshPreferences
a -> StartInstanceRefresh
s {$sel:preferences:StartInstanceRefresh' :: Maybe RefreshPreferences
preferences = Maybe RefreshPreferences
a} :: StartInstanceRefresh)

-- | The strategy to use for the instance refresh. The only valid value is
-- @Rolling@.
--
-- A rolling update helps you update your instances gradually. A rolling
-- update can fail due to failed health checks or if instances are on
-- standby or are protected from scale in. If the rolling update process
-- fails, any instances that are replaced are not rolled back to their
-- previous configuration.
startInstanceRefresh_strategy :: Lens.Lens' StartInstanceRefresh (Prelude.Maybe RefreshStrategy)
startInstanceRefresh_strategy :: (Maybe RefreshStrategy -> f (Maybe RefreshStrategy))
-> StartInstanceRefresh -> f StartInstanceRefresh
startInstanceRefresh_strategy = (StartInstanceRefresh -> Maybe RefreshStrategy)
-> (StartInstanceRefresh
    -> Maybe RefreshStrategy -> StartInstanceRefresh)
-> Lens
     StartInstanceRefresh
     StartInstanceRefresh
     (Maybe RefreshStrategy)
     (Maybe RefreshStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartInstanceRefresh' {Maybe RefreshStrategy
strategy :: Maybe RefreshStrategy
$sel:strategy:StartInstanceRefresh' :: StartInstanceRefresh -> Maybe RefreshStrategy
strategy} -> Maybe RefreshStrategy
strategy) (\s :: StartInstanceRefresh
s@StartInstanceRefresh' {} Maybe RefreshStrategy
a -> StartInstanceRefresh
s {$sel:strategy:StartInstanceRefresh' :: Maybe RefreshStrategy
strategy = Maybe RefreshStrategy
a} :: StartInstanceRefresh)

-- | The desired configuration. For example, the desired configuration can
-- specify a new launch template or a new version of the current launch
-- template.
--
-- Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
-- settings of the Auto Scaling group to reflect the new desired
-- configuration.
--
-- When you specify a new launch template or a new version of the current
-- launch template for your desired configuration, consider enabling the
-- @SkipMatching@ property in preferences. If it\'s enabled, Amazon EC2
-- Auto Scaling skips replacing instances that already use the specified
-- launch template and version. This can help you reduce the number of
-- replacements that are required to apply updates.
startInstanceRefresh_desiredConfiguration :: Lens.Lens' StartInstanceRefresh (Prelude.Maybe DesiredConfiguration)
startInstanceRefresh_desiredConfiguration :: (Maybe DesiredConfiguration -> f (Maybe DesiredConfiguration))
-> StartInstanceRefresh -> f StartInstanceRefresh
startInstanceRefresh_desiredConfiguration = (StartInstanceRefresh -> Maybe DesiredConfiguration)
-> (StartInstanceRefresh
    -> Maybe DesiredConfiguration -> StartInstanceRefresh)
-> Lens
     StartInstanceRefresh
     StartInstanceRefresh
     (Maybe DesiredConfiguration)
     (Maybe DesiredConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartInstanceRefresh' {Maybe DesiredConfiguration
desiredConfiguration :: Maybe DesiredConfiguration
$sel:desiredConfiguration:StartInstanceRefresh' :: StartInstanceRefresh -> Maybe DesiredConfiguration
desiredConfiguration} -> Maybe DesiredConfiguration
desiredConfiguration) (\s :: StartInstanceRefresh
s@StartInstanceRefresh' {} Maybe DesiredConfiguration
a -> StartInstanceRefresh
s {$sel:desiredConfiguration:StartInstanceRefresh' :: Maybe DesiredConfiguration
desiredConfiguration = Maybe DesiredConfiguration
a} :: StartInstanceRefresh)

-- | The name of the Auto Scaling group.
startInstanceRefresh_autoScalingGroupName :: Lens.Lens' StartInstanceRefresh Prelude.Text
startInstanceRefresh_autoScalingGroupName :: (Text -> f Text) -> StartInstanceRefresh -> f StartInstanceRefresh
startInstanceRefresh_autoScalingGroupName = (StartInstanceRefresh -> Text)
-> (StartInstanceRefresh -> Text -> StartInstanceRefresh)
-> Lens StartInstanceRefresh StartInstanceRefresh Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartInstanceRefresh' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:StartInstanceRefresh' :: StartInstanceRefresh -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: StartInstanceRefresh
s@StartInstanceRefresh' {} Text
a -> StartInstanceRefresh
s {$sel:autoScalingGroupName:StartInstanceRefresh' :: Text
autoScalingGroupName = Text
a} :: StartInstanceRefresh)

instance Core.AWSRequest StartInstanceRefresh where
  type
    AWSResponse StartInstanceRefresh =
      StartInstanceRefreshResponse
  request :: StartInstanceRefresh -> Request StartInstanceRefresh
request = Service -> StartInstanceRefresh -> Request StartInstanceRefresh
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy StartInstanceRefresh
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartInstanceRefresh)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse StartInstanceRefresh))
-> Logger
-> Service
-> Proxy StartInstanceRefresh
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartInstanceRefresh)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"StartInstanceRefreshResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Int -> StartInstanceRefreshResponse
StartInstanceRefreshResponse'
            (Maybe Text -> Int -> StartInstanceRefreshResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartInstanceRefreshResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InstanceRefreshId")
            Either String (Int -> StartInstanceRefreshResponse)
-> Either String Int -> Either String StartInstanceRefreshResponse
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 StartInstanceRefresh

instance Prelude.NFData StartInstanceRefresh

instance Core.ToHeaders StartInstanceRefresh where
  toHeaders :: StartInstanceRefresh -> ResponseHeaders
toHeaders = ResponseHeaders -> StartInstanceRefresh -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery StartInstanceRefresh where
  toQuery :: StartInstanceRefresh -> QueryString
toQuery StartInstanceRefresh' {Maybe DesiredConfiguration
Maybe RefreshPreferences
Maybe RefreshStrategy
Text
autoScalingGroupName :: Text
desiredConfiguration :: Maybe DesiredConfiguration
strategy :: Maybe RefreshStrategy
preferences :: Maybe RefreshPreferences
$sel:autoScalingGroupName:StartInstanceRefresh' :: StartInstanceRefresh -> Text
$sel:desiredConfiguration:StartInstanceRefresh' :: StartInstanceRefresh -> Maybe DesiredConfiguration
$sel:strategy:StartInstanceRefresh' :: StartInstanceRefresh -> Maybe RefreshStrategy
$sel:preferences:StartInstanceRefresh' :: StartInstanceRefresh -> Maybe RefreshPreferences
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"StartInstanceRefresh" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"Preferences" ByteString -> Maybe RefreshPreferences -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RefreshPreferences
preferences,
        ByteString
"Strategy" ByteString -> Maybe RefreshStrategy -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RefreshStrategy
strategy,
        ByteString
"DesiredConfiguration" ByteString -> Maybe DesiredConfiguration -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DesiredConfiguration
desiredConfiguration,
        ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName
      ]

-- | /See:/ 'newStartInstanceRefreshResponse' smart constructor.
data StartInstanceRefreshResponse = StartInstanceRefreshResponse'
  { -- | A unique ID for tracking the progress of the request.
    StartInstanceRefreshResponse -> Maybe Text
instanceRefreshId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartInstanceRefreshResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartInstanceRefreshResponse
-> StartInstanceRefreshResponse -> Bool
(StartInstanceRefreshResponse
 -> StartInstanceRefreshResponse -> Bool)
-> (StartInstanceRefreshResponse
    -> StartInstanceRefreshResponse -> Bool)
-> Eq StartInstanceRefreshResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartInstanceRefreshResponse
-> StartInstanceRefreshResponse -> Bool
$c/= :: StartInstanceRefreshResponse
-> StartInstanceRefreshResponse -> Bool
== :: StartInstanceRefreshResponse
-> StartInstanceRefreshResponse -> Bool
$c== :: StartInstanceRefreshResponse
-> StartInstanceRefreshResponse -> Bool
Prelude.Eq, ReadPrec [StartInstanceRefreshResponse]
ReadPrec StartInstanceRefreshResponse
Int -> ReadS StartInstanceRefreshResponse
ReadS [StartInstanceRefreshResponse]
(Int -> ReadS StartInstanceRefreshResponse)
-> ReadS [StartInstanceRefreshResponse]
-> ReadPrec StartInstanceRefreshResponse
-> ReadPrec [StartInstanceRefreshResponse]
-> Read StartInstanceRefreshResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartInstanceRefreshResponse]
$creadListPrec :: ReadPrec [StartInstanceRefreshResponse]
readPrec :: ReadPrec StartInstanceRefreshResponse
$creadPrec :: ReadPrec StartInstanceRefreshResponse
readList :: ReadS [StartInstanceRefreshResponse]
$creadList :: ReadS [StartInstanceRefreshResponse]
readsPrec :: Int -> ReadS StartInstanceRefreshResponse
$creadsPrec :: Int -> ReadS StartInstanceRefreshResponse
Prelude.Read, Int -> StartInstanceRefreshResponse -> ShowS
[StartInstanceRefreshResponse] -> ShowS
StartInstanceRefreshResponse -> String
(Int -> StartInstanceRefreshResponse -> ShowS)
-> (StartInstanceRefreshResponse -> String)
-> ([StartInstanceRefreshResponse] -> ShowS)
-> Show StartInstanceRefreshResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartInstanceRefreshResponse] -> ShowS
$cshowList :: [StartInstanceRefreshResponse] -> ShowS
show :: StartInstanceRefreshResponse -> String
$cshow :: StartInstanceRefreshResponse -> String
showsPrec :: Int -> StartInstanceRefreshResponse -> ShowS
$cshowsPrec :: Int -> StartInstanceRefreshResponse -> ShowS
Prelude.Show, (forall x.
 StartInstanceRefreshResponse -> Rep StartInstanceRefreshResponse x)
-> (forall x.
    Rep StartInstanceRefreshResponse x -> StartInstanceRefreshResponse)
-> Generic StartInstanceRefreshResponse
forall x.
Rep StartInstanceRefreshResponse x -> StartInstanceRefreshResponse
forall x.
StartInstanceRefreshResponse -> Rep StartInstanceRefreshResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartInstanceRefreshResponse x -> StartInstanceRefreshResponse
$cfrom :: forall x.
StartInstanceRefreshResponse -> Rep StartInstanceRefreshResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartInstanceRefreshResponse' 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:
--
-- 'instanceRefreshId', 'startInstanceRefreshResponse_instanceRefreshId' - A unique ID for tracking the progress of the request.
--
-- 'httpStatus', 'startInstanceRefreshResponse_httpStatus' - The response's http status code.
newStartInstanceRefreshResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartInstanceRefreshResponse
newStartInstanceRefreshResponse :: Int -> StartInstanceRefreshResponse
newStartInstanceRefreshResponse Int
pHttpStatus_ =
  StartInstanceRefreshResponse' :: Maybe Text -> Int -> StartInstanceRefreshResponse
StartInstanceRefreshResponse'
    { $sel:instanceRefreshId:StartInstanceRefreshResponse' :: Maybe Text
instanceRefreshId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartInstanceRefreshResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A unique ID for tracking the progress of the request.
startInstanceRefreshResponse_instanceRefreshId :: Lens.Lens' StartInstanceRefreshResponse (Prelude.Maybe Prelude.Text)
startInstanceRefreshResponse_instanceRefreshId :: (Maybe Text -> f (Maybe Text))
-> StartInstanceRefreshResponse -> f StartInstanceRefreshResponse
startInstanceRefreshResponse_instanceRefreshId = (StartInstanceRefreshResponse -> Maybe Text)
-> (StartInstanceRefreshResponse
    -> Maybe Text -> StartInstanceRefreshResponse)
-> Lens
     StartInstanceRefreshResponse
     StartInstanceRefreshResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartInstanceRefreshResponse' {Maybe Text
instanceRefreshId :: Maybe Text
$sel:instanceRefreshId:StartInstanceRefreshResponse' :: StartInstanceRefreshResponse -> Maybe Text
instanceRefreshId} -> Maybe Text
instanceRefreshId) (\s :: StartInstanceRefreshResponse
s@StartInstanceRefreshResponse' {} Maybe Text
a -> StartInstanceRefreshResponse
s {$sel:instanceRefreshId:StartInstanceRefreshResponse' :: Maybe Text
instanceRefreshId = Maybe Text
a} :: StartInstanceRefreshResponse)

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

instance Prelude.NFData StartInstanceRefreshResponse