module Network.AWS.StorageGateway.DescribeSnapshotSchedule
(
DescribeSnapshotSchedule
, describeSnapshotSchedule
, dssVolumeARN
, DescribeSnapshotScheduleResponse
, describeSnapshotScheduleResponse
, dssrDescription
, dssrRecurrenceInHours
, dssrStartAt
, dssrTimezone
, dssrVolumeARN
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.StorageGateway.Types
import qualified GHC.Exts
newtype DescribeSnapshotSchedule = DescribeSnapshotSchedule
{ _dssVolumeARN :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
describeSnapshotSchedule :: Text
-> DescribeSnapshotSchedule
describeSnapshotSchedule p1 = DescribeSnapshotSchedule
{ _dssVolumeARN = p1
}
dssVolumeARN :: Lens' DescribeSnapshotSchedule Text
dssVolumeARN = lens _dssVolumeARN (\s a -> s { _dssVolumeARN = a })
data DescribeSnapshotScheduleResponse = DescribeSnapshotScheduleResponse
{ _dssrDescription :: Maybe Text
, _dssrRecurrenceInHours :: Maybe Nat
, _dssrStartAt :: Maybe Nat
, _dssrTimezone :: Maybe Text
, _dssrVolumeARN :: Maybe Text
} deriving (Eq, Ord, Read, Show)
describeSnapshotScheduleResponse :: DescribeSnapshotScheduleResponse
describeSnapshotScheduleResponse = DescribeSnapshotScheduleResponse
{ _dssrVolumeARN = Nothing
, _dssrStartAt = Nothing
, _dssrRecurrenceInHours = Nothing
, _dssrDescription = Nothing
, _dssrTimezone = Nothing
}
dssrDescription :: Lens' DescribeSnapshotScheduleResponse (Maybe Text)
dssrDescription = lens _dssrDescription (\s a -> s { _dssrDescription = a })
dssrRecurrenceInHours :: Lens' DescribeSnapshotScheduleResponse (Maybe Natural)
dssrRecurrenceInHours =
lens _dssrRecurrenceInHours (\s a -> s { _dssrRecurrenceInHours = a })
. mapping _Nat
dssrStartAt :: Lens' DescribeSnapshotScheduleResponse (Maybe Natural)
dssrStartAt = lens _dssrStartAt (\s a -> s { _dssrStartAt = a }) . mapping _Nat
dssrTimezone :: Lens' DescribeSnapshotScheduleResponse (Maybe Text)
dssrTimezone = lens _dssrTimezone (\s a -> s { _dssrTimezone = a })
dssrVolumeARN :: Lens' DescribeSnapshotScheduleResponse (Maybe Text)
dssrVolumeARN = lens _dssrVolumeARN (\s a -> s { _dssrVolumeARN = a })
instance ToPath DescribeSnapshotSchedule where
toPath = const "/"
instance ToQuery DescribeSnapshotSchedule where
toQuery = const mempty
instance ToHeaders DescribeSnapshotSchedule
instance ToJSON DescribeSnapshotSchedule where
toJSON DescribeSnapshotSchedule{..} = object
[ "VolumeARN" .= _dssVolumeARN
]
instance AWSRequest DescribeSnapshotSchedule where
type Sv DescribeSnapshotSchedule = StorageGateway
type Rs DescribeSnapshotSchedule = DescribeSnapshotScheduleResponse
request = post "DescribeSnapshotSchedule"
response = jsonResponse
instance FromJSON DescribeSnapshotScheduleResponse where
parseJSON = withObject "DescribeSnapshotScheduleResponse" $ \o -> DescribeSnapshotScheduleResponse
<$> o .:? "Description"
<*> o .:? "RecurrenceInHours"
<*> o .:? "StartAt"
<*> o .:? "Timezone"
<*> o .:? "VolumeARN"