{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeStarNotifications.CreateNotificationRule
(
CreateNotificationRule (..),
newCreateNotificationRule,
createNotificationRule_status,
createNotificationRule_clientRequestToken,
createNotificationRule_tags,
createNotificationRule_name,
createNotificationRule_eventTypeIds,
createNotificationRule_resource,
createNotificationRule_targets,
createNotificationRule_detailType,
CreateNotificationRuleResponse (..),
newCreateNotificationRuleResponse,
createNotificationRuleResponse_arn,
createNotificationRuleResponse_httpStatus,
)
where
import Amazonka.CodeStarNotifications.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateNotificationRule = CreateNotificationRule'
{
CreateNotificationRule -> Maybe NotificationRuleStatus
status :: Prelude.Maybe NotificationRuleStatus,
CreateNotificationRule -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
CreateNotificationRule -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateNotificationRule -> Sensitive Text
name :: Core.Sensitive Prelude.Text,
CreateNotificationRule -> [Text]
eventTypeIds :: [Prelude.Text],
CreateNotificationRule -> Text
resource :: Prelude.Text,
CreateNotificationRule -> [Target]
targets :: [Target],
CreateNotificationRule -> DetailType
detailType :: DetailType
}
deriving (CreateNotificationRule -> CreateNotificationRule -> Bool
(CreateNotificationRule -> CreateNotificationRule -> Bool)
-> (CreateNotificationRule -> CreateNotificationRule -> Bool)
-> Eq CreateNotificationRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotificationRule -> CreateNotificationRule -> Bool
$c/= :: CreateNotificationRule -> CreateNotificationRule -> Bool
== :: CreateNotificationRule -> CreateNotificationRule -> Bool
$c== :: CreateNotificationRule -> CreateNotificationRule -> Bool
Prelude.Eq, Int -> CreateNotificationRule -> ShowS
[CreateNotificationRule] -> ShowS
CreateNotificationRule -> String
(Int -> CreateNotificationRule -> ShowS)
-> (CreateNotificationRule -> String)
-> ([CreateNotificationRule] -> ShowS)
-> Show CreateNotificationRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotificationRule] -> ShowS
$cshowList :: [CreateNotificationRule] -> ShowS
show :: CreateNotificationRule -> String
$cshow :: CreateNotificationRule -> String
showsPrec :: Int -> CreateNotificationRule -> ShowS
$cshowsPrec :: Int -> CreateNotificationRule -> ShowS
Prelude.Show, (forall x. CreateNotificationRule -> Rep CreateNotificationRule x)
-> (forall x.
Rep CreateNotificationRule x -> CreateNotificationRule)
-> Generic CreateNotificationRule
forall x. Rep CreateNotificationRule x -> CreateNotificationRule
forall x. CreateNotificationRule -> Rep CreateNotificationRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNotificationRule x -> CreateNotificationRule
$cfrom :: forall x. CreateNotificationRule -> Rep CreateNotificationRule x
Prelude.Generic)
newCreateNotificationRule ::
Prelude.Text ->
Prelude.Text ->
DetailType ->
CreateNotificationRule
newCreateNotificationRule :: Text -> Text -> DetailType -> CreateNotificationRule
newCreateNotificationRule
Text
pName_
Text
pResource_
DetailType
pDetailType_ =
CreateNotificationRule' :: Maybe NotificationRuleStatus
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Sensitive Text
-> [Text]
-> Text
-> [Target]
-> DetailType
-> CreateNotificationRule
CreateNotificationRule'
{ $sel:status:CreateNotificationRule' :: Maybe NotificationRuleStatus
status = Maybe NotificationRuleStatus
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:CreateNotificationRule' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateNotificationRule' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateNotificationRule' :: Sensitive Text
name = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pName_,
$sel:eventTypeIds:CreateNotificationRule' :: [Text]
eventTypeIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:resource:CreateNotificationRule' :: Text
resource = Text
pResource_,
$sel:targets:CreateNotificationRule' :: [Target]
targets = [Target]
forall a. Monoid a => a
Prelude.mempty,
$sel:detailType:CreateNotificationRule' :: DetailType
detailType = DetailType
pDetailType_
}
createNotificationRule_status :: Lens.Lens' CreateNotificationRule (Prelude.Maybe NotificationRuleStatus)
createNotificationRule_status :: (Maybe NotificationRuleStatus -> f (Maybe NotificationRuleStatus))
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_status = (CreateNotificationRule -> Maybe NotificationRuleStatus)
-> (CreateNotificationRule
-> Maybe NotificationRuleStatus -> CreateNotificationRule)
-> Lens
CreateNotificationRule
CreateNotificationRule
(Maybe NotificationRuleStatus)
(Maybe NotificationRuleStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {Maybe NotificationRuleStatus
status :: Maybe NotificationRuleStatus
$sel:status:CreateNotificationRule' :: CreateNotificationRule -> Maybe NotificationRuleStatus
status} -> Maybe NotificationRuleStatus
status) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} Maybe NotificationRuleStatus
a -> CreateNotificationRule
s {$sel:status:CreateNotificationRule' :: Maybe NotificationRuleStatus
status = Maybe NotificationRuleStatus
a} :: CreateNotificationRule)
createNotificationRule_clientRequestToken :: Lens.Lens' CreateNotificationRule (Prelude.Maybe Prelude.Text)
createNotificationRule_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_clientRequestToken = (CreateNotificationRule -> Maybe Text)
-> (CreateNotificationRule -> Maybe Text -> CreateNotificationRule)
-> Lens
CreateNotificationRule
CreateNotificationRule
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateNotificationRule' :: CreateNotificationRule -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} Maybe Text
a -> CreateNotificationRule
s {$sel:clientRequestToken:CreateNotificationRule' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateNotificationRule)
createNotificationRule_tags :: Lens.Lens' CreateNotificationRule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createNotificationRule_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_tags = (CreateNotificationRule -> Maybe (HashMap Text Text))
-> (CreateNotificationRule
-> Maybe (HashMap Text Text) -> CreateNotificationRule)
-> Lens
CreateNotificationRule
CreateNotificationRule
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateNotificationRule' :: CreateNotificationRule -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} Maybe (HashMap Text Text)
a -> CreateNotificationRule
s {$sel:tags:CreateNotificationRule' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateNotificationRule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateNotificationRule -> f CreateNotificationRule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateNotificationRule
-> f CreateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createNotificationRule_name :: Lens.Lens' CreateNotificationRule Prelude.Text
createNotificationRule_name :: (Text -> f Text)
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_name = (CreateNotificationRule -> Sensitive Text)
-> (CreateNotificationRule
-> Sensitive Text -> CreateNotificationRule)
-> Lens
CreateNotificationRule
CreateNotificationRule
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {Sensitive Text
name :: Sensitive Text
$sel:name:CreateNotificationRule' :: CreateNotificationRule -> Sensitive Text
name} -> Sensitive Text
name) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} Sensitive Text
a -> CreateNotificationRule
s {$sel:name:CreateNotificationRule' :: Sensitive Text
name = Sensitive Text
a} :: CreateNotificationRule) ((Sensitive Text -> f (Sensitive Text))
-> CreateNotificationRule -> f CreateNotificationRule)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateNotificationRule
-> f CreateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
createNotificationRule_eventTypeIds :: Lens.Lens' CreateNotificationRule [Prelude.Text]
createNotificationRule_eventTypeIds :: ([Text] -> f [Text])
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_eventTypeIds = (CreateNotificationRule -> [Text])
-> (CreateNotificationRule -> [Text] -> CreateNotificationRule)
-> Lens CreateNotificationRule CreateNotificationRule [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {[Text]
eventTypeIds :: [Text]
$sel:eventTypeIds:CreateNotificationRule' :: CreateNotificationRule -> [Text]
eventTypeIds} -> [Text]
eventTypeIds) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} [Text]
a -> CreateNotificationRule
s {$sel:eventTypeIds:CreateNotificationRule' :: [Text]
eventTypeIds = [Text]
a} :: CreateNotificationRule) (([Text] -> f [Text])
-> CreateNotificationRule -> f CreateNotificationRule)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateNotificationRule
-> f CreateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createNotificationRule_resource :: Lens.Lens' CreateNotificationRule Prelude.Text
createNotificationRule_resource :: (Text -> f Text)
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_resource = (CreateNotificationRule -> Text)
-> (CreateNotificationRule -> Text -> CreateNotificationRule)
-> Lens CreateNotificationRule CreateNotificationRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {Text
resource :: Text
$sel:resource:CreateNotificationRule' :: CreateNotificationRule -> Text
resource} -> Text
resource) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} Text
a -> CreateNotificationRule
s {$sel:resource:CreateNotificationRule' :: Text
resource = Text
a} :: CreateNotificationRule)
createNotificationRule_targets :: Lens.Lens' CreateNotificationRule [Target]
createNotificationRule_targets :: ([Target] -> f [Target])
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_targets = (CreateNotificationRule -> [Target])
-> (CreateNotificationRule -> [Target] -> CreateNotificationRule)
-> Lens
CreateNotificationRule CreateNotificationRule [Target] [Target]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {[Target]
targets :: [Target]
$sel:targets:CreateNotificationRule' :: CreateNotificationRule -> [Target]
targets} -> [Target]
targets) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} [Target]
a -> CreateNotificationRule
s {$sel:targets:CreateNotificationRule' :: [Target]
targets = [Target]
a} :: CreateNotificationRule) (([Target] -> f [Target])
-> CreateNotificationRule -> f CreateNotificationRule)
-> (([Target] -> f [Target]) -> [Target] -> f [Target])
-> ([Target] -> f [Target])
-> CreateNotificationRule
-> f CreateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Target] -> f [Target]) -> [Target] -> f [Target]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createNotificationRule_detailType :: Lens.Lens' CreateNotificationRule DetailType
createNotificationRule_detailType :: (DetailType -> f DetailType)
-> CreateNotificationRule -> f CreateNotificationRule
createNotificationRule_detailType = (CreateNotificationRule -> DetailType)
-> (CreateNotificationRule -> DetailType -> CreateNotificationRule)
-> Lens
CreateNotificationRule CreateNotificationRule DetailType DetailType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRule' {DetailType
detailType :: DetailType
$sel:detailType:CreateNotificationRule' :: CreateNotificationRule -> DetailType
detailType} -> DetailType
detailType) (\s :: CreateNotificationRule
s@CreateNotificationRule' {} DetailType
a -> CreateNotificationRule
s {$sel:detailType:CreateNotificationRule' :: DetailType
detailType = DetailType
a} :: CreateNotificationRule)
instance Core.AWSRequest CreateNotificationRule where
type
AWSResponse CreateNotificationRule =
CreateNotificationRuleResponse
request :: CreateNotificationRule -> Request CreateNotificationRule
request = Service -> CreateNotificationRule -> Request CreateNotificationRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateNotificationRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateNotificationRule)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateNotificationRule))
-> Logger
-> Service
-> Proxy CreateNotificationRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateNotificationRule)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> CreateNotificationRuleResponse
CreateNotificationRuleResponse'
(Maybe Text -> Int -> CreateNotificationRuleResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateNotificationRuleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
Either String (Int -> CreateNotificationRuleResponse)
-> Either String Int
-> Either String CreateNotificationRuleResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateNotificationRule
instance Prelude.NFData CreateNotificationRule
instance Core.ToHeaders CreateNotificationRule where
toHeaders :: CreateNotificationRule -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateNotificationRule -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateNotificationRule where
toJSON :: CreateNotificationRule -> Value
toJSON CreateNotificationRule' {[Text]
[Target]
Maybe Text
Maybe (HashMap Text Text)
Maybe NotificationRuleStatus
Text
Sensitive Text
DetailType
detailType :: DetailType
targets :: [Target]
resource :: Text
eventTypeIds :: [Text]
name :: Sensitive Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
status :: Maybe NotificationRuleStatus
$sel:detailType:CreateNotificationRule' :: CreateNotificationRule -> DetailType
$sel:targets:CreateNotificationRule' :: CreateNotificationRule -> [Target]
$sel:resource:CreateNotificationRule' :: CreateNotificationRule -> Text
$sel:eventTypeIds:CreateNotificationRule' :: CreateNotificationRule -> [Text]
$sel:name:CreateNotificationRule' :: CreateNotificationRule -> Sensitive Text
$sel:tags:CreateNotificationRule' :: CreateNotificationRule -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateNotificationRule' :: CreateNotificationRule -> Maybe Text
$sel:status:CreateNotificationRule' :: CreateNotificationRule -> Maybe NotificationRuleStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Status" Text -> NotificationRuleStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NotificationRuleStatus -> Pair)
-> Maybe NotificationRuleStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationRuleStatus
status,
(Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EventTypeIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
eventTypeIds),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Resource" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resource),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Targets" Text -> [Target] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Target]
targets),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DetailType" Text -> DetailType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DetailType
detailType)
]
)
instance Core.ToPath CreateNotificationRule where
toPath :: CreateNotificationRule -> ByteString
toPath = ByteString -> CreateNotificationRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/createNotificationRule"
instance Core.ToQuery CreateNotificationRule where
toQuery :: CreateNotificationRule -> QueryString
toQuery = QueryString -> CreateNotificationRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateNotificationRuleResponse = CreateNotificationRuleResponse'
{
CreateNotificationRuleResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateNotificationRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool
(CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool)
-> (CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool)
-> Eq CreateNotificationRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool
$c/= :: CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool
== :: CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool
$c== :: CreateNotificationRuleResponse
-> CreateNotificationRuleResponse -> Bool
Prelude.Eq, ReadPrec [CreateNotificationRuleResponse]
ReadPrec CreateNotificationRuleResponse
Int -> ReadS CreateNotificationRuleResponse
ReadS [CreateNotificationRuleResponse]
(Int -> ReadS CreateNotificationRuleResponse)
-> ReadS [CreateNotificationRuleResponse]
-> ReadPrec CreateNotificationRuleResponse
-> ReadPrec [CreateNotificationRuleResponse]
-> Read CreateNotificationRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNotificationRuleResponse]
$creadListPrec :: ReadPrec [CreateNotificationRuleResponse]
readPrec :: ReadPrec CreateNotificationRuleResponse
$creadPrec :: ReadPrec CreateNotificationRuleResponse
readList :: ReadS [CreateNotificationRuleResponse]
$creadList :: ReadS [CreateNotificationRuleResponse]
readsPrec :: Int -> ReadS CreateNotificationRuleResponse
$creadsPrec :: Int -> ReadS CreateNotificationRuleResponse
Prelude.Read, Int -> CreateNotificationRuleResponse -> ShowS
[CreateNotificationRuleResponse] -> ShowS
CreateNotificationRuleResponse -> String
(Int -> CreateNotificationRuleResponse -> ShowS)
-> (CreateNotificationRuleResponse -> String)
-> ([CreateNotificationRuleResponse] -> ShowS)
-> Show CreateNotificationRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotificationRuleResponse] -> ShowS
$cshowList :: [CreateNotificationRuleResponse] -> ShowS
show :: CreateNotificationRuleResponse -> String
$cshow :: CreateNotificationRuleResponse -> String
showsPrec :: Int -> CreateNotificationRuleResponse -> ShowS
$cshowsPrec :: Int -> CreateNotificationRuleResponse -> ShowS
Prelude.Show, (forall x.
CreateNotificationRuleResponse
-> Rep CreateNotificationRuleResponse x)
-> (forall x.
Rep CreateNotificationRuleResponse x
-> CreateNotificationRuleResponse)
-> Generic CreateNotificationRuleResponse
forall x.
Rep CreateNotificationRuleResponse x
-> CreateNotificationRuleResponse
forall x.
CreateNotificationRuleResponse
-> Rep CreateNotificationRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNotificationRuleResponse x
-> CreateNotificationRuleResponse
$cfrom :: forall x.
CreateNotificationRuleResponse
-> Rep CreateNotificationRuleResponse x
Prelude.Generic)
newCreateNotificationRuleResponse ::
Prelude.Int ->
CreateNotificationRuleResponse
newCreateNotificationRuleResponse :: Int -> CreateNotificationRuleResponse
newCreateNotificationRuleResponse Int
pHttpStatus_ =
CreateNotificationRuleResponse' :: Maybe Text -> Int -> CreateNotificationRuleResponse
CreateNotificationRuleResponse'
{ $sel:arn:CreateNotificationRuleResponse' :: Maybe Text
arn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateNotificationRuleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createNotificationRuleResponse_arn :: Lens.Lens' CreateNotificationRuleResponse (Prelude.Maybe Prelude.Text)
createNotificationRuleResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateNotificationRuleResponse
-> f CreateNotificationRuleResponse
createNotificationRuleResponse_arn = (CreateNotificationRuleResponse -> Maybe Text)
-> (CreateNotificationRuleResponse
-> Maybe Text -> CreateNotificationRuleResponse)
-> Lens
CreateNotificationRuleResponse
CreateNotificationRuleResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRuleResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateNotificationRuleResponse' :: CreateNotificationRuleResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateNotificationRuleResponse
s@CreateNotificationRuleResponse' {} Maybe Text
a -> CreateNotificationRuleResponse
s {$sel:arn:CreateNotificationRuleResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateNotificationRuleResponse)
createNotificationRuleResponse_httpStatus :: Lens.Lens' CreateNotificationRuleResponse Prelude.Int
createNotificationRuleResponse_httpStatus :: (Int -> f Int)
-> CreateNotificationRuleResponse
-> f CreateNotificationRuleResponse
createNotificationRuleResponse_httpStatus = (CreateNotificationRuleResponse -> Int)
-> (CreateNotificationRuleResponse
-> Int -> CreateNotificationRuleResponse)
-> Lens
CreateNotificationRuleResponse
CreateNotificationRuleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotificationRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateNotificationRuleResponse' :: CreateNotificationRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateNotificationRuleResponse
s@CreateNotificationRuleResponse' {} Int
a -> CreateNotificationRuleResponse
s {$sel:httpStatus:CreateNotificationRuleResponse' :: Int
httpStatus = Int
a} :: CreateNotificationRuleResponse)
instance
Prelude.NFData
CreateNotificationRuleResponse