{-# 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.DescribeInstancePatches
-- 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 information about the patches on the specified managed node
-- and their state relative to the patch baseline being used for the node.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeInstancePatches
  ( -- * Creating a Request
    DescribeInstancePatches (..),
    newDescribeInstancePatches,

    -- * Request Lenses
    describeInstancePatches_filters,
    describeInstancePatches_maxResults,
    describeInstancePatches_nextToken,
    describeInstancePatches_instanceId,

    -- * Destructuring the Response
    DescribeInstancePatchesResponse (..),
    newDescribeInstancePatchesResponse,

    -- * Response Lenses
    describeInstancePatchesResponse_nextToken,
    describeInstancePatchesResponse_patches,
    describeInstancePatchesResponse_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:/ 'newDescribeInstancePatches' smart constructor.
data DescribeInstancePatches = DescribeInstancePatches'
  { -- | Each element in the array is a structure containing a key-value pair.
    --
    -- Supported keys for @DescribeInstancePatches@include the following:
    --
    -- -   __@Classification@__
    --
    --     Sample values: @Security@ | @SecurityUpdates@
    --
    -- -   __@KBId@__
    --
    --     Sample values: @KB4480056@ | @java-1.7.0-openjdk.x86_64@
    --
    -- -   __@Severity@__
    --
    --     Sample values: @Important@ | @Medium@ | @Low@
    --
    -- -   __@State@__
    --
    --     Sample values: @Installed@ | @InstalledOther@ |
    --     @InstalledPendingReboot@
    DescribeInstancePatches -> Maybe [PatchOrchestratorFilter]
filters :: Prelude.Maybe [PatchOrchestratorFilter],
    -- | The maximum number of patches to return (per page).
    DescribeInstancePatches -> 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.)
    DescribeInstancePatches -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the managed node whose patch state information should be
    -- retrieved.
    DescribeInstancePatches -> Text
instanceId :: Prelude.Text
  }
  deriving (DescribeInstancePatches -> DescribeInstancePatches -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstancePatches -> DescribeInstancePatches -> Bool
$c/= :: DescribeInstancePatches -> DescribeInstancePatches -> Bool
== :: DescribeInstancePatches -> DescribeInstancePatches -> Bool
$c== :: DescribeInstancePatches -> DescribeInstancePatches -> Bool
Prelude.Eq, ReadPrec [DescribeInstancePatches]
ReadPrec DescribeInstancePatches
Int -> ReadS DescribeInstancePatches
ReadS [DescribeInstancePatches]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstancePatches]
$creadListPrec :: ReadPrec [DescribeInstancePatches]
readPrec :: ReadPrec DescribeInstancePatches
$creadPrec :: ReadPrec DescribeInstancePatches
readList :: ReadS [DescribeInstancePatches]
$creadList :: ReadS [DescribeInstancePatches]
readsPrec :: Int -> ReadS DescribeInstancePatches
$creadsPrec :: Int -> ReadS DescribeInstancePatches
Prelude.Read, Int -> DescribeInstancePatches -> ShowS
[DescribeInstancePatches] -> ShowS
DescribeInstancePatches -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstancePatches] -> ShowS
$cshowList :: [DescribeInstancePatches] -> ShowS
show :: DescribeInstancePatches -> String
$cshow :: DescribeInstancePatches -> String
showsPrec :: Int -> DescribeInstancePatches -> ShowS
$cshowsPrec :: Int -> DescribeInstancePatches -> ShowS
Prelude.Show, forall x. Rep DescribeInstancePatches x -> DescribeInstancePatches
forall x. DescribeInstancePatches -> Rep DescribeInstancePatches x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeInstancePatches x -> DescribeInstancePatches
$cfrom :: forall x. DescribeInstancePatches -> Rep DescribeInstancePatches x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstancePatches' 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:
--
-- 'filters', 'describeInstancePatches_filters' - Each element in the array is a structure containing a key-value pair.
--
-- Supported keys for @DescribeInstancePatches@include the following:
--
-- -   __@Classification@__
--
--     Sample values: @Security@ | @SecurityUpdates@
--
-- -   __@KBId@__
--
--     Sample values: @KB4480056@ | @java-1.7.0-openjdk.x86_64@
--
-- -   __@Severity@__
--
--     Sample values: @Important@ | @Medium@ | @Low@
--
-- -   __@State@__
--
--     Sample values: @Installed@ | @InstalledOther@ |
--     @InstalledPendingReboot@
--
-- 'maxResults', 'describeInstancePatches_maxResults' - The maximum number of patches to return (per page).
--
-- 'nextToken', 'describeInstancePatches_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'instanceId', 'describeInstancePatches_instanceId' - The ID of the managed node whose patch state information should be
-- retrieved.
newDescribeInstancePatches ::
  -- | 'instanceId'
  Prelude.Text ->
  DescribeInstancePatches
newDescribeInstancePatches :: Text -> DescribeInstancePatches
newDescribeInstancePatches Text
pInstanceId_ =
  DescribeInstancePatches'
    { $sel:filters:DescribeInstancePatches' :: Maybe [PatchOrchestratorFilter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeInstancePatches' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstancePatches' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:DescribeInstancePatches' :: Text
instanceId = Text
pInstanceId_
    }

-- | Each element in the array is a structure containing a key-value pair.
--
-- Supported keys for @DescribeInstancePatches@include the following:
--
-- -   __@Classification@__
--
--     Sample values: @Security@ | @SecurityUpdates@
--
-- -   __@KBId@__
--
--     Sample values: @KB4480056@ | @java-1.7.0-openjdk.x86_64@
--
-- -   __@Severity@__
--
--     Sample values: @Important@ | @Medium@ | @Low@
--
-- -   __@State@__
--
--     Sample values: @Installed@ | @InstalledOther@ |
--     @InstalledPendingReboot@
describeInstancePatches_filters :: Lens.Lens' DescribeInstancePatches (Prelude.Maybe [PatchOrchestratorFilter])
describeInstancePatches_filters :: Lens' DescribeInstancePatches (Maybe [PatchOrchestratorFilter])
describeInstancePatches_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatches' {Maybe [PatchOrchestratorFilter]
filters :: Maybe [PatchOrchestratorFilter]
$sel:filters:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe [PatchOrchestratorFilter]
filters} -> Maybe [PatchOrchestratorFilter]
filters) (\s :: DescribeInstancePatches
s@DescribeInstancePatches' {} Maybe [PatchOrchestratorFilter]
a -> DescribeInstancePatches
s {$sel:filters:DescribeInstancePatches' :: Maybe [PatchOrchestratorFilter]
filters = Maybe [PatchOrchestratorFilter]
a} :: DescribeInstancePatches) 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 maximum number of patches to return (per page).
describeInstancePatches_maxResults :: Lens.Lens' DescribeInstancePatches (Prelude.Maybe Prelude.Natural)
describeInstancePatches_maxResults :: Lens' DescribeInstancePatches (Maybe Natural)
describeInstancePatches_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatches' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeInstancePatches
s@DescribeInstancePatches' {} Maybe Natural
a -> DescribeInstancePatches
s {$sel:maxResults:DescribeInstancePatches' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeInstancePatches)

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

-- | The ID of the managed node whose patch state information should be
-- retrieved.
describeInstancePatches_instanceId :: Lens.Lens' DescribeInstancePatches Prelude.Text
describeInstancePatches_instanceId :: Lens' DescribeInstancePatches Text
describeInstancePatches_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatches' {Text
instanceId :: Text
$sel:instanceId:DescribeInstancePatches' :: DescribeInstancePatches -> Text
instanceId} -> Text
instanceId) (\s :: DescribeInstancePatches
s@DescribeInstancePatches' {} Text
a -> DescribeInstancePatches
s {$sel:instanceId:DescribeInstancePatches' :: Text
instanceId = Text
a} :: DescribeInstancePatches)

instance Core.AWSPager DescribeInstancePatches where
  page :: DescribeInstancePatches
-> AWSResponse DescribeInstancePatches
-> Maybe DescribeInstancePatches
page DescribeInstancePatches
rq AWSResponse DescribeInstancePatches
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstancePatches
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstancePatchesResponse (Maybe Text)
describeInstancePatchesResponse_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 DescribeInstancePatches
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstancePatchesResponse (Maybe [PatchComplianceData])
describeInstancePatchesResponse_patches
            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.$ DescribeInstancePatches
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeInstancePatches (Maybe Text)
describeInstancePatches_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeInstancePatches
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstancePatchesResponse (Maybe Text)
describeInstancePatchesResponse_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 DescribeInstancePatches where
  type
    AWSResponse DescribeInstancePatches =
      DescribeInstancePatchesResponse
  request :: (Service -> Service)
-> DescribeInstancePatches -> Request DescribeInstancePatches
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 DescribeInstancePatches
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstancePatches)))
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 Text
-> Maybe [PatchComplianceData]
-> Int
-> DescribeInstancePatchesResponse
DescribeInstancePatchesResponse'
            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
"NextToken")
            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
"Patches" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeInstancePatches where
  hashWithSalt :: Int -> DescribeInstancePatches -> Int
hashWithSalt Int
_salt DescribeInstancePatches' {Maybe Natural
Maybe [PatchOrchestratorFilter]
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [PatchOrchestratorFilter]
$sel:instanceId:DescribeInstancePatches' :: DescribeInstancePatches -> Text
$sel:nextToken:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Text
$sel:maxResults:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Natural
$sel:filters:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe [PatchOrchestratorFilter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PatchOrchestratorFilter]
filters
      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
instanceId

instance Prelude.NFData DescribeInstancePatches where
  rnf :: DescribeInstancePatches -> ()
rnf DescribeInstancePatches' {Maybe Natural
Maybe [PatchOrchestratorFilter]
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [PatchOrchestratorFilter]
$sel:instanceId:DescribeInstancePatches' :: DescribeInstancePatches -> Text
$sel:nextToken:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Text
$sel:maxResults:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Natural
$sel:filters:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe [PatchOrchestratorFilter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [PatchOrchestratorFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
instanceId

instance Data.ToHeaders DescribeInstancePatches where
  toHeaders :: DescribeInstancePatches -> 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.DescribeInstancePatches" ::
                          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 DescribeInstancePatches where
  toJSON :: DescribeInstancePatches -> Value
toJSON DescribeInstancePatches' {Maybe Natural
Maybe [PatchOrchestratorFilter]
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [PatchOrchestratorFilter]
$sel:instanceId:DescribeInstancePatches' :: DescribeInstancePatches -> Text
$sel:nextToken:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Text
$sel:maxResults:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe Natural
$sel:filters:DescribeInstancePatches' :: DescribeInstancePatches -> Maybe [PatchOrchestratorFilter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" 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 [PatchOrchestratorFilter]
filters,
            (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
"InstanceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceId)
          ]
      )

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

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

-- | /See:/ 'newDescribeInstancePatchesResponse' smart constructor.
data DescribeInstancePatchesResponse = DescribeInstancePatchesResponse'
  { -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    DescribeInstancePatchesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Each entry in the array is a structure containing:
    --
    -- -   Title (string)
    --
    -- -   KBId (string)
    --
    -- -   Classification (string)
    --
    -- -   Severity (string)
    --
    -- -   State (string, such as \"INSTALLED\" or \"FAILED\")
    --
    -- -   InstalledTime (DateTime)
    --
    -- -   InstalledBy (string)
    DescribeInstancePatchesResponse -> Maybe [PatchComplianceData]
patches :: Prelude.Maybe [PatchComplianceData],
    -- | The response's http status code.
    DescribeInstancePatchesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstancePatchesResponse
-> DescribeInstancePatchesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstancePatchesResponse
-> DescribeInstancePatchesResponse -> Bool
$c/= :: DescribeInstancePatchesResponse
-> DescribeInstancePatchesResponse -> Bool
== :: DescribeInstancePatchesResponse
-> DescribeInstancePatchesResponse -> Bool
$c== :: DescribeInstancePatchesResponse
-> DescribeInstancePatchesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeInstancePatchesResponse]
ReadPrec DescribeInstancePatchesResponse
Int -> ReadS DescribeInstancePatchesResponse
ReadS [DescribeInstancePatchesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstancePatchesResponse]
$creadListPrec :: ReadPrec [DescribeInstancePatchesResponse]
readPrec :: ReadPrec DescribeInstancePatchesResponse
$creadPrec :: ReadPrec DescribeInstancePatchesResponse
readList :: ReadS [DescribeInstancePatchesResponse]
$creadList :: ReadS [DescribeInstancePatchesResponse]
readsPrec :: Int -> ReadS DescribeInstancePatchesResponse
$creadsPrec :: Int -> ReadS DescribeInstancePatchesResponse
Prelude.Read, Int -> DescribeInstancePatchesResponse -> ShowS
[DescribeInstancePatchesResponse] -> ShowS
DescribeInstancePatchesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstancePatchesResponse] -> ShowS
$cshowList :: [DescribeInstancePatchesResponse] -> ShowS
show :: DescribeInstancePatchesResponse -> String
$cshow :: DescribeInstancePatchesResponse -> String
showsPrec :: Int -> DescribeInstancePatchesResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstancePatchesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeInstancePatchesResponse x
-> DescribeInstancePatchesResponse
forall x.
DescribeInstancePatchesResponse
-> Rep DescribeInstancePatchesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstancePatchesResponse x
-> DescribeInstancePatchesResponse
$cfrom :: forall x.
DescribeInstancePatchesResponse
-> Rep DescribeInstancePatchesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstancePatchesResponse' 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', 'describeInstancePatchesResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'patches', 'describeInstancePatchesResponse_patches' - Each entry in the array is a structure containing:
--
-- -   Title (string)
--
-- -   KBId (string)
--
-- -   Classification (string)
--
-- -   Severity (string)
--
-- -   State (string, such as \"INSTALLED\" or \"FAILED\")
--
-- -   InstalledTime (DateTime)
--
-- -   InstalledBy (string)
--
-- 'httpStatus', 'describeInstancePatchesResponse_httpStatus' - The response's http status code.
newDescribeInstancePatchesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstancePatchesResponse
newDescribeInstancePatchesResponse :: Int -> DescribeInstancePatchesResponse
newDescribeInstancePatchesResponse Int
pHttpStatus_ =
  DescribeInstancePatchesResponse'
    { $sel:nextToken:DescribeInstancePatchesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:patches:DescribeInstancePatchesResponse' :: Maybe [PatchComplianceData]
patches = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstancePatchesResponse' :: 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.
describeInstancePatchesResponse_nextToken :: Lens.Lens' DescribeInstancePatchesResponse (Prelude.Maybe Prelude.Text)
describeInstancePatchesResponse_nextToken :: Lens' DescribeInstancePatchesResponse (Maybe Text)
describeInstancePatchesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstancePatchesResponse' :: DescribeInstancePatchesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstancePatchesResponse
s@DescribeInstancePatchesResponse' {} Maybe Text
a -> DescribeInstancePatchesResponse
s {$sel:nextToken:DescribeInstancePatchesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstancePatchesResponse)

-- | Each entry in the array is a structure containing:
--
-- -   Title (string)
--
-- -   KBId (string)
--
-- -   Classification (string)
--
-- -   Severity (string)
--
-- -   State (string, such as \"INSTALLED\" or \"FAILED\")
--
-- -   InstalledTime (DateTime)
--
-- -   InstalledBy (string)
describeInstancePatchesResponse_patches :: Lens.Lens' DescribeInstancePatchesResponse (Prelude.Maybe [PatchComplianceData])
describeInstancePatchesResponse_patches :: Lens' DescribeInstancePatchesResponse (Maybe [PatchComplianceData])
describeInstancePatchesResponse_patches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchesResponse' {Maybe [PatchComplianceData]
patches :: Maybe [PatchComplianceData]
$sel:patches:DescribeInstancePatchesResponse' :: DescribeInstancePatchesResponse -> Maybe [PatchComplianceData]
patches} -> Maybe [PatchComplianceData]
patches) (\s :: DescribeInstancePatchesResponse
s@DescribeInstancePatchesResponse' {} Maybe [PatchComplianceData]
a -> DescribeInstancePatchesResponse
s {$sel:patches:DescribeInstancePatchesResponse' :: Maybe [PatchComplianceData]
patches = Maybe [PatchComplianceData]
a} :: DescribeInstancePatchesResponse) 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 response's http status code.
describeInstancePatchesResponse_httpStatus :: Lens.Lens' DescribeInstancePatchesResponse Prelude.Int
describeInstancePatchesResponse_httpStatus :: Lens' DescribeInstancePatchesResponse Int
describeInstancePatchesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancePatchesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeInstancePatchesResponse' :: DescribeInstancePatchesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeInstancePatchesResponse
s@DescribeInstancePatchesResponse' {} Int
a -> DescribeInstancePatchesResponse
s {$sel:httpStatus:DescribeInstancePatchesResponse' :: Int
httpStatus = Int
a} :: DescribeInstancePatchesResponse)

instance
  Prelude.NFData
    DescribeInstancePatchesResponse
  where
  rnf :: DescribeInstancePatchesResponse -> ()
rnf DescribeInstancePatchesResponse' {Int
Maybe [PatchComplianceData]
Maybe Text
httpStatus :: Int
patches :: Maybe [PatchComplianceData]
nextToken :: Maybe Text
$sel:httpStatus:DescribeInstancePatchesResponse' :: DescribeInstancePatchesResponse -> Int
$sel:patches:DescribeInstancePatchesResponse' :: DescribeInstancePatchesResponse -> Maybe [PatchComplianceData]
$sel:nextToken:DescribeInstancePatchesResponse' :: DescribeInstancePatchesResponse -> Maybe Text
..} =
    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 Maybe [PatchComplianceData]
patches
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus