{-# 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-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)
--
-- Retrieves the high-level patch state of one or more instances.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeInstancePatchStates
  ( -- * Creating a Request
    DescribeInstancePatchStates (..),
    newDescribeInstancePatchStates,

    -- * Request Lenses
    describeInstancePatchStates_nextToken,
    describeInstancePatchStates_maxResults,
    describeInstancePatchStates_instanceIds,

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

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

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

-- | /See:/ 'newDescribeInstancePatchStates' smart constructor.
data DescribeInstancePatchStates = DescribeInstancePatchStates'
  { -- | 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 maximum number of instances to return (per page).
    DescribeInstancePatchStates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the instance for which patch state information should be
    -- retrieved.
    DescribeInstancePatchStates -> [Text]
instanceIds :: [Prelude.Text]
  }
  deriving (DescribeInstancePatchStates -> DescribeInstancePatchStates -> Bool
(DescribeInstancePatchStates
 -> DescribeInstancePatchStates -> Bool)
-> (DescribeInstancePatchStates
    -> DescribeInstancePatchStates -> Bool)
-> Eq DescribeInstancePatchStates
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]
(Int -> ReadS DescribeInstancePatchStates)
-> ReadS [DescribeInstancePatchStates]
-> ReadPrec DescribeInstancePatchStates
-> ReadPrec [DescribeInstancePatchStates]
-> Read 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
(Int -> DescribeInstancePatchStates -> ShowS)
-> (DescribeInstancePatchStates -> String)
-> ([DescribeInstancePatchStates] -> ShowS)
-> Show DescribeInstancePatchStates
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.
 DescribeInstancePatchStates -> Rep DescribeInstancePatchStates x)
-> (forall x.
    Rep DescribeInstancePatchStates x -> DescribeInstancePatchStates)
-> Generic DescribeInstancePatchStates
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:
--
-- 'nextToken', 'describeInstancePatchStates_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxResults', 'describeInstancePatchStates_maxResults' - The maximum number of instances to return (per page).
--
-- 'instanceIds', 'describeInstancePatchStates_instanceIds' - The ID of the instance for which patch state information should be
-- retrieved.
newDescribeInstancePatchStates ::
  DescribeInstancePatchStates
newDescribeInstancePatchStates :: DescribeInstancePatchStates
newDescribeInstancePatchStates =
  DescribeInstancePatchStates' :: Maybe Text
-> Maybe Natural -> [Text] -> DescribeInstancePatchStates
DescribeInstancePatchStates'
    { $sel:nextToken:DescribeInstancePatchStates' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeInstancePatchStates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceIds:DescribeInstancePatchStates' :: [Text]
instanceIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeInstancePatchStates -> f DescribeInstancePatchStates
describeInstancePatchStates_nextToken = (DescribeInstancePatchStates -> Maybe Text)
-> (DescribeInstancePatchStates
    -> Maybe Text -> DescribeInstancePatchStates)
-> Lens
     DescribeInstancePatchStates
     DescribeInstancePatchStates
     (Maybe Text)
     (Maybe Text)
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 maximum number of instances to return (per page).
describeInstancePatchStates_maxResults :: Lens.Lens' DescribeInstancePatchStates (Prelude.Maybe Prelude.Natural)
describeInstancePatchStates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeInstancePatchStates -> f DescribeInstancePatchStates
describeInstancePatchStates_maxResults = (DescribeInstancePatchStates -> Maybe Natural)
-> (DescribeInstancePatchStates
    -> Maybe Natural -> DescribeInstancePatchStates)
-> Lens
     DescribeInstancePatchStates
     DescribeInstancePatchStates
     (Maybe Natural)
     (Maybe Natural)
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 ID of the instance for which patch state information should be
-- retrieved.
describeInstancePatchStates_instanceIds :: Lens.Lens' DescribeInstancePatchStates [Prelude.Text]
describeInstancePatchStates_instanceIds :: ([Text] -> f [Text])
-> DescribeInstancePatchStates -> f DescribeInstancePatchStates
describeInstancePatchStates_instanceIds = (DescribeInstancePatchStates -> [Text])
-> (DescribeInstancePatchStates
    -> [Text] -> DescribeInstancePatchStates)
-> Lens
     DescribeInstancePatchStates
     DescribeInstancePatchStates
     [Text]
     [Text]
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) (([Text] -> f [Text])
 -> DescribeInstancePatchStates -> f DescribeInstancePatchStates)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeInstancePatchStates
-> f DescribeInstancePatchStates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstancePatchStates
DescribeInstancePatchStatesResponse
rs
            DescribeInstancePatchStatesResponse
-> Getting (First Text) DescribeInstancePatchStatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeInstancePatchStatesResponse
-> Const (First Text) DescribeInstancePatchStatesResponse
Lens' DescribeInstancePatchStatesResponse (Maybe Text)
describeInstancePatchStatesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeInstancePatchStatesResponse
 -> Const (First Text) DescribeInstancePatchStatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeInstancePatchStatesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeInstancePatchStates
forall a. Maybe a
Prelude.Nothing
    | Maybe [InstancePatchState] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstancePatchStates
DescribeInstancePatchStatesResponse
rs
            DescribeInstancePatchStatesResponse
-> Getting
     (First [InstancePatchState])
     DescribeInstancePatchStatesResponse
     [InstancePatchState]
-> Maybe [InstancePatchState]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [InstancePatchState]
 -> Const (First [InstancePatchState]) (Maybe [InstancePatchState]))
-> DescribeInstancePatchStatesResponse
-> Const
     (First [InstancePatchState]) DescribeInstancePatchStatesResponse
Lens'
  DescribeInstancePatchStatesResponse (Maybe [InstancePatchState])
describeInstancePatchStatesResponse_instancePatchStates
              ((Maybe [InstancePatchState]
  -> Const (First [InstancePatchState]) (Maybe [InstancePatchState]))
 -> DescribeInstancePatchStatesResponse
 -> Const
      (First [InstancePatchState]) DescribeInstancePatchStatesResponse)
-> (([InstancePatchState]
     -> Const (First [InstancePatchState]) [InstancePatchState])
    -> Maybe [InstancePatchState]
    -> Const (First [InstancePatchState]) (Maybe [InstancePatchState]))
-> Getting
     (First [InstancePatchState])
     DescribeInstancePatchStatesResponse
     [InstancePatchState]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([InstancePatchState]
 -> Const (First [InstancePatchState]) [InstancePatchState])
-> Maybe [InstancePatchState]
-> Const (First [InstancePatchState]) (Maybe [InstancePatchState])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeInstancePatchStates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeInstancePatchStates -> Maybe DescribeInstancePatchStates
forall a. a -> Maybe a
Prelude.Just (DescribeInstancePatchStates -> Maybe DescribeInstancePatchStates)
-> DescribeInstancePatchStates -> Maybe DescribeInstancePatchStates
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeInstancePatchStates
rq
          DescribeInstancePatchStates
-> (DescribeInstancePatchStates -> DescribeInstancePatchStates)
-> DescribeInstancePatchStates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeInstancePatchStates
-> Identity DescribeInstancePatchStates
Lens
  DescribeInstancePatchStates
  DescribeInstancePatchStates
  (Maybe Text)
  (Maybe Text)
describeInstancePatchStates_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeInstancePatchStates
 -> Identity DescribeInstancePatchStates)
-> Maybe Text
-> DescribeInstancePatchStates
-> DescribeInstancePatchStates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeInstancePatchStates
DescribeInstancePatchStatesResponse
rs
          DescribeInstancePatchStatesResponse
-> Getting (First Text) DescribeInstancePatchStatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeInstancePatchStatesResponse
-> Const (First Text) DescribeInstancePatchStatesResponse
Lens' DescribeInstancePatchStatesResponse (Maybe Text)
describeInstancePatchStatesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeInstancePatchStatesResponse
 -> Const (First Text) DescribeInstancePatchStatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeInstancePatchStatesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.NFData DescribeInstancePatchStates

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

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

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

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

-- | /See:/ 'newDescribeInstancePatchStatesResponse' smart constructor.
data DescribeInstancePatchStatesResponse = DescribeInstancePatchStatesResponse'
  { -- | 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 high-level patch state for the requested instances.
    DescribeInstancePatchStatesResponse -> Maybe [InstancePatchState]
instancePatchStates :: Prelude.Maybe [InstancePatchState],
    -- | The response's http status code.
    DescribeInstancePatchStatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstancePatchStatesResponse
-> DescribeInstancePatchStatesResponse -> Bool
(DescribeInstancePatchStatesResponse
 -> DescribeInstancePatchStatesResponse -> Bool)
-> (DescribeInstancePatchStatesResponse
    -> DescribeInstancePatchStatesResponse -> Bool)
-> Eq DescribeInstancePatchStatesResponse
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
(Int -> DescribeInstancePatchStatesResponse -> ShowS)
-> (DescribeInstancePatchStatesResponse -> String)
-> ([DescribeInstancePatchStatesResponse] -> ShowS)
-> Show DescribeInstancePatchStatesResponse
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.
 DescribeInstancePatchStatesResponse
 -> Rep DescribeInstancePatchStatesResponse x)
-> (forall x.
    Rep DescribeInstancePatchStatesResponse x
    -> DescribeInstancePatchStatesResponse)
-> Generic DescribeInstancePatchStatesResponse
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:
--
-- '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.
--
-- 'instancePatchStates', 'describeInstancePatchStatesResponse_instancePatchStates' - The high-level patch state for the requested instances.
--
-- 'httpStatus', 'describeInstancePatchStatesResponse_httpStatus' - The response's http status code.
newDescribeInstancePatchStatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstancePatchStatesResponse
newDescribeInstancePatchStatesResponse :: Int -> DescribeInstancePatchStatesResponse
newDescribeInstancePatchStatesResponse Int
pHttpStatus_ =
  DescribeInstancePatchStatesResponse' :: Maybe Text
-> Maybe [InstancePatchState]
-> Int
-> DescribeInstancePatchStatesResponse
DescribeInstancePatchStatesResponse'
    { $sel:nextToken:DescribeInstancePatchStatesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instancePatchStates:DescribeInstancePatchStatesResponse' :: Maybe [InstancePatchState]
instancePatchStates = Maybe [InstancePatchState]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstancePatchStatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DescribeInstancePatchStatesResponse
-> f DescribeInstancePatchStatesResponse
describeInstancePatchStatesResponse_nextToken = (DescribeInstancePatchStatesResponse -> Maybe Text)
-> (DescribeInstancePatchStatesResponse
    -> Maybe Text -> DescribeInstancePatchStatesResponse)
-> Lens' DescribeInstancePatchStatesResponse (Maybe Text)
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 high-level patch state for the requested instances.
describeInstancePatchStatesResponse_instancePatchStates :: Lens.Lens' DescribeInstancePatchStatesResponse (Prelude.Maybe [InstancePatchState])
describeInstancePatchStatesResponse_instancePatchStates :: (Maybe [InstancePatchState] -> f (Maybe [InstancePatchState]))
-> DescribeInstancePatchStatesResponse
-> f DescribeInstancePatchStatesResponse
describeInstancePatchStatesResponse_instancePatchStates = (DescribeInstancePatchStatesResponse -> Maybe [InstancePatchState])
-> (DescribeInstancePatchStatesResponse
    -> Maybe [InstancePatchState]
    -> DescribeInstancePatchStatesResponse)
-> Lens'
     DescribeInstancePatchStatesResponse (Maybe [InstancePatchState])
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) ((Maybe [InstancePatchState] -> f (Maybe [InstancePatchState]))
 -> DescribeInstancePatchStatesResponse
 -> f DescribeInstancePatchStatesResponse)
-> ((Maybe [InstancePatchState] -> f (Maybe [InstancePatchState]))
    -> Maybe [InstancePatchState] -> f (Maybe [InstancePatchState]))
-> (Maybe [InstancePatchState] -> f (Maybe [InstancePatchState]))
-> DescribeInstancePatchStatesResponse
-> f DescribeInstancePatchStatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstancePatchState]
  [InstancePatchState]
  [InstancePatchState]
  [InstancePatchState]
-> Iso
     (Maybe [InstancePatchState])
     (Maybe [InstancePatchState])
     (Maybe [InstancePatchState])
     (Maybe [InstancePatchState])
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
  [InstancePatchState]
  [InstancePatchState]
  [InstancePatchState]
  [InstancePatchState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeInstancePatchStatesResponse_httpStatus :: Lens.Lens' DescribeInstancePatchStatesResponse Prelude.Int
describeInstancePatchStatesResponse_httpStatus :: (Int -> f Int)
-> DescribeInstancePatchStatesResponse
-> f DescribeInstancePatchStatesResponse
describeInstancePatchStatesResponse_httpStatus = (DescribeInstancePatchStatesResponse -> Int)
-> (DescribeInstancePatchStatesResponse
    -> Int -> DescribeInstancePatchStatesResponse)
-> Lens
     DescribeInstancePatchStatesResponse
     DescribeInstancePatchStatesResponse
     Int
     Int
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