module Network.AWS.StorageGateway.CreateSnapshotFromVolumeRecoveryPoint
    (
    
      createSnapshotFromVolumeRecoveryPoint
    , CreateSnapshotFromVolumeRecoveryPoint
    
    , csfvrpVolumeARN
    , csfvrpSnapshotDescription
    
    , createSnapshotFromVolumeRecoveryPointResponse
    , CreateSnapshotFromVolumeRecoveryPointResponse
    
    , csfvrprsVolumeRecoveryPointTime
    , csfvrprsVolumeARN
    , csfvrprsSnapshotId
    , csfvrprsStatus
    ) where
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response
import           Network.AWS.StorageGateway.Types
import           Network.AWS.StorageGateway.Types.Product
data CreateSnapshotFromVolumeRecoveryPoint = CreateSnapshotFromVolumeRecoveryPoint'
    { _csfvrpVolumeARN           :: !Text
    , _csfvrpSnapshotDescription :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
createSnapshotFromVolumeRecoveryPoint
    :: Text 
    -> Text 
    -> CreateSnapshotFromVolumeRecoveryPoint
createSnapshotFromVolumeRecoveryPoint pVolumeARN_ pSnapshotDescription_ =
    CreateSnapshotFromVolumeRecoveryPoint'
    { _csfvrpVolumeARN = pVolumeARN_
    , _csfvrpSnapshotDescription = pSnapshotDescription_
    }
csfvrpVolumeARN :: Lens' CreateSnapshotFromVolumeRecoveryPoint Text
csfvrpVolumeARN = lens _csfvrpVolumeARN (\ s a -> s{_csfvrpVolumeARN = a});
csfvrpSnapshotDescription :: Lens' CreateSnapshotFromVolumeRecoveryPoint Text
csfvrpSnapshotDescription = lens _csfvrpSnapshotDescription (\ s a -> s{_csfvrpSnapshotDescription = a});
instance AWSRequest
         CreateSnapshotFromVolumeRecoveryPoint where
        type Rs CreateSnapshotFromVolumeRecoveryPoint =
             CreateSnapshotFromVolumeRecoveryPointResponse
        request = postJSON storageGateway
        response
          = receiveJSON
              (\ s h x ->
                 CreateSnapshotFromVolumeRecoveryPointResponse' <$>
                   (x .?> "VolumeRecoveryPointTime") <*>
                     (x .?> "VolumeARN")
                     <*> (x .?> "SnapshotId")
                     <*> (pure (fromEnum s)))
instance ToHeaders
         CreateSnapshotFromVolumeRecoveryPoint where
        toHeaders
          = const
              (mconcat
                 ["X-Amz-Target" =#
                    ("StorageGateway_20130630.CreateSnapshotFromVolumeRecoveryPoint"
                       :: ByteString),
                  "Content-Type" =#
                    ("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateSnapshotFromVolumeRecoveryPoint
         where
        toJSON CreateSnapshotFromVolumeRecoveryPoint'{..}
          = object
              (catMaybes
                 [Just ("VolumeARN" .= _csfvrpVolumeARN),
                  Just
                    ("SnapshotDescription" .=
                       _csfvrpSnapshotDescription)])
instance ToPath CreateSnapshotFromVolumeRecoveryPoint
         where
        toPath = const "/"
instance ToQuery
         CreateSnapshotFromVolumeRecoveryPoint where
        toQuery = const mempty
data CreateSnapshotFromVolumeRecoveryPointResponse = CreateSnapshotFromVolumeRecoveryPointResponse'
    { _csfvrprsVolumeRecoveryPointTime :: !(Maybe Text)
    , _csfvrprsVolumeARN               :: !(Maybe Text)
    , _csfvrprsSnapshotId              :: !(Maybe Text)
    , _csfvrprsStatus                  :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
createSnapshotFromVolumeRecoveryPointResponse
    :: Int 
    -> CreateSnapshotFromVolumeRecoveryPointResponse
createSnapshotFromVolumeRecoveryPointResponse pStatus_ =
    CreateSnapshotFromVolumeRecoveryPointResponse'
    { _csfvrprsVolumeRecoveryPointTime = Nothing
    , _csfvrprsVolumeARN = Nothing
    , _csfvrprsSnapshotId = Nothing
    , _csfvrprsStatus = pStatus_
    }
csfvrprsVolumeRecoveryPointTime :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprsVolumeRecoveryPointTime = lens _csfvrprsVolumeRecoveryPointTime (\ s a -> s{_csfvrprsVolumeRecoveryPointTime = a});
csfvrprsVolumeARN :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprsVolumeARN = lens _csfvrprsVolumeARN (\ s a -> s{_csfvrprsVolumeARN = a});
csfvrprsSnapshotId :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse (Maybe Text)
csfvrprsSnapshotId = lens _csfvrprsSnapshotId (\ s a -> s{_csfvrprsSnapshotId = a});
csfvrprsStatus :: Lens' CreateSnapshotFromVolumeRecoveryPointResponse Int
csfvrprsStatus = lens _csfvrprsStatus (\ s a -> s{_csfvrprsStatus = a});