{-# 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.DescribeInstanceRefreshes
-- 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)
--
-- Gets information about the instance refreshes for the specified 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 after you make configuration changes.
--
-- To help you determine the status of an instance refresh, this operation
-- returns information about the instance refreshes you previously
-- initiated, including their status, end time, the percentage of the
-- instance refresh that is complete, and the number of instances remaining
-- to update before the instance refresh is complete.
--
-- The following are the possible statuses:
--
-- -   @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.
module Amazonka.AutoScaling.DescribeInstanceRefreshes
  ( -- * Creating a Request
    DescribeInstanceRefreshes (..),
    newDescribeInstanceRefreshes,

    -- * Request Lenses
    describeInstanceRefreshes_nextToken,
    describeInstanceRefreshes_maxRecords,
    describeInstanceRefreshes_instanceRefreshIds,
    describeInstanceRefreshes_autoScalingGroupName,

    -- * Destructuring the Response
    DescribeInstanceRefreshesResponse (..),
    newDescribeInstanceRefreshesResponse,

    -- * Response Lenses
    describeInstanceRefreshesResponse_nextToken,
    describeInstanceRefreshesResponse_instanceRefreshes,
    describeInstanceRefreshesResponse_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:/ 'newDescribeInstanceRefreshes' smart constructor.
data DescribeInstanceRefreshes = DescribeInstanceRefreshes'
  { -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeInstanceRefreshes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call. The default value
    -- is @50@ and the maximum value is @100@.
    DescribeInstanceRefreshes -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | One or more instance refresh IDs.
    DescribeInstanceRefreshes -> Maybe [Text]
instanceRefreshIds :: Prelude.Maybe [Prelude.Text],
    -- | The name of the Auto Scaling group.
    DescribeInstanceRefreshes -> Text
autoScalingGroupName :: Prelude.Text
  }
  deriving (DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool
(DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool)
-> (DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool)
-> Eq DescribeInstanceRefreshes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool
$c/= :: DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool
== :: DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool
$c== :: DescribeInstanceRefreshes -> DescribeInstanceRefreshes -> Bool
Prelude.Eq, ReadPrec [DescribeInstanceRefreshes]
ReadPrec DescribeInstanceRefreshes
Int -> ReadS DescribeInstanceRefreshes
ReadS [DescribeInstanceRefreshes]
(Int -> ReadS DescribeInstanceRefreshes)
-> ReadS [DescribeInstanceRefreshes]
-> ReadPrec DescribeInstanceRefreshes
-> ReadPrec [DescribeInstanceRefreshes]
-> Read DescribeInstanceRefreshes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstanceRefreshes]
$creadListPrec :: ReadPrec [DescribeInstanceRefreshes]
readPrec :: ReadPrec DescribeInstanceRefreshes
$creadPrec :: ReadPrec DescribeInstanceRefreshes
readList :: ReadS [DescribeInstanceRefreshes]
$creadList :: ReadS [DescribeInstanceRefreshes]
readsPrec :: Int -> ReadS DescribeInstanceRefreshes
$creadsPrec :: Int -> ReadS DescribeInstanceRefreshes
Prelude.Read, Int -> DescribeInstanceRefreshes -> ShowS
[DescribeInstanceRefreshes] -> ShowS
DescribeInstanceRefreshes -> String
(Int -> DescribeInstanceRefreshes -> ShowS)
-> (DescribeInstanceRefreshes -> String)
-> ([DescribeInstanceRefreshes] -> ShowS)
-> Show DescribeInstanceRefreshes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstanceRefreshes] -> ShowS
$cshowList :: [DescribeInstanceRefreshes] -> ShowS
show :: DescribeInstanceRefreshes -> String
$cshow :: DescribeInstanceRefreshes -> String
showsPrec :: Int -> DescribeInstanceRefreshes -> ShowS
$cshowsPrec :: Int -> DescribeInstanceRefreshes -> ShowS
Prelude.Show, (forall x.
 DescribeInstanceRefreshes -> Rep DescribeInstanceRefreshes x)
-> (forall x.
    Rep DescribeInstanceRefreshes x -> DescribeInstanceRefreshes)
-> Generic DescribeInstanceRefreshes
forall x.
Rep DescribeInstanceRefreshes x -> DescribeInstanceRefreshes
forall x.
DescribeInstanceRefreshes -> Rep DescribeInstanceRefreshes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstanceRefreshes x -> DescribeInstanceRefreshes
$cfrom :: forall x.
DescribeInstanceRefreshes -> Rep DescribeInstanceRefreshes x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstanceRefreshes' 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:
--
-- 'nextToken', 'describeInstanceRefreshes_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxRecords', 'describeInstanceRefreshes_maxRecords' - The maximum number of items to return with this call. The default value
-- is @50@ and the maximum value is @100@.
--
-- 'instanceRefreshIds', 'describeInstanceRefreshes_instanceRefreshIds' - One or more instance refresh IDs.
--
-- 'autoScalingGroupName', 'describeInstanceRefreshes_autoScalingGroupName' - The name of the Auto Scaling group.
newDescribeInstanceRefreshes ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  DescribeInstanceRefreshes
newDescribeInstanceRefreshes :: Text -> DescribeInstanceRefreshes
newDescribeInstanceRefreshes Text
pAutoScalingGroupName_ =
  DescribeInstanceRefreshes' :: Maybe Text
-> Maybe Int -> Maybe [Text] -> Text -> DescribeInstanceRefreshes
DescribeInstanceRefreshes'
    { $sel:nextToken:DescribeInstanceRefreshes' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeInstanceRefreshes' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRefreshIds:DescribeInstanceRefreshes' :: Maybe [Text]
instanceRefreshIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroupName:DescribeInstanceRefreshes' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_
    }

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
describeInstanceRefreshes_nextToken :: Lens.Lens' DescribeInstanceRefreshes (Prelude.Maybe Prelude.Text)
describeInstanceRefreshes_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeInstanceRefreshes -> f DescribeInstanceRefreshes
describeInstanceRefreshes_nextToken = (DescribeInstanceRefreshes -> Maybe Text)
-> (DescribeInstanceRefreshes
    -> Maybe Text -> DescribeInstanceRefreshes)
-> Lens
     DescribeInstanceRefreshes
     DescribeInstanceRefreshes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceRefreshes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstanceRefreshes
s@DescribeInstanceRefreshes' {} Maybe Text
a -> DescribeInstanceRefreshes
s {$sel:nextToken:DescribeInstanceRefreshes' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstanceRefreshes)

-- | The maximum number of items to return with this call. The default value
-- is @50@ and the maximum value is @100@.
describeInstanceRefreshes_maxRecords :: Lens.Lens' DescribeInstanceRefreshes (Prelude.Maybe Prelude.Int)
describeInstanceRefreshes_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeInstanceRefreshes -> f DescribeInstanceRefreshes
describeInstanceRefreshes_maxRecords = (DescribeInstanceRefreshes -> Maybe Int)
-> (DescribeInstanceRefreshes
    -> Maybe Int -> DescribeInstanceRefreshes)
-> Lens
     DescribeInstanceRefreshes
     DescribeInstanceRefreshes
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceRefreshes' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeInstanceRefreshes
s@DescribeInstanceRefreshes' {} Maybe Int
a -> DescribeInstanceRefreshes
s {$sel:maxRecords:DescribeInstanceRefreshes' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeInstanceRefreshes)

-- | One or more instance refresh IDs.
describeInstanceRefreshes_instanceRefreshIds :: Lens.Lens' DescribeInstanceRefreshes (Prelude.Maybe [Prelude.Text])
describeInstanceRefreshes_instanceRefreshIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeInstanceRefreshes -> f DescribeInstanceRefreshes
describeInstanceRefreshes_instanceRefreshIds = (DescribeInstanceRefreshes -> Maybe [Text])
-> (DescribeInstanceRefreshes
    -> Maybe [Text] -> DescribeInstanceRefreshes)
-> Lens
     DescribeInstanceRefreshes
     DescribeInstanceRefreshes
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceRefreshes' {Maybe [Text]
instanceRefreshIds :: Maybe [Text]
$sel:instanceRefreshIds:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Maybe [Text]
instanceRefreshIds} -> Maybe [Text]
instanceRefreshIds) (\s :: DescribeInstanceRefreshes
s@DescribeInstanceRefreshes' {} Maybe [Text]
a -> DescribeInstanceRefreshes
s {$sel:instanceRefreshIds:DescribeInstanceRefreshes' :: Maybe [Text]
instanceRefreshIds = Maybe [Text]
a} :: DescribeInstanceRefreshes) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeInstanceRefreshes -> f DescribeInstanceRefreshes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeInstanceRefreshes
-> f DescribeInstanceRefreshes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Core.AWSRequest DescribeInstanceRefreshes where
  type
    AWSResponse DescribeInstanceRefreshes =
      DescribeInstanceRefreshesResponse
  request :: DescribeInstanceRefreshes -> Request DescribeInstanceRefreshes
request = Service
-> DescribeInstanceRefreshes -> Request DescribeInstanceRefreshes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeInstanceRefreshes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstanceRefreshes)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeInstanceRefreshes))
-> Logger
-> Service
-> Proxy DescribeInstanceRefreshes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstanceRefreshes)))
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
"DescribeInstanceRefreshesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [InstanceRefresh]
-> Int
-> DescribeInstanceRefreshesResponse
DescribeInstanceRefreshesResponse'
            (Maybe Text
 -> Maybe [InstanceRefresh]
 -> Int
 -> DescribeInstanceRefreshesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [InstanceRefresh]
      -> Int -> DescribeInstanceRefreshesResponse)
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
"NextToken")
            Either
  String
  (Maybe [InstanceRefresh]
   -> Int -> DescribeInstanceRefreshesResponse)
-> Either String (Maybe [InstanceRefresh])
-> Either String (Int -> DescribeInstanceRefreshesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InstanceRefreshes"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [InstanceRefresh]))
-> Either String (Maybe [InstanceRefresh])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [InstanceRefresh])
-> [Node] -> Either String (Maybe [InstanceRefresh])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [InstanceRefresh]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> DescribeInstanceRefreshesResponse)
-> Either String Int
-> Either String DescribeInstanceRefreshesResponse
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 DescribeInstanceRefreshes

instance Prelude.NFData DescribeInstanceRefreshes

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

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

instance Core.ToQuery DescribeInstanceRefreshes where
  toQuery :: DescribeInstanceRefreshes -> QueryString
toQuery DescribeInstanceRefreshes' {Maybe Int
Maybe [Text]
Maybe Text
Text
autoScalingGroupName :: Text
instanceRefreshIds :: Maybe [Text]
maxRecords :: Maybe Int
nextToken :: Maybe Text
$sel:autoScalingGroupName:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Text
$sel:instanceRefreshIds:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Maybe [Text]
$sel:maxRecords:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Maybe Int
$sel:nextToken:DescribeInstanceRefreshes' :: DescribeInstanceRefreshes -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeInstanceRefreshes" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords,
        ByteString
"InstanceRefreshIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
instanceRefreshIds
            ),
        ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName
      ]

-- | /See:/ 'newDescribeInstanceRefreshesResponse' smart constructor.
data DescribeInstanceRefreshesResponse = DescribeInstanceRefreshesResponse'
  { -- | A string that indicates that the response contains more items than can
    -- be returned in a single response. To receive additional items, specify
    -- this string for the @NextToken@ value when requesting the next set of
    -- items. This value is null when there are no more items to return.
    DescribeInstanceRefreshesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The instance refreshes for the specified group.
    DescribeInstanceRefreshesResponse -> Maybe [InstanceRefresh]
instanceRefreshes :: Prelude.Maybe [InstanceRefresh],
    -- | The response's http status code.
    DescribeInstanceRefreshesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstanceRefreshesResponse
-> DescribeInstanceRefreshesResponse -> Bool
(DescribeInstanceRefreshesResponse
 -> DescribeInstanceRefreshesResponse -> Bool)
-> (DescribeInstanceRefreshesResponse
    -> DescribeInstanceRefreshesResponse -> Bool)
-> Eq DescribeInstanceRefreshesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstanceRefreshesResponse
-> DescribeInstanceRefreshesResponse -> Bool
$c/= :: DescribeInstanceRefreshesResponse
-> DescribeInstanceRefreshesResponse -> Bool
== :: DescribeInstanceRefreshesResponse
-> DescribeInstanceRefreshesResponse -> Bool
$c== :: DescribeInstanceRefreshesResponse
-> DescribeInstanceRefreshesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeInstanceRefreshesResponse]
ReadPrec DescribeInstanceRefreshesResponse
Int -> ReadS DescribeInstanceRefreshesResponse
ReadS [DescribeInstanceRefreshesResponse]
(Int -> ReadS DescribeInstanceRefreshesResponse)
-> ReadS [DescribeInstanceRefreshesResponse]
-> ReadPrec DescribeInstanceRefreshesResponse
-> ReadPrec [DescribeInstanceRefreshesResponse]
-> Read DescribeInstanceRefreshesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstanceRefreshesResponse]
$creadListPrec :: ReadPrec [DescribeInstanceRefreshesResponse]
readPrec :: ReadPrec DescribeInstanceRefreshesResponse
$creadPrec :: ReadPrec DescribeInstanceRefreshesResponse
readList :: ReadS [DescribeInstanceRefreshesResponse]
$creadList :: ReadS [DescribeInstanceRefreshesResponse]
readsPrec :: Int -> ReadS DescribeInstanceRefreshesResponse
$creadsPrec :: Int -> ReadS DescribeInstanceRefreshesResponse
Prelude.Read, Int -> DescribeInstanceRefreshesResponse -> ShowS
[DescribeInstanceRefreshesResponse] -> ShowS
DescribeInstanceRefreshesResponse -> String
(Int -> DescribeInstanceRefreshesResponse -> ShowS)
-> (DescribeInstanceRefreshesResponse -> String)
-> ([DescribeInstanceRefreshesResponse] -> ShowS)
-> Show DescribeInstanceRefreshesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstanceRefreshesResponse] -> ShowS
$cshowList :: [DescribeInstanceRefreshesResponse] -> ShowS
show :: DescribeInstanceRefreshesResponse -> String
$cshow :: DescribeInstanceRefreshesResponse -> String
showsPrec :: Int -> DescribeInstanceRefreshesResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstanceRefreshesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeInstanceRefreshesResponse
 -> Rep DescribeInstanceRefreshesResponse x)
-> (forall x.
    Rep DescribeInstanceRefreshesResponse x
    -> DescribeInstanceRefreshesResponse)
-> Generic DescribeInstanceRefreshesResponse
forall x.
Rep DescribeInstanceRefreshesResponse x
-> DescribeInstanceRefreshesResponse
forall x.
DescribeInstanceRefreshesResponse
-> Rep DescribeInstanceRefreshesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstanceRefreshesResponse x
-> DescribeInstanceRefreshesResponse
$cfrom :: forall x.
DescribeInstanceRefreshesResponse
-> Rep DescribeInstanceRefreshesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstanceRefreshesResponse' 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:
--
-- 'nextToken', 'describeInstanceRefreshesResponse_nextToken' - A string that indicates that the response contains more items than can
-- be returned in a single response. To receive additional items, specify
-- this string for the @NextToken@ value when requesting the next set of
-- items. This value is null when there are no more items to return.
--
-- 'instanceRefreshes', 'describeInstanceRefreshesResponse_instanceRefreshes' - The instance refreshes for the specified group.
--
-- 'httpStatus', 'describeInstanceRefreshesResponse_httpStatus' - The response's http status code.
newDescribeInstanceRefreshesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstanceRefreshesResponse
newDescribeInstanceRefreshesResponse :: Int -> DescribeInstanceRefreshesResponse
newDescribeInstanceRefreshesResponse Int
pHttpStatus_ =
  DescribeInstanceRefreshesResponse' :: Maybe Text
-> Maybe [InstanceRefresh]
-> Int
-> DescribeInstanceRefreshesResponse
DescribeInstanceRefreshesResponse'
    { $sel:nextToken:DescribeInstanceRefreshesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRefreshes:DescribeInstanceRefreshesResponse' :: Maybe [InstanceRefresh]
instanceRefreshes = Maybe [InstanceRefresh]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstanceRefreshesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A string that indicates that the response contains more items than can
-- be returned in a single response. To receive additional items, specify
-- this string for the @NextToken@ value when requesting the next set of
-- items. This value is null when there are no more items to return.
describeInstanceRefreshesResponse_nextToken :: Lens.Lens' DescribeInstanceRefreshesResponse (Prelude.Maybe Prelude.Text)
describeInstanceRefreshesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeInstanceRefreshesResponse
-> f DescribeInstanceRefreshesResponse
describeInstanceRefreshesResponse_nextToken = (DescribeInstanceRefreshesResponse -> Maybe Text)
-> (DescribeInstanceRefreshesResponse
    -> Maybe Text -> DescribeInstanceRefreshesResponse)
-> Lens
     DescribeInstanceRefreshesResponse
     DescribeInstanceRefreshesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceRefreshesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstanceRefreshesResponse' :: DescribeInstanceRefreshesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstanceRefreshesResponse
s@DescribeInstanceRefreshesResponse' {} Maybe Text
a -> DescribeInstanceRefreshesResponse
s {$sel:nextToken:DescribeInstanceRefreshesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstanceRefreshesResponse)

-- | The instance refreshes for the specified group.
describeInstanceRefreshesResponse_instanceRefreshes :: Lens.Lens' DescribeInstanceRefreshesResponse (Prelude.Maybe [InstanceRefresh])
describeInstanceRefreshesResponse_instanceRefreshes :: (Maybe [InstanceRefresh] -> f (Maybe [InstanceRefresh]))
-> DescribeInstanceRefreshesResponse
-> f DescribeInstanceRefreshesResponse
describeInstanceRefreshesResponse_instanceRefreshes = (DescribeInstanceRefreshesResponse -> Maybe [InstanceRefresh])
-> (DescribeInstanceRefreshesResponse
    -> Maybe [InstanceRefresh] -> DescribeInstanceRefreshesResponse)
-> Lens
     DescribeInstanceRefreshesResponse
     DescribeInstanceRefreshesResponse
     (Maybe [InstanceRefresh])
     (Maybe [InstanceRefresh])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceRefreshesResponse' {Maybe [InstanceRefresh]
instanceRefreshes :: Maybe [InstanceRefresh]
$sel:instanceRefreshes:DescribeInstanceRefreshesResponse' :: DescribeInstanceRefreshesResponse -> Maybe [InstanceRefresh]
instanceRefreshes} -> Maybe [InstanceRefresh]
instanceRefreshes) (\s :: DescribeInstanceRefreshesResponse
s@DescribeInstanceRefreshesResponse' {} Maybe [InstanceRefresh]
a -> DescribeInstanceRefreshesResponse
s {$sel:instanceRefreshes:DescribeInstanceRefreshesResponse' :: Maybe [InstanceRefresh]
instanceRefreshes = Maybe [InstanceRefresh]
a} :: DescribeInstanceRefreshesResponse) ((Maybe [InstanceRefresh] -> f (Maybe [InstanceRefresh]))
 -> DescribeInstanceRefreshesResponse
 -> f DescribeInstanceRefreshesResponse)
-> ((Maybe [InstanceRefresh] -> f (Maybe [InstanceRefresh]))
    -> Maybe [InstanceRefresh] -> f (Maybe [InstanceRefresh]))
-> (Maybe [InstanceRefresh] -> f (Maybe [InstanceRefresh]))
-> DescribeInstanceRefreshesResponse
-> f DescribeInstanceRefreshesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstanceRefresh]
  [InstanceRefresh]
  [InstanceRefresh]
  [InstanceRefresh]
-> Iso
     (Maybe [InstanceRefresh])
     (Maybe [InstanceRefresh])
     (Maybe [InstanceRefresh])
     (Maybe [InstanceRefresh])
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
  [InstanceRefresh]
  [InstanceRefresh]
  [InstanceRefresh]
  [InstanceRefresh]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeInstanceRefreshesResponse