{-# 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

-- | The value to use when a resource attribute accepts 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
    }

-- | 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]

-- | The value to use for a resource attribute.
--
-- /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
    }

-- | Valid values are case-sensitive and vary by action.
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 on 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

-- | 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

-- | 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)
    , _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'
--
-- * '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
    , _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});

-- | 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 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 .@? "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/AWSEC2/latest/UserGuide/VMImportPrerequisites.html Before You Get Started>
-- in the Amazon Elastic Compute Cloud 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 Base64-encoded MIME user data to be made available to the instance.
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 :: !(Maybe Text)
    , _iitdVolumes     :: ![ImportInstanceVolumeDetailItem]
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportInstanceTaskDetails' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iitdInstanceId'
--
-- * 'iitdPlatform'
--
-- * 'iitdDescription'
--
-- * 'iitdVolumes'
importInstanceTaskDetails
    :: ImportInstanceTaskDetails
importInstanceTaskDetails =
    ImportInstanceTaskDetails'
    { _iitdInstanceId = Nothing
    , _iitdPlatform = Nothing
    , _iitdDescription = Nothing
    , _iitdVolumes = mempty
    }

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

-- | The instance operating system.
iitdPlatform :: Lens' ImportInstanceTaskDetails (Maybe PlatformValues)
iitdPlatform = lens _iitdPlatform (\ s a -> s{_iitdPlatform = a});

-- | A description of the task.
iitdDescription :: Lens' ImportInstanceTaskDetails (Maybe Text)
iitdDescription = lens _iitdDescription (\ s a -> s{_iitdDescription = a});

-- | One or more volumes.
iitdVolumes :: Lens' ImportInstanceTaskDetails [ImportInstanceVolumeDetailItem]
iitdVolumes = lens _iitdVolumes (\ s a -> s{_iitdVolumes = a}) . _Coerce;

instance FromXML ImportInstanceTaskDetails where
        parseXML x
          = ImportInstanceTaskDetails' <$>
              (x .@? "instanceId") <*> (x .@? "platform") <*>
                (x .@? "description")
                <*>
                (x .@? "volumes" .!@ mempty >>= parseXMLList "item")

instance Hashable ImportInstanceTaskDetails

instance NFData ImportInstanceTaskDetails

-- | Describes an import volume task.
--
-- /See:/ 'importInstanceVolumeDetailItem' smart constructor.
data ImportInstanceVolumeDetailItem = ImportInstanceVolumeDetailItem'
    { _iivdiStatusMessage    :: !(Maybe Text)
    , _iivdiDescription      :: !(Maybe Text)
    , _iivdiBytesConverted   :: !Integer
    , _iivdiAvailabilityZone :: !Text
    , _iivdiImage            :: !DiskImageDescription
    , _iivdiVolume           :: !DiskImageVolumeDescription
    , _iivdiStatus           :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportInstanceVolumeDetailItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iivdiStatusMessage'
--
-- * 'iivdiDescription'
--
-- * 'iivdiBytesConverted'
--
-- * 'iivdiAvailabilityZone'
--
-- * 'iivdiImage'
--
-- * 'iivdiVolume'
--
-- * 'iivdiStatus'
importInstanceVolumeDetailItem
    :: Integer -- ^ 'iivdiBytesConverted'
    -> Text -- ^ 'iivdiAvailabilityZone'
    -> DiskImageDescription -- ^ 'iivdiImage'
    -> DiskImageVolumeDescription -- ^ 'iivdiVolume'
    -> Text -- ^ 'iivdiStatus'
    -> ImportInstanceVolumeDetailItem
importInstanceVolumeDetailItem pBytesConverted_ pAvailabilityZone_ pImage_ pVolume_ pStatus_ =
    ImportInstanceVolumeDetailItem'
    { _iivdiStatusMessage = Nothing
    , _iivdiDescription = Nothing
    , _iivdiBytesConverted = pBytesConverted_
    , _iivdiAvailabilityZone = pAvailabilityZone_
    , _iivdiImage = pImage_
    , _iivdiVolume = pVolume_
    , _iivdiStatus = pStatus_
    }

-- | The status information or errors related to the disk image.
iivdiStatusMessage :: Lens' ImportInstanceVolumeDetailItem (Maybe Text)
iivdiStatusMessage = lens _iivdiStatusMessage (\ s a -> s{_iivdiStatusMessage = a});

-- | A description of the task.
iivdiDescription :: Lens' ImportInstanceVolumeDetailItem (Maybe Text)
iivdiDescription = lens _iivdiDescription (\ s a -> s{_iivdiDescription = a});

-- | The number of bytes converted so far.
iivdiBytesConverted :: Lens' ImportInstanceVolumeDetailItem Integer
iivdiBytesConverted = lens _iivdiBytesConverted (\ s a -> s{_iivdiBytesConverted = a});

-- | The Availability Zone where the resulting instance will reside.
iivdiAvailabilityZone :: Lens' ImportInstanceVolumeDetailItem Text
iivdiAvailabilityZone = lens _iivdiAvailabilityZone (\ s a -> s{_iivdiAvailabilityZone = a});

-- | The image.
iivdiImage :: Lens' ImportInstanceVolumeDetailItem DiskImageDescription
iivdiImage = lens _iivdiImage (\ s a -> s{_iivdiImage = a});

-- | The volume.
iivdiVolume :: Lens' ImportInstanceVolumeDetailItem DiskImageVolumeDescription
iivdiVolume = lens _iivdiVolume (\ s a -> s{_iivdiVolume = a});

-- | The status of the import of this particular disk image.
iivdiStatus :: Lens' ImportInstanceVolumeDetailItem Text
iivdiStatus = lens _iivdiStatus (\ s a -> s{_iivdiStatus = a});

instance FromXML ImportInstanceVolumeDetailItem where
        parseXML x
          = ImportInstanceVolumeDetailItem' <$>
              (x .@? "statusMessage") <*> (x .@? "description") <*>
                (x .@ "bytesConverted")
                <*> (x .@ "availabilityZone")
                <*> (x .@ "image")
                <*> (x .@ "volume")
                <*> (x .@ "status")

instance Hashable ImportInstanceVolumeDetailItem

instance NFData ImportInstanceVolumeDetailItem

-- | Describes an import snapshot task.
--
-- /See:/ 'importSnapshotTask' smart constructor.
data ImportSnapshotTask = ImportSnapshotTask'
    { _istSnapshotTaskDetail :: !(Maybe SnapshotTaskDetail)
    , _istImportTaskId       :: !(Maybe Text)
    , _istDescription        :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportSnapshotTask' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'istSnapshotTaskDetail'
--
-- * 'istImportTaskId'
--
-- * 'istDescription'
importSnapshotTask
    :: ImportSnapshotTask
importSnapshotTask =
    ImportSnapshotTask'
    { _istSnapshotTaskDetail = Nothing
    , _istImportTaskId = Nothing
    , _istDescription = Nothing
    }

-- | Describes an import snapshot task.
istSnapshotTaskDetail :: Lens' ImportSnapshotTask (Maybe SnapshotTaskDetail)
istSnapshotTaskDetail = lens _istSnapshotTaskDetail (\ s a -> s{_istSnapshotTaskDetail = a});

-- | The ID of the import snapshot task.
istImportTaskId :: Lens' ImportSnapshotTask (Maybe Text)
istImportTaskId = lens _istImportTaskId (\ s a -> s{_istImportTaskId = a});

-- | A description of the import snapshot task.
istDescription :: Lens' ImportSnapshotTask (Maybe Text)
istDescription = lens _istDescription (\ s a -> s{_istDescription = a});

instance FromXML ImportSnapshotTask where
        parseXML x
          = ImportSnapshotTask' <$>
              (x .@? "snapshotTaskDetail") <*>
                (x .@? "importTaskId")
                <*> (x .@? "description")

instance Hashable ImportSnapshotTask

instance NFData ImportSnapshotTask

-- | Describes an import volume task.
--
-- /See:/ 'importVolumeTaskDetails' smart constructor.
data ImportVolumeTaskDetails = ImportVolumeTaskDetails'
    { _ivtdDescription      :: !(Maybe Text)
    , _ivtdBytesConverted   :: !Integer
    , _ivtdAvailabilityZone :: !Text
    , _ivtdImage            :: !DiskImageDescription
    , _ivtdVolume           :: !DiskImageVolumeDescription
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportVolumeTaskDetails' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ivtdDescription'
--
-- * 'ivtdBytesConverted'
--
-- * 'ivtdAvailabilityZone'
--
-- * 'ivtdImage'
--
-- * 'ivtdVolume'
importVolumeTaskDetails
    :: Integer -- ^ 'ivtdBytesConverted'
    -> Text -- ^ 'ivtdAvailabilityZone'
    -> DiskImageDescription -- ^ 'ivtdImage'
    -> DiskImageVolumeDescription -- ^ 'ivtdVolume'
    -> ImportVolumeTaskDetails
importVolumeTaskDetails pBytesConverted_ pAvailabilityZone_ pImage_ pVolume_ =
    ImportVolumeTaskDetails'
    { _ivtdDescription = Nothing
    , _ivtdBytesConverted = pBytesConverted_
    , _ivtdAvailabilityZone = pAvailabilityZone_
    , _ivtdImage = pImage_
    , _ivtdVolume = pVolume_
    }

-- | The description you provided when starting the import volume task.
ivtdDescription :: Lens' ImportVolumeTaskDetails (Maybe Text)
ivtdDescription = lens _ivtdDescription (\ s a -> s{_ivtdDescription = a});

-- | The number of bytes converted so far.
ivtdBytesConverted :: Lens' ImportVolumeTaskDetails Integer
ivtdBytesConverted = lens _ivtdBytesConverted (\ s a -> s{_ivtdBytesConverted = a});

-- | The Availability Zone where the resulting volume will reside.
ivtdAvailabilityZone :: Lens' ImportVolumeTaskDetails Text
ivtdAvailabilityZone = lens _ivtdAvailabilityZone (\ s a -> s{_ivtdAvailabilityZone = a});

-- | The image.
ivtdImage :: Lens' ImportVolumeTaskDetails DiskImageDescription
ivtdImage = lens _ivtdImage (\ s a -> s{_ivtdImage = a});

-- | The volume.
ivtdVolume :: Lens' ImportVolumeTaskDetails DiskImageVolumeDescription
ivtdVolume = lens _ivtdVolume (\ s a -> s{_ivtdVolume = a});

instance FromXML ImportVolumeTaskDetails where
        parseXML x
          = ImportVolumeTaskDetails' <$>
              (x .@? "description") <*> (x .@ "bytesConverted") <*>
                (x .@ "availabilityZone")
                <*> (x .@ "image")
                <*> (x .@ "volume")

instance Hashable ImportVolumeTaskDetails

instance NFData ImportVolumeTaskDetails

-- | Describes an instance.
--
-- /See:/ 'instance'' smart constructor.
data Instance = Instance'
    { _insPublicDNSName         :: !(Maybe Text)
    , _insPlatform              :: !(Maybe PlatformValues)
    , _insSecurityGroups        :: !(Maybe [GroupIdentifier])
    , _insClientToken           :: !(Maybe Text)
    , _insSourceDestCheck       :: !(Maybe Bool)
    , _insVPCId                 :: !(Maybe Text)
    , _insKeyName               :: !(Maybe Text)
    , _insNetworkInterfaces     :: !(Maybe [InstanceNetworkInterface])
    , _insRAMDiskId             :: !(Maybe Text)
    , _insSubnetId              :: !(Maybe Text)
    , _insKernelId              :: !(Maybe Text)
    , _insRootDeviceName        :: !(Maybe Text)
    , _insSRIOVNetSupport       :: !(Maybe Text)
    , _insEBSOptimized          :: !(Maybe Bool)
    , _insStateTransitionReason :: !(Maybe Text)
    , _insInstanceLifecycle     :: !(Maybe InstanceLifecycleType)
    , _insIAMInstanceProfile    :: !(Maybe IAMInstanceProfile)
    , _insPrivateIPAddress      :: !(Maybe Text)
    , _insProductCodes          :: !(Maybe [ProductCode])
    , _insSpotInstanceRequestId :: !(Maybe Text)
    , _insPrivateDNSName        :: !(Maybe Text)
    , _insStateReason           :: !(Maybe StateReason)
    , _insBlockDeviceMappings   :: !(Maybe [InstanceBlockDeviceMapping])
    , _insPublicIPAddress       :: !(Maybe Text)
    , _insTags                  :: !(Maybe [Tag])
    , _insInstanceId            :: !Text
    , _insImageId               :: !Text
    , _insAMILaunchIndex        :: !Int
    , _insInstanceType          :: !InstanceType
    , _insLaunchTime            :: !ISO8601
    , _insPlacement             :: !Placement
    , _insMonitoring            :: !Monitoring
    , _insArchitecture          :: !ArchitectureValues
    , _insRootDeviceType        :: !DeviceType
    , _insVirtualizationType    :: !VirtualizationType
    , _insHypervisor            :: !HypervisorType
    , _insState                 :: !InstanceState
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'Instance' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'insPublicDNSName'
--
-- * 'insPlatform'
--
-- * 'insSecurityGroups'
--
-- * 'insClientToken'
--
-- * 'insSourceDestCheck'
--
-- * 'insVPCId'
--
-- * 'insKeyName'
--
-- * 'insNetworkInterfaces'
--
-- * 'insRAMDiskId'
--
-- * 'insSubnetId'
--
-- * 'insKernelId'
--
-- * 'insRootDeviceName'
--
-- * 'insSRIOVNetSupport'
--
-- * 'insEBSOptimized'
--
-- * 'insStateTransitionReason'
--
-- * 'insInstanceLifecycle'
--
-- * 'insIAMInstanceProfile'
--
-- * 'insPrivateIPAddress'
--
-- * 'insProductCodes'
--
-- * 'insSpotInstanceRequestId'
--
-- * 'insPrivateDNSName'
--
-- * 'insStateReason'
--
-- * 'insBlockDeviceMappings'
--
-- * 'insPublicIPAddress'
--
-- * 'insTags'
--
-- * 'insInstanceId'
--
-- * 'insImageId'
--
-- * 'insAMILaunchIndex'
--
-- * 'insInstanceType'
--
-- * 'insLaunchTime'
--
-- * 'insPlacement'
--
-- * 'insMonitoring'
--
-- * 'insArchitecture'
--
-- * 'insRootDeviceType'
--
-- * 'insVirtualizationType'
--
-- * 'insHypervisor'
--
-- * 'insState'
instance'
    :: Text -- ^ 'insInstanceId'
    -> Text -- ^ 'insImageId'
    -> Int -- ^ 'insAMILaunchIndex'
    -> InstanceType -- ^ 'insInstanceType'
    -> UTCTime -- ^ 'insLaunchTime'
    -> Placement -- ^ 'insPlacement'
    -> Monitoring -- ^ 'insMonitoring'
    -> ArchitectureValues -- ^ 'insArchitecture'
    -> DeviceType -- ^ 'insRootDeviceType'
    -> VirtualizationType -- ^ 'insVirtualizationType'
    -> HypervisorType -- ^ 'insHypervisor'
    -> InstanceState -- ^ 'insState'
    -> Instance
instance' pInstanceId_ pImageId_ pAMILaunchIndex_ pInstanceType_ pLaunchTime_ pPlacement_ pMonitoring_ pArchitecture_ pRootDeviceType_ pVirtualizationType_ pHypervisor_ pState_ =
    Instance'
    { _insPublicDNSName = Nothing
    , _insPlatform = Nothing
    , _insSecurityGroups = Nothing
    , _insClientToken = Nothing
    , _insSourceDestCheck = Nothing
    , _insVPCId = Nothing
    , _insKeyName = Nothing
    , _insNetworkInterfaces = Nothing
    , _insRAMDiskId = Nothing
    , _insSubnetId = Nothing
    , _insKernelId = Nothing
    , _insRootDeviceName = Nothing
    , _insSRIOVNetSupport = Nothing
    , _insEBSOptimized = Nothing
    , _insStateTransitionReason = Nothing
    , _insInstanceLifecycle = Nothing
    , _insIAMInstanceProfile = Nothing
    , _insPrivateIPAddress = Nothing
    , _insProductCodes = Nothing
    , _insSpotInstanceRequestId = Nothing
    , _insPrivateDNSName = Nothing
    , _insStateReason = Nothing
    , _insBlockDeviceMappings = Nothing
    , _insPublicIPAddress = Nothing
    , _insTags = Nothing
    , _insInstanceId = pInstanceId_
    , _insImageId = pImageId_
    , _insAMILaunchIndex = pAMILaunchIndex_
    , _insInstanceType = pInstanceType_
    , _insLaunchTime = _Time # pLaunchTime_
    , _insPlacement = pPlacement_
    , _insMonitoring = pMonitoring_
    , _insArchitecture = pArchitecture_
    , _insRootDeviceType = pRootDeviceType_
    , _insVirtualizationType = pVirtualizationType_
    , _insHypervisor = pHypervisor_
    , _insState = pState_
    }

-- | The public DNS name assigned to the instance. This name is not available
-- until the instance enters the 'running' state. For EC2-VPC, this name is
-- only available if you\'ve enabled DNS hostnames for your VPC.
insPublicDNSName :: Lens' Instance (Maybe Text)
insPublicDNSName = lens _insPublicDNSName (\ s a -> s{_insPublicDNSName = a});

-- | The value is 'Windows' for Windows instances; otherwise blank.
insPlatform :: Lens' Instance (Maybe PlatformValues)
insPlatform = lens _insPlatform (\ s a -> s{_insPlatform = a});

-- | One or more security groups for the instance.
insSecurityGroups :: Lens' Instance [GroupIdentifier]
insSecurityGroups = lens _insSecurityGroups (\ s a -> s{_insSecurityGroups = a}) . _Default . _Coerce;

-- | The idempotency token you provided when you launched the instance, if
-- applicable.
insClientToken :: Lens' Instance (Maybe Text)
insClientToken = lens _insClientToken (\ s a -> s{_insClientToken = a});

-- | Specifies whether to enable an instance launched in a VPC to perform
-- NAT. This controls whether source\/destination checking is enabled on
-- the instance. A value of 'true' means checking is enabled, and 'false'
-- means checking is disabled. The value must be 'false' for the instance
-- to perform NAT. For more information, see
-- <http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html NAT Instances>
-- in the /Amazon Virtual Private Cloud User Guide/.
insSourceDestCheck :: Lens' Instance (Maybe Bool)
insSourceDestCheck = lens _insSourceDestCheck (\ s a -> s{_insSourceDestCheck = a});

-- | [EC2-VPC] The ID of the VPC in which the instance is running.
insVPCId :: Lens' Instance (Maybe Text)
insVPCId = lens _insVPCId (\ s a -> s{_insVPCId = a});

-- | The name of the key pair, if this instance was launched with an
-- associated key pair.
insKeyName :: Lens' Instance (Maybe Text)
insKeyName = lens _insKeyName (\ s a -> s{_insKeyName = a});

-- | [EC2-VPC] One or more network interfaces for the instance.
insNetworkInterfaces :: Lens' Instance [InstanceNetworkInterface]
insNetworkInterfaces = lens _insNetworkInterfaces (\ s a -> s{_insNetworkInterfaces = a}) . _Default . _Coerce;

-- | The RAM disk associated with this instance, if applicable.
insRAMDiskId :: Lens' Instance (Maybe Text)
insRAMDiskId = lens _insRAMDiskId (\ s a -> s{_insRAMDiskId = a});

-- | [EC2-VPC] The ID of the subnet in which the instance is running.
insSubnetId :: Lens' Instance (Maybe Text)
insSubnetId = lens _insSubnetId (\ s a -> s{_insSubnetId = a});

-- | The kernel associated with this instance, if applicable.
insKernelId :: Lens' Instance (Maybe Text)
insKernelId = lens _insKernelId (\ s a -> s{_insKernelId = a});

-- | The root device name (for example, '\/dev\/sda1' or '\/dev\/xvda').
insRootDeviceName :: Lens' Instance (Maybe Text)
insRootDeviceName = lens _insRootDeviceName (\ s a -> s{_insRootDeviceName = a});

-- | Specifies whether enhanced networking is enabled.
insSRIOVNetSupport :: Lens' Instance (Maybe Text)
insSRIOVNetSupport = lens _insSRIOVNetSupport (\ s a -> s{_insSRIOVNetSupport = a});

-- | Indicates whether the instance is optimized for EBS I\/O. This
-- optimization provides dedicated throughput to Amazon EBS and an
-- optimized configuration stack to provide optimal I\/O performance. This
-- optimization isn\'t available with all instance types. Additional usage
-- charges apply when using an EBS Optimized instance.
insEBSOptimized :: Lens' Instance (Maybe Bool)
insEBSOptimized = lens _insEBSOptimized (\ s a -> s{_insEBSOptimized = a});

-- | The reason for the most recent state transition. This might be an empty
-- string.
insStateTransitionReason :: Lens' Instance (Maybe Text)
insStateTransitionReason = lens _insStateTransitionReason (\ s a -> s{_insStateTransitionReason = a});

-- | Indicates whether this is a Spot instance or a Scheduled Instance.
insInstanceLifecycle :: Lens' Instance (Maybe InstanceLifecycleType)
insInstanceLifecycle = lens _insInstanceLifecycle (\ s a -> s{_insInstanceLifecycle = a});

-- | The IAM instance profile associated with the instance, if applicable.
insIAMInstanceProfile :: Lens' Instance (Maybe IAMInstanceProfile)
insIAMInstanceProfile = lens _insIAMInstanceProfile (\ s a -> s{_insIAMInstanceProfile = a});

-- | The private IP address assigned to the instance.
insPrivateIPAddress :: Lens' Instance (Maybe Text)
insPrivateIPAddress = lens _insPrivateIPAddress (\ s a -> s{_insPrivateIPAddress = a});

-- | The product codes attached to this instance, if applicable.
insProductCodes :: Lens' Instance [ProductCode]
insProductCodes = lens _insProductCodes (\ s a -> s{_insProductCodes = a}) . _Default . _Coerce;

-- | If the request is a Spot instance request, the ID of the request.
insSpotInstanceRequestId :: Lens' Instance (Maybe Text)
insSpotInstanceRequestId = lens _insSpotInstanceRequestId (\ s a -> s{_insSpotInstanceRequestId = a});

-- | The private DNS name assigned to the instance. This DNS name can only be
-- used inside the Amazon EC2 network. This name is not available until the
-- instance enters the 'running' state. For EC2-VPC, this name is only
-- available if you\'ve enabled DNS hostnames for your VPC.
insPrivateDNSName :: Lens' Instance (Maybe Text)
insPrivateDNSName = lens _insPrivateDNSName (\ s a -> s{_insPrivateDNSName = a});

-- | The reason for the most recent state transition.
insStateReason :: Lens' Instance (Maybe StateReason)
insStateReason = lens _insStateReason (\ s a -> s{_insStateReason = a});

-- | Any block device mapping entries for the instance.
insBlockDeviceMappings :: Lens' Instance [InstanceBlockDeviceMapping]
insBlockDeviceMappings = lens _insBlockDeviceMappings (\ s a -> s{_insBlockDeviceMappings = a}) . _Default . _Coerce;

-- | The public IP address assigned to the instance, if applicable.
insPublicIPAddress :: Lens' Instance (Maybe Text)
insPublicIPAddress = lens _insPublicIPAddress (\ s a -> s{_insPublicIPAddress = a});

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

-- | The ID of the instance.
insInstanceId :: Lens' Instance Text
insInstanceId = lens _insInstanceId (\ s a -> s{_insInstanceId = a});

-- | The ID of the AMI used to launch the instance.
insImageId :: Lens' Instance Text
insImageId = lens _insImageId (\ s a -> s{_insImageId = a});

-- | The AMI launch index, which can be used to find this instance in the
-- launch group.
insAMILaunchIndex :: Lens' Instance Int
insAMILaunchIndex = lens _insAMILaunchIndex (\ s a -> s{_insAMILaunchIndex = a});

-- | The instance type.
insInstanceType :: Lens' Instance InstanceType
insInstanceType = lens _insInstanceType (\ s a -> s{_insInstanceType = a});

-- | The time the instance was launched.
insLaunchTime :: Lens' Instance UTCTime
insLaunchTime = lens _insLaunchTime (\ s a -> s{_insLaunchTime = a}) . _Time;

-- | The location where the instance launched, if applicable.
insPlacement :: Lens' Instance Placement
insPlacement = lens _insPlacement (\ s a -> s{_insPlacement = a});

-- | The monitoring information for the instance.
insMonitoring :: Lens' Instance Monitoring
insMonitoring = lens _insMonitoring (\ s a -> s{_insMonitoring = a});

-- | The architecture of the image.
insArchitecture :: Lens' Instance ArchitectureValues
insArchitecture = lens _insArchitecture (\ s a -> s{_insArchitecture = a});

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

-- | The virtualization type of the instance.
insVirtualizationType :: Lens' Instance VirtualizationType
insVirtualizationType = lens _insVirtualizationType (\ s a -> s{_insVirtualizationType = a});

-- | The hypervisor type of the instance.
insHypervisor :: Lens' Instance HypervisorType
insHypervisor = lens _insHypervisor (\ s a -> s{_insHypervisor = a});

-- | The current state of the instance.
insState :: Lens' Instance InstanceState
insState = lens _insState (\ s a -> s{_insState = a});

instance FromXML Instance where
        parseXML x
          = Instance' <$>
              (x .@? "dnsName") <*> (x .@? "platform") <*>
                (x .@? "groupSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "clientToken")
                <*> (x .@? "sourceDestCheck")
                <*> (x .@? "vpcId")
                <*> (x .@? "keyName")
                <*>
                (x .@? "networkInterfaceSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "ramdiskId")
                <*> (x .@? "subnetId")
                <*> (x .@? "kernelId")
                <*> (x .@? "rootDeviceName")
                <*> (x .@? "sriovNetSupport")
                <*> (x .@? "ebsOptimized")
                <*> (x .@? "reason")
                <*> (x .@? "instanceLifecycle")
                <*> (x .@? "iamInstanceProfile")
                <*> (x .@? "privateIpAddress")
                <*>
                (x .@? "productCodes" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "spotInstanceRequestId")
                <*> (x .@? "privateDnsName")
                <*> (x .@? "stateReason")
                <*>
                (x .@? "blockDeviceMapping" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "ipAddress")
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@ "instanceId")
                <*> (x .@ "imageId")
                <*> (x .@ "amiLaunchIndex")
                <*> (x .@ "instanceType")
                <*> (x .@ "launchTime")
                <*> (x .@ "placement")
                <*> (x .@ "monitoring")
                <*> (x .@ "architecture")
                <*> (x .@ "rootDeviceType")
                <*> (x .@ "virtualizationType")
                <*> (x .@ "hypervisor")
                <*> (x .@ "instanceState")

instance Hashable Instance

instance NFData Instance

-- | Describes a block device mapping.
--
-- /See:/ 'instanceBlockDeviceMapping' smart constructor.
data InstanceBlockDeviceMapping = InstanceBlockDeviceMapping'
    { _ibdmEBS        :: !(Maybe EBSInstanceBlockDevice)
    , _ibdmDeviceName :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceBlockDeviceMapping' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ibdmEBS'
--
-- * 'ibdmDeviceName'
instanceBlockDeviceMapping
    :: InstanceBlockDeviceMapping
instanceBlockDeviceMapping =
    InstanceBlockDeviceMapping'
    { _ibdmEBS = Nothing
    , _ibdmDeviceName = Nothing
    }

-- | Parameters used to automatically set up EBS volumes when the instance is
-- launched.
ibdmEBS :: Lens' InstanceBlockDeviceMapping (Maybe EBSInstanceBlockDevice)
ibdmEBS = lens _ibdmEBS (\ s a -> s{_ibdmEBS = a});

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

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

instance Hashable InstanceBlockDeviceMapping

instance NFData InstanceBlockDeviceMapping

-- | Describes a block device mapping entry.
--
-- /See:/ 'instanceBlockDeviceMappingSpecification' smart constructor.
data InstanceBlockDeviceMappingSpecification = InstanceBlockDeviceMappingSpecification'
    { _ibdmsVirtualName :: !(Maybe Text)
    , _ibdmsNoDevice    :: !(Maybe Text)
    , _ibdmsEBS         :: !(Maybe EBSInstanceBlockDeviceSpecification)
    , _ibdmsDeviceName  :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceBlockDeviceMappingSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ibdmsVirtualName'
--
-- * 'ibdmsNoDevice'
--
-- * 'ibdmsEBS'
--
-- * 'ibdmsDeviceName'
instanceBlockDeviceMappingSpecification
    :: InstanceBlockDeviceMappingSpecification
instanceBlockDeviceMappingSpecification =
    InstanceBlockDeviceMappingSpecification'
    { _ibdmsVirtualName = Nothing
    , _ibdmsNoDevice = Nothing
    , _ibdmsEBS = Nothing
    , _ibdmsDeviceName = Nothing
    }

-- | The virtual device name.
ibdmsVirtualName :: Lens' InstanceBlockDeviceMappingSpecification (Maybe Text)
ibdmsVirtualName = lens _ibdmsVirtualName (\ s a -> s{_ibdmsVirtualName = a});

-- | suppress the specified device included in the block device mapping.
ibdmsNoDevice :: Lens' InstanceBlockDeviceMappingSpecification (Maybe Text)
ibdmsNoDevice = lens _ibdmsNoDevice (\ s a -> s{_ibdmsNoDevice = a});

-- | Parameters used to automatically set up EBS volumes when the instance is
-- launched.
ibdmsEBS :: Lens' InstanceBlockDeviceMappingSpecification (Maybe EBSInstanceBlockDeviceSpecification)
ibdmsEBS = lens _ibdmsEBS (\ s a -> s{_ibdmsEBS = a});

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

instance Hashable
         InstanceBlockDeviceMappingSpecification

instance NFData
         InstanceBlockDeviceMappingSpecification

instance ToQuery
         InstanceBlockDeviceMappingSpecification where
        toQuery InstanceBlockDeviceMappingSpecification'{..}
          = mconcat
              ["VirtualName" =: _ibdmsVirtualName,
               "NoDevice" =: _ibdmsNoDevice, "Ebs" =: _ibdmsEBS,
               "DeviceName" =: _ibdmsDeviceName]

-- | Information about the instance type that the Dedicated host supports.
--
-- /See:/ 'instanceCapacity' smart constructor.
data InstanceCapacity = InstanceCapacity'
    { _icAvailableCapacity :: !(Maybe Int)
    , _icInstanceType      :: !(Maybe Text)
    , _icTotalCapacity     :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceCapacity' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'icAvailableCapacity'
--
-- * 'icInstanceType'
--
-- * 'icTotalCapacity'
instanceCapacity
    :: InstanceCapacity
instanceCapacity =
    InstanceCapacity'
    { _icAvailableCapacity = Nothing
    , _icInstanceType = Nothing
    , _icTotalCapacity = Nothing
    }

-- | The number of instances that can still be launched onto the Dedicated
-- host.
icAvailableCapacity :: Lens' InstanceCapacity (Maybe Int)
icAvailableCapacity = lens _icAvailableCapacity (\ s a -> s{_icAvailableCapacity = a});

-- | The instance type size supported by the Dedicated host.
icInstanceType :: Lens' InstanceCapacity (Maybe Text)
icInstanceType = lens _icInstanceType (\ s a -> s{_icInstanceType = a});

-- | The total number of instances that can be launched onto the Dedicated
-- host.
icTotalCapacity :: Lens' InstanceCapacity (Maybe Int)
icTotalCapacity = lens _icTotalCapacity (\ s a -> s{_icTotalCapacity = a});

instance FromXML InstanceCapacity where
        parseXML x
          = InstanceCapacity' <$>
              (x .@? "availableCapacity") <*>
                (x .@? "instanceType")
                <*> (x .@? "totalCapacity")

instance Hashable InstanceCapacity

instance NFData InstanceCapacity

-- | Describes a Reserved Instance listing state.
--
-- /See:/ 'instanceCount' smart constructor.
data InstanceCount = InstanceCount'
    { _icState         :: !(Maybe ListingState)
    , _icInstanceCount :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceCount' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'icState'
--
-- * 'icInstanceCount'
instanceCount
    :: InstanceCount
instanceCount =
    InstanceCount'
    { _icState = Nothing
    , _icInstanceCount = Nothing
    }

-- | The states of the listed Reserved Instances.
icState :: Lens' InstanceCount (Maybe ListingState)
icState = lens _icState (\ s a -> s{_icState = a});

-- | The number of listed Reserved Instances in the state specified by the
-- 'state'.
icInstanceCount :: Lens' InstanceCount (Maybe Int)
icInstanceCount = lens _icInstanceCount (\ s a -> s{_icInstanceCount = a});

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

instance Hashable InstanceCount

instance NFData InstanceCount

-- | Describes an instance to export.
--
-- /See:/ 'instanceExportDetails' smart constructor.
data InstanceExportDetails = InstanceExportDetails'
    { _iedTargetEnvironment :: !(Maybe ExportEnvironment)
    , _iedInstanceId        :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceExportDetails' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iedTargetEnvironment'
--
-- * 'iedInstanceId'
instanceExportDetails
    :: InstanceExportDetails
instanceExportDetails =
    InstanceExportDetails'
    { _iedTargetEnvironment = Nothing
    , _iedInstanceId = Nothing
    }

-- | The target virtualization environment.
iedTargetEnvironment :: Lens' InstanceExportDetails (Maybe ExportEnvironment)
iedTargetEnvironment = lens _iedTargetEnvironment (\ s a -> s{_iedTargetEnvironment = a});

-- | The ID of the resource being exported.
iedInstanceId :: Lens' InstanceExportDetails (Maybe Text)
iedInstanceId = lens _iedInstanceId (\ s a -> s{_iedInstanceId = a});

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

instance Hashable InstanceExportDetails

instance NFData InstanceExportDetails

-- | Describes the monitoring information of the instance.
--
-- /See:/ 'instanceMonitoring' smart constructor.
data InstanceMonitoring = InstanceMonitoring'
    { _imInstanceId :: !(Maybe Text)
    , _imMonitoring :: !(Maybe Monitoring)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceMonitoring' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'imInstanceId'
--
-- * 'imMonitoring'
instanceMonitoring
    :: InstanceMonitoring
instanceMonitoring =
    InstanceMonitoring'
    { _imInstanceId = Nothing
    , _imMonitoring = Nothing
    }

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

-- | The monitoring information.
imMonitoring :: Lens' InstanceMonitoring (Maybe Monitoring)
imMonitoring = lens _imMonitoring (\ s a -> s{_imMonitoring = a});

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

instance Hashable InstanceMonitoring

instance NFData InstanceMonitoring

-- | Describes a network interface.
--
-- /See:/ 'instanceNetworkInterface' smart constructor.
data InstanceNetworkInterface = InstanceNetworkInterface'
    { _iniGroups             :: !(Maybe [GroupIdentifier])
    , _iniStatus             :: !(Maybe NetworkInterfaceStatus)
    , _iniPrivateIPAddresses :: !(Maybe [InstancePrivateIPAddress])
    , _iniSourceDestCheck    :: !(Maybe Bool)
    , _iniVPCId              :: !(Maybe Text)
    , _iniNetworkInterfaceId :: !(Maybe Text)
    , _iniSubnetId           :: !(Maybe Text)
    , _iniMACAddress         :: !(Maybe Text)
    , _iniAttachment         :: !(Maybe InstanceNetworkInterfaceAttachment)
    , _iniOwnerId            :: !(Maybe Text)
    , _iniPrivateIPAddress   :: !(Maybe Text)
    , _iniPrivateDNSName     :: !(Maybe Text)
    , _iniDescription        :: !(Maybe Text)
    , _iniAssociation        :: !(Maybe InstanceNetworkInterfaceAssociation)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceNetworkInterface' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iniGroups'
--
-- * 'iniStatus'
--
-- * 'iniPrivateIPAddresses'
--
-- * 'iniSourceDestCheck'
--
-- * 'iniVPCId'
--
-- * 'iniNetworkInterfaceId'
--
-- * 'iniSubnetId'
--
-- * 'iniMACAddress'
--
-- * 'iniAttachment'
--
-- * 'iniOwnerId'
--
-- * 'iniPrivateIPAddress'
--
-- * 'iniPrivateDNSName'
--
-- * 'iniDescription'
--
-- * 'iniAssociation'
instanceNetworkInterface
    :: InstanceNetworkInterface
instanceNetworkInterface =
    InstanceNetworkInterface'
    { _iniGroups = Nothing
    , _iniStatus = Nothing
    , _iniPrivateIPAddresses = Nothing
    , _iniSourceDestCheck = Nothing
    , _iniVPCId = Nothing
    , _iniNetworkInterfaceId = Nothing
    , _iniSubnetId = Nothing
    , _iniMACAddress = Nothing
    , _iniAttachment = Nothing
    , _iniOwnerId = Nothing
    , _iniPrivateIPAddress = Nothing
    , _iniPrivateDNSName = Nothing
    , _iniDescription = Nothing
    , _iniAssociation = Nothing
    }

-- | One or more security groups.
iniGroups :: Lens' InstanceNetworkInterface [GroupIdentifier]
iniGroups = lens _iniGroups (\ s a -> s{_iniGroups = a}) . _Default . _Coerce;

-- | The status of the network interface.
iniStatus :: Lens' InstanceNetworkInterface (Maybe NetworkInterfaceStatus)
iniStatus = lens _iniStatus (\ s a -> s{_iniStatus = a});

-- | The private IP addresses associated with the network interface.
iniPrivateIPAddresses :: Lens' InstanceNetworkInterface [InstancePrivateIPAddress]
iniPrivateIPAddresses = lens _iniPrivateIPAddresses (\ s a -> s{_iniPrivateIPAddresses = a}) . _Default . _Coerce;

-- | Indicates whether to validate network traffic to or from this network
-- interface.
iniSourceDestCheck :: Lens' InstanceNetworkInterface (Maybe Bool)
iniSourceDestCheck = lens _iniSourceDestCheck (\ s a -> s{_iniSourceDestCheck = a});

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

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

-- | The ID of the subnet.
iniSubnetId :: Lens' InstanceNetworkInterface (Maybe Text)
iniSubnetId = lens _iniSubnetId (\ s a -> s{_iniSubnetId = a});

-- | The MAC address.
iniMACAddress :: Lens' InstanceNetworkInterface (Maybe Text)
iniMACAddress = lens _iniMACAddress (\ s a -> s{_iniMACAddress = a});

-- | The network interface attachment.
iniAttachment :: Lens' InstanceNetworkInterface (Maybe InstanceNetworkInterfaceAttachment)
iniAttachment = lens _iniAttachment (\ s a -> s{_iniAttachment = a});

-- | The ID of the AWS account that created the network interface.
iniOwnerId :: Lens' InstanceNetworkInterface (Maybe Text)
iniOwnerId = lens _iniOwnerId (\ s a -> s{_iniOwnerId = a});

-- | The IP address of the network interface within the subnet.
iniPrivateIPAddress :: Lens' InstanceNetworkInterface (Maybe Text)
iniPrivateIPAddress = lens _iniPrivateIPAddress (\ s a -> s{_iniPrivateIPAddress = a});

-- | The private DNS name.
iniPrivateDNSName :: Lens' InstanceNetworkInterface (Maybe Text)
iniPrivateDNSName = lens _iniPrivateDNSName (\ s a -> s{_iniPrivateDNSName = a});

-- | The description.
iniDescription :: Lens' InstanceNetworkInterface (Maybe Text)
iniDescription = lens _iniDescription (\ s a -> s{_iniDescription = a});

-- | The association information for an Elastic IP associated with the
-- network interface.
iniAssociation :: Lens' InstanceNetworkInterface (Maybe InstanceNetworkInterfaceAssociation)
iniAssociation = lens _iniAssociation (\ s a -> s{_iniAssociation = a});

instance FromXML InstanceNetworkInterface where
        parseXML x
          = InstanceNetworkInterface' <$>
              (x .@? "groupSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "status")
                <*>
                (x .@? "privateIpAddressesSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "sourceDestCheck")
                <*> (x .@? "vpcId")
                <*> (x .@? "networkInterfaceId")
                <*> (x .@? "subnetId")
                <*> (x .@? "macAddress")
                <*> (x .@? "attachment")
                <*> (x .@? "ownerId")
                <*> (x .@? "privateIpAddress")
                <*> (x .@? "privateDnsName")
                <*> (x .@? "description")
                <*> (x .@? "association")

instance Hashable InstanceNetworkInterface

instance NFData InstanceNetworkInterface

-- | Describes association information for an Elastic IP address.
--
-- /See:/ 'instanceNetworkInterfaceAssociation' smart constructor.
data InstanceNetworkInterfaceAssociation = InstanceNetworkInterfaceAssociation'
    { _iniaPublicDNSName :: !(Maybe Text)
    , _iniaIPOwnerId     :: !(Maybe Text)
    , _iniaPublicIP      :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceNetworkInterfaceAssociation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iniaPublicDNSName'
--
-- * 'iniaIPOwnerId'
--
-- * 'iniaPublicIP'
instanceNetworkInterfaceAssociation
    :: InstanceNetworkInterfaceAssociation
instanceNetworkInterfaceAssociation =
    InstanceNetworkInterfaceAssociation'
    { _iniaPublicDNSName = Nothing
    , _iniaIPOwnerId = Nothing
    , _iniaPublicIP = Nothing
    }

-- | The public DNS name.
iniaPublicDNSName :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
iniaPublicDNSName = lens _iniaPublicDNSName (\ s a -> s{_iniaPublicDNSName = a});

-- | The ID of the owner of the Elastic IP address.
iniaIPOwnerId :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
iniaIPOwnerId = lens _iniaIPOwnerId (\ s a -> s{_iniaIPOwnerId = a});

-- | The public IP address or Elastic IP address bound to the network
-- interface.
iniaPublicIP :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
iniaPublicIP = lens _iniaPublicIP (\ s a -> s{_iniaPublicIP = a});

instance FromXML InstanceNetworkInterfaceAssociation
         where
        parseXML x
          = InstanceNetworkInterfaceAssociation' <$>
              (x .@? "publicDnsName") <*> (x .@? "ipOwnerId") <*>
                (x .@? "publicIp")

instance Hashable InstanceNetworkInterfaceAssociation

instance NFData InstanceNetworkInterfaceAssociation

-- | Describes a network interface attachment.
--
-- /See:/ 'instanceNetworkInterfaceAttachment' smart constructor.
data InstanceNetworkInterfaceAttachment = InstanceNetworkInterfaceAttachment'
    { _iniaStatus              :: !(Maybe AttachmentStatus)
    , _iniaDeleteOnTermination :: !(Maybe Bool)
    , _iniaAttachmentId        :: !(Maybe Text)
    , _iniaAttachTime          :: !(Maybe ISO8601)
    , _iniaDeviceIndex         :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceNetworkInterfaceAttachment' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iniaStatus'
--
-- * 'iniaDeleteOnTermination'
--
-- * 'iniaAttachmentId'
--
-- * 'iniaAttachTime'
--
-- * 'iniaDeviceIndex'
instanceNetworkInterfaceAttachment
    :: InstanceNetworkInterfaceAttachment
instanceNetworkInterfaceAttachment =
    InstanceNetworkInterfaceAttachment'
    { _iniaStatus = Nothing
    , _iniaDeleteOnTermination = Nothing
    , _iniaAttachmentId = Nothing
    , _iniaAttachTime = Nothing
    , _iniaDeviceIndex = Nothing
    }

-- | The attachment state.
iniaStatus :: Lens' InstanceNetworkInterfaceAttachment (Maybe AttachmentStatus)
iniaStatus = lens _iniaStatus (\ s a -> s{_iniaStatus = a});

-- | Indicates whether the network interface is deleted when the instance is
-- terminated.
iniaDeleteOnTermination :: Lens' InstanceNetworkInterfaceAttachment (Maybe Bool)
iniaDeleteOnTermination = lens _iniaDeleteOnTermination (\ s a -> s{_iniaDeleteOnTermination = a});

-- | The ID of the network interface attachment.
iniaAttachmentId :: Lens' InstanceNetworkInterfaceAttachment (Maybe Text)
iniaAttachmentId = lens _iniaAttachmentId (\ s a -> s{_iniaAttachmentId = a});

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

-- | The index of the device on the instance for the network interface
-- attachment.
iniaDeviceIndex :: Lens' InstanceNetworkInterfaceAttachment (Maybe Int)
iniaDeviceIndex = lens _iniaDeviceIndex (\ s a -> s{_iniaDeviceIndex = a});

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

instance Hashable InstanceNetworkInterfaceAttachment

instance NFData InstanceNetworkInterfaceAttachment

-- | Describes a network interface.
--
-- /See:/ 'instanceNetworkInterfaceSpecification' smart constructor.
data InstanceNetworkInterfaceSpecification = InstanceNetworkInterfaceSpecification'
    { _inisGroups                         :: !(Maybe [Text])
    , _inisPrivateIPAddresses             :: !(Maybe [PrivateIPAddressSpecification])
    , _inisDeleteOnTermination            :: !(Maybe Bool)
    , _inisAssociatePublicIPAddress       :: !(Maybe Bool)
    , _inisNetworkInterfaceId             :: !(Maybe Text)
    , _inisSubnetId                       :: !(Maybe Text)
    , _inisPrivateIPAddress               :: !(Maybe Text)
    , _inisSecondaryPrivateIPAddressCount :: !(Maybe Int)
    , _inisDescription                    :: !(Maybe Text)
    , _inisDeviceIndex                    :: !(Maybe Int)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceNetworkInterfaceSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'inisGroups'
--
-- * 'inisPrivateIPAddresses'
--
-- * 'inisDeleteOnTermination'
--
-- * 'inisAssociatePublicIPAddress'
--
-- * 'inisNetworkInterfaceId'
--
-- * 'inisSubnetId'
--
-- * 'inisPrivateIPAddress'
--
-- * 'inisSecondaryPrivateIPAddressCount'
--
-- * 'inisDescription'
--
-- * 'inisDeviceIndex'
instanceNetworkInterfaceSpecification
    :: InstanceNetworkInterfaceSpecification
instanceNetworkInterfaceSpecification =
    InstanceNetworkInterfaceSpecification'
    { _inisGroups = Nothing
    , _inisPrivateIPAddresses = Nothing
    , _inisDeleteOnTermination = Nothing
    , _inisAssociatePublicIPAddress = Nothing
    , _inisNetworkInterfaceId = Nothing
    , _inisSubnetId = Nothing
    , _inisPrivateIPAddress = Nothing
    , _inisSecondaryPrivateIPAddressCount = Nothing
    , _inisDescription = Nothing
    , _inisDeviceIndex = Nothing
    }

-- | The IDs of the security groups for the network interface. Applies only
-- if creating a network interface when launching an instance.
inisGroups :: Lens' InstanceNetworkInterfaceSpecification [Text]
inisGroups = lens _inisGroups (\ s a -> s{_inisGroups = a}) . _Default . _Coerce;

-- | One or more private IP addresses to assign to the network interface.
-- Only one private IP address can be designated as primary.
inisPrivateIPAddresses :: Lens' InstanceNetworkInterfaceSpecification [PrivateIPAddressSpecification]
inisPrivateIPAddresses = lens _inisPrivateIPAddresses (\ s a -> s{_inisPrivateIPAddresses = a}) . _Default . _Coerce;

-- | If set to 'true', the interface is deleted when the instance is
-- terminated. You can specify 'true' only if creating a new network
-- interface when launching an instance.
inisDeleteOnTermination :: Lens' InstanceNetworkInterfaceSpecification (Maybe Bool)
inisDeleteOnTermination = lens _inisDeleteOnTermination (\ s a -> s{_inisDeleteOnTermination = a});

-- | Indicates whether to assign a public IP address to an instance you
-- launch in a VPC. The public IP address can only be assigned to a network
-- interface for eth0, and can only be assigned to a new network interface,
-- not an existing one. You cannot specify more than one network interface
-- in the request. If launching into a default subnet, the default value is
-- 'true'.
inisAssociatePublicIPAddress :: Lens' InstanceNetworkInterfaceSpecification (Maybe Bool)
inisAssociatePublicIPAddress = lens _inisAssociatePublicIPAddress (\ s a -> s{_inisAssociatePublicIPAddress = a});

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

-- | The ID of the subnet associated with the network string. Applies only if
-- creating a network interface when launching an instance.
inisSubnetId :: Lens' InstanceNetworkInterfaceSpecification (Maybe Text)
inisSubnetId = lens _inisSubnetId (\ s a -> s{_inisSubnetId = a});

-- | The private IP address of the network interface. Applies only if
-- creating a network interface when launching an instance.
inisPrivateIPAddress :: Lens' InstanceNetworkInterfaceSpecification (Maybe Text)
inisPrivateIPAddress = lens _inisPrivateIPAddress (\ s a -> s{_inisPrivateIPAddress = a});

-- | The number of secondary private IP addresses. You can\'t specify this
-- option and specify more than one private IP address using the private IP
-- addresses option.
inisSecondaryPrivateIPAddressCount :: Lens' InstanceNetworkInterfaceSpecification (Maybe Int)
inisSecondaryPrivateIPAddressCount = lens _inisSecondaryPrivateIPAddressCount (\ s a -> s{_inisSecondaryPrivateIPAddressCount = a});

-- | The description of the network interface. Applies only if creating a
-- network interface when launching an instance.
inisDescription :: Lens' InstanceNetworkInterfaceSpecification (Maybe Text)
inisDescription = lens _inisDescription (\ s a -> s{_inisDescription = a});

-- | The index of the device on the instance for the network interface
-- attachment. If you are specifying a network interface in a
-- < RunInstances> request, you must provide the device index.
inisDeviceIndex :: Lens' InstanceNetworkInterfaceSpecification (Maybe Int)
inisDeviceIndex = lens _inisDeviceIndex (\ s a -> s{_inisDeviceIndex = a});

instance FromXML
         InstanceNetworkInterfaceSpecification where
        parseXML x
          = InstanceNetworkInterfaceSpecification' <$>
              (x .@? "SecurityGroupId" .!@ mempty >>=
                 may (parseXMLList "SecurityGroupId"))
                <*>
                (x .@? "privateIpAddressesSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "deleteOnTermination")
                <*> (x .@? "associatePublicIpAddress")
                <*> (x .@? "networkInterfaceId")
                <*> (x .@? "subnetId")
                <*> (x .@? "privateIpAddress")
                <*> (x .@? "secondaryPrivateIpAddressCount")
                <*> (x .@? "description")
                <*> (x .@? "deviceIndex")

instance Hashable
         InstanceNetworkInterfaceSpecification

instance NFData InstanceNetworkInterfaceSpecification

instance ToQuery
         InstanceNetworkInterfaceSpecification where
        toQuery InstanceNetworkInterfaceSpecification'{..}
          = mconcat
              [toQuery
                 (toQueryList "SecurityGroupId" <$> _inisGroups),
               toQuery
                 (toQueryList "PrivateIpAddresses" <$>
                    _inisPrivateIPAddresses),
               "DeleteOnTermination" =: _inisDeleteOnTermination,
               "AssociatePublicIpAddress" =:
                 _inisAssociatePublicIPAddress,
               "NetworkInterfaceId" =: _inisNetworkInterfaceId,
               "SubnetId" =: _inisSubnetId,
               "PrivateIpAddress" =: _inisPrivateIPAddress,
               "SecondaryPrivateIpAddressCount" =:
                 _inisSecondaryPrivateIPAddressCount,
               "Description" =: _inisDescription,
               "DeviceIndex" =: _inisDeviceIndex]

-- | Describes a private IP address.
--
-- /See:/ 'instancePrivateIPAddress' smart constructor.
data InstancePrivateIPAddress = InstancePrivateIPAddress'
    { _ipiaPrimary          :: !(Maybe Bool)
    , _ipiaPrivateIPAddress :: !(Maybe Text)
    , _ipiaPrivateDNSName   :: !(Maybe Text)
    , _ipiaAssociation      :: !(Maybe InstanceNetworkInterfaceAssociation)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstancePrivateIPAddress' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ipiaPrimary'
--
-- * 'ipiaPrivateIPAddress'
--
-- * 'ipiaPrivateDNSName'
--
-- * 'ipiaAssociation'
instancePrivateIPAddress
    :: InstancePrivateIPAddress
instancePrivateIPAddress =
    InstancePrivateIPAddress'
    { _ipiaPrimary = Nothing
    , _ipiaPrivateIPAddress = Nothing
    , _ipiaPrivateDNSName = Nothing
    , _ipiaAssociation = Nothing
    }

-- | Indicates whether this IP address is the primary private IP address of
-- the network interface.
ipiaPrimary :: Lens' InstancePrivateIPAddress (Maybe Bool)
ipiaPrimary = lens _ipiaPrimary (\ s a -> s{_ipiaPrimary = a});

-- | The private IP address of the network interface.
ipiaPrivateIPAddress :: Lens' InstancePrivateIPAddress (Maybe Text)
ipiaPrivateIPAddress = lens _ipiaPrivateIPAddress (\ s a -> s{_ipiaPrivateIPAddress = a});

-- | The private DNS name.
ipiaPrivateDNSName :: Lens' InstancePrivateIPAddress (Maybe Text)
ipiaPrivateDNSName = lens _ipiaPrivateDNSName (\ s a -> s{_ipiaPrivateDNSName = a});

-- | The association information for an Elastic IP address for the network
-- interface.
ipiaAssociation :: Lens' InstancePrivateIPAddress (Maybe InstanceNetworkInterfaceAssociation)
ipiaAssociation = lens _ipiaAssociation (\ s a -> s{_ipiaAssociation = a});

instance FromXML InstancePrivateIPAddress where
        parseXML x
          = InstancePrivateIPAddress' <$>
              (x .@? "primary") <*> (x .@? "privateIpAddress") <*>
                (x .@? "privateDnsName")
                <*> (x .@? "association")

instance Hashable InstancePrivateIPAddress

instance NFData InstancePrivateIPAddress

-- | Describes the current state of the instance.
--
-- /See:/ 'instanceState' smart constructor.
data InstanceState = InstanceState'
    { _isName :: !InstanceStateName
    , _isCode :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceState' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'isName'
--
-- * 'isCode'
instanceState
    :: InstanceStateName -- ^ 'isName'
    -> Int -- ^ 'isCode'
    -> InstanceState
instanceState pName_ pCode_ =
    InstanceState'
    { _isName = pName_
    , _isCode = pCode_
    }

-- | The current state of the instance.
isName :: Lens' InstanceState InstanceStateName
isName = lens _isName (\ s a -> s{_isName = a});

-- | The low byte represents the state. The high byte is an opaque internal
-- value and should be ignored.
--
-- -   '0' : 'pending'
--
-- -   '16' : 'running'
--
-- -   '32' : 'shutting-down'
--
-- -   '48' : 'terminated'
--
-- -   '64' : 'stopping'
--
-- -   '80' : 'stopped'
--
isCode :: Lens' InstanceState Int
isCode = lens _isCode (\ s a -> s{_isCode = a});

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

instance Hashable InstanceState

instance NFData InstanceState

-- | Describes an instance state change.
--
-- /See:/ 'instanceStateChange' smart constructor.
data InstanceStateChange = InstanceStateChange'
    { _iscInstanceId    :: !(Maybe Text)
    , _iscCurrentState  :: !(Maybe InstanceState)
    , _iscPreviousState :: !(Maybe InstanceState)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceStateChange' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iscInstanceId'
--
-- * 'iscCurrentState'
--
-- * 'iscPreviousState'
instanceStateChange
    :: InstanceStateChange
instanceStateChange =
    InstanceStateChange'
    { _iscInstanceId = Nothing
    , _iscCurrentState = Nothing
    , _iscPreviousState = Nothing
    }

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

-- | The current state of the instance.
iscCurrentState :: Lens' InstanceStateChange (Maybe InstanceState)
iscCurrentState = lens _iscCurrentState (\ s a -> s{_iscCurrentState = a});

-- | The previous state of the instance.
iscPreviousState :: Lens' InstanceStateChange (Maybe InstanceState)
iscPreviousState = lens _iscPreviousState (\ s a -> s{_iscPreviousState = a});

instance FromXML InstanceStateChange where
        parseXML x
          = InstanceStateChange' <$>
              (x .@? "instanceId") <*> (x .@? "currentState") <*>
                (x .@? "previousState")

instance Hashable InstanceStateChange

instance NFData InstanceStateChange

-- | Describes the status of an instance.
--
-- /See:/ 'instanceStatus' smart constructor.
data InstanceStatus = InstanceStatus'
    { _isInstanceId       :: !(Maybe Text)
    , _isSystemStatus     :: !(Maybe InstanceStatusSummary)
    , _isEvents           :: !(Maybe [InstanceStatusEvent])
    , _isAvailabilityZone :: !(Maybe Text)
    , _isInstanceStatus   :: !(Maybe InstanceStatusSummary)
    , _isInstanceState    :: !(Maybe InstanceState)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'isInstanceId'
--
-- * 'isSystemStatus'
--
-- * 'isEvents'
--
-- * 'isAvailabilityZone'
--
-- * 'isInstanceStatus'
--
-- * 'isInstanceState'
instanceStatus
    :: InstanceStatus
instanceStatus =
    InstanceStatus'
    { _isInstanceId = Nothing
    , _isSystemStatus = Nothing
    , _isEvents = Nothing
    , _isAvailabilityZone = Nothing
    , _isInstanceStatus = Nothing
    , _isInstanceState = Nothing
    }

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

-- | Reports impaired functionality that stems from issues related to the
-- systems that support an instance, such as hardware failures and network
-- connectivity problems.
isSystemStatus :: Lens' InstanceStatus (Maybe InstanceStatusSummary)
isSystemStatus = lens _isSystemStatus (\ s a -> s{_isSystemStatus = a});

-- | Any scheduled events associated with the instance.
isEvents :: Lens' InstanceStatus [InstanceStatusEvent]
isEvents = lens _isEvents (\ s a -> s{_isEvents = a}) . _Default . _Coerce;

-- | The Availability Zone of the instance.
isAvailabilityZone :: Lens' InstanceStatus (Maybe Text)
isAvailabilityZone = lens _isAvailabilityZone (\ s a -> s{_isAvailabilityZone = a});

-- | Reports impaired functionality that stems from issues internal to the
-- instance, such as impaired reachability.
isInstanceStatus :: Lens' InstanceStatus (Maybe InstanceStatusSummary)
isInstanceStatus = lens _isInstanceStatus (\ s a -> s{_isInstanceStatus = a});

-- | The intended state of the instance. < DescribeInstanceStatus> requires
-- that an instance be in the 'running' state.
isInstanceState :: Lens' InstanceStatus (Maybe InstanceState)
isInstanceState = lens _isInstanceState (\ s a -> s{_isInstanceState = a});

instance FromXML InstanceStatus where
        parseXML x
          = InstanceStatus' <$>
              (x .@? "instanceId") <*> (x .@? "systemStatus") <*>
                (x .@? "eventsSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "availabilityZone")
                <*> (x .@? "instanceStatus")
                <*> (x .@? "instanceState")

instance Hashable InstanceStatus

instance NFData InstanceStatus

-- | Describes the instance status.
--
-- /See:/ 'instanceStatusDetails' smart constructor.
data InstanceStatusDetails = InstanceStatusDetails'
    { _isdStatus        :: !(Maybe StatusType)
    , _isdImpairedSince :: !(Maybe ISO8601)
    , _isdName          :: !(Maybe StatusName)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceStatusDetails' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'isdStatus'
--
-- * 'isdImpairedSince'
--
-- * 'isdName'
instanceStatusDetails
    :: InstanceStatusDetails
instanceStatusDetails =
    InstanceStatusDetails'
    { _isdStatus = Nothing
    , _isdImpairedSince = Nothing
    , _isdName = Nothing
    }

-- | The status.
isdStatus :: Lens' InstanceStatusDetails (Maybe StatusType)
isdStatus = lens _isdStatus (\ s a -> s{_isdStatus = a});

-- | The time when a status check failed. For an instance that was launched
-- and impaired, this is the time when the instance was launched.
isdImpairedSince :: Lens' InstanceStatusDetails (Maybe UTCTime)
isdImpairedSince = lens _isdImpairedSince (\ s a -> s{_isdImpairedSince = a}) . mapping _Time;

-- | The type of instance status.
isdName :: Lens' InstanceStatusDetails (Maybe StatusName)
isdName = lens _isdName (\ s a -> s{_isdName = a});

instance FromXML InstanceStatusDetails where
        parseXML x
          = InstanceStatusDetails' <$>
              (x .@? "status") <*> (x .@? "impairedSince") <*>
                (x .@? "name")

instance Hashable InstanceStatusDetails

instance NFData InstanceStatusDetails

-- | Describes a scheduled event for an instance.
--
-- /See:/ 'instanceStatusEvent' smart constructor.
data InstanceStatusEvent = InstanceStatusEvent'
    { _iseNotBefore   :: !(Maybe ISO8601)
    , _iseCode        :: !(Maybe EventCode)
    , _iseDescription :: !(Maybe Text)
    , _iseNotAfter    :: !(Maybe ISO8601)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceStatusEvent' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iseNotBefore'
--
-- * 'iseCode'
--
-- * 'iseDescription'
--
-- * 'iseNotAfter'
instanceStatusEvent
    :: InstanceStatusEvent
instanceStatusEvent =
    InstanceStatusEvent'
    { _iseNotBefore = Nothing
    , _iseCode = Nothing
    , _iseDescription = Nothing
    , _iseNotAfter = Nothing
    }

-- | The earliest scheduled start time for the event.
iseNotBefore :: Lens' InstanceStatusEvent (Maybe UTCTime)
iseNotBefore = lens _iseNotBefore (\ s a -> s{_iseNotBefore = a}) . mapping _Time;

-- | The event code.
iseCode :: Lens' InstanceStatusEvent (Maybe EventCode)
iseCode = lens _iseCode (\ s a -> s{_iseCode = a});

-- | A description of the event.
--
-- After a scheduled event is completed, it can still be described for up
-- to a week. If the event has been completed, this description starts with
-- the following text: [Completed].
iseDescription :: Lens' InstanceStatusEvent (Maybe Text)
iseDescription = lens _iseDescription (\ s a -> s{_iseDescription = a});

-- | The latest scheduled end time for the event.
iseNotAfter :: Lens' InstanceStatusEvent (Maybe UTCTime)
iseNotAfter = lens _iseNotAfter (\ s a -> s{_iseNotAfter = a}) . mapping _Time;

instance FromXML InstanceStatusEvent where
        parseXML x
          = InstanceStatusEvent' <$>
              (x .@? "notBefore") <*> (x .@? "code") <*>
                (x .@? "description")
                <*> (x .@? "notAfter")

instance Hashable InstanceStatusEvent

instance NFData InstanceStatusEvent

-- | Describes the status of an instance.
--
-- /See:/ 'instanceStatusSummary' smart constructor.
data InstanceStatusSummary = InstanceStatusSummary'
    { _issDetails :: !(Maybe [InstanceStatusDetails])
    , _issStatus  :: !SummaryStatus
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InstanceStatusSummary' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'issDetails'
--
-- * 'issStatus'
instanceStatusSummary
    :: SummaryStatus -- ^ 'issStatus'
    -> InstanceStatusSummary
instanceStatusSummary pStatus_ =
    InstanceStatusSummary'
    { _issDetails = Nothing
    , _issStatus = pStatus_
    }

-- | The system instance health or application instance health.
issDetails :: Lens' InstanceStatusSummary [InstanceStatusDetails]
issDetails = lens _issDetails (\ s a -> s{_issDetails = a}) . _Default . _Coerce;

-- | The status.
issStatus :: Lens' InstanceStatusSummary SummaryStatus
issStatus = lens _issStatus (\ s a -> s{_issStatus = a});

instance FromXML InstanceStatusSummary where
        parseXML x
          = InstanceStatusSummary' <$>
              (x .@? "details" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@ "status")

instance Hashable InstanceStatusSummary

instance NFData InstanceStatusSummary

-- | Describes an Internet gateway.
--
-- /See:/ 'internetGateway' smart constructor.
data InternetGateway = InternetGateway'
    { _igAttachments       :: !(Maybe [InternetGatewayAttachment])
    , _igTags              :: !(Maybe [Tag])
    , _igInternetGatewayId :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InternetGateway' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'igAttachments'
--
-- * 'igTags'
--
-- * 'igInternetGatewayId'
internetGateway
    :: Text -- ^ 'igInternetGatewayId'
    -> InternetGateway
internetGateway pInternetGatewayId_ =
    InternetGateway'
    { _igAttachments = Nothing
    , _igTags = Nothing
    , _igInternetGatewayId = pInternetGatewayId_
    }

-- | Any VPCs attached to the Internet gateway.
igAttachments :: Lens' InternetGateway [InternetGatewayAttachment]
igAttachments = lens _igAttachments (\ s a -> s{_igAttachments = a}) . _Default . _Coerce;

-- | Any tags assigned to the Internet gateway.
igTags :: Lens' InternetGateway [Tag]
igTags = lens _igTags (\ s a -> s{_igTags = a}) . _Default . _Coerce;

-- | The ID of the Internet gateway.
igInternetGatewayId :: Lens' InternetGateway Text
igInternetGatewayId = lens _igInternetGatewayId (\ s a -> s{_igInternetGatewayId = a});

instance FromXML InternetGateway where
        parseXML x
          = InternetGateway' <$>
              (x .@? "attachmentSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@ "internetGatewayId")

instance Hashable InternetGateway

instance NFData InternetGateway

-- | Describes the attachment of a VPC to an Internet gateway.
--
-- /See:/ 'internetGatewayAttachment' smart constructor.
data InternetGatewayAttachment = InternetGatewayAttachment'
    { _igaState :: !AttachmentStatus
    , _igaVPCId :: !Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'InternetGatewayAttachment' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'igaState'
--
-- * 'igaVPCId'
internetGatewayAttachment
    :: AttachmentStatus -- ^ 'igaState'
    -> Text -- ^ 'igaVPCId'
    -> InternetGatewayAttachment
internetGatewayAttachment pState_ pVPCId_ =
    InternetGatewayAttachment'
    { _igaState = pState_
    , _igaVPCId = pVPCId_
    }

-- | The current state of the attachment.
igaState :: Lens' InternetGatewayAttachment AttachmentStatus
igaState = lens _igaState (\ s a -> s{_igaState = a});

-- | The ID of the VPC.
igaVPCId :: Lens' InternetGatewayAttachment Text
igaVPCId = lens _igaVPCId (\ s a -> s{_igaVPCId = a});

instance FromXML InternetGatewayAttachment where
        parseXML x
          = InternetGatewayAttachment' <$>
              (x .@ "state") <*> (x .@ "vpcId")

instance Hashable InternetGatewayAttachment

instance NFData InternetGatewayAttachment

-- | Describes a key pair.
--
-- /See:/ 'keyPairInfo' smart constructor.
data KeyPairInfo = KeyPairInfo'
    { _kpiKeyFingerprint :: !(Maybe Text)
    , _kpiKeyName        :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'KeyPairInfo' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'kpiKeyFingerprint'
--
-- * 'kpiKeyName'
keyPairInfo
    :: KeyPairInfo
keyPairInfo =
    KeyPairInfo'
    { _kpiKeyFingerprint = Nothing
    , _kpiKeyName = Nothing
    }

-- | If you used < CreateKeyPair> to create the key pair, this is the SHA-1
-- digest of the DER encoded private key. If you used < ImportKeyPair> to
-- provide AWS the public key, this is the MD5 public key fingerprint as
-- specified in section 4 of RFC4716.
kpiKeyFingerprint :: Lens' KeyPairInfo (Maybe Text)
kpiKeyFingerprint = lens _kpiKeyFingerprint (\ s a -> s{_kpiKeyFingerprint = a});

-- | The name of the key pair.
kpiKeyName :: Lens' KeyPairInfo (Maybe Text)
kpiKeyName = lens _kpiKeyName (\ s a -> s{_kpiKeyName = a});

instance FromXML KeyPairInfo where
        parseXML x
          = KeyPairInfo' <$>
              (x .@? "keyFingerprint") <*> (x .@? "keyName")

instance Hashable KeyPairInfo

instance NFData KeyPairInfo

-- | Describes a launch permission.
--
-- /See:/ 'launchPermission' smart constructor.
data LaunchPermission = LaunchPermission'
    { _lpGroup  :: !(Maybe PermissionGroup)
    , _lpUserId :: !(Maybe Text)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'LaunchPermission' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lpGroup'
--
-- * 'lpUserId'
launchPermission
    :: LaunchPermission
launchPermission =
    LaunchPermission'
    { _lpGroup = Nothing
    , _lpUserId = Nothing
    }

-- | The name of the group.
lpGroup :: Lens' LaunchPermission (Maybe PermissionGroup)
lpGroup = lens _lpGroup (\ s a -> s{_lpGroup = a});

-- | The AWS account ID.
lpUserId :: Lens' LaunchPermission (Maybe Text)
lpUserId = lens _lpUserId (\ s a -> s{_lpUserId = a});

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

instance Hashable LaunchPermission

instance NFData LaunchPermission

instance ToQuery LaunchPermission where
        toQuery LaunchPermission'{..}
          = mconcat
              ["Group" =: _lpGroup, "UserId" =: _lpUserId]

-- | Describes a launch permission modification.
--
-- /See:/ 'launchPermissionModifications' smart constructor.
data LaunchPermissionModifications = LaunchPermissionModifications'
    { _lpmRemove :: !(Maybe [LaunchPermission])
    , _lpmAdd    :: !(Maybe [LaunchPermission])
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'LaunchPermissionModifications' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lpmRemove'
--
-- * 'lpmAdd'
launchPermissionModifications
    :: LaunchPermissionModifications
launchPermissionModifications =
    LaunchPermissionModifications'
    { _lpmRemove = Nothing
    , _lpmAdd = Nothing
    }

-- | The AWS account ID to remove from the list of launch permissions for the
-- AMI.
lpmRemove :: Lens' LaunchPermissionModifications [LaunchPermission]
lpmRemove = lens _lpmRemove (\ s a -> s{_lpmRemove = a}) . _Default . _Coerce;

-- | The AWS account ID to add to the list of launch permissions for the AMI.
lpmAdd :: Lens' LaunchPermissionModifications [LaunchPermission]
lpmAdd = lens _lpmAdd (\ s a -> s{_lpmAdd = a}) . _Default . _Coerce;

instance Hashable LaunchPermissionModifications

instance NFData LaunchPermissionModifications

instance ToQuery LaunchPermissionModifications where
        toQuery LaunchPermissionModifications'{..}
          = mconcat
              [toQuery (toQueryList "Remove" <$> _lpmRemove),
               toQuery (toQueryList "Add" <$> _lpmAdd)]

-- | Describes the launch specification for an instance.
--
-- /See:/ 'launchSpecification' smart constructor.
data LaunchSpecification = LaunchSpecification'
    { _lsSecurityGroups      :: !(Maybe [GroupIdentifier])
    , _lsKeyName             :: !(Maybe Text)
    , _lsNetworkInterfaces   :: !(Maybe [InstanceNetworkInterfaceSpecification])
    , _lsRAMDiskId           :: !(Maybe Text)
    , _lsSubnetId            :: !(Maybe Text)
    , _lsKernelId            :: !(Maybe Text)
    , _lsInstanceType        :: !(Maybe InstanceType)
    , _lsEBSOptimized        :: !(Maybe Bool)
    , _lsUserData            :: !(Maybe Text)
    , _lsMonitoring          :: !(Maybe RunInstancesMonitoringEnabled)
    , _lsIAMInstanceProfile  :: !(Maybe IAMInstanceProfileSpecification)
    , _lsImageId             :: !(Maybe Text)
    , _lsAddressingType      :: !(Maybe Text)
    , _lsBlockDeviceMappings :: !(Maybe [BlockDeviceMapping])
    , _lsPlacement           :: !(Maybe SpotPlacement)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'LaunchSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lsSecurityGroups'
--
-- * 'lsKeyName'
--
-- * 'lsNetworkInterfaces'
--
-- * 'lsRAMDiskId'
--
-- * 'lsSubnetId'
--
-- * 'lsKernelId'
--
-- * 'lsInstanceType'
--
-- * 'lsEBSOptimized'
--
-- * 'lsUserData'
--
-- * 'lsMonitoring'
--
-- * 'lsIAMInstanceProfile'
--
-- * 'lsImageId'
--
-- * 'lsAddressingType'
--
-- * 'lsBlockDeviceMappings'
--
-- * 'lsPlacement'
launchSpecification
    :: LaunchSpecification
launchSpecification =
    LaunchSpecification'
    { _lsSecurityGroups = Nothing
    , _lsKeyName = Nothing
    , _lsNetworkInterfaces = Nothing
    , _lsRAMDiskId = Nothing
    , _lsSubnetId = Nothing
    , _lsKernelId = Nothing
    , _lsInstanceType = Nothing
    , _lsEBSOptimized = Nothing
    , _lsUserData = Nothing
    , _lsMonitoring = Nothing
    , _lsIAMInstanceProfile = Nothing
    , _lsImageId = Nothing
    , _lsAddressingType = Nothing
    , _lsBlockDeviceMappings = Nothing
    , _lsPlacement = Nothing
    }

-- | One or more security groups. When requesting instances in a VPC, you
-- must specify the IDs of the security groups. When requesting instances
-- in EC2-Classic, you can specify the names or the IDs of the security
-- groups.
lsSecurityGroups :: Lens' LaunchSpecification [GroupIdentifier]
lsSecurityGroups = lens _lsSecurityGroups (\ s a -> s{_lsSecurityGroups = a}) . _Default . _Coerce;

-- | The name of the key pair.
lsKeyName :: Lens' LaunchSpecification (Maybe Text)
lsKeyName = lens _lsKeyName (\ s a -> s{_lsKeyName = a});

-- | One or more network interfaces.
lsNetworkInterfaces :: Lens' LaunchSpecification [InstanceNetworkInterfaceSpecification]
lsNetworkInterfaces = lens _lsNetworkInterfaces (\ s a -> s{_lsNetworkInterfaces = a}) . _Default . _Coerce;

-- | The ID of the RAM disk.
lsRAMDiskId :: Lens' LaunchSpecification (Maybe Text)
lsRAMDiskId = lens _lsRAMDiskId (\ s a -> s{_lsRAMDiskId = a});

-- | The ID of the subnet in which to launch the instance.
lsSubnetId :: Lens' LaunchSpecification (Maybe Text)
lsSubnetId = lens _lsSubnetId (\ s a -> s{_lsSubnetId = a});

-- | The ID of the kernel.
lsKernelId :: Lens' LaunchSpecification (Maybe Text)
lsKernelId = lens _lsKernelId (\ s a -> s{_lsKernelId = a});

-- | The instance type.
lsInstanceType :: Lens' LaunchSpecification (Maybe InstanceType)
lsInstanceType = lens _lsInstanceType (\ s a -> s{_lsInstanceType = a});

-- | Indicates whether the instance is optimized for EBS I\/O. This
-- optimization provides dedicated throughput to Amazon EBS and an
-- optimized configuration stack to provide optimal EBS I\/O performance.
-- This optimization isn\'t available with all instance types. Additional
-- usage charges apply when using an EBS Optimized instance.
--
-- Default: 'false'
lsEBSOptimized :: Lens' LaunchSpecification (Maybe Bool)
lsEBSOptimized = lens _lsEBSOptimized (\ s a -> s{_lsEBSOptimized = a});

-- | The Base64-encoded MIME user data to make available to the instances.
lsUserData :: Lens' LaunchSpecification (Maybe Text)
lsUserData = lens _lsUserData (\ s a -> s{_lsUserData = a});

-- | Undocumented member.
lsMonitoring :: Lens' LaunchSpecification (Maybe RunInstancesMonitoringEnabled)
lsMonitoring = lens _lsMonitoring (\ s a -> s{_lsMonitoring = a});

-- | The IAM instance profile.
lsIAMInstanceProfile :: Lens' LaunchSpecification (Maybe IAMInstanceProfileSpecification)
lsIAMInstanceProfile = lens _lsIAMInstanceProfile (\ s a -> s{_lsIAMInstanceProfile = a});

-- | The ID of the AMI.
lsImageId :: Lens' LaunchSpecification (Maybe Text)
lsImageId = lens _lsImageId (\ s a -> s{_lsImageId = a});

-- | Deprecated.
lsAddressingType :: Lens' LaunchSpecification (Maybe Text)
lsAddressingType = lens _lsAddressingType (\ s a -> s{_lsAddressingType = a});

-- | One or more block device mapping entries.
--
-- Although you can specify encrypted EBS volumes in this block device
-- mapping for your Spot Instances, these volumes are not encrypted.
lsBlockDeviceMappings :: Lens' LaunchSpecification [BlockDeviceMapping]
lsBlockDeviceMappings = lens _lsBlockDeviceMappings (\ s a -> s{_lsBlockDeviceMappings = a}) . _Default . _Coerce;

-- | The placement information for the instance.
lsPlacement :: Lens' LaunchSpecification (Maybe SpotPlacement)
lsPlacement = lens _lsPlacement (\ s a -> s{_lsPlacement = a});

instance FromXML LaunchSpecification where
        parseXML x
          = LaunchSpecification' <$>
              (x .@? "groupSet" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "keyName")
                <*>
                (x .@? "networkInterfaceSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*>