{-# 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.Config.DescribeConfigRules
-- 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)
--
-- Returns details about your Config rules.
--
-- This operation returns paginated results.
module Amazonka.Config.DescribeConfigRules
  ( -- * Creating a Request
    DescribeConfigRules (..),
    newDescribeConfigRules,

    -- * Request Lenses
    describeConfigRules_configRuleNames,
    describeConfigRules_nextToken,

    -- * Destructuring the Response
    DescribeConfigRulesResponse (..),
    newDescribeConfigRulesResponse,

    -- * Response Lenses
    describeConfigRulesResponse_configRules,
    describeConfigRulesResponse_nextToken,
    describeConfigRulesResponse_httpStatus,
  )
where

import Amazonka.Config.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:/ 'newDescribeConfigRules' smart constructor.
data DescribeConfigRules = DescribeConfigRules'
  { -- | The names of the Config rules for which you want details. If you do not
    -- specify any names, Config returns details for all your rules.
    DescribeConfigRules -> Maybe [Text]
configRuleNames :: Prelude.Maybe [Prelude.Text],
    -- | The @nextToken@ string returned on a previous page that you use to get
    -- the next page of results in a paginated response.
    DescribeConfigRules -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeConfigRules -> DescribeConfigRules -> Bool
(DescribeConfigRules -> DescribeConfigRules -> Bool)
-> (DescribeConfigRules -> DescribeConfigRules -> Bool)
-> Eq DescribeConfigRules
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConfigRules -> DescribeConfigRules -> Bool
$c/= :: DescribeConfigRules -> DescribeConfigRules -> Bool
== :: DescribeConfigRules -> DescribeConfigRules -> Bool
$c== :: DescribeConfigRules -> DescribeConfigRules -> Bool
Prelude.Eq, ReadPrec [DescribeConfigRules]
ReadPrec DescribeConfigRules
Int -> ReadS DescribeConfigRules
ReadS [DescribeConfigRules]
(Int -> ReadS DescribeConfigRules)
-> ReadS [DescribeConfigRules]
-> ReadPrec DescribeConfigRules
-> ReadPrec [DescribeConfigRules]
-> Read DescribeConfigRules
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConfigRules]
$creadListPrec :: ReadPrec [DescribeConfigRules]
readPrec :: ReadPrec DescribeConfigRules
$creadPrec :: ReadPrec DescribeConfigRules
readList :: ReadS [DescribeConfigRules]
$creadList :: ReadS [DescribeConfigRules]
readsPrec :: Int -> ReadS DescribeConfigRules
$creadsPrec :: Int -> ReadS DescribeConfigRules
Prelude.Read, Int -> DescribeConfigRules -> ShowS
[DescribeConfigRules] -> ShowS
DescribeConfigRules -> String
(Int -> DescribeConfigRules -> ShowS)
-> (DescribeConfigRules -> String)
-> ([DescribeConfigRules] -> ShowS)
-> Show DescribeConfigRules
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConfigRules] -> ShowS
$cshowList :: [DescribeConfigRules] -> ShowS
show :: DescribeConfigRules -> String
$cshow :: DescribeConfigRules -> String
showsPrec :: Int -> DescribeConfigRules -> ShowS
$cshowsPrec :: Int -> DescribeConfigRules -> ShowS
Prelude.Show, (forall x. DescribeConfigRules -> Rep DescribeConfigRules x)
-> (forall x. Rep DescribeConfigRules x -> DescribeConfigRules)
-> Generic DescribeConfigRules
forall x. Rep DescribeConfigRules x -> DescribeConfigRules
forall x. DescribeConfigRules -> Rep DescribeConfigRules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeConfigRules x -> DescribeConfigRules
$cfrom :: forall x. DescribeConfigRules -> Rep DescribeConfigRules x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConfigRules' 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:
--
-- 'configRuleNames', 'describeConfigRules_configRuleNames' - The names of the Config rules for which you want details. If you do not
-- specify any names, Config returns details for all your rules.
--
-- 'nextToken', 'describeConfigRules_nextToken' - The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
newDescribeConfigRules ::
  DescribeConfigRules
newDescribeConfigRules :: DescribeConfigRules
newDescribeConfigRules =
  DescribeConfigRules' :: Maybe [Text] -> Maybe Text -> DescribeConfigRules
DescribeConfigRules'
    { $sel:configRuleNames:DescribeConfigRules' :: Maybe [Text]
configRuleNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeConfigRules' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The names of the Config rules for which you want details. If you do not
-- specify any names, Config returns details for all your rules.
describeConfigRules_configRuleNames :: Lens.Lens' DescribeConfigRules (Prelude.Maybe [Prelude.Text])
describeConfigRules_configRuleNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeConfigRules -> f DescribeConfigRules
describeConfigRules_configRuleNames = (DescribeConfigRules -> Maybe [Text])
-> (DescribeConfigRules -> Maybe [Text] -> DescribeConfigRules)
-> Lens
     DescribeConfigRules
     DescribeConfigRules
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigRules' {Maybe [Text]
configRuleNames :: Maybe [Text]
$sel:configRuleNames:DescribeConfigRules' :: DescribeConfigRules -> Maybe [Text]
configRuleNames} -> Maybe [Text]
configRuleNames) (\s :: DescribeConfigRules
s@DescribeConfigRules' {} Maybe [Text]
a -> DescribeConfigRules
s {$sel:configRuleNames:DescribeConfigRules' :: Maybe [Text]
configRuleNames = Maybe [Text]
a} :: DescribeConfigRules) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeConfigRules -> f DescribeConfigRules)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeConfigRules
-> f DescribeConfigRules
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 @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
describeConfigRules_nextToken :: Lens.Lens' DescribeConfigRules (Prelude.Maybe Prelude.Text)
describeConfigRules_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeConfigRules -> f DescribeConfigRules
describeConfigRules_nextToken = (DescribeConfigRules -> Maybe Text)
-> (DescribeConfigRules -> Maybe Text -> DescribeConfigRules)
-> Lens
     DescribeConfigRules DescribeConfigRules (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigRules' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeConfigRules' :: DescribeConfigRules -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeConfigRules
s@DescribeConfigRules' {} Maybe Text
a -> DescribeConfigRules
s {$sel:nextToken:DescribeConfigRules' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeConfigRules)

instance Core.AWSPager DescribeConfigRules where
  page :: DescribeConfigRules
-> AWSResponse DescribeConfigRules -> Maybe DescribeConfigRules
page DescribeConfigRules
rq AWSResponse DescribeConfigRules
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeConfigRules
DescribeConfigRulesResponse
rs
            DescribeConfigRulesResponse
-> Getting (First Text) DescribeConfigRulesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeConfigRulesResponse
-> Const (First Text) DescribeConfigRulesResponse
Lens' DescribeConfigRulesResponse (Maybe Text)
describeConfigRulesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeConfigRulesResponse
 -> Const (First Text) DescribeConfigRulesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeConfigRulesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeConfigRules
forall a. Maybe a
Prelude.Nothing
    | Maybe [ConfigRule] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeConfigRules
DescribeConfigRulesResponse
rs
            DescribeConfigRulesResponse
-> Getting
     (First [ConfigRule]) DescribeConfigRulesResponse [ConfigRule]
-> Maybe [ConfigRule]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ConfigRule]
 -> Const (First [ConfigRule]) (Maybe [ConfigRule]))
-> DescribeConfigRulesResponse
-> Const (First [ConfigRule]) DescribeConfigRulesResponse
Lens' DescribeConfigRulesResponse (Maybe [ConfigRule])
describeConfigRulesResponse_configRules
              ((Maybe [ConfigRule]
  -> Const (First [ConfigRule]) (Maybe [ConfigRule]))
 -> DescribeConfigRulesResponse
 -> Const (First [ConfigRule]) DescribeConfigRulesResponse)
-> (([ConfigRule] -> Const (First [ConfigRule]) [ConfigRule])
    -> Maybe [ConfigRule]
    -> Const (First [ConfigRule]) (Maybe [ConfigRule]))
-> Getting
     (First [ConfigRule]) DescribeConfigRulesResponse [ConfigRule]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ConfigRule] -> Const (First [ConfigRule]) [ConfigRule])
-> Maybe [ConfigRule]
-> Const (First [ConfigRule]) (Maybe [ConfigRule])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeConfigRules
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeConfigRules -> Maybe DescribeConfigRules
forall a. a -> Maybe a
Prelude.Just (DescribeConfigRules -> Maybe DescribeConfigRules)
-> DescribeConfigRules -> Maybe DescribeConfigRules
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeConfigRules
rq
          DescribeConfigRules
-> (DescribeConfigRules -> DescribeConfigRules)
-> DescribeConfigRules
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeConfigRules -> Identity DescribeConfigRules
Lens
  DescribeConfigRules DescribeConfigRules (Maybe Text) (Maybe Text)
describeConfigRules_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeConfigRules -> Identity DescribeConfigRules)
-> Maybe Text -> DescribeConfigRules -> DescribeConfigRules
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeConfigRules
DescribeConfigRulesResponse
rs
          DescribeConfigRulesResponse
-> Getting (First Text) DescribeConfigRulesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeConfigRulesResponse
-> Const (First Text) DescribeConfigRulesResponse
Lens' DescribeConfigRulesResponse (Maybe Text)
describeConfigRulesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeConfigRulesResponse
 -> Const (First Text) DescribeConfigRulesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeConfigRulesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeConfigRules where
  type
    AWSResponse DescribeConfigRules =
      DescribeConfigRulesResponse
  request :: DescribeConfigRules -> Request DescribeConfigRules
request = Service -> DescribeConfigRules -> Request DescribeConfigRules
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeConfigRules
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConfigRules)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeConfigRules))
-> Logger
-> Service
-> Proxy DescribeConfigRules
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConfigRules)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [ConfigRule]
-> Maybe Text -> Int -> DescribeConfigRulesResponse
DescribeConfigRulesResponse'
            (Maybe [ConfigRule]
 -> Maybe Text -> Int -> DescribeConfigRulesResponse)
-> Either String (Maybe [ConfigRule])
-> Either String (Maybe Text -> Int -> DescribeConfigRulesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ConfigRule]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConfigRules" Either String (Maybe (Maybe [ConfigRule]))
-> Maybe [ConfigRule] -> Either String (Maybe [ConfigRule])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ConfigRule]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeConfigRulesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeConfigRulesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> DescribeConfigRulesResponse)
-> Either String Int -> Either String DescribeConfigRulesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeConfigRules

instance Prelude.NFData DescribeConfigRules

instance Core.ToHeaders DescribeConfigRules where
  toHeaders :: DescribeConfigRules -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeConfigRules -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StarlingDoveService.DescribeConfigRules" ::
                          Prelude.ByteString
                      ),
            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 DescribeConfigRules where
  toJSON :: DescribeConfigRules -> Value
toJSON DescribeConfigRules' {Maybe [Text]
Maybe Text
nextToken :: Maybe Text
configRuleNames :: Maybe [Text]
$sel:nextToken:DescribeConfigRules' :: DescribeConfigRules -> Maybe Text
$sel:configRuleNames:DescribeConfigRules' :: DescribeConfigRules -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ConfigRuleNames" 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]
configRuleNames,
            (Text
"NextToken" 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
nextToken
          ]
      )

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

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

-- |
--
-- /See:/ 'newDescribeConfigRulesResponse' smart constructor.
data DescribeConfigRulesResponse = DescribeConfigRulesResponse'
  { -- | The details about your Config rules.
    DescribeConfigRulesResponse -> Maybe [ConfigRule]
configRules :: Prelude.Maybe [ConfigRule],
    -- | The string that you use in a subsequent request to get the next page of
    -- results in a paginated response.
    DescribeConfigRulesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeConfigRulesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeConfigRulesResponse -> DescribeConfigRulesResponse -> Bool
(DescribeConfigRulesResponse
 -> DescribeConfigRulesResponse -> Bool)
-> (DescribeConfigRulesResponse
    -> DescribeConfigRulesResponse -> Bool)
-> Eq DescribeConfigRulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConfigRulesResponse -> DescribeConfigRulesResponse -> Bool
$c/= :: DescribeConfigRulesResponse -> DescribeConfigRulesResponse -> Bool
== :: DescribeConfigRulesResponse -> DescribeConfigRulesResponse -> Bool
$c== :: DescribeConfigRulesResponse -> DescribeConfigRulesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeConfigRulesResponse]
ReadPrec DescribeConfigRulesResponse
Int -> ReadS DescribeConfigRulesResponse
ReadS [DescribeConfigRulesResponse]
(Int -> ReadS DescribeConfigRulesResponse)
-> ReadS [DescribeConfigRulesResponse]
-> ReadPrec DescribeConfigRulesResponse
-> ReadPrec [DescribeConfigRulesResponse]
-> Read DescribeConfigRulesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConfigRulesResponse]
$creadListPrec :: ReadPrec [DescribeConfigRulesResponse]
readPrec :: ReadPrec DescribeConfigRulesResponse
$creadPrec :: ReadPrec DescribeConfigRulesResponse
readList :: ReadS [DescribeConfigRulesResponse]
$creadList :: ReadS [DescribeConfigRulesResponse]
readsPrec :: Int -> ReadS DescribeConfigRulesResponse
$creadsPrec :: Int -> ReadS DescribeConfigRulesResponse
Prelude.Read, Int -> DescribeConfigRulesResponse -> ShowS
[DescribeConfigRulesResponse] -> ShowS
DescribeConfigRulesResponse -> String
(Int -> DescribeConfigRulesResponse -> ShowS)
-> (DescribeConfigRulesResponse -> String)
-> ([DescribeConfigRulesResponse] -> ShowS)
-> Show DescribeConfigRulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConfigRulesResponse] -> ShowS
$cshowList :: [DescribeConfigRulesResponse] -> ShowS
show :: DescribeConfigRulesResponse -> String
$cshow :: DescribeConfigRulesResponse -> String
showsPrec :: Int -> DescribeConfigRulesResponse -> ShowS
$cshowsPrec :: Int -> DescribeConfigRulesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeConfigRulesResponse -> Rep DescribeConfigRulesResponse x)
-> (forall x.
    Rep DescribeConfigRulesResponse x -> DescribeConfigRulesResponse)
-> Generic DescribeConfigRulesResponse
forall x.
Rep DescribeConfigRulesResponse x -> DescribeConfigRulesResponse
forall x.
DescribeConfigRulesResponse -> Rep DescribeConfigRulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConfigRulesResponse x -> DescribeConfigRulesResponse
$cfrom :: forall x.
DescribeConfigRulesResponse -> Rep DescribeConfigRulesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConfigRulesResponse' 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:
--
-- 'configRules', 'describeConfigRulesResponse_configRules' - The details about your Config rules.
--
-- 'nextToken', 'describeConfigRulesResponse_nextToken' - The string that you use in a subsequent request to get the next page of
-- results in a paginated response.
--
-- 'httpStatus', 'describeConfigRulesResponse_httpStatus' - The response's http status code.
newDescribeConfigRulesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeConfigRulesResponse
newDescribeConfigRulesResponse :: Int -> DescribeConfigRulesResponse
newDescribeConfigRulesResponse Int
pHttpStatus_ =
  DescribeConfigRulesResponse' :: Maybe [ConfigRule]
-> Maybe Text -> Int -> DescribeConfigRulesResponse
DescribeConfigRulesResponse'
    { $sel:configRules:DescribeConfigRulesResponse' :: Maybe [ConfigRule]
configRules =
        Maybe [ConfigRule]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeConfigRulesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeConfigRulesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The details about your Config rules.
describeConfigRulesResponse_configRules :: Lens.Lens' DescribeConfigRulesResponse (Prelude.Maybe [ConfigRule])
describeConfigRulesResponse_configRules :: (Maybe [ConfigRule] -> f (Maybe [ConfigRule]))
-> DescribeConfigRulesResponse -> f DescribeConfigRulesResponse
describeConfigRulesResponse_configRules = (DescribeConfigRulesResponse -> Maybe [ConfigRule])
-> (DescribeConfigRulesResponse
    -> Maybe [ConfigRule] -> DescribeConfigRulesResponse)
-> Lens' DescribeConfigRulesResponse (Maybe [ConfigRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigRulesResponse' {Maybe [ConfigRule]
configRules :: Maybe [ConfigRule]
$sel:configRules:DescribeConfigRulesResponse' :: DescribeConfigRulesResponse -> Maybe [ConfigRule]
configRules} -> Maybe [ConfigRule]
configRules) (\s :: DescribeConfigRulesResponse
s@DescribeConfigRulesResponse' {} Maybe [ConfigRule]
a -> DescribeConfigRulesResponse
s {$sel:configRules:DescribeConfigRulesResponse' :: Maybe [ConfigRule]
configRules = Maybe [ConfigRule]
a} :: DescribeConfigRulesResponse) ((Maybe [ConfigRule] -> f (Maybe [ConfigRule]))
 -> DescribeConfigRulesResponse -> f DescribeConfigRulesResponse)
-> ((Maybe [ConfigRule] -> f (Maybe [ConfigRule]))
    -> Maybe [ConfigRule] -> f (Maybe [ConfigRule]))
-> (Maybe [ConfigRule] -> f (Maybe [ConfigRule]))
-> DescribeConfigRulesResponse
-> f DescribeConfigRulesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ConfigRule] [ConfigRule] [ConfigRule] [ConfigRule]
-> Iso
     (Maybe [ConfigRule])
     (Maybe [ConfigRule])
     (Maybe [ConfigRule])
     (Maybe [ConfigRule])
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 [ConfigRule] [ConfigRule] [ConfigRule] [ConfigRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The string that you use in a subsequent request to get the next page of
-- results in a paginated response.
describeConfigRulesResponse_nextToken :: Lens.Lens' DescribeConfigRulesResponse (Prelude.Maybe Prelude.Text)
describeConfigRulesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeConfigRulesResponse -> f DescribeConfigRulesResponse
describeConfigRulesResponse_nextToken = (DescribeConfigRulesResponse -> Maybe Text)
-> (DescribeConfigRulesResponse
    -> Maybe Text -> DescribeConfigRulesResponse)
-> Lens' DescribeConfigRulesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConfigRulesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeConfigRulesResponse' :: DescribeConfigRulesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeConfigRulesResponse
s@DescribeConfigRulesResponse' {} Maybe Text
a -> DescribeConfigRulesResponse
s {$sel:nextToken:DescribeConfigRulesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeConfigRulesResponse)

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

instance Prelude.NFData DescribeConfigRulesResponse