{-# 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-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 current snapshot for the patch baseline the instance 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 an instance 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.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:/ '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 instance 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
(GetDeployablePatchSnapshotForInstance
 -> GetDeployablePatchSnapshotForInstance -> Bool)
-> (GetDeployablePatchSnapshotForInstance
    -> GetDeployablePatchSnapshotForInstance -> Bool)
-> Eq GetDeployablePatchSnapshotForInstance
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
(Int -> GetDeployablePatchSnapshotForInstance -> ShowS)
-> (GetDeployablePatchSnapshotForInstance -> String)
-> ([GetDeployablePatchSnapshotForInstance] -> ShowS)
-> Show GetDeployablePatchSnapshotForInstance
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.
 GetDeployablePatchSnapshotForInstance
 -> Rep GetDeployablePatchSnapshotForInstance x)
-> (forall x.
    Rep GetDeployablePatchSnapshotForInstance x
    -> GetDeployablePatchSnapshotForInstance)
-> Generic GetDeployablePatchSnapshotForInstance
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 instance 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' :: Maybe BaselineOverride
-> Text -> Text -> GetDeployablePatchSnapshotForInstance
GetDeployablePatchSnapshotForInstance'
      { $sel:baselineOverride:GetDeployablePatchSnapshotForInstance' :: Maybe BaselineOverride
baselineOverride =
          Maybe 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 :: (Maybe BaselineOverride -> f (Maybe BaselineOverride))
-> GetDeployablePatchSnapshotForInstance
-> f GetDeployablePatchSnapshotForInstance
getDeployablePatchSnapshotForInstance_baselineOverride = (GetDeployablePatchSnapshotForInstance -> Maybe BaselineOverride)
-> (GetDeployablePatchSnapshotForInstance
    -> Maybe BaselineOverride -> GetDeployablePatchSnapshotForInstance)
-> Lens
     GetDeployablePatchSnapshotForInstance
     GetDeployablePatchSnapshotForInstance
     (Maybe BaselineOverride)
     (Maybe 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 instance for which the appropriate patch snapshot should
-- be retrieved.
getDeployablePatchSnapshotForInstance_instanceId :: Lens.Lens' GetDeployablePatchSnapshotForInstance Prelude.Text
getDeployablePatchSnapshotForInstance_instanceId :: (Text -> f Text)
-> GetDeployablePatchSnapshotForInstance
-> f GetDeployablePatchSnapshotForInstance
getDeployablePatchSnapshotForInstance_instanceId = (GetDeployablePatchSnapshotForInstance -> Text)
-> (GetDeployablePatchSnapshotForInstance
    -> Text -> GetDeployablePatchSnapshotForInstance)
-> Lens
     GetDeployablePatchSnapshotForInstance
     GetDeployablePatchSnapshotForInstance
     Text
     Text
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 :: (Text -> f Text)
-> GetDeployablePatchSnapshotForInstance
-> f GetDeployablePatchSnapshotForInstance
getDeployablePatchSnapshotForInstance_snapshotId = (GetDeployablePatchSnapshotForInstance -> Text)
-> (GetDeployablePatchSnapshotForInstance
    -> Text -> GetDeployablePatchSnapshotForInstance)
-> Lens
     GetDeployablePatchSnapshotForInstance
     GetDeployablePatchSnapshotForInstance
     Text
     Text
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 :: GetDeployablePatchSnapshotForInstance
-> Request GetDeployablePatchSnapshotForInstance
request = Service
-> GetDeployablePatchSnapshotForInstance
-> Request GetDeployablePatchSnapshotForInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDeployablePatchSnapshotForInstance
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetDeployablePatchSnapshotForInstance)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse GetDeployablePatchSnapshotForInstance))
-> Logger
-> Service
-> Proxy GetDeployablePatchSnapshotForInstance
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetDeployablePatchSnapshotForInstance)))
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 Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeployablePatchSnapshotForInstanceResponse
GetDeployablePatchSnapshotForInstanceResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetDeployablePatchSnapshotForInstanceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetDeployablePatchSnapshotForInstanceResponse)
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
"InstanceId")
              Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetDeployablePatchSnapshotForInstanceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Int
      -> GetDeployablePatchSnapshotForInstanceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Product")
              Either
  String
  (Maybe Text
   -> Maybe Text
   -> Int
   -> GetDeployablePatchSnapshotForInstanceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int -> GetDeployablePatchSnapshotForInstanceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"SnapshotDownloadUrl")
              Either
  String
  (Maybe Text
   -> Int -> GetDeployablePatchSnapshotForInstanceResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> GetDeployablePatchSnapshotForInstanceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"SnapshotId")
              Either
  String (Int -> GetDeployablePatchSnapshotForInstanceResponse)
-> Either String Int
-> Either String GetDeployablePatchSnapshotForInstanceResponse
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
    GetDeployablePatchSnapshotForInstance

instance
  Prelude.NFData
    GetDeployablePatchSnapshotForInstance

instance
  Core.ToHeaders
    GetDeployablePatchSnapshotForInstance
  where
  toHeaders :: GetDeployablePatchSnapshotForInstance -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GetDeployablePatchSnapshotForInstance -> 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.GetDeployablePatchSnapshotForInstance" ::
                          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
    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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BaselineOverride" Text -> BaselineOverride -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BaselineOverride -> Pair) -> Maybe BaselineOverride -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BaselineOverride
baselineOverride,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SnapshotId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
snapshotId)
          ]
      )

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

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

-- | /See:/ 'newGetDeployablePatchSnapshotForInstanceResponse' smart constructor.
data GetDeployablePatchSnapshotForInstanceResponse = GetDeployablePatchSnapshotForInstanceResponse'
  { -- | The instance 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 instance 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
(GetDeployablePatchSnapshotForInstanceResponse
 -> GetDeployablePatchSnapshotForInstanceResponse -> Bool)
-> (GetDeployablePatchSnapshotForInstanceResponse
    -> GetDeployablePatchSnapshotForInstanceResponse -> Bool)
-> Eq GetDeployablePatchSnapshotForInstanceResponse
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]
(Int -> ReadS GetDeployablePatchSnapshotForInstanceResponse)
-> ReadS [GetDeployablePatchSnapshotForInstanceResponse]
-> ReadPrec GetDeployablePatchSnapshotForInstanceResponse
-> ReadPrec [GetDeployablePatchSnapshotForInstanceResponse]
-> Read 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
(Int -> GetDeployablePatchSnapshotForInstanceResponse -> ShowS)
-> (GetDeployablePatchSnapshotForInstanceResponse -> String)
-> ([GetDeployablePatchSnapshotForInstanceResponse] -> ShowS)
-> Show GetDeployablePatchSnapshotForInstanceResponse
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.
 GetDeployablePatchSnapshotForInstanceResponse
 -> Rep GetDeployablePatchSnapshotForInstanceResponse x)
-> (forall x.
    Rep GetDeployablePatchSnapshotForInstanceResponse x
    -> GetDeployablePatchSnapshotForInstanceResponse)
-> Generic GetDeployablePatchSnapshotForInstanceResponse
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 instance ID.
--
-- 'product', 'getDeployablePatchSnapshotForInstanceResponse_product' - Returns the specific operating system (for example Windows Server 2012
-- or Amazon Linux 2015.09) on the instance 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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeployablePatchSnapshotForInstanceResponse
GetDeployablePatchSnapshotForInstanceResponse'
      { $sel:instanceId:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
instanceId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:product:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
product = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotDownloadUrl:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
snapshotDownloadUrl =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotId:GetDeployablePatchSnapshotForInstanceResponse' :: Maybe Text
snapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetDeployablePatchSnapshotForInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The instance ID.
getDeployablePatchSnapshotForInstanceResponse_instanceId :: Lens.Lens' GetDeployablePatchSnapshotForInstanceResponse (Prelude.Maybe Prelude.Text)
getDeployablePatchSnapshotForInstanceResponse_instanceId :: (Maybe Text -> f (Maybe Text))
-> GetDeployablePatchSnapshotForInstanceResponse
-> f GetDeployablePatchSnapshotForInstanceResponse
getDeployablePatchSnapshotForInstanceResponse_instanceId = (GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text)
-> (GetDeployablePatchSnapshotForInstanceResponse
    -> Maybe Text -> GetDeployablePatchSnapshotForInstanceResponse)
-> Lens
     GetDeployablePatchSnapshotForInstanceResponse
     GetDeployablePatchSnapshotForInstanceResponse
     (Maybe Text)
     (Maybe Text)
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 instance for the specified patch
-- snapshot.
getDeployablePatchSnapshotForInstanceResponse_product :: Lens.Lens' GetDeployablePatchSnapshotForInstanceResponse (Prelude.Maybe Prelude.Text)
getDeployablePatchSnapshotForInstanceResponse_product :: (Maybe Text -> f (Maybe Text))
-> GetDeployablePatchSnapshotForInstanceResponse
-> f GetDeployablePatchSnapshotForInstanceResponse
getDeployablePatchSnapshotForInstanceResponse_product = (GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text)
-> (GetDeployablePatchSnapshotForInstanceResponse
    -> Maybe Text -> GetDeployablePatchSnapshotForInstanceResponse)
-> Lens
     GetDeployablePatchSnapshotForInstanceResponse
     GetDeployablePatchSnapshotForInstanceResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> GetDeployablePatchSnapshotForInstanceResponse
-> f GetDeployablePatchSnapshotForInstanceResponse
getDeployablePatchSnapshotForInstanceResponse_snapshotDownloadUrl = (GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text)
-> (GetDeployablePatchSnapshotForInstanceResponse
    -> Maybe Text -> GetDeployablePatchSnapshotForInstanceResponse)
-> Lens
     GetDeployablePatchSnapshotForInstanceResponse
     GetDeployablePatchSnapshotForInstanceResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> GetDeployablePatchSnapshotForInstanceResponse
-> f GetDeployablePatchSnapshotForInstanceResponse
getDeployablePatchSnapshotForInstanceResponse_snapshotId = (GetDeployablePatchSnapshotForInstanceResponse -> Maybe Text)
-> (GetDeployablePatchSnapshotForInstanceResponse
    -> Maybe Text -> GetDeployablePatchSnapshotForInstanceResponse)
-> Lens
     GetDeployablePatchSnapshotForInstanceResponse
     GetDeployablePatchSnapshotForInstanceResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Int -> f Int)
-> GetDeployablePatchSnapshotForInstanceResponse
-> f GetDeployablePatchSnapshotForInstanceResponse
getDeployablePatchSnapshotForInstanceResponse_httpStatus = (GetDeployablePatchSnapshotForInstanceResponse -> Int)
-> (GetDeployablePatchSnapshotForInstanceResponse
    -> Int -> GetDeployablePatchSnapshotForInstanceResponse)
-> Lens
     GetDeployablePatchSnapshotForInstanceResponse
     GetDeployablePatchSnapshotForInstanceResponse
     Int
     Int
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