{-# 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.GetDeployablePatchSnapshotForInstance
-- 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 current snapshot for the patch baseline the managed node
-- uses. This API is primarily used by the @AWS-RunPatchBaseline@ Systems
-- Manager document (SSM document).
--
-- If you run the command locally, such as with the Command Line Interface
-- (CLI), the system attempts to use your local Amazon Web Services
-- credentials and the operation fails. To avoid this, you can run the
-- command in the Amazon Web Services Systems Manager console. Use Run
-- Command, a capability of Amazon Web Services Systems Manager, with an
-- SSM document that enables you to target a managed node with a script or
-- command. For example, run the command using the @AWS-RunShellScript@
-- document or the @AWS-RunPowerShellScript@ document.
module Amazonka.SSM.GetDeployablePatchSnapshotForInstance
  ( -- * Creating a Request
    GetDeployablePatchSnapshotForInstance (..),
    newGetDeployablePatchSnapshotForInstance,

    -- * Request Lenses
    getDeployablePatchSnapshotForInstance_baselineOverride,
    getDeployablePatchSnapshotForInstance_instanceId,
    getDeployablePatchSnapshotForInstance_snapshotId,

    -- * Destructuring the Response
    GetDeployablePatchSnapshotForInstanceResponse (..),
    newGetDeployablePatchSnapshotForInstanceResponse,

    -- * Response Lenses
    getDeployablePatchSnapshotForInstanceResponse_instanceId,
    getDeployablePatchSnapshotForInstanceResponse_product,
    getDeployablePatchSnapshotForInstanceResponse_snapshotDownloadUrl,
    getDeployablePatchSnapshotForInstanceResponse_snapshotId,
    getDeployablePatchSnapshotForInstanceResponse_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:/ 'newGetDeployablePatchSnapshotForInstance' smart constructor.
data GetDeployablePatchSnapshotForInstance = GetDeployablePatchSnapshotForInstance'
  { -- | Defines the basic information about a patch baseline override.
    GetDeployablePatchSnapshotForInstance -> Maybe BaselineOverride
baselineOverride :: Prelude.Maybe BaselineOverride,
    -- | The ID of the managed node for which the appropriate patch snapshot
    -- should be retrieved.
    GetDeployablePatchSnapshotForInstance -> Text
instanceId :: Prelude.Text,
    -- | The snapshot ID provided by the user when running
    -- @AWS-RunPatchBaseline@.
    GetDeployablePatchSnapshotForInstance -> Text
snapshotId :: Prelude.Text
  }
  deriving (GetDeployablePatchSnapshotForInstance
-> GetDeployablePatchSnapshotForInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeployablePatchSnapshotForInstance
-> GetDeployablePatchSnapshotForInstance -> Bool
$c/= :: GetDeployablePatchSnapshotForInstance
-> GetDeployablePatchSnapshotForInstance -> Bool
== :: GetDeployablePatchSnapshotForInstance
-> GetDeployablePatchSnapshotForInstance -> Bool
$c== :: GetDeployablePatchSnapshotForInstance
-> GetDeployablePatchSnapshotForInstance -> Bool
Prelude.Eq, Int -> GetDeployablePatchSnapshotForInstance -> ShowS
[GetDeployablePatchSnapshotForInstance] -> ShowS
GetDeployablePatchSnapshotForInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeployablePatchSnapshotForInstance] -> ShowS
$cshowList :: [GetDeployablePatchSnapshotForInstance] -> ShowS
show :: GetDeployablePatchSnapshotForInstance -> String
$cshow :: GetDeployablePatchSnapshotForInstance -> String
showsPrec :: Int -> GetDeployablePatchSnapshotForInstance -> ShowS
$cshowsPrec :: Int -> GetDeployablePatchSnapshotForInstance -> ShowS
Prelude.Show, forall x.
Rep GetDeployablePatchSnapshotForInstance x
-> GetDeployablePatchSnapshotForInstance
forall x.
GetDeployablePatchSnapshotForInstance
-> Rep GetDeployablePatchSnapshotForInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeployablePatchSnapshotForInstance x
-> GetDeployablePatchSnapshotForInstance
$cfrom :: forall x.
GetDeployablePatchSnapshotForInstance
-> Rep GetDeployablePatchSnapshotForInstance x
Prelude.Generic)

-- |
-- Create a value of 'GetDeployablePatchSnapshotForInstance' 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:
--
-- 'baselineOverride', 'getDeployablePatchSnapshotForInstance_baselineOverride' - Defines the basic information about a patch baseline override.
--
-- 'instanceId', 'getDeployablePatchSnapshotForInstance_instanceId' - The ID of the managed node for which the appropriate patch snapshot
-- should be retrieved.
--
-- 'snapshotId', 'getDeployablePatchSnapshotForInstance_snapshotId' - The snapshot ID provided by the user when running
-- @AWS-RunPatchBaseline@.
newGetDeployablePatchSnapshotForInstance ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'snapshotId'
  Prelude.Text ->
  GetDeployablePatchSnapshotForInstance
newGetDeployablePatchSnapshotForInstance :: Text -> Text -> GetDeployablePatchSnapshotForInstance
newGetDeployablePatchSnapshotForInstance
  Text
pInstanceId_
  Text
pSnapshotId_ =
    GetDeployablePatchSnapshotForInstance'
      { $sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: Maybe BaselineOverride
baselineOverride =
          forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:GetDeployablePatchSnapshotForInstance' :: Text
instanceId = Text
pInstanceId_,
        $sel:snapshotId:GetDeployablePatchSnapshotForInstance' :: Text
snapshotId = Text
pSnapshotId_
      }

-- | Defines the basic information about a patch baseline override.
getDeployablePatchSnapshotForInstance_baselineOverride :: Lens.Lens' GetDeployablePatchSnapshotForInstance (Prelude.Maybe BaselineOverride)
getDeployablePatchSnapshotForInstance_baselineOverride :: Lens'
  GetDeployablePatchSnapshotForInstance (Maybe BaselineOverride)
getDeployablePatchSnapshotForInstance_baselineOverride = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstance' {Maybe BaselineOverride
baselineOverride :: Maybe BaselineOverride
$sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Maybe BaselineOverride
baselineOverride} -> Maybe BaselineOverride
baselineOverride) (\s :: GetDeployablePatchSnapshotForInstance
s@GetDeployablePatchSnapshotForInstance' {} Maybe BaselineOverride
a -> GetDeployablePatchSnapshotForInstance
s {$sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: Maybe BaselineOverride
baselineOverride = Maybe BaselineOverride
a} :: GetDeployablePatchSnapshotForInstance)

-- | The ID of the managed node for which the appropriate patch snapshot
-- should be retrieved.
getDeployablePatchSnapshotForInstance_instanceId :: Lens.Lens' GetDeployablePatchSnapshotForInstance Prelude.Text
getDeployablePatchSnapshotForInstance_instanceId :: Lens' GetDeployablePatchSnapshotForInstance Text
getDeployablePatchSnapshotForInstance_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstance' {Text
instanceId :: Text
$sel:instanceId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
instanceId} -> Text
instanceId) (\s :: GetDeployablePatchSnapshotForInstance
s@GetDeployablePatchSnapshotForInstance' {} Text
a -> GetDeployablePatchSnapshotForInstance
s {$sel:instanceId:GetDeployablePatchSnapshotForInstance' :: Text
instanceId = Text
a} :: GetDeployablePatchSnapshotForInstance)

-- | The snapshot ID provided by the user when running
-- @AWS-RunPatchBaseline@.
getDeployablePatchSnapshotForInstance_snapshotId :: Lens.Lens' GetDeployablePatchSnapshotForInstance Prelude.Text
getDeployablePatchSnapshotForInstance_snapshotId :: Lens' GetDeployablePatchSnapshotForInstance Text
getDeployablePatchSnapshotForInstance_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstance' {Text
snapshotId :: Text
$sel:snapshotId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
snapshotId} -> Text
snapshotId) (\s :: GetDeployablePatchSnapshotForInstance
s@GetDeployablePatchSnapshotForInstance' {} Text
a -> GetDeployablePatchSnapshotForInstance
s {$sel:snapshotId:GetDeployablePatchSnapshotForInstance' :: Text
snapshotId = Text
a} :: GetDeployablePatchSnapshotForInstance)

instance
  Core.AWSRequest
    GetDeployablePatchSnapshotForInstance
  where
  type
    AWSResponse
      GetDeployablePatchSnapshotForInstance =
      GetDeployablePatchSnapshotForInstanceResponse
  request :: (Service -> Service)
-> GetDeployablePatchSnapshotForInstance
-> Request GetDeployablePatchSnapshotForInstance
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 GetDeployablePatchSnapshotForInstance
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetDeployablePatchSnapshotForInstance)))
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 Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeployablePatchSnapshotForInstanceResponse
GetDeployablePatchSnapshotForInstanceResponse'
            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
"InstanceId")
            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
"Product")
            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
"SnapshotDownloadUrl")
            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
"SnapshotId")
            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
    GetDeployablePatchSnapshotForInstance
  where
  hashWithSalt :: Int -> GetDeployablePatchSnapshotForInstance -> Int
hashWithSalt
    Int
_salt
    GetDeployablePatchSnapshotForInstance' {Maybe BaselineOverride
Text
snapshotId :: Text
instanceId :: Text
baselineOverride :: Maybe BaselineOverride
$sel:snapshotId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
$sel:instanceId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
$sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Maybe BaselineOverride
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BaselineOverride
baselineOverride
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotId

instance
  Prelude.NFData
    GetDeployablePatchSnapshotForInstance
  where
  rnf :: GetDeployablePatchSnapshotForInstance -> ()
rnf GetDeployablePatchSnapshotForInstance' {Maybe BaselineOverride
Text
snapshotId :: Text
instanceId :: Text
baselineOverride :: Maybe BaselineOverride
$sel:snapshotId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
$sel:instanceId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
$sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Maybe BaselineOverride
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe BaselineOverride
baselineOverride
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotId

instance
  Data.ToHeaders
    GetDeployablePatchSnapshotForInstance
  where
  toHeaders :: GetDeployablePatchSnapshotForInstance -> 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.GetDeployablePatchSnapshotForInstance" ::
                          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
    GetDeployablePatchSnapshotForInstance
  where
  toJSON :: GetDeployablePatchSnapshotForInstance -> Value
toJSON GetDeployablePatchSnapshotForInstance' {Maybe BaselineOverride
Text
snapshotId :: Text
instanceId :: Text
baselineOverride :: Maybe BaselineOverride
$sel:snapshotId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
$sel:instanceId:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Text
$sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: GetDeployablePatchSnapshotForInstance -> Maybe BaselineOverride
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BaselineOverride" 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 BaselineOverride
baselineOverride,
            forall a. a -> Maybe a
Prelude.Just (Key
"InstanceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceId),
            forall a. a -> Maybe a
Prelude.Just (Key
"SnapshotId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
snapshotId)
          ]
      )

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

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

-- | /See:/ 'newGetDeployablePatchSnapshotForInstanceResponse' smart constructor.
data GetDeployablePatchSnapshotForInstanceResponse = GetDeployablePatchSnapshotForInstanceResponse'
  { -- | The managed node ID.
    GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | Returns the specific operating system (for example Windows Server 2012
    -- or Amazon Linux 2015.09) on the managed node for the specified patch
    -- snapshot.
    GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
product :: Prelude.Maybe Prelude.Text,
    -- | A pre-signed Amazon Simple Storage Service (Amazon S3) URL that can be
    -- used to download the patch snapshot.
    GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
snapshotDownloadUrl :: Prelude.Maybe Prelude.Text,
    -- | The user-defined snapshot ID.
    GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetDeployablePatchSnapshotForInstanceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDeployablePatchSnapshotForInstanceResponse
-> GetDeployablePatchSnapshotForInstanceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeployablePatchSnapshotForInstanceResponse
-> GetDeployablePatchSnapshotForInstanceResponse -> Bool
$c/= :: GetDeployablePatchSnapshotForInstanceResponse
-> GetDeployablePatchSnapshotForInstanceResponse -> Bool
== :: GetDeployablePatchSnapshotForInstanceResponse
-> GetDeployablePatchSnapshotForInstanceResponse -> Bool
$c== :: GetDeployablePatchSnapshotForInstanceResponse
-> GetDeployablePatchSnapshotForInstanceResponse -> Bool
Prelude.Eq, ReadPrec [GetDeployablePatchSnapshotForInstanceResponse]
ReadPrec GetDeployablePatchSnapshotForInstanceResponse
Int -> ReadS GetDeployablePatchSnapshotForInstanceResponse
ReadS [GetDeployablePatchSnapshotForInstanceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeployablePatchSnapshotForInstanceResponse]
$creadListPrec :: ReadPrec [GetDeployablePatchSnapshotForInstanceResponse]
readPrec :: ReadPrec GetDeployablePatchSnapshotForInstanceResponse
$creadPrec :: ReadPrec GetDeployablePatchSnapshotForInstanceResponse
readList :: ReadS [GetDeployablePatchSnapshotForInstanceResponse]
$creadList :: ReadS [GetDeployablePatchSnapshotForInstanceResponse]
readsPrec :: Int -> ReadS GetDeployablePatchSnapshotForInstanceResponse
$creadsPrec :: Int -> ReadS GetDeployablePatchSnapshotForInstanceResponse
Prelude.Read, Int -> GetDeployablePatchSnapshotForInstanceResponse -> ShowS
[GetDeployablePatchSnapshotForInstanceResponse] -> ShowS
GetDeployablePatchSnapshotForInstanceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeployablePatchSnapshotForInstanceResponse] -> ShowS
$cshowList :: [GetDeployablePatchSnapshotForInstanceResponse] -> ShowS
show :: GetDeployablePatchSnapshotForInstanceResponse -> String
$cshow :: GetDeployablePatchSnapshotForInstanceResponse -> String
showsPrec :: Int -> GetDeployablePatchSnapshotForInstanceResponse -> ShowS
$cshowsPrec :: Int -> GetDeployablePatchSnapshotForInstanceResponse -> ShowS
Prelude.Show, forall x.
Rep GetDeployablePatchSnapshotForInstanceResponse x
-> GetDeployablePatchSnapshotForInstanceResponse
forall x.
GetDeployablePatchSnapshotForInstanceResponse
-> Rep GetDeployablePatchSnapshotForInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeployablePatchSnapshotForInstanceResponse x
-> GetDeployablePatchSnapshotForInstanceResponse
$cfrom :: forall x.
GetDeployablePatchSnapshotForInstanceResponse
-> Rep GetDeployablePatchSnapshotForInstanceResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDeployablePatchSnapshotForInstanceResponse' 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:
--
-- 'instanceId', 'getDeployablePatchSnapshotForInstanceResponse_instanceId' - The managed node ID.
--
-- 'product', 'getDeployablePatchSnapshotForInstanceResponse_product' - Returns the specific operating system (for example Windows Server 2012
-- or Amazon Linux 2015.09) on the managed node for the specified patch
-- snapshot.
--
-- 'snapshotDownloadUrl', 'getDeployablePatchSnapshotForInstanceResponse_snapshotDownloadUrl' - A pre-signed Amazon Simple Storage Service (Amazon S3) URL that can be
-- used to download the patch snapshot.
--
-- 'snapshotId', 'getDeployablePatchSnapshotForInstanceResponse_snapshotId' - The user-defined snapshot ID.
--
-- 'httpStatus', 'getDeployablePatchSnapshotForInstanceResponse_httpStatus' - The response's http status code.
newGetDeployablePatchSnapshotForInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDeployablePatchSnapshotForInstanceResponse
newGetDeployablePatchSnapshotForInstanceResponse :: Int -> GetDeployablePatchSnapshotForInstanceResponse
newGetDeployablePatchSnapshotForInstanceResponse
  Int
pHttpStatus_ =
    GetDeployablePatchSnapshotForInstanceResponse'
      { $sel:instanceId:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
instanceId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:product:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
product = forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotDownloadUrl:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
snapshotDownloadUrl =
          forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotId:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetDeployablePatchSnapshotForInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The managed node ID.
getDeployablePatchSnapshotForInstanceResponse_instanceId :: Lens.Lens' GetDeployablePatchSnapshotForInstanceResponse (Prelude.Maybe Prelude.Text)
getDeployablePatchSnapshotForInstanceResponse_instanceId :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
getDeployablePatchSnapshotForInstanceResponse_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstanceResponse' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: GetDeployablePatchSnapshotForInstanceResponse
s@GetDeployablePatchSnapshotForInstanceResponse' {} Maybe Text
a -> GetDeployablePatchSnapshotForInstanceResponse
s {$sel:instanceId:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
instanceId = Maybe Text
a} :: GetDeployablePatchSnapshotForInstanceResponse)

-- | Returns the specific operating system (for example Windows Server 2012
-- or Amazon Linux 2015.09) on the managed node for the specified patch
-- snapshot.
getDeployablePatchSnapshotForInstanceResponse_product :: Lens.Lens' GetDeployablePatchSnapshotForInstanceResponse (Prelude.Maybe Prelude.Text)
getDeployablePatchSnapshotForInstanceResponse_product :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
getDeployablePatchSnapshotForInstanceResponse_product = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstanceResponse' {Maybe Text
product :: Maybe Text
$sel:product:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
product} -> Maybe Text
product) (\s :: GetDeployablePatchSnapshotForInstanceResponse
s@GetDeployablePatchSnapshotForInstanceResponse' {} Maybe Text
a -> GetDeployablePatchSnapshotForInstanceResponse
s {$sel:product:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
product = Maybe Text
a} :: GetDeployablePatchSnapshotForInstanceResponse)

-- | A pre-signed Amazon Simple Storage Service (Amazon S3) URL that can be
-- used to download the patch snapshot.
getDeployablePatchSnapshotForInstanceResponse_snapshotDownloadUrl :: Lens.Lens' GetDeployablePatchSnapshotForInstanceResponse (Prelude.Maybe Prelude.Text)
getDeployablePatchSnapshotForInstanceResponse_snapshotDownloadUrl :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
getDeployablePatchSnapshotForInstanceResponse_snapshotDownloadUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstanceResponse' {Maybe Text
snapshotDownloadUrl :: Maybe Text
$sel:snapshotDownloadUrl:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
snapshotDownloadUrl} -> Maybe Text
snapshotDownloadUrl) (\s :: GetDeployablePatchSnapshotForInstanceResponse
s@GetDeployablePatchSnapshotForInstanceResponse' {} Maybe Text
a -> GetDeployablePatchSnapshotForInstanceResponse
s {$sel:snapshotDownloadUrl:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
snapshotDownloadUrl = Maybe Text
a} :: GetDeployablePatchSnapshotForInstanceResponse)

-- | The user-defined snapshot ID.
getDeployablePatchSnapshotForInstanceResponse_snapshotId :: Lens.Lens' GetDeployablePatchSnapshotForInstanceResponse (Prelude.Maybe Prelude.Text)
getDeployablePatchSnapshotForInstanceResponse_snapshotId :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
getDeployablePatchSnapshotForInstanceResponse_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployablePatchSnapshotForInstanceResponse' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: GetDeployablePatchSnapshotForInstanceResponse
s@GetDeployablePatchSnapshotForInstanceResponse' {} Maybe Text
a -> GetDeployablePatchSnapshotForInstanceResponse
s {$sel:snapshotId:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
snapshotId = Maybe Text
a} :: GetDeployablePatchSnapshotForInstanceResponse)

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

instance
  Prelude.NFData
    GetDeployablePatchSnapshotForInstanceResponse
  where
  rnf :: GetDeployablePatchSnapshotForInstanceResponse -> ()
rnf
    GetDeployablePatchSnapshotForInstanceResponse' {Int
Maybe Text
httpStatus :: Int
snapshotId :: Maybe Text
snapshotDownloadUrl :: Maybe Text
product :: Maybe Text
instanceId :: Maybe Text
$sel:httpStatus:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Int
$sel:snapshotId:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
$sel:snapshotDownloadUrl:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
$sel:product:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
$sel:instanceId:GetDeployablePatchSnapshotForInstanceResponse' :: GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
product
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotDownloadUrl
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus