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

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

-- |
-- Module      : Amazonka.AutoScaling.Types.InstanceRefresh
-- 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)
module Amazonka.AutoScaling.Types.InstanceRefresh where

import Amazonka.AutoScaling.Types.DesiredConfiguration
import Amazonka.AutoScaling.Types.InstanceRefreshProgressDetails
import Amazonka.AutoScaling.Types.InstanceRefreshStatus
import Amazonka.AutoScaling.Types.RefreshPreferences
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an instance refresh for an Auto Scaling group.
--
-- /See:/ 'newInstanceRefresh' smart constructor.
data InstanceRefresh = InstanceRefresh'
  { -- | The current status for the instance refresh operation:
    --
    -- -   @Pending@ - The request was created, but the operation has not
    --     started.
    --
    -- -   @InProgress@ - The operation is in progress.
    --
    -- -   @Successful@ - The operation completed successfully.
    --
    -- -   @Failed@ - The operation failed to complete. You can troubleshoot
    --     using the status reason and the scaling activities.
    --
    -- -   @Cancelling@ - An ongoing operation is being cancelled. Cancellation
    --     does not roll back any replacements that have already been
    --     completed, but it prevents new replacements from being started.
    --
    -- -   @Cancelled@ - The operation is cancelled.
    InstanceRefresh -> Maybe InstanceRefreshStatus
status :: Prelude.Maybe InstanceRefreshStatus,
    -- | Additional progress details for an Auto Scaling group that has a warm
    -- pool.
    InstanceRefresh -> Maybe InstanceRefreshProgressDetails
progressDetails :: Prelude.Maybe InstanceRefreshProgressDetails,
    -- | The date and time at which the instance refresh began.
    InstanceRefresh -> Maybe ISO8601
startTime :: Prelude.Maybe Core.ISO8601,
    InstanceRefresh -> Maybe RefreshPreferences
preferences :: Prelude.Maybe RefreshPreferences,
    -- | The number of instances remaining to update before the instance refresh
    -- is complete.
    InstanceRefresh -> Maybe Natural
instancesToUpdate :: Prelude.Maybe Prelude.Natural,
    -- | The percentage of the instance refresh that is complete. For each
    -- instance replacement, Amazon EC2 Auto Scaling tracks the instance\'s
    -- health status and warm-up time. When the instance\'s health status
    -- changes to healthy and the specified warm-up time passes, the instance
    -- is considered updated and is added to the percentage complete.
    InstanceRefresh -> Maybe Natural
percentageComplete :: Prelude.Maybe Prelude.Natural,
    -- | The name of the Auto Scaling group.
    InstanceRefresh -> Maybe Text
autoScalingGroupName :: Prelude.Maybe Prelude.Text,
    -- | The date and time at which the instance refresh ended.
    InstanceRefresh -> Maybe ISO8601
endTime :: Prelude.Maybe Core.ISO8601,
    -- | Provides more details about the current status of the instance refresh.
    InstanceRefresh -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | Describes the specific update you want to deploy.
    InstanceRefresh -> Maybe DesiredConfiguration
desiredConfiguration :: Prelude.Maybe DesiredConfiguration,
    -- | The instance refresh ID.
    InstanceRefresh -> Maybe Text
instanceRefreshId :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceRefresh -> InstanceRefresh -> Bool
(InstanceRefresh -> InstanceRefresh -> Bool)
-> (InstanceRefresh -> InstanceRefresh -> Bool)
-> Eq InstanceRefresh
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceRefresh -> InstanceRefresh -> Bool
$c/= :: InstanceRefresh -> InstanceRefresh -> Bool
== :: InstanceRefresh -> InstanceRefresh -> Bool
$c== :: InstanceRefresh -> InstanceRefresh -> Bool
Prelude.Eq, ReadPrec [InstanceRefresh]
ReadPrec InstanceRefresh
Int -> ReadS InstanceRefresh
ReadS [InstanceRefresh]
(Int -> ReadS InstanceRefresh)
-> ReadS [InstanceRefresh]
-> ReadPrec InstanceRefresh
-> ReadPrec [InstanceRefresh]
-> Read InstanceRefresh
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceRefresh]
$creadListPrec :: ReadPrec [InstanceRefresh]
readPrec :: ReadPrec InstanceRefresh
$creadPrec :: ReadPrec InstanceRefresh
readList :: ReadS [InstanceRefresh]
$creadList :: ReadS [InstanceRefresh]
readsPrec :: Int -> ReadS InstanceRefresh
$creadsPrec :: Int -> ReadS InstanceRefresh
Prelude.Read, Int -> InstanceRefresh -> ShowS
[InstanceRefresh] -> ShowS
InstanceRefresh -> String
(Int -> InstanceRefresh -> ShowS)
-> (InstanceRefresh -> String)
-> ([InstanceRefresh] -> ShowS)
-> Show InstanceRefresh
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceRefresh] -> ShowS
$cshowList :: [InstanceRefresh] -> ShowS
show :: InstanceRefresh -> String
$cshow :: InstanceRefresh -> String
showsPrec :: Int -> InstanceRefresh -> ShowS
$cshowsPrec :: Int -> InstanceRefresh -> ShowS
Prelude.Show, (forall x. InstanceRefresh -> Rep InstanceRefresh x)
-> (forall x. Rep InstanceRefresh x -> InstanceRefresh)
-> Generic InstanceRefresh
forall x. Rep InstanceRefresh x -> InstanceRefresh
forall x. InstanceRefresh -> Rep InstanceRefresh x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceRefresh x -> InstanceRefresh
$cfrom :: forall x. InstanceRefresh -> Rep InstanceRefresh x
Prelude.Generic)

-- |
-- Create a value of 'InstanceRefresh' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'instanceRefresh_status' - The current status for the instance refresh operation:
--
-- -   @Pending@ - The request was created, but the operation has not
--     started.
--
-- -   @InProgress@ - The operation is in progress.
--
-- -   @Successful@ - The operation completed successfully.
--
-- -   @Failed@ - The operation failed to complete. You can troubleshoot
--     using the status reason and the scaling activities.
--
-- -   @Cancelling@ - An ongoing operation is being cancelled. Cancellation
--     does not roll back any replacements that have already been
--     completed, but it prevents new replacements from being started.
--
-- -   @Cancelled@ - The operation is cancelled.
--
-- 'progressDetails', 'instanceRefresh_progressDetails' - Additional progress details for an Auto Scaling group that has a warm
-- pool.
--
-- 'startTime', 'instanceRefresh_startTime' - The date and time at which the instance refresh began.
--
-- 'preferences', 'instanceRefresh_preferences' - Undocumented member.
--
-- 'instancesToUpdate', 'instanceRefresh_instancesToUpdate' - The number of instances remaining to update before the instance refresh
-- is complete.
--
-- 'percentageComplete', 'instanceRefresh_percentageComplete' - The percentage of the instance refresh that is complete. For each
-- instance replacement, Amazon EC2 Auto Scaling tracks the instance\'s
-- health status and warm-up time. When the instance\'s health status
-- changes to healthy and the specified warm-up time passes, the instance
-- is considered updated and is added to the percentage complete.
--
-- 'autoScalingGroupName', 'instanceRefresh_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'endTime', 'instanceRefresh_endTime' - The date and time at which the instance refresh ended.
--
-- 'statusReason', 'instanceRefresh_statusReason' - Provides more details about the current status of the instance refresh.
--
-- 'desiredConfiguration', 'instanceRefresh_desiredConfiguration' - Describes the specific update you want to deploy.
--
-- 'instanceRefreshId', 'instanceRefresh_instanceRefreshId' - The instance refresh ID.
newInstanceRefresh ::
  InstanceRefresh
newInstanceRefresh :: InstanceRefresh
newInstanceRefresh =
  InstanceRefresh' :: Maybe InstanceRefreshStatus
-> Maybe InstanceRefreshProgressDetails
-> Maybe ISO8601
-> Maybe RefreshPreferences
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe DesiredConfiguration
-> Maybe Text
-> InstanceRefresh
InstanceRefresh'
    { $sel:status:InstanceRefresh' :: Maybe InstanceRefreshStatus
status = Maybe InstanceRefreshStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:progressDetails:InstanceRefresh' :: Maybe InstanceRefreshProgressDetails
progressDetails = Maybe InstanceRefreshProgressDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:InstanceRefresh' :: Maybe ISO8601
startTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:preferences:InstanceRefresh' :: Maybe RefreshPreferences
preferences = Maybe RefreshPreferences
forall a. Maybe a
Prelude.Nothing,
      $sel:instancesToUpdate:InstanceRefresh' :: Maybe Natural
instancesToUpdate = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:percentageComplete:InstanceRefresh' :: Maybe Natural
percentageComplete = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroupName:InstanceRefresh' :: Maybe Text
autoScalingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:InstanceRefresh' :: Maybe ISO8601
endTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:InstanceRefresh' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:desiredConfiguration:InstanceRefresh' :: Maybe DesiredConfiguration
desiredConfiguration = Maybe DesiredConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRefreshId:InstanceRefresh' :: Maybe Text
instanceRefreshId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status for the instance refresh operation:
--
-- -   @Pending@ - The request was created, but the operation has not
--     started.
--
-- -   @InProgress@ - The operation is in progress.
--
-- -   @Successful@ - The operation completed successfully.
--
-- -   @Failed@ - The operation failed to complete. You can troubleshoot
--     using the status reason and the scaling activities.
--
-- -   @Cancelling@ - An ongoing operation is being cancelled. Cancellation
--     does not roll back any replacements that have already been
--     completed, but it prevents new replacements from being started.
--
-- -   @Cancelled@ - The operation is cancelled.
instanceRefresh_status :: Lens.Lens' InstanceRefresh (Prelude.Maybe InstanceRefreshStatus)
instanceRefresh_status :: (Maybe InstanceRefreshStatus -> f (Maybe InstanceRefreshStatus))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_status = (InstanceRefresh -> Maybe InstanceRefreshStatus)
-> (InstanceRefresh
    -> Maybe InstanceRefreshStatus -> InstanceRefresh)
-> Lens
     InstanceRefresh
     InstanceRefresh
     (Maybe InstanceRefreshStatus)
     (Maybe InstanceRefreshStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe InstanceRefreshStatus
status :: Maybe InstanceRefreshStatus
$sel:status:InstanceRefresh' :: InstanceRefresh -> Maybe InstanceRefreshStatus
status} -> Maybe InstanceRefreshStatus
status) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe InstanceRefreshStatus
a -> InstanceRefresh
s {$sel:status:InstanceRefresh' :: Maybe InstanceRefreshStatus
status = Maybe InstanceRefreshStatus
a} :: InstanceRefresh)

-- | Additional progress details for an Auto Scaling group that has a warm
-- pool.
instanceRefresh_progressDetails :: Lens.Lens' InstanceRefresh (Prelude.Maybe InstanceRefreshProgressDetails)
instanceRefresh_progressDetails :: (Maybe InstanceRefreshProgressDetails
 -> f (Maybe InstanceRefreshProgressDetails))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_progressDetails = (InstanceRefresh -> Maybe InstanceRefreshProgressDetails)
-> (InstanceRefresh
    -> Maybe InstanceRefreshProgressDetails -> InstanceRefresh)
-> Lens
     InstanceRefresh
     InstanceRefresh
     (Maybe InstanceRefreshProgressDetails)
     (Maybe InstanceRefreshProgressDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe InstanceRefreshProgressDetails
progressDetails :: Maybe InstanceRefreshProgressDetails
$sel:progressDetails:InstanceRefresh' :: InstanceRefresh -> Maybe InstanceRefreshProgressDetails
progressDetails} -> Maybe InstanceRefreshProgressDetails
progressDetails) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe InstanceRefreshProgressDetails
a -> InstanceRefresh
s {$sel:progressDetails:InstanceRefresh' :: Maybe InstanceRefreshProgressDetails
progressDetails = Maybe InstanceRefreshProgressDetails
a} :: InstanceRefresh)

-- | The date and time at which the instance refresh began.
instanceRefresh_startTime :: Lens.Lens' InstanceRefresh (Prelude.Maybe Prelude.UTCTime)
instanceRefresh_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_startTime = (InstanceRefresh -> Maybe ISO8601)
-> (InstanceRefresh -> Maybe ISO8601 -> InstanceRefresh)
-> Lens
     InstanceRefresh InstanceRefresh (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:InstanceRefresh' :: InstanceRefresh -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe ISO8601
a -> InstanceRefresh
s {$sel:startTime:InstanceRefresh' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: InstanceRefresh) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> InstanceRefresh -> f InstanceRefresh)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceRefresh
-> f InstanceRefresh
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Undocumented member.
instanceRefresh_preferences :: Lens.Lens' InstanceRefresh (Prelude.Maybe RefreshPreferences)
instanceRefresh_preferences :: (Maybe RefreshPreferences -> f (Maybe RefreshPreferences))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_preferences = (InstanceRefresh -> Maybe RefreshPreferences)
-> (InstanceRefresh -> Maybe RefreshPreferences -> InstanceRefresh)
-> Lens
     InstanceRefresh
     InstanceRefresh
     (Maybe RefreshPreferences)
     (Maybe RefreshPreferences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe RefreshPreferences
preferences :: Maybe RefreshPreferences
$sel:preferences:InstanceRefresh' :: InstanceRefresh -> Maybe RefreshPreferences
preferences} -> Maybe RefreshPreferences
preferences) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe RefreshPreferences
a -> InstanceRefresh
s {$sel:preferences:InstanceRefresh' :: Maybe RefreshPreferences
preferences = Maybe RefreshPreferences
a} :: InstanceRefresh)

-- | The number of instances remaining to update before the instance refresh
-- is complete.
instanceRefresh_instancesToUpdate :: Lens.Lens' InstanceRefresh (Prelude.Maybe Prelude.Natural)
instanceRefresh_instancesToUpdate :: (Maybe Natural -> f (Maybe Natural))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_instancesToUpdate = (InstanceRefresh -> Maybe Natural)
-> (InstanceRefresh -> Maybe Natural -> InstanceRefresh)
-> Lens
     InstanceRefresh InstanceRefresh (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe Natural
instancesToUpdate :: Maybe Natural
$sel:instancesToUpdate:InstanceRefresh' :: InstanceRefresh -> Maybe Natural
instancesToUpdate} -> Maybe Natural
instancesToUpdate) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe Natural
a -> InstanceRefresh
s {$sel:instancesToUpdate:InstanceRefresh' :: Maybe Natural
instancesToUpdate = Maybe Natural
a} :: InstanceRefresh)

-- | The percentage of the instance refresh that is complete. For each
-- instance replacement, Amazon EC2 Auto Scaling tracks the instance\'s
-- health status and warm-up time. When the instance\'s health status
-- changes to healthy and the specified warm-up time passes, the instance
-- is considered updated and is added to the percentage complete.
instanceRefresh_percentageComplete :: Lens.Lens' InstanceRefresh (Prelude.Maybe Prelude.Natural)
instanceRefresh_percentageComplete :: (Maybe Natural -> f (Maybe Natural))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_percentageComplete = (InstanceRefresh -> Maybe Natural)
-> (InstanceRefresh -> Maybe Natural -> InstanceRefresh)
-> Lens
     InstanceRefresh InstanceRefresh (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe Natural
percentageComplete :: Maybe Natural
$sel:percentageComplete:InstanceRefresh' :: InstanceRefresh -> Maybe Natural
percentageComplete} -> Maybe Natural
percentageComplete) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe Natural
a -> InstanceRefresh
s {$sel:percentageComplete:InstanceRefresh' :: Maybe Natural
percentageComplete = Maybe Natural
a} :: InstanceRefresh)

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

-- | The date and time at which the instance refresh ended.
instanceRefresh_endTime :: Lens.Lens' InstanceRefresh (Prelude.Maybe Prelude.UTCTime)
instanceRefresh_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_endTime = (InstanceRefresh -> Maybe ISO8601)
-> (InstanceRefresh -> Maybe ISO8601 -> InstanceRefresh)
-> Lens
     InstanceRefresh InstanceRefresh (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:InstanceRefresh' :: InstanceRefresh -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe ISO8601
a -> InstanceRefresh
s {$sel:endTime:InstanceRefresh' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: InstanceRefresh) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> InstanceRefresh -> f InstanceRefresh)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceRefresh
-> f InstanceRefresh
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Provides more details about the current status of the instance refresh.
instanceRefresh_statusReason :: Lens.Lens' InstanceRefresh (Prelude.Maybe Prelude.Text)
instanceRefresh_statusReason :: (Maybe Text -> f (Maybe Text))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_statusReason = (InstanceRefresh -> Maybe Text)
-> (InstanceRefresh -> Maybe Text -> InstanceRefresh)
-> Lens InstanceRefresh InstanceRefresh (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:InstanceRefresh' :: InstanceRefresh -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe Text
a -> InstanceRefresh
s {$sel:statusReason:InstanceRefresh' :: Maybe Text
statusReason = Maybe Text
a} :: InstanceRefresh)

-- | Describes the specific update you want to deploy.
instanceRefresh_desiredConfiguration :: Lens.Lens' InstanceRefresh (Prelude.Maybe DesiredConfiguration)
instanceRefresh_desiredConfiguration :: (Maybe DesiredConfiguration -> f (Maybe DesiredConfiguration))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_desiredConfiguration = (InstanceRefresh -> Maybe DesiredConfiguration)
-> (InstanceRefresh
    -> Maybe DesiredConfiguration -> InstanceRefresh)
-> Lens
     InstanceRefresh
     InstanceRefresh
     (Maybe DesiredConfiguration)
     (Maybe DesiredConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe DesiredConfiguration
desiredConfiguration :: Maybe DesiredConfiguration
$sel:desiredConfiguration:InstanceRefresh' :: InstanceRefresh -> Maybe DesiredConfiguration
desiredConfiguration} -> Maybe DesiredConfiguration
desiredConfiguration) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe DesiredConfiguration
a -> InstanceRefresh
s {$sel:desiredConfiguration:InstanceRefresh' :: Maybe DesiredConfiguration
desiredConfiguration = Maybe DesiredConfiguration
a} :: InstanceRefresh)

-- | The instance refresh ID.
instanceRefresh_instanceRefreshId :: Lens.Lens' InstanceRefresh (Prelude.Maybe Prelude.Text)
instanceRefresh_instanceRefreshId :: (Maybe Text -> f (Maybe Text))
-> InstanceRefresh -> f InstanceRefresh
instanceRefresh_instanceRefreshId = (InstanceRefresh -> Maybe Text)
-> (InstanceRefresh -> Maybe Text -> InstanceRefresh)
-> Lens InstanceRefresh InstanceRefresh (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRefresh' {Maybe Text
instanceRefreshId :: Maybe Text
$sel:instanceRefreshId:InstanceRefresh' :: InstanceRefresh -> Maybe Text
instanceRefreshId} -> Maybe Text
instanceRefreshId) (\s :: InstanceRefresh
s@InstanceRefresh' {} Maybe Text
a -> InstanceRefresh
s {$sel:instanceRefreshId:InstanceRefresh' :: Maybe Text
instanceRefreshId = Maybe Text
a} :: InstanceRefresh)

instance Core.FromXML InstanceRefresh where
  parseXML :: [Node] -> Either String InstanceRefresh
parseXML [Node]
x =
    Maybe InstanceRefreshStatus
-> Maybe InstanceRefreshProgressDetails
-> Maybe ISO8601
-> Maybe RefreshPreferences
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe DesiredConfiguration
-> Maybe Text
-> InstanceRefresh
InstanceRefresh'
      (Maybe InstanceRefreshStatus
 -> Maybe InstanceRefreshProgressDetails
 -> Maybe ISO8601
 -> Maybe RefreshPreferences
 -> Maybe Natural
 -> Maybe Natural
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe DesiredConfiguration
 -> Maybe Text
 -> InstanceRefresh)
-> Either String (Maybe InstanceRefreshStatus)
-> Either
     String
     (Maybe InstanceRefreshProgressDetails
      -> Maybe ISO8601
      -> Maybe RefreshPreferences
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe InstanceRefreshStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe InstanceRefreshProgressDetails
   -> Maybe ISO8601
   -> Maybe RefreshPreferences
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe InstanceRefreshProgressDetails)
-> Either
     String
     (Maybe ISO8601
      -> Maybe RefreshPreferences
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe InstanceRefreshProgressDetails)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ProgressDetails")
      Either
  String
  (Maybe ISO8601
   -> Maybe RefreshPreferences
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe RefreshPreferences
      -> Maybe Natural
      -> Maybe Natural
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StartTime")
      Either
  String
  (Maybe RefreshPreferences
   -> Maybe Natural
   -> Maybe Natural
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe RefreshPreferences)
-> Either
     String
     (Maybe Natural
      -> Maybe Natural
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe RefreshPreferences)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Preferences")
      Either
  String
  (Maybe Natural
   -> Maybe Natural
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InstancesToUpdate")
      Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PercentageComplete")
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe DesiredConfiguration
      -> Maybe Text
      -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => 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
"AutoScalingGroupName")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe DesiredConfiguration
   -> Maybe Text
   -> InstanceRefresh)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe DesiredConfiguration -> Maybe Text -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EndTime")
      Either
  String
  (Maybe Text
   -> Maybe DesiredConfiguration -> Maybe Text -> InstanceRefresh)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe DesiredConfiguration -> Maybe Text -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => 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
"StatusReason")
      Either
  String
  (Maybe DesiredConfiguration -> Maybe Text -> InstanceRefresh)
-> Either String (Maybe DesiredConfiguration)
-> Either String (Maybe Text -> InstanceRefresh)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DesiredConfiguration)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DesiredConfiguration")
      Either String (Maybe Text -> InstanceRefresh)
-> Either String (Maybe Text) -> Either String InstanceRefresh
forall (f :: * -> *) a b. Applicative f => 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")

instance Prelude.Hashable InstanceRefresh

instance Prelude.NFData InstanceRefresh