{-# 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.DescribeNotificationRule
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about a specified notification rule.
module Amazonka.CodeStarNotifications.DescribeNotificationRule
  ( -- * Creating a Request
    DescribeNotificationRule (..),
    newDescribeNotificationRule,

    -- * Request Lenses
    describeNotificationRule_arn,

    -- * Destructuring the Response
    DescribeNotificationRuleResponse (..),
    newDescribeNotificationRuleResponse,

    -- * Response Lenses
    describeNotificationRuleResponse_createdBy,
    describeNotificationRuleResponse_createdTimestamp,
    describeNotificationRuleResponse_detailType,
    describeNotificationRuleResponse_eventTypes,
    describeNotificationRuleResponse_lastModifiedTimestamp,
    describeNotificationRuleResponse_name,
    describeNotificationRuleResponse_resource,
    describeNotificationRuleResponse_status,
    describeNotificationRuleResponse_tags,
    describeNotificationRuleResponse_targets,
    describeNotificationRuleResponse_httpStatus,
    describeNotificationRuleResponse_arn,
  )
where

import Amazonka.CodeStarNotifications.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeNotificationRule' smart constructor.
data DescribeNotificationRule = DescribeNotificationRule'
  { -- | The Amazon Resource Name (ARN) of the notification rule.
    DescribeNotificationRule -> Text
arn :: Prelude.Text
  }
  deriving (DescribeNotificationRule -> DescribeNotificationRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNotificationRule -> DescribeNotificationRule -> Bool
$c/= :: DescribeNotificationRule -> DescribeNotificationRule -> Bool
== :: DescribeNotificationRule -> DescribeNotificationRule -> Bool
$c== :: DescribeNotificationRule -> DescribeNotificationRule -> Bool
Prelude.Eq, ReadPrec [DescribeNotificationRule]
ReadPrec DescribeNotificationRule
Int -> ReadS DescribeNotificationRule
ReadS [DescribeNotificationRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNotificationRule]
$creadListPrec :: ReadPrec [DescribeNotificationRule]
readPrec :: ReadPrec DescribeNotificationRule
$creadPrec :: ReadPrec DescribeNotificationRule
readList :: ReadS [DescribeNotificationRule]
$creadList :: ReadS [DescribeNotificationRule]
readsPrec :: Int -> ReadS DescribeNotificationRule
$creadsPrec :: Int -> ReadS DescribeNotificationRule
Prelude.Read, Int -> DescribeNotificationRule -> ShowS
[DescribeNotificationRule] -> ShowS
DescribeNotificationRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNotificationRule] -> ShowS
$cshowList :: [DescribeNotificationRule] -> ShowS
show :: DescribeNotificationRule -> String
$cshow :: DescribeNotificationRule -> String
showsPrec :: Int -> DescribeNotificationRule -> ShowS
$cshowsPrec :: Int -> DescribeNotificationRule -> ShowS
Prelude.Show, forall x.
Rep DescribeNotificationRule x -> DescribeNotificationRule
forall x.
DescribeNotificationRule -> Rep DescribeNotificationRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNotificationRule x -> DescribeNotificationRule
$cfrom :: forall x.
DescribeNotificationRule -> Rep DescribeNotificationRule x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNotificationRule' 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:
--
-- 'arn', 'describeNotificationRule_arn' - The Amazon Resource Name (ARN) of the notification rule.
newDescribeNotificationRule ::
  -- | 'arn'
  Prelude.Text ->
  DescribeNotificationRule
newDescribeNotificationRule :: Text -> DescribeNotificationRule
newDescribeNotificationRule Text
pArn_ =
  DescribeNotificationRule' {$sel:arn:DescribeNotificationRule' :: Text
arn = Text
pArn_}

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

instance Core.AWSRequest DescribeNotificationRule where
  type
    AWSResponse DescribeNotificationRule =
      DescribeNotificationRuleResponse
  request :: (Service -> Service)
-> DescribeNotificationRule -> Request DescribeNotificationRule
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeNotificationRule
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeNotificationRule)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe DetailType
-> Maybe [EventTypeSummary]
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe NotificationRuleStatus
-> Maybe (HashMap Text Text)
-> Maybe [TargetSummary]
-> Int
-> Text
-> DescribeNotificationRuleResponse
DescribeNotificationRuleResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreatedBy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreatedTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DetailType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventTypes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Resource")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Targets" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"Arn")
      )

instance Prelude.Hashable DescribeNotificationRule where
  hashWithSalt :: Int -> DescribeNotificationRule -> Int
hashWithSalt Int
_salt DescribeNotificationRule' {Text
arn :: Text
$sel:arn:DescribeNotificationRule' :: DescribeNotificationRule -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData DescribeNotificationRule where
  rnf :: DescribeNotificationRule -> ()
rnf DescribeNotificationRule' {Text
arn :: Text
$sel:arn:DescribeNotificationRule' :: DescribeNotificationRule -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn

instance Data.ToHeaders DescribeNotificationRule where
  toHeaders :: DescribeNotificationRule -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeNotificationRule where
  toJSON :: DescribeNotificationRule -> Value
toJSON DescribeNotificationRule' {Text
arn :: Text
$sel:arn:DescribeNotificationRule' :: DescribeNotificationRule -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"Arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)]
      )

instance Data.ToPath DescribeNotificationRule where
  toPath :: DescribeNotificationRule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/describeNotificationRule"

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

-- | /See:/ 'newDescribeNotificationRuleResponse' smart constructor.
data DescribeNotificationRuleResponse = DescribeNotificationRuleResponse'
  { -- | The name or email alias of the person who created the notification rule.
    DescribeNotificationRuleResponse -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The date and time the notification rule was created, in timestamp
    -- format.
    DescribeNotificationRuleResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The level of detail included in the notifications for this resource.
    -- BASIC will include only the contents of the event as it would appear in
    -- Amazon 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.
    DescribeNotificationRuleResponse -> Maybe DetailType
detailType :: Prelude.Maybe DetailType,
    -- | A list of the event types associated with the notification rule.
    DescribeNotificationRuleResponse -> Maybe [EventTypeSummary]
eventTypes :: Prelude.Maybe [EventTypeSummary],
    -- | The date and time the notification rule was most recently updated, in
    -- timestamp format.
    DescribeNotificationRuleResponse -> Maybe POSIX
lastModifiedTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The name of the notification rule.
    DescribeNotificationRuleResponse -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the resource associated with the
    -- notification rule.
    DescribeNotificationRuleResponse -> Maybe Text
resource :: Prelude.Maybe Prelude.Text,
    -- | The status of the notification rule. Valid statuses are on (sending
    -- notifications) or off (not sending notifications).
    DescribeNotificationRuleResponse -> Maybe NotificationRuleStatus
status :: Prelude.Maybe NotificationRuleStatus,
    -- | The tags associated with the notification rule.
    DescribeNotificationRuleResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A list of the Chatbot topics and Chatbot clients associated with the
    -- notification rule.
    DescribeNotificationRuleResponse -> Maybe [TargetSummary]
targets :: Prelude.Maybe [TargetSummary],
    -- | The response's http status code.
    DescribeNotificationRuleResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the notification rule.
    DescribeNotificationRuleResponse -> Text
arn :: Prelude.Text
  }
  deriving (DescribeNotificationRuleResponse
-> DescribeNotificationRuleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNotificationRuleResponse
-> DescribeNotificationRuleResponse -> Bool
$c/= :: DescribeNotificationRuleResponse
-> DescribeNotificationRuleResponse -> Bool
== :: DescribeNotificationRuleResponse
-> DescribeNotificationRuleResponse -> Bool
$c== :: DescribeNotificationRuleResponse
-> DescribeNotificationRuleResponse -> Bool
Prelude.Eq, Int -> DescribeNotificationRuleResponse -> ShowS
[DescribeNotificationRuleResponse] -> ShowS
DescribeNotificationRuleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNotificationRuleResponse] -> ShowS
$cshowList :: [DescribeNotificationRuleResponse] -> ShowS
show :: DescribeNotificationRuleResponse -> String
$cshow :: DescribeNotificationRuleResponse -> String
showsPrec :: Int -> DescribeNotificationRuleResponse -> ShowS
$cshowsPrec :: Int -> DescribeNotificationRuleResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeNotificationRuleResponse x
-> DescribeNotificationRuleResponse
forall x.
DescribeNotificationRuleResponse
-> Rep DescribeNotificationRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNotificationRuleResponse x
-> DescribeNotificationRuleResponse
$cfrom :: forall x.
DescribeNotificationRuleResponse
-> Rep DescribeNotificationRuleResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNotificationRuleResponse' 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:
--
-- 'createdBy', 'describeNotificationRuleResponse_createdBy' - The name or email alias of the person who created the notification rule.
--
-- 'createdTimestamp', 'describeNotificationRuleResponse_createdTimestamp' - The date and time the notification rule was created, in timestamp
-- format.
--
-- 'detailType', 'describeNotificationRuleResponse_detailType' - The level of detail included in the notifications for this resource.
-- BASIC will include only the contents of the event as it would appear in
-- Amazon 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.
--
-- 'eventTypes', 'describeNotificationRuleResponse_eventTypes' - A list of the event types associated with the notification rule.
--
-- 'lastModifiedTimestamp', 'describeNotificationRuleResponse_lastModifiedTimestamp' - The date and time the notification rule was most recently updated, in
-- timestamp format.
--
-- 'name', 'describeNotificationRuleResponse_name' - The name of the notification rule.
--
-- 'resource', 'describeNotificationRuleResponse_resource' - The Amazon Resource Name (ARN) of the resource associated with the
-- notification rule.
--
-- 'status', 'describeNotificationRuleResponse_status' - The status of the notification rule. Valid statuses are on (sending
-- notifications) or off (not sending notifications).
--
-- 'tags', 'describeNotificationRuleResponse_tags' - The tags associated with the notification rule.
--
-- 'targets', 'describeNotificationRuleResponse_targets' - A list of the Chatbot topics and Chatbot clients associated with the
-- notification rule.
--
-- 'httpStatus', 'describeNotificationRuleResponse_httpStatus' - The response's http status code.
--
-- 'arn', 'describeNotificationRuleResponse_arn' - The Amazon Resource Name (ARN) of the notification rule.
newDescribeNotificationRuleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'arn'
  Prelude.Text ->
  DescribeNotificationRuleResponse
newDescribeNotificationRuleResponse :: Int -> Text -> DescribeNotificationRuleResponse
newDescribeNotificationRuleResponse
  Int
pHttpStatus_
  Text
pArn_ =
    DescribeNotificationRuleResponse'
      { $sel:createdBy:DescribeNotificationRuleResponse' :: Maybe Text
createdBy =
          forall a. Maybe a
Prelude.Nothing,
        $sel:createdTimestamp:DescribeNotificationRuleResponse' :: Maybe POSIX
createdTimestamp = forall a. Maybe a
Prelude.Nothing,
        $sel:detailType:DescribeNotificationRuleResponse' :: Maybe DetailType
detailType = forall a. Maybe a
Prelude.Nothing,
        $sel:eventTypes:DescribeNotificationRuleResponse' :: Maybe [EventTypeSummary]
eventTypes = forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedTimestamp:DescribeNotificationRuleResponse' :: Maybe POSIX
lastModifiedTimestamp = forall a. Maybe a
Prelude.Nothing,
        $sel:name:DescribeNotificationRuleResponse' :: Maybe (Sensitive Text)
name = forall a. Maybe a
Prelude.Nothing,
        $sel:resource:DescribeNotificationRuleResponse' :: Maybe Text
resource = forall a. Maybe a
Prelude.Nothing,
        $sel:status:DescribeNotificationRuleResponse' :: Maybe NotificationRuleStatus
status = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:DescribeNotificationRuleResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:targets:DescribeNotificationRuleResponse' :: Maybe [TargetSummary]
targets = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeNotificationRuleResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:arn:DescribeNotificationRuleResponse' :: Text
arn = Text
pArn_
      }

-- | The name or email alias of the person who created the notification rule.
describeNotificationRuleResponse_createdBy :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe Prelude.Text)
describeNotificationRuleResponse_createdBy :: Lens' DescribeNotificationRuleResponse (Maybe Text)
describeNotificationRuleResponse_createdBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe Text
a -> DescribeNotificationRuleResponse
s {$sel:createdBy:DescribeNotificationRuleResponse' :: Maybe Text
createdBy = Maybe Text
a} :: DescribeNotificationRuleResponse)

-- | The date and time the notification rule was created, in timestamp
-- format.
describeNotificationRuleResponse_createdTimestamp :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe Prelude.UTCTime)
describeNotificationRuleResponse_createdTimestamp :: Lens' DescribeNotificationRuleResponse (Maybe UTCTime)
describeNotificationRuleResponse_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe POSIX
a -> DescribeNotificationRuleResponse
s {$sel:createdTimestamp:DescribeNotificationRuleResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: DescribeNotificationRuleResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The level of detail included in the notifications for this resource.
-- BASIC will include only the contents of the event as it would appear in
-- Amazon 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.
describeNotificationRuleResponse_detailType :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe DetailType)
describeNotificationRuleResponse_detailType :: Lens' DescribeNotificationRuleResponse (Maybe DetailType)
describeNotificationRuleResponse_detailType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe DetailType
detailType :: Maybe DetailType
$sel:detailType:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe DetailType
detailType} -> Maybe DetailType
detailType) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe DetailType
a -> DescribeNotificationRuleResponse
s {$sel:detailType:DescribeNotificationRuleResponse' :: Maybe DetailType
detailType = Maybe DetailType
a} :: DescribeNotificationRuleResponse)

-- | A list of the event types associated with the notification rule.
describeNotificationRuleResponse_eventTypes :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe [EventTypeSummary])
describeNotificationRuleResponse_eventTypes :: Lens' DescribeNotificationRuleResponse (Maybe [EventTypeSummary])
describeNotificationRuleResponse_eventTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe [EventTypeSummary]
eventTypes :: Maybe [EventTypeSummary]
$sel:eventTypes:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe [EventTypeSummary]
eventTypes} -> Maybe [EventTypeSummary]
eventTypes) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe [EventTypeSummary]
a -> DescribeNotificationRuleResponse
s {$sel:eventTypes:DescribeNotificationRuleResponse' :: Maybe [EventTypeSummary]
eventTypes = Maybe [EventTypeSummary]
a} :: DescribeNotificationRuleResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date and time the notification rule was most recently updated, in
-- timestamp format.
describeNotificationRuleResponse_lastModifiedTimestamp :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe Prelude.UTCTime)
describeNotificationRuleResponse_lastModifiedTimestamp :: Lens' DescribeNotificationRuleResponse (Maybe UTCTime)
describeNotificationRuleResponse_lastModifiedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe POSIX
lastModifiedTimestamp :: Maybe POSIX
$sel:lastModifiedTimestamp:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe POSIX
lastModifiedTimestamp} -> Maybe POSIX
lastModifiedTimestamp) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe POSIX
a -> DescribeNotificationRuleResponse
s {$sel:lastModifiedTimestamp:DescribeNotificationRuleResponse' :: Maybe POSIX
lastModifiedTimestamp = Maybe POSIX
a} :: DescribeNotificationRuleResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

-- | The Amazon Resource Name (ARN) of the resource associated with the
-- notification rule.
describeNotificationRuleResponse_resource :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe Prelude.Text)
describeNotificationRuleResponse_resource :: Lens' DescribeNotificationRuleResponse (Maybe Text)
describeNotificationRuleResponse_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe Text
resource :: Maybe Text
$sel:resource:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe Text
resource} -> Maybe Text
resource) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe Text
a -> DescribeNotificationRuleResponse
s {$sel:resource:DescribeNotificationRuleResponse' :: Maybe Text
resource = Maybe Text
a} :: DescribeNotificationRuleResponse)

-- | The status of the notification rule. Valid statuses are on (sending
-- notifications) or off (not sending notifications).
describeNotificationRuleResponse_status :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe NotificationRuleStatus)
describeNotificationRuleResponse_status :: Lens'
  DescribeNotificationRuleResponse (Maybe NotificationRuleStatus)
describeNotificationRuleResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe NotificationRuleStatus
status :: Maybe NotificationRuleStatus
$sel:status:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe NotificationRuleStatus
status} -> Maybe NotificationRuleStatus
status) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe NotificationRuleStatus
a -> DescribeNotificationRuleResponse
s {$sel:status:DescribeNotificationRuleResponse' :: Maybe NotificationRuleStatus
status = Maybe NotificationRuleStatus
a} :: DescribeNotificationRuleResponse)

-- | The tags associated with the notification rule.
describeNotificationRuleResponse_tags :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
describeNotificationRuleResponse_tags :: Lens' DescribeNotificationRuleResponse (Maybe (HashMap Text Text))
describeNotificationRuleResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe (HashMap Text Text)
a -> DescribeNotificationRuleResponse
s {$sel:tags:DescribeNotificationRuleResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: DescribeNotificationRuleResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of the Chatbot topics and Chatbot clients associated with the
-- notification rule.
describeNotificationRuleResponse_targets :: Lens.Lens' DescribeNotificationRuleResponse (Prelude.Maybe [TargetSummary])
describeNotificationRuleResponse_targets :: Lens' DescribeNotificationRuleResponse (Maybe [TargetSummary])
describeNotificationRuleResponse_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationRuleResponse' {Maybe [TargetSummary]
targets :: Maybe [TargetSummary]
$sel:targets:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe [TargetSummary]
targets} -> Maybe [TargetSummary]
targets) (\s :: DescribeNotificationRuleResponse
s@DescribeNotificationRuleResponse' {} Maybe [TargetSummary]
a -> DescribeNotificationRuleResponse
s {$sel:targets:DescribeNotificationRuleResponse' :: Maybe [TargetSummary]
targets = Maybe [TargetSummary]
a} :: DescribeNotificationRuleResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    DescribeNotificationRuleResponse
  where
  rnf :: DescribeNotificationRuleResponse -> ()
rnf DescribeNotificationRuleResponse' {Int
Maybe [EventTypeSummary]
Maybe [TargetSummary]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe POSIX
Maybe DetailType
Maybe NotificationRuleStatus
Text
arn :: Text
httpStatus :: Int
targets :: Maybe [TargetSummary]
tags :: Maybe (HashMap Text Text)
status :: Maybe NotificationRuleStatus
resource :: Maybe Text
name :: Maybe (Sensitive Text)
lastModifiedTimestamp :: Maybe POSIX
eventTypes :: Maybe [EventTypeSummary]
detailType :: Maybe DetailType
createdTimestamp :: Maybe POSIX
createdBy :: Maybe Text
$sel:arn:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Text
$sel:httpStatus:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Int
$sel:targets:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe [TargetSummary]
$sel:tags:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe (HashMap Text Text)
$sel:status:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe NotificationRuleStatus
$sel:resource:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe Text
$sel:name:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe (Sensitive Text)
$sel:lastModifiedTimestamp:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe POSIX
$sel:eventTypes:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe [EventTypeSummary]
$sel:detailType:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe DetailType
$sel:createdTimestamp:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe POSIX
$sel:createdBy:DescribeNotificationRuleResponse' :: DescribeNotificationRuleResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DetailType
detailType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EventTypeSummary]
eventTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationRuleStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TargetSummary]
targets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn