module Network.AWS.StorageGateway.Types
(
StorageGateway
, JSONError
, ChapInfo
, chapInfo
, ciInitiatorName
, ciSecretToAuthenticateInitiator
, ciSecretToAuthenticateTarget
, ciTargetARN
, VolumeiSCSIAttributes
, volumeiSCSIAttributes
, vscsiaChapEnabled
, vscsiaLunNumber
, vscsiaNetworkInterfaceId
, vscsiaNetworkInterfacePort
, vscsiaTargetARN
, DeviceiSCSIAttributes
, deviceiSCSIAttributes
, dscsiaChapEnabled
, dscsiaNetworkInterfaceId
, dscsiaNetworkInterfacePort
, dscsiaTargetARN
, Error'
, error
, eErrorCode
, eErrorDetails
, Disk
, disk
, dDiskAllocationResource
, dDiskAllocationType
, dDiskId
, dDiskNode
, dDiskPath
, dDiskSizeInBytes
, dDiskStatus
, Tape
, tape
, tProgress
, tTapeARN
, tTapeBarcode
, tTapeSizeInBytes
, tTapeStatus
, tVTLDevice
, NetworkInterface
, networkInterface
, niIpv4Address
, niIpv6Address
, niMacAddress
, VTLDevice
, vtldevice
, vtldDeviceiSCSIAttributes
, vtldVTLDeviceARN
, vtldVTLDeviceProductIdentifier
, vtldVTLDeviceType
, vtldVTLDeviceVendor
, TapeRecoveryPointInfo
, tapeRecoveryPointInfo
, trpiTapeARN
, trpiTapeRecoveryPointTime
, trpiTapeSizeInBytes
, trpiTapeStatus
, VolumeRecoveryPointInfo
, volumeRecoveryPointInfo
, vrpiVolumeARN
, vrpiVolumeRecoveryPointTime
, vrpiVolumeSizeInBytes
, vrpiVolumeUsageInBytes
, TapeArchive
, tapeArchive
, taCompletionTime
, taRetrievedTo
, taTapeARN
, taTapeBarcode
, taTapeSizeInBytes
, taTapeStatus
, ErrorCode (..)
, StorediSCSIVolume
, storediSCSIVolume
, sscsivPreservedExistingData
, sscsivSourceSnapshotId
, sscsivVolumeARN
, sscsivVolumeDiskId
, sscsivVolumeId
, sscsivVolumeProgress
, sscsivVolumeSizeInBytes
, sscsivVolumeStatus
, sscsivVolumeType
, sscsivVolumeiSCSIAttributes
, CachediSCSIVolume
, cachediSCSIVolume
, cscsivSourceSnapshotId
, cscsivVolumeARN
, cscsivVolumeId
, cscsivVolumeProgress
, cscsivVolumeSizeInBytes
, cscsivVolumeStatus
, cscsivVolumeType
, cscsivVolumeiSCSIAttributes
, VolumeInfo
, volumeInfo
, viVolumeARN
, viVolumeType
, GatewayInfo
, gatewayInfo
, giGatewayARN
, giGatewayOperationalState
, giGatewayType
) where
import Network.AWS.Prelude
import Network.AWS.Signing
import qualified GHC.Exts
data StorageGateway
instance AWSService StorageGateway where
type Sg StorageGateway = V4
type Er StorageGateway = JSONError
service = service'
where
service' :: Service StorageGateway
service' = Service
{ _svcAbbrev = "StorageGateway"
, _svcPrefix = "storagegateway"
, _svcVersion = "2013-06-30"
, _svcTargetPrefix = Just "StorageGateway_20130630"
, _svcJSONVersion = Just "1.1"
, _svcHandle = handle
, _svcRetry = retry
}
handle :: Status
-> Maybe (LazyByteString -> ServiceError JSONError)
handle = jsonError statusSuccess service'
retry :: Retry StorageGateway
retry = Exponential
{ _retryBase = 0.05
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check :: Status
-> JSONError
-> Bool
check (statusCode -> s) (awsErrorCode -> e)
| s == 400 && "ThrottlingException" == e = True
| s == 500 = True
| s == 509 = True
| s == 503 = True
| otherwise = False
data ChapInfo = ChapInfo
{ _ciInitiatorName :: Maybe Text
, _ciSecretToAuthenticateInitiator :: Maybe Text
, _ciSecretToAuthenticateTarget :: Maybe Text
, _ciTargetARN :: Maybe Text
} deriving (Eq, Ord, Read, Show)
chapInfo :: ChapInfo
chapInfo = ChapInfo
{ _ciTargetARN = Nothing
, _ciSecretToAuthenticateInitiator = Nothing
, _ciInitiatorName = Nothing
, _ciSecretToAuthenticateTarget = Nothing
}
ciInitiatorName :: Lens' ChapInfo (Maybe Text)
ciInitiatorName = lens _ciInitiatorName (\s a -> s { _ciInitiatorName = a })
ciSecretToAuthenticateInitiator :: Lens' ChapInfo (Maybe Text)
ciSecretToAuthenticateInitiator =
lens _ciSecretToAuthenticateInitiator
(\s a -> s { _ciSecretToAuthenticateInitiator = a })
ciSecretToAuthenticateTarget :: Lens' ChapInfo (Maybe Text)
ciSecretToAuthenticateTarget =
lens _ciSecretToAuthenticateTarget
(\s a -> s { _ciSecretToAuthenticateTarget = a })
ciTargetARN :: Lens' ChapInfo (Maybe Text)
ciTargetARN = lens _ciTargetARN (\s a -> s { _ciTargetARN = a })
instance FromJSON ChapInfo where
parseJSON = withObject "ChapInfo" $ \o -> ChapInfo
<$> o .:? "InitiatorName"
<*> o .:? "SecretToAuthenticateInitiator"
<*> o .:? "SecretToAuthenticateTarget"
<*> o .:? "TargetARN"
instance ToJSON ChapInfo where
toJSON ChapInfo{..} = object
[ "TargetARN" .= _ciTargetARN
, "SecretToAuthenticateInitiator" .= _ciSecretToAuthenticateInitiator
, "InitiatorName" .= _ciInitiatorName
, "SecretToAuthenticateTarget" .= _ciSecretToAuthenticateTarget
]
data VolumeiSCSIAttributes = VolumeiSCSIAttributes
{ _vscsiaChapEnabled :: Maybe Bool
, _vscsiaLunNumber :: Maybe Nat
, _vscsiaNetworkInterfaceId :: Maybe Text
, _vscsiaNetworkInterfacePort :: Maybe Int
, _vscsiaTargetARN :: Maybe Text
} deriving (Eq, Ord, Read, Show)
volumeiSCSIAttributes :: VolumeiSCSIAttributes
volumeiSCSIAttributes = VolumeiSCSIAttributes
{ _vscsiaTargetARN = Nothing
, _vscsiaNetworkInterfaceId = Nothing
, _vscsiaNetworkInterfacePort = Nothing
, _vscsiaLunNumber = Nothing
, _vscsiaChapEnabled = Nothing
}
vscsiaChapEnabled :: Lens' VolumeiSCSIAttributes (Maybe Bool)
vscsiaChapEnabled =
lens _vscsiaChapEnabled (\s a -> s { _vscsiaChapEnabled = a })
vscsiaLunNumber :: Lens' VolumeiSCSIAttributes (Maybe Natural)
vscsiaLunNumber = lens _vscsiaLunNumber (\s a -> s { _vscsiaLunNumber = a }) . mapping _Nat
vscsiaNetworkInterfaceId :: Lens' VolumeiSCSIAttributes (Maybe Text)
vscsiaNetworkInterfaceId =
lens _vscsiaNetworkInterfaceId
(\s a -> s { _vscsiaNetworkInterfaceId = a })
vscsiaNetworkInterfacePort :: Lens' VolumeiSCSIAttributes (Maybe Int)
vscsiaNetworkInterfacePort =
lens _vscsiaNetworkInterfacePort
(\s a -> s { _vscsiaNetworkInterfacePort = a })
vscsiaTargetARN :: Lens' VolumeiSCSIAttributes (Maybe Text)
vscsiaTargetARN = lens _vscsiaTargetARN (\s a -> s { _vscsiaTargetARN = a })
instance FromJSON VolumeiSCSIAttributes where
parseJSON = withObject "VolumeiSCSIAttributes" $ \o -> VolumeiSCSIAttributes
<$> o .:? "ChapEnabled"
<*> o .:? "LunNumber"
<*> o .:? "NetworkInterfaceId"
<*> o .:? "NetworkInterfacePort"
<*> o .:? "TargetARN"
instance ToJSON VolumeiSCSIAttributes where
toJSON VolumeiSCSIAttributes{..} = object
[ "TargetARN" .= _vscsiaTargetARN
, "NetworkInterfaceId" .= _vscsiaNetworkInterfaceId
, "NetworkInterfacePort" .= _vscsiaNetworkInterfacePort
, "LunNumber" .= _vscsiaLunNumber
, "ChapEnabled" .= _vscsiaChapEnabled
]
data DeviceiSCSIAttributes = DeviceiSCSIAttributes
{ _dscsiaChapEnabled :: Maybe Bool
, _dscsiaNetworkInterfaceId :: Maybe Text
, _dscsiaNetworkInterfacePort :: Maybe Int
, _dscsiaTargetARN :: Maybe Text
} deriving (Eq, Ord, Read, Show)
deviceiSCSIAttributes :: DeviceiSCSIAttributes
deviceiSCSIAttributes = DeviceiSCSIAttributes
{ _dscsiaTargetARN = Nothing
, _dscsiaNetworkInterfaceId = Nothing
, _dscsiaNetworkInterfacePort = Nothing
, _dscsiaChapEnabled = Nothing
}
dscsiaChapEnabled :: Lens' DeviceiSCSIAttributes (Maybe Bool)
dscsiaChapEnabled =
lens _dscsiaChapEnabled (\s a -> s { _dscsiaChapEnabled = a })
dscsiaNetworkInterfaceId :: Lens' DeviceiSCSIAttributes (Maybe Text)
dscsiaNetworkInterfaceId =
lens _dscsiaNetworkInterfaceId
(\s a -> s { _dscsiaNetworkInterfaceId = a })
dscsiaNetworkInterfacePort :: Lens' DeviceiSCSIAttributes (Maybe Int)
dscsiaNetworkInterfacePort =
lens _dscsiaNetworkInterfacePort
(\s a -> s { _dscsiaNetworkInterfacePort = a })
dscsiaTargetARN :: Lens' DeviceiSCSIAttributes (Maybe Text)
dscsiaTargetARN = lens _dscsiaTargetARN (\s a -> s { _dscsiaTargetARN = a })
instance FromJSON DeviceiSCSIAttributes where
parseJSON = withObject "DeviceiSCSIAttributes" $ \o -> DeviceiSCSIAttributes
<$> o .:? "ChapEnabled"
<*> o .:? "NetworkInterfaceId"
<*> o .:? "NetworkInterfacePort"
<*> o .:? "TargetARN"
instance ToJSON DeviceiSCSIAttributes where
toJSON DeviceiSCSIAttributes{..} = object
[ "TargetARN" .= _dscsiaTargetARN
, "NetworkInterfaceId" .= _dscsiaNetworkInterfaceId
, "NetworkInterfacePort" .= _dscsiaNetworkInterfacePort
, "ChapEnabled" .= _dscsiaChapEnabled
]
data Error' = Error'
{ _eErrorCode :: Maybe ErrorCode
, _eErrorDetails :: Map Text Text
} deriving (Eq, Read, Show)
error :: Error'
error = Error'
{ _eErrorCode = Nothing
, _eErrorDetails = mempty
}
eErrorCode :: Lens' Error' (Maybe ErrorCode)
eErrorCode = lens _eErrorCode (\s a -> s { _eErrorCode = a })
eErrorDetails :: Lens' Error' (HashMap Text Text)
eErrorDetails = lens _eErrorDetails (\s a -> s { _eErrorDetails = a }) . _Map
instance FromJSON Error' where
parseJSON = withObject "Error'" $ \o -> Error'
<$> o .:? "errorCode"
<*> o .:? "errorDetails" .!= mempty
instance ToJSON Error' where
toJSON Error'{..} = object
[ "errorCode" .= _eErrorCode
, "errorDetails" .= _eErrorDetails
]
data Disk = Disk
{ _dDiskAllocationResource :: Maybe Text
, _dDiskAllocationType :: Maybe Text
, _dDiskId :: Maybe Text
, _dDiskNode :: Maybe Text
, _dDiskPath :: Maybe Text
, _dDiskSizeInBytes :: Maybe Integer
, _dDiskStatus :: Maybe Text
} deriving (Eq, Ord, Read, Show)
disk :: Disk
disk = Disk
{ _dDiskId = Nothing
, _dDiskPath = Nothing
, _dDiskNode = Nothing
, _dDiskStatus = Nothing
, _dDiskSizeInBytes = Nothing
, _dDiskAllocationType = Nothing
, _dDiskAllocationResource = Nothing
}
dDiskAllocationResource :: Lens' Disk (Maybe Text)
dDiskAllocationResource =
lens _dDiskAllocationResource (\s a -> s { _dDiskAllocationResource = a })
dDiskAllocationType :: Lens' Disk (Maybe Text)
dDiskAllocationType =
lens _dDiskAllocationType (\s a -> s { _dDiskAllocationType = a })
dDiskId :: Lens' Disk (Maybe Text)
dDiskId = lens _dDiskId (\s a -> s { _dDiskId = a })
dDiskNode :: Lens' Disk (Maybe Text)
dDiskNode = lens _dDiskNode (\s a -> s { _dDiskNode = a })
dDiskPath :: Lens' Disk (Maybe Text)
dDiskPath = lens _dDiskPath (\s a -> s { _dDiskPath = a })
dDiskSizeInBytes :: Lens' Disk (Maybe Integer)
dDiskSizeInBytes = lens _dDiskSizeInBytes (\s a -> s { _dDiskSizeInBytes = a })
dDiskStatus :: Lens' Disk (Maybe Text)
dDiskStatus = lens _dDiskStatus (\s a -> s { _dDiskStatus = a })
instance FromJSON Disk where
parseJSON = withObject "Disk" $ \o -> Disk
<$> o .:? "DiskAllocationResource"
<*> o .:? "DiskAllocationType"
<*> o .:? "DiskId"
<*> o .:? "DiskNode"
<*> o .:? "DiskPath"
<*> o .:? "DiskSizeInBytes"
<*> o .:? "DiskStatus"
instance ToJSON Disk where
toJSON Disk{..} = object
[ "DiskId" .= _dDiskId
, "DiskPath" .= _dDiskPath
, "DiskNode" .= _dDiskNode
, "DiskStatus" .= _dDiskStatus
, "DiskSizeInBytes" .= _dDiskSizeInBytes
, "DiskAllocationType" .= _dDiskAllocationType
, "DiskAllocationResource" .= _dDiskAllocationResource
]
data Tape = Tape
{ _tProgress :: Maybe Double
, _tTapeARN :: Maybe Text
, _tTapeBarcode :: Maybe Text
, _tTapeSizeInBytes :: Maybe Integer
, _tTapeStatus :: Maybe Text
, _tVTLDevice :: Maybe Text
} deriving (Eq, Ord, Read, Show)
tape :: Tape
tape = Tape
{ _tTapeARN = Nothing
, _tTapeBarcode = Nothing
, _tTapeSizeInBytes = Nothing
, _tTapeStatus = Nothing
, _tVTLDevice = Nothing
, _tProgress = Nothing
}
tProgress :: Lens' Tape (Maybe Double)
tProgress = lens _tProgress (\s a -> s { _tProgress = a })
tTapeARN :: Lens' Tape (Maybe Text)
tTapeARN = lens _tTapeARN (\s a -> s { _tTapeARN = a })
tTapeBarcode :: Lens' Tape (Maybe Text)
tTapeBarcode = lens _tTapeBarcode (\s a -> s { _tTapeBarcode = a })
tTapeSizeInBytes :: Lens' Tape (Maybe Integer)
tTapeSizeInBytes = lens _tTapeSizeInBytes (\s a -> s { _tTapeSizeInBytes = a })
tTapeStatus :: Lens' Tape (Maybe Text)
tTapeStatus = lens _tTapeStatus (\s a -> s { _tTapeStatus = a })
tVTLDevice :: Lens' Tape (Maybe Text)
tVTLDevice = lens _tVTLDevice (\s a -> s { _tVTLDevice = a })
instance FromJSON Tape where
parseJSON = withObject "Tape" $ \o -> Tape
<$> o .:? "Progress"
<*> o .:? "TapeARN"
<*> o .:? "TapeBarcode"
<*> o .:? "TapeSizeInBytes"
<*> o .:? "TapeStatus"
<*> o .:? "VTLDevice"
instance ToJSON Tape where
toJSON Tape{..} = object
[ "TapeARN" .= _tTapeARN
, "TapeBarcode" .= _tTapeBarcode
, "TapeSizeInBytes" .= _tTapeSizeInBytes
, "TapeStatus" .= _tTapeStatus
, "VTLDevice" .= _tVTLDevice
, "Progress" .= _tProgress
]
data NetworkInterface = NetworkInterface
{ _niIpv4Address :: Maybe Text
, _niIpv6Address :: Maybe Text
, _niMacAddress :: Maybe Text
} deriving (Eq, Ord, Read, Show)
networkInterface :: NetworkInterface
networkInterface = NetworkInterface
{ _niIpv4Address = Nothing
, _niMacAddress = Nothing
, _niIpv6Address = Nothing
}
niIpv4Address :: Lens' NetworkInterface (Maybe Text)
niIpv4Address = lens _niIpv4Address (\s a -> s { _niIpv4Address = a })
niIpv6Address :: Lens' NetworkInterface (Maybe Text)
niIpv6Address = lens _niIpv6Address (\s a -> s { _niIpv6Address = a })
niMacAddress :: Lens' NetworkInterface (Maybe Text)
niMacAddress = lens _niMacAddress (\s a -> s { _niMacAddress = a })
instance FromJSON NetworkInterface where
parseJSON = withObject "NetworkInterface" $ \o -> NetworkInterface
<$> o .:? "Ipv4Address"
<*> o .:? "Ipv6Address"
<*> o .:? "MacAddress"
instance ToJSON NetworkInterface where
toJSON NetworkInterface{..} = object
[ "Ipv4Address" .= _niIpv4Address
, "MacAddress" .= _niMacAddress
, "Ipv6Address" .= _niIpv6Address
]
data VTLDevice = VTLDevice
{ _vtldDeviceiSCSIAttributes :: Maybe DeviceiSCSIAttributes
, _vtldVTLDeviceARN :: Maybe Text
, _vtldVTLDeviceProductIdentifier :: Maybe Text
, _vtldVTLDeviceType :: Maybe Text
, _vtldVTLDeviceVendor :: Maybe Text
} deriving (Eq, Read, Show)
vtldevice :: VTLDevice
vtldevice = VTLDevice
{ _vtldVTLDeviceARN = Nothing
, _vtldVTLDeviceType = Nothing
, _vtldVTLDeviceVendor = Nothing
, _vtldVTLDeviceProductIdentifier = Nothing
, _vtldDeviceiSCSIAttributes = Nothing
}
vtldDeviceiSCSIAttributes :: Lens' VTLDevice (Maybe DeviceiSCSIAttributes)
vtldDeviceiSCSIAttributes =
lens _vtldDeviceiSCSIAttributes
(\s a -> s { _vtldDeviceiSCSIAttributes = a })
vtldVTLDeviceARN :: Lens' VTLDevice (Maybe Text)
vtldVTLDeviceARN = lens _vtldVTLDeviceARN (\s a -> s { _vtldVTLDeviceARN = a })
vtldVTLDeviceProductIdentifier :: Lens' VTLDevice (Maybe Text)
vtldVTLDeviceProductIdentifier =
lens _vtldVTLDeviceProductIdentifier
(\s a -> s { _vtldVTLDeviceProductIdentifier = a })
vtldVTLDeviceType :: Lens' VTLDevice (Maybe Text)
vtldVTLDeviceType =
lens _vtldVTLDeviceType (\s a -> s { _vtldVTLDeviceType = a })
vtldVTLDeviceVendor :: Lens' VTLDevice (Maybe Text)
vtldVTLDeviceVendor =
lens _vtldVTLDeviceVendor (\s a -> s { _vtldVTLDeviceVendor = a })
instance FromJSON VTLDevice where
parseJSON = withObject "VTLDevice" $ \o -> VTLDevice
<$> o .:? "DeviceiSCSIAttributes"
<*> o .:? "VTLDeviceARN"
<*> o .:? "VTLDeviceProductIdentifier"
<*> o .:? "VTLDeviceType"
<*> o .:? "VTLDeviceVendor"
instance ToJSON VTLDevice where
toJSON VTLDevice{..} = object
[ "VTLDeviceARN" .= _vtldVTLDeviceARN
, "VTLDeviceType" .= _vtldVTLDeviceType
, "VTLDeviceVendor" .= _vtldVTLDeviceVendor
, "VTLDeviceProductIdentifier" .= _vtldVTLDeviceProductIdentifier
, "DeviceiSCSIAttributes" .= _vtldDeviceiSCSIAttributes
]
data TapeRecoveryPointInfo = TapeRecoveryPointInfo
{ _trpiTapeARN :: Maybe Text
, _trpiTapeRecoveryPointTime :: Maybe POSIX
, _trpiTapeSizeInBytes :: Maybe Integer
, _trpiTapeStatus :: Maybe Text
} deriving (Eq, Ord, Read, Show)
tapeRecoveryPointInfo :: TapeRecoveryPointInfo
tapeRecoveryPointInfo = TapeRecoveryPointInfo
{ _trpiTapeARN = Nothing
, _trpiTapeRecoveryPointTime = Nothing
, _trpiTapeSizeInBytes = Nothing
, _trpiTapeStatus = Nothing
}
trpiTapeARN :: Lens' TapeRecoveryPointInfo (Maybe Text)
trpiTapeARN = lens _trpiTapeARN (\s a -> s { _trpiTapeARN = a })
trpiTapeRecoveryPointTime :: Lens' TapeRecoveryPointInfo (Maybe UTCTime)
trpiTapeRecoveryPointTime =
lens _trpiTapeRecoveryPointTime
(\s a -> s { _trpiTapeRecoveryPointTime = a })
. mapping _Time
trpiTapeSizeInBytes :: Lens' TapeRecoveryPointInfo (Maybe Integer)
trpiTapeSizeInBytes =
lens _trpiTapeSizeInBytes (\s a -> s { _trpiTapeSizeInBytes = a })
trpiTapeStatus :: Lens' TapeRecoveryPointInfo (Maybe Text)
trpiTapeStatus = lens _trpiTapeStatus (\s a -> s { _trpiTapeStatus = a })
instance FromJSON TapeRecoveryPointInfo where
parseJSON = withObject "TapeRecoveryPointInfo" $ \o -> TapeRecoveryPointInfo
<$> o .:? "TapeARN"
<*> o .:? "TapeRecoveryPointTime"
<*> o .:? "TapeSizeInBytes"
<*> o .:? "TapeStatus"
instance ToJSON TapeRecoveryPointInfo where
toJSON TapeRecoveryPointInfo{..} = object
[ "TapeARN" .= _trpiTapeARN
, "TapeRecoveryPointTime" .= _trpiTapeRecoveryPointTime
, "TapeSizeInBytes" .= _trpiTapeSizeInBytes
, "TapeStatus" .= _trpiTapeStatus
]
data VolumeRecoveryPointInfo = VolumeRecoveryPointInfo
{ _vrpiVolumeARN :: Maybe Text
, _vrpiVolumeRecoveryPointTime :: Maybe Text
, _vrpiVolumeSizeInBytes :: Maybe Integer
, _vrpiVolumeUsageInBytes :: Maybe Integer
} deriving (Eq, Ord, Read, Show)
volumeRecoveryPointInfo :: VolumeRecoveryPointInfo
volumeRecoveryPointInfo = VolumeRecoveryPointInfo
{ _vrpiVolumeARN = Nothing
, _vrpiVolumeSizeInBytes = Nothing
, _vrpiVolumeUsageInBytes = Nothing
, _vrpiVolumeRecoveryPointTime = Nothing
}
vrpiVolumeARN :: Lens' VolumeRecoveryPointInfo (Maybe Text)
vrpiVolumeARN = lens _vrpiVolumeARN (\s a -> s { _vrpiVolumeARN = a })
vrpiVolumeRecoveryPointTime :: Lens' VolumeRecoveryPointInfo (Maybe Text)
vrpiVolumeRecoveryPointTime =
lens _vrpiVolumeRecoveryPointTime
(\s a -> s { _vrpiVolumeRecoveryPointTime = a })
vrpiVolumeSizeInBytes :: Lens' VolumeRecoveryPointInfo (Maybe Integer)
vrpiVolumeSizeInBytes =
lens _vrpiVolumeSizeInBytes (\s a -> s { _vrpiVolumeSizeInBytes = a })
vrpiVolumeUsageInBytes :: Lens' VolumeRecoveryPointInfo (Maybe Integer)
vrpiVolumeUsageInBytes =
lens _vrpiVolumeUsageInBytes (\s a -> s { _vrpiVolumeUsageInBytes = a })
instance FromJSON VolumeRecoveryPointInfo where
parseJSON = withObject "VolumeRecoveryPointInfo" $ \o -> VolumeRecoveryPointInfo
<$> o .:? "VolumeARN"
<*> o .:? "VolumeRecoveryPointTime"
<*> o .:? "VolumeSizeInBytes"
<*> o .:? "VolumeUsageInBytes"
instance ToJSON VolumeRecoveryPointInfo where
toJSON VolumeRecoveryPointInfo{..} = object
[ "VolumeARN" .= _vrpiVolumeARN
, "VolumeSizeInBytes" .= _vrpiVolumeSizeInBytes
, "VolumeUsageInBytes" .= _vrpiVolumeUsageInBytes
, "VolumeRecoveryPointTime" .= _vrpiVolumeRecoveryPointTime
]
data TapeArchive = TapeArchive
{ _taCompletionTime :: Maybe POSIX
, _taRetrievedTo :: Maybe Text
, _taTapeARN :: Maybe Text
, _taTapeBarcode :: Maybe Text
, _taTapeSizeInBytes :: Maybe Integer
, _taTapeStatus :: Maybe Text
} deriving (Eq, Ord, Read, Show)
tapeArchive :: TapeArchive
tapeArchive = TapeArchive
{ _taTapeARN = Nothing
, _taTapeBarcode = Nothing
, _taTapeSizeInBytes = Nothing
, _taCompletionTime = Nothing
, _taRetrievedTo = Nothing
, _taTapeStatus = Nothing
}
taCompletionTime :: Lens' TapeArchive (Maybe UTCTime)
taCompletionTime = lens _taCompletionTime (\s a -> s { _taCompletionTime = a }) . mapping _Time
taRetrievedTo :: Lens' TapeArchive (Maybe Text)
taRetrievedTo = lens _taRetrievedTo (\s a -> s { _taRetrievedTo = a })
taTapeARN :: Lens' TapeArchive (Maybe Text)
taTapeARN = lens _taTapeARN (\s a -> s { _taTapeARN = a })
taTapeBarcode :: Lens' TapeArchive (Maybe Text)
taTapeBarcode = lens _taTapeBarcode (\s a -> s { _taTapeBarcode = a })
taTapeSizeInBytes :: Lens' TapeArchive (Maybe Integer)
taTapeSizeInBytes =
lens _taTapeSizeInBytes (\s a -> s { _taTapeSizeInBytes = a })
taTapeStatus :: Lens' TapeArchive (Maybe Text)
taTapeStatus = lens _taTapeStatus (\s a -> s { _taTapeStatus = a })
instance FromJSON TapeArchive where
parseJSON = withObject "TapeArchive" $ \o -> TapeArchive
<$> o .:? "CompletionTime"
<*> o .:? "RetrievedTo"
<*> o .:? "TapeARN"
<*> o .:? "TapeBarcode"
<*> o .:? "TapeSizeInBytes"
<*> o .:? "TapeStatus"
instance ToJSON TapeArchive where
toJSON TapeArchive{..} = object
[ "TapeARN" .= _taTapeARN
, "TapeBarcode" .= _taTapeBarcode
, "TapeSizeInBytes" .= _taTapeSizeInBytes
, "CompletionTime" .= _taCompletionTime
, "RetrievedTo" .= _taRetrievedTo
, "TapeStatus" .= _taTapeStatus
]
data ErrorCode
= ActivationKeyExpired
| ActivationKeyInvalid
| ActivationKeyNotFound
| AuthenticationFailure
| BandwidthThrottleScheduleNotFound
| Blocked
| CannotExportSnapshot
| ChapCredentialNotFound
| DiskAlreadyAllocated
| DiskDoesNotExist
| DiskSizeGreaterThanVolumeMaxSize
| DiskSizeLessThanVolumeSize
| DiskSizeNotGigAligned
| DuplicateCertificateInfo
| DuplicateSchedule
| EndpointNotFound
| GatewayInternalError
| GatewayNotConnected
| GatewayNotFound
| GatewayProxyNetworkConnectionBusy
| IAMNotSupported
| InitiatorInvalid
| InitiatorNotFound
| InternalError
| InvalidEndpoint
| InvalidGateway
| InvalidParameters
| InvalidSchedule
| LocalStorageLimitExceeded
| LunAlreadyAllocated
| LunInvalid
| MaximumContentLengthExceeded
| MaximumTapeCartridgeCountExceeded
| MaximumVolumeCountExceeded
| NetworkConfigurationChanged
| NoDisksAvailable
| NotImplemented
| NotSupported
| OperationAborted
| OutdatedGateway
| ParametersNotImplemented
| RegionInvalid
| RequestTimeout
| ServiceUnavailable
| SnapshotDeleted
| SnapshotIdInvalid
| SnapshotInProgress
| SnapshotNotFound
| SnapshotScheduleNotFound
| StagingAreaFull
| StorageFailure
| TapeCartridgeNotFound
| TargetAlreadyExists
| TargetInvalid
| TargetNotFound
| UnauthorizedOperation
| VolumeAlreadyExists
| VolumeIdInvalid
| VolumeInUse
| VolumeNotFound
| VolumeNotReady
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable ErrorCode
instance FromText ErrorCode where
parser = takeLowerText >>= \case
"activationkeyexpired" -> pure ActivationKeyExpired
"activationkeyinvalid" -> pure ActivationKeyInvalid
"activationkeynotfound" -> pure ActivationKeyNotFound
"authenticationfailure" -> pure AuthenticationFailure
"bandwidththrottleschedulenotfound" -> pure BandwidthThrottleScheduleNotFound
"blocked" -> pure Blocked
"cannotexportsnapshot" -> pure CannotExportSnapshot
"chapcredentialnotfound" -> pure ChapCredentialNotFound
"diskalreadyallocated" -> pure DiskAlreadyAllocated
"diskdoesnotexist" -> pure DiskDoesNotExist
"disksizegreaterthanvolumemaxsize" -> pure DiskSizeGreaterThanVolumeMaxSize
"disksizelessthanvolumesize" -> pure DiskSizeLessThanVolumeSize
"disksizenotgigaligned" -> pure DiskSizeNotGigAligned
"duplicatecertificateinfo" -> pure DuplicateCertificateInfo
"duplicateschedule" -> pure DuplicateSchedule
"endpointnotfound" -> pure EndpointNotFound
"gatewayinternalerror" -> pure GatewayInternalError
"gatewaynotconnected" -> pure GatewayNotConnected
"gatewaynotfound" -> pure GatewayNotFound
"gatewayproxynetworkconnectionbusy" -> pure GatewayProxyNetworkConnectionBusy
"iamnotsupported" -> pure IAMNotSupported
"initiatorinvalid" -> pure InitiatorInvalid
"initiatornotfound" -> pure InitiatorNotFound
"internalerror" -> pure InternalError
"invalidendpoint" -> pure InvalidEndpoint
"invalidgateway" -> pure InvalidGateway
"invalidparameters" -> pure InvalidParameters
"invalidschedule" -> pure InvalidSchedule
"localstoragelimitexceeded" -> pure LocalStorageLimitExceeded
"lunalreadyallocated " -> pure LunAlreadyAllocated
"luninvalid" -> pure LunInvalid
"maximumcontentlengthexceeded" -> pure MaximumContentLengthExceeded
"maximumtapecartridgecountexceeded" -> pure MaximumTapeCartridgeCountExceeded
"maximumvolumecountexceeded" -> pure MaximumVolumeCountExceeded
"networkconfigurationchanged" -> pure NetworkConfigurationChanged
"nodisksavailable" -> pure NoDisksAvailable
"notimplemented" -> pure NotImplemented
"notsupported" -> pure NotSupported
"operationaborted" -> pure OperationAborted
"outdatedgateway" -> pure OutdatedGateway
"parametersnotimplemented" -> pure ParametersNotImplemented
"regioninvalid" -> pure RegionInvalid
"requesttimeout" -> pure RequestTimeout
"serviceunavailable" -> pure ServiceUnavailable
"snapshotdeleted" -> pure SnapshotDeleted
"snapshotidinvalid" -> pure SnapshotIdInvalid
"snapshotinprogress" -> pure SnapshotInProgress
"snapshotnotfound" -> pure SnapshotNotFound
"snapshotschedulenotfound" -> pure SnapshotScheduleNotFound
"stagingareafull" -> pure StagingAreaFull
"storagefailure" -> pure StorageFailure
"tapecartridgenotfound" -> pure TapeCartridgeNotFound
"targetalreadyexists" -> pure TargetAlreadyExists
"targetinvalid" -> pure TargetInvalid
"targetnotfound" -> pure TargetNotFound
"unauthorizedoperation" -> pure UnauthorizedOperation
"volumealreadyexists" -> pure VolumeAlreadyExists
"volumeidinvalid" -> pure VolumeIdInvalid
"volumeinuse" -> pure VolumeInUse
"volumenotfound" -> pure VolumeNotFound
"volumenotready" -> pure VolumeNotReady
e -> fail $
"Failure parsing ErrorCode from " ++ show e
instance ToText ErrorCode where
toText = \case
ActivationKeyExpired -> "ActivationKeyExpired"
ActivationKeyInvalid -> "ActivationKeyInvalid"
ActivationKeyNotFound -> "ActivationKeyNotFound"
AuthenticationFailure -> "AuthenticationFailure"
BandwidthThrottleScheduleNotFound -> "BandwidthThrottleScheduleNotFound"
Blocked -> "Blocked"
CannotExportSnapshot -> "CannotExportSnapshot"
ChapCredentialNotFound -> "ChapCredentialNotFound"
DiskAlreadyAllocated -> "DiskAlreadyAllocated"
DiskDoesNotExist -> "DiskDoesNotExist"
DiskSizeGreaterThanVolumeMaxSize -> "DiskSizeGreaterThanVolumeMaxSize"
DiskSizeLessThanVolumeSize -> "DiskSizeLessThanVolumeSize"
DiskSizeNotGigAligned -> "DiskSizeNotGigAligned"
DuplicateCertificateInfo -> "DuplicateCertificateInfo"
DuplicateSchedule -> "DuplicateSchedule"
EndpointNotFound -> "EndpointNotFound"
GatewayInternalError -> "GatewayInternalError"
GatewayNotConnected -> "GatewayNotConnected"
GatewayNotFound -> "GatewayNotFound"
GatewayProxyNetworkConnectionBusy -> "GatewayProxyNetworkConnectionBusy"
IAMNotSupported -> "IAMNotSupported"
InitiatorInvalid -> "InitiatorInvalid"
InitiatorNotFound -> "InitiatorNotFound"
InternalError -> "InternalError"
InvalidEndpoint -> "InvalidEndpoint"
InvalidGateway -> "InvalidGateway"
InvalidParameters -> "InvalidParameters"
InvalidSchedule -> "InvalidSchedule"
LocalStorageLimitExceeded -> "LocalStorageLimitExceeded"
LunAlreadyAllocated -> "LunAlreadyAllocated "
LunInvalid -> "LunInvalid"
MaximumContentLengthExceeded -> "MaximumContentLengthExceeded"
MaximumTapeCartridgeCountExceeded -> "MaximumTapeCartridgeCountExceeded"
MaximumVolumeCountExceeded -> "MaximumVolumeCountExceeded"
NetworkConfigurationChanged -> "NetworkConfigurationChanged"
NoDisksAvailable -> "NoDisksAvailable"
NotImplemented -> "NotImplemented"
NotSupported -> "NotSupported"
OperationAborted -> "OperationAborted"
OutdatedGateway -> "OutdatedGateway"
ParametersNotImplemented -> "ParametersNotImplemented"
RegionInvalid -> "RegionInvalid"
RequestTimeout -> "RequestTimeout"
ServiceUnavailable -> "ServiceUnavailable"
SnapshotDeleted -> "SnapshotDeleted"
SnapshotIdInvalid -> "SnapshotIdInvalid"
SnapshotInProgress -> "SnapshotInProgress"
SnapshotNotFound -> "SnapshotNotFound"
SnapshotScheduleNotFound -> "SnapshotScheduleNotFound"
StagingAreaFull -> "StagingAreaFull"
StorageFailure -> "StorageFailure"
TapeCartridgeNotFound -> "TapeCartridgeNotFound"
TargetAlreadyExists -> "TargetAlreadyExists"
TargetInvalid -> "TargetInvalid"
TargetNotFound -> "TargetNotFound"
UnauthorizedOperation -> "UnauthorizedOperation"
VolumeAlreadyExists -> "VolumeAlreadyExists"
VolumeIdInvalid -> "VolumeIdInvalid"
VolumeInUse -> "VolumeInUse"
VolumeNotFound -> "VolumeNotFound"
VolumeNotReady -> "VolumeNotReady"
instance ToByteString ErrorCode
instance ToHeader ErrorCode
instance ToQuery ErrorCode
instance FromJSON ErrorCode where
parseJSON = parseJSONText "ErrorCode"
instance ToJSON ErrorCode where
toJSON = toJSONText
data StorediSCSIVolume = StorediSCSIVolume
{ _sscsivPreservedExistingData :: Maybe Bool
, _sscsivSourceSnapshotId :: Maybe Text
, _sscsivVolumeARN :: Maybe Text
, _sscsivVolumeDiskId :: Maybe Text
, _sscsivVolumeId :: Maybe Text
, _sscsivVolumeProgress :: Maybe Double
, _sscsivVolumeSizeInBytes :: Maybe Integer
, _sscsivVolumeStatus :: Maybe Text
, _sscsivVolumeType :: Maybe Text
, _sscsivVolumeiSCSIAttributes :: Maybe VolumeiSCSIAttributes
} deriving (Eq, Read, Show)
storediSCSIVolume :: StorediSCSIVolume
storediSCSIVolume = StorediSCSIVolume
{ _sscsivVolumeARN = Nothing
, _sscsivVolumeId = Nothing
, _sscsivVolumeType = Nothing
, _sscsivVolumeStatus = Nothing
, _sscsivVolumeSizeInBytes = Nothing
, _sscsivVolumeProgress = Nothing
, _sscsivVolumeDiskId = Nothing
, _sscsivSourceSnapshotId = Nothing
, _sscsivPreservedExistingData = Nothing
, _sscsivVolumeiSCSIAttributes = Nothing
}
sscsivPreservedExistingData :: Lens' StorediSCSIVolume (Maybe Bool)
sscsivPreservedExistingData =
lens _sscsivPreservedExistingData
(\s a -> s { _sscsivPreservedExistingData = a })
sscsivSourceSnapshotId :: Lens' StorediSCSIVolume (Maybe Text)
sscsivSourceSnapshotId =
lens _sscsivSourceSnapshotId (\s a -> s { _sscsivSourceSnapshotId = a })
sscsivVolumeARN :: Lens' StorediSCSIVolume (Maybe Text)
sscsivVolumeARN = lens _sscsivVolumeARN (\s a -> s { _sscsivVolumeARN = a })
sscsivVolumeDiskId :: Lens' StorediSCSIVolume (Maybe Text)
sscsivVolumeDiskId =
lens _sscsivVolumeDiskId (\s a -> s { _sscsivVolumeDiskId = a })
sscsivVolumeId :: Lens' StorediSCSIVolume (Maybe Text)
sscsivVolumeId = lens _sscsivVolumeId (\s a -> s { _sscsivVolumeId = a })
sscsivVolumeProgress :: Lens' StorediSCSIVolume (Maybe Double)
sscsivVolumeProgress =
lens _sscsivVolumeProgress (\s a -> s { _sscsivVolumeProgress = a })
sscsivVolumeSizeInBytes :: Lens' StorediSCSIVolume (Maybe Integer)
sscsivVolumeSizeInBytes =
lens _sscsivVolumeSizeInBytes (\s a -> s { _sscsivVolumeSizeInBytes = a })
sscsivVolumeStatus :: Lens' StorediSCSIVolume (Maybe Text)
sscsivVolumeStatus =
lens _sscsivVolumeStatus (\s a -> s { _sscsivVolumeStatus = a })
sscsivVolumeType :: Lens' StorediSCSIVolume (Maybe Text)
sscsivVolumeType = lens _sscsivVolumeType (\s a -> s { _sscsivVolumeType = a })
sscsivVolumeiSCSIAttributes :: Lens' StorediSCSIVolume (Maybe VolumeiSCSIAttributes)
sscsivVolumeiSCSIAttributes =
lens _sscsivVolumeiSCSIAttributes
(\s a -> s { _sscsivVolumeiSCSIAttributes = a })
instance FromJSON StorediSCSIVolume where
parseJSON = withObject "StorediSCSIVolume" $ \o -> StorediSCSIVolume
<$> o .:? "PreservedExistingData"
<*> o .:? "SourceSnapshotId"
<*> o .:? "VolumeARN"
<*> o .:? "VolumeDiskId"
<*> o .:? "VolumeId"
<*> o .:? "VolumeProgress"
<*> o .:? "VolumeSizeInBytes"
<*> o .:? "VolumeStatus"
<*> o .:? "VolumeType"
<*> o .:? "VolumeiSCSIAttributes"
instance ToJSON StorediSCSIVolume where
toJSON StorediSCSIVolume{..} = object
[ "VolumeARN" .= _sscsivVolumeARN
, "VolumeId" .= _sscsivVolumeId
, "VolumeType" .= _sscsivVolumeType
, "VolumeStatus" .= _sscsivVolumeStatus
, "VolumeSizeInBytes" .= _sscsivVolumeSizeInBytes
, "VolumeProgress" .= _sscsivVolumeProgress
, "VolumeDiskId" .= _sscsivVolumeDiskId
, "SourceSnapshotId" .= _sscsivSourceSnapshotId
, "PreservedExistingData" .= _sscsivPreservedExistingData
, "VolumeiSCSIAttributes" .= _sscsivVolumeiSCSIAttributes
]
data CachediSCSIVolume = CachediSCSIVolume
{ _cscsivSourceSnapshotId :: Maybe Text
, _cscsivVolumeARN :: Maybe Text
, _cscsivVolumeId :: Maybe Text
, _cscsivVolumeProgress :: Maybe Double
, _cscsivVolumeSizeInBytes :: Maybe Integer
, _cscsivVolumeStatus :: Maybe Text
, _cscsivVolumeType :: Maybe Text
, _cscsivVolumeiSCSIAttributes :: Maybe VolumeiSCSIAttributes
} deriving (Eq, Read, Show)
cachediSCSIVolume :: CachediSCSIVolume
cachediSCSIVolume = CachediSCSIVolume
{ _cscsivVolumeARN = Nothing
, _cscsivVolumeId = Nothing
, _cscsivVolumeType = Nothing
, _cscsivVolumeStatus = Nothing
, _cscsivVolumeSizeInBytes = Nothing
, _cscsivVolumeProgress = Nothing
, _cscsivSourceSnapshotId = Nothing
, _cscsivVolumeiSCSIAttributes = Nothing
}
cscsivSourceSnapshotId :: Lens' CachediSCSIVolume (Maybe Text)
cscsivSourceSnapshotId =
lens _cscsivSourceSnapshotId (\s a -> s { _cscsivSourceSnapshotId = a })
cscsivVolumeARN :: Lens' CachediSCSIVolume (Maybe Text)
cscsivVolumeARN = lens _cscsivVolumeARN (\s a -> s { _cscsivVolumeARN = a })
cscsivVolumeId :: Lens' CachediSCSIVolume (Maybe Text)
cscsivVolumeId = lens _cscsivVolumeId (\s a -> s { _cscsivVolumeId = a })
cscsivVolumeProgress :: Lens' CachediSCSIVolume (Maybe Double)
cscsivVolumeProgress =
lens _cscsivVolumeProgress (\s a -> s { _cscsivVolumeProgress = a })
cscsivVolumeSizeInBytes :: Lens' CachediSCSIVolume (Maybe Integer)
cscsivVolumeSizeInBytes =
lens _cscsivVolumeSizeInBytes (\s a -> s { _cscsivVolumeSizeInBytes = a })
cscsivVolumeStatus :: Lens' CachediSCSIVolume (Maybe Text)
cscsivVolumeStatus =
lens _cscsivVolumeStatus (\s a -> s { _cscsivVolumeStatus = a })
cscsivVolumeType :: Lens' CachediSCSIVolume (Maybe Text)
cscsivVolumeType = lens _cscsivVolumeType (\s a -> s { _cscsivVolumeType = a })
cscsivVolumeiSCSIAttributes :: Lens' CachediSCSIVolume (Maybe VolumeiSCSIAttributes)
cscsivVolumeiSCSIAttributes =
lens _cscsivVolumeiSCSIAttributes
(\s a -> s { _cscsivVolumeiSCSIAttributes = a })
instance FromJSON CachediSCSIVolume where
parseJSON = withObject "CachediSCSIVolume" $ \o -> CachediSCSIVolume
<$> o .:? "SourceSnapshotId"
<*> o .:? "VolumeARN"
<*> o .:? "VolumeId"
<*> o .:? "VolumeProgress"
<*> o .:? "VolumeSizeInBytes"
<*> o .:? "VolumeStatus"
<*> o .:? "VolumeType"
<*> o .:? "VolumeiSCSIAttributes"
instance ToJSON CachediSCSIVolume where
toJSON CachediSCSIVolume{..} = object
[ "VolumeARN" .= _cscsivVolumeARN
, "VolumeId" .= _cscsivVolumeId
, "VolumeType" .= _cscsivVolumeType
, "VolumeStatus" .= _cscsivVolumeStatus
, "VolumeSizeInBytes" .= _cscsivVolumeSizeInBytes
, "VolumeProgress" .= _cscsivVolumeProgress
, "SourceSnapshotId" .= _cscsivSourceSnapshotId
, "VolumeiSCSIAttributes" .= _cscsivVolumeiSCSIAttributes
]
data VolumeInfo = VolumeInfo
{ _viVolumeARN :: Maybe Text
, _viVolumeType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
volumeInfo :: VolumeInfo
volumeInfo = VolumeInfo
{ _viVolumeARN = Nothing
, _viVolumeType = Nothing
}
viVolumeARN :: Lens' VolumeInfo (Maybe Text)
viVolumeARN = lens _viVolumeARN (\s a -> s { _viVolumeARN = a })
viVolumeType :: Lens' VolumeInfo (Maybe Text)
viVolumeType = lens _viVolumeType (\s a -> s { _viVolumeType = a })
instance FromJSON VolumeInfo where
parseJSON = withObject "VolumeInfo" $ \o -> VolumeInfo
<$> o .:? "VolumeARN"
<*> o .:? "VolumeType"
instance ToJSON VolumeInfo where
toJSON VolumeInfo{..} = object
[ "VolumeARN" .= _viVolumeARN
, "VolumeType" .= _viVolumeType
]
data GatewayInfo = GatewayInfo
{ _giGatewayARN :: Maybe Text
, _giGatewayOperationalState :: Maybe Text
, _giGatewayType :: Maybe Text
} deriving (Eq, Ord, Read, Show)
gatewayInfo :: GatewayInfo
gatewayInfo = GatewayInfo
{ _giGatewayARN = Nothing
, _giGatewayType = Nothing
, _giGatewayOperationalState = Nothing
}
giGatewayARN :: Lens' GatewayInfo (Maybe Text)
giGatewayARN = lens _giGatewayARN (\s a -> s { _giGatewayARN = a })
giGatewayOperationalState :: Lens' GatewayInfo (Maybe Text)
giGatewayOperationalState =
lens _giGatewayOperationalState
(\s a -> s { _giGatewayOperationalState = a })
giGatewayType :: Lens' GatewayInfo (Maybe Text)
giGatewayType = lens _giGatewayType (\s a -> s { _giGatewayType = a })
instance FromJSON GatewayInfo where
parseJSON = withObject "GatewayInfo" $ \o -> GatewayInfo
<$> o .:? "GatewayARN"
<*> o .:? "GatewayOperationalState"
<*> o .:? "GatewayType"
instance ToJSON GatewayInfo where
toJSON GatewayInfo{..} = object
[ "GatewayARN" .= _giGatewayARN
, "GatewayType" .= _giGatewayType
, "GatewayOperationalState" .= _giGatewayOperationalState
]