{-# 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-2018 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@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' - One or more values for the account attribute.
--
-- * 'aaAttributeName' - The name of the account attribute.
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 where

instance NFData AccountAttribute where

-- | 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' - The value of the attribute.
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 where

instance NFData AccountAttributeValue where

-- | Describes a running instance in a Spot Fleet.
--
--
--
-- /See:/ 'activeInstance' smart constructor.
data ActiveInstance = ActiveInstance'
  { _aiInstanceId            :: !(Maybe Text)
  , _aiInstanceHealth        :: !(Maybe InstanceHealthStatus)
  , _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' - The ID of the instance.
--
-- * 'aiInstanceHealth' - The health status of the instance. If the status of either the instance status check or the system status check is @impaired@ , the health status of the instance is @unhealthy@ . Otherwise, the health status is @healthy@ .
--
-- * 'aiInstanceType' - The instance type.
--
-- * 'aiSpotInstanceRequestId' - The ID of the Spot Instance request.
activeInstance
    :: ActiveInstance
activeInstance =
  ActiveInstance'
    { _aiInstanceId = Nothing
    , _aiInstanceHealth = Nothing
    , _aiInstanceType = Nothing
    , _aiSpotInstanceRequestId = Nothing
    }


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

-- | The health status of the instance. If the status of either the instance status check or the system status check is @impaired@ , the health status of the instance is @unhealthy@ . Otherwise, the health status is @healthy@ .
aiInstanceHealth :: Lens' ActiveInstance (Maybe InstanceHealthStatus)
aiInstanceHealth = lens _aiInstanceHealth (\ s a -> s{_aiInstanceHealth = 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 .@? "instanceHealth") <*>
                (x .@? "instanceType")
                <*> (x .@? "spotInstanceRequestId")

instance Hashable ActiveInstance where

instance NFData ActiveInstance where

-- | 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)
  , _aTags                    :: !(Maybe [Tag])
  } 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' - The ID representing the association of the address with an instance in a VPC.
--
-- * 'aInstanceId' - The ID of the instance that the address is associated with (if any).
--
-- * 'aNetworkInterfaceOwnerId' - The ID of the AWS account that owns the network interface.
--
-- * 'aAllocationId' - The ID representing the allocation of the address for use with EC2-VPC.
--
-- * 'aDomain' - Indicates whether this Elastic IP address is for use with instances in EC2-Classic (@standard@ ) or instances in a VPC (@vpc@ ).
--
-- * 'aNetworkInterfaceId' - The ID of the network interface.
--
-- * 'aPrivateIPAddress' - The private IP address associated with the Elastic IP address.
--
-- * 'aPublicIP' - The Elastic IP address.
--
-- * 'aTags' - Any tags assigned to the Elastic IP address.
address
    :: Address
address =
  Address'
    { _aAssociationId = Nothing
    , _aInstanceId = Nothing
    , _aNetworkInterfaceOwnerId = Nothing
    , _aAllocationId = Nothing
    , _aDomain = Nothing
    , _aNetworkInterfaceId = Nothing
    , _aPrivateIPAddress = Nothing
    , _aPublicIP = Nothing
    , _aTags = 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})

-- | Any tags assigned to the Elastic IP address.
aTags :: Lens' Address [Tag]
aTags = lens _aTags (\ s a -> s{_aTags = a}) . _Default . _Coerce

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

instance Hashable Address where

instance NFData Address where

-- | Describes a principal.
--
--
--
-- /See:/ 'allowedPrincipal' smart constructor.
data AllowedPrincipal = AllowedPrincipal'
  { _apPrincipalType :: !(Maybe PrincipalType)
  , _apPrincipal     :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'AllowedPrincipal' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'apPrincipalType' - The type of principal.
--
-- * 'apPrincipal' - The Amazon Resource Name (ARN) of the principal.
allowedPrincipal
    :: AllowedPrincipal
allowedPrincipal =
  AllowedPrincipal' {_apPrincipalType = Nothing, _apPrincipal = Nothing}


-- | The type of principal.
apPrincipalType :: Lens' AllowedPrincipal (Maybe PrincipalType)
apPrincipalType = lens _apPrincipalType (\ s a -> s{_apPrincipalType = a})

-- | The Amazon Resource Name (ARN) of the principal.
apPrincipal :: Lens' AllowedPrincipal (Maybe Text)
apPrincipal = lens _apPrincipal (\ s a -> s{_apPrincipal = a})

instance FromXML AllowedPrincipal where
        parseXML x
          = AllowedPrincipal' <$>
              (x .@? "principalType") <*> (x .@? "principal")

instance Hashable AllowedPrincipal where

instance NFData AllowedPrincipal where

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


-- | Creates a value of 'AttributeBooleanValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'abvValue' - The attribute value. The valid values are @true@ or @false@ .
attributeBooleanValue
    :: AttributeBooleanValue
attributeBooleanValue = AttributeBooleanValue' {_abvValue = Nothing}


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

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

instance Hashable AttributeBooleanValue where

instance NFData AttributeBooleanValue where

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

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


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


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

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

instance Hashable AttributeValue where

instance NFData AttributeValue where

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' - The state of the Availability Zone.
--
-- * 'azRegionName' - The name of the region.
--
-- * 'azZoneName' - The name of the Availability Zone.
--
-- * 'azMessages' - Any messages about the Availability Zone.
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 where

instance NFData AvailabilityZone where

-- | 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' - The message about the Availability Zone.
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 where

instance NFData AvailabilityZoneMessage where

-- | 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' - The total number of instances that the Dedicated Host supports.
--
-- * 'acAvailableVCPUs' - The number of vCPUs available on the Dedicated Host.
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 where

instance NFData AvailableCapacity where

-- | /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' - Undocumented member.-- /Note:/ This 'Lens' automatically encodes and decodes Base64 data. 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.
blobAttributeValue
    :: BlobAttributeValue
blobAttributeValue = BlobAttributeValue' {_bavValue = Nothing}


-- | Undocumented member.-- /Note:/ This 'Lens' automatically encodes and decodes Base64 data. 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 where

instance NFData BlobAttributeValue where

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' - 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.
--
-- * 'bdmNoDevice' - Suppresses the specified device included in the block device mapping of the AMI.
--
-- * 'bdmEBS' - Parameters used to automatically set up EBS volumes when the instance is launched.
--
-- * 'bdmDeviceName' - The device name (for example, @/dev/sdh@ or @xvdh@ ).
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 (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 where

instance NFData BlockDeviceMapping where

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' - If the task fails, a description of the error.
--
-- * 'btBundleId' - The ID of the bundle task.
--
-- * 'btInstanceId' - The ID of the instance associated with this bundle task.
--
-- * 'btProgress' - The level of task completion, as a percent (for example, 20%).
--
-- * 'btStartTime' - The time this task started.
--
-- * 'btState' - The state of the task.
--
-- * 'btStorage' - The Amazon S3 storage locations.
--
-- * 'btUpdateTime' - The time of the most recent update for the task.
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 where

instance NFData BundleTask where

-- | 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' - The error code.
--
-- * 'bteMessage' - The error message.
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 where

instance NFData BundleTaskError where

-- | The CPU options for the instance.
--
--
--
-- /See:/ 'cpuOptions' smart constructor.
data CPUOptions = CPUOptions'
  { _coCoreCount      :: !(Maybe Int)
  , _coThreadsPerCore :: !(Maybe Int)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'CPUOptions' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'coCoreCount' - The number of CPU cores for the instance.
--
-- * 'coThreadsPerCore' - The number of threads per CPU core.
cpuOptions
    :: CPUOptions
cpuOptions = CPUOptions' {_coCoreCount = Nothing, _coThreadsPerCore = Nothing}


-- | The number of CPU cores for the instance.
coCoreCount :: Lens' CPUOptions (Maybe Int)
coCoreCount = lens _coCoreCount (\ s a -> s{_coCoreCount = a})

-- | The number of threads per CPU core.
coThreadsPerCore :: Lens' CPUOptions (Maybe Int)
coThreadsPerCore = lens _coThreadsPerCore (\ s a -> s{_coThreadsPerCore = a})

instance FromXML CPUOptions where
        parseXML x
          = CPUOptions' <$>
              (x .@? "coreCount") <*> (x .@? "threadsPerCore")

instance Hashable CPUOptions where

instance NFData CPUOptions where

-- | The CPU options for the instance. Both the core count and threads per core must be specified in the request.
--
--
--
-- /See:/ 'cpuOptionsRequest' smart constructor.
data CPUOptionsRequest = CPUOptionsRequest'
  { _corCoreCount      :: !(Maybe Int)
  , _corThreadsPerCore :: !(Maybe Int)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'CPUOptionsRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'corCoreCount' - The number of CPU cores for the instance.
--
-- * 'corThreadsPerCore' - The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of @1@ . Otherwise, specify the default value of @2@ .
cpuOptionsRequest
    :: CPUOptionsRequest
cpuOptionsRequest =
  CPUOptionsRequest' {_corCoreCount = Nothing, _corThreadsPerCore = Nothing}


-- | The number of CPU cores for the instance.
corCoreCount :: Lens' CPUOptionsRequest (Maybe Int)
corCoreCount = lens _corCoreCount (\ s a -> s{_corCoreCount = a})

-- | The number of threads per CPU core. To disable Intel Hyper-Threading Technology for the instance, specify a value of @1@ . Otherwise, specify the default value of @2@ .
corThreadsPerCore :: Lens' CPUOptionsRequest (Maybe Int)
corThreadsPerCore = lens _corThreadsPerCore (\ s a -> s{_corThreadsPerCore = a})

instance Hashable CPUOptionsRequest where

instance NFData CPUOptionsRequest where

instance ToQuery CPUOptionsRequest where
        toQuery CPUOptionsRequest'{..}
          = mconcat
              ["CoreCount" =: _corCoreCount,
               "ThreadsPerCore" =: _corThreadsPerCore]

-- | 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' - The error code.
--
-- * 'csfreMessage' - The description for the error code.
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 where

instance NFData CancelSpotFleetRequestsError where

-- | Describes a Spot Fleet request that was not successfully canceled.
--
--
--
-- /See:/ 'cancelSpotFleetRequestsErrorItem' smart constructor.
data CancelSpotFleetRequestsErrorItem = CancelSpotFleetRequestsErrorItem'
  { _csfreiError              :: !CancelSpotFleetRequestsError
  , _csfreiSpotFleetRequestId :: !Text
  } 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:
--
-- * 'csfreiError' - The error.
--
-- * 'csfreiSpotFleetRequestId' - The ID of the Spot Fleet request.
cancelSpotFleetRequestsErrorItem
    :: CancelSpotFleetRequestsError -- ^ 'csfreiError'
    -> Text -- ^ 'csfreiSpotFleetRequestId'
    -> CancelSpotFleetRequestsErrorItem
cancelSpotFleetRequestsErrorItem pError_ pSpotFleetRequestId_ =
  CancelSpotFleetRequestsErrorItem'
    {_csfreiError = pError_, _csfreiSpotFleetRequestId = pSpotFleetRequestId_}


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

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

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

instance Hashable CancelSpotFleetRequestsErrorItem
         where

instance NFData CancelSpotFleetRequestsErrorItem
         where

-- | Describes a Spot Fleet request that was successfully canceled.
--
--
--
-- /See:/ 'cancelSpotFleetRequestsSuccessItem' smart constructor.
data CancelSpotFleetRequestsSuccessItem = CancelSpotFleetRequestsSuccessItem'
  { _csfrsiCurrentSpotFleetRequestState  :: !BatchState
  , _csfrsiPreviousSpotFleetRequestState :: !BatchState
  , _csfrsiSpotFleetRequestId            :: !Text
  } 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:
--
-- * 'csfrsiCurrentSpotFleetRequestState' - The current state of the Spot Fleet request.
--
-- * 'csfrsiPreviousSpotFleetRequestState' - The previous state of the Spot Fleet request.
--
-- * 'csfrsiSpotFleetRequestId' - The ID of the Spot Fleet request.
cancelSpotFleetRequestsSuccessItem
    :: BatchState -- ^ 'csfrsiCurrentSpotFleetRequestState'
    -> BatchState -- ^ 'csfrsiPreviousSpotFleetRequestState'
    -> Text -- ^ 'csfrsiSpotFleetRequestId'
    -> CancelSpotFleetRequestsSuccessItem
cancelSpotFleetRequestsSuccessItem pCurrentSpotFleetRequestState_ pPreviousSpotFleetRequestState_ pSpotFleetRequestId_ =
  CancelSpotFleetRequestsSuccessItem'
    { _csfrsiCurrentSpotFleetRequestState = pCurrentSpotFleetRequestState_
    , _csfrsiPreviousSpotFleetRequestState = pPreviousSpotFleetRequestState_
    , _csfrsiSpotFleetRequestId = pSpotFleetRequestId_
    }


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

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

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

instance Hashable CancelSpotFleetRequestsSuccessItem
         where

instance NFData CancelSpotFleetRequestsSuccessItem
         where

-- | 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' - The state of the Spot Instance request.
--
-- * 'csirSpotInstanceRequestId' - The ID of the Spot Instance request.
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 where

instance NFData CancelledSpotInstanceRequest where

-- | Describes an IPv4 CIDR block.
--
--
--
-- /See:/ 'cidrBlock' smart constructor.
newtype CidrBlock = CidrBlock'
  { _cbCidrBlock :: Maybe Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'CidrBlock' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cbCidrBlock' - The IPv4 CIDR block.
cidrBlock
    :: CidrBlock
cidrBlock = CidrBlock' {_cbCidrBlock = Nothing}


-- | The IPv4 CIDR block.
cbCidrBlock :: Lens' CidrBlock (Maybe Text)
cbCidrBlock = lens _cbCidrBlock (\ s a -> s{_cbCidrBlock = a})

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

instance Hashable CidrBlock where

instance NFData CidrBlock where

-- | 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' - The ID of the VPC.
--
-- * 'cldsClassicLinkDNSSupported' - Indicates whether ClassicLink DNS support is enabled for the VPC.
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 where

instance NFData ClassicLinkDNSSupport where

-- | 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' - The ID of the instance.
--
-- * 'cliGroups' - A list of security groups.
--
-- * 'cliVPCId' - The ID of the VPC.
--
-- * 'cliTags' - Any tags assigned to the instance.
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 where

instance NFData ClassicLinkInstance where

-- | Describes a Classic Load Balancer.
--
--
--
-- /See:/ 'classicLoadBalancer' smart constructor.
newtype ClassicLoadBalancer = ClassicLoadBalancer'
  { _clbName :: Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ClassicLoadBalancer' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'clbName' - The name of the load balancer.
classicLoadBalancer
    :: Text -- ^ 'clbName'
    -> ClassicLoadBalancer
classicLoadBalancer pName_ = ClassicLoadBalancer' {_clbName = pName_}


-- | The name of the load balancer.
clbName :: Lens' ClassicLoadBalancer Text
clbName = lens _clbName (\ s a -> s{_clbName = a})

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

instance Hashable ClassicLoadBalancer where

instance NFData ClassicLoadBalancer where

instance ToQuery ClassicLoadBalancer where
        toQuery ClassicLoadBalancer'{..}
          = mconcat ["Name" =: _clbName]

-- | Describes the Classic Load Balancers to attach to a Spot Fleet. Spot Fleet registers the running Spot Instances with these Classic Load Balancers.
--
--
--
-- /See:/ 'classicLoadBalancersConfig' smart constructor.
newtype ClassicLoadBalancersConfig = ClassicLoadBalancersConfig'
  { _clbcClassicLoadBalancers :: List1 ClassicLoadBalancer
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ClassicLoadBalancersConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'clbcClassicLoadBalancers' - One or more Classic Load Balancers.
classicLoadBalancersConfig
    :: NonEmpty ClassicLoadBalancer -- ^ 'clbcClassicLoadBalancers'
    -> ClassicLoadBalancersConfig
classicLoadBalancersConfig pClassicLoadBalancers_ =
  ClassicLoadBalancersConfig'
    {_clbcClassicLoadBalancers = _List1 # pClassicLoadBalancers_}


-- | One or more Classic Load Balancers.
clbcClassicLoadBalancers :: Lens' ClassicLoadBalancersConfig (NonEmpty ClassicLoadBalancer)
clbcClassicLoadBalancers = lens _clbcClassicLoadBalancers (\ s a -> s{_clbcClassicLoadBalancers = a}) . _List1

instance FromXML ClassicLoadBalancersConfig where
        parseXML x
          = ClassicLoadBalancersConfig' <$>
              (x .@? "classicLoadBalancers" .!@ mempty >>=
                 parseXMLList1 "item")

instance Hashable ClassicLoadBalancersConfig where

instance NFData ClassicLoadBalancersConfig where

instance ToQuery ClassicLoadBalancersConfig where
        toQuery ClassicLoadBalancersConfig'{..}
          = mconcat
              [toQueryList "ClassicLoadBalancers"
                 _clbcClassicLoadBalancers]

-- | 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' - The time that the disk upload starts.
--
-- * 'cdUploadSize' - The size of the uploaded disk image, in GiB.
--
-- * 'cdUploadEnd' - The time that the disk upload ends.
--
-- * 'cdComment' - A user-defined comment about the disk upload.
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 where

instance NFData ClientData where

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

-- | Describes a connection notification for a VPC endpoint or VPC endpoint service.
--
--
--
-- /See:/ 'connectionNotification' smart constructor.
data ConnectionNotification = ConnectionNotification'
  { _cnConnectionNotificationState :: !(Maybe ConnectionNotificationState)
  , _cnConnectionNotificationType  :: !(Maybe ConnectionNotificationType)
  , _cnConnectionEvents            :: !(Maybe [Text])
  , _cnServiceId                   :: !(Maybe Text)
  , _cnVPCEndpointId               :: !(Maybe Text)
  , _cnConnectionNotificationId    :: !(Maybe Text)
  , _cnConnectionNotificationARN   :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ConnectionNotification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cnConnectionNotificationState' - The state of the notification.
--
-- * 'cnConnectionNotificationType' - The type of notification.
--
-- * 'cnConnectionEvents' - The events for the notification. Valid values are @Accept@ , @Connect@ , @Delete@ , and @Reject@ .
--
-- * 'cnServiceId' - The ID of the endpoint service.
--
-- * 'cnVPCEndpointId' - The ID of the VPC endpoint.
--
-- * 'cnConnectionNotificationId' - The ID of the notification.
--
-- * 'cnConnectionNotificationARN' - The ARN of the SNS topic for the notification.
connectionNotification
    :: ConnectionNotification
connectionNotification =
  ConnectionNotification'
    { _cnConnectionNotificationState = Nothing
    , _cnConnectionNotificationType = Nothing
    , _cnConnectionEvents = Nothing
    , _cnServiceId = Nothing
    , _cnVPCEndpointId = Nothing
    , _cnConnectionNotificationId = Nothing
    , _cnConnectionNotificationARN = Nothing
    }


-- | The state of the notification.
cnConnectionNotificationState :: Lens' ConnectionNotification (Maybe ConnectionNotificationState)
cnConnectionNotificationState = lens _cnConnectionNotificationState (\ s a -> s{_cnConnectionNotificationState = a})

-- | The type of notification.
cnConnectionNotificationType :: Lens' ConnectionNotification (Maybe ConnectionNotificationType)
cnConnectionNotificationType = lens _cnConnectionNotificationType (\ s a -> s{_cnConnectionNotificationType = a})

-- | The events for the notification. Valid values are @Accept@ , @Connect@ , @Delete@ , and @Reject@ .
cnConnectionEvents :: Lens' ConnectionNotification [Text]
cnConnectionEvents = lens _cnConnectionEvents (\ s a -> s{_cnConnectionEvents = a}) . _Default . _Coerce

-- | The ID of the endpoint service.
cnServiceId :: Lens' ConnectionNotification (Maybe Text)
cnServiceId = lens _cnServiceId (\ s a -> s{_cnServiceId = a})

-- | The ID of the VPC endpoint.
cnVPCEndpointId :: Lens' ConnectionNotification (Maybe Text)
cnVPCEndpointId = lens _cnVPCEndpointId (\ s a -> s{_cnVPCEndpointId = a})

-- | The ID of the notification.
cnConnectionNotificationId :: Lens' ConnectionNotification (Maybe Text)
cnConnectionNotificationId = lens _cnConnectionNotificationId (\ s a -> s{_cnConnectionNotificationId = a})

-- | The ARN of the SNS topic for the notification.
cnConnectionNotificationARN :: Lens' ConnectionNotification (Maybe Text)
cnConnectionNotificationARN = lens _cnConnectionNotificationARN (\ s a -> s{_cnConnectionNotificationARN = a})

instance FromXML ConnectionNotification where
        parseXML x
          = ConnectionNotification' <$>
              (x .@? "connectionNotificationState") <*>
                (x .@? "connectionNotificationType")
                <*>
                (x .@? "connectionEvents" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "serviceId")
                <*> (x .@? "vpcEndpointId")
                <*> (x .@? "connectionNotificationId")
                <*> (x .@? "connectionNotificationArn")

instance Hashable ConnectionNotification where

instance NFData ConnectionNotification where

-- | Describes a conversion task.
--
--
--
-- /See:/ 'conversionTask' smart constructor.
data ConversionTask = ConversionTask'
  { _ctImportInstance   :: !(Maybe ImportInstanceTaskDetails)
  , _ctState            :: !(Maybe ConversionTaskState)
  , _ctStatusMessage    :: !(Maybe Text)
  , _ctImportVolume     :: !(Maybe ImportVolumeTaskDetails)
  , _ctConversionTaskId :: !(Maybe Text)
  , _ctExpirationTime   :: !(Maybe Text)
  , _ctTags             :: !(Maybe [Tag])
  } 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' - If the task is for importing an instance, this contains information about the import instance task.
--
-- * 'ctState' - The state of the conversion task.
--
-- * 'ctStatusMessage' - The status message related to the conversion task.
--
-- * 'ctImportVolume' - If the task is for importing a volume, this contains information about the import volume task.
--
-- * 'ctConversionTaskId' - The ID of the conversion task.
--
-- * 'ctExpirationTime' - The time when the task expires. If the upload isn't complete before the expiration time, we automatically cancel the task.
--
-- * 'ctTags' - Any tags assigned to the task.
conversionTask
    :: ConversionTask
conversionTask =
  ConversionTask'
    { _ctImportInstance = Nothing
    , _ctState = Nothing
    , _ctStatusMessage = Nothing
    , _ctImportVolume = Nothing
    , _ctConversionTaskId = Nothing
    , _ctExpirationTime = Nothing
    , _ctTags = Nothing
    }


-- | 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 state of the conversion task.
ctState :: Lens' ConversionTask (Maybe ConversionTaskState)
ctState = lens _ctState (\ s a -> s{_ctState = 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 ID of the conversion task.
ctConversionTaskId :: Lens' ConversionTask (Maybe Text)
ctConversionTaskId = lens _ctConversionTaskId (\ s a -> s{_ctConversionTaskId = 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

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

instance Hashable ConversionTask where

instance NFData ConversionTask where

-- | 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' - The specific group that is to be added or removed from a volume's list of create volume permissions.
--
-- * 'cvpUserId' - The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.
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 where

instance NFData CreateVolumePermission where

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' - Removes a specific AWS account ID or group from a volume's list of create volume permissions.
--
-- * 'cvpmAdd' - Adds a specific AWS account ID or group to a volume's list of create volume permissions.
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
         where

instance NFData CreateVolumePermissionModifications
         where

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

-- | Describes the credit option for CPU usage of a T2 instance.
--
--
--
-- /See:/ 'creditSpecification' smart constructor.
newtype CreditSpecification = CreditSpecification'
  { _csCPUCredits :: Maybe Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'CreditSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'csCPUCredits' - The credit option for CPU usage of a T2 instance.
creditSpecification
    :: CreditSpecification
creditSpecification = CreditSpecification' {_csCPUCredits = Nothing}


-- | The credit option for CPU usage of a T2 instance.
csCPUCredits :: Lens' CreditSpecification (Maybe Text)
csCPUCredits = lens _csCPUCredits (\ s a -> s{_csCPUCredits = a})

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

instance Hashable CreditSpecification where

instance NFData CreditSpecification where

-- | The credit option for CPU usage of a T2 instance.
--
--
--
-- /See:/ 'creditSpecificationRequest' smart constructor.
newtype CreditSpecificationRequest = CreditSpecificationRequest'
  { _csrCPUCredits :: Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'CreditSpecificationRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'csrCPUCredits' - The credit option for CPU usage of a T2 instance. Valid values are @standard@ and @unlimited@ .
creditSpecificationRequest
    :: Text -- ^ 'csrCPUCredits'
    -> CreditSpecificationRequest
creditSpecificationRequest pCPUCredits_ =
  CreditSpecificationRequest' {_csrCPUCredits = pCPUCredits_}


-- | The credit option for CPU usage of a T2 instance. Valid values are @standard@ and @unlimited@ .
csrCPUCredits :: Lens' CreditSpecificationRequest Text
csrCPUCredits = lens _csrCPUCredits (\ s a -> s{_csrCPUCredits = a})

instance Hashable CreditSpecificationRequest where

instance NFData CreditSpecificationRequest where

instance ToQuery CreditSpecificationRequest where
        toQuery CreditSpecificationRequest'{..}
          = mconcat ["CpuCredits" =: _csrCPUCredits]

-- | 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' - Any tags assigned to the customer gateway.
--
-- * 'cgBGPASN' - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
--
-- * 'cgCustomerGatewayId' - The ID of the customer gateway.
--
-- * 'cgIPAddress' - The Internet-routable IP address of the customer gateway's outside interface.
--
-- * 'cgState' - The current state of the customer gateway (@pending | available | deleting | deleted@ ).
--
-- * 'cgType' - The type of VPN connection the customer gateway supports (@ipsec.1@ ).
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 where

instance NFData CustomerGateway where

-- | 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' - One or more values for the DHCP option.
--
-- * 'dcKey' - The name of a DHCP option.
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 where

instance NFData DHCPConfiguration where

-- | 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' - One or more DHCP options in the set.
--
-- * 'doDHCPOptionsId' - The ID of the set of DHCP options.
--
-- * 'doTags' - Any tags assigned to the DHCP options set.
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 where

instance NFData DHCPOptions where

-- | Describes a DNS entry.
--
--
--
-- /See:/ 'dnsEntry' smart constructor.
data DNSEntry = DNSEntry'
  { _deHostedZoneId :: !(Maybe Text)
  , _deDNSName      :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'DNSEntry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'deHostedZoneId' - The ID of the private hosted zone.
--
-- * 'deDNSName' - The DNS name.
dnsEntry
    :: DNSEntry
dnsEntry = DNSEntry' {_deHostedZoneId = Nothing, _deDNSName = Nothing}


-- | The ID of the private hosted zone.
deHostedZoneId :: Lens' DNSEntry (Maybe Text)
deHostedZoneId = lens _deHostedZoneId (\ s a -> s{_deHostedZoneId = a})

-- | The DNS name.
deDNSName :: Lens' DNSEntry (Maybe Text)
deDNSName = lens _deDNSName (\ s a -> s{_deDNSName = a})

instance FromXML DNSEntry where
        parseXML x
          = DNSEntry' <$>
              (x .@? "hostedZoneId") <*> (x .@? "dnsName")

instance Hashable DNSEntry where

instance NFData DNSEntry where

-- | Describes an EC2 Fleet error.
--
--
--
-- /See:/ 'deleteFleetError' smart constructor.
data DeleteFleetError = DeleteFleetError'
  { _dfeCode    :: !(Maybe DeleteFleetErrorCode)
  , _dfeMessage :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'DeleteFleetError' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dfeCode' - The error code.
--
-- * 'dfeMessage' - The description for the error code.
deleteFleetError
    :: DeleteFleetError
deleteFleetError = DeleteFleetError' {_dfeCode = Nothing, _dfeMessage = Nothing}


-- | The error code.
dfeCode :: Lens' DeleteFleetError (Maybe DeleteFleetErrorCode)
dfeCode = lens _dfeCode (\ s a -> s{_dfeCode = a})

-- | The description for the error code.
dfeMessage :: Lens' DeleteFleetError (Maybe Text)
dfeMessage = lens _dfeMessage (\ s a -> s{_dfeMessage = a})

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

instance Hashable DeleteFleetError where

instance NFData DeleteFleetError where

-- | Describes an EC2 Fleet that was not successfully deleted.
--
--
--
-- /See:/ 'deleteFleetErrorItem' smart constructor.
data DeleteFleetErrorItem = DeleteFleetErrorItem'
  { _dfeiError   :: !(Maybe DeleteFleetError)
  , _dfeiFleetId :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'DeleteFleetErrorItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dfeiError' - The error.
--
-- * 'dfeiFleetId' - The ID of the EC2 Fleet.
deleteFleetErrorItem
    :: DeleteFleetErrorItem
deleteFleetErrorItem =
  DeleteFleetErrorItem' {_dfeiError = Nothing, _dfeiFleetId = Nothing}


-- | The error.
dfeiError :: Lens' DeleteFleetErrorItem (Maybe DeleteFleetError)
dfeiError = lens _dfeiError (\ s a -> s{_dfeiError = a})

-- | The ID of the EC2 Fleet.
dfeiFleetId :: Lens' DeleteFleetErrorItem (Maybe Text)
dfeiFleetId = lens _dfeiFleetId (\ s a -> s{_dfeiFleetId = a})

instance FromXML DeleteFleetErrorItem where
        parseXML x
          = DeleteFleetErrorItem' <$>
              (x .@? "error") <*> (x .@? "fleetId")

instance Hashable DeleteFleetErrorItem where

instance NFData DeleteFleetErrorItem where

-- | Describes an EC2 Fleet that was successfully deleted.
--
--
--
-- /See:/ 'deleteFleetSuccessItem' smart constructor.
data DeleteFleetSuccessItem = DeleteFleetSuccessItem'
  { _dfsiCurrentFleetState  :: !(Maybe FleetStateCode)
  , _dfsiPreviousFleetState :: !(Maybe FleetStateCode)
  , _dfsiFleetId            :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'DeleteFleetSuccessItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dfsiCurrentFleetState' - The current state of the EC2 Fleet.
--
-- * 'dfsiPreviousFleetState' - The previous state of the EC2 Fleet.
--
-- * 'dfsiFleetId' - The ID of the EC2 Fleet.
deleteFleetSuccessItem
    :: DeleteFleetSuccessItem
deleteFleetSuccessItem =
  DeleteFleetSuccessItem'
    { _dfsiCurrentFleetState = Nothing
    , _dfsiPreviousFleetState = Nothing
    , _dfsiFleetId = Nothing
    }


-- | The current state of the EC2 Fleet.
dfsiCurrentFleetState :: Lens' DeleteFleetSuccessItem (Maybe FleetStateCode)
dfsiCurrentFleetState = lens _dfsiCurrentFleetState (\ s a -> s{_dfsiCurrentFleetState = a})

-- | The previous state of the EC2 Fleet.
dfsiPreviousFleetState :: Lens' DeleteFleetSuccessItem (Maybe FleetStateCode)
dfsiPreviousFleetState = lens _dfsiPreviousFleetState (\ s a -> s{_dfsiPreviousFleetState = a})

-- | The ID of the EC2 Fleet.
dfsiFleetId :: Lens' DeleteFleetSuccessItem (Maybe Text)
dfsiFleetId = lens _dfsiFleetId (\ s a -> s{_dfsiFleetId = a})

instance FromXML DeleteFleetSuccessItem where
        parseXML x
          = DeleteFleetSuccessItem' <$>
              (x .@? "currentFleetState") <*>
                (x .@? "previousFleetState")
                <*> (x .@? "fleetId")

instance Hashable DeleteFleetSuccessItem where

instance NFData DeleteFleetSuccessItem where

-- | Describes a launch template version that could not be deleted.
--
--
--
-- /See:/ 'deleteLaunchTemplateVersionsResponseErrorItem' smart constructor.
data DeleteLaunchTemplateVersionsResponseErrorItem = DeleteLaunchTemplateVersionsResponseErrorItem'
  { _dltvreiLaunchTemplateName :: !(Maybe Text)
  , _dltvreiLaunchTemplateId   :: !(Maybe Text)
  , _dltvreiVersionNumber      :: !(Maybe Integer)
  , _dltvreiResponseError      :: !(Maybe ResponseError)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'DeleteLaunchTemplateVersionsResponseErrorItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dltvreiLaunchTemplateName' - The name of the launch template.
--
-- * 'dltvreiLaunchTemplateId' - The ID of the launch template.
--
-- * 'dltvreiVersionNumber' - The version number of the launch template.
--
-- * 'dltvreiResponseError' - Information about the error.
deleteLaunchTemplateVersionsResponseErrorItem
    :: DeleteLaunchTemplateVersionsResponseErrorItem
deleteLaunchTemplateVersionsResponseErrorItem =
  DeleteLaunchTemplateVersionsResponseErrorItem'
    { _dltvreiLaunchTemplateName = Nothing
    , _dltvreiLaunchTemplateId = Nothing
    , _dltvreiVersionNumber = Nothing
    , _dltvreiResponseError = Nothing
    }


-- | The name of the launch template.
dltvreiLaunchTemplateName :: Lens' DeleteLaunchTemplateVersionsResponseErrorItem (Maybe Text)
dltvreiLaunchTemplateName = lens _dltvreiLaunchTemplateName (\ s a -> s{_dltvreiLaunchTemplateName = a})

-- | The ID of the launch template.
dltvreiLaunchTemplateId :: Lens' DeleteLaunchTemplateVersionsResponseErrorItem (Maybe Text)
dltvreiLaunchTemplateId = lens _dltvreiLaunchTemplateId (\ s a -> s{_dltvreiLaunchTemplateId = a})

-- | The version number of the launch template.
dltvreiVersionNumber :: Lens' DeleteLaunchTemplateVersionsResponseErrorItem (Maybe Integer)
dltvreiVersionNumber = lens _dltvreiVersionNumber (\ s a -> s{_dltvreiVersionNumber = a})

-- | Information about the error.
dltvreiResponseError :: Lens' DeleteLaunchTemplateVersionsResponseErrorItem (Maybe ResponseError)
dltvreiResponseError = lens _dltvreiResponseError (\ s a -> s{_dltvreiResponseError = a})

instance FromXML
           DeleteLaunchTemplateVersionsResponseErrorItem
         where
        parseXML x
          = DeleteLaunchTemplateVersionsResponseErrorItem' <$>
              (x .@? "launchTemplateName") <*>
                (x .@? "launchTemplateId")
                <*> (x .@? "versionNumber")
                <*> (x .@? "responseError")

instance Hashable
           DeleteLaunchTemplateVersionsResponseErrorItem
         where

instance NFData
           DeleteLaunchTemplateVersionsResponseErrorItem
         where

-- | Describes a launch template version that was successfully deleted.
--
--
--
-- /See:/ 'deleteLaunchTemplateVersionsResponseSuccessItem' smart constructor.
data DeleteLaunchTemplateVersionsResponseSuccessItem = DeleteLaunchTemplateVersionsResponseSuccessItem'
  { _dltvrsiLaunchTemplateName :: !(Maybe Text)
  , _dltvrsiLaunchTemplateId   :: !(Maybe Text)
  , _dltvrsiVersionNumber      :: !(Maybe Integer)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'DeleteLaunchTemplateVersionsResponseSuccessItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dltvrsiLaunchTemplateName' - The name of the launch template.
--
-- * 'dltvrsiLaunchTemplateId' - The ID of the launch template.
--
-- * 'dltvrsiVersionNumber' - The version number of the launch template.
deleteLaunchTemplateVersionsResponseSuccessItem
    :: DeleteLaunchTemplateVersionsResponseSuccessItem
deleteLaunchTemplateVersionsResponseSuccessItem =
  DeleteLaunchTemplateVersionsResponseSuccessItem'
    { _dltvrsiLaunchTemplateName = Nothing
    , _dltvrsiLaunchTemplateId = Nothing
    , _dltvrsiVersionNumber = Nothing
    }


-- | The name of the launch template.
dltvrsiLaunchTemplateName :: Lens' DeleteLaunchTemplateVersionsResponseSuccessItem (Maybe Text)
dltvrsiLaunchTemplateName = lens _dltvrsiLaunchTemplateName (\ s a -> s{_dltvrsiLaunchTemplateName = a})

-- | The ID of the launch template.
dltvrsiLaunchTemplateId :: Lens' DeleteLaunchTemplateVersionsResponseSuccessItem (Maybe Text)
dltvrsiLaunchTemplateId = lens _dltvrsiLaunchTemplateId (\ s a -> s{_dltvrsiLaunchTemplateId = a})

-- | The version number of the launch template.
dltvrsiVersionNumber :: Lens' DeleteLaunchTemplateVersionsResponseSuccessItem (Maybe Integer)
dltvrsiVersionNumber = lens _dltvrsiVersionNumber (\ s a -> s{_dltvrsiVersionNumber = a})

instance FromXML
           DeleteLaunchTemplateVersionsResponseSuccessItem
         where
        parseXML x
          = DeleteLaunchTemplateVersionsResponseSuccessItem'
              <$>
              (x .@? "launchTemplateName") <*>
                (x .@? "launchTemplateId")
                <*> (x .@? "versionNumber")

instance Hashable
           DeleteLaunchTemplateVersionsResponseSuccessItem
         where

instance NFData
           DeleteLaunchTemplateVersionsResponseSuccessItem
         where

-- | 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' - Information about the disk image.
--
-- * 'diVolume' - Information about the volume.
--
-- * 'diDescription' - A description of the disk image.
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 where

instance NFData DiskImage where

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

-- | Describes a disk image.
--
--
--
-- /See:/ 'diskImageDescription' smart constructor.
data DiskImageDescription = DiskImageDescription'
  { _dSize              :: !(Maybe Integer)
  , _dChecksum          :: !(Maybe Text)
  , _dFormat            :: !(Maybe DiskImageFormat)
  , _dImportManifestURL :: !(Maybe 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:
--
-- * 'dSize' - The size of the disk image, in GiB.
--
-- * 'dChecksum' - The checksum computed for the disk image.
--
-- * 'dFormat' - The disk image format.
--
-- * 'dImportManifestURL' - 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> .
diskImageDescription
    :: DiskImageDescription
diskImageDescription =
  DiskImageDescription'
    { _dSize = Nothing
    , _dChecksum = Nothing
    , _dFormat = Nothing
    , _dImportManifestURL = Nothing
    }


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

-- | 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 (Maybe DiskImageFormat)
dFormat = lens _dFormat (\ s a -> s{_dFormat = 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 (Maybe Text)
dImportManifestURL = lens _dImportManifestURL (\ s a -> s{_dImportManifestURL = a})

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

instance Hashable DiskImageDescription where

instance NFData DiskImageDescription where

-- | Describes a disk image.
--
--
--
-- /See:/ 'diskImageDetail' smart constructor.
data DiskImageDetail = DiskImageDetail'
  { _didBytes             :: !Integer
  , _didFormat            :: !DiskImageFormat
  , _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:
--
-- * 'didBytes' - The size of the disk image, in GiB.
--
-- * 'didFormat' - The disk image format.
--
-- * 'didImportManifestURL' - 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> .
diskImageDetail
    :: Integer -- ^ 'didBytes'
    -> DiskImageFormat -- ^ 'didFormat'
    -> Text -- ^ 'didImportManifestURL'
    -> DiskImageDetail
diskImageDetail pBytes_ pFormat_ pImportManifestURL_ =
  DiskImageDetail'
    { _didBytes = pBytes_
    , _didFormat = pFormat_
    , _didImportManifestURL = pImportManifestURL_
    }


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

-- | The disk image format.
didFormat :: Lens' DiskImageDetail DiskImageFormat
didFormat = lens _didFormat (\ s a -> s{_didFormat = 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 where

instance NFData DiskImageDetail where

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

-- | Describes a disk image volume.
--
--
--
-- /See:/ 'diskImageVolumeDescription' smart constructor.
data DiskImageVolumeDescription = DiskImageVolumeDescription'
  { _divdSize :: !(Maybe Integer)
  , _divdId   :: !(Maybe 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' - The size of the volume, in GiB.
--
-- * 'divdId' - The volume identifier.
diskImageVolumeDescription
    :: DiskImageVolumeDescription
diskImageVolumeDescription =
  DiskImageVolumeDescription' {_divdSize = Nothing, _divdId = Nothing}


-- | 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 (Maybe Text)
divdId = lens _divdId (\ s a -> s{_divdId = a})

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

instance Hashable DiskImageVolumeDescription where

instance NFData DiskImageVolumeDescription where

-- | 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)
  , _ebdKMSKeyId            :: !(Maybe Text)
  , _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' - Indicates whether the EBS volume is deleted on instance termination.
--
-- * 'ebdVolumeSize' - 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.
--
-- * 'ebdIOPS' - The number of I/O operations per second (IOPS) that the volume supports. For @io1@ , this represents the number of IOPS that are provisioned for the volume. For @gp2@ , this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html Amazon EBS Volume Types> in the /Amazon Elastic Compute Cloud User Guide/ . Constraint: Range is 100-20000 IOPS for @io1@ volumes and 100-10000 IOPS for @gp2@ volumes. Condition: This parameter is required for requests to create @io1@ volumes; it is not used in requests to create @gp2@ , @st1@ , @sc1@ , or @standard@ volumes.
--
-- * 'ebdEncrypted' - Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.
--
-- * 'ebdKMSKeyId' - Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK under which the EBS volume is encrypted. Note: This parameter is only supported on @BlockDeviceMapping@ objects called by <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html RunInstances> , <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html RequestSpotFleet> , and <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html RequestSpotInstances> .
--
-- * 'ebdVolumeType' - The volume type: @gp2@ , @io1@ , @st1@ , @sc1@ , or @standard@ . Default: @standard@
--
-- * 'ebdSnapshotId' - The ID of the snapshot.
ebsBlockDevice
    :: EBSBlockDevice
ebsBlockDevice =
  EBSBlockDevice'
    { _ebdDeleteOnTermination = Nothing
    , _ebdVolumeSize = Nothing
    , _ebdIOPS = Nothing
    , _ebdEncrypted = Nothing
    , _ebdKMSKeyId = Nothing
    , _ebdVolumeType = Nothing
    , _ebdSnapshotId = Nothing
    }


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

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

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

-- | Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.
ebdEncrypted :: Lens' EBSBlockDevice (Maybe Bool)
ebdEncrypted = lens _ebdEncrypted (\ s a -> s{_ebdEncrypted = a})

-- | Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK under which the EBS volume is encrypted. Note: This parameter is only supported on @BlockDeviceMapping@ objects called by <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html RunInstances> , <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html RequestSpotFleet> , and <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html RequestSpotInstances> .
ebdKMSKeyId :: Lens' EBSBlockDevice (Maybe Text)
ebdKMSKeyId = lens _ebdKMSKeyId (\ s a -> s{_ebdKMSKeyId = 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 .@? "KmsKeyId")
                <*> (x .@? "volumeType")
                <*> (x .@? "snapshotId")

instance Hashable EBSBlockDevice where

instance NFData EBSBlockDevice where

instance ToQuery EBSBlockDevice where
        toQuery EBSBlockDevice'{..}
          = mconcat
              ["DeleteOnTermination" =: _ebdDeleteOnTermination,
               "VolumeSize" =: _ebdVolumeSize, "Iops" =: _ebdIOPS,
               "Encrypted" =: _ebdEncrypted,
               "KmsKeyId" =: _ebdKMSKeyId,
               "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' - The attachment state.
--
-- * 'eibdDeleteOnTermination' - Indicates whether the volume is deleted on instance termination.
--
-- * 'eibdVolumeId' - The ID of the EBS volume.
--
-- * 'eibdAttachTime' - The time stamp when the attachment initiated.
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 where

instance NFData EBSInstanceBlockDevice where

-- | 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' - Indicates whether the volume is deleted on instance termination.
--
-- * 'eibdsVolumeId' - The ID of the EBS volume.
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
         where

instance NFData EBSInstanceBlockDeviceSpecification
         where

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

-- | Describes an egress-only Internet gateway.
--
--
--
-- /See:/ 'egressOnlyInternetGateway' smart constructor.
data EgressOnlyInternetGateway = EgressOnlyInternetGateway'
  { _eoigEgressOnlyInternetGatewayId :: !(Maybe Text)
  , _eoigAttachments                 :: !(Maybe [InternetGatewayAttachment])
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'EgressOnlyInternetGateway' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eoigEgressOnlyInternetGatewayId' - The ID of the egress-only Internet gateway.
--
-- * 'eoigAttachments' - Information about the attachment of the egress-only Internet gateway.
egressOnlyInternetGateway
    :: EgressOnlyInternetGateway
egressOnlyInternetGateway =
  EgressOnlyInternetGateway'
    {_eoigEgressOnlyInternetGatewayId = Nothing, _eoigAttachments = Nothing}


-- | The ID of the egress-only Internet gateway.
eoigEgressOnlyInternetGatewayId :: Lens' EgressOnlyInternetGateway (Maybe Text)
eoigEgressOnlyInternetGatewayId = lens _eoigEgressOnlyInternetGatewayId (\ s a -> s{_eoigEgressOnlyInternetGatewayId = a})

-- | Information about the attachment of the egress-only Internet gateway.
eoigAttachments :: Lens' EgressOnlyInternetGateway [InternetGatewayAttachment]
eoigAttachments = lens _eoigAttachments (\ s a -> s{_eoigAttachments = a}) . _Default . _Coerce

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

instance Hashable EgressOnlyInternetGateway where

instance NFData EgressOnlyInternetGateway where

-- | Describes the association between an instance and an Elastic GPU.
--
--
--
-- /See:/ 'elasticGpuAssociation' smart constructor.
data ElasticGpuAssociation = ElasticGpuAssociation'
  { _egaElasticGpuId               :: !(Maybe Text)
  , _egaElasticGpuAssociationId    :: !(Maybe Text)
  , _egaElasticGpuAssociationTime  :: !(Maybe Text)
  , _egaElasticGpuAssociationState :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ElasticGpuAssociation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'egaElasticGpuId' - The ID of the Elastic GPU.
--
-- * 'egaElasticGpuAssociationId' - The ID of the association.
--
-- * 'egaElasticGpuAssociationTime' - The time the Elastic GPU was associated with the instance.
--
-- * 'egaElasticGpuAssociationState' - The state of the association between the instance and the Elastic GPU.
elasticGpuAssociation
    :: ElasticGpuAssociation
elasticGpuAssociation =
  ElasticGpuAssociation'
    { _egaElasticGpuId = Nothing
    , _egaElasticGpuAssociationId = Nothing
    , _egaElasticGpuAssociationTime = Nothing
    , _egaElasticGpuAssociationState = Nothing
    }


-- | The ID of the Elastic GPU.
egaElasticGpuId :: Lens' ElasticGpuAssociation (Maybe Text)
egaElasticGpuId = lens _egaElasticGpuId (\ s a -> s{_egaElasticGpuId = a})

-- | The ID of the association.
egaElasticGpuAssociationId :: Lens' ElasticGpuAssociation (Maybe Text)
egaElasticGpuAssociationId = lens _egaElasticGpuAssociationId (\ s a -> s{_egaElasticGpuAssociationId = a})

-- | The time the Elastic GPU was associated with the instance.
egaElasticGpuAssociationTime :: Lens' ElasticGpuAssociation (Maybe Text)
egaElasticGpuAssociationTime = lens _egaElasticGpuAssociationTime (\ s a -> s{_egaElasticGpuAssociationTime = a})

-- | The state of the association between the instance and the Elastic GPU.
egaElasticGpuAssociationState :: Lens' ElasticGpuAssociation (Maybe Text)
egaElasticGpuAssociationState = lens _egaElasticGpuAssociationState (\ s a -> s{_egaElasticGpuAssociationState = a})

instance FromXML ElasticGpuAssociation where
        parseXML x
          = ElasticGpuAssociation' <$>
              (x .@? "elasticGpuId") <*>
                (x .@? "elasticGpuAssociationId")
                <*> (x .@? "elasticGpuAssociationTime")
                <*> (x .@? "elasticGpuAssociationState")

instance Hashable ElasticGpuAssociation where

instance NFData ElasticGpuAssociation where

-- | Describes the status of an Elastic GPU.
--
--
--
-- /See:/ 'elasticGpuHealth' smart constructor.
newtype ElasticGpuHealth = ElasticGpuHealth'
  { _eghStatus :: Maybe ElasticGpuStatus
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ElasticGpuHealth' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eghStatus' - The health status.
elasticGpuHealth
    :: ElasticGpuHealth
elasticGpuHealth = ElasticGpuHealth' {_eghStatus = Nothing}


-- | The health status.
eghStatus :: Lens' ElasticGpuHealth (Maybe ElasticGpuStatus)
eghStatus = lens _eghStatus (\ s a -> s{_eghStatus = a})

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

instance Hashable ElasticGpuHealth where

instance NFData ElasticGpuHealth where

-- | A specification for an Elastic GPU.
--
--
--
-- /See:/ 'elasticGpuSpecification' smart constructor.
newtype ElasticGpuSpecification = ElasticGpuSpecification'
  { _egsType :: Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ElasticGpuSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'egsType' - The type of Elastic GPU.
elasticGpuSpecification
    :: Text -- ^ 'egsType'
    -> ElasticGpuSpecification
elasticGpuSpecification pType_ = ElasticGpuSpecification' {_egsType = pType_}


-- | The type of Elastic GPU.
egsType :: Lens' ElasticGpuSpecification Text
egsType = lens _egsType (\ s a -> s{_egsType = a})

instance Hashable ElasticGpuSpecification where

instance NFData ElasticGpuSpecification where

instance ToQuery ElasticGpuSpecification where
        toQuery ElasticGpuSpecification'{..}
          = mconcat ["Type" =: _egsType]

-- | Describes an elastic GPU.
--
--
--
-- /See:/ 'elasticGpuSpecificationResponse' smart constructor.
newtype ElasticGpuSpecificationResponse = ElasticGpuSpecificationResponse'
  { _eType :: Maybe Text
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ElasticGpuSpecificationResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'eType' - The elastic GPU type.
elasticGpuSpecificationResponse
    :: ElasticGpuSpecificationResponse
elasticGpuSpecificationResponse =
  ElasticGpuSpecificationResponse' {_eType = Nothing}


-- | The elastic GPU type.
eType :: Lens' ElasticGpuSpecificationResponse (Maybe Text)
eType = lens _eType (\ s a -> s{_eType = a})

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

instance Hashable ElasticGpuSpecificationResponse
         where

instance NFData ElasticGpuSpecificationResponse where

-- | Describes an Elastic GPU.
--
--
--
-- /See:/ 'elasticGpus' smart constructor.
data ElasticGpus = ElasticGpus'
  { _egInstanceId       :: !(Maybe Text)
  , _egElasticGpuType   :: !(Maybe Text)
  , _egElasticGpuId     :: !(Maybe Text)
  , _egElasticGpuState  :: !(Maybe ElasticGpuState)
  , _egElasticGpuHealth :: !(Maybe ElasticGpuHealth)
  , _egAvailabilityZone :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'ElasticGpus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'egInstanceId' - The ID of the instance to which the Elastic GPU is attached.
--
-- * 'egElasticGpuType' - The type of Elastic GPU.
--
-- * 'egElasticGpuId' - The ID of the Elastic GPU.
--
-- * 'egElasticGpuState' - The state of the Elastic GPU.
--
-- * 'egElasticGpuHealth' - The status of the Elastic GPU.
--
-- * 'egAvailabilityZone' - The Availability Zone in the which the Elastic GPU resides.
elasticGpus
    :: ElasticGpus
elasticGpus =
  ElasticGpus'
    { _egInstanceId = Nothing
    , _egElasticGpuType = Nothing
    , _egElasticGpuId = Nothing
    , _egElasticGpuState = Nothing
    , _egElasticGpuHealth = Nothing
    , _egAvailabilityZone = Nothing
    }


-- | The ID of the instance to which the Elastic GPU is attached.
egInstanceId :: Lens' ElasticGpus (Maybe Text)
egInstanceId = lens _egInstanceId (\ s a -> s{_egInstanceId = a})

-- | The type of Elastic GPU.
egElasticGpuType :: Lens' ElasticGpus (Maybe Text)
egElasticGpuType = lens _egElasticGpuType (\ s a -> s{_egElasticGpuType = a})

-- | The ID of the Elastic GPU.
egElasticGpuId :: Lens' ElasticGpus (Maybe Text)
egElasticGpuId = lens _egElasticGpuId (\ s a -> s{_egElasticGpuId = a})

-- | The state of the Elastic GPU.
egElasticGpuState :: Lens' ElasticGpus (Maybe ElasticGpuState)
egElasticGpuState = lens _egElasticGpuState (\ s a -> s{_egElasticGpuState = a})

-- | The status of the Elastic GPU.
egElasticGpuHealth :: Lens' ElasticGpus (Maybe ElasticGpuHealth)
egElasticGpuHealth = lens _egElasticGpuHealth (\ s a -> s{_egElasticGpuHealth = a})

-- | The Availability Zone in the which the Elastic GPU resides.
egAvailabilityZone :: Lens' ElasticGpus (Maybe Text)
egAvailabilityZone = lens _egAvailabilityZone (\ s a -> s{_egAvailabilityZone = a})

instance FromXML ElasticGpus where
        parseXML x
          = ElasticGpus' <$>
              (x .@? "instanceId") <*> (x .@? "elasticGpuType") <*>
                (x .@? "elasticGpuId")
                <*> (x .@? "elasticGpuState")
                <*> (x .@? "elasticGpuHealth")
                <*> (x .@? "availabilityZone")

instance Hashable ElasticGpus where

instance NFData ElasticGpus where

-- | 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' - The ID of the instance. This information is available only for @instanceChange@ events.
--
-- * 'eiEventDescription' - The description of the event.
--
-- * 'eiEventSubType' - 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 does not launch additional Spot Instances. 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 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 request was fulfilled and a new instance was launched.     * @terminated@ - An instance was terminated by the user. The following are the @Information@ events:     * @launchSpecUnusable@ - The price in a launch specification is not valid because it is below the Spot price or the Spot price is above the On-Demand price.     * @fleetProgressHalted@ - The price in every launch specification is not valid. A launch specification might become valid if the Spot price changes.
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 does not launch additional Spot Instances. 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 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 request was fulfilled and a new instance was launched.     * @terminated@ - An instance was terminated by the user. The following are the @Information@ events:     * @launchSpecUnusable@ - The price in a launch specification is not valid because it is below the Spot price or the Spot price is above the On-Demand price.     * @fleetProgressHalted@ - The price in every launch specification is not valid. A launch specification might become valid if the Spot price changes.
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 where

instance NFData EventInformation where

-- | 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' - A description of the resource being exported.
--
-- * 'etExportTaskId' - The ID of the export task.
--
-- * 'etExportToS3Task' - Information about the export task.
--
-- * 'etInstanceExportDetails' - Information about the instance to export.
--
-- * 'etState' - The state of the export task.
--
-- * 'etStatusMessage' - The status message related to the export task.
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 where

instance NFData ExportTask where

-- | 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' - The encryption key for your S3 bucket.
--
-- * 'etstContainerFormat' - The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
--
-- * 'etstS3Bucket' - 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@ .
--
-- * 'etstDiskImageFormat' - The format for the exported image.
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 where

instance NFData ExportToS3Task where

-- | 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' - The container format used to combine disk images with metadata (such as OVF). If absent, only the disk image is exported.
--
-- * 'etstsS3Prefix' - The image is written to a single object in the S3 bucket at the S3 key s3prefix + exportTaskId + '.' + diskImageFormat.
--
-- * 'etstsS3Bucket' - 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@ .
--
-- * 'etstsDiskImageFormat' - The format for the exported image.
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 where

instance NFData ExportToS3TaskSpecification where

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 from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:
--
--
--     * 'DescribeAvailabilityZones'
--
--     * 'DescribeImages'
--
--     * 'DescribeInstances'
--
--     * 'DescribeKeyPairs'
--
--     * 'DescribeSecurityGroups'
--
--     * 'DescribeSnapshots'
--
--     * 'DescribeSubnets'
--
--     * 'DescribeTags'
--
--     * 'DescribeVolumes'
--
--     * 'DescribeVpcs'
--
--
--
--
-- /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' - One or more filter values. Filter values are case-sensitive.
--
-- * 'fName' - The name of the filter. Filter names are case-sensitive.
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 where

instance NFData Filter where

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

-- | Describes an EC2 Fleet.
--
--
--
-- /See:/ 'fleetData' smart constructor.
data FleetData = FleetData'
  { _fdClientToken :: !(Maybe Text)
  , _fdTargetCapacitySpecification :: !(Maybe TargetCapacitySpecification)
  , _fdSpotOptions :: !(Maybe SpotOptions)
  , _fdExcessCapacityTerminationPolicy :: !(Maybe FleetExcessCapacityTerminationPolicy)
  , _fdFleetState :: !(Maybe FleetStateCode)
  , _fdLaunchTemplateConfigs :: !(Maybe [FleetLaunchTemplateConfig])
  , _fdValidUntil :: !(Maybe ISO8601)
  , _fdTerminateInstancesWithExpiration :: !(Maybe Bool)
  , _fdFulfilledCapacity :: !(Maybe Double)
  , _fdType :: !(Maybe FleetType)
  , _fdValidFrom :: !(Maybe ISO8601)
  , _fdReplaceUnhealthyInstances :: !(Maybe Bool)
  , _fdFulfilledOnDemandCapacity :: !(Maybe Double)
  , _fdFleetId :: !(Maybe Text)
  , _fdCreateTime :: !(Maybe ISO8601)
  , _fdTags :: !(Maybe [Tag])
  , _fdActivityStatus :: !(Maybe FleetActivityStatus)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetData' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fdClientToken' - Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring Idempotency> . Constraints: Maximum 64 ASCII characters
--
-- * 'fdTargetCapacitySpecification' - The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is @maintain@ , you can specify a target capacity of 0 and add capacity later.
--
-- * 'fdSpotOptions' - The configuration of Spot Instances in an EC2 Fleet.
--
-- * 'fdExcessCapacityTerminationPolicy' - Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.
--
-- * 'fdFleetState' - The state of the EC2 Fleet.
--
-- * 'fdLaunchTemplateConfigs' - The launch template and overrides.
--
-- * 'fdValidUntil' - The end date and time of the request, in UTC format (for example, /YYYY/ -/MM/ -/DD/ T/HH/ :/MM/ :/SS/ Z). At this point, no new instance requests are placed or able to fulfill the request. The default end date is 7 days from the current date.
--
-- * 'fdTerminateInstancesWithExpiration' - Indicates whether running instances should be terminated when the EC2 Fleet expires.
--
-- * 'fdFulfilledCapacity' - The number of units fulfilled by this request compared to the set target capacity.
--
-- * 'fdType' - The type of request. Indicates whether the EC2 Fleet only @requests@ the target capacity, or also attempts to @maintain@ it. If you request a certain target capacity, EC2 Fleet only places the required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically replenishes any interrupted Spot Instances. Default: @maintain@ .
--
-- * 'fdValidFrom' - The start date and time of the request, in UTC format (for example, /YYYY/ -/MM/ -/DD/ T/HH/ :/MM/ :/SS/ Z). The default is to start fulfilling the request immediately.
--
-- * 'fdReplaceUnhealthyInstances' - Indicates whether EC2 Fleet should replace unhealthy instances.
--
-- * 'fdFulfilledOnDemandCapacity' - The number of units fulfilled by this request compared to the set target On-Demand capacity.
--
-- * 'fdFleetId' - The ID of the EC2 Fleet.
--
-- * 'fdCreateTime' - The creation date and time of the EC2 Fleet.
--
-- * 'fdTags' - The tags for an EC2 Fleet resource.
--
-- * 'fdActivityStatus' - The progress of the EC2 Fleet. If there is an error, the status is @error@ . After all requests are placed, the status is @pending_fulfillment@ . If the size of the EC2 Fleet is equal to or greater than its target capacity, the status is @fulfilled@ . If the size of the EC2 Fleet is decreased, the status is @pending_termination@ while instances are terminating.
fleetData
    :: FleetData
fleetData =
  FleetData'
    { _fdClientToken = Nothing
    , _fdTargetCapacitySpecification = Nothing
    , _fdSpotOptions = Nothing
    , _fdExcessCapacityTerminationPolicy = Nothing
    , _fdFleetState = Nothing
    , _fdLaunchTemplateConfigs = Nothing
    , _fdValidUntil = Nothing
    , _fdTerminateInstancesWithExpiration = Nothing
    , _fdFulfilledCapacity = Nothing
    , _fdType = Nothing
    , _fdValidFrom = Nothing
    , _fdReplaceUnhealthyInstances = Nothing
    , _fdFulfilledOnDemandCapacity = Nothing
    , _fdFleetId = Nothing
    , _fdCreateTime = Nothing
    , _fdTags = Nothing
    , _fdActivityStatus = Nothing
    }


-- | Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring Idempotency> . Constraints: Maximum 64 ASCII characters
fdClientToken :: Lens' FleetData (Maybe Text)
fdClientToken = lens _fdClientToken (\ s a -> s{_fdClientToken = a})

-- | The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is @maintain@ , you can specify a target capacity of 0 and add capacity later.
fdTargetCapacitySpecification :: Lens' FleetData (Maybe TargetCapacitySpecification)
fdTargetCapacitySpecification = lens _fdTargetCapacitySpecification (\ s a -> s{_fdTargetCapacitySpecification = a})

-- | The configuration of Spot Instances in an EC2 Fleet.
fdSpotOptions :: Lens' FleetData (Maybe SpotOptions)
fdSpotOptions = lens _fdSpotOptions (\ s a -> s{_fdSpotOptions = a})

-- | Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.
fdExcessCapacityTerminationPolicy :: Lens' FleetData (Maybe FleetExcessCapacityTerminationPolicy)
fdExcessCapacityTerminationPolicy = lens _fdExcessCapacityTerminationPolicy (\ s a -> s{_fdExcessCapacityTerminationPolicy = a})

-- | The state of the EC2 Fleet.
fdFleetState :: Lens' FleetData (Maybe FleetStateCode)
fdFleetState = lens _fdFleetState (\ s a -> s{_fdFleetState = a})

-- | The launch template and overrides.
fdLaunchTemplateConfigs :: Lens' FleetData [FleetLaunchTemplateConfig]
fdLaunchTemplateConfigs = lens _fdLaunchTemplateConfigs (\ s a -> s{_fdLaunchTemplateConfigs = a}) . _Default . _Coerce

-- | The end date and time of the request, in UTC format (for example, /YYYY/ -/MM/ -/DD/ T/HH/ :/MM/ :/SS/ Z). At this point, no new instance requests are placed or able to fulfill the request. The default end date is 7 days from the current date.
fdValidUntil :: Lens' FleetData (Maybe UTCTime)
fdValidUntil = lens _fdValidUntil (\ s a -> s{_fdValidUntil = a}) . mapping _Time

-- | Indicates whether running instances should be terminated when the EC2 Fleet expires.
fdTerminateInstancesWithExpiration :: Lens' FleetData (Maybe Bool)
fdTerminateInstancesWithExpiration = lens _fdTerminateInstancesWithExpiration (\ s a -> s{_fdTerminateInstancesWithExpiration = a})

-- | The number of units fulfilled by this request compared to the set target capacity.
fdFulfilledCapacity :: Lens' FleetData (Maybe Double)
fdFulfilledCapacity = lens _fdFulfilledCapacity (\ s a -> s{_fdFulfilledCapacity = a})

-- | The type of request. Indicates whether the EC2 Fleet only @requests@ the target capacity, or also attempts to @maintain@ it. If you request a certain target capacity, EC2 Fleet only places the required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically replenishes any interrupted Spot Instances. Default: @maintain@ .
fdType :: Lens' FleetData (Maybe FleetType)
fdType = lens _fdType (\ s a -> s{_fdType = a})

-- | The start date and time of the request, in UTC format (for example, /YYYY/ -/MM/ -/DD/ T/HH/ :/MM/ :/SS/ Z). The default is to start fulfilling the request immediately.
fdValidFrom :: Lens' FleetData (Maybe UTCTime)
fdValidFrom = lens _fdValidFrom (\ s a -> s{_fdValidFrom = a}) . mapping _Time

-- | Indicates whether EC2 Fleet should replace unhealthy instances.
fdReplaceUnhealthyInstances :: Lens' FleetData (Maybe Bool)
fdReplaceUnhealthyInstances = lens _fdReplaceUnhealthyInstances (\ s a -> s{_fdReplaceUnhealthyInstances = a})

-- | The number of units fulfilled by this request compared to the set target On-Demand capacity.
fdFulfilledOnDemandCapacity :: Lens' FleetData (Maybe Double)
fdFulfilledOnDemandCapacity = lens _fdFulfilledOnDemandCapacity (\ s a -> s{_fdFulfilledOnDemandCapacity = a})

-- | The ID of the EC2 Fleet.
fdFleetId :: Lens' FleetData (Maybe Text)
fdFleetId = lens _fdFleetId (\ s a -> s{_fdFleetId = a})

-- | The creation date and time of the EC2 Fleet.
fdCreateTime :: Lens' FleetData (Maybe UTCTime)
fdCreateTime = lens _fdCreateTime (\ s a -> s{_fdCreateTime = a}) . mapping _Time

-- | The tags for an EC2 Fleet resource.
fdTags :: Lens' FleetData [Tag]
fdTags = lens _fdTags (\ s a -> s{_fdTags = a}) . _Default . _Coerce

-- | The progress of the EC2 Fleet. If there is an error, the status is @error@ . After all requests are placed, the status is @pending_fulfillment@ . If the size of the EC2 Fleet is equal to or greater than its target capacity, the status is @fulfilled@ . If the size of the EC2 Fleet is decreased, the status is @pending_termination@ while instances are terminating.
fdActivityStatus :: Lens' FleetData (Maybe FleetActivityStatus)
fdActivityStatus = lens _fdActivityStatus (\ s a -> s{_fdActivityStatus = a})

instance FromXML FleetData where
        parseXML x
          = FleetData' <$>
              (x .@? "clientToken") <*>
                (x .@? "targetCapacitySpecification")
                <*> (x .@? "spotOptions")
                <*> (x .@? "excessCapacityTerminationPolicy")
                <*> (x .@? "fleetState")
                <*>
                (x .@? "launchTemplateConfigs" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "validUntil")
                <*> (x .@? "terminateInstancesWithExpiration")
                <*> (x .@? "fulfilledCapacity")
                <*> (x .@? "type")
                <*> (x .@? "validFrom")
                <*> (x .@? "replaceUnhealthyInstances")
                <*> (x .@? "fulfilledOnDemandCapacity")
                <*> (x .@? "fleetId")
                <*> (x .@? "createTime")
                <*>
                (x .@? "tagSet" .!@ mempty >>=
                   may (parseXMLList "item"))
                <*> (x .@? "activityStatus")

instance Hashable FleetData where

instance NFData FleetData where

-- | Describes a launch template and overrides.
--
--
--
-- /See:/ 'fleetLaunchTemplateConfig' smart constructor.
data FleetLaunchTemplateConfig = FleetLaunchTemplateConfig'
  { _fltcOverrides :: !(Maybe [FleetLaunchTemplateOverrides])
  , _fltcLaunchTemplateSpecification :: !(Maybe FleetLaunchTemplateSpecification)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetLaunchTemplateConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fltcOverrides' - Any parameters that you specify override the same parameters in the launch template.
--
-- * 'fltcLaunchTemplateSpecification' - The launch template.
fleetLaunchTemplateConfig
    :: FleetLaunchTemplateConfig
fleetLaunchTemplateConfig =
  FleetLaunchTemplateConfig'
    {_fltcOverrides = Nothing, _fltcLaunchTemplateSpecification = Nothing}


-- | Any parameters that you specify override the same parameters in the launch template.
fltcOverrides :: Lens' FleetLaunchTemplateConfig [FleetLaunchTemplateOverrides]
fltcOverrides = lens _fltcOverrides (\ s a -> s{_fltcOverrides = a}) . _Default . _Coerce

-- | The launch template.
fltcLaunchTemplateSpecification :: Lens' FleetLaunchTemplateConfig (Maybe FleetLaunchTemplateSpecification)
fltcLaunchTemplateSpecification = lens _fltcLaunchTemplateSpecification (\ s a -> s{_fltcLaunchTemplateSpecification = a})

instance FromXML FleetLaunchTemplateConfig where
        parseXML x
          = FleetLaunchTemplateConfig' <$>
              (x .@? "overrides" .!@ mempty >>=
                 may (parseXMLList "item"))
                <*> (x .@? "launchTemplateSpecification")

instance Hashable FleetLaunchTemplateConfig where

instance NFData FleetLaunchTemplateConfig where

-- | Describes a launch template and overrides.
--
--
--
-- /See:/ 'fleetLaunchTemplateConfigRequest' smart constructor.
data FleetLaunchTemplateConfigRequest = FleetLaunchTemplateConfigRequest'
  { _fltcrOverrides :: !(Maybe [FleetLaunchTemplateOverridesRequest])
  , _fltcrLaunchTemplateSpecification :: !(Maybe FleetLaunchTemplateSpecificationRequest)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetLaunchTemplateConfigRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fltcrOverrides' - Any parameters that you specify override the same parameters in the launch template.
--
-- * 'fltcrLaunchTemplateSpecification' - The launch template to use. You must specify either the launch template ID or launch template name in the request.
fleetLaunchTemplateConfigRequest
    :: FleetLaunchTemplateConfigRequest
fleetLaunchTemplateConfigRequest =
  FleetLaunchTemplateConfigRequest'
    {_fltcrOverrides = Nothing, _fltcrLaunchTemplateSpecification = Nothing}


-- | Any parameters that you specify override the same parameters in the launch template.
fltcrOverrides :: Lens' FleetLaunchTemplateConfigRequest [FleetLaunchTemplateOverridesRequest]
fltcrOverrides = lens _fltcrOverrides (\ s a -> s{_fltcrOverrides = a}) . _Default . _Coerce

-- | The launch template to use. You must specify either the launch template ID or launch template name in the request.
fltcrLaunchTemplateSpecification :: Lens' FleetLaunchTemplateConfigRequest (Maybe FleetLaunchTemplateSpecificationRequest)
fltcrLaunchTemplateSpecification = lens _fltcrLaunchTemplateSpecification (\ s a -> s{_fltcrLaunchTemplateSpecification = a})

instance Hashable FleetLaunchTemplateConfigRequest
         where

instance NFData FleetLaunchTemplateConfigRequest
         where

instance ToQuery FleetLaunchTemplateConfigRequest
         where
        toQuery FleetLaunchTemplateConfigRequest'{..}
          = mconcat
              [toQuery
                 (toQueryList "Overrides" <$> _fltcrOverrides),
               "LaunchTemplateSpecification" =:
                 _fltcrLaunchTemplateSpecification]

-- | Describes overrides for a launch template.
--
--
--
-- /See:/ 'fleetLaunchTemplateOverrides' smart constructor.
data FleetLaunchTemplateOverrides = FleetLaunchTemplateOverrides'
  { _fltoWeightedCapacity :: !(Maybe Double)
  , _fltoSubnetId         :: !(Maybe Text)
  , _fltoInstanceType     :: !(Maybe InstanceType)
  , _fltoAvailabilityZone :: !(Maybe Text)
  , _fltoMaxPrice         :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetLaunchTemplateOverrides' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fltoWeightedCapacity' - The number of units provided by the specified instance type.
--
-- * 'fltoSubnetId' - The ID of the subnet in which to launch the instances.
--
-- * 'fltoInstanceType' - The instance type.
--
-- * 'fltoAvailabilityZone' - The Availability Zone in which to launch the instances.
--
-- * 'fltoMaxPrice' - The maximum price per unit hour that you are willing to pay for a Spot Instance.
fleetLaunchTemplateOverrides
    :: FleetLaunchTemplateOverrides
fleetLaunchTemplateOverrides =
  FleetLaunchTemplateOverrides'
    { _fltoWeightedCapacity = Nothing
    , _fltoSubnetId = Nothing
    , _fltoInstanceType = Nothing
    , _fltoAvailabilityZone = Nothing
    , _fltoMaxPrice = Nothing
    }


-- | The number of units provided by the specified instance type.
fltoWeightedCapacity :: Lens' FleetLaunchTemplateOverrides (Maybe Double)
fltoWeightedCapacity = lens _fltoWeightedCapacity (\ s a -> s{_fltoWeightedCapacity = a})

-- | The ID of the subnet in which to launch the instances.
fltoSubnetId :: Lens' FleetLaunchTemplateOverrides (Maybe Text)
fltoSubnetId = lens _fltoSubnetId (\ s a -> s{_fltoSubnetId = a})

-- | The instance type.
fltoInstanceType :: Lens' FleetLaunchTemplateOverrides (Maybe InstanceType)
fltoInstanceType = lens _fltoInstanceType (\ s a -> s{_fltoInstanceType = a})

-- | The Availability Zone in which to launch the instances.
fltoAvailabilityZone :: Lens' FleetLaunchTemplateOverrides (Maybe Text)
fltoAvailabilityZone = lens _fltoAvailabilityZone (\ s a -> s{_fltoAvailabilityZone = a})

-- | The maximum price per unit hour that you are willing to pay for a Spot Instance.
fltoMaxPrice :: Lens' FleetLaunchTemplateOverrides (Maybe Text)
fltoMaxPrice = lens _fltoMaxPrice (\ s a -> s{_fltoMaxPrice = a})

instance FromXML FleetLaunchTemplateOverrides where
        parseXML x
          = FleetLaunchTemplateOverrides' <$>
              (x .@? "weightedCapacity") <*> (x .@? "subnetId") <*>
                (x .@? "instanceType")
                <*> (x .@? "availabilityZone")
                <*> (x .@? "maxPrice")

instance Hashable FleetLaunchTemplateOverrides where

instance NFData FleetLaunchTemplateOverrides where

-- | Describes overrides for a launch template.
--
--
--
-- /See:/ 'fleetLaunchTemplateOverridesRequest' smart constructor.
data FleetLaunchTemplateOverridesRequest = FleetLaunchTemplateOverridesRequest'
  { _fltorWeightedCapacity :: !(Maybe Double)
  , _fltorSubnetId         :: !(Maybe Text)
  , _fltorInstanceType     :: !(Maybe InstanceType)
  , _fltorAvailabilityZone :: !(Maybe Text)
  , _fltorMaxPrice         :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetLaunchTemplateOverridesRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fltorWeightedCapacity' - The number of units provided by the specified instance type.
--
-- * 'fltorSubnetId' - The ID of the subnet in which to launch the instances.
--
-- * 'fltorInstanceType' - The instance type.
--
-- * 'fltorAvailabilityZone' - The Availability Zone in which to launch the instances.
--
-- * 'fltorMaxPrice' - The maximum price per unit hour that you are willing to pay for a Spot Instance.
fleetLaunchTemplateOverridesRequest
    :: FleetLaunchTemplateOverridesRequest
fleetLaunchTemplateOverridesRequest =
  FleetLaunchTemplateOverridesRequest'
    { _fltorWeightedCapacity = Nothing
    , _fltorSubnetId = Nothing
    , _fltorInstanceType = Nothing
    , _fltorAvailabilityZone = Nothing
    , _fltorMaxPrice = Nothing
    }


-- | The number of units provided by the specified instance type.
fltorWeightedCapacity :: Lens' FleetLaunchTemplateOverridesRequest (Maybe Double)
fltorWeightedCapacity = lens _fltorWeightedCapacity (\ s a -> s{_fltorWeightedCapacity = a})

-- | The ID of the subnet in which to launch the instances.
fltorSubnetId :: Lens' FleetLaunchTemplateOverridesRequest (Maybe Text)
fltorSubnetId = lens _fltorSubnetId (\ s a -> s{_fltorSubnetId = a})

-- | The instance type.
fltorInstanceType :: Lens' FleetLaunchTemplateOverridesRequest (Maybe InstanceType)
fltorInstanceType = lens _fltorInstanceType (\ s a -> s{_fltorInstanceType = a})

-- | The Availability Zone in which to launch the instances.
fltorAvailabilityZone :: Lens' FleetLaunchTemplateOverridesRequest (Maybe Text)
fltorAvailabilityZone = lens _fltorAvailabilityZone (\ s a -> s{_fltorAvailabilityZone = a})

-- | The maximum price per unit hour that you are willing to pay for a Spot Instance.
fltorMaxPrice :: Lens' FleetLaunchTemplateOverridesRequest (Maybe Text)
fltorMaxPrice = lens _fltorMaxPrice (\ s a -> s{_fltorMaxPrice = a})

instance Hashable FleetLaunchTemplateOverridesRequest
         where

instance NFData FleetLaunchTemplateOverridesRequest
         where

instance ToQuery FleetLaunchTemplateOverridesRequest
         where
        toQuery FleetLaunchTemplateOverridesRequest'{..}
          = mconcat
              ["WeightedCapacity" =: _fltorWeightedCapacity,
               "SubnetId" =: _fltorSubnetId,
               "InstanceType" =: _fltorInstanceType,
               "AvailabilityZone" =: _fltorAvailabilityZone,
               "MaxPrice" =: _fltorMaxPrice]

-- | Describes a launch template.
--
--
--
-- /See:/ 'fleetLaunchTemplateSpecification' smart constructor.
data FleetLaunchTemplateSpecification = FleetLaunchTemplateSpecification'
  { _fltsLaunchTemplateName :: !(Maybe Text)
  , _fltsLaunchTemplateId   :: !(Maybe Text)
  , _fltsVersion            :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetLaunchTemplateSpecification' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fltsLaunchTemplateName' - The name of the launch template. You must specify either a template name or a template ID.
--
-- * 'fltsLaunchTemplateId' - The ID of the launch template. You must specify either a template ID or a template name.
--
-- * 'fltsVersion' - The version number. By default, the default version of the launch template is used.
fleetLaunchTemplateSpecification
    :: FleetLaunchTemplateSpecification
fleetLaunchTemplateSpecification =
  FleetLaunchTemplateSpecification'
    { _fltsLaunchTemplateName = Nothing
    , _fltsLaunchTemplateId = Nothing
    , _fltsVersion = Nothing
    }


-- | The name of the launch template. You must specify either a template name or a template ID.
fltsLaunchTemplateName :: Lens' FleetLaunchTemplateSpecification (Maybe Text)
fltsLaunchTemplateName = lens _fltsLaunchTemplateName (\ s a -> s{_fltsLaunchTemplateName = a})

-- | The ID of the launch template. You must specify either a template ID or a template name.
fltsLaunchTemplateId :: Lens' FleetLaunchTemplateSpecification (Maybe Text)
fltsLaunchTemplateId = lens _fltsLaunchTemplateId (\ s a -> s{_fltsLaunchTemplateId = a})

-- | The version number. By default, the default version of the launch template is used.
fltsVersion :: Lens' FleetLaunchTemplateSpecification (Maybe Text)
fltsVersion = lens _fltsVersion (\ s a -> s{_fltsVersion = a})

instance FromXML FleetLaunchTemplateSpecification
         where
        parseXML x
          = FleetLaunchTemplateSpecification' <$>
              (x .@? "launchTemplateName") <*>
                (x .@? "launchTemplateId")
                <*> (x .@? "version")

instance Hashable FleetLaunchTemplateSpecification
         where

instance NFData FleetLaunchTemplateSpecification
         where

instance ToQuery FleetLaunchTemplateSpecification
         where
        toQuery FleetLaunchTemplateSpecification'{..}
          = mconcat
              ["LaunchTemplateName" =: _fltsLaunchTemplateName,
               "LaunchTemplateId" =: _fltsLaunchTemplateId,
               "Version" =: _fltsVersion]

-- | The launch template to use. You must specify either the launch template ID or launch template name in the request.
--
--
--
-- /See:/ 'fleetLaunchTemplateSpecificationRequest' smart constructor.
data FleetLaunchTemplateSpecificationRequest = FleetLaunchTemplateSpecificationRequest'
  { _fltsrLaunchTemplateName :: !(Maybe Text)
  , _fltsrLaunchTemplateId   :: !(Maybe Text)
  , _fltsrVersion            :: !(Maybe Text)
  } deriving (Eq, Read, Show, Data, Typeable, Generic)


-- | Creates a value of 'FleetLaunchTemplateSpecificationRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'fltsrLaunchTemplateName' - The name of the launch template.
--
-- * 'fltsrLaunchTemplateId' - The ID of the launch template.
--
-- * 'fltsrVersion' - The version number of the launch template.
fleetLaunchTemplateSpecificationRequest
    :: FleetLaunchTemplateSpecificationRequest
fleetLaunchTemplateSpecificationRequest =
  FleetLaunchTemplateSpecificationRequest'
    { _fltsrLaunchTemplateName = Nothing
    , _fltsrLaunchTemplateId = Nothing
    , _fltsrVersion = Nothing
    }


-- | The name of the launch template.
fltsrLaunchTemplateName :: Lens' FleetLaunchTemplateSpecificationRequest (Maybe Text)
fltsrLaunchTemplateName = lens _fltsrLaunchTemplateName (\ s a -> s{_fltsrLaunchTemplateName = a})

-- | The ID of the launch template.
fltsrLaunchTemplateId :: Lens' FleetLaunchTemplateSpecificationRequest (Maybe Text)
fltsrLaunchTemplateId = lens _fltsrLaunchTemplateId (\ s a -> s{_fltsrLaunchTemplateId = a})

-- | The version number of the launch template.
fltsrVersion :: Lens' FleetLaunchTemplateSpecificationRequest (Maybe Text)
fltsrVersion = lens _fltsrVersion (\ s a -> s{_fltsrVersion = a})

instance Hashable
           FleetLaunchTemplateSpecificationRequest
         where

instance NFData
           FleetLaunchTemplateSpecificationRequest
         where

instance ToQuery
           FleetLaunchTemplateSpecificationRequest
         where
        toQuery FleetLaunchTemplateSpecificationRequest'{..}
          = mconcat
              ["LaunchTemplateName" =: _fltsrLaunchTemplateName,
               "LaunchTemplateId" =: _fltsrLaunchTemplateId,
               "Version" =: