{-# 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.DescribeInstancePatchStates
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the high-level patch state of one or more managed nodes.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeInstancePatchStates
  ( -- * Creating a Request
    DescribeInstancePatchStates (..),
    newDescribeInstancePatchStates,

    -- * Request Lenses
    describeInstancePatchStates_maxResults,
    describeInstancePatchStates_nextToken,
    describeInstancePatchStates_instanceIds,

    -- * Destructuring the Response
    DescribeInstancePatchStatesResponse (..),
    newDescribeInstancePatchStatesResponse,

    -- * Response Lenses
    describeInstancePatchStatesResponse_instancePatchStates,
    describeInstancePatchStatesResponse_nextToken,
    describeInstancePatchStatesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newDescribeInstancePatchStates' smart constructor.
data DescribeInstancePatchStates = DescribeInstancePatchStates'
  { -- | The maximum number of managed nodes to return (per page).
    DescribeInstancePatchStates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeInstancePatchStates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the managed node for which patch state information should be
    -- retrieved.
    DescribeInstancePatchStates -> [Text]
instanceIds :: [Prelude.Text]
  }
  deriving (DescribeInstancePatchStates -> DescribeInstancePatchStates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstancePatchStates -> DescribeInstancePatchStates -> Bool
$c/= :: DescribeInstancePatchStates -> DescribeInstancePatchStates -> Bool
== :: DescribeInstancePatchStates -> DescribeInstancePatchStates -> Bool
$c== :: DescribeInstancePatchStates -> DescribeInstancePatchStates -> Bool
Prelude.Eq, ReadPrec [DescribeInstancePatchStates]
ReadPrec DescribeInstancePatchStates
Int -> ReadS DescribeInstancePatchStates
ReadS [DescribeInstancePatchStates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstancePatchStates]
$creadListPrec :: ReadPrec [DescribeInstancePatchStates]
readPrec :: ReadPrec DescribeInstancePatchStates
$creadPrec :: ReadPrec DescribeInstancePatchStates
readList :: ReadS [DescribeInstancePatchStates]
$creadList :: ReadS [DescribeInstancePatchStates]
readsPrec :: Int -> ReadS DescribeInstancePatchStates
$creadsPrec :: Int -> ReadS DescribeInstancePatchStates
Prelude.Read, Int -> DescribeInstancePatchStates -> ShowS
[DescribeInstancePatchStates] -> ShowS
DescribeInstancePatchStates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstancePatchStates] -> ShowS
$cshowList :: [DescribeInstancePatchStates] -> ShowS
show :: DescribeInstancePatchStates -> String
$cshow :: DescribeInstancePatchStates -> String
showsPrec :: Int -> DescribeInstancePatchStates -> ShowS
$cshowsPrec :: Int -> DescribeInstancePatchStates -> ShowS
Prelude.Show, forall x.
Rep DescribeInstancePatchStates x -> DescribeInstancePatchStates
forall x.
DescribeInstancePatchStates -> Rep DescribeInstancePatchStates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstancePatchStates x -> DescribeInstancePatchStates
$cfrom :: forall x.
DescribeInstancePatchStates -> Rep DescribeInstancePatchStates x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstancePatchStates' 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:
--
-- 'maxResults', 'describeInstancePatchStates_maxResults' - The maximum number of managed nodes to return (per page).
--
-- 'nextToken', 'describeInstancePatchStates_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'instanceIds', 'describeInstancePatchStates_instanceIds' - The ID of the managed node for which patch state information should be
-- retrieved.
newDescribeInstancePatchStates ::
  DescribeInstancePatchStates
newDescribeInstancePatchStates :: DescribeInstancePatchStates
newDescribeInstancePatchStates =
  DescribeInstancePatchStates'
    { $sel:maxResults:DescribeInstancePatchStates' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstancePatchStates' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceIds:DescribeInstancePatchStates' :: [Text]
instanceIds = forall a. Monoid a => a
Prelude.mempty
    }

-- | The maximum number of managed nodes to return (per page).
describeInstancePatchStates_maxResults :: Lens.Lens' DescribeInstancePatchStates (Prelude.Maybe Prelude.Natural)
describeInstancePatchStates_maxResults :: Lens' DescribeInstancePatchStates (Maybe Natural)
describeInstancePatchStates_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchStates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeInstancePatchStates
s@DescribeInstancePatchStates' {} Maybe Natural
a -> DescribeInstancePatchStates
s {$sel:maxResults:DescribeInstancePatchStates' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeInstancePatchStates)

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

-- | The ID of the managed node for which patch state information should be
-- retrieved.
describeInstancePatchStates_instanceIds :: Lens.Lens' DescribeInstancePatchStates [Prelude.Text]
describeInstancePatchStates_instanceIds :: Lens' DescribeInstancePatchStates [Text]
describeInstancePatchStates_instanceIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchStates' {[Text]
instanceIds :: [Text]
$sel:instanceIds:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> [Text]
instanceIds} -> [Text]
instanceIds) (\s :: DescribeInstancePatchStates
s@DescribeInstancePatchStates' {} [Text]
a -> DescribeInstancePatchStates
s {$sel:instanceIds:DescribeInstancePatchStates' :: [Text]
instanceIds = [Text]
a} :: DescribeInstancePatchStates) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager DescribeInstancePatchStates where
  page :: DescribeInstancePatchStates
-> AWSResponse DescribeInstancePatchStates
-> Maybe DescribeInstancePatchStates
page DescribeInstancePatchStates
rq AWSResponse DescribeInstancePatchStates
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstancePatchStates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstancePatchStatesResponse (Maybe Text)
describeInstancePatchStatesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstancePatchStates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeInstancePatchStatesResponse (Maybe [InstancePatchState])
describeInstancePatchStatesResponse_instancePatchStates
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeInstancePatchStates
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeInstancePatchStates (Maybe Text)
describeInstancePatchStates_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeInstancePatchStates
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstancePatchStatesResponse (Maybe Text)
describeInstancePatchStatesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeInstancePatchStates where
  type
    AWSResponse DescribeInstancePatchStates =
      DescribeInstancePatchStatesResponse
  request :: (Service -> Service)
-> DescribeInstancePatchStates
-> Request DescribeInstancePatchStates
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeInstancePatchStates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstancePatchStates)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [InstancePatchState]
-> Maybe Text -> Int -> DescribeInstancePatchStatesResponse
DescribeInstancePatchStatesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"InstancePatchStates"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeInstancePatchStates where
  hashWithSalt :: Int -> DescribeInstancePatchStates -> Int
hashWithSalt Int
_salt DescribeInstancePatchStates' {[Text]
Maybe Natural
Maybe Text
instanceIds :: [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceIds:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> [Text]
$sel:nextToken:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Text
$sel:maxResults:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
instanceIds

instance Prelude.NFData DescribeInstancePatchStates where
  rnf :: DescribeInstancePatchStates -> ()
rnf DescribeInstancePatchStates' {[Text]
Maybe Natural
Maybe Text
instanceIds :: [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceIds:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> [Text]
$sel:nextToken:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Text
$sel:maxResults:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
instanceIds

instance Data.ToHeaders DescribeInstancePatchStates where
  toHeaders :: DescribeInstancePatchStates -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.DescribeInstancePatchStates" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeInstancePatchStates where
  toJSON :: DescribeInstancePatchStates -> Value
toJSON DescribeInstancePatchStates' {[Text]
Maybe Natural
Maybe Text
instanceIds :: [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceIds:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> [Text]
$sel:nextToken:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Text
$sel:maxResults:DescribeInstancePatchStates' :: DescribeInstancePatchStates -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"InstanceIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
instanceIds)
          ]
      )

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

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

-- | /See:/ 'newDescribeInstancePatchStatesResponse' smart constructor.
data DescribeInstancePatchStatesResponse = DescribeInstancePatchStatesResponse'
  { -- | The high-level patch state for the requested managed nodes.
    DescribeInstancePatchStatesResponse -> Maybe [InstancePatchState]
instancePatchStates :: Prelude.Maybe [InstancePatchState],
    -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    DescribeInstancePatchStatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeInstancePatchStatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstancePatchStatesResponse
-> DescribeInstancePatchStatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstancePatchStatesResponse
-> DescribeInstancePatchStatesResponse -> Bool
$c/= :: DescribeInstancePatchStatesResponse
-> DescribeInstancePatchStatesResponse -> Bool
== :: DescribeInstancePatchStatesResponse
-> DescribeInstancePatchStatesResponse -> Bool
$c== :: DescribeInstancePatchStatesResponse
-> DescribeInstancePatchStatesResponse -> Bool
Prelude.Eq, Int -> DescribeInstancePatchStatesResponse -> ShowS
[DescribeInstancePatchStatesResponse] -> ShowS
DescribeInstancePatchStatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstancePatchStatesResponse] -> ShowS
$cshowList :: [DescribeInstancePatchStatesResponse] -> ShowS
show :: DescribeInstancePatchStatesResponse -> String
$cshow :: DescribeInstancePatchStatesResponse -> String
showsPrec :: Int -> DescribeInstancePatchStatesResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstancePatchStatesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeInstancePatchStatesResponse x
-> DescribeInstancePatchStatesResponse
forall x.
DescribeInstancePatchStatesResponse
-> Rep DescribeInstancePatchStatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstancePatchStatesResponse x
-> DescribeInstancePatchStatesResponse
$cfrom :: forall x.
DescribeInstancePatchStatesResponse
-> Rep DescribeInstancePatchStatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstancePatchStatesResponse' 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:
--
-- 'instancePatchStates', 'describeInstancePatchStatesResponse_instancePatchStates' - The high-level patch state for the requested managed nodes.
--
-- 'nextToken', 'describeInstancePatchStatesResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'httpStatus', 'describeInstancePatchStatesResponse_httpStatus' - The response's http status code.
newDescribeInstancePatchStatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstancePatchStatesResponse
newDescribeInstancePatchStatesResponse :: Int -> DescribeInstancePatchStatesResponse
newDescribeInstancePatchStatesResponse Int
pHttpStatus_ =
  DescribeInstancePatchStatesResponse'
    { $sel:instancePatchStates:DescribeInstancePatchStatesResponse' :: Maybe [InstancePatchState]
instancePatchStates =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstancePatchStatesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstancePatchStatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The high-level patch state for the requested managed nodes.
describeInstancePatchStatesResponse_instancePatchStates :: Lens.Lens' DescribeInstancePatchStatesResponse (Prelude.Maybe [InstancePatchState])
describeInstancePatchStatesResponse_instancePatchStates :: Lens'
  DescribeInstancePatchStatesResponse (Maybe [InstancePatchState])
describeInstancePatchStatesResponse_instancePatchStates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchStatesResponse' {Maybe [InstancePatchState]
instancePatchStates :: Maybe [InstancePatchState]
$sel:instancePatchStates:DescribeInstancePatchStatesResponse' :: DescribeInstancePatchStatesResponse -> Maybe [InstancePatchState]
instancePatchStates} -> Maybe [InstancePatchState]
instancePatchStates) (\s :: DescribeInstancePatchStatesResponse
s@DescribeInstancePatchStatesResponse' {} Maybe [InstancePatchState]
a -> DescribeInstancePatchStatesResponse
s {$sel:instancePatchStates:DescribeInstancePatchStatesResponse' :: Maybe [InstancePatchState]
instancePatchStates = Maybe [InstancePatchState]
a} :: DescribeInstancePatchStatesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
describeInstancePatchStatesResponse_nextToken :: Lens.Lens' DescribeInstancePatchStatesResponse (Prelude.Maybe Prelude.Text)
describeInstancePatchStatesResponse_nextToken :: Lens' DescribeInstancePatchStatesResponse (Maybe Text)
describeInstancePatchStatesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchStatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstancePatchStatesResponse' :: DescribeInstancePatchStatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstancePatchStatesResponse
s@DescribeInstancePatchStatesResponse' {} Maybe Text
a -> DescribeInstancePatchStatesResponse
s {$sel:nextToken:DescribeInstancePatchStatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstancePatchStatesResponse)

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

instance
  Prelude.NFData
    DescribeInstancePatchStatesResponse
  where
  rnf :: DescribeInstancePatchStatesResponse -> ()
rnf DescribeInstancePatchStatesResponse' {Int
Maybe [InstancePatchState]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
instancePatchStates :: Maybe [InstancePatchState]
$sel:httpStatus:DescribeInstancePatchStatesResponse' :: DescribeInstancePatchStatesResponse -> Int
$sel:nextToken:DescribeInstancePatchStatesResponse' :: DescribeInstancePatchStatesResponse -> Maybe Text
$sel:instancePatchStates:DescribeInstancePatchStatesResponse' :: DescribeInstancePatchStatesResponse -> Maybe [InstancePatchState]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstancePatchState]
instancePatchStates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus