Skip to content

Commit

Permalink
Regenerating amazonka-cloudwatch-events from latest service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed Aug 20, 2017
1 parent 8400fe9 commit 101538e
Show file tree
Hide file tree
Showing 19 changed files with 540 additions and 23 deletions.
3 changes: 3 additions & 0 deletions amazonka-cloudwatch-events/amazonka-cloudwatch-events.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ library
exposed-modules:
Network.AWS.CloudWatchEvents
, Network.AWS.CloudWatchEvents.DeleteRule
, Network.AWS.CloudWatchEvents.DescribeEventBus
, Network.AWS.CloudWatchEvents.DescribeRule
, Network.AWS.CloudWatchEvents.DisableRule
, Network.AWS.CloudWatchEvents.EnableRule
, Network.AWS.CloudWatchEvents.ListRuleNamesByTarget
, Network.AWS.CloudWatchEvents.ListRules
, Network.AWS.CloudWatchEvents.ListTargetsByRule
, Network.AWS.CloudWatchEvents.PutEvents
, Network.AWS.CloudWatchEvents.PutPermission
, Network.AWS.CloudWatchEvents.PutRule
, Network.AWS.CloudWatchEvents.PutTargets
, Network.AWS.CloudWatchEvents.RemovePermission
, Network.AWS.CloudWatchEvents.RemoveTargets
, Network.AWS.CloudWatchEvents.TestEventPattern
, Network.AWS.CloudWatchEvents.Types
Expand Down
10 changes: 10 additions & 0 deletions amazonka-cloudwatch-events/fixture/DescribeEventBus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
method: POST
headers:
Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/events/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?
Host: events.us-east-1.amazonaws.com
Content-Type: application/x-www-form-urlencoded; charset=utf-8
X-Amz-Content-SHA256: abcdef
X-Amz-Date: 20091028T223200Z
body:
''
Empty file.
10 changes: 10 additions & 0 deletions amazonka-cloudwatch-events/fixture/PutPermission.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
method: POST
headers:
Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/events/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?
Host: events.us-east-1.amazonaws.com
Content-Type: application/x-www-form-urlencoded; charset=utf-8
X-Amz-Content-SHA256: abcdef
X-Amz-Date: 20091028T223200Z
body:
''
Empty file.
10 changes: 10 additions & 0 deletions amazonka-cloudwatch-events/fixture/RemovePermission.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
method: POST
headers:
Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/events/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?
Host: events.us-east-1.amazonaws.com
Content-Type: application/x-www-form-urlencoded; charset=utf-8
X-Amz-Content-SHA256: abcdef
X-Amz-Date: 20091028T223200Z
body:
''
Empty file.
15 changes: 15 additions & 0 deletions amazonka-cloudwatch-events/gen/Network/AWS/CloudWatchEvents.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ module Network.AWS.CloudWatchEvents
-- * Errors
-- $errors

-- ** PolicyLengthExceededException
, _PolicyLengthExceededException

-- ** ConcurrentModificationException
, _ConcurrentModificationException

Expand Down Expand Up @@ -68,9 +71,15 @@ module Network.AWS.CloudWatchEvents
-- ** DisableRule
, module Network.AWS.CloudWatchEvents.DisableRule

-- ** PutPermission
, module Network.AWS.CloudWatchEvents.PutPermission

-- ** ListTargetsByRule
, module Network.AWS.CloudWatchEvents.ListTargetsByRule

-- ** RemovePermission
, module Network.AWS.CloudWatchEvents.RemovePermission

-- ** DescribeRule
, module Network.AWS.CloudWatchEvents.DescribeRule

Expand All @@ -83,6 +92,9 @@ module Network.AWS.CloudWatchEvents
-- ** TestEventPattern
, module Network.AWS.CloudWatchEvents.TestEventPattern

-- ** DescribeEventBus
, module Network.AWS.CloudWatchEvents.DescribeEventBus

-- ** PutTargets
, module Network.AWS.CloudWatchEvents.PutTargets

Expand Down Expand Up @@ -178,15 +190,18 @@ module Network.AWS.CloudWatchEvents
) where

import Network.AWS.CloudWatchEvents.DeleteRule
import Network.AWS.CloudWatchEvents.DescribeEventBus
import Network.AWS.CloudWatchEvents.DescribeRule
import Network.AWS.CloudWatchEvents.DisableRule
import Network.AWS.CloudWatchEvents.EnableRule
import Network.AWS.CloudWatchEvents.ListRuleNamesByTarget
import Network.AWS.CloudWatchEvents.ListRules
import Network.AWS.CloudWatchEvents.ListTargetsByRule
import Network.AWS.CloudWatchEvents.PutEvents
import Network.AWS.CloudWatchEvents.PutPermission
import Network.AWS.CloudWatchEvents.PutRule
import Network.AWS.CloudWatchEvents.PutTargets
import Network.AWS.CloudWatchEvents.RemovePermission
import Network.AWS.CloudWatchEvents.RemoveTargets
import Network.AWS.CloudWatchEvents.TestEventPattern
import Network.AWS.CloudWatchEvents.Types
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{-# 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.CloudWatchEvents.DescribeEventBus
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <[email protected]>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Displays the external AWS accounts that are permitted to write events to your account using your account's event bus, and the associated policy. To enable your account to receive events from other accounts, use 'PutPermission' .
--
--
module Network.AWS.CloudWatchEvents.DescribeEventBus
(
-- * Creating a Request
describeEventBus
, DescribeEventBus

-- * Destructuring the Response
, describeEventBusResponse
, DescribeEventBusResponse
-- * Response Lenses
, debrsARN
, debrsName
, debrsPolicy
, debrsResponseStatus
) where

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

-- | /See:/ 'describeEventBus' smart constructor.
data DescribeEventBus =
DescribeEventBus'
deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeEventBus' with the minimum fields required to make a request.
--
describeEventBus
:: DescribeEventBus
describeEventBus = DescribeEventBus'

instance AWSRequest DescribeEventBus where
type Rs DescribeEventBus = DescribeEventBusResponse
request = postJSON cloudWatchEvents
response
= receiveJSON
(\ s h x ->
DescribeEventBusResponse' <$>
(x .?> "Arn") <*> (x .?> "Name") <*> (x .?> "Policy")
<*> (pure (fromEnum s)))

instance Hashable DescribeEventBus

instance NFData DescribeEventBus

instance ToHeaders DescribeEventBus where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSEvents.DescribeEventBus" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])

instance ToJSON DescribeEventBus where
toJSON = const (Object mempty)

instance ToPath DescribeEventBus where
toPath = const "/"

instance ToQuery DescribeEventBus where
toQuery = const mempty

-- | /See:/ 'describeEventBusResponse' smart constructor.
data DescribeEventBusResponse = DescribeEventBusResponse'
{ _debrsARN :: !(Maybe Text)
, _debrsName :: !(Maybe Text)
, _debrsPolicy :: !(Maybe Text)
, _debrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'DescribeEventBusResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'debrsARN' - The Amazon Resource Name (ARN) of the account permitted to write events to the current account.
--
-- * 'debrsName' - The name of the event bus. Currently, this is always @default@ .
--
-- * 'debrsPolicy' - The policy that enables the external account to send events to your account.
--
-- * 'debrsResponseStatus' - -- | The response status code.
describeEventBusResponse
:: Int -- ^ 'debrsResponseStatus'
-> DescribeEventBusResponse
describeEventBusResponse pResponseStatus_ =
DescribeEventBusResponse'
{ _debrsARN = Nothing
, _debrsName = Nothing
, _debrsPolicy = Nothing
, _debrsResponseStatus = pResponseStatus_
}

-- | The Amazon Resource Name (ARN) of the account permitted to write events to the current account.
debrsARN :: Lens' DescribeEventBusResponse (Maybe Text)
debrsARN = lens _debrsARN (\ s a -> s{_debrsARN = a});

-- | The name of the event bus. Currently, this is always @default@ .
debrsName :: Lens' DescribeEventBusResponse (Maybe Text)
debrsName = lens _debrsName (\ s a -> s{_debrsName = a});

-- | The policy that enables the external account to send events to your account.
debrsPolicy :: Lens' DescribeEventBusResponse (Maybe Text)
debrsPolicy = lens _debrsPolicy (\ s a -> s{_debrsPolicy = a});

-- | -- | The response status code.
debrsResponseStatus :: Lens' DescribeEventBusResponse Int
debrsResponseStatus = lens _debrsResponseStatus (\ s a -> s{_debrsResponseStatus = a});

instance NFData DescribeEventBusResponse
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ data DescribeRuleResponse = DescribeRuleResponse'
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'drrsEventPattern' - The event pattern.
-- * 'drrsEventPattern' - The event pattern. For more information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html Events and Event Patterns> in the /Amazon CloudWatch Events User Guide/ .
--
-- * 'drrsState' - Specifies whether the rule is enabled or disabled.
--
Expand Down Expand Up @@ -156,7 +156,7 @@ describeRuleResponse pResponseStatus_ =
, _drrsResponseStatus = pResponseStatus_
}

-- | The event pattern.
-- | The event pattern. For more information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html Events and Event Patterns> in the /Amazon CloudWatch Events User Guide/ .
drrsEventPattern :: Lens' DescribeRuleResponse (Maybe Text)
drrsEventPattern = lens _drrsEventPattern (\ s a -> s{_drrsEventPattern = a});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{-# 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.CloudWatchEvents.PutPermission
-- Copyright : (c) 2013-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <[email protected]>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Running @PutPermission@ permits the specified AWS account to put events to your account's default /event bus/ . CloudWatch Events rules in your account are triggered by these events arriving to your default event bus.
--
--
-- For another account to send events to your account, that external account must have a CloudWatch Events rule with your account's default event bus as a target.
--
-- To enable multiple AWS accounts to put events to your default event bus, run @PutPermission@ once for each of these accounts.
--
module Network.AWS.CloudWatchEvents.PutPermission
(
-- * Creating a Request
putPermission
, PutPermission
-- * Request Lenses
, ppAction
, ppPrincipal
, ppStatementId

-- * Destructuring the Response
, putPermissionResponse
, PutPermissionResponse
) where

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

-- | /See:/ 'putPermission' smart constructor.
data PutPermission = PutPermission'
{ _ppAction :: !Text
, _ppPrincipal :: !Text
, _ppStatementId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'PutPermission' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ppAction' - The action that you are enabling the other account to perform. Currently, this must be @events:PutEvents@ .
--
-- * 'ppPrincipal' - The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify "*" to permit any account to put events to your default event bus. If you specify "*", avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an @account@ field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.
--
-- * 'ppStatementId' - An identifier string for the external account that you are granting permissions to. If you later want to revoke the permission for this external account, specify this @StatementId@ when you run 'RemovePermission' .
putPermission
:: Text -- ^ 'ppAction'
-> Text -- ^ 'ppPrincipal'
-> Text -- ^ 'ppStatementId'
-> PutPermission
putPermission pAction_ pPrincipal_ pStatementId_ =
PutPermission'
{ _ppAction = pAction_
, _ppPrincipal = pPrincipal_
, _ppStatementId = pStatementId_
}

-- | The action that you are enabling the other account to perform. Currently, this must be @events:PutEvents@ .
ppAction :: Lens' PutPermission Text
ppAction = lens _ppAction (\ s a -> s{_ppAction = a});

-- | The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify "*" to permit any account to put events to your default event bus. If you specify "*", avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an @account@ field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.
ppPrincipal :: Lens' PutPermission Text
ppPrincipal = lens _ppPrincipal (\ s a -> s{_ppPrincipal = a});

-- | An identifier string for the external account that you are granting permissions to. If you later want to revoke the permission for this external account, specify this @StatementId@ when you run 'RemovePermission' .
ppStatementId :: Lens' PutPermission Text
ppStatementId = lens _ppStatementId (\ s a -> s{_ppStatementId = a});

instance AWSRequest PutPermission where
type Rs PutPermission = PutPermissionResponse
request = postJSON cloudWatchEvents
response = receiveNull PutPermissionResponse'

instance Hashable PutPermission

instance NFData PutPermission

instance ToHeaders PutPermission where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSEvents.PutPermission" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])

instance ToJSON PutPermission where
toJSON PutPermission'{..}
= object
(catMaybes
[Just ("Action" .= _ppAction),
Just ("Principal" .= _ppPrincipal),
Just ("StatementId" .= _ppStatementId)])

instance ToPath PutPermission where
toPath = const "/"

instance ToQuery PutPermission where
toQuery = const mempty

-- | /See:/ 'putPermissionResponse' smart constructor.
data PutPermissionResponse =
PutPermissionResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)

-- | Creates a value of 'PutPermissionResponse' with the minimum fields required to make a request.
--
putPermissionResponse
:: PutPermissionResponse
putPermissionResponse = PutPermissionResponse'

instance NFData PutPermissionResponse
Loading

0 comments on commit 101538e

Please sign in to comment.