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

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

-- |
-- Module      : Amazonka.CodeStarNotifications.UpdateNotificationRule
-- Copyright   : (c) 2013-2021 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)
--
-- Updates a notification rule for a resource. You can change the events
-- that trigger the notification rule, the status of the rule, and the
-- targets that receive the notifications.
--
-- To add or remove tags for a notification rule, you must use TagResource
-- and UntagResource.
module Amazonka.CodeStarNotifications.UpdateNotificationRule
  ( -- * Creating a Request
    UpdateNotificationRule (..),
    newUpdateNotificationRule,

    -- * Request Lenses
    updateNotificationRule_status,
    updateNotificationRule_eventTypeIds,
    updateNotificationRule_detailType,
    updateNotificationRule_name,
    updateNotificationRule_targets,
    updateNotificationRule_arn,

    -- * Destructuring the Response
    UpdateNotificationRuleResponse (..),
    newUpdateNotificationRuleResponse,

    -- * Response Lenses
    updateNotificationRuleResponse_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

-- | /See:/ 'newUpdateNotificationRule' smart constructor.
data UpdateNotificationRule = UpdateNotificationRule'
  { -- | The status of the notification rule. Valid statuses include enabled
    -- (sending notifications) or disabled (not sending notifications).
    UpdateNotificationRule -> Maybe NotificationRuleStatus
status :: Prelude.Maybe NotificationRuleStatus,
    -- | A list of event types associated with this notification rule.
    UpdateNotificationRule -> Maybe [Text]
eventTypeIds :: Prelude.Maybe [Prelude.Text],
    -- | The level of detail to include in the notifications for this resource.
    -- BASIC will include only the contents of the event as it would appear in
    -- AWS CloudWatch. FULL will include any supplemental information provided
    -- by AWS CodeStar Notifications and\/or the service for the resource for
    -- which the notification is created.
    UpdateNotificationRule -> Maybe DetailType
detailType :: Prelude.Maybe DetailType,
    -- | The name of the notification rule.
    UpdateNotificationRule -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The address and type of the targets to receive notifications from this
    -- notification rule.
    UpdateNotificationRule -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | The Amazon Resource Name (ARN) of the notification rule.
    UpdateNotificationRule -> Text
arn :: Prelude.Text
  }
  deriving (UpdateNotificationRule -> UpdateNotificationRule -> Bool
(UpdateNotificationRule -> UpdateNotificationRule -> Bool)
-> (UpdateNotificationRule -> UpdateNotificationRule -> Bool)
-> Eq UpdateNotificationRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNotificationRule -> UpdateNotificationRule -> Bool
$c/= :: UpdateNotificationRule -> UpdateNotificationRule -> Bool
== :: UpdateNotificationRule -> UpdateNotificationRule -> Bool
$c== :: UpdateNotificationRule -> UpdateNotificationRule -> Bool
Prelude.Eq, Int -> UpdateNotificationRule -> ShowS
[UpdateNotificationRule] -> ShowS
UpdateNotificationRule -> String
(Int -> UpdateNotificationRule -> ShowS)
-> (UpdateNotificationRule -> String)
-> ([UpdateNotificationRule] -> ShowS)
-> Show UpdateNotificationRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNotificationRule] -> ShowS
$cshowList :: [UpdateNotificationRule] -> ShowS
show :: UpdateNotificationRule -> String
$cshow :: UpdateNotificationRule -> String
showsPrec :: Int -> UpdateNotificationRule -> ShowS
$cshowsPrec :: Int -> UpdateNotificationRule -> ShowS
Prelude.Show, (forall x. UpdateNotificationRule -> Rep UpdateNotificationRule x)
-> (forall x.
    Rep UpdateNotificationRule x -> UpdateNotificationRule)
-> Generic UpdateNotificationRule
forall x. Rep UpdateNotificationRule x -> UpdateNotificationRule
forall x. UpdateNotificationRule -> Rep UpdateNotificationRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateNotificationRule x -> UpdateNotificationRule
$cfrom :: forall x. UpdateNotificationRule -> Rep UpdateNotificationRule x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNotificationRule' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'updateNotificationRule_status' - The status of the notification rule. Valid statuses include enabled
-- (sending notifications) or disabled (not sending notifications).
--
-- 'eventTypeIds', 'updateNotificationRule_eventTypeIds' - A list of event types associated with this notification rule.
--
-- 'detailType', 'updateNotificationRule_detailType' - The level of detail to include in the notifications for this resource.
-- BASIC will include only the contents of the event as it would appear in
-- AWS CloudWatch. FULL will include any supplemental information provided
-- by AWS CodeStar Notifications and\/or the service for the resource for
-- which the notification is created.
--
-- 'name', 'updateNotificationRule_name' - The name of the notification rule.
--
-- 'targets', 'updateNotificationRule_targets' - The address and type of the targets to receive notifications from this
-- notification rule.
--
-- 'arn', 'updateNotificationRule_arn' - The Amazon Resource Name (ARN) of the notification rule.
newUpdateNotificationRule ::
  -- | 'arn'
  Prelude.Text ->
  UpdateNotificationRule
newUpdateNotificationRule :: Text -> UpdateNotificationRule
newUpdateNotificationRule Text
pArn_ =
  UpdateNotificationRule' :: Maybe NotificationRuleStatus
-> Maybe [Text]
-> Maybe DetailType
-> Maybe (Sensitive Text)
-> Maybe [Target]
-> Text
-> UpdateNotificationRule
UpdateNotificationRule'
    { $sel:status:UpdateNotificationRule' :: Maybe NotificationRuleStatus
status = Maybe NotificationRuleStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTypeIds:UpdateNotificationRule' :: Maybe [Text]
eventTypeIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:detailType:UpdateNotificationRule' :: Maybe DetailType
detailType = Maybe DetailType
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateNotificationRule' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:UpdateNotificationRule' :: Maybe [Target]
targets = Maybe [Target]
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateNotificationRule' :: Text
arn = Text
pArn_
    }

-- | The status of the notification rule. Valid statuses include enabled
-- (sending notifications) or disabled (not sending notifications).
updateNotificationRule_status :: Lens.Lens' UpdateNotificationRule (Prelude.Maybe NotificationRuleStatus)
updateNotificationRule_status :: (Maybe NotificationRuleStatus -> f (Maybe NotificationRuleStatus))
-> UpdateNotificationRule -> f UpdateNotificationRule
updateNotificationRule_status = (UpdateNotificationRule -> Maybe NotificationRuleStatus)
-> (UpdateNotificationRule
    -> Maybe NotificationRuleStatus -> UpdateNotificationRule)
-> Lens
     UpdateNotificationRule
     UpdateNotificationRule
     (Maybe NotificationRuleStatus)
     (Maybe NotificationRuleStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRule' {Maybe NotificationRuleStatus
status :: Maybe NotificationRuleStatus
$sel:status:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe NotificationRuleStatus
status} -> Maybe NotificationRuleStatus
status) (\s :: UpdateNotificationRule
s@UpdateNotificationRule' {} Maybe NotificationRuleStatus
a -> UpdateNotificationRule
s {$sel:status:UpdateNotificationRule' :: Maybe NotificationRuleStatus
status = Maybe NotificationRuleStatus
a} :: UpdateNotificationRule)

-- | A list of event types associated with this notification rule.
updateNotificationRule_eventTypeIds :: Lens.Lens' UpdateNotificationRule (Prelude.Maybe [Prelude.Text])
updateNotificationRule_eventTypeIds :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateNotificationRule -> f UpdateNotificationRule
updateNotificationRule_eventTypeIds = (UpdateNotificationRule -> Maybe [Text])
-> (UpdateNotificationRule
    -> Maybe [Text] -> UpdateNotificationRule)
-> Lens
     UpdateNotificationRule
     UpdateNotificationRule
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRule' {Maybe [Text]
eventTypeIds :: Maybe [Text]
$sel:eventTypeIds:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe [Text]
eventTypeIds} -> Maybe [Text]
eventTypeIds) (\s :: UpdateNotificationRule
s@UpdateNotificationRule' {} Maybe [Text]
a -> UpdateNotificationRule
s {$sel:eventTypeIds:UpdateNotificationRule' :: Maybe [Text]
eventTypeIds = Maybe [Text]
a} :: UpdateNotificationRule) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateNotificationRule -> f UpdateNotificationRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateNotificationRule
-> f UpdateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The level of detail to include in the notifications for this resource.
-- BASIC will include only the contents of the event as it would appear in
-- AWS CloudWatch. FULL will include any supplemental information provided
-- by AWS CodeStar Notifications and\/or the service for the resource for
-- which the notification is created.
updateNotificationRule_detailType :: Lens.Lens' UpdateNotificationRule (Prelude.Maybe DetailType)
updateNotificationRule_detailType :: (Maybe DetailType -> f (Maybe DetailType))
-> UpdateNotificationRule -> f UpdateNotificationRule
updateNotificationRule_detailType = (UpdateNotificationRule -> Maybe DetailType)
-> (UpdateNotificationRule
    -> Maybe DetailType -> UpdateNotificationRule)
-> Lens
     UpdateNotificationRule
     UpdateNotificationRule
     (Maybe DetailType)
     (Maybe DetailType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRule' {Maybe DetailType
detailType :: Maybe DetailType
$sel:detailType:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe DetailType
detailType} -> Maybe DetailType
detailType) (\s :: UpdateNotificationRule
s@UpdateNotificationRule' {} Maybe DetailType
a -> UpdateNotificationRule
s {$sel:detailType:UpdateNotificationRule' :: Maybe DetailType
detailType = Maybe DetailType
a} :: UpdateNotificationRule)

-- | The name of the notification rule.
updateNotificationRule_name :: Lens.Lens' UpdateNotificationRule (Prelude.Maybe Prelude.Text)
updateNotificationRule_name :: (Maybe Text -> f (Maybe Text))
-> UpdateNotificationRule -> f UpdateNotificationRule
updateNotificationRule_name = (UpdateNotificationRule -> Maybe (Sensitive Text))
-> (UpdateNotificationRule
    -> Maybe (Sensitive Text) -> UpdateNotificationRule)
-> Lens
     UpdateNotificationRule
     UpdateNotificationRule
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRule' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: UpdateNotificationRule
s@UpdateNotificationRule' {} Maybe (Sensitive Text)
a -> UpdateNotificationRule
s {$sel:name:UpdateNotificationRule' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: UpdateNotificationRule) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateNotificationRule -> f UpdateNotificationRule)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateNotificationRule
-> f UpdateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The address and type of the targets to receive notifications from this
-- notification rule.
updateNotificationRule_targets :: Lens.Lens' UpdateNotificationRule (Prelude.Maybe [Target])
updateNotificationRule_targets :: (Maybe [Target] -> f (Maybe [Target]))
-> UpdateNotificationRule -> f UpdateNotificationRule
updateNotificationRule_targets = (UpdateNotificationRule -> Maybe [Target])
-> (UpdateNotificationRule
    -> Maybe [Target] -> UpdateNotificationRule)
-> Lens
     UpdateNotificationRule
     UpdateNotificationRule
     (Maybe [Target])
     (Maybe [Target])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRule' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: UpdateNotificationRule
s@UpdateNotificationRule' {} Maybe [Target]
a -> UpdateNotificationRule
s {$sel:targets:UpdateNotificationRule' :: Maybe [Target]
targets = Maybe [Target]
a} :: UpdateNotificationRule) ((Maybe [Target] -> f (Maybe [Target]))
 -> UpdateNotificationRule -> f UpdateNotificationRule)
-> ((Maybe [Target] -> f (Maybe [Target]))
    -> Maybe [Target] -> f (Maybe [Target]))
-> (Maybe [Target] -> f (Maybe [Target]))
-> UpdateNotificationRule
-> f UpdateNotificationRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Target] [Target] [Target] [Target]
-> Iso
     (Maybe [Target]) (Maybe [Target]) (Maybe [Target]) (Maybe [Target])
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 [Target] [Target] [Target] [Target]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the notification rule.
updateNotificationRule_arn :: Lens.Lens' UpdateNotificationRule Prelude.Text
updateNotificationRule_arn :: (Text -> f Text)
-> UpdateNotificationRule -> f UpdateNotificationRule
updateNotificationRule_arn = (UpdateNotificationRule -> Text)
-> (UpdateNotificationRule -> Text -> UpdateNotificationRule)
-> Lens UpdateNotificationRule UpdateNotificationRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRule' {Text
arn :: Text
$sel:arn:UpdateNotificationRule' :: UpdateNotificationRule -> Text
arn} -> Text
arn) (\s :: UpdateNotificationRule
s@UpdateNotificationRule' {} Text
a -> UpdateNotificationRule
s {$sel:arn:UpdateNotificationRule' :: Text
arn = Text
a} :: UpdateNotificationRule)

instance Core.AWSRequest UpdateNotificationRule where
  type
    AWSResponse UpdateNotificationRule =
      UpdateNotificationRuleResponse
  request :: UpdateNotificationRule -> Request UpdateNotificationRule
request = Service -> UpdateNotificationRule -> Request UpdateNotificationRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateNotificationRule
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNotificationRule)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateNotificationRule))
-> Logger
-> Service
-> Proxy UpdateNotificationRule
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNotificationRule)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateNotificationRuleResponse
UpdateNotificationRuleResponse'
            (Int -> UpdateNotificationRuleResponse)
-> Either String Int
-> Either String UpdateNotificationRuleResponse
forall (f :: * -> *) a b. Functor 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 UpdateNotificationRule

instance Prelude.NFData UpdateNotificationRule

instance Core.ToHeaders UpdateNotificationRule where
  toHeaders :: UpdateNotificationRule -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateNotificationRule -> 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 UpdateNotificationRule where
  toJSON :: UpdateNotificationRule -> Value
toJSON UpdateNotificationRule' {Maybe [Text]
Maybe [Target]
Maybe (Sensitive Text)
Maybe DetailType
Maybe NotificationRuleStatus
Text
arn :: Text
targets :: Maybe [Target]
name :: Maybe (Sensitive Text)
detailType :: Maybe DetailType
eventTypeIds :: Maybe [Text]
status :: Maybe NotificationRuleStatus
$sel:arn:UpdateNotificationRule' :: UpdateNotificationRule -> Text
$sel:targets:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe [Target]
$sel:name:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe (Sensitive Text)
$sel:detailType:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe DetailType
$sel:eventTypeIds:UpdateNotificationRule' :: UpdateNotificationRule -> Maybe [Text]
$sel:status:UpdateNotificationRule' :: UpdateNotificationRule -> 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
"EventTypeIds" 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]
eventTypeIds,
            (Text
"DetailType" Text -> DetailType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DetailType -> Pair) -> Maybe DetailType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DetailType
detailType,
            (Text
"Name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
name,
            (Text
"Targets" Text -> [Target] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Target] -> Pair) -> Maybe [Target] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Target]
targets,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
          ]
      )

instance Core.ToPath UpdateNotificationRule where
  toPath :: UpdateNotificationRule -> ByteString
toPath = ByteString -> UpdateNotificationRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/updateNotificationRule"

instance Core.ToQuery UpdateNotificationRule where
  toQuery :: UpdateNotificationRule -> QueryString
toQuery = QueryString -> UpdateNotificationRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateNotificationRuleResponse' smart constructor.
data UpdateNotificationRuleResponse = UpdateNotificationRuleResponse'
  { -- | The response's http status code.
    UpdateNotificationRuleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateNotificationRuleResponse
-> UpdateNotificationRuleResponse -> Bool
(UpdateNotificationRuleResponse
 -> UpdateNotificationRuleResponse -> Bool)
-> (UpdateNotificationRuleResponse
    -> UpdateNotificationRuleResponse -> Bool)
-> Eq UpdateNotificationRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNotificationRuleResponse
-> UpdateNotificationRuleResponse -> Bool
$c/= :: UpdateNotificationRuleResponse
-> UpdateNotificationRuleResponse -> Bool
== :: UpdateNotificationRuleResponse
-> UpdateNotificationRuleResponse -> Bool
$c== :: UpdateNotificationRuleResponse
-> UpdateNotificationRuleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateNotificationRuleResponse]
ReadPrec UpdateNotificationRuleResponse
Int -> ReadS UpdateNotificationRuleResponse
ReadS [UpdateNotificationRuleResponse]
(Int -> ReadS UpdateNotificationRuleResponse)
-> ReadS [UpdateNotificationRuleResponse]
-> ReadPrec UpdateNotificationRuleResponse
-> ReadPrec [UpdateNotificationRuleResponse]
-> Read UpdateNotificationRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateNotificationRuleResponse]
$creadListPrec :: ReadPrec [UpdateNotificationRuleResponse]
readPrec :: ReadPrec UpdateNotificationRuleResponse
$creadPrec :: ReadPrec UpdateNotificationRuleResponse
readList :: ReadS [UpdateNotificationRuleResponse]
$creadList :: ReadS [UpdateNotificationRuleResponse]
readsPrec :: Int -> ReadS UpdateNotificationRuleResponse
$creadsPrec :: Int -> ReadS UpdateNotificationRuleResponse
Prelude.Read, Int -> UpdateNotificationRuleResponse -> ShowS
[UpdateNotificationRuleResponse] -> ShowS
UpdateNotificationRuleResponse -> String
(Int -> UpdateNotificationRuleResponse -> ShowS)
-> (UpdateNotificationRuleResponse -> String)
-> ([UpdateNotificationRuleResponse] -> ShowS)
-> Show UpdateNotificationRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNotificationRuleResponse] -> ShowS
$cshowList :: [UpdateNotificationRuleResponse] -> ShowS
show :: UpdateNotificationRuleResponse -> String
$cshow :: UpdateNotificationRuleResponse -> String
showsPrec :: Int -> UpdateNotificationRuleResponse -> ShowS
$cshowsPrec :: Int -> UpdateNotificationRuleResponse -> ShowS
Prelude.Show, (forall x.
 UpdateNotificationRuleResponse
 -> Rep UpdateNotificationRuleResponse x)
-> (forall x.
    Rep UpdateNotificationRuleResponse x
    -> UpdateNotificationRuleResponse)
-> Generic UpdateNotificationRuleResponse
forall x.
Rep UpdateNotificationRuleResponse x
-> UpdateNotificationRuleResponse
forall x.
UpdateNotificationRuleResponse
-> Rep UpdateNotificationRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateNotificationRuleResponse x
-> UpdateNotificationRuleResponse
$cfrom :: forall x.
UpdateNotificationRuleResponse
-> Rep UpdateNotificationRuleResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNotificationRuleResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'updateNotificationRuleResponse_httpStatus' - The response's http status code.
newUpdateNotificationRuleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateNotificationRuleResponse
newUpdateNotificationRuleResponse :: Int -> UpdateNotificationRuleResponse
newUpdateNotificationRuleResponse Int
pHttpStatus_ =
  UpdateNotificationRuleResponse' :: Int -> UpdateNotificationRuleResponse
UpdateNotificationRuleResponse'
    { $sel:httpStatus:UpdateNotificationRuleResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
updateNotificationRuleResponse_httpStatus :: Lens.Lens' UpdateNotificationRuleResponse Prelude.Int
updateNotificationRuleResponse_httpStatus :: (Int -> f Int)
-> UpdateNotificationRuleResponse
-> f UpdateNotificationRuleResponse
updateNotificationRuleResponse_httpStatus = (UpdateNotificationRuleResponse -> Int)
-> (UpdateNotificationRuleResponse
    -> Int -> UpdateNotificationRuleResponse)
-> Lens
     UpdateNotificationRuleResponse
     UpdateNotificationRuleResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNotificationRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateNotificationRuleResponse' :: UpdateNotificationRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateNotificationRuleResponse
s@UpdateNotificationRuleResponse' {} Int
a -> UpdateNotificationRuleResponse
s {$sel:httpStatus:UpdateNotificationRuleResponse' :: Int
httpStatus = Int
a} :: UpdateNotificationRuleResponse)

instance
  Prelude.NFData
    UpdateNotificationRuleResponse