{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.SSM.GetDeployablePatchSnapshotForInstance
(
getDeployablePatchSnapshotForInstance
, GetDeployablePatchSnapshotForInstance
, gdpsfiInstanceId
, gdpsfiSnapshotId
, getDeployablePatchSnapshotForInstanceResponse
, GetDeployablePatchSnapshotForInstanceResponse
, gdpsfirsInstanceId
, gdpsfirsProduct
, gdpsfirsSnapshotDownloadURL
, gdpsfirsSnapshotId
, gdpsfirsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SSM.Types
import Network.AWS.SSM.Types.Product
data GetDeployablePatchSnapshotForInstance = GetDeployablePatchSnapshotForInstance'
{ _gdpsfiInstanceId :: !Text
, _gdpsfiSnapshotId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeployablePatchSnapshotForInstance
:: Text
-> Text
-> GetDeployablePatchSnapshotForInstance
getDeployablePatchSnapshotForInstance pInstanceId_ pSnapshotId_ =
GetDeployablePatchSnapshotForInstance'
{_gdpsfiInstanceId = pInstanceId_, _gdpsfiSnapshotId = pSnapshotId_}
gdpsfiInstanceId :: Lens' GetDeployablePatchSnapshotForInstance Text
gdpsfiInstanceId = lens _gdpsfiInstanceId (\ s a -> s{_gdpsfiInstanceId = a})
gdpsfiSnapshotId :: Lens' GetDeployablePatchSnapshotForInstance Text
gdpsfiSnapshotId = lens _gdpsfiSnapshotId (\ s a -> s{_gdpsfiSnapshotId = a})
instance AWSRequest
GetDeployablePatchSnapshotForInstance
where
type Rs GetDeployablePatchSnapshotForInstance =
GetDeployablePatchSnapshotForInstanceResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetDeployablePatchSnapshotForInstanceResponse' <$>
(x .?> "InstanceId") <*> (x .?> "Product") <*>
(x .?> "SnapshotDownloadUrl")
<*> (x .?> "SnapshotId")
<*> (pure (fromEnum s)))
instance Hashable
GetDeployablePatchSnapshotForInstance
where
instance NFData GetDeployablePatchSnapshotForInstance
where
instance ToHeaders
GetDeployablePatchSnapshotForInstance
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetDeployablePatchSnapshotForInstance" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDeployablePatchSnapshotForInstance
where
toJSON GetDeployablePatchSnapshotForInstance'{..}
= object
(catMaybes
[Just ("InstanceId" .= _gdpsfiInstanceId),
Just ("SnapshotId" .= _gdpsfiSnapshotId)])
instance ToPath GetDeployablePatchSnapshotForInstance
where
toPath = const "/"
instance ToQuery
GetDeployablePatchSnapshotForInstance
where
toQuery = const mempty
data GetDeployablePatchSnapshotForInstanceResponse = GetDeployablePatchSnapshotForInstanceResponse'
{ _gdpsfirsInstanceId :: !(Maybe Text)
, _gdpsfirsProduct :: !(Maybe Text)
, _gdpsfirsSnapshotDownloadURL :: !(Maybe Text)
, _gdpsfirsSnapshotId :: !(Maybe Text)
, _gdpsfirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeployablePatchSnapshotForInstanceResponse
:: Int
-> GetDeployablePatchSnapshotForInstanceResponse
getDeployablePatchSnapshotForInstanceResponse pResponseStatus_ =
GetDeployablePatchSnapshotForInstanceResponse'
{ _gdpsfirsInstanceId = Nothing
, _gdpsfirsProduct = Nothing
, _gdpsfirsSnapshotDownloadURL = Nothing
, _gdpsfirsSnapshotId = Nothing
, _gdpsfirsResponseStatus = pResponseStatus_
}
gdpsfirsInstanceId :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
gdpsfirsInstanceId = lens _gdpsfirsInstanceId (\ s a -> s{_gdpsfirsInstanceId = a})
gdpsfirsProduct :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
gdpsfirsProduct = lens _gdpsfirsProduct (\ s a -> s{_gdpsfirsProduct = a})
gdpsfirsSnapshotDownloadURL :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
gdpsfirsSnapshotDownloadURL = lens _gdpsfirsSnapshotDownloadURL (\ s a -> s{_gdpsfirsSnapshotDownloadURL = a})
gdpsfirsSnapshotId :: Lens' GetDeployablePatchSnapshotForInstanceResponse (Maybe Text)
gdpsfirsSnapshotId = lens _gdpsfirsSnapshotId (\ s a -> s{_gdpsfirsSnapshotId = a})
gdpsfirsResponseStatus :: Lens' GetDeployablePatchSnapshotForInstanceResponse Int
gdpsfirsResponseStatus = lens _gdpsfirsResponseStatus (\ s a -> s{_gdpsfirsResponseStatus = a})
instance NFData
GetDeployablePatchSnapshotForInstanceResponse
where