module Network.AWS.StorageGateway.DescribeSnapshotSchedule
    (
    
      describeSnapshotSchedule
    , DescribeSnapshotSchedule
    
    , dssVolumeARN
    
    , describeSnapshotScheduleResponse
    , DescribeSnapshotScheduleResponse
    
    , dssrsVolumeARN
    , dssrsStartAt
    , dssrsRecurrenceInHours
    , dssrsTimezone
    , dssrsDescription
    , dssrsStatus
    ) where
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response
import           Network.AWS.StorageGateway.Types
import           Network.AWS.StorageGateway.Types.Product
newtype DescribeSnapshotSchedule = DescribeSnapshotSchedule'
    { _dssVolumeARN :: Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
describeSnapshotSchedule
    :: Text 
    -> DescribeSnapshotSchedule
describeSnapshotSchedule pVolumeARN_ =
    DescribeSnapshotSchedule'
    { _dssVolumeARN = pVolumeARN_
    }
dssVolumeARN :: Lens' DescribeSnapshotSchedule Text
dssVolumeARN = lens _dssVolumeARN (\ s a -> s{_dssVolumeARN = a});
instance AWSRequest DescribeSnapshotSchedule where
        type Rs DescribeSnapshotSchedule =
             DescribeSnapshotScheduleResponse
        request = postJSON storageGateway
        response
          = receiveJSON
              (\ s h x ->
                 DescribeSnapshotScheduleResponse' <$>
                   (x .?> "VolumeARN") <*> (x .?> "StartAt") <*>
                     (x .?> "RecurrenceInHours")
                     <*> (x .?> "Timezone")
                     <*> (x .?> "Description")
                     <*> (pure (fromEnum s)))
instance ToHeaders DescribeSnapshotSchedule where
        toHeaders
          = const
              (mconcat
                 ["X-Amz-Target" =#
                    ("StorageGateway_20130630.DescribeSnapshotSchedule"
                       :: ByteString),
                  "Content-Type" =#
                    ("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeSnapshotSchedule where
        toJSON DescribeSnapshotSchedule'{..}
          = object
              (catMaybes [Just ("VolumeARN" .= _dssVolumeARN)])
instance ToPath DescribeSnapshotSchedule where
        toPath = const "/"
instance ToQuery DescribeSnapshotSchedule where
        toQuery = const mempty
data DescribeSnapshotScheduleResponse = DescribeSnapshotScheduleResponse'
    { _dssrsVolumeARN         :: !(Maybe Text)
    , _dssrsStartAt           :: !(Maybe Nat)
    , _dssrsRecurrenceInHours :: !(Maybe Nat)
    , _dssrsTimezone          :: !(Maybe Text)
    , _dssrsDescription       :: !(Maybe Text)
    , _dssrsStatus            :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
describeSnapshotScheduleResponse
    :: Int 
    -> DescribeSnapshotScheduleResponse
describeSnapshotScheduleResponse pStatus_ =
    DescribeSnapshotScheduleResponse'
    { _dssrsVolumeARN = Nothing
    , _dssrsStartAt = Nothing
    , _dssrsRecurrenceInHours = Nothing
    , _dssrsTimezone = Nothing
    , _dssrsDescription = Nothing
    , _dssrsStatus = pStatus_
    }
dssrsVolumeARN :: Lens' DescribeSnapshotScheduleResponse (Maybe Text)
dssrsVolumeARN = lens _dssrsVolumeARN (\ s a -> s{_dssrsVolumeARN = a});
dssrsStartAt :: Lens' DescribeSnapshotScheduleResponse (Maybe Natural)
dssrsStartAt = lens _dssrsStartAt (\ s a -> s{_dssrsStartAt = a}) . mapping _Nat;
dssrsRecurrenceInHours :: Lens' DescribeSnapshotScheduleResponse (Maybe Natural)
dssrsRecurrenceInHours = lens _dssrsRecurrenceInHours (\ s a -> s{_dssrsRecurrenceInHours = a}) . mapping _Nat;
dssrsTimezone :: Lens' DescribeSnapshotScheduleResponse (Maybe Text)
dssrsTimezone = lens _dssrsTimezone (\ s a -> s{_dssrsTimezone = a});
dssrsDescription :: Lens' DescribeSnapshotScheduleResponse (Maybe Text)
dssrsDescription = lens _dssrsDescription (\ s a -> s{_dssrsDescription = a});
dssrsStatus :: Lens' DescribeSnapshotScheduleResponse Int
dssrsStatus = lens _dssrsStatus (\ s a -> s{_dssrsStatus = a});