{-# 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.DescribeConformancePacks
-- 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 a list of one or more conformance packs.
--
-- This operation returns paginated results.
module Amazonka.Config.DescribeConformancePacks
  ( -- * Creating a Request
    DescribeConformancePacks (..),
    newDescribeConformancePacks,

    -- * Request Lenses
    describeConformancePacks_conformancePackNames,
    describeConformancePacks_nextToken,
    describeConformancePacks_limit,

    -- * Destructuring the Response
    DescribeConformancePacksResponse (..),
    newDescribeConformancePacksResponse,

    -- * Response Lenses
    describeConformancePacksResponse_nextToken,
    describeConformancePacksResponse_conformancePackDetails,
    describeConformancePacksResponse_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:/ 'newDescribeConformancePacks' smart constructor.
data DescribeConformancePacks = DescribeConformancePacks'
  { -- | Comma-separated list of conformance pack names for which you want
    -- details. If you do not specify any names, Config returns details for all
    -- your conformance packs.
    DescribeConformancePacks -> Maybe [Text]
conformancePackNames :: Prelude.Maybe [Prelude.Text],
    -- | The @nextToken@ string returned in a previous request that you use to
    -- request the next page of results in a paginated response.
    DescribeConformancePacks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of conformance packs returned on each page.
    DescribeConformancePacks -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeConformancePacks -> DescribeConformancePacks -> Bool
(DescribeConformancePacks -> DescribeConformancePacks -> Bool)
-> (DescribeConformancePacks -> DescribeConformancePacks -> Bool)
-> Eq DescribeConformancePacks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConformancePacks -> DescribeConformancePacks -> Bool
$c/= :: DescribeConformancePacks -> DescribeConformancePacks -> Bool
== :: DescribeConformancePacks -> DescribeConformancePacks -> Bool
$c== :: DescribeConformancePacks -> DescribeConformancePacks -> Bool
Prelude.Eq, ReadPrec [DescribeConformancePacks]
ReadPrec DescribeConformancePacks
Int -> ReadS DescribeConformancePacks
ReadS [DescribeConformancePacks]
(Int -> ReadS DescribeConformancePacks)
-> ReadS [DescribeConformancePacks]
-> ReadPrec DescribeConformancePacks
-> ReadPrec [DescribeConformancePacks]
-> Read DescribeConformancePacks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConformancePacks]
$creadListPrec :: ReadPrec [DescribeConformancePacks]
readPrec :: ReadPrec DescribeConformancePacks
$creadPrec :: ReadPrec DescribeConformancePacks
readList :: ReadS [DescribeConformancePacks]
$creadList :: ReadS [DescribeConformancePacks]
readsPrec :: Int -> ReadS DescribeConformancePacks
$creadsPrec :: Int -> ReadS DescribeConformancePacks
Prelude.Read, Int -> DescribeConformancePacks -> ShowS
[DescribeConformancePacks] -> ShowS
DescribeConformancePacks -> String
(Int -> DescribeConformancePacks -> ShowS)
-> (DescribeConformancePacks -> String)
-> ([DescribeConformancePacks] -> ShowS)
-> Show DescribeConformancePacks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConformancePacks] -> ShowS
$cshowList :: [DescribeConformancePacks] -> ShowS
show :: DescribeConformancePacks -> String
$cshow :: DescribeConformancePacks -> String
showsPrec :: Int -> DescribeConformancePacks -> ShowS
$cshowsPrec :: Int -> DescribeConformancePacks -> ShowS
Prelude.Show, (forall x.
 DescribeConformancePacks -> Rep DescribeConformancePacks x)
-> (forall x.
    Rep DescribeConformancePacks x -> DescribeConformancePacks)
-> Generic DescribeConformancePacks
forall x.
Rep DescribeConformancePacks x -> DescribeConformancePacks
forall x.
DescribeConformancePacks -> Rep DescribeConformancePacks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConformancePacks x -> DescribeConformancePacks
$cfrom :: forall x.
DescribeConformancePacks -> Rep DescribeConformancePacks x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConformancePacks' 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:
--
-- 'conformancePackNames', 'describeConformancePacks_conformancePackNames' - Comma-separated list of conformance pack names for which you want
-- details. If you do not specify any names, Config returns details for all
-- your conformance packs.
--
-- 'nextToken', 'describeConformancePacks_nextToken' - The @nextToken@ string returned in a previous request that you use to
-- request the next page of results in a paginated response.
--
-- 'limit', 'describeConformancePacks_limit' - The maximum number of conformance packs returned on each page.
newDescribeConformancePacks ::
  DescribeConformancePacks
newDescribeConformancePacks :: DescribeConformancePacks
newDescribeConformancePacks =
  DescribeConformancePacks' :: Maybe [Text]
-> Maybe Text -> Maybe Natural -> DescribeConformancePacks
DescribeConformancePacks'
    { $sel:conformancePackNames:DescribeConformancePacks' :: Maybe [Text]
conformancePackNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeConformancePacks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeConformancePacks' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Comma-separated list of conformance pack names for which you want
-- details. If you do not specify any names, Config returns details for all
-- your conformance packs.
describeConformancePacks_conformancePackNames :: Lens.Lens' DescribeConformancePacks (Prelude.Maybe [Prelude.Text])
describeConformancePacks_conformancePackNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeConformancePacks -> f DescribeConformancePacks
describeConformancePacks_conformancePackNames = (DescribeConformancePacks -> Maybe [Text])
-> (DescribeConformancePacks
    -> Maybe [Text] -> DescribeConformancePacks)
-> Lens
     DescribeConformancePacks
     DescribeConformancePacks
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConformancePacks' {Maybe [Text]
conformancePackNames :: Maybe [Text]
$sel:conformancePackNames:DescribeConformancePacks' :: DescribeConformancePacks -> Maybe [Text]
conformancePackNames} -> Maybe [Text]
conformancePackNames) (\s :: DescribeConformancePacks
s@DescribeConformancePacks' {} Maybe [Text]
a -> DescribeConformancePacks
s {$sel:conformancePackNames:DescribeConformancePacks' :: Maybe [Text]
conformancePackNames = Maybe [Text]
a} :: DescribeConformancePacks) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeConformancePacks -> f DescribeConformancePacks)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeConformancePacks
-> f DescribeConformancePacks
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 in a previous request that you use to
-- request the next page of results in a paginated response.
describeConformancePacks_nextToken :: Lens.Lens' DescribeConformancePacks (Prelude.Maybe Prelude.Text)
describeConformancePacks_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeConformancePacks -> f DescribeConformancePacks
describeConformancePacks_nextToken = (DescribeConformancePacks -> Maybe Text)
-> (DescribeConformancePacks
    -> Maybe Text -> DescribeConformancePacks)
-> Lens
     DescribeConformancePacks
     DescribeConformancePacks
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConformancePacks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeConformancePacks' :: DescribeConformancePacks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeConformancePacks
s@DescribeConformancePacks' {} Maybe Text
a -> DescribeConformancePacks
s {$sel:nextToken:DescribeConformancePacks' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeConformancePacks)

-- | The maximum number of conformance packs returned on each page.
describeConformancePacks_limit :: Lens.Lens' DescribeConformancePacks (Prelude.Maybe Prelude.Natural)
describeConformancePacks_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeConformancePacks -> f DescribeConformancePacks
describeConformancePacks_limit = (DescribeConformancePacks -> Maybe Natural)
-> (DescribeConformancePacks
    -> Maybe Natural -> DescribeConformancePacks)
-> Lens
     DescribeConformancePacks
     DescribeConformancePacks
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConformancePacks' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeConformancePacks' :: DescribeConformancePacks -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeConformancePacks
s@DescribeConformancePacks' {} Maybe Natural
a -> DescribeConformancePacks
s {$sel:limit:DescribeConformancePacks' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeConformancePacks)

instance Core.AWSPager DescribeConformancePacks where
  page :: DescribeConformancePacks
-> AWSResponse DescribeConformancePacks
-> Maybe DescribeConformancePacks
page DescribeConformancePacks
rq AWSResponse DescribeConformancePacks
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeConformancePacks
DescribeConformancePacksResponse
rs
            DescribeConformancePacksResponse
-> Getting (First Text) DescribeConformancePacksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeConformancePacksResponse
-> Const (First Text) DescribeConformancePacksResponse
Lens' DescribeConformancePacksResponse (Maybe Text)
describeConformancePacksResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeConformancePacksResponse
 -> Const (First Text) DescribeConformancePacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeConformancePacksResponse 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 DescribeConformancePacks
forall a. Maybe a
Prelude.Nothing
    | Maybe [ConformancePackDetail] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeConformancePacks
DescribeConformancePacksResponse
rs
            DescribeConformancePacksResponse
-> Getting
     (First [ConformancePackDetail])
     DescribeConformancePacksResponse
     [ConformancePackDetail]
-> Maybe [ConformancePackDetail]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ConformancePackDetail]
 -> Const
      (First [ConformancePackDetail]) (Maybe [ConformancePackDetail]))
-> DescribeConformancePacksResponse
-> Const
     (First [ConformancePackDetail]) DescribeConformancePacksResponse
Lens'
  DescribeConformancePacksResponse (Maybe [ConformancePackDetail])
describeConformancePacksResponse_conformancePackDetails
              ((Maybe [ConformancePackDetail]
  -> Const
       (First [ConformancePackDetail]) (Maybe [ConformancePackDetail]))
 -> DescribeConformancePacksResponse
 -> Const
      (First [ConformancePackDetail]) DescribeConformancePacksResponse)
-> (([ConformancePackDetail]
     -> Const (First [ConformancePackDetail]) [ConformancePackDetail])
    -> Maybe [ConformancePackDetail]
    -> Const
         (First [ConformancePackDetail]) (Maybe [ConformancePackDetail]))
-> Getting
     (First [ConformancePackDetail])
     DescribeConformancePacksResponse
     [ConformancePackDetail]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ConformancePackDetail]
 -> Const (First [ConformancePackDetail]) [ConformancePackDetail])
-> Maybe [ConformancePackDetail]
-> Const
     (First [ConformancePackDetail]) (Maybe [ConformancePackDetail])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeConformancePacks
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeConformancePacks -> Maybe DescribeConformancePacks
forall a. a -> Maybe a
Prelude.Just (DescribeConformancePacks -> Maybe DescribeConformancePacks)
-> DescribeConformancePacks -> Maybe DescribeConformancePacks
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeConformancePacks
rq
          DescribeConformancePacks
-> (DescribeConformancePacks -> DescribeConformancePacks)
-> DescribeConformancePacks
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeConformancePacks -> Identity DescribeConformancePacks
Lens
  DescribeConformancePacks
  DescribeConformancePacks
  (Maybe Text)
  (Maybe Text)
describeConformancePacks_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeConformancePacks -> Identity DescribeConformancePacks)
-> Maybe Text
-> DescribeConformancePacks
-> DescribeConformancePacks
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeConformancePacks
DescribeConformancePacksResponse
rs
          DescribeConformancePacksResponse
-> Getting (First Text) DescribeConformancePacksResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeConformancePacksResponse
-> Const (First Text) DescribeConformancePacksResponse
Lens' DescribeConformancePacksResponse (Maybe Text)
describeConformancePacksResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeConformancePacksResponse
 -> Const (First Text) DescribeConformancePacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeConformancePacksResponse 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 DescribeConformancePacks where
  type
    AWSResponse DescribeConformancePacks =
      DescribeConformancePacksResponse
  request :: DescribeConformancePacks -> Request DescribeConformancePacks
request = Service
-> DescribeConformancePacks -> Request DescribeConformancePacks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeConformancePacks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConformancePacks)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeConformancePacks))
-> Logger
-> Service
-> Proxy DescribeConformancePacks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConformancePacks)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ConformancePackDetail]
-> Int
-> DescribeConformancePacksResponse
DescribeConformancePacksResponse'
            (Maybe Text
 -> Maybe [ConformancePackDetail]
 -> Int
 -> DescribeConformancePacksResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ConformancePackDetail]
      -> Int -> DescribeConformancePacksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [ConformancePackDetail]
   -> Int -> DescribeConformancePacksResponse)
-> Either String (Maybe [ConformancePackDetail])
-> Either String (Int -> DescribeConformancePacksResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ConformancePackDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConformancePackDetails"
                            Either String (Maybe (Maybe [ConformancePackDetail]))
-> Maybe [ConformancePackDetail]
-> Either String (Maybe [ConformancePackDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ConformancePackDetail]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeConformancePacksResponse)
-> Either String Int
-> Either String DescribeConformancePacksResponse
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 DescribeConformancePacks

instance Prelude.NFData DescribeConformancePacks

instance Core.ToHeaders DescribeConformancePacks where
  toHeaders :: DescribeConformancePacks -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeConformancePacks -> 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.DescribeConformancePacks" ::
                          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 DescribeConformancePacks where
  toJSON :: DescribeConformancePacks -> Value
toJSON DescribeConformancePacks' {Maybe Natural
Maybe [Text]
Maybe Text
limit :: Maybe Natural
nextToken :: Maybe Text
conformancePackNames :: Maybe [Text]
$sel:limit:DescribeConformancePacks' :: DescribeConformancePacks -> Maybe Natural
$sel:nextToken:DescribeConformancePacks' :: DescribeConformancePacks -> Maybe Text
$sel:conformancePackNames:DescribeConformancePacks' :: DescribeConformancePacks -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ConformancePackNames" 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]
conformancePackNames,
            (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,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit
          ]
      )

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

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

-- | /See:/ 'newDescribeConformancePacksResponse' smart constructor.
data DescribeConformancePacksResponse = DescribeConformancePacksResponse'
  { -- | The @nextToken@ string returned in a previous request that you use to
    -- request the next page of results in a paginated response.
    DescribeConformancePacksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Returns a list of @ConformancePackDetail@ objects.
    DescribeConformancePacksResponse -> Maybe [ConformancePackDetail]
conformancePackDetails :: Prelude.Maybe [ConformancePackDetail],
    -- | The response's http status code.
    DescribeConformancePacksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeConformancePacksResponse
-> DescribeConformancePacksResponse -> Bool
(DescribeConformancePacksResponse
 -> DescribeConformancePacksResponse -> Bool)
-> (DescribeConformancePacksResponse
    -> DescribeConformancePacksResponse -> Bool)
-> Eq DescribeConformancePacksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConformancePacksResponse
-> DescribeConformancePacksResponse -> Bool
$c/= :: DescribeConformancePacksResponse
-> DescribeConformancePacksResponse -> Bool
== :: DescribeConformancePacksResponse
-> DescribeConformancePacksResponse -> Bool
$c== :: DescribeConformancePacksResponse
-> DescribeConformancePacksResponse -> Bool
Prelude.Eq, ReadPrec [DescribeConformancePacksResponse]
ReadPrec DescribeConformancePacksResponse
Int -> ReadS DescribeConformancePacksResponse
ReadS [DescribeConformancePacksResponse]
(Int -> ReadS DescribeConformancePacksResponse)
-> ReadS [DescribeConformancePacksResponse]
-> ReadPrec DescribeConformancePacksResponse
-> ReadPrec [DescribeConformancePacksResponse]
-> Read DescribeConformancePacksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConformancePacksResponse]
$creadListPrec :: ReadPrec [DescribeConformancePacksResponse]
readPrec :: ReadPrec DescribeConformancePacksResponse
$creadPrec :: ReadPrec DescribeConformancePacksResponse
readList :: ReadS [DescribeConformancePacksResponse]
$creadList :: ReadS [DescribeConformancePacksResponse]
readsPrec :: Int -> ReadS DescribeConformancePacksResponse
$creadsPrec :: Int -> ReadS DescribeConformancePacksResponse
Prelude.Read, Int -> DescribeConformancePacksResponse -> ShowS
[DescribeConformancePacksResponse] -> ShowS
DescribeConformancePacksResponse -> String
(Int -> DescribeConformancePacksResponse -> ShowS)
-> (DescribeConformancePacksResponse -> String)
-> ([DescribeConformancePacksResponse] -> ShowS)
-> Show DescribeConformancePacksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConformancePacksResponse] -> ShowS
$cshowList :: [DescribeConformancePacksResponse] -> ShowS
show :: DescribeConformancePacksResponse -> String
$cshow :: DescribeConformancePacksResponse -> String
showsPrec :: Int -> DescribeConformancePacksResponse -> ShowS
$cshowsPrec :: Int -> DescribeConformancePacksResponse -> ShowS
Prelude.Show, (forall x.
 DescribeConformancePacksResponse
 -> Rep DescribeConformancePacksResponse x)
-> (forall x.
    Rep DescribeConformancePacksResponse x
    -> DescribeConformancePacksResponse)
-> Generic DescribeConformancePacksResponse
forall x.
Rep DescribeConformancePacksResponse x
-> DescribeConformancePacksResponse
forall x.
DescribeConformancePacksResponse
-> Rep DescribeConformancePacksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConformancePacksResponse x
-> DescribeConformancePacksResponse
$cfrom :: forall x.
DescribeConformancePacksResponse
-> Rep DescribeConformancePacksResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConformancePacksResponse' 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:
--
-- 'nextToken', 'describeConformancePacksResponse_nextToken' - The @nextToken@ string returned in a previous request that you use to
-- request the next page of results in a paginated response.
--
-- 'conformancePackDetails', 'describeConformancePacksResponse_conformancePackDetails' - Returns a list of @ConformancePackDetail@ objects.
--
-- 'httpStatus', 'describeConformancePacksResponse_httpStatus' - The response's http status code.
newDescribeConformancePacksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeConformancePacksResponse
newDescribeConformancePacksResponse :: Int -> DescribeConformancePacksResponse
newDescribeConformancePacksResponse Int
pHttpStatus_ =
  DescribeConformancePacksResponse' :: Maybe Text
-> Maybe [ConformancePackDetail]
-> Int
-> DescribeConformancePacksResponse
DescribeConformancePacksResponse'
    { $sel:nextToken:DescribeConformancePacksResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:conformancePackDetails:DescribeConformancePacksResponse' :: Maybe [ConformancePackDetail]
conformancePackDetails = Maybe [ConformancePackDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeConformancePacksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Returns a list of @ConformancePackDetail@ objects.
describeConformancePacksResponse_conformancePackDetails :: Lens.Lens' DescribeConformancePacksResponse (Prelude.Maybe [ConformancePackDetail])
describeConformancePacksResponse_conformancePackDetails :: (Maybe [ConformancePackDetail]
 -> f (Maybe [ConformancePackDetail]))
-> DescribeConformancePacksResponse
-> f DescribeConformancePacksResponse
describeConformancePacksResponse_conformancePackDetails = (DescribeConformancePacksResponse -> Maybe [ConformancePackDetail])
-> (DescribeConformancePacksResponse
    -> Maybe [ConformancePackDetail]
    -> DescribeConformancePacksResponse)
-> Lens'
     DescribeConformancePacksResponse (Maybe [ConformancePackDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConformancePacksResponse' {Maybe [ConformancePackDetail]
conformancePackDetails :: Maybe [ConformancePackDetail]
$sel:conformancePackDetails:DescribeConformancePacksResponse' :: DescribeConformancePacksResponse -> Maybe [ConformancePackDetail]
conformancePackDetails} -> Maybe [ConformancePackDetail]
conformancePackDetails) (\s :: DescribeConformancePacksResponse
s@DescribeConformancePacksResponse' {} Maybe [ConformancePackDetail]
a -> DescribeConformancePacksResponse
s {$sel:conformancePackDetails:DescribeConformancePacksResponse' :: Maybe [ConformancePackDetail]
conformancePackDetails = Maybe [ConformancePackDetail]
a} :: DescribeConformancePacksResponse) ((Maybe [ConformancePackDetail]
  -> f (Maybe [ConformancePackDetail]))
 -> DescribeConformancePacksResponse
 -> f DescribeConformancePacksResponse)
-> ((Maybe [ConformancePackDetail]
     -> f (Maybe [ConformancePackDetail]))
    -> Maybe [ConformancePackDetail]
    -> f (Maybe [ConformancePackDetail]))
-> (Maybe [ConformancePackDetail]
    -> f (Maybe [ConformancePackDetail]))
-> DescribeConformancePacksResponse
-> f DescribeConformancePacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ConformancePackDetail]
  [ConformancePackDetail]
  [ConformancePackDetail]
  [ConformancePackDetail]
-> Iso
     (Maybe [ConformancePackDetail])
     (Maybe [ConformancePackDetail])
     (Maybe [ConformancePackDetail])
     (Maybe [ConformancePackDetail])
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
  [ConformancePackDetail]
  [ConformancePackDetail]
  [ConformancePackDetail]
  [ConformancePackDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeConformancePacksResponse