{-# 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.CloudWatchEvents.DescribeRule
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the specified rule.
--
-- DescribeRule does not list the targets of a rule. To see the targets
-- associated with a rule, use
-- <https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ListTargetsByRule.html ListTargetsByRule>.
module Amazonka.CloudWatchEvents.DescribeRule
  ( -- * Creating a Request
    DescribeRule (..),
    newDescribeRule,

    -- * Request Lenses
    describeRule_eventBusName,
    describeRule_name,

    -- * Destructuring the Response
    DescribeRuleResponse (..),
    newDescribeRuleResponse,

    -- * Response Lenses
    describeRuleResponse_arn,
    describeRuleResponse_createdBy,
    describeRuleResponse_description,
    describeRuleResponse_eventBusName,
    describeRuleResponse_eventPattern,
    describeRuleResponse_managedBy,
    describeRuleResponse_name,
    describeRuleResponse_roleArn,
    describeRuleResponse_scheduleExpression,
    describeRuleResponse_state,
    describeRuleResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.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:/ 'newDescribeRule' smart constructor.
data DescribeRule = DescribeRule'
  { -- | The name or ARN of the event bus associated with the rule. If you omit
    -- this, the default event bus is used.
    DescribeRule -> Maybe Text
eventBusName :: Prelude.Maybe Prelude.Text,
    -- | The name of the rule.
    DescribeRule -> Text
name :: Prelude.Text
  }
  deriving (DescribeRule -> DescribeRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRule -> DescribeRule -> Bool
$c/= :: DescribeRule -> DescribeRule -> Bool
== :: DescribeRule -> DescribeRule -> Bool
$c== :: DescribeRule -> DescribeRule -> Bool
Prelude.Eq, ReadPrec [DescribeRule]
ReadPrec DescribeRule
Int -> ReadS DescribeRule
ReadS [DescribeRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRule]
$creadListPrec :: ReadPrec [DescribeRule]
readPrec :: ReadPrec DescribeRule
$creadPrec :: ReadPrec DescribeRule
readList :: ReadS [DescribeRule]
$creadList :: ReadS [DescribeRule]
readsPrec :: Int -> ReadS DescribeRule
$creadsPrec :: Int -> ReadS DescribeRule
Prelude.Read, Int -> DescribeRule -> ShowS
[DescribeRule] -> ShowS
DescribeRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRule] -> ShowS
$cshowList :: [DescribeRule] -> ShowS
show :: DescribeRule -> String
$cshow :: DescribeRule -> String
showsPrec :: Int -> DescribeRule -> ShowS
$cshowsPrec :: Int -> DescribeRule -> ShowS
Prelude.Show, forall x. Rep DescribeRule x -> DescribeRule
forall x. DescribeRule -> Rep DescribeRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRule x -> DescribeRule
$cfrom :: forall x. DescribeRule -> Rep DescribeRule x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRule' 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:
--
-- 'eventBusName', 'describeRule_eventBusName' - The name or ARN of the event bus associated with the rule. If you omit
-- this, the default event bus is used.
--
-- 'name', 'describeRule_name' - The name of the rule.
newDescribeRule ::
  -- | 'name'
  Prelude.Text ->
  DescribeRule
newDescribeRule :: Text -> DescribeRule
newDescribeRule Text
pName_ =
  DescribeRule'
    { $sel:eventBusName:DescribeRule' :: Maybe Text
eventBusName = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeRule' :: Text
name = Text
pName_
    }

-- | The name or ARN of the event bus associated with the rule. If you omit
-- this, the default event bus is used.
describeRule_eventBusName :: Lens.Lens' DescribeRule (Prelude.Maybe Prelude.Text)
describeRule_eventBusName :: Lens' DescribeRule (Maybe Text)
describeRule_eventBusName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRule' {Maybe Text
eventBusName :: Maybe Text
$sel:eventBusName:DescribeRule' :: DescribeRule -> Maybe Text
eventBusName} -> Maybe Text
eventBusName) (\s :: DescribeRule
s@DescribeRule' {} Maybe Text
a -> DescribeRule
s {$sel:eventBusName:DescribeRule' :: Maybe Text
eventBusName = Maybe Text
a} :: DescribeRule)

-- | The name of the rule.
describeRule_name :: Lens.Lens' DescribeRule Prelude.Text
describeRule_name :: Lens' DescribeRule Text
describeRule_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRule' {Text
name :: Text
$sel:name:DescribeRule' :: DescribeRule -> Text
name} -> Text
name) (\s :: DescribeRule
s@DescribeRule' {} Text
a -> DescribeRule
s {$sel:name:DescribeRule' :: Text
name = Text
a} :: DescribeRule)

instance Core.AWSRequest DescribeRule where
  type AWSResponse DescribeRule = DescribeRuleResponse
  request :: (Service -> Service) -> DescribeRule -> Request DescribeRule
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 DescribeRule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeRule)))
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RuleState
-> Int
-> DescribeRuleResponse
DescribeRuleResponse'
            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
"Arn")
            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
"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
"Description")
            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
"EventBusName")
            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
"EventPattern")
            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
"ManagedBy")
            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
"RoleArn")
            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
"ScheduleExpression")
            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
"State")
            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))
      )

instance Prelude.Hashable DescribeRule where
  hashWithSalt :: Int -> DescribeRule -> Int
hashWithSalt Int
_salt DescribeRule' {Maybe Text
Text
name :: Text
eventBusName :: Maybe Text
$sel:name:DescribeRule' :: DescribeRule -> Text
$sel:eventBusName:DescribeRule' :: DescribeRule -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventBusName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData DescribeRule where
  rnf :: DescribeRule -> ()
rnf DescribeRule' {Maybe Text
Text
name :: Text
eventBusName :: Maybe Text
$sel:name:DescribeRule' :: DescribeRule -> Text
$sel:eventBusName:DescribeRule' :: DescribeRule -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventBusName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

instance Data.ToJSON DescribeRule where
  toJSON :: DescribeRule -> Value
toJSON DescribeRule' {Maybe Text
Text
name :: Text
eventBusName :: Maybe Text
$sel:name:DescribeRule' :: DescribeRule -> Text
$sel:eventBusName:DescribeRule' :: DescribeRule -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"EventBusName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
eventBusName,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newDescribeRuleResponse' smart constructor.
data DescribeRuleResponse = DescribeRuleResponse'
  { -- | The Amazon Resource Name (ARN) of the rule.
    DescribeRuleResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The account ID of the user that created the rule. If you use @PutRule@
    -- to put a rule on an event bus in another account, the other account is
    -- the owner of the rule, and the rule ARN includes the account ID for that
    -- account. However, the value for @CreatedBy@ is the account ID as the
    -- account that created the rule in the other account.
    DescribeRuleResponse -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The description of the rule.
    DescribeRuleResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the event bus associated with the rule.
    DescribeRuleResponse -> Maybe Text
eventBusName :: Prelude.Maybe Prelude.Text,
    -- | The event pattern. For more information, see
    -- <https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html Events and Event Patterns>
    -- in the /Amazon EventBridge User Guide/.
    DescribeRuleResponse -> Maybe Text
eventPattern :: Prelude.Maybe Prelude.Text,
    -- | If this is a managed rule, created by an Amazon Web Services service on
    -- your behalf, this field displays the principal name of the Amazon Web
    -- Services service that created the rule.
    DescribeRuleResponse -> Maybe Text
managedBy :: Prelude.Maybe Prelude.Text,
    -- | The name of the rule.
    DescribeRuleResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM role associated with the rule.
    DescribeRuleResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The scheduling expression. For example, \"cron(0 20 * * ? *)\", \"rate(5
    -- minutes)\".
    DescribeRuleResponse -> Maybe Text
scheduleExpression :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the rule is enabled or disabled.
    DescribeRuleResponse -> Maybe RuleState
state :: Prelude.Maybe RuleState,
    -- | The response's http status code.
    DescribeRuleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeRuleResponse -> DescribeRuleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleResponse -> DescribeRuleResponse -> Bool
$c/= :: DescribeRuleResponse -> DescribeRuleResponse -> Bool
== :: DescribeRuleResponse -> DescribeRuleResponse -> Bool
$c== :: DescribeRuleResponse -> DescribeRuleResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRuleResponse]
ReadPrec DescribeRuleResponse
Int -> ReadS DescribeRuleResponse
ReadS [DescribeRuleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleResponse]
$creadListPrec :: ReadPrec [DescribeRuleResponse]
readPrec :: ReadPrec DescribeRuleResponse
$creadPrec :: ReadPrec DescribeRuleResponse
readList :: ReadS [DescribeRuleResponse]
$creadList :: ReadS [DescribeRuleResponse]
readsPrec :: Int -> ReadS DescribeRuleResponse
$creadsPrec :: Int -> ReadS DescribeRuleResponse
Prelude.Read, Int -> DescribeRuleResponse -> ShowS
[DescribeRuleResponse] -> ShowS
DescribeRuleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleResponse] -> ShowS
$cshowList :: [DescribeRuleResponse] -> ShowS
show :: DescribeRuleResponse -> String
$cshow :: DescribeRuleResponse -> String
showsPrec :: Int -> DescribeRuleResponse -> ShowS
$cshowsPrec :: Int -> DescribeRuleResponse -> ShowS
Prelude.Show, forall x. Rep DescribeRuleResponse x -> DescribeRuleResponse
forall x. DescribeRuleResponse -> Rep DescribeRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRuleResponse x -> DescribeRuleResponse
$cfrom :: forall x. DescribeRuleResponse -> Rep DescribeRuleResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRuleResponse' 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', 'describeRuleResponse_arn' - The Amazon Resource Name (ARN) of the rule.
--
-- 'createdBy', 'describeRuleResponse_createdBy' - The account ID of the user that created the rule. If you use @PutRule@
-- to put a rule on an event bus in another account, the other account is
-- the owner of the rule, and the rule ARN includes the account ID for that
-- account. However, the value for @CreatedBy@ is the account ID as the
-- account that created the rule in the other account.
--
-- 'description', 'describeRuleResponse_description' - The description of the rule.
--
-- 'eventBusName', 'describeRuleResponse_eventBusName' - The name of the event bus associated with the rule.
--
-- 'eventPattern', 'describeRuleResponse_eventPattern' - The event pattern. For more information, see
-- <https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html Events and Event Patterns>
-- in the /Amazon EventBridge User Guide/.
--
-- 'managedBy', 'describeRuleResponse_managedBy' - If this is a managed rule, created by an Amazon Web Services service on
-- your behalf, this field displays the principal name of the Amazon Web
-- Services service that created the rule.
--
-- 'name', 'describeRuleResponse_name' - The name of the rule.
--
-- 'roleArn', 'describeRuleResponse_roleArn' - The Amazon Resource Name (ARN) of the IAM role associated with the rule.
--
-- 'scheduleExpression', 'describeRuleResponse_scheduleExpression' - The scheduling expression. For example, \"cron(0 20 * * ? *)\", \"rate(5
-- minutes)\".
--
-- 'state', 'describeRuleResponse_state' - Specifies whether the rule is enabled or disabled.
--
-- 'httpStatus', 'describeRuleResponse_httpStatus' - The response's http status code.
newDescribeRuleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeRuleResponse
newDescribeRuleResponse :: Int -> DescribeRuleResponse
newDescribeRuleResponse Int
pHttpStatus_ =
  DescribeRuleResponse'
    { $sel:arn:DescribeRuleResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:DescribeRuleResponse' :: Maybe Text
createdBy = forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribeRuleResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:eventBusName:DescribeRuleResponse' :: Maybe Text
eventBusName = forall a. Maybe a
Prelude.Nothing,
      $sel:eventPattern:DescribeRuleResponse' :: Maybe Text
eventPattern = forall a. Maybe a
Prelude.Nothing,
      $sel:managedBy:DescribeRuleResponse' :: Maybe Text
managedBy = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeRuleResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:DescribeRuleResponse' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleExpression:DescribeRuleResponse' :: Maybe Text
scheduleExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeRuleResponse' :: Maybe RuleState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeRuleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The account ID of the user that created the rule. If you use @PutRule@
-- to put a rule on an event bus in another account, the other account is
-- the owner of the rule, and the rule ARN includes the account ID for that
-- account. However, the value for @CreatedBy@ is the account ID as the
-- account that created the rule in the other account.
describeRuleResponse_createdBy :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_createdBy :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_createdBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:createdBy:DescribeRuleResponse' :: Maybe Text
createdBy = Maybe Text
a} :: DescribeRuleResponse)

-- | The description of the rule.
describeRuleResponse_description :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_description :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:description:DescribeRuleResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeRuleResponse)

-- | The name of the event bus associated with the rule.
describeRuleResponse_eventBusName :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_eventBusName :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_eventBusName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
eventBusName :: Maybe Text
$sel:eventBusName:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
eventBusName} -> Maybe Text
eventBusName) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:eventBusName:DescribeRuleResponse' :: Maybe Text
eventBusName = Maybe Text
a} :: DescribeRuleResponse)

-- | The event pattern. For more information, see
-- <https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html Events and Event Patterns>
-- in the /Amazon EventBridge User Guide/.
describeRuleResponse_eventPattern :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_eventPattern :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_eventPattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
eventPattern :: Maybe Text
$sel:eventPattern:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
eventPattern} -> Maybe Text
eventPattern) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:eventPattern:DescribeRuleResponse' :: Maybe Text
eventPattern = Maybe Text
a} :: DescribeRuleResponse)

-- | If this is a managed rule, created by an Amazon Web Services service on
-- your behalf, this field displays the principal name of the Amazon Web
-- Services service that created the rule.
describeRuleResponse_managedBy :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_managedBy :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_managedBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
managedBy :: Maybe Text
$sel:managedBy:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
managedBy} -> Maybe Text
managedBy) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:managedBy:DescribeRuleResponse' :: Maybe Text
managedBy = Maybe Text
a} :: DescribeRuleResponse)

-- | The name of the rule.
describeRuleResponse_name :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_name :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:name:DescribeRuleResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeRuleResponse)

-- | The Amazon Resource Name (ARN) of the IAM role associated with the rule.
describeRuleResponse_roleArn :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_roleArn :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:roleArn:DescribeRuleResponse' :: Maybe Text
roleArn = Maybe Text
a} :: DescribeRuleResponse)

-- | The scheduling expression. For example, \"cron(0 20 * * ? *)\", \"rate(5
-- minutes)\".
describeRuleResponse_scheduleExpression :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe Prelude.Text)
describeRuleResponse_scheduleExpression :: Lens' DescribeRuleResponse (Maybe Text)
describeRuleResponse_scheduleExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe Text
scheduleExpression :: Maybe Text
$sel:scheduleExpression:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
scheduleExpression} -> Maybe Text
scheduleExpression) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe Text
a -> DescribeRuleResponse
s {$sel:scheduleExpression:DescribeRuleResponse' :: Maybe Text
scheduleExpression = Maybe Text
a} :: DescribeRuleResponse)

-- | Specifies whether the rule is enabled or disabled.
describeRuleResponse_state :: Lens.Lens' DescribeRuleResponse (Prelude.Maybe RuleState)
describeRuleResponse_state :: Lens' DescribeRuleResponse (Maybe RuleState)
describeRuleResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleResponse' {Maybe RuleState
state :: Maybe RuleState
$sel:state:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe RuleState
state} -> Maybe RuleState
state) (\s :: DescribeRuleResponse
s@DescribeRuleResponse' {} Maybe RuleState
a -> DescribeRuleResponse
s {$sel:state:DescribeRuleResponse' :: Maybe RuleState
state = Maybe RuleState
a} :: DescribeRuleResponse)

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

instance Prelude.NFData DescribeRuleResponse where
  rnf :: DescribeRuleResponse -> ()
rnf DescribeRuleResponse' {Int
Maybe Text
Maybe RuleState
httpStatus :: Int
state :: Maybe RuleState
scheduleExpression :: Maybe Text
roleArn :: Maybe Text
name :: Maybe Text
managedBy :: Maybe Text
eventPattern :: Maybe Text
eventBusName :: Maybe Text
description :: Maybe Text
createdBy :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:DescribeRuleResponse' :: DescribeRuleResponse -> Int
$sel:state:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe RuleState
$sel:scheduleExpression:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:roleArn:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:name:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:managedBy:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:eventPattern:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:eventBusName:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:description:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:createdBy:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
$sel:arn:DescribeRuleResponse' :: DescribeRuleResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventBusName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventPattern
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
managedBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus