{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE OverloadedStrings  #-}
{-# LANGUAGE RecordWildCards    #-}

{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Network.AWS.EC2.Types.Product
-- Copyright   : (c) 2013-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
module Network.AWS.EC2.Types.Product where

import           Network.AWS.EC2.Internal
import           Network.AWS.EC2.Types.Sum
import           Network.AWS.Lens
import           Network.AWS.Prelude

-- | Describes an account attribute.
--
-- /See:/ 'accountAttribute' smart constructor.
data AccountAttribute = AccountAttribute'
    { _aaAttributeValues :: !(Maybe [AccountAttributeValue])
    , _aaAttributeName   :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountAttribute' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aaAttributeValues'
--
-- * 'aaAttributeName'
accountAttribute
    :: AccountAttribute
accountAttribute =
    AccountAttribute'
    { _aaAttributeValues = Nothing
    , _aaAttributeName = Nothing
    }

-- | One or more values for the account attribute.
aaAttributeValues :: Lens' AccountAttribute [AccountAttributeValue]
aaAttributeValues = lens _aaAttributeValues (\ s a -> s{_aaAttributeValues = a}) . _Default . _Coerce;

-- | The name of the account attribute.
aaAttributeName :: Lens' AccountAttribute (Maybe Text)
aaAttributeName = lens _aaAttributeName (\ s a -> s{_aaAttributeName = a});

instance FromXML AccountAttribute where
        parseXML x
          = AccountAttribute' <$>
              (x .@? "attributeValueSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "attributeName")

instance Hashable AccountAttribute

instance NFData AccountAttribute

-- | Describes a value of an account attribute.
--
-- /See:/ 'accountAttributeValue' smart constructor.
newtype AccountAttributeValue = AccountAttributeValue'
    { _aavAttributeValue :: Maybe Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AccountAttributeValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aavAttributeValue'
accountAttributeValue
    :: AccountAttributeValue
accountAttributeValue =
    AccountAttributeValue'
    { _aavAttributeValue = Nothing
    }

-- | The value of the attribute.
aavAttributeValue :: Lens' AccountAttributeValue (Maybe Text)
aavAttributeValue = lens _aavAttributeValue (\ s a -> s{_aavAttributeValue = a});

instance FromXML AccountAttributeValue where
        parseXML x
          = AccountAttributeValue' <$> (x .@? "attributeValue")

instance Hashable AccountAttributeValue

instance NFData AccountAttributeValue

-- | Describes a running instance in a Spot fleet.
--
-- /See:/ 'activeInstance' smart constructor.
data ActiveInstance = ActiveInstance'
    { _aiInstanceId            :: !(Maybe Text)
    , _aiInstanceType          :: !(Maybe Text)
    , _aiSpotInstanceRequestId :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ActiveInstance' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aiInstanceId'
--
-- * 'aiInstanceType'
--
-- * 'aiSpotInstanceRequestId'
activeInstance
    :: ActiveInstance
activeInstance =
    ActiveInstance'
    { _aiInstanceId = Nothing
    , _aiInstanceType = Nothing
    , _aiSpotInstanceRequestId = Nothing
    }

-- | The ID of the instance.
aiInstanceId :: Lens' ActiveInstance (Maybe Text)
aiInstanceId = lens _aiInstanceId (\ s a -> s{_aiInstanceId = a});

-- | The instance type.
aiInstanceType :: Lens' ActiveInstance (Maybe Text)
aiInstanceType = lens _aiInstanceType (\ s a -> s{_aiInstanceType = a});

-- | The ID of the Spot instance request.
aiSpotInstanceRequestId :: Lens' ActiveInstance (Maybe Text)
aiSpotInstanceRequestId = lens _aiSpotInstanceRequestId (\ s a -> s{_aiSpotInstanceRequestId = a});

instance FromXML ActiveInstance where
        parseXML x
          = ActiveInstance' <$>
              (x .@? "instanceId") <*> (x .@? "instanceType") <*>
                (x .@? "spotInstanceRequestId")

instance Hashable ActiveInstance

instance NFData ActiveInstance

-- | Describes an Elastic IP address.
--
-- /See:/ 'address' smart constructor.
data Address = Address'
    { _aAssociationId           :: !(Maybe Text)
    , _aInstanceId              :: !(Maybe Text)
    , _aNetworkInterfaceOwnerId :: !(Maybe Text)
    , _aAllocationId            :: !(Maybe Text)
    , _aDomain                  :: !(Maybe DomainType)
    , _aNetworkInterfaceId      :: !(Maybe Text)
    , _aPrivateIPAddress        :: !(Maybe Text)
    , _aPublicIP                :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'Address' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aAssociationId'
--
-- * 'aInstanceId'
--
-- * 'aNetworkInterfaceOwnerId'
--
-- * 'aAllocationId'
--
-- * 'aDomain'
--
-- * 'aNetworkInterfaceId'
--
-- * 'aPrivateIPAddress'
--
-- * 'aPublicIP'
address
    :: Address
address =
    Address'
    { _aAssociationId = Nothing
    , _aInstanceId = Nothing
    , _aNetworkInterfaceOwnerId = Nothing
    , _aAllocationId = Nothing
    , _aDomain = Nothing
    , _aNetworkInterfaceId = Nothing
    , _aPrivateIPAddress = Nothing
    , _aPublicIP = Nothing
    }

-- | The ID representing the association of the address with an instance in a VPC.
aAssociationId :: Lens' Address (Maybe Text)
aAssociationId = lens _aAssociationId (\ s a -> s{_aAssociationId = a});

-- | The ID of the instance that the address is associated with (if any).
aInstanceId :: Lens' Address (Maybe Text)
aInstanceId = lens _aInstanceId (\ s a -> s{_aInstanceId = a});

-- | The ID of the AWS account that owns the network interface.
aNetworkInterfaceOwnerId :: Lens' Address (Maybe Text)
aNetworkInterfaceOwnerId = lens _aNetworkInterfaceOwnerId (\ s a -> s{_aNetworkInterfaceOwnerId = a});

-- | The ID representing the allocation of the address for use with EC2-VPC.
aAllocationId :: Lens' Address (Maybe Text)
aAllocationId = lens _aAllocationId (\ s a -> s{_aAllocationId = a});

-- | Indicates whether this Elastic IP address is for use with instances in EC2-Classic ('standard') or instances in a VPC ('vpc').
aDomain :: Lens' Address (Maybe DomainType)
aDomain = lens _aDomain (\ s a -> s{_aDomain = a});

-- | The ID of the network interface.
aNetworkInterfaceId :: Lens' Address (Maybe Text)
aNetworkInterfaceId = lens _aNetworkInterfaceId (\ s a -> s{_aNetworkInterfaceId = a});

-- | The private IP address associated with the Elastic IP address.
aPrivateIPAddress :: Lens' Address (Maybe Text)
aPrivateIPAddress = lens _aPrivateIPAddress (\ s a -> s{_aPrivateIPAddress = a});

-- | The Elastic IP address.
aPublicIP :: Lens' Address (Maybe Text)
aPublicIP = lens _aPublicIP (\ s a -> s{_aPublicIP = a});

instance FromXML Address where
        parseXML x
          = Address' <$>
              (x .@? "associationId") <*> (x .@? "instanceId") <*>
                (x .@? "networkInterfaceOwnerId")
                <*> (x .@? "allocationId")
                <*> (x .@? "domain")
                <*> (x .@? "networkInterfaceId")
                <*> (x .@? "privateIpAddress")
                <*> (x .@? "publicIp")

instance Hashable Address

instance NFData Address

-- | Describes a value for a resource attribute that is a Boolean value.
--
-- /See:/ 'attributeBooleanValue' smart constructor.
newtype AttributeBooleanValue = AttributeBooleanValue'
    { _abvValue :: Maybe Bool
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AttributeBooleanValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'abvValue'
attributeBooleanValue
    :: AttributeBooleanValue
attributeBooleanValue =
    AttributeBooleanValue'
    { _abvValue = Nothing
    }

-- | The attribute value. The valid values are 'true' or 'false'.
abvValue :: Lens' AttributeBooleanValue (Maybe Bool)
abvValue = lens _abvValue (\ s a -> s{_abvValue = a});

instance FromXML AttributeBooleanValue where
        parseXML x
          = AttributeBooleanValue' <$> (x .@? "value")

instance Hashable AttributeBooleanValue

instance NFData AttributeBooleanValue

instance ToQuery AttributeBooleanValue where
        toQuery AttributeBooleanValue'{..}
          = mconcat ["Value" =: _abvValue]

-- | Describes a value for a resource attribute that is a String.
--
-- /See:/ 'attributeValue' smart constructor.
newtype AttributeValue = AttributeValue'
    { _avValue :: Maybe Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AttributeValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'avValue'
attributeValue
    :: AttributeValue
attributeValue =
    AttributeValue'
    { _avValue = Nothing
    }

-- | The attribute value. Note that the value is case-sensitive.
avValue :: Lens' AttributeValue (Maybe Text)
avValue = lens _avValue (\ s a -> s{_avValue = a});

instance FromXML AttributeValue where
        parseXML x = AttributeValue' <$> (x .@? "value")

instance Hashable AttributeValue

instance NFData AttributeValue

instance ToQuery AttributeValue where
        toQuery AttributeValue'{..}
          = mconcat ["Value" =: _avValue]

-- | Describes an Availability Zone.
--
-- /See:/ 'availabilityZone' smart constructor.
data AvailabilityZone = AvailabilityZone'
    { _azState      :: !(Maybe AvailabilityZoneState)
    , _azRegionName :: !(Maybe Text)
    , _azZoneName   :: !(Maybe Text)
    , _azMessages   :: !(Maybe [AvailabilityZoneMessage])
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AvailabilityZone' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'azState'
--
-- * 'azRegionName'
--
-- * 'azZoneName'
--
-- * 'azMessages'
availabilityZone
    :: AvailabilityZone
availabilityZone =
    AvailabilityZone'
    { _azState = Nothing
    , _azRegionName = Nothing
    , _azZoneName = Nothing
    , _azMessages = Nothing
    }

-- | The state of the Availability Zone.
azState :: Lens' AvailabilityZone (Maybe AvailabilityZoneState)
azState = lens _azState (\ s a -> s{_azState = a});

-- | The name of the region.
azRegionName :: Lens' AvailabilityZone (Maybe Text)
azRegionName = lens _azRegionName (\ s a -> s{_azRegionName = a});

-- | The name of the Availability Zone.
azZoneName :: Lens' AvailabilityZone (Maybe Text)
azZoneName = lens _azZoneName (\ s a -> s{_azZoneName = a});

-- | Any messages about the Availability Zone.
azMessages :: Lens' AvailabilityZone [AvailabilityZoneMessage]
azMessages = lens _azMessages (\ s a -> s{_azMessages = a}) . _Default . _Coerce;

instance FromXML AvailabilityZone where
        parseXML x
          = AvailabilityZone' <$>
              (x .@? "zoneState") <*> (x .@? "regionName") <*>
                (x .@? "zoneName")
                <*>
                (x .@? "messageSet" .!@ mempty >>=
                   may (parseXMLList "item"))

instance Hashable AvailabilityZone

instance NFData AvailabilityZone

-- | Describes a message about an Availability Zone.
--
-- /See:/ 'availabilityZoneMessage' smart constructor.
newtype AvailabilityZoneMessage = AvailabilityZoneMessage'
    { _azmMessage :: Maybe Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AvailabilityZoneMessage' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'azmMessage'
availabilityZoneMessage
    :: AvailabilityZoneMessage
availabilityZoneMessage =
    AvailabilityZoneMessage'
    { _azmMessage = Nothing
    }

-- | The message about the Availability Zone.
azmMessage :: Lens' AvailabilityZoneMessage (Maybe Text)
azmMessage = lens _azmMessage (\ s a -> s{_azmMessage = a});

instance FromXML AvailabilityZoneMessage where
        parseXML x
          = AvailabilityZoneMessage' <$> (x .@? "message")

instance Hashable AvailabilityZoneMessage

instance NFData AvailabilityZoneMessage

-- | The capacity information for instances launched onto the Dedicated Host.
--
-- /See:/ 'availableCapacity' smart constructor.
data AvailableCapacity = AvailableCapacity'
    { _acAvailableInstanceCapacity :: !(Maybe [InstanceCapacity])
    , _acAvailableVCPUs            :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'AvailableCapacity' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acAvailableInstanceCapacity'
--
-- * 'acAvailableVCPUs'
availableCapacity
    :: AvailableCapacity
availableCapacity =
    AvailableCapacity'
    { _acAvailableInstanceCapacity = Nothing
    , _acAvailableVCPUs = Nothing
    }

-- | The total number of instances that the Dedicated Host supports.
acAvailableInstanceCapacity :: Lens' AvailableCapacity [InstanceCapacity]
acAvailableInstanceCapacity = lens _acAvailableInstanceCapacity (\ s a -> s{_acAvailableInstanceCapacity = a}) . _Default . _Coerce;

-- | The number of vCPUs available on the Dedicated Host.
acAvailableVCPUs :: Lens' AvailableCapacity (Maybe Int)
acAvailableVCPUs = lens _acAvailableVCPUs (\ s a -> s{_acAvailableVCPUs = a});

instance FromXML AvailableCapacity where
        parseXML x
          = AvailableCapacity' <$>
              (x .@? "availableInstanceCapacity" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "availableVCpus")

instance Hashable AvailableCapacity

instance NFData AvailableCapacity

-- | /See:/ 'blobAttributeValue' smart constructor.
newtype BlobAttributeValue = BlobAttributeValue'
    { _bavValue :: Maybe Base64
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'BlobAttributeValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'bavValue'
blobAttributeValue
    :: BlobAttributeValue
blobAttributeValue =
    BlobAttributeValue'
    { _bavValue = Nothing
    }

-- | Undocumented member.
--
-- /Note:/ This 'Lens' automatically encodes and decodes Base64 data,
-- despite what the AWS documentation might say.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This 'Lens' accepts and returns only raw unencoded data.
bavValue :: Lens' BlobAttributeValue (Maybe ByteString)
bavValue = lens _bavValue (\ s a -> s{_bavValue = a}) . mapping _Base64;

instance Hashable BlobAttributeValue

instance NFData BlobAttributeValue

instance ToQuery BlobAttributeValue where
        toQuery BlobAttributeValue'{..}
          = mconcat ["Value" =: _bavValue]

-- | Describes a block device mapping.
--
-- /See:/ 'blockDeviceMapping' smart constructor.
data BlockDeviceMapping = BlockDeviceMapping'
    { _bdmVirtualName :: !(Maybe Text)
    , _bdmNoDevice    :: !(Maybe Text)
    , _bdmEBS         :: !(Maybe EBSBlockDevice)
    , _bdmDeviceName  :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'BlockDeviceMapping' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'bdmVirtualName'
--
-- * 'bdmNoDevice'
--
-- * 'bdmEBS'
--
-- * 'bdmDeviceName'
blockDeviceMapping
    :: Text -- ^ 'bdmDeviceName'
    -> BlockDeviceMapping
blockDeviceMapping pDeviceName_ =
    BlockDeviceMapping'
    { _bdmVirtualName = Nothing
    , _bdmNoDevice = Nothing
    , _bdmEBS = Nothing
    , _bdmDeviceName = pDeviceName_
    }

-- | The virtual device name ('ephemeral'N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for 'ephemeral0' and 'ephemeral1'.The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
--
-- Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.
bdmVirtualName :: Lens' BlockDeviceMapping (Maybe Text)
bdmVirtualName = lens _bdmVirtualName (\ s a -> s{_bdmVirtualName = a});

-- | Suppresses the specified device included in the block device mapping of the AMI.
bdmNoDevice :: Lens' BlockDeviceMapping (Maybe Text)
bdmNoDevice = lens _bdmNoDevice (\ s a -> s{_bdmNoDevice = a});

-- | Parameters used to automatically set up EBS volumes when the instance is launched.
bdmEBS :: Lens' BlockDeviceMapping (Maybe EBSBlockDevice)
bdmEBS = lens _bdmEBS (\ s a -> s{_bdmEBS = a});

-- | The device name exposed to the instance (for example, '\/dev\/sdh' or 'xvdh').
bdmDeviceName :: Lens' BlockDeviceMapping Text
bdmDeviceName = lens _bdmDeviceName (\ s a -> s{_bdmDeviceName = a});

instance FromXML BlockDeviceMapping where
        parseXML x
          = BlockDeviceMapping' <$>
              (x .@? "virtualName") <*> (x .@? "noDevice") <*>
                (x .@? "ebs")
                <*> (x .@ "deviceName")

instance Hashable BlockDeviceMapping

instance NFData BlockDeviceMapping

instance ToQuery BlockDeviceMapping where
        toQuery BlockDeviceMapping'{..}
          = mconcat
              ["VirtualName" =: _bdmVirtualName,
               "NoDevice" =: _bdmNoDevice, "Ebs" =: _bdmEBS,
               "DeviceName" =: _bdmDeviceName]

-- | Describes a bundle task.
--
-- /See:/ 'bundleTask' smart constructor.
data BundleTask = BundleTask'
    { _btBundleTaskError :: !(Maybe BundleTaskError)
    , _btBundleId        :: !Text
    , _btInstanceId      :: !Text
    , _btProgress        :: !Text
    , _btStartTime       :: !ISO8601
    , _btState           :: !BundleTaskState
    , _btStorage         :: !Storage
    , _btUpdateTime      :: !ISO8601
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'BundleTask' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'btBundleTaskError'
--
-- * 'btBundleId'
--
-- * 'btInstanceId'
--
-- * 'btProgress'
--
-- * 'btStartTime'
--
-- * 'btState'
--
-- * 'btStorage'
--
-- * 'btUpdateTime'
bundleTask
    :: Text -- ^ 'btBundleId'
    -> Text -- ^ 'btInstanceId'
    -> Text -- ^ 'btProgress'
    -> UTCTime -- ^ 'btStartTime'
    -> BundleTaskState -- ^ 'btState'
    -> Storage -- ^ 'btStorage'
    -> UTCTime -- ^ 'btUpdateTime'
    -> BundleTask
bundleTask pBundleId_ pInstanceId_ pProgress_ pStartTime_ pState_ pStorage_ pUpdateTime_ =
    BundleTask'
    { _btBundleTaskError = Nothing
    , _btBundleId = pBundleId_
    , _btInstanceId = pInstanceId_
    , _btProgress = pProgress_
    , _btStartTime = _Time # pStartTime_
    , _btState = pState_
    , _btStorage = pStorage_
    , _btUpdateTime = _Time # pUpdateTime_
    }

-- | If the task fails, a description of the error.
btBundleTaskError :: Lens' BundleTask (Maybe BundleTaskError)
btBundleTaskError = lens _btBundleTaskError (\ s a -> s{_btBundleTaskError = a});

-- | The ID of the bundle task.
btBundleId :: Lens' BundleTask Text
btBundleId = lens _btBundleId (\ s a -> s{_btBundleId = a});

-- | The ID of the instance associated with this bundle task.
btInstanceId :: Lens' BundleTask Text
btInstanceId = lens _btInstanceId (\ s a -> s{_btInstanceId = a});

-- | The level of task completion, as a percent (for example, 20%).
btProgress :: Lens' BundleTask Text
btProgress = lens _btProgress (\ s a -> s{_btProgress = a});

-- | The time this task started.
btStartTime :: Lens' BundleTask UTCTime
btStartTime = lens _btStartTime (\ s a -> s{_btStartTime = a}) . _Time;

-- | The state of the task.
btState :: Lens' BundleTask BundleTaskState
btState = lens _btState (\ s a -> s{_btState = a});

-- | The Amazon S3 storage locations.
btStorage :: Lens' BundleTask Storage
btStorage = lens _btStorage (\ s a -> s{_btStorage = a});

-- | The time of the most recent update for the task.
btUpdateTime :: Lens' BundleTask UTCTime
btUpdateTime = lens _btUpdateTime (\ s a -> s{_btUpdateTime = a}) . _Time;

instance FromXML BundleTask where
        parseXML x
          = BundleTask' <$>
              (x .@? "error") <*> (x .@ "bundleId") <*>
                (x .@ "instanceId")
                <*> (x .@ "progress")
                <*> (x .@ "startTime")
                <*> (x .@ "state")
                <*> (x .@ "storage")
                <*> (x .@ "updateTime")

instance Hashable BundleTask

instance NFData BundleTask

-- | Describes an error for < BundleInstance>.
--
-- /See:/ 'bundleTaskError' smart constructor.
data BundleTaskError = BundleTaskError'
    { _bteCode    :: !(Maybe Text)
    , _bteMessage :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'BundleTaskError' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'bteCode'
--
-- * 'bteMessage'
bundleTaskError
    :: BundleTaskError
bundleTaskError =
    BundleTaskError'
    { _bteCode = Nothing
    , _bteMessage = Nothing
    }

-- | The error code.
bteCode :: Lens' BundleTaskError (Maybe Text)
bteCode = lens _bteCode (\ s a -> s{_bteCode = a});

-- | The error message.
bteMessage :: Lens' BundleTaskError (Maybe Text)
bteMessage = lens _bteMessage (\ s a -> s{_bteMessage = a});

instance FromXML BundleTaskError where
        parseXML x
          = BundleTaskError' <$>
              (x .@? "code") <*> (x .@? "message")

instance Hashable BundleTaskError

instance NFData BundleTaskError

-- | Describes a Spot fleet error.
--
-- /See:/ 'cancelSpotFleetRequestsError' smart constructor.
data CancelSpotFleetRequestsError = CancelSpotFleetRequestsError'
    { _csfreCode    :: !CancelBatchErrorCode
    , _csfreMessage :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CancelSpotFleetRequestsError' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'csfreCode'
--
-- * 'csfreMessage'
cancelSpotFleetRequestsError
    :: CancelBatchErrorCode -- ^ 'csfreCode'
    -> Text -- ^ 'csfreMessage'
    -> CancelSpotFleetRequestsError
cancelSpotFleetRequestsError pCode_ pMessage_ =
    CancelSpotFleetRequestsError'
    { _csfreCode = pCode_
    , _csfreMessage = pMessage_
    }

-- | The error code.
csfreCode :: Lens' CancelSpotFleetRequestsError CancelBatchErrorCode
csfreCode = lens _csfreCode (\ s a -> s{_csfreCode = a});

-- | The description for the error code.
csfreMessage :: Lens' CancelSpotFleetRequestsError Text
csfreMessage = lens _csfreMessage (\ s a -> s{_csfreMessage = a});

instance FromXML CancelSpotFleetRequestsError where
        parseXML x
          = CancelSpotFleetRequestsError' <$>
              (x .@ "code") <*> (x .@ "message")

instance Hashable CancelSpotFleetRequestsError

instance NFData CancelSpotFleetRequestsError

-- | Describes a Spot fleet request that was not successfully canceled.
--
-- /See:/ 'cancelSpotFleetRequestsErrorItem' smart constructor.
data CancelSpotFleetRequestsErrorItem = CancelSpotFleetRequestsErrorItem'
    { _csfreiSpotFleetRequestId :: !Text
    , _csfreiError              :: !CancelSpotFleetRequestsError
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CancelSpotFleetRequestsErrorItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'csfreiSpotFleetRequestId'
--
-- * 'csfreiError'
cancelSpotFleetRequestsErrorItem
    :: Text -- ^ 'csfreiSpotFleetRequestId'
    -> CancelSpotFleetRequestsError -- ^ 'csfreiError'
    -> CancelSpotFleetRequestsErrorItem
cancelSpotFleetRequestsErrorItem pSpotFleetRequestId_ pError_ =
    CancelSpotFleetRequestsErrorItem'
    { _csfreiSpotFleetRequestId = pSpotFleetRequestId_
    , _csfreiError = pError_
    }

-- | The ID of the Spot fleet request.
csfreiSpotFleetRequestId :: Lens' CancelSpotFleetRequestsErrorItem Text
csfreiSpotFleetRequestId = lens _csfreiSpotFleetRequestId (\ s a -> s{_csfreiSpotFleetRequestId = a});

-- | The error.
csfreiError :: Lens' CancelSpotFleetRequestsErrorItem CancelSpotFleetRequestsError
csfreiError = lens _csfreiError (\ s a -> s{_csfreiError = a});

instance FromXML CancelSpotFleetRequestsErrorItem
         where
        parseXML x
          = CancelSpotFleetRequestsErrorItem' <$>
              (x .@ "spotFleetRequestId") <*> (x .@ "error")

instance Hashable CancelSpotFleetRequestsErrorItem

instance NFData CancelSpotFleetRequestsErrorItem

-- | Describes a Spot fleet request that was successfully canceled.
--
-- /See:/ 'cancelSpotFleetRequestsSuccessItem' smart constructor.
data CancelSpotFleetRequestsSuccessItem = CancelSpotFleetRequestsSuccessItem'
    { _csfrsiSpotFleetRequestId            :: !Text
    , _csfrsiCurrentSpotFleetRequestState  :: !BatchState
    , _csfrsiPreviousSpotFleetRequestState :: !BatchState
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CancelSpotFleetRequestsSuccessItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'csfrsiSpotFleetRequestId'
--
-- * 'csfrsiCurrentSpotFleetRequestState'
--
-- * 'csfrsiPreviousSpotFleetRequestState'
cancelSpotFleetRequestsSuccessItem
    :: Text -- ^ 'csfrsiSpotFleetRequestId'
    -> BatchState -- ^ 'csfrsiCurrentSpotFleetRequestState'
    -> BatchState -- ^ 'csfrsiPreviousSpotFleetRequestState'
    -> CancelSpotFleetRequestsSuccessItem
cancelSpotFleetRequestsSuccessItem pSpotFleetRequestId_ pCurrentSpotFleetRequestState_ pPreviousSpotFleetRequestState_ =
    CancelSpotFleetRequestsSuccessItem'
    { _csfrsiSpotFleetRequestId = pSpotFleetRequestId_
    , _csfrsiCurrentSpotFleetRequestState = pCurrentSpotFleetRequestState_
    , _csfrsiPreviousSpotFleetRequestState = pPreviousSpotFleetRequestState_
    }

-- | The ID of the Spot fleet request.
csfrsiSpotFleetRequestId :: Lens' CancelSpotFleetRequestsSuccessItem Text
csfrsiSpotFleetRequestId = lens _csfrsiSpotFleetRequestId (\ s a -> s{_csfrsiSpotFleetRequestId = a});

-- | The current state of the Spot fleet request.
csfrsiCurrentSpotFleetRequestState :: Lens' CancelSpotFleetRequestsSuccessItem BatchState
csfrsiCurrentSpotFleetRequestState = lens _csfrsiCurrentSpotFleetRequestState (\ s a -> s{_csfrsiCurrentSpotFleetRequestState = a});

-- | The previous state of the Spot fleet request.
csfrsiPreviousSpotFleetRequestState :: Lens' CancelSpotFleetRequestsSuccessItem BatchState
csfrsiPreviousSpotFleetRequestState = lens _csfrsiPreviousSpotFleetRequestState (\ s a -> s{_csfrsiPreviousSpotFleetRequestState = a});

instance FromXML CancelSpotFleetRequestsSuccessItem
         where
        parseXML x
          = CancelSpotFleetRequestsSuccessItem' <$>
              (x .@ "spotFleetRequestId") <*>
                (x .@ "currentSpotFleetRequestState")
                <*> (x .@ "previousSpotFleetRequestState")

instance Hashable CancelSpotFleetRequestsSuccessItem

instance NFData CancelSpotFleetRequestsSuccessItem

-- | Describes a request to cancel a Spot instance.
--
-- /See:/ 'cancelledSpotInstanceRequest' smart constructor.
data CancelledSpotInstanceRequest = CancelledSpotInstanceRequest'
    { _csirState                 :: !(Maybe CancelSpotInstanceRequestState)
    , _csirSpotInstanceRequestId :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CancelledSpotInstanceRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'csirState'
--
-- * 'csirSpotInstanceRequestId'
cancelledSpotInstanceRequest
    :: CancelledSpotInstanceRequest
cancelledSpotInstanceRequest =
    CancelledSpotInstanceRequest'
    { _csirState = Nothing
    , _csirSpotInstanceRequestId = Nothing
    }

-- | The state of the Spot instance request.
csirState :: Lens' CancelledSpotInstanceRequest (Maybe CancelSpotInstanceRequestState)
csirState = lens _csirState (\ s a -> s{_csirState = a});

-- | The ID of the Spot instance request.
csirSpotInstanceRequestId :: Lens' CancelledSpotInstanceRequest (Maybe Text)
csirSpotInstanceRequestId = lens _csirSpotInstanceRequestId (\ s a -> s{_csirSpotInstanceRequestId = a});

instance FromXML CancelledSpotInstanceRequest where
        parseXML x
          = CancelledSpotInstanceRequest' <$>
              (x .@? "state") <*> (x .@? "spotInstanceRequestId")

instance Hashable CancelledSpotInstanceRequest

instance NFData CancelledSpotInstanceRequest

-- | Describes the ClassicLink DNS support status of a VPC.
--
-- /See:/ 'classicLinkDNSSupport' smart constructor.
data ClassicLinkDNSSupport = ClassicLinkDNSSupport'
    { _cldsVPCId                   :: !(Maybe Text)
    , _cldsClassicLinkDNSSupported :: !(Maybe Bool)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ClassicLinkDNSSupport' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cldsVPCId'
--
-- * 'cldsClassicLinkDNSSupported'
classicLinkDNSSupport
    :: ClassicLinkDNSSupport
classicLinkDNSSupport =
    ClassicLinkDNSSupport'
    { _cldsVPCId = Nothing
    , _cldsClassicLinkDNSSupported = Nothing
    }

-- | The ID of the VPC.
cldsVPCId :: Lens' ClassicLinkDNSSupport (Maybe Text)
cldsVPCId = lens _cldsVPCId (\ s a -> s{_cldsVPCId = a});

-- | Indicates whether ClassicLink DNS support is enabled for the VPC.
cldsClassicLinkDNSSupported :: Lens' ClassicLinkDNSSupport (Maybe Bool)
cldsClassicLinkDNSSupported = lens _cldsClassicLinkDNSSupported (\ s a -> s{_cldsClassicLinkDNSSupported = a});

instance FromXML ClassicLinkDNSSupport where
        parseXML x
          = ClassicLinkDNSSupport' <$>
              (x .@? "vpcId") <*> (x .@? "classicLinkDnsSupported")

instance Hashable ClassicLinkDNSSupport

instance NFData ClassicLinkDNSSupport

-- | Describes a linked EC2-Classic instance.
--
-- /See:/ 'classicLinkInstance' smart constructor.
data ClassicLinkInstance = ClassicLinkInstance'
    { _cliInstanceId :: !(Maybe Text)
    , _cliGroups     :: !(Maybe [GroupIdentifier])
    , _cliVPCId      :: !(Maybe Text)
    , _cliTags       :: !(Maybe [Tag])
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ClassicLinkInstance' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cliInstanceId'
--
-- * 'cliGroups'
--
-- * 'cliVPCId'
--
-- * 'cliTags'
classicLinkInstance
    :: ClassicLinkInstance
classicLinkInstance =
    ClassicLinkInstance'
    { _cliInstanceId = Nothing
    , _cliGroups = Nothing
    , _cliVPCId = Nothing
    , _cliTags = Nothing
    }

-- | The ID of the instance.
cliInstanceId :: Lens' ClassicLinkInstance (Maybe Text)
cliInstanceId = lens _cliInstanceId (\ s a -> s{_cliInstanceId = a});

-- | A list of security groups.
cliGroups :: Lens' ClassicLinkInstance [GroupIdentifier]
cliGroups = lens _cliGroups (\ s a -> s{_cliGroups = a}) . _Default . _Coerce;

-- | The ID of the VPC.
cliVPCId :: Lens' ClassicLinkInstance (Maybe Text)
cliVPCId = lens _cliVPCId (\ s a -> s{_cliVPCId = a});

-- | Any tags assigned to the instance.
cliTags :: Lens' ClassicLinkInstance [Tag]
cliTags = lens _cliTags (\ s a -> s{_cliTags = a}) . _Default . _Coerce;

instance FromXML ClassicLinkInstance where
        parseXML x
          = ClassicLinkInstance' <$>
              (x .@? "instanceId") <*>
                (x .@? "groupSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "vpcId")
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))

instance Hashable ClassicLinkInstance

instance NFData ClassicLinkInstance

-- | Describes the client-specific data.
--
-- /See:/ 'clientData' smart constructor.
data ClientData = ClientData'
    { _cdUploadStart :: !(Maybe ISO8601)
    , _cdUploadSize  :: !(Maybe Double)
    , _cdUploadEnd   :: !(Maybe ISO8601)
    , _cdComment     :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ClientData' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cdUploadStart'
--
-- * 'cdUploadSize'
--
-- * 'cdUploadEnd'
--
-- * 'cdComment'
clientData
    :: ClientData
clientData =
    ClientData'
    { _cdUploadStart = Nothing
    , _cdUploadSize = Nothing
    , _cdUploadEnd = Nothing
    , _cdComment = Nothing
    }

-- | The time that the disk upload starts.
cdUploadStart :: Lens' ClientData (Maybe UTCTime)
cdUploadStart = lens _cdUploadStart (\ s a -> s{_cdUploadStart = a}) . mapping _Time;

-- | The size of the uploaded disk image, in GiB.
cdUploadSize :: Lens' ClientData (Maybe Double)
cdUploadSize = lens _cdUploadSize (\ s a -> s{_cdUploadSize = a});

-- | The time that the disk upload ends.
cdUploadEnd :: Lens' ClientData (Maybe UTCTime)
cdUploadEnd = lens _cdUploadEnd (\ s a -> s{_cdUploadEnd = a}) . mapping _Time;

-- | A user-defined comment about the disk upload.
cdComment :: Lens' ClientData (Maybe Text)
cdComment = lens _cdComment (\ s a -> s{_cdComment = a});

instance Hashable ClientData

instance NFData ClientData

instance ToQuery ClientData where
        toQuery ClientData'{..}
          = mconcat
              ["UploadStart" =: _cdUploadStart,
               "UploadSize" =: _cdUploadSize,
               "UploadEnd" =: _cdUploadEnd, "Comment" =: _cdComment]

-- | Describes a conversion task.
--
-- /See:/ 'conversionTask' smart constructor.
data ConversionTask = ConversionTask'
    { _ctImportInstance   :: !(Maybe ImportInstanceTaskDetails)
    , _ctStatusMessage    :: !(Maybe Text)
    , _ctImportVolume     :: !(Maybe ImportVolumeTaskDetails)
    , _ctExpirationTime   :: !(Maybe Text)
    , _ctTags             :: !(Maybe [Tag])
    , _ctConversionTaskId :: !Text
    , _ctState            :: !ConversionTaskState
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ConversionTask' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ctImportInstance'
--
-- * 'ctStatusMessage'
--
-- * 'ctImportVolume'
--
-- * 'ctExpirationTime'
--
-- * 'ctTags'
--
-- * 'ctConversionTaskId'
--
-- * 'ctState'
conversionTask
    :: Text -- ^ 'ctConversionTaskId'
    -> ConversionTaskState -- ^ 'ctState'
    -> ConversionTask
conversionTask pConversionTaskId_ pState_ =
    ConversionTask'
    { _ctImportInstance = Nothing
    , _ctStatusMessage = Nothing
    , _ctImportVolume = Nothing
    , _ctExpirationTime = Nothing
    , _ctTags = Nothing
    , _ctConversionTaskId = pConversionTaskId_
    , _ctState = pState_
    }

-- | If the task is for importing an instance, this contains information about the import instance task.
ctImportInstance :: Lens' ConversionTask (Maybe ImportInstanceTaskDetails)
ctImportInstance = lens _ctImportInstance (\ s a -> s{_ctImportInstance = a});

-- | The status message related to the conversion task.
ctStatusMessage :: Lens' ConversionTask (Maybe Text)
ctStatusMessage = lens _ctStatusMessage (\ s a -> s{_ctStatusMessage = a});

-- | If the task is for importing a volume, this contains information about the import volume task.
ctImportVolume :: Lens' ConversionTask (Maybe ImportVolumeTaskDetails)
ctImportVolume = lens _ctImportVolume (\ s a -> s{_ctImportVolume = a});

-- | The time when the task expires. If the upload isn\'t complete before the expiration time, we automatically cancel the task.
ctExpirationTime :: Lens' ConversionTask (Maybe Text)
ctExpirationTime = lens _ctExpirationTime (\ s a -> s{_ctExpirationTime = a});

-- | Any tags assigned to the task.
ctTags :: Lens' ConversionTask [Tag]
ctTags = lens _ctTags (\ s a -> s{_ctTags = a}) . _Default . _Coerce;

-- | The ID of the conversion task.
ctConversionTaskId :: Lens' ConversionTask Text
ctConversionTaskId = lens _ctConversionTaskId (\ s a -> s{_ctConversionTaskId = a});

-- | The state of the conversion task.
ctState :: Lens' ConversionTask ConversionTaskState
ctState = lens _ctState (\ s a -> s{_ctState = a});

instance FromXML ConversionTask where
        parseXML x
          = ConversionTask' <$>
              (x .@? "importInstance") <*> (x .@? "statusMessage")
                <*> (x .@? "importVolume")
                <*> (x .@? "expirationTime")
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@ "conversionTaskId")
                <*> (x .@ "state")

instance Hashable ConversionTask

instance NFData ConversionTask

-- | Describes the user or group to be added or removed from the permissions for a volume.
--
-- /See:/ 'createVolumePermission' smart constructor.
data CreateVolumePermission = CreateVolumePermission'
    { _cvpGroup  :: !(Maybe PermissionGroup)
    , _cvpUserId :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CreateVolumePermission' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cvpGroup'
--
-- * 'cvpUserId'
createVolumePermission
    :: CreateVolumePermission
createVolumePermission =
    CreateVolumePermission'
    { _cvpGroup = Nothing
    , _cvpUserId = Nothing
    }

-- | The specific group that is to be added or removed from a volume\'s list of create volume permissions.
cvpGroup :: Lens' CreateVolumePermission (Maybe PermissionGroup)
cvpGroup = lens _cvpGroup (\ s a -> s{_cvpGroup = a});

-- | The specific AWS account ID that is to be added or removed from a volume\'s list of create volume permissions.
cvpUserId :: Lens' CreateVolumePermission (Maybe Text)
cvpUserId = lens _cvpUserId (\ s a -> s{_cvpUserId = a});

instance FromXML CreateVolumePermission where
        parseXML x
          = CreateVolumePermission' <$>
              (x .@? "group") <*> (x .@? "userId")

instance Hashable CreateVolumePermission

instance NFData CreateVolumePermission

instance ToQuery CreateVolumePermission where
        toQuery CreateVolumePermission'{..}
          = mconcat
              ["Group" =: _cvpGroup, "UserId" =: _cvpUserId]

-- | Describes modifications to the permissions for a volume.
--
-- /See:/ 'createVolumePermissionModifications' smart constructor.
data CreateVolumePermissionModifications = CreateVolumePermissionModifications'
    { _cvpmRemove :: !(Maybe [CreateVolumePermission])
    , _cvpmAdd    :: !(Maybe [CreateVolumePermission])
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CreateVolumePermissionModifications' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cvpmRemove'
--
-- * 'cvpmAdd'
createVolumePermissionModifications
    :: CreateVolumePermissionModifications
createVolumePermissionModifications =
    CreateVolumePermissionModifications'
    { _cvpmRemove = Nothing
    , _cvpmAdd = Nothing
    }

-- | Removes a specific AWS account ID or group from a volume\'s list of create volume permissions.
cvpmRemove :: Lens' CreateVolumePermissionModifications [CreateVolumePermission]
cvpmRemove = lens _cvpmRemove (\ s a -> s{_cvpmRemove = a}) . _Default . _Coerce;

-- | Adds a specific AWS account ID or group to a volume\'s list of create volume permissions.
cvpmAdd :: Lens' CreateVolumePermissionModifications [CreateVolumePermission]
cvpmAdd = lens _cvpmAdd (\ s a -> s{_cvpmAdd = a}) . _Default . _Coerce;

instance Hashable CreateVolumePermissionModifications

instance NFData CreateVolumePermissionModifications

instance ToQuery CreateVolumePermissionModifications
         where
        toQuery CreateVolumePermissionModifications'{..}
          = mconcat
              [toQuery (toQueryList "Remove" <$> _cvpmRemove),
               toQuery (toQueryList "Add" <$> _cvpmAdd)]

-- | Describes a customer gateway.
--
-- /See:/ 'customerGateway' smart constructor.
data CustomerGateway = CustomerGateway'
    { _cgTags              :: !(Maybe [Tag])
    , _cgBGPASN            :: !Text
    , _cgCustomerGatewayId :: !Text
    , _cgIPAddress         :: !Text
    , _cgState             :: !Text
    , _cgType              :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'CustomerGateway' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cgTags'
--
-- * 'cgBGPASN'
--
-- * 'cgCustomerGatewayId'
--
-- * 'cgIPAddress'
--
-- * 'cgState'
--
-- * 'cgType'
customerGateway
    :: Text -- ^ 'cgBGPASN'
    -> Text -- ^ 'cgCustomerGatewayId'
    -> Text -- ^ 'cgIPAddress'
    -> Text -- ^ 'cgState'
    -> Text -- ^ 'cgType'
    -> CustomerGateway
customerGateway pBGPASN_ pCustomerGatewayId_ pIPAddress_ pState_ pType_ =
    CustomerGateway'
    { _cgTags = Nothing
    , _cgBGPASN = pBGPASN_
    , _cgCustomerGatewayId = pCustomerGatewayId_
    , _cgIPAddress = pIPAddress_
    , _cgState = pState_
    , _cgType = pType_
    }

-- | Any tags assigned to the customer gateway.
cgTags :: Lens' CustomerGateway [Tag]
cgTags = lens _cgTags (\ s a -> s{_cgTags = a}) . _Default . _Coerce;

-- | The customer gateway\'s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
cgBGPASN :: Lens' CustomerGateway Text
cgBGPASN = lens _cgBGPASN (\ s a -> s{_cgBGPASN = a});

-- | The ID of the customer gateway.
cgCustomerGatewayId :: Lens' CustomerGateway Text
cgCustomerGatewayId = lens _cgCustomerGatewayId (\ s a -> s{_cgCustomerGatewayId = a});

-- | The Internet-routable IP address of the customer gateway\'s outside interface.
cgIPAddress :: Lens' CustomerGateway Text
cgIPAddress = lens _cgIPAddress (\ s a -> s{_cgIPAddress = a});

-- | The current state of the customer gateway ('pending | available | deleting | deleted').
cgState :: Lens' CustomerGateway Text
cgState = lens _cgState (\ s a -> s{_cgState = a});

-- | The type of VPN connection the customer gateway supports ('ipsec.1').
cgType :: Lens' CustomerGateway Text
cgType = lens _cgType (\ s a -> s{_cgType = a});

instance FromXML CustomerGateway where
        parseXML x
          = CustomerGateway' <$>
              (x .@? "tagSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@ "bgpAsn")
                <*> (x .@ "customerGatewayId")
                <*> (x .@ "ipAddress")
                <*> (x .@ "state")
                <*> (x .@ "type")

instance Hashable CustomerGateway

instance NFData CustomerGateway

-- | Describes a DHCP configuration option.
--
-- /See:/ 'dhcpConfiguration' smart constructor.
data DHCPConfiguration = DHCPConfiguration'
    { _dcValues :: !(Maybe [AttributeValue])
    , _dcKey    :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DHCPConfiguration' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dcValues'
--
-- * 'dcKey'
dhcpConfiguration
    :: DHCPConfiguration
dhcpConfiguration =
    DHCPConfiguration'
    { _dcValues = Nothing
    , _dcKey = Nothing
    }

-- | One or more values for the DHCP option.
dcValues :: Lens' DHCPConfiguration [AttributeValue]
dcValues = lens _dcValues (\ s a -> s{_dcValues = a}) . _Default . _Coerce;

-- | The name of a DHCP option.
dcKey :: Lens' DHCPConfiguration (Maybe Text)
dcKey = lens _dcKey (\ s a -> s{_dcKey = a});

instance FromXML DHCPConfiguration where
        parseXML x
          = DHCPConfiguration' <$>
              (x .@? "valueSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "key")

instance Hashable DHCPConfiguration

instance NFData DHCPConfiguration

-- | Describes a set of DHCP options.
--
-- /See:/ 'dhcpOptions' smart constructor.
data DHCPOptions = DHCPOptions'
    { _doDHCPConfigurations :: !(Maybe [DHCPConfiguration])
    , _doDHCPOptionsId      :: !(Maybe Text)
    , _doTags               :: !(Maybe [Tag])
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DHCPOptions' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'doDHCPConfigurations'
--
-- * 'doDHCPOptionsId'
--
-- * 'doTags'
dhcpOptions
    :: DHCPOptions
dhcpOptions =
    DHCPOptions'
    { _doDHCPConfigurations = Nothing
    , _doDHCPOptionsId = Nothing
    , _doTags = Nothing
    }

-- | One or more DHCP options in the set.
doDHCPConfigurations :: Lens' DHCPOptions [DHCPConfiguration]
doDHCPConfigurations = lens _doDHCPConfigurations (\ s a -> s{_doDHCPConfigurations = a}) . _Default . _Coerce;

-- | The ID of the set of DHCP options.
doDHCPOptionsId :: Lens' DHCPOptions (Maybe Text)
doDHCPOptionsId = lens _doDHCPOptionsId (\ s a -> s{_doDHCPOptionsId = a});

-- | Any tags assigned to the DHCP options set.
doTags :: Lens' DHCPOptions [Tag]
doTags = lens _doTags (\ s a -> s{_doTags = a}) . _Default . _Coerce;

instance FromXML DHCPOptions where
        parseXML x
          = DHCPOptions' <$>
              (x .@? "dhcpConfigurationSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "dhcpOptionsId")
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))

instance Hashable DHCPOptions

instance NFData DHCPOptions

-- | Describes a disk image.
--
-- /See:/ 'diskImage' smart constructor.
data DiskImage = DiskImage'
    { _diImage       :: !(Maybe DiskImageDetail)
    , _diVolume      :: !(Maybe VolumeDetail)
    , _diDescription :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DiskImage' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'diImage'
--
-- * 'diVolume'
--
-- * 'diDescription'
diskImage
    :: DiskImage
diskImage =
    DiskImage'
    { _diImage = Nothing
    , _diVolume = Nothing
    , _diDescription = Nothing
    }

-- | Information about the disk image.
diImage :: Lens' DiskImage (Maybe DiskImageDetail)
diImage = lens _diImage (\ s a -> s{_diImage = a});

-- | Information about the volume.
diVolume :: Lens' DiskImage (Maybe VolumeDetail)
diVolume = lens _diVolume (\ s a -> s{_diVolume = a});

-- | A description of the disk image.
diDescription :: Lens' DiskImage (Maybe Text)
diDescription = lens _diDescription (\ s a -> s{_diDescription = a});

instance Hashable DiskImage

instance NFData DiskImage

instance ToQuery DiskImage where
        toQuery DiskImage'{..}
          = mconcat
              ["Image" =: _diImage, "Volume" =: _diVolume,
               "Description" =: _diDescription]

-- | Describes a disk image.
--
-- /See:/ 'diskImageDescription' smart constructor.
data DiskImageDescription = DiskImageDescription'
    { _dChecksum          :: !(Maybe Text)
    , _dFormat            :: !DiskImageFormat
    , _dSize              :: !Integer
    , _dImportManifestURL :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DiskImageDescription' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dChecksum'
--
-- * 'dFormat'
--
-- * 'dSize'
--
-- * 'dImportManifestURL'
diskImageDescription
    :: DiskImageFormat -- ^ 'dFormat'
    -> Integer -- ^ 'dSize'
    -> Text -- ^ 'dImportManifestURL'
    -> DiskImageDescription
diskImageDescription pFormat_ pSize_ pImportManifestURL_ =
    DiskImageDescription'
    { _dChecksum = Nothing
    , _dFormat = pFormat_
    , _dSize = pSize_
    , _dImportManifestURL = pImportManifestURL_
    }

-- | The checksum computed for the disk image.
dChecksum :: Lens' DiskImageDescription (Maybe Text)
dChecksum = lens _dChecksum (\ s a -> s{_dChecksum = a});

-- | The disk image format.
dFormat :: Lens' DiskImageDescription DiskImageFormat
dFormat = lens _dFormat (\ s a -> s{_dFormat = a});

-- | The size of the disk image, in GiB.
dSize :: Lens' DiskImageDescription Integer
dSize = lens _dSize (\ s a -> s{_dSize = a});

-- | A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the \"Query String Request Authentication Alternative\" section of the <http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html Authenticating REST Requests> topic in the /Amazon Simple Storage Service Developer Guide/.
--
-- For information about the import manifest referenced by this API action, see <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html VM Import Manifest>.
dImportManifestURL :: Lens' DiskImageDescription Text
dImportManifestURL = lens _dImportManifestURL (\ s a -> s{_dImportManifestURL = a});

instance FromXML DiskImageDescription where
        parseXML x
          = DiskImageDescription' <$>
              (x .@? "checksum") <*> (x .@ "format") <*>
                (x .@ "size")
                <*> (x .@ "importManifestUrl")

instance Hashable DiskImageDescription

instance NFData DiskImageDescription

-- | Describes a disk image.
--
-- /See:/ 'diskImageDetail' smart constructor.
data DiskImageDetail = DiskImageDetail'
    { _didFormat            :: !DiskImageFormat
    , _didBytes             :: !Integer
    , _didImportManifestURL :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DiskImageDetail' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'didFormat'
--
-- * 'didBytes'
--
-- * 'didImportManifestURL'
diskImageDetail
    :: DiskImageFormat -- ^ 'didFormat'
    -> Integer -- ^ 'didBytes'
    -> Text -- ^ 'didImportManifestURL'
    -> DiskImageDetail
diskImageDetail pFormat_ pBytes_ pImportManifestURL_ =
    DiskImageDetail'
    { _didFormat = pFormat_
    , _didBytes = pBytes_
    , _didImportManifestURL = pImportManifestURL_
    }

-- | The disk image format.
didFormat :: Lens' DiskImageDetail DiskImageFormat
didFormat = lens _didFormat (\ s a -> s{_didFormat = a});

-- | The size of the disk image, in GiB.
didBytes :: Lens' DiskImageDetail Integer
didBytes = lens _didBytes (\ s a -> s{_didBytes = a});

-- | A presigned URL for the import manifest stored in Amazon S3 and presented here as an Amazon S3 presigned URL. For information about creating a presigned URL for an Amazon S3 object, read the \"Query String Request Authentication Alternative\" section of the <http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html Authenticating REST Requests> topic in the /Amazon Simple Storage Service Developer Guide/.
--
-- For information about the import manifest referenced by this API action, see <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html VM Import Manifest>.
didImportManifestURL :: Lens' DiskImageDetail Text
didImportManifestURL = lens _didImportManifestURL (\ s a -> s{_didImportManifestURL = a});

instance Hashable DiskImageDetail

instance NFData DiskImageDetail

instance ToQuery DiskImageDetail where
        toQuery DiskImageDetail'{..}
          = mconcat
              ["Format" =: _didFormat, "Bytes" =: _didBytes,
               "ImportManifestUrl" =: _didImportManifestURL]

-- | Describes a disk image volume.
--
-- /See:/ 'diskImageVolumeDescription' smart constructor.
data DiskImageVolumeDescription = DiskImageVolumeDescription'
    { _divdSize :: !(Maybe Integer)
    , _divdId   :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DiskImageVolumeDescription' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'divdSize'
--
-- * 'divdId'
diskImageVolumeDescription
    :: Text -- ^ 'divdId'
    -> DiskImageVolumeDescription
diskImageVolumeDescription pId_ =
    DiskImageVolumeDescription'
    { _divdSize = Nothing
    , _divdId = pId_
    }

-- | The size of the volume, in GiB.
divdSize :: Lens' DiskImageVolumeDescription (Maybe Integer)
divdSize = lens _divdSize (\ s a -> s{_divdSize = a});

-- | The volume identifier.
divdId :: Lens' DiskImageVolumeDescription Text
divdId = lens _divdId (\ s a -> s{_divdId = a});

instance FromXML DiskImageVolumeDescription where
        parseXML x
          = DiskImageVolumeDescription' <$>
              (x .@? "size") <*> (x .@ "id")

instance Hashable DiskImageVolumeDescription

instance NFData DiskImageVolumeDescription

-- | Describes a block device for an EBS volume.
--
-- /See:/ 'ebsBlockDevice' smart constructor.
data EBSBlockDevice = EBSBlockDevice'
    { _ebdDeleteOnTermination :: !(Maybe Bool)
    , _ebdVolumeSize          :: !(Maybe Int)
    , _ebdIOPS                :: !(Maybe Int)
    , _ebdEncrypted           :: !(Maybe Bool)
    , _ebdVolumeType          :: !(Maybe VolumeType)
    , _ebdSnapshotId          :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'EBSBlockDevice' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ebdDeleteOnTermination'
--
-- * 'ebdVolumeSize'
--
-- * 'ebdIOPS'
--
-- * 'ebdEncrypted'
--
-- * 'ebdVolumeType'
--
-- * 'ebdSnapshotId'
ebsBlockDevice
    :: EBSBlockDevice
ebsBlockDevice =
    EBSBlockDevice'
    { _ebdDeleteOnTermination = Nothing
    , _ebdVolumeSize = Nothing
    , _ebdIOPS = Nothing
    , _ebdEncrypted = Nothing
    , _ebdVolumeType = Nothing
    , _ebdSnapshotId = Nothing
    }

-- | Indicates whether the EBS volume is deleted on instance termination.
ebdDeleteOnTermination :: Lens' EBSBlockDevice (Maybe Bool)
ebdDeleteOnTermination = lens _ebdDeleteOnTermination (\ s a -> s{_ebdDeleteOnTermination = a});

-- | The size of the volume, in GiB.
--
-- Constraints: 1-16384 for General Purpose SSD ('gp2'), 4-16384 for Provisioned IOPS SSD ('io1'), 500-16384 for Throughput Optimized HDD ('st1'), 500-16384 for Cold HDD ('sc1'), and 1-1024 for Magnetic ('standard') volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.
--
-- Default: If you\'re creating the volume from a snapshot and don\'t specify a volume size, the default is the snapshot size.
ebdVolumeSize :: Lens' EBSBlockDevice (Maybe Int)
ebdVolumeSize = lens _ebdVolumeSize (\ s a -> s{_ebdVolumeSize = a});

-- | The number of I\/O operations per second (IOPS) that the volume supports. For 'io1', this represents the number of IOPS that are provisioned for the volume. For 'gp2', this represents the baseline performance of the volume and the rate at which the volume accumulates I\/O credits for bursting. For more information about General Purpose SSD baseline performance, I\/O credits, and bursting, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS Volume Types> in the /Amazon Elastic Compute Cloud User Guide/.
--
-- Constraint: Range is 100-20000 IOPS for 'io1' volumes and 100-10000 IOPS for 'gp2' volumes.
--
-- Condition: This parameter is required for requests to create 'io1' volumes; it is not used in requests to create 'gp2', 'st1', 'sc1', or 'standard' volumes.
ebdIOPS :: Lens' EBSBlockDevice (Maybe Int)
ebdIOPS = lens _ebdIOPS (\ s a -> s{_ebdIOPS = a});

-- | Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption.
ebdEncrypted :: Lens' EBSBlockDevice (Maybe Bool)
ebdEncrypted = lens _ebdEncrypted (\ s a -> s{_ebdEncrypted = a});

-- | The volume type: 'gp2', 'io1', 'st1', 'sc1', or 'standard'.
--
-- Default: 'standard'
ebdVolumeType :: Lens' EBSBlockDevice (Maybe VolumeType)
ebdVolumeType = lens _ebdVolumeType (\ s a -> s{_ebdVolumeType = a});

-- | The ID of the snapshot.
ebdSnapshotId :: Lens' EBSBlockDevice (Maybe Text)
ebdSnapshotId = lens _ebdSnapshotId (\ s a -> s{_ebdSnapshotId = a});

instance FromXML EBSBlockDevice where
        parseXML x
          = EBSBlockDevice' <$>
              (x .@? "deleteOnTermination") <*>
                (x .@? "volumeSize")
                <*> (x .@? "iops")
                <*> (x .@? "encrypted")
                <*> (x .@? "volumeType")
                <*> (x .@? "snapshotId")

instance Hashable EBSBlockDevice

instance NFData EBSBlockDevice

instance ToQuery EBSBlockDevice where
        toQuery EBSBlockDevice'{..}
          = mconcat
              ["DeleteOnTermination" =: _ebdDeleteOnTermination,
               "VolumeSize" =: _ebdVolumeSize, "Iops" =: _ebdIOPS,
               "Encrypted" =: _ebdEncrypted,
               "VolumeType" =: _ebdVolumeType,
               "SnapshotId" =: _ebdSnapshotId]

-- | Describes a parameter used to set up an EBS volume in a block device mapping.
--
-- /See:/ 'ebsInstanceBlockDevice' smart constructor.
data EBSInstanceBlockDevice = EBSInstanceBlockDevice'
    { _eibdStatus              :: !(Maybe AttachmentStatus)
    , _eibdDeleteOnTermination :: !(Maybe Bool)
    , _eibdVolumeId            :: !(Maybe Text)
    , _eibdAttachTime          :: !(Maybe ISO8601)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'EBSInstanceBlockDevice' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eibdStatus'
--
-- * 'eibdDeleteOnTermination'
--
-- * 'eibdVolumeId'
--
-- * 'eibdAttachTime'
ebsInstanceBlockDevice
    :: EBSInstanceBlockDevice
ebsInstanceBlockDevice =
    EBSInstanceBlockDevice'
    { _eibdStatus = Nothing
    , _eibdDeleteOnTermination = Nothing
    , _eibdVolumeId = Nothing
    , _eibdAttachTime = Nothing
    }

-- | The attachment state.
eibdStatus :: Lens' EBSInstanceBlockDevice (Maybe AttachmentStatus)
eibdStatus = lens _eibdStatus (\ s a -> s{_eibdStatus = a});

-- | Indicates whether the volume is deleted on instance termination.
eibdDeleteOnTermination :: Lens' EBSInstanceBlockDevice (Maybe Bool)
eibdDeleteOnTermination = lens _eibdDeleteOnTermination (\ s a -> s{_eibdDeleteOnTermination = a});

-- | The ID of the EBS volume.
eibdVolumeId :: Lens' EBSInstanceBlockDevice (Maybe Text)
eibdVolumeId = lens _eibdVolumeId (\ s a -> s{_eibdVolumeId = a});

-- | The time stamp when the attachment initiated.
eibdAttachTime :: Lens' EBSInstanceBlockDevice (Maybe UTCTime)
eibdAttachTime = lens _eibdAttachTime (\ s a -> s{_eibdAttachTime = a}) . mapping _Time;

instance FromXML EBSInstanceBlockDevice where
        parseXML x
          = EBSInstanceBlockDevice' <$>
              (x .@? "status") <*> (x .@? "deleteOnTermination")
                <*> (x .@? "volumeId")
                <*> (x .@? "attachTime")

instance Hashable EBSInstanceBlockDevice

instance NFData EBSInstanceBlockDevice

-- | Describes information used to set up an EBS volume specified in a block device mapping.
--
-- /See:/ 'ebsInstanceBlockDeviceSpecification' smart constructor.
data EBSInstanceBlockDeviceSpecification = EBSInstanceBlockDeviceSpecification'
    { _eibdsDeleteOnTermination :: !(Maybe Bool)
    , _eibdsVolumeId            :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'EBSInstanceBlockDeviceSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eibdsDeleteOnTermination'
--
-- * 'eibdsVolumeId'
ebsInstanceBlockDeviceSpecification
    :: EBSInstanceBlockDeviceSpecification
ebsInstanceBlockDeviceSpecification =
    EBSInstanceBlockDeviceSpecification'
    { _eibdsDeleteOnTermination = Nothing
    , _eibdsVolumeId = Nothing
    }

-- | Indicates whether the volume is deleted on instance termination.
eibdsDeleteOnTermination :: Lens' EBSInstanceBlockDeviceSpecification (Maybe Bool)
eibdsDeleteOnTermination = lens _eibdsDeleteOnTermination (\ s a -> s{_eibdsDeleteOnTermination = a});

-- | The ID of the EBS volume.
eibdsVolumeId :: Lens' EBSInstanceBlockDeviceSpecification (Maybe Text)
eibdsVolumeId = lens _eibdsVolumeId (\ s a -> s{_eibdsVolumeId = a});

instance Hashable EBSInstanceBlockDeviceSpecification

instance NFData EBSInstanceBlockDeviceSpecification

instance ToQuery EBSInstanceBlockDeviceSpecification
         where
        toQuery EBSInstanceBlockDeviceSpecification'{..}
          = mconcat
              ["DeleteOnTermination" =: _eibdsDeleteOnTermination,
               "VolumeId" =: _eibdsVolumeId]

-- | Describes a Spot fleet event.
--
-- /See:/ 'eventInformation' smart constructor.
data EventInformation = EventInformation'
    { _eiInstanceId       :: !(Maybe Text)
    , _eiEventDescription :: !(Maybe Text)
    , _eiEventSubType     :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'EventInformation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eiInstanceId'
--
-- * 'eiEventDescription'
--
-- * 'eiEventSubType'
eventInformation
    :: EventInformation
eventInformation =
    EventInformation'
    { _eiInstanceId = Nothing
    , _eiEventDescription = Nothing
    , _eiEventSubType = Nothing
    }

-- | The ID of the instance. This information is available only for 'instanceChange' events.
eiInstanceId :: Lens' EventInformation (Maybe Text)
eiInstanceId = lens _eiInstanceId (\ s a -> s{_eiInstanceId = a});

-- | The description of the event.
eiEventDescription :: Lens' EventInformation (Maybe Text)
eiEventDescription = lens _eiEventDescription (\ s a -> s{_eiEventDescription = a});

-- | The event.
--
-- The following are the 'error' events.
--
-- -   'iamFleetRoleInvalid' - The Spot fleet did not have the required permissions either to launch or terminate an instance.
--
-- -   'launchSpecTemporarilyBlacklisted' - The configuration is not valid and several attempts to launch instances have failed. For more information, see the description of the event.
--
-- -   'spotFleetRequestConfigurationInvalid' - The configuration is not valid. For more information, see the description of the event.
--
-- -   'spotInstanceCountLimitExceeded' - You\'ve reached the limit on the number of Spot instances that you can launch.
--
-- The following are the 'fleetRequestChange' events.
--
-- -   'active' - The Spot fleet has been validated and Amazon EC2 is attempting to maintain the target number of running Spot instances.
--
-- -   'cancelled' - The Spot fleet is canceled and has no running Spot instances. The Spot fleet will be deleted two days after its instances were terminated.
--
-- -   'cancelled_running' - The Spot fleet is canceled and will not launch additional Spot instances, but its existing Spot instances continue to run until they are interrupted or terminated.
--
-- -   'cancelled_terminating' - The Spot fleet is canceled and its Spot instances are terminating.
--
-- -   'expired' - The Spot fleet request has expired. A subsequent event indicates that the instances were terminated, if the request was created with 'TerminateInstancesWithExpiration' set.
--
-- -   'modify_in_progress' - A request to modify the Spot fleet request was accepted and is in progress.
--
-- -   'modify_successful' - The Spot fleet request was modified.
--
-- -   'price_update' - The bid price for a launch configuration was adjusted because it was too high. This change is permanent.
--
-- -   'submitted' - The Spot fleet request is being evaluated and Amazon EC2 is preparing to launch the target number of Spot instances.
--
-- The following are the 'instanceChange' events.
--
-- -   'launched' - A bid was fulfilled and a new instance was launched.
--
-- -   'terminated' - An instance was terminated by the user.
--
eiEventSubType :: Lens' EventInformation (Maybe Text)
eiEventSubType = lens _eiEventSubType (\ s a -> s{_eiEventSubType = a});

instance FromXML EventInformation where
        parseXML x
          = EventInformation' <$>
              (x .@? "instanceId") <*> (x .@? "eventDescription")
                <*> (x .@? "eventSubType")

instance Hashable EventInformation

instance NFData EventInformation

-- | Describes an instance export task.
--
-- /See:/ 'exportTask' smart constructor.
data ExportTask = ExportTask'
    { _etDescription           :: !Text
    , _etExportTaskId          :: !Text
    , _etExportToS3Task        :: !ExportToS3Task
    , _etInstanceExportDetails :: !InstanceExportDetails
    , _etState                 :: !ExportTaskState
    , _etStatusMessage         :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ExportTask' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'etDescription'
--
-- * 'etExportTaskId'
--
-- * 'etExportToS3Task'
--
-- * 'etInstanceExportDetails'
--
-- * 'etState'
--
-- * 'etStatusMessage'
exportTask
    :: Text -- ^ 'etDescription'
    -> Text -- ^ 'etExportTaskId'
    -> ExportToS3Task -- ^ 'etExportToS3Task'
    -> InstanceExportDetails -- ^ 'etInstanceExportDetails'
    -> ExportTaskState -- ^ 'etState'
    -> Text -- ^ 'etStatusMessage'
    -> ExportTask
exportTask pDescription_ pExportTaskId_ pExportToS3Task_ pInstanceExportDetails_ pState_ pStatusMessage_ =
    ExportTask'
    { _etDescription = pDescription_
    , _etExportTaskId = pExportTaskId_
    , _etExportToS3Task = pExportToS3Task_
    , _etInstanceExportDetails = pInstanceExportDetails_
    , _etState = pState_
    , _etStatusMessage = pStatusMessage_
    }

-- | A description of the resource being exported.
etDescription :: Lens' ExportTask Text
etDescription = lens _etDescription (\ s a -> s{_etDescription = a});

-- | The ID of the export task.
etExportTaskId :: Lens' ExportTask Text
etExportTaskId = lens _etExportTaskId (\ s a -> s{_etExportTaskId = a});

-- | Information about the export task.
etExportToS3Task :: Lens' ExportTask ExportToS3Task
etExportToS3Task = lens _etExportToS3Task (\ s a -> s{_etExportToS3Task = a});

-- | Information about the instance to export.
etInstanceExportDetails :: Lens' ExportTask InstanceExportDetails
etInstanceExportDetails = lens _etInstanceExportDetails (\ s a -> s{_etInstanceExportDetails = a});

-- | The state of the export task.
etState :: Lens' ExportTask ExportTaskState
etState = lens _etState (\ s a -> s{_etState = a});

-- | The status message related to the export task.
etStatusMessage :: Lens' ExportTask Text
etStatusMessage = lens _etStatusMessage (\ s a -> s{_etStatusMessage = a});

instance FromXML ExportTask where
        parseXML x
          = ExportTask' <$>
              (x .@ "description") <*> (x .@ "exportTaskId") <*>
                (x .@ "exportToS3")
                <*> (x .@ "instanceExport")
                <*> (x .@ "state")
                <*> (x .@ "statusMessage")

instance Hashable ExportTask

instance NFData ExportTask

-- | Describes the format and location for an instance export task.
--
-- /See:/ 'exportToS3Task' smart constructor.
data ExportToS3Task = ExportToS3Task'
    { _etstS3Key           :: !(Maybe Text)
    , _etstContainerFormat :: !(Maybe ContainerFormat)
    , _etstS3Bucket        :: !(Maybe Text)
    , _etstDiskImageFormat :: !(Maybe DiskImageFormat)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ExportToS3Task' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'etstS3Key'
--
-- * 'etstContainerFormat'
--
-- * 'etstS3Bucket'
--
-- * 'etstDiskImageFormat'
exportToS3Task
    :: ExportToS3Task
exportToS3Task =
    ExportToS3Task'
    { _etstS3Key = Nothing
    , _etstContainerFormat = Nothing
    , _etstS3Bucket = Nothing
    , _etstDiskImageFormat = Nothing
    }

-- | The encryption key for your S3 bucket.
etstS3Key :: Lens' ExportToS3Task (Maybe Text)
etstS3Key = lens _etstS3Key (\ s a -> s{_etstS3Key = a});

-- | The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
etstContainerFormat :: Lens' ExportToS3Task (Maybe ContainerFormat)
etstContainerFormat = lens _etstContainerFormat (\ s a -> s{_etstContainerFormat = a});

-- | The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account 'vm-import-export\'amazon.com'.
etstS3Bucket :: Lens' ExportToS3Task (Maybe Text)
etstS3Bucket = lens _etstS3Bucket (\ s a -> s{_etstS3Bucket = a});

-- | The format for the exported image.
etstDiskImageFormat :: Lens' ExportToS3Task (Maybe DiskImageFormat)
etstDiskImageFormat = lens _etstDiskImageFormat (\ s a -> s{_etstDiskImageFormat = a});

instance FromXML ExportToS3Task where
        parseXML x
          = ExportToS3Task' <$>
              (x .@? "s3Key") <*> (x .@? "containerFormat") <*>
                (x .@? "s3Bucket")
                <*> (x .@? "diskImageFormat")

instance Hashable ExportToS3Task

instance NFData ExportToS3Task

-- | Describes an instance export task.
--
-- /See:/ 'exportToS3TaskSpecification' smart constructor.
data ExportToS3TaskSpecification = ExportToS3TaskSpecification'
    { _etstsContainerFormat :: !(Maybe ContainerFormat)
    , _etstsS3Prefix        :: !(Maybe Text)
    , _etstsS3Bucket        :: !(Maybe Text)
    , _etstsDiskImageFormat :: !(Maybe DiskImageFormat)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ExportToS3TaskSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'etstsContainerFormat'
--
-- * 'etstsS3Prefix'
--
-- * 'etstsS3Bucket'
--
-- * 'etstsDiskImageFormat'
exportToS3TaskSpecification
    :: ExportToS3TaskSpecification
exportToS3TaskSpecification =
    ExportToS3TaskSpecification'
    { _etstsContainerFormat = Nothing
    , _etstsS3Prefix = Nothing
    , _etstsS3Bucket = Nothing
    , _etstsDiskImageFormat = Nothing
    }

-- | The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
etstsContainerFormat :: Lens' ExportToS3TaskSpecification (Maybe ContainerFormat)
etstsContainerFormat = lens _etstsContainerFormat (\ s a -> s{_etstsContainerFormat = a});

-- | The image is written to a single object in the S3 bucket at the S3 key s3prefix + exportTaskId + \'.\' + diskImageFormat.
etstsS3Prefix :: Lens' ExportToS3TaskSpecification (Maybe Text)
etstsS3Prefix = lens _etstsS3Prefix (\ s a -> s{_etstsS3Prefix = a});

-- | The S3 bucket for the destination image. The destination bucket must exist and grant WRITE and READ_ACP permissions to the AWS account 'vm-import-export\'amazon.com'.
etstsS3Bucket :: Lens' ExportToS3TaskSpecification (Maybe Text)
etstsS3Bucket = lens _etstsS3Bucket (\ s a -> s{_etstsS3Bucket = a});

-- | The format for the exported image.
etstsDiskImageFormat :: Lens' ExportToS3TaskSpecification (Maybe DiskImageFormat)
etstsDiskImageFormat = lens _etstsDiskImageFormat (\ s a -> s{_etstsDiskImageFormat = a});

instance Hashable ExportToS3TaskSpecification

instance NFData ExportToS3TaskSpecification

instance ToQuery ExportToS3TaskSpecification where
        toQuery ExportToS3TaskSpecification'{..}
          = mconcat
              ["ContainerFormat" =: _etstsContainerFormat,
               "S3Prefix" =: _etstsS3Prefix,
               "S3Bucket" =: _etstsS3Bucket,
               "DiskImageFormat" =: _etstsDiskImageFormat]

-- | A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.
--
-- /See:/ 'filter'' smart constructor.
data Filter = Filter'
    { _fValues :: !(Maybe [Text])
    , _fName   :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'Filter' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fValues'
--
-- * 'fName'
filter'
    :: Text -- ^ 'fName'
    -> Filter
filter' pName_ =
    Filter'
    { _fValues = Nothing
    , _fName = pName_
    }

-- | One or more filter values. Filter values are case-sensitive.
fValues :: Lens' Filter [Text]
fValues = lens _fValues (\ s a -> s{_fValues = a}) . _Default . _Coerce;

-- | The name of the filter. Filter names are case-sensitive.
fName :: Lens' Filter Text
fName = lens _fName (\ s a -> s{_fName = a});

instance Hashable Filter

instance NFData Filter

instance ToQuery Filter where
        toQuery Filter'{..}
          = mconcat
              [toQuery (toQueryList "Value" <$> _fValues),
               "Name" =: _fName]

-- | Describes a flow log.
--
-- /See:/ 'flowLog' smart constructor.
data FlowLog = FlowLog'
    { _flCreationTime             :: !(Maybe ISO8601)
    , _flResourceId               :: !(Maybe Text)
    , _flFlowLogStatus            :: !(Maybe Text)
    , _flTrafficType              :: !(Maybe TrafficType)
    , _flDeliverLogsStatus        :: !(Maybe Text)
    , _flDeliverLogsErrorMessage  :: !(Maybe Text)
    , _flLogGroupName             :: !(Maybe Text)
    , _flDeliverLogsPermissionARN :: !(Maybe Text)
    , _flFlowLogId                :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'FlowLog' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'flCreationTime'
--
-- * 'flResourceId'
--
-- * 'flFlowLogStatus'
--
-- * 'flTrafficType'
--
-- * 'flDeliverLogsStatus'
--
-- * 'flDeliverLogsErrorMessage'
--
-- * 'flLogGroupName'
--
-- * 'flDeliverLogsPermissionARN'
--
-- * 'flFlowLogId'
flowLog
    :: FlowLog
flowLog =
    FlowLog'
    { _flCreationTime = Nothing
    , _flResourceId = Nothing
    , _flFlowLogStatus = Nothing
    , _flTrafficType = Nothing
    , _flDeliverLogsStatus = Nothing
    , _flDeliverLogsErrorMessage = Nothing
    , _flLogGroupName = Nothing
    , _flDeliverLogsPermissionARN = Nothing
    , _flFlowLogId = Nothing
    }

-- | The date and time the flow log was created.
flCreationTime :: Lens' FlowLog (Maybe UTCTime)
flCreationTime = lens _flCreationTime (\ s a -> s{_flCreationTime = a}) . mapping _Time;

-- | The ID of the resource on which the flow log was created.
flResourceId :: Lens' FlowLog (Maybe Text)
flResourceId = lens _flResourceId (\ s a -> s{_flResourceId = a});

-- | The status of the flow log ('ACTIVE').
flFlowLogStatus :: Lens' FlowLog (Maybe Text)
flFlowLogStatus = lens _flFlowLogStatus (\ s a -> s{_flFlowLogStatus = a});

-- | The type of traffic captured for the flow log.
flTrafficType :: Lens' FlowLog (Maybe TrafficType)
flTrafficType = lens _flTrafficType (\ s a -> s{_flTrafficType = a});

-- | The status of the logs delivery ('SUCCESS' | 'FAILED').
flDeliverLogsStatus :: Lens' FlowLog (Maybe Text)
flDeliverLogsStatus = lens _flDeliverLogsStatus (\ s a -> s{_flDeliverLogsStatus = a});

-- | Information about the error that occurred. 'Rate limited' indicates that CloudWatch logs throttling has been applied for one or more network interfaces, or that you\'ve reached the limit on the number of CloudWatch Logs log groups that you can create. 'Access error' indicates that the IAM role associated with the flow log does not have sufficient permissions to publish to CloudWatch Logs. 'Unknown error' indicates an internal error.
flDeliverLogsErrorMessage :: Lens' FlowLog (Maybe Text)
flDeliverLogsErrorMessage = lens _flDeliverLogsErrorMessage (\ s a -> s{_flDeliverLogsErrorMessage = a});

-- | The name of the flow log group.
flLogGroupName :: Lens' FlowLog (Maybe Text)
flLogGroupName = lens _flLogGroupName (\ s a -> s{_flLogGroupName = a});

-- | The ARN of the IAM role that posts logs to CloudWatch Logs.
flDeliverLogsPermissionARN :: Lens' FlowLog (Maybe Text)
flDeliverLogsPermissionARN = lens _flDeliverLogsPermissionARN (\ s a -> s{_flDeliverLogsPermissionARN = a});

-- | The flow log ID.
flFlowLogId :: Lens' FlowLog (Maybe Text)
flFlowLogId = lens _flFlowLogId (\ s a -> s{_flFlowLogId = a});

instance FromXML FlowLog where
        parseXML x
          = FlowLog' <$>
              (x .@? "creationTime") <*> (x .@? "resourceId") <*>
                (x .@? "flowLogStatus")
                <*> (x .@? "trafficType")
                <*> (x .@? "deliverLogsStatus")
                <*> (x .@? "deliverLogsErrorMessage")
                <*> (x .@? "logGroupName")
                <*> (x .@? "deliverLogsPermissionArn")
                <*> (x .@? "flowLogId")

instance Hashable FlowLog

instance NFData FlowLog

-- | Describes a security group.
--
-- /See:/ 'groupIdentifier' smart constructor.
data GroupIdentifier = GroupIdentifier'
    { _giGroupId   :: !(Maybe Text)
    , _giGroupName :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'GroupIdentifier' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'giGroupId'
--
-- * 'giGroupName'
groupIdentifier
    :: GroupIdentifier
groupIdentifier =
    GroupIdentifier'
    { _giGroupId = Nothing
    , _giGroupName = Nothing
    }

-- | The ID of the security group.
giGroupId :: Lens' GroupIdentifier (Maybe Text)
giGroupId = lens _giGroupId (\ s a -> s{_giGroupId = a});

-- | The name of the security group.
giGroupName :: Lens' GroupIdentifier (Maybe Text)
giGroupName = lens _giGroupName (\ s a -> s{_giGroupName = a});

instance FromXML GroupIdentifier where
        parseXML x
          = GroupIdentifier' <$>
              (x .@? "groupId") <*> (x .@? "groupName")

instance Hashable GroupIdentifier

instance NFData GroupIdentifier

instance ToQuery GroupIdentifier where
        toQuery GroupIdentifier'{..}
          = mconcat
              ["GroupId" =: _giGroupId,
               "GroupName" =: _giGroupName]

-- | Describes an event in the history of the Spot fleet request.
--
-- /See:/ 'historyRecord' smart constructor.
data HistoryRecord = HistoryRecord'
    { _hrTimestamp        :: !ISO8601
    , _hrEventType        :: !EventType
    , _hrEventInformation :: !EventInformation
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'HistoryRecord' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hrTimestamp'
--
-- * 'hrEventType'
--
-- * 'hrEventInformation'
historyRecord
    :: UTCTime -- ^ 'hrTimestamp'
    -> EventType -- ^ 'hrEventType'
    -> EventInformation -- ^ 'hrEventInformation'
    -> HistoryRecord
historyRecord pTimestamp_ pEventType_ pEventInformation_ =
    HistoryRecord'
    { _hrTimestamp = _Time # pTimestamp_
    , _hrEventType = pEventType_
    , _hrEventInformation = pEventInformation_
    }

-- | The date and time of the event, in UTC format (for example, /YYYY/-/MM/-/DD/T/HH/:/MM/:/SS/Z).
hrTimestamp :: Lens' HistoryRecord UTCTime
hrTimestamp = lens _hrTimestamp (\ s a -> s{_hrTimestamp = a}) . _Time;

-- | The event type.
--
-- -   'error' - Indicates an error with the Spot fleet request.
--
-- -   'fleetRequestChange' - Indicates a change in the status or configuration of the Spot fleet request.
--
-- -   'instanceChange' - Indicates that an instance was launched or terminated.
--
hrEventType :: Lens' HistoryRecord EventType
hrEventType = lens _hrEventType (\ s a -> s{_hrEventType = a});

-- | Information about the event.
hrEventInformation :: Lens' HistoryRecord EventInformation
hrEventInformation = lens _hrEventInformation (\ s a -> s{_hrEventInformation = a});

instance FromXML HistoryRecord where
        parseXML x
          = HistoryRecord' <$>
              (x .@ "timestamp") <*> (x .@ "eventType") <*>
                (x .@ "eventInformation")

instance Hashable HistoryRecord

instance NFData HistoryRecord

-- | Describes the properties of the Dedicated Host.
--
-- /See:/ 'host' smart constructor.
data Host = Host'
    { _hState             :: !(Maybe AllocationState)
    , _hClientToken       :: !(Maybe Text)
    , _hHostId            :: !(Maybe Text)
    , _hAvailableCapacity :: !(Maybe AvailableCapacity)
    , _hHostReservationId :: !(Maybe Text)
    , _hHostProperties    :: !(Maybe HostProperties)
    , _hAvailabilityZone  :: !(Maybe Text)
    , _hInstances         :: !(Maybe [HostInstance])
    , _hAutoPlacement     :: !(Maybe AutoPlacement)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'Host' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hState'
--
-- * 'hClientToken'
--
-- * 'hHostId'
--
-- * 'hAvailableCapacity'
--
-- * 'hHostReservationId'
--
-- * 'hHostProperties'
--
-- * 'hAvailabilityZone'
--
-- * 'hInstances'
--
-- * 'hAutoPlacement'
host
    :: Host
host =
    Host'
    { _hState = Nothing
    , _hClientToken = Nothing
    , _hHostId = Nothing
    , _hAvailableCapacity = Nothing
    , _hHostReservationId = Nothing
    , _hHostProperties = Nothing
    , _hAvailabilityZone = Nothing
    , _hInstances = Nothing
    , _hAutoPlacement = Nothing
    }

-- | The Dedicated Host\'s state.
hState :: Lens' Host (Maybe AllocationState)
hState = lens _hState (\ s a -> s{_hState = a});

-- | Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency> in the /Amazon Elastic Compute Cloud User Guide/.
hClientToken :: Lens' Host (Maybe Text)
hClientToken = lens _hClientToken (\ s a -> s{_hClientToken = a});

-- | The ID of the Dedicated Host.
hHostId :: Lens' Host (Maybe Text)
hHostId = lens _hHostId (\ s a -> s{_hHostId = a});

-- | The number of new instances that can be launched onto the Dedicated Host.
hAvailableCapacity :: Lens' Host (Maybe AvailableCapacity)
hAvailableCapacity = lens _hAvailableCapacity (\ s a -> s{_hAvailableCapacity = a});

-- | The reservation ID of the Dedicated Host. This returns a 'null' response if the Dedicated Host doesn\'t have an associated reservation.
hHostReservationId :: Lens' Host (Maybe Text)
hHostReservationId = lens _hHostReservationId (\ s a -> s{_hHostReservationId = a});

-- | The hardware specifications of the Dedicated Host.
hHostProperties :: Lens' Host (Maybe HostProperties)
hHostProperties = lens _hHostProperties (\ s a -> s{_hHostProperties = a});

-- | The Availability Zone of the Dedicated Host.
hAvailabilityZone :: Lens' Host (Maybe Text)
hAvailabilityZone = lens _hAvailabilityZone (\ s a -> s{_hAvailabilityZone = a});

-- | The IDs and instance type that are currently running on the Dedicated Host.
hInstances :: Lens' Host [HostInstance]
hInstances = lens _hInstances (\ s a -> s{_hInstances = a}) . _Default . _Coerce;

-- | Whether auto-placement is on or off.
hAutoPlacement :: Lens' Host (Maybe AutoPlacement)
hAutoPlacement = lens _hAutoPlacement (\ s a -> s{_hAutoPlacement = a});

instance FromXML Host where
        parseXML x
          = Host' <$>
              (x .@? "state") <*> (x .@? "clientToken") <*>
                (x .@? "hostId")
                <*> (x .@? "availableCapacity")
                <*> (x .@? "hostReservationId")
                <*> (x .@? "hostProperties")
                <*> (x .@? "availabilityZone")
                <*>
                (x .@? "instances" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "autoPlacement")

instance Hashable Host

instance NFData Host

-- | Describes an instance running on a Dedicated Host.
--
-- /See:/ 'hostInstance' smart constructor.
data HostInstance = HostInstance'
    { _hiInstanceId   :: !(Maybe Text)
    , _hiInstanceType :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'HostInstance' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hiInstanceId'
--
-- * 'hiInstanceType'
hostInstance
    :: HostInstance
hostInstance =
    HostInstance'
    { _hiInstanceId = Nothing
    , _hiInstanceType = Nothing
    }

-- | the IDs of instances that are running on the Dedicated Host.
hiInstanceId :: Lens' HostInstance (Maybe Text)
hiInstanceId = lens _hiInstanceId (\ s a -> s{_hiInstanceId = a});

-- | The instance type size (for example, 'm3.medium') of the running instance.
hiInstanceType :: Lens' HostInstance (Maybe Text)
hiInstanceType = lens _hiInstanceType (\ s a -> s{_hiInstanceType = a});

instance FromXML HostInstance where
        parseXML x
          = HostInstance' <$>
              (x .@? "instanceId") <*> (x .@? "instanceType")

instance Hashable HostInstance

instance NFData HostInstance

-- | Details about the Dedicated Host Reservation offering.
--
-- /See:/ 'hostOffering' smart constructor.
data HostOffering = HostOffering'
    { _hoInstanceFamily :: !(Maybe Text)
    , _hoCurrencyCode   :: !(Maybe CurrencyCodeValues)
    , _hoHourlyPrice    :: !(Maybe Text)
    , _hoUpfrontPrice   :: !(Maybe Text)
    , _hoOfferingId     :: !(Maybe Text)
    , _hoDuration       :: !(Maybe Int)
    , _hoPaymentOption  :: !(Maybe PaymentOption)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'HostOffering' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hoInstanceFamily'
--
-- * 'hoCurrencyCode'
--
-- * 'hoHourlyPrice'
--
-- * 'hoUpfrontPrice'
--
-- * 'hoOfferingId'
--
-- * 'hoDuration'
--
-- * 'hoPaymentOption'
hostOffering
    :: HostOffering
hostOffering =
    HostOffering'
    { _hoInstanceFamily = Nothing
    , _hoCurrencyCode = Nothing
    , _hoHourlyPrice = Nothing
    , _hoUpfrontPrice = Nothing
    , _hoOfferingId = Nothing
    , _hoDuration = Nothing
    , _hoPaymentOption = Nothing
    }

-- | The instance family of the offering.
hoInstanceFamily :: Lens' HostOffering (Maybe Text)
hoInstanceFamily = lens _hoInstanceFamily (\ s a -> s{_hoInstanceFamily = a});

-- | The currency of the offering.
hoCurrencyCode :: Lens' HostOffering (Maybe CurrencyCodeValues)
hoCurrencyCode = lens _hoCurrencyCode (\ s a -> s{_hoCurrencyCode = a});

-- | The hourly price of the offering.
hoHourlyPrice :: Lens' HostOffering (Maybe Text)
hoHourlyPrice = lens _hoHourlyPrice (\ s a -> s{_hoHourlyPrice = a});

-- | The upfront price of the offering. Does not apply to No Upfront offerings.
hoUpfrontPrice :: Lens' HostOffering (Maybe Text)
hoUpfrontPrice = lens _hoUpfrontPrice (\ s a -> s{_hoUpfrontPrice = a});

-- | The ID of the offering.
hoOfferingId :: Lens' HostOffering (Maybe Text)
hoOfferingId = lens _hoOfferingId (\ s a -> s{_hoOfferingId = a});

-- | The duration of the offering (in seconds).
hoDuration :: Lens' HostOffering (Maybe Int)
hoDuration = lens _hoDuration (\ s a -> s{_hoDuration = a});

-- | The available payment option.
hoPaymentOption :: Lens' HostOffering (Maybe PaymentOption)
hoPaymentOption = lens _hoPaymentOption (\ s a -> s{_hoPaymentOption = a});

instance FromXML HostOffering where
        parseXML x
          = HostOffering' <$>
              (x .@? "instanceFamily") <*> (x .@? "currencyCode")
                <*> (x .@? "hourlyPrice")
                <*> (x .@? "upfrontPrice")
                <*> (x .@? "offeringId")
                <*> (x .@? "duration")
                <*> (x .@? "paymentOption")

instance Hashable HostOffering

instance NFData HostOffering

-- | Describes properties of a Dedicated Host.
--
-- /See:/ 'hostProperties' smart constructor.
data HostProperties = HostProperties'
    { _hpInstanceType :: !(Maybe Text)
    , _hpTotalVCPUs   :: !(Maybe Int)
    , _hpCores        :: !(Maybe Int)
    , _hpSockets      :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'HostProperties' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hpInstanceType'
--
-- * 'hpTotalVCPUs'
--
-- * 'hpCores'
--
-- * 'hpSockets'
hostProperties
    :: HostProperties
hostProperties =
    HostProperties'
    { _hpInstanceType = Nothing
    , _hpTotalVCPUs = Nothing
    , _hpCores = Nothing
    , _hpSockets = Nothing
    }

-- | The instance type size that the Dedicated Host supports (for example, 'm3.medium').
hpInstanceType :: Lens' HostProperties (Maybe Text)
hpInstanceType = lens _hpInstanceType (\ s a -> s{_hpInstanceType = a});

-- | The number of vCPUs on the Dedicated Host.
hpTotalVCPUs :: Lens' HostProperties (Maybe Int)
hpTotalVCPUs = lens _hpTotalVCPUs (\ s a -> s{_hpTotalVCPUs = a});

-- | The number of cores on the Dedicated Host.
hpCores :: Lens' HostProperties (Maybe Int)
hpCores = lens _hpCores (\ s a -> s{_hpCores = a});

-- | The number of sockets on the Dedicated Host.
hpSockets :: Lens' HostProperties (Maybe Int)
hpSockets = lens _hpSockets (\ s a -> s{_hpSockets = a});

instance FromXML HostProperties where
        parseXML x
          = HostProperties' <$>
              (x .@? "instanceType") <*> (x .@? "totalVCpus") <*>
                (x .@? "cores")
                <*> (x .@? "sockets")

instance Hashable HostProperties

instance NFData HostProperties

-- | Details about the Dedicated Host Reservation and associated Dedicated Hosts.
--
-- /See:/ 'hostReservation' smart constructor.
data HostReservation = HostReservation'
    { _hrState             :: !(Maybe ReservationState)
    , _hrInstanceFamily    :: !(Maybe Text)
    , _hrCurrencyCode      :: !(Maybe CurrencyCodeValues)
    , _hrHostReservationId :: !(Maybe Text)
    , _hrStart             :: !(Maybe ISO8601)
    , _hrHourlyPrice       :: !(Maybe Text)
    , _hrCount             :: !(Maybe Int)
    , _hrUpfrontPrice      :: !(Maybe Text)
    , _hrEnd               :: !(Maybe ISO8601)
    , _hrHostIdSet         :: !(Maybe [Text])
    , _hrOfferingId        :: !(Maybe Text)
    , _hrDuration          :: !(Maybe Int)
    , _hrPaymentOption     :: !(Maybe PaymentOption)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'HostReservation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hrState'
--
-- * 'hrInstanceFamily'
--
-- * 'hrCurrencyCode'
--
-- * 'hrHostReservationId'
--
-- * 'hrStart'
--
-- * 'hrHourlyPrice'
--
-- * 'hrCount'
--
-- * 'hrUpfrontPrice'
--
-- * 'hrEnd'
--
-- * 'hrHostIdSet'
--
-- * 'hrOfferingId'
--
-- * 'hrDuration'
--
-- * 'hrPaymentOption'
hostReservation
    :: HostReservation
hostReservation =
    HostReservation'
    { _hrState = Nothing
    , _hrInstanceFamily = Nothing
    , _hrCurrencyCode = Nothing
    , _hrHostReservationId = Nothing
    , _hrStart = Nothing
    , _hrHourlyPrice = Nothing
    , _hrCount = Nothing
    , _hrUpfrontPrice = Nothing
    , _hrEnd = Nothing
    , _hrHostIdSet = Nothing
    , _hrOfferingId = Nothing
    , _hrDuration = Nothing
    , _hrPaymentOption = Nothing
    }

-- | The state of the reservation.
hrState :: Lens' HostReservation (Maybe ReservationState)
hrState = lens _hrState (\ s a -> s{_hrState = a});

-- | The instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same in order for it to benefit from the reservation.
hrInstanceFamily :: Lens' HostReservation (Maybe Text)
hrInstanceFamily = lens _hrInstanceFamily (\ s a -> s{_hrInstanceFamily = a});

-- | The currency in which the 'upfrontPrice' and 'hourlyPrice' amounts are specified. At this time, the only supported currency is 'USD'.
hrCurrencyCode :: Lens' HostReservation (Maybe CurrencyCodeValues)
hrCurrencyCode = lens _hrCurrencyCode (\ s a -> s{_hrCurrencyCode = a});

-- | The ID of the reservation that specifies the associated Dedicated Hosts.
hrHostReservationId :: Lens' HostReservation (Maybe Text)
hrHostReservationId = lens _hrHostReservationId (\ s a -> s{_hrHostReservationId = a});

-- | The date and time that the reservation started.
hrStart :: Lens' HostReservation (Maybe UTCTime)
hrStart = lens _hrStart (\ s a -> s{_hrStart = a}) . mapping _Time;

-- | The hourly price of the reservation.
hrHourlyPrice :: Lens' HostReservation (Maybe Text)
hrHourlyPrice = lens _hrHourlyPrice (\ s a -> s{_hrHourlyPrice = a});

-- | The number of Dedicated Hosts the reservation is associated with.
hrCount :: Lens' HostReservation (Maybe Int)
hrCount = lens _hrCount (\ s a -> s{_hrCount = a});

-- | The upfront price of the reservation.
hrUpfrontPrice :: Lens' HostReservation (Maybe Text)
hrUpfrontPrice = lens _hrUpfrontPrice (\ s a -> s{_hrUpfrontPrice = a});

-- | The date and time that the reservation ends.
hrEnd :: Lens' HostReservation (Maybe UTCTime)
hrEnd = lens _hrEnd (\ s a -> s{_hrEnd = a}) . mapping _Time;

-- | The IDs of the Dedicated Hosts associated with the reservation.
hrHostIdSet :: Lens' HostReservation [Text]
hrHostIdSet = lens _hrHostIdSet (\ s a -> s{_hrHostIdSet = a}) . _Default . _Coerce;

-- | The ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it.
hrOfferingId :: Lens' HostReservation (Maybe Text)
hrOfferingId = lens _hrOfferingId (\ s a -> s{_hrOfferingId = a});

-- | The length of the reservation\'s term, specified in seconds. Can be '31536000 (1 year)' | '94608000 (3 years)'.
hrDuration :: Lens' HostReservation (Maybe Int)
hrDuration = lens _hrDuration (\ s a -> s{_hrDuration = a});

-- | The payment option selected for this reservation.
hrPaymentOption :: Lens' HostReservation (Maybe PaymentOption)
hrPaymentOption = lens _hrPaymentOption (\ s a -> s{_hrPaymentOption = a});

instance FromXML HostReservation where
        parseXML x
          = HostReservation' <$>
              (x .@? "state") <*> (x .@? "instanceFamily") <*>
                (x .@? "currencyCode")
                <*> (x .@? "hostReservationId")
                <*> (x .@? "start")
                <*> (x .@? "hourlyPrice")
                <*> (x .@? "count")
                <*> (x .@? "upfrontPrice")
                <*> (x .@? "end")
                <*>
                (x .@? "hostIdSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "offeringId")
                <*> (x .@? "duration")
                <*> (x .@? "paymentOption")

instance Hashable HostReservation

instance NFData HostReservation

-- | Describes an IAM instance profile.
--
-- /See:/ 'iamInstanceProfile' smart constructor.
data IAMInstanceProfile = IAMInstanceProfile'
    { _iapARN :: !(Maybe Text)
    , _iapId  :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'IAMInstanceProfile' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iapARN'
--
-- * 'iapId'
iamInstanceProfile
    :: IAMInstanceProfile
iamInstanceProfile =
    IAMInstanceProfile'
    { _iapARN = Nothing
    , _iapId = Nothing
    }

-- | The Amazon Resource Name (ARN) of the instance profile.
iapARN :: Lens' IAMInstanceProfile (Maybe Text)
iapARN = lens _iapARN (\ s a -> s{_iapARN = a});

-- | The ID of the instance profile.
iapId :: Lens' IAMInstanceProfile (Maybe Text)
iapId = lens _iapId (\ s a -> s{_iapId = a});

instance FromXML IAMInstanceProfile where
        parseXML x
          = IAMInstanceProfile' <$>
              (x .@? "arn") <*> (x .@? "id")

instance Hashable IAMInstanceProfile

instance NFData IAMInstanceProfile

-- | Describes an IAM instance profile.
--
-- /See:/ 'iamInstanceProfileSpecification' smart constructor.
data IAMInstanceProfileSpecification = IAMInstanceProfileSpecification'
    { _iapsARN  :: !(Maybe Text)
    , _iapsName :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'IAMInstanceProfileSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iapsARN'
--
-- * 'iapsName'
iamInstanceProfileSpecification
    :: IAMInstanceProfileSpecification
iamInstanceProfileSpecification =
    IAMInstanceProfileSpecification'
    { _iapsARN = Nothing
    , _iapsName = Nothing
    }

-- | The Amazon Resource Name (ARN) of the instance profile.
iapsARN :: Lens' IAMInstanceProfileSpecification (Maybe Text)
iapsARN = lens _iapsARN (\ s a -> s{_iapsARN = a});

-- | The name of the instance profile.
iapsName :: Lens' IAMInstanceProfileSpecification (Maybe Text)
iapsName = lens _iapsName (\ s a -> s{_iapsName = a});

instance FromXML IAMInstanceProfileSpecification
         where
        parseXML x
          = IAMInstanceProfileSpecification' <$>
              (x .@? "arn") <*> (x .@? "name")

instance Hashable IAMInstanceProfileSpecification

instance NFData IAMInstanceProfileSpecification

instance ToQuery IAMInstanceProfileSpecification
         where
        toQuery IAMInstanceProfileSpecification'{..}
          = mconcat ["Arn" =: _iapsARN, "Name" =: _iapsName]

-- | Describes the ICMP type and code.
--
-- /See:/ 'icmpTypeCode' smart constructor.
data ICMPTypeCode = ICMPTypeCode'
    { _itcCode :: !(Maybe Int)
    , _itcType :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ICMPTypeCode' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'itcCode'
--
-- * 'itcType'
icmpTypeCode
    :: ICMPTypeCode
icmpTypeCode =
    ICMPTypeCode'
    { _itcCode = Nothing
    , _itcType = Nothing
    }

-- | The ICMP type. A value of -1 means all types.
itcCode :: Lens' ICMPTypeCode (Maybe Int)
itcCode = lens _itcCode (\ s a -> s{_itcCode = a});

-- | The ICMP code. A value of -1 means all codes for the specified ICMP type.
itcType :: Lens' ICMPTypeCode (Maybe Int)
itcType = lens _itcType (\ s a -> s{_itcType = a});

instance FromXML ICMPTypeCode where
        parseXML x
          = ICMPTypeCode' <$> (x .@? "code") <*> (x .@? "type")

instance Hashable ICMPTypeCode

instance NFData ICMPTypeCode

instance ToQuery ICMPTypeCode where
        toQuery ICMPTypeCode'{..}
          = mconcat ["Code" =: _itcCode, "Type" =: _itcType]

-- | Describes a security group rule.
--
-- /See:/ 'ipPermission' smart constructor.
data IPPermission = IPPermission'
    { _ipFromPort         :: !(Maybe Int)
    , _ipUserIdGroupPairs :: !(Maybe [UserIdGroupPair])
    , _ipPrefixListIds    :: !(Maybe [PrefixListId])
    , _ipToPort           :: !(Maybe Int)
    , _ipIPRanges         :: !(Maybe [IPRange])
    , _ipIPProtocol       :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'IPPermission' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ipFromPort'
--
-- * 'ipUserIdGroupPairs'
--
-- * 'ipPrefixListIds'
--
-- * 'ipToPort'
--
-- * 'ipIPRanges'
--
-- * 'ipIPProtocol'
ipPermission
    :: Text -- ^ 'ipIPProtocol'
    -> IPPermission
ipPermission pIPProtocol_ =
    IPPermission'
    { _ipFromPort = Nothing
    , _ipUserIdGroupPairs = Nothing
    , _ipPrefixListIds = Nothing
    , _ipToPort = Nothing
    , _ipIPRanges = Nothing
    , _ipIPProtocol = pIPProtocol_
    }

-- | The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of '-1' indicates all ICMP types.
ipFromPort :: Lens' IPPermission (Maybe Int)
ipFromPort = lens _ipFromPort (\ s a -> s{_ipFromPort = a});

-- | One or more security group and AWS account ID pairs.
ipUserIdGroupPairs :: Lens' IPPermission [UserIdGroupPair]
ipUserIdGroupPairs = lens _ipUserIdGroupPairs (\ s a -> s{_ipUserIdGroupPairs = a}) . _Default . _Coerce;

-- | (Valid for < AuthorizeSecurityGroupEgress>, < RevokeSecurityGroupEgress> and < DescribeSecurityGroups> only) One or more prefix list IDs for an AWS service. In an < AuthorizeSecurityGroupEgress> request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
ipPrefixListIds :: Lens' IPPermission [PrefixListId]
ipPrefixListIds = lens _ipPrefixListIds (\ s a -> s{_ipPrefixListIds = a}) . _Default . _Coerce;

-- | The end of port range for the TCP and UDP protocols, or an ICMP code. A value of '-1' indicates all ICMP codes for the specified ICMP type.
ipToPort :: Lens' IPPermission (Maybe Int)
ipToPort = lens _ipToPort (\ s a -> s{_ipToPort = a});

-- | One or more IP ranges.
ipIPRanges :: Lens' IPPermission [IPRange]
ipIPRanges = lens _ipIPRanges (\ s a -> s{_ipIPRanges = a}) . _Default . _Coerce;

-- | The IP protocol name (for 'tcp', 'udp', and 'icmp') or number (see <http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml Protocol Numbers>).
--
-- [EC2-VPC only] When you authorize or revoke security group rules, you can use '-1' to specify all.
ipIPProtocol :: Lens' IPPermission Text
ipIPProtocol = lens _ipIPProtocol (\ s a -> s{_ipIPProtocol = a});

instance FromXML IPPermission where
        parseXML x
          = IPPermission' <$>
              (x .@? "fromPort") <*>
                (x .@? "groups" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*>
                (x .@? "prefixListIds" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "toPort")
                <*>
                (x .@? "ipRanges" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@ "ipProtocol")

instance Hashable IPPermission

instance NFData IPPermission

instance ToQuery IPPermission where
        toQuery IPPermission'{..}
          = mconcat
              ["FromPort" =: _ipFromPort,
               toQuery
                 (toQueryList "Groups" <$> _ipUserIdGroupPairs),
               toQuery
                 (toQueryList "PrefixListIds" <$> _ipPrefixListIds),
               "ToPort" =: _ipToPort,
               toQuery (toQueryList "IpRanges" <$> _ipIPRanges),
               "IpProtocol" =: _ipIPProtocol]

-- | Describes an IP range.
--
-- /See:/ 'ipRange' smart constructor.
newtype IPRange = IPRange'
    { _irCIdRIP :: Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'IPRange' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'irCIdRIP'
ipRange
    :: Text -- ^ 'irCIdRIP'
    -> IPRange
ipRange pCIdRIP_ =
    IPRange'
    { _irCIdRIP = pCIdRIP_
    }

-- | The CIDR range. You can either specify a CIDR range or a source security group, not both.
irCIdRIP :: Lens' IPRange Text
irCIdRIP = lens _irCIdRIP (\ s a -> s{_irCIdRIP = a});

instance FromXML IPRange where
        parseXML x = IPRange' <$> (x .@ "cidrIp")

instance Hashable IPRange

instance NFData IPRange

instance ToQuery IPRange where
        toQuery IPRange'{..}
          = mconcat ["CidrIp" =: _irCIdRIP]

-- | Describes the ID format for a resource.
--
-- /See:/ 'idFormat' smart constructor.
data IdFormat = IdFormat'
    { _ifUseLongIds :: !(Maybe Bool)
    , _ifDeadline   :: !(Maybe ISO8601)
    , _ifResource   :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'IdFormat' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ifUseLongIds'
--
-- * 'ifDeadline'
--
-- * 'ifResource'
idFormat
    :: IdFormat
idFormat =
    IdFormat'
    { _ifUseLongIds = Nothing
    , _ifDeadline = Nothing
    , _ifResource = Nothing
    }

-- | Indicates whether longer IDs (17-character IDs) are enabled for the resource.
ifUseLongIds :: Lens' IdFormat (Maybe Bool)
ifUseLongIds = lens _ifUseLongIds (\ s a -> s{_ifUseLongIds = a});

-- | The date in UTC at which you are permanently switched over to using longer IDs. If a deadline is not yet available for this resource type, this field is not returned.
ifDeadline :: Lens' IdFormat (Maybe UTCTime)
ifDeadline = lens _ifDeadline (\ s a -> s{_ifDeadline = a}) . mapping _Time;

-- | The type of resource.
ifResource :: Lens' IdFormat (Maybe Text)
ifResource = lens _ifResource (\ s a -> s{_ifResource = a});

instance FromXML IdFormat where
        parseXML x
          = IdFormat' <$>
              (x .@? "useLongIds") <*> (x .@? "deadline") <*>
                (x .@? "resource")

instance Hashable IdFormat

instance NFData IdFormat

-- | Describes an image.
--
-- /See:/ 'image' smart constructor.
data Image = Image'
    { _iPlatform            :: !(Maybe PlatformValues)
    , _iEnaSupport          :: !(Maybe Bool)
    , _iImageOwnerAlias     :: !(Maybe Text)
    , _iRAMDiskId           :: !(Maybe Text)
    , _iKernelId            :: !(Maybe Text)
    , _iRootDeviceName      :: !(Maybe Text)
    , _iSRIOVNetSupport     :: !(Maybe Text)
    , _iName                :: !(Maybe Text)
    , _iCreationDate        :: !(Maybe Text)
    , _iProductCodes        :: !(Maybe [ProductCode])
    , _iStateReason         :: !(Maybe StateReason)
    , _iDescription         :: !(Maybe Text)
    , _iBlockDeviceMappings :: !(Maybe [BlockDeviceMapping])
    , _iTags                :: !(Maybe [Tag])
    , _iImageId             :: !Text
    , _iImageLocation       :: !Text
    , _iState               :: !ImageState
    , _iOwnerId             :: !Text
    , _iPublic              :: !Bool
    , _iArchitecture        :: !ArchitectureValues
    , _iImageType           :: !ImageTypeValues
    , _iRootDeviceType      :: !DeviceType
    , _iVirtualizationType  :: !VirtualizationType
    , _iHypervisor          :: !HypervisorType
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'Image' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iPlatform'
--
-- * 'iEnaSupport'
--
-- * 'iImageOwnerAlias'
--
-- * 'iRAMDiskId'
--
-- * 'iKernelId'
--
-- * 'iRootDeviceName'
--
-- * 'iSRIOVNetSupport'
--
-- * 'iName'
--
-- * 'iCreationDate'
--
-- * 'iProductCodes'
--
-- * 'iStateReason'
--
-- * 'iDescription'
--
-- * 'iBlockDeviceMappings'
--
-- * 'iTags'
--
-- * 'iImageId'
--
-- * 'iImageLocation'
--
-- * 'iState'
--
-- * 'iOwnerId'
--
-- * 'iPublic'
--
-- * 'iArchitecture'
--
-- * 'iImageType'
--
-- * 'iRootDeviceType'
--
-- * 'iVirtualizationType'
--
-- * 'iHypervisor'
image
    :: Text -- ^ 'iImageId'
    -> Text -- ^ 'iImageLocation'
    -> ImageState -- ^ 'iState'
    -> Text -- ^ 'iOwnerId'
    -> Bool -- ^ 'iPublic'
    -> ArchitectureValues -- ^ 'iArchitecture'
    -> ImageTypeValues -- ^ 'iImageType'
    -> DeviceType -- ^ 'iRootDeviceType'
    -> VirtualizationType -- ^ 'iVirtualizationType'
    -> HypervisorType -- ^ 'iHypervisor'
    -> Image
image pImageId_ pImageLocation_ pState_ pOwnerId_ pPublic_ pArchitecture_ pImageType_ pRootDeviceType_ pVirtualizationType_ pHypervisor_ =
    Image'
    { _iPlatform = Nothing
    , _iEnaSupport = Nothing
    , _iImageOwnerAlias = Nothing
    , _iRAMDiskId = Nothing
    , _iKernelId = Nothing
    , _iRootDeviceName = Nothing
    , _iSRIOVNetSupport = Nothing
    , _iName = Nothing
    , _iCreationDate = Nothing
    , _iProductCodes = Nothing
    , _iStateReason = Nothing
    , _iDescription = Nothing
    , _iBlockDeviceMappings = Nothing
    , _iTags = Nothing
    , _iImageId = pImageId_
    , _iImageLocation = pImageLocation_
    , _iState = pState_
    , _iOwnerId = pOwnerId_
    , _iPublic = pPublic_
    , _iArchitecture = pArchitecture_
    , _iImageType = pImageType_
    , _iRootDeviceType = pRootDeviceType_
    , _iVirtualizationType = pVirtualizationType_
    , _iHypervisor = pHypervisor_
    }

-- | The value is 'Windows' for Windows AMIs; otherwise blank.
iPlatform :: Lens' Image (Maybe PlatformValues)
iPlatform = lens _iPlatform (\ s a -> s{_iPlatform = a});

-- | Specifies whether enhanced networking with ENA is enabled.
iEnaSupport :: Lens' Image (Maybe Bool)
iEnaSupport = lens _iEnaSupport (\ s a -> s{_iEnaSupport = a});

-- | The AWS account alias (for example, 'amazon', 'self') or the AWS account ID of the AMI owner.
iImageOwnerAlias :: Lens' Image (Maybe Text)
iImageOwnerAlias = lens _iImageOwnerAlias (\ s a -> s{_iImageOwnerAlias = a});

-- | The RAM disk associated with the image, if any. Only applicable for machine images.
iRAMDiskId :: Lens' Image (Maybe Text)
iRAMDiskId = lens _iRAMDiskId (\ s a -> s{_iRAMDiskId = a});

-- | The kernel associated with the image, if any. Only applicable for machine images.
iKernelId :: Lens' Image (Maybe Text)
iKernelId = lens _iKernelId (\ s a -> s{_iKernelId = a});

-- | The device name of the root device (for example, '\/dev\/sda1' or '\/dev\/xvda').
iRootDeviceName :: Lens' Image (Maybe Text)
iRootDeviceName = lens _iRootDeviceName (\ s a -> s{_iRootDeviceName = a});

-- | Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
iSRIOVNetSupport :: Lens' Image (Maybe Text)
iSRIOVNetSupport = lens _iSRIOVNetSupport (\ s a -> s{_iSRIOVNetSupport = a});

-- | The name of the AMI that was provided during image creation.
iName :: Lens' Image (Maybe Text)
iName = lens _iName (\ s a -> s{_iName = a});

-- | The date and time the image was created.
iCreationDate :: Lens' Image (Maybe Text)
iCreationDate = lens _iCreationDate (\ s a -> s{_iCreationDate = a});

-- | Any product codes associated with the AMI.
iProductCodes :: Lens' Image [ProductCode]
iProductCodes = lens _iProductCodes (\ s a -> s{_iProductCodes = a}) . _Default . _Coerce;

-- | The reason for the state change.
iStateReason :: Lens' Image (Maybe StateReason)
iStateReason = lens _iStateReason (\ s a -> s{_iStateReason = a});

-- | The description of the AMI that was provided during image creation.
iDescription :: Lens' Image (Maybe Text)
iDescription = lens _iDescription (\ s a -> s{_iDescription = a});

-- | Any block device mapping entries.
iBlockDeviceMappings :: Lens' Image [BlockDeviceMapping]
iBlockDeviceMappings = lens _iBlockDeviceMappings (\ s a -> s{_iBlockDeviceMappings = a}) . _Default . _Coerce;

-- | Any tags assigned to the image.
iTags :: Lens' Image [Tag]
iTags = lens _iTags (\ s a -> s{_iTags = a}) . _Default . _Coerce;

-- | The ID of the AMI.
iImageId :: Lens' Image Text
iImageId = lens _iImageId (\ s a -> s{_iImageId = a});

-- | The location of the AMI.
iImageLocation :: Lens' Image Text
iImageLocation = lens _iImageLocation (\ s a -> s{_iImageLocation = a});

-- | The current state of the AMI. If the state is 'available', the image is successfully registered and can be used to launch an instance.
iState :: Lens' Image ImageState
iState = lens _iState (\ s a -> s{_iState = a});

-- | The AWS account ID of the image owner.
iOwnerId :: Lens' Image Text
iOwnerId = lens _iOwnerId (\ s a -> s{_iOwnerId = a});

-- | Indicates whether the image has public launch permissions. The value is 'true' if this image has public launch permissions or 'false' if it has only implicit and explicit launch permissions.
iPublic :: Lens' Image Bool
iPublic = lens _iPublic (\ s a -> s{_iPublic = a});

-- | The architecture of the image.
iArchitecture :: Lens' Image ArchitectureValues
iArchitecture = lens _iArchitecture (\ s a -> s{_iArchitecture = a});

-- | The type of image.
iImageType :: Lens' Image ImageTypeValues
iImageType = lens _iImageType (\ s a -> s{_iImageType = a});

-- | The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
iRootDeviceType :: Lens' Image DeviceType
iRootDeviceType = lens _iRootDeviceType (\ s a -> s{_iRootDeviceType = a});

-- | The type of virtualization of the AMI.
iVirtualizationType :: Lens' Image VirtualizationType
iVirtualizationType = lens _iVirtualizationType (\ s a -> s{_iVirtualizationType = a});

-- | The hypervisor type of the image.
iHypervisor :: Lens' Image HypervisorType
iHypervisor = lens _iHypervisor (\ s a -> s{_iHypervisor = a});

instance FromXML Image where
        parseXML x
          = Image' <$>
              (x .@? "platform") <*> (x .@? "enaSupport") <*>
                (x .@? "imageOwnerAlias")
                <*> (x .@? "ramdiskId")
                <*> (x .@? "kernelId")
                <*> (x .@? "rootDeviceName")
                <*> (x .@? "sriovNetSupport")
                <*> (x .@? "name")
                <*> (x .@? "creationDate")
                <*>
                (x .@? "productCodes" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "stateReason")
                <*> (x .@? "description")
                <*>
                (x .@? "blockDeviceMapping" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@ "imageId")
                <*> (x .@ "imageLocation")
                <*> (x .@ "imageState")
                <*> (x .@ "imageOwnerId")
                <*> (x .@ "isPublic")
                <*> (x .@ "architecture")
                <*> (x .@ "imageType")
                <*> (x .@ "rootDeviceType")
                <*> (x .@ "virtualizationType")
                <*> (x .@ "hypervisor")

instance Hashable Image

instance NFData Image

-- | Describes the disk container object for an import image task.
--
-- /See:/ 'imageDiskContainer' smart constructor.
data ImageDiskContainer = ImageDiskContainer'
    { _idcFormat      :: !(Maybe Text)
    , _idcURL         :: !(Maybe Text)
    , _idcDeviceName  :: !(Maybe Text)
    , _idcUserBucket  :: !(Maybe UserBucket)
    , _idcDescription :: !(Maybe Text)
    , _idcSnapshotId  :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImageDiskContainer' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'idcFormat'
--
-- * 'idcURL'
--
-- * 'idcDeviceName'
--
-- * 'idcUserBucket'
--
-- * 'idcDescription'
--
-- * 'idcSnapshotId'
imageDiskContainer
    :: ImageDiskContainer
imageDiskContainer =
    ImageDiskContainer'
    { _idcFormat = Nothing
    , _idcURL = Nothing
    , _idcDeviceName = Nothing
    , _idcUserBucket = Nothing
    , _idcDescription = Nothing
    , _idcSnapshotId = Nothing
    }

-- | The format of the disk image being imported.
--
-- Valid values: 'RAW' | 'VHD' | 'VMDK' | 'OVA'
idcFormat :: Lens' ImageDiskContainer (Maybe Text)
idcFormat = lens _idcFormat (\ s a -> s{_idcFormat = a});

-- | The URL to the Amazon S3-based disk image being imported. The URL can either be a https URL (https:\/\/..) or an Amazon S3 URL (s3:\/\/..)
idcURL :: Lens' ImageDiskContainer (Maybe Text)
idcURL = lens _idcURL (\ s a -> s{_idcURL = a});

-- | The block device mapping for the disk.
idcDeviceName :: Lens' ImageDiskContainer (Maybe Text)
idcDeviceName = lens _idcDeviceName (\ s a -> s{_idcDeviceName = a});

-- | The S3 bucket for the disk image.
idcUserBucket :: Lens' ImageDiskContainer (Maybe UserBucket)
idcUserBucket = lens _idcUserBucket (\ s a -> s{_idcUserBucket = a});

-- | The description of the disk image.
idcDescription :: Lens' ImageDiskContainer (Maybe Text)
idcDescription = lens _idcDescription (\ s a -> s{_idcDescription = a});

-- | The ID of the EBS snapshot to be used for importing the snapshot.
idcSnapshotId :: Lens' ImageDiskContainer (Maybe Text)
idcSnapshotId = lens _idcSnapshotId (\ s a -> s{_idcSnapshotId = a});

instance Hashable ImageDiskContainer

instance NFData ImageDiskContainer

instance ToQuery ImageDiskContainer where
        toQuery ImageDiskContainer'{..}
          = mconcat
              ["Format" =: _idcFormat, "Url" =: _idcURL,
               "DeviceName" =: _idcDeviceName,
               "UserBucket" =: _idcUserBucket,
               "Description" =: _idcDescription,
               "SnapshotId" =: _idcSnapshotId]

-- | Describes an import image task.
--
-- /See:/ 'importImageTask' smart constructor.
data ImportImageTask = ImportImageTask'
    { _iitStatus          :: !(Maybe Text)
    , _iitHypervisor      :: !(Maybe Text)
    , _iitPlatform        :: !(Maybe Text)
    , _iitProgress        :: !(Maybe Text)
    , _iitLicenseType     :: !(Maybe Text)
    , _iitSnapshotDetails :: !(Maybe [SnapshotDetail])
    , _iitStatusMessage   :: !(Maybe Text)
    , _iitImageId         :: !(Maybe Text)
    , _iitImportTaskId    :: !(Maybe Text)
    , _iitArchitecture    :: !(Maybe Text)
    , _iitDescription     :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportImageTask' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iitStatus'
--
-- * 'iitHypervisor'
--
-- * 'iitPlatform'
--
-- * 'iitProgress'
--
-- * 'iitLicenseType'
--
-- * 'iitSnapshotDetails'
--
-- * 'iitStatusMessage'
--
-- * 'iitImageId'
--
-- * 'iitImportTaskId'
--
-- * 'iitArchitecture'
--
-- * 'iitDescription'
importImageTask
    :: ImportImageTask
importImageTask =
    ImportImageTask'
    { _iitStatus = Nothing
    , _iitHypervisor = Nothing
    , _iitPlatform = Nothing
    , _iitProgress = Nothing
    , _iitLicenseType = Nothing
    , _iitSnapshotDetails = Nothing
    , _iitStatusMessage = Nothing
    , _iitImageId = Nothing
    , _iitImportTaskId = Nothing
    , _iitArchitecture = Nothing
    , _iitDescription = Nothing
    }

-- | A brief status for the import image task.
iitStatus :: Lens' ImportImageTask (Maybe Text)
iitStatus = lens _iitStatus (\ s a -> s{_iitStatus = a});

-- | The target hypervisor for the import task.
--
-- Valid values: 'xen'
iitHypervisor :: Lens' ImportImageTask (Maybe Text)
iitHypervisor = lens _iitHypervisor (\ s a -> s{_iitHypervisor = a});

-- | The description string for the import image task.
iitPlatform :: Lens' ImportImageTask (Maybe Text)
iitPlatform = lens _iitPlatform (\ s a -> s{_iitPlatform = a});

-- | The percentage of progress of the import image task.
iitProgress :: Lens' ImportImageTask (Maybe Text)
iitProgress = lens _iitProgress (\ s a -> s{_iitProgress = a});

-- | The license type of the virtual machine.
iitLicenseType :: Lens' ImportImageTask (Maybe Text)
iitLicenseType = lens _iitLicenseType (\ s a -> s{_iitLicenseType = a});

-- | Information about the snapshots.
iitSnapshotDetails :: Lens' ImportImageTask [SnapshotDetail]
iitSnapshotDetails = lens _iitSnapshotDetails (\ s a -> s{_iitSnapshotDetails = a}) . _Default . _Coerce;

-- | A descriptive status message for the import image task.
iitStatusMessage :: Lens' ImportImageTask (Maybe Text)
iitStatusMessage = lens _iitStatusMessage (\ s a -> s{_iitStatusMessage = a});

-- | The ID of the Amazon Machine Image (AMI) of the imported virtual machine.
iitImageId :: Lens' ImportImageTask (Maybe Text)
iitImageId = lens _iitImageId (\ s a -> s{_iitImageId = a});

-- | The ID of the import image task.
iitImportTaskId :: Lens' ImportImageTask (Maybe Text)
iitImportTaskId = lens _iitImportTaskId (\ s a -> s{_iitImportTaskId = a});

-- | The architecture of the virtual machine.
--
-- Valid values: 'i386' | 'x86_64'
iitArchitecture :: Lens' ImportImageTask (Maybe Text)
iitArchitecture = lens _iitArchitecture (\ s a -> s{_iitArchitecture = a});

-- | A description of the import task.
iitDescription :: Lens' ImportImageTask (Maybe Text)
iitDescription = lens _iitDescription (\ s a -> s{_iitDescription = a});

instance FromXML ImportImageTask where
        parseXML x
          = ImportImageTask' <$>
              (x .@? "status") <*> (x .@? "hypervisor") <*>
                (x .@? "platform")
                <*> (x .@? "progress")
                <*> (x .@? "licenseType")
                <*>
                (x .@? "snapshotDetailSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "statusMessage")
                <*> (x .@? "imageId")
                <*> (x .@? "importTaskId")
                <*> (x .@? "architecture")
                <*> (x .@? "description")

instance Hashable ImportImageTask

instance NFData ImportImageTask

-- | Describes the launch specification for VM import.
--
-- /See:/ 'importInstanceLaunchSpecification' smart constructor.
data ImportInstanceLaunchSpecification = ImportInstanceLaunchSpecification'
    { _iilsAdditionalInfo                    :: !(Maybe Text)
    , _iilsGroupNames                        :: !(Maybe [Text])
    , _iilsSubnetId                          :: !(Maybe Text)
    , _iilsInstanceType                      :: !(Maybe InstanceType)
    , _iilsGroupIds                          :: !(Maybe [Text])
    , _iilsUserData                          :: !(Maybe UserData)
    , _iilsMonitoring                        :: !(Maybe Bool)
    , _iilsPrivateIPAddress                  :: !(Maybe Text)
    , _iilsInstanceInitiatedShutdownBehavior :: !(Maybe ShutdownBehavior)
    , _iilsArchitecture                      :: !(Maybe ArchitectureValues)
    , _iilsPlacement                         :: !(Maybe Placement)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportInstanceLaunchSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iilsAdditionalInfo'
--
-- * 'iilsGroupNames'
--
-- * 'iilsSubnetId'
--
-- * 'iilsInstanceType'
--
-- * 'iilsGroupIds'
--
-- * 'iilsUserData'
--
-- * 'iilsMonitoring'
--
-- * 'iilsPrivateIPAddress'
--
-- * 'iilsInstanceInitiatedShutdownBehavior'
--
-- * 'iilsArchitecture'
--
-- * 'iilsPlacement'
importInstanceLaunchSpecification
    :: ImportInstanceLaunchSpecification
importInstanceLaunchSpecification =
    ImportInstanceLaunchSpecification'
    { _iilsAdditionalInfo = Nothing
    , _iilsGroupNames = Nothing
    , _iilsSubnetId = Nothing
    , _iilsInstanceType = Nothing
    , _iilsGroupIds = Nothing
    , _iilsUserData = Nothing
    , _iilsMonitoring = Nothing
    , _iilsPrivateIPAddress = Nothing
    , _iilsInstanceInitiatedShutdownBehavior = Nothing
    , _iilsArchitecture = Nothing
    , _iilsPlacement = Nothing
    }

-- | Reserved.
iilsAdditionalInfo :: Lens' ImportInstanceLaunchSpecification (Maybe Text)
iilsAdditionalInfo = lens _iilsAdditionalInfo (\ s a -> s{_iilsAdditionalInfo = a});

-- | One or more security group names.
iilsGroupNames :: Lens' ImportInstanceLaunchSpecification [Text]
iilsGroupNames = lens _iilsGroupNames (\ s a -> s{_iilsGroupNames = a}) . _Default . _Coerce;

-- | [EC2-VPC] The ID of the subnet in which to launch the instance.
iilsSubnetId :: Lens' ImportInstanceLaunchSpecification (Maybe Text)
iilsSubnetId = lens _iilsSubnetId (\ s a -> s{_iilsSubnetId = a});

-- | The instance type. For more information about the instance types that you can import, see <http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#vmimport-instance-types Instance Types> in the VM Import\/Export User Guide.
iilsInstanceType :: Lens' ImportInstanceLaunchSpecification (Maybe InstanceType)
iilsInstanceType = lens _iilsInstanceType (\ s a -> s{_iilsInstanceType = a});

-- | One or more security group IDs.
iilsGroupIds :: Lens' ImportInstanceLaunchSpecification [Text]
iilsGroupIds = lens _iilsGroupIds (\ s a -> s{_iilsGroupIds = a}) . _Default . _Coerce;

-- | The user data to make available to the instance. If you are using an AWS SDK or command line tool, Base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide Base64-encoded text.
iilsUserData :: Lens' ImportInstanceLaunchSpecification (Maybe UserData)
iilsUserData = lens _iilsUserData (\ s a -> s{_iilsUserData = a});

-- | Indicates whether monitoring is enabled.
iilsMonitoring :: Lens' ImportInstanceLaunchSpecification (Maybe Bool)
iilsMonitoring = lens _iilsMonitoring (\ s a -> s{_iilsMonitoring = a});

-- | [EC2-VPC] An available IP address from the IP address range of the subnet.
iilsPrivateIPAddress :: Lens' ImportInstanceLaunchSpecification (Maybe Text)
iilsPrivateIPAddress = lens _iilsPrivateIPAddress (\ s a -> s{_iilsPrivateIPAddress = a});

-- | Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
iilsInstanceInitiatedShutdownBehavior :: Lens' ImportInstanceLaunchSpecification (Maybe ShutdownBehavior)
iilsInstanceInitiatedShutdownBehavior = lens _iilsInstanceInitiatedShutdownBehavior (\ s a -> s{_iilsInstanceInitiatedShutdownBehavior = a});

-- | The architecture of the instance.
iilsArchitecture :: Lens' ImportInstanceLaunchSpecification (Maybe ArchitectureValues)
iilsArchitecture = lens _iilsArchitecture (\ s a -> s{_iilsArchitecture = a});

-- | The placement information for the instance.
iilsPlacement :: Lens' ImportInstanceLaunchSpecification (Maybe Placement)
iilsPlacement = lens _iilsPlacement (\ s a -> s{_iilsPlacement = a});

instance Hashable ImportInstanceLaunchSpecification

instance NFData ImportInstanceLaunchSpecification

instance ToQuery ImportInstanceLaunchSpecification
         where
        toQuery ImportInstanceLaunchSpecification'{..}
          = mconcat
              ["AdditionalInfo" =: _iilsAdditionalInfo,
               toQuery
                 (toQueryList "GroupName" <$> _iilsGroupNames),
               "SubnetId" =: _iilsSubnetId,
               "InstanceType" =: _iilsInstanceType,
               toQuery (toQueryList "GroupId" <$> _iilsGroupIds),
               "UserData" =: _iilsUserData,
               "Monitoring" =: _iilsMonitoring,
               "PrivateIpAddress" =: _iilsPrivateIPAddress,
               "InstanceInitiatedShutdownBehavior" =:
                 _iilsInstanceInitiatedShutdownBehavior,
               "Architecture" =: _iilsArchitecture,
               "Placement" =: _iilsPlacement]

-- | Describes an import instance task.
--
-- /See:/ 'importInstanceTaskDetails' smart constructor.
data ImportInstanceTaskDetails = ImportInstanceTaskDetails'
    { _iitdInstanceId  :: !(Maybe Text)
    , _iitdPlatform    :: !(Maybe PlatformValues)
    , _iitdDescription