Skip to content

Commit

Permalink
Regenerating EC2 from latest service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed May 30, 2016
1 parent 9b804b2 commit 93b6b72
Show file tree
Hide file tree
Showing 9 changed files with 487 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
145 changes: 145 additions & 0 deletions amazonka-ec2/gen/Network/AWS/EC2/DescribeSecurityGroupReferences.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}

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

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

-- |
-- Module : Network.AWS.EC2.DescribeSecurityGroupReferences
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- [EC2-VPC only] Describes the VPCs on the other side of a VPC peering
-- connection that are referencing the security groups you\'ve specified in
-- this request.
module Network.AWS.EC2.DescribeSecurityGroupReferences
(
-- * Creating a Request
describeSecurityGroupReferences
, DescribeSecurityGroupReferences
-- * Request Lenses
, dsgrDryRun
, dsgrGroupId

-- * Destructuring the Response
, describeSecurityGroupReferencesResponse
, DescribeSecurityGroupReferencesResponse
-- * Response Lenses
, dsgrrsSecurityGroupReferenceSet
, dsgrrsResponseStatus
) where

import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response

-- | /See:/ 'describeSecurityGroupReferences' smart constructor.
data DescribeSecurityGroupReferences = DescribeSecurityGroupReferences'
{ _dsgrDryRun :: !(Maybe Bool)
, _dsgrGroupId :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeSecurityGroupReferences' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dsgrDryRun'
--
-- * 'dsgrGroupId'
describeSecurityGroupReferences
:: DescribeSecurityGroupReferences
describeSecurityGroupReferences =
DescribeSecurityGroupReferences'
{ _dsgrDryRun = Nothing
, _dsgrGroupId = mempty
}

-- | Checks whether you have the required permissions for the operation,
-- without actually making the request, and provides an error response. If
-- you have the required permissions, the error response is
-- DryRunOperation. Otherwise, it is UnauthorizedOperation.
dsgrDryRun :: Lens' DescribeSecurityGroupReferences (Maybe Bool)
dsgrDryRun = lens _dsgrDryRun (\ s a -> s{_dsgrDryRun = a});

-- | One or more security group IDs in your account.
dsgrGroupId :: Lens' DescribeSecurityGroupReferences [Text]
dsgrGroupId = lens _dsgrGroupId (\ s a -> s{_dsgrGroupId = a}) . _Coerce;

instance AWSRequest DescribeSecurityGroupReferences
where
type Rs DescribeSecurityGroupReferences =
DescribeSecurityGroupReferencesResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DescribeSecurityGroupReferencesResponse' <$>
(x .@? "securityGroupReferenceSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))

instance Hashable DescribeSecurityGroupReferences

instance NFData DescribeSecurityGroupReferences

instance ToHeaders DescribeSecurityGroupReferences
where
toHeaders = const mempty

instance ToPath DescribeSecurityGroupReferences where
toPath = const "/"

instance ToQuery DescribeSecurityGroupReferences
where
toQuery DescribeSecurityGroupReferences'{..}
= mconcat
["Action" =:
("DescribeSecurityGroupReferences" :: ByteString),
"Version" =: ("2015-10-01" :: ByteString),
"DryRun" =: _dsgrDryRun,
toQueryList "GroupId" _dsgrGroupId]

-- | /See:/ 'describeSecurityGroupReferencesResponse' smart constructor.
data DescribeSecurityGroupReferencesResponse = DescribeSecurityGroupReferencesResponse'
{ _dsgrrsSecurityGroupReferenceSet :: !(Maybe [SecurityGroupReference])
, _dsgrrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeSecurityGroupReferencesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dsgrrsSecurityGroupReferenceSet'
--
-- * 'dsgrrsResponseStatus'
describeSecurityGroupReferencesResponse
:: Int -- ^ 'dsgrrsResponseStatus'
-> DescribeSecurityGroupReferencesResponse
describeSecurityGroupReferencesResponse pResponseStatus_ =
DescribeSecurityGroupReferencesResponse'
{ _dsgrrsSecurityGroupReferenceSet = Nothing
, _dsgrrsResponseStatus = pResponseStatus_
}

-- | Information about the VPCs with the referencing security groups.
dsgrrsSecurityGroupReferenceSet :: Lens' DescribeSecurityGroupReferencesResponse [SecurityGroupReference]
dsgrrsSecurityGroupReferenceSet = lens _dsgrrsSecurityGroupReferenceSet (\ s a -> s{_dsgrrsSecurityGroupReferenceSet = a}) . _Default . _Coerce;

-- | The response status code.
dsgrrsResponseStatus :: Lens' DescribeSecurityGroupReferencesResponse Int
dsgrrsResponseStatus = lens _dsgrrsResponseStatus (\ s a -> s{_dsgrrsResponseStatus = a});

instance NFData
DescribeSecurityGroupReferencesResponse
177 changes: 177 additions & 0 deletions amazonka-ec2/gen/Network/AWS/EC2/DescribeStaleSecurityGroups.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}

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

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

-- |
-- Module : Network.AWS.EC2.DescribeStaleSecurityGroups
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- [EC2-VPC only] Describes the stale security group rules for security
-- groups in a specified VPC. Rules are stale when they reference a deleted
-- security group in a peer VPC, or a security group in a peer VPC for
-- which the VPC peering connection has been deleted.
module Network.AWS.EC2.DescribeStaleSecurityGroups
(
-- * Creating a Request
describeStaleSecurityGroups
, DescribeStaleSecurityGroups
-- * Request Lenses
, dssgNextToken
, dssgDryRun
, dssgMaxResults
, dssgVPCId

-- * Destructuring the Response
, describeStaleSecurityGroupsResponse
, DescribeStaleSecurityGroupsResponse
-- * Response Lenses
, dssgrsStaleSecurityGroupSet
, dssgrsNextToken
, dssgrsResponseStatus
) where

import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response

-- | /See:/ 'describeStaleSecurityGroups' smart constructor.
data DescribeStaleSecurityGroups = DescribeStaleSecurityGroups'
{ _dssgNextToken :: !(Maybe Text)
, _dssgDryRun :: !(Maybe Bool)
, _dssgMaxResults :: !(Maybe Nat)
, _dssgVPCId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeStaleSecurityGroups' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dssgNextToken'
--
-- * 'dssgDryRun'
--
-- * 'dssgMaxResults'
--
-- * 'dssgVPCId'
describeStaleSecurityGroups
:: Text -- ^ 'dssgVPCId'
-> DescribeStaleSecurityGroups
describeStaleSecurityGroups pVPCId_ =
DescribeStaleSecurityGroups'
{ _dssgNextToken = Nothing
, _dssgDryRun = Nothing
, _dssgMaxResults = Nothing
, _dssgVPCId = pVPCId_
}

-- | The token for the next set of items to return. (You received this token
-- from a prior call.)
dssgNextToken :: Lens' DescribeStaleSecurityGroups (Maybe Text)
dssgNextToken = lens _dssgNextToken (\ s a -> s{_dssgNextToken = a});

-- | Checks whether you have the required permissions for the operation,
-- without actually making the request, and provides an error response. If
-- you have the required permissions, the error response is
-- DryRunOperation. Otherwise, it is UnauthorizedOperation.
dssgDryRun :: Lens' DescribeStaleSecurityGroups (Maybe Bool)
dssgDryRun = lens _dssgDryRun (\ s a -> s{_dssgDryRun = a});

-- | The maximum number of items to return for this request. The request
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
dssgMaxResults :: Lens' DescribeStaleSecurityGroups (Maybe Natural)
dssgMaxResults = lens _dssgMaxResults (\ s a -> s{_dssgMaxResults = a}) . mapping _Nat;

-- | The ID of the VPC.
dssgVPCId :: Lens' DescribeStaleSecurityGroups Text
dssgVPCId = lens _dssgVPCId (\ s a -> s{_dssgVPCId = a});

instance AWSRequest DescribeStaleSecurityGroups where
type Rs DescribeStaleSecurityGroups =
DescribeStaleSecurityGroupsResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DescribeStaleSecurityGroupsResponse' <$>
(x .@? "staleSecurityGroupSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (x .@? "nextToken")
<*> (pure (fromEnum s)))

instance Hashable DescribeStaleSecurityGroups

instance NFData DescribeStaleSecurityGroups

instance ToHeaders DescribeStaleSecurityGroups where
toHeaders = const mempty

instance ToPath DescribeStaleSecurityGroups where
toPath = const "/"

instance ToQuery DescribeStaleSecurityGroups where
toQuery DescribeStaleSecurityGroups'{..}
= mconcat
["Action" =:
("DescribeStaleSecurityGroups" :: ByteString),
"Version" =: ("2015-10-01" :: ByteString),
"NextToken" =: _dssgNextToken,
"DryRun" =: _dssgDryRun,
"MaxResults" =: _dssgMaxResults,
"VpcId" =: _dssgVPCId]

-- | /See:/ 'describeStaleSecurityGroupsResponse' smart constructor.
data DescribeStaleSecurityGroupsResponse = DescribeStaleSecurityGroupsResponse'
{ _dssgrsStaleSecurityGroupSet :: !(Maybe [StaleSecurityGroup])
, _dssgrsNextToken :: !(Maybe Text)
, _dssgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeStaleSecurityGroupsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dssgrsStaleSecurityGroupSet'
--
-- * 'dssgrsNextToken'
--
-- * 'dssgrsResponseStatus'
describeStaleSecurityGroupsResponse
:: Int -- ^ 'dssgrsResponseStatus'
-> DescribeStaleSecurityGroupsResponse
describeStaleSecurityGroupsResponse pResponseStatus_ =
DescribeStaleSecurityGroupsResponse'
{ _dssgrsStaleSecurityGroupSet = Nothing
, _dssgrsNextToken = Nothing
, _dssgrsResponseStatus = pResponseStatus_
}

-- | Information about the stale security groups.
dssgrsStaleSecurityGroupSet :: Lens' DescribeStaleSecurityGroupsResponse [StaleSecurityGroup]
dssgrsStaleSecurityGroupSet = lens _dssgrsStaleSecurityGroupSet (\ s a -> s{_dssgrsStaleSecurityGroupSet = a}) . _Default . _Coerce;

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
dssgrsNextToken :: Lens' DescribeStaleSecurityGroupsResponse (Maybe Text)
dssgrsNextToken = lens _dssgrsNextToken (\ s a -> s{_dssgrsNextToken = a});

-- | The response status code.
dssgrsResponseStatus :: Lens' DescribeStaleSecurityGroupsResponse Int
dssgrsResponseStatus = lens _dssgrsResponseStatus (\ s a -> s{_dssgrsResponseStatus = a});

instance NFData DescribeStaleSecurityGroupsResponse
Loading

0 comments on commit 93b6b72

Please sign in to comment.