{-# 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.DescribeOrganizationConformancePackStatuses
-- 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)
--
-- Provides organization conformance pack deployment status for an
-- organization.
--
-- The status is not considered successful until organization conformance
-- pack is successfully deployed in all the member accounts with an
-- exception of excluded accounts.
--
-- When you specify the limit and the next token, you receive a paginated
-- response. Limit and next token are not applicable if you specify
-- organization conformance pack names. They are only applicable, when you
-- request all the organization conformance packs.
--
-- This operation returns paginated results.
module Amazonka.Config.DescribeOrganizationConformancePackStatuses
  ( -- * Creating a Request
    DescribeOrganizationConformancePackStatuses (..),
    newDescribeOrganizationConformancePackStatuses,

    -- * Request Lenses
    describeOrganizationConformancePackStatuses_nextToken,
    describeOrganizationConformancePackStatuses_limit,
    describeOrganizationConformancePackStatuses_organizationConformancePackNames,

    -- * Destructuring the Response
    DescribeOrganizationConformancePackStatusesResponse (..),
    newDescribeOrganizationConformancePackStatusesResponse,

    -- * Response Lenses
    describeOrganizationConformancePackStatusesResponse_organizationConformancePackStatuses,
    describeOrganizationConformancePackStatusesResponse_nextToken,
    describeOrganizationConformancePackStatusesResponse_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:/ 'newDescribeOrganizationConformancePackStatuses' smart constructor.
data DescribeOrganizationConformancePackStatuses = DescribeOrganizationConformancePackStatuses'
  { -- | The nextToken string returned on a previous page that you use to get the
    -- next page of results in a paginated response.
    DescribeOrganizationConformancePackStatuses -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of OrganizationConformancePackStatuses returned on
    -- each page. If you do no specify a number, Config uses the default. The
    -- default is 100.
    DescribeOrganizationConformancePackStatuses -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The names of organization conformance packs for which you want status
    -- details. If you do not specify any names, Config returns details for all
    -- your organization conformance packs.
    DescribeOrganizationConformancePackStatuses -> Maybe [Text]
organizationConformancePackNames :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeOrganizationConformancePackStatuses
-> DescribeOrganizationConformancePackStatuses -> Bool
(DescribeOrganizationConformancePackStatuses
 -> DescribeOrganizationConformancePackStatuses -> Bool)
-> (DescribeOrganizationConformancePackStatuses
    -> DescribeOrganizationConformancePackStatuses -> Bool)
-> Eq DescribeOrganizationConformancePackStatuses
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOrganizationConformancePackStatuses
-> DescribeOrganizationConformancePackStatuses -> Bool
$c/= :: DescribeOrganizationConformancePackStatuses
-> DescribeOrganizationConformancePackStatuses -> Bool
== :: DescribeOrganizationConformancePackStatuses
-> DescribeOrganizationConformancePackStatuses -> Bool
$c== :: DescribeOrganizationConformancePackStatuses
-> DescribeOrganizationConformancePackStatuses -> Bool
Prelude.Eq, ReadPrec [DescribeOrganizationConformancePackStatuses]
ReadPrec DescribeOrganizationConformancePackStatuses
Int -> ReadS DescribeOrganizationConformancePackStatuses
ReadS [DescribeOrganizationConformancePackStatuses]
(Int -> ReadS DescribeOrganizationConformancePackStatuses)
-> ReadS [DescribeOrganizationConformancePackStatuses]
-> ReadPrec DescribeOrganizationConformancePackStatuses
-> ReadPrec [DescribeOrganizationConformancePackStatuses]
-> Read DescribeOrganizationConformancePackStatuses
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOrganizationConformancePackStatuses]
$creadListPrec :: ReadPrec [DescribeOrganizationConformancePackStatuses]
readPrec :: ReadPrec DescribeOrganizationConformancePackStatuses
$creadPrec :: ReadPrec DescribeOrganizationConformancePackStatuses
readList :: ReadS [DescribeOrganizationConformancePackStatuses]
$creadList :: ReadS [DescribeOrganizationConformancePackStatuses]
readsPrec :: Int -> ReadS DescribeOrganizationConformancePackStatuses
$creadsPrec :: Int -> ReadS DescribeOrganizationConformancePackStatuses
Prelude.Read, Int -> DescribeOrganizationConformancePackStatuses -> ShowS
[DescribeOrganizationConformancePackStatuses] -> ShowS
DescribeOrganizationConformancePackStatuses -> String
(Int -> DescribeOrganizationConformancePackStatuses -> ShowS)
-> (DescribeOrganizationConformancePackStatuses -> String)
-> ([DescribeOrganizationConformancePackStatuses] -> ShowS)
-> Show DescribeOrganizationConformancePackStatuses
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOrganizationConformancePackStatuses] -> ShowS
$cshowList :: [DescribeOrganizationConformancePackStatuses] -> ShowS
show :: DescribeOrganizationConformancePackStatuses -> String
$cshow :: DescribeOrganizationConformancePackStatuses -> String
showsPrec :: Int -> DescribeOrganizationConformancePackStatuses -> ShowS
$cshowsPrec :: Int -> DescribeOrganizationConformancePackStatuses -> ShowS
Prelude.Show, (forall x.
 DescribeOrganizationConformancePackStatuses
 -> Rep DescribeOrganizationConformancePackStatuses x)
-> (forall x.
    Rep DescribeOrganizationConformancePackStatuses x
    -> DescribeOrganizationConformancePackStatuses)
-> Generic DescribeOrganizationConformancePackStatuses
forall x.
Rep DescribeOrganizationConformancePackStatuses x
-> DescribeOrganizationConformancePackStatuses
forall x.
DescribeOrganizationConformancePackStatuses
-> Rep DescribeOrganizationConformancePackStatuses x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOrganizationConformancePackStatuses x
-> DescribeOrganizationConformancePackStatuses
$cfrom :: forall x.
DescribeOrganizationConformancePackStatuses
-> Rep DescribeOrganizationConformancePackStatuses x
Prelude.Generic)

-- |
-- Create a value of 'DescribeOrganizationConformancePackStatuses' 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', 'describeOrganizationConformancePackStatuses_nextToken' - The nextToken string returned on a previous page that you use to get the
-- next page of results in a paginated response.
--
-- 'limit', 'describeOrganizationConformancePackStatuses_limit' - The maximum number of OrganizationConformancePackStatuses returned on
-- each page. If you do no specify a number, Config uses the default. The
-- default is 100.
--
-- 'organizationConformancePackNames', 'describeOrganizationConformancePackStatuses_organizationConformancePackNames' - The names of organization conformance packs for which you want status
-- details. If you do not specify any names, Config returns details for all
-- your organization conformance packs.
newDescribeOrganizationConformancePackStatuses ::
  DescribeOrganizationConformancePackStatuses
newDescribeOrganizationConformancePackStatuses :: DescribeOrganizationConformancePackStatuses
newDescribeOrganizationConformancePackStatuses =
  DescribeOrganizationConformancePackStatuses' :: Maybe Text
-> Maybe Natural
-> Maybe [Text]
-> DescribeOrganizationConformancePackStatuses
DescribeOrganizationConformancePackStatuses'
    { $sel:nextToken:DescribeOrganizationConformancePackStatuses' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeOrganizationConformancePackStatuses' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationConformancePackNames:DescribeOrganizationConformancePackStatuses' :: Maybe [Text]
organizationConformancePackNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The maximum number of OrganizationConformancePackStatuses returned on
-- each page. If you do no specify a number, Config uses the default. The
-- default is 100.
describeOrganizationConformancePackStatuses_limit :: Lens.Lens' DescribeOrganizationConformancePackStatuses (Prelude.Maybe Prelude.Natural)
describeOrganizationConformancePackStatuses_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeOrganizationConformancePackStatuses
-> f DescribeOrganizationConformancePackStatuses
describeOrganizationConformancePackStatuses_limit = (DescribeOrganizationConformancePackStatuses -> Maybe Natural)
-> (DescribeOrganizationConformancePackStatuses
    -> Maybe Natural -> DescribeOrganizationConformancePackStatuses)
-> Lens
     DescribeOrganizationConformancePackStatuses
     DescribeOrganizationConformancePackStatuses
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConformancePackStatuses' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeOrganizationConformancePackStatuses' :: DescribeOrganizationConformancePackStatuses -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeOrganizationConformancePackStatuses
s@DescribeOrganizationConformancePackStatuses' {} Maybe Natural
a -> DescribeOrganizationConformancePackStatuses
s {$sel:limit:DescribeOrganizationConformancePackStatuses' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeOrganizationConformancePackStatuses)

-- | The names of organization conformance packs for which you want status
-- details. If you do not specify any names, Config returns details for all
-- your organization conformance packs.
describeOrganizationConformancePackStatuses_organizationConformancePackNames :: Lens.Lens' DescribeOrganizationConformancePackStatuses (Prelude.Maybe [Prelude.Text])
describeOrganizationConformancePackStatuses_organizationConformancePackNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeOrganizationConformancePackStatuses
-> f DescribeOrganizationConformancePackStatuses
describeOrganizationConformancePackStatuses_organizationConformancePackNames = (DescribeOrganizationConformancePackStatuses -> Maybe [Text])
-> (DescribeOrganizationConformancePackStatuses
    -> Maybe [Text] -> DescribeOrganizationConformancePackStatuses)
-> Lens
     DescribeOrganizationConformancePackStatuses
     DescribeOrganizationConformancePackStatuses
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConformancePackStatuses' {Maybe [Text]
organizationConformancePackNames :: Maybe [Text]
$sel:organizationConformancePackNames:DescribeOrganizationConformancePackStatuses' :: DescribeOrganizationConformancePackStatuses -> Maybe [Text]
organizationConformancePackNames} -> Maybe [Text]
organizationConformancePackNames) (\s :: DescribeOrganizationConformancePackStatuses
s@DescribeOrganizationConformancePackStatuses' {} Maybe [Text]
a -> DescribeOrganizationConformancePackStatuses
s {$sel:organizationConformancePackNames:DescribeOrganizationConformancePackStatuses' :: Maybe [Text]
organizationConformancePackNames = Maybe [Text]
a} :: DescribeOrganizationConformancePackStatuses) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeOrganizationConformancePackStatuses
 -> f DescribeOrganizationConformancePackStatuses)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeOrganizationConformancePackStatuses
-> f DescribeOrganizationConformancePackStatuses
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

instance
  Core.AWSPager
    DescribeOrganizationConformancePackStatuses
  where
  page :: DescribeOrganizationConformancePackStatuses
-> AWSResponse DescribeOrganizationConformancePackStatuses
-> Maybe DescribeOrganizationConformancePackStatuses
page DescribeOrganizationConformancePackStatuses
rq AWSResponse DescribeOrganizationConformancePackStatuses
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeOrganizationConformancePackStatuses
DescribeOrganizationConformancePackStatusesResponse
rs
            DescribeOrganizationConformancePackStatusesResponse
-> Getting
     (First Text)
     DescribeOrganizationConformancePackStatusesResponse
     Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeOrganizationConformancePackStatusesResponse
-> Const
     (First Text) DescribeOrganizationConformancePackStatusesResponse
Lens'
  DescribeOrganizationConformancePackStatusesResponse (Maybe Text)
describeOrganizationConformancePackStatusesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeOrganizationConformancePackStatusesResponse
 -> Const
      (First Text) DescribeOrganizationConformancePackStatusesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text)
     DescribeOrganizationConformancePackStatusesResponse
     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 DescribeOrganizationConformancePackStatuses
forall a. Maybe a
Prelude.Nothing
    | Maybe [OrganizationConformancePackStatus] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeOrganizationConformancePackStatuses
DescribeOrganizationConformancePackStatusesResponse
rs
            DescribeOrganizationConformancePackStatusesResponse
-> Getting
     (First [OrganizationConformancePackStatus])
     DescribeOrganizationConformancePackStatusesResponse
     [OrganizationConformancePackStatus]
-> Maybe [OrganizationConformancePackStatus]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [OrganizationConformancePackStatus]
 -> Const
      (First [OrganizationConformancePackStatus])
      (Maybe [OrganizationConformancePackStatus]))
-> DescribeOrganizationConformancePackStatusesResponse
-> Const
     (First [OrganizationConformancePackStatus])
     DescribeOrganizationConformancePackStatusesResponse
Lens'
  DescribeOrganizationConformancePackStatusesResponse
  (Maybe [OrganizationConformancePackStatus])
describeOrganizationConformancePackStatusesResponse_organizationConformancePackStatuses
              ((Maybe [OrganizationConformancePackStatus]
  -> Const
       (First [OrganizationConformancePackStatus])
       (Maybe [OrganizationConformancePackStatus]))
 -> DescribeOrganizationConformancePackStatusesResponse
 -> Const
      (First [OrganizationConformancePackStatus])
      DescribeOrganizationConformancePackStatusesResponse)
-> (([OrganizationConformancePackStatus]
     -> Const
          (First [OrganizationConformancePackStatus])
          [OrganizationConformancePackStatus])
    -> Maybe [OrganizationConformancePackStatus]
    -> Const
         (First [OrganizationConformancePackStatus])
         (Maybe [OrganizationConformancePackStatus]))
-> Getting
     (First [OrganizationConformancePackStatus])
     DescribeOrganizationConformancePackStatusesResponse
     [OrganizationConformancePackStatus]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([OrganizationConformancePackStatus]
 -> Const
      (First [OrganizationConformancePackStatus])
      [OrganizationConformancePackStatus])
-> Maybe [OrganizationConformancePackStatus]
-> Const
     (First [OrganizationConformancePackStatus])
     (Maybe [OrganizationConformancePackStatus])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeOrganizationConformancePackStatuses
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeOrganizationConformancePackStatuses
-> Maybe DescribeOrganizationConformancePackStatuses
forall a. a -> Maybe a
Prelude.Just (DescribeOrganizationConformancePackStatuses
 -> Maybe DescribeOrganizationConformancePackStatuses)
-> DescribeOrganizationConformancePackStatuses
-> Maybe DescribeOrganizationConformancePackStatuses
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeOrganizationConformancePackStatuses
rq
          DescribeOrganizationConformancePackStatuses
-> (DescribeOrganizationConformancePackStatuses
    -> DescribeOrganizationConformancePackStatuses)
-> DescribeOrganizationConformancePackStatuses
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeOrganizationConformancePackStatuses
-> Identity DescribeOrganizationConformancePackStatuses
Lens
  DescribeOrganizationConformancePackStatuses
  DescribeOrganizationConformancePackStatuses
  (Maybe Text)
  (Maybe Text)
describeOrganizationConformancePackStatuses_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeOrganizationConformancePackStatuses
 -> Identity DescribeOrganizationConformancePackStatuses)
-> Maybe Text
-> DescribeOrganizationConformancePackStatuses
-> DescribeOrganizationConformancePackStatuses
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeOrganizationConformancePackStatuses
DescribeOrganizationConformancePackStatusesResponse
rs
            DescribeOrganizationConformancePackStatusesResponse
-> Getting
     (First Text)
     DescribeOrganizationConformancePackStatusesResponse
     Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeOrganizationConformancePackStatusesResponse
-> Const
     (First Text) DescribeOrganizationConformancePackStatusesResponse
Lens'
  DescribeOrganizationConformancePackStatusesResponse (Maybe Text)
describeOrganizationConformancePackStatusesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeOrganizationConformancePackStatusesResponse
 -> Const
      (First Text) DescribeOrganizationConformancePackStatusesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text)
     DescribeOrganizationConformancePackStatusesResponse
     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
    DescribeOrganizationConformancePackStatuses
  where
  type
    AWSResponse
      DescribeOrganizationConformancePackStatuses =
      DescribeOrganizationConformancePackStatusesResponse
  request :: DescribeOrganizationConformancePackStatuses
-> Request DescribeOrganizationConformancePackStatuses
request = Service
-> DescribeOrganizationConformancePackStatuses
-> Request DescribeOrganizationConformancePackStatuses
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeOrganizationConformancePackStatuses
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeOrganizationConformancePackStatuses)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse DescribeOrganizationConformancePackStatuses))
-> Logger
-> Service
-> Proxy DescribeOrganizationConformancePackStatuses
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeOrganizationConformancePackStatuses)))
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 [OrganizationConformancePackStatus]
-> Maybe Text
-> Int
-> DescribeOrganizationConformancePackStatusesResponse
DescribeOrganizationConformancePackStatusesResponse'
            (Maybe [OrganizationConformancePackStatus]
 -> Maybe Text
 -> Int
 -> DescribeOrganizationConformancePackStatusesResponse)
-> Either String (Maybe [OrganizationConformancePackStatus])
-> Either
     String
     (Maybe Text
      -> Int -> DescribeOrganizationConformancePackStatusesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either
     String (Maybe (Maybe [OrganizationConformancePackStatus]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OrganizationConformancePackStatuses"
                            Either String (Maybe (Maybe [OrganizationConformancePackStatus]))
-> Maybe [OrganizationConformancePackStatus]
-> Either String (Maybe [OrganizationConformancePackStatus])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [OrganizationConformancePackStatus]
forall a. Monoid a => a
Prelude.mempty
                        )
              Either
  String
  (Maybe Text
   -> Int -> DescribeOrganizationConformancePackStatusesResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> DescribeOrganizationConformancePackStatusesResponse)
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 -> DescribeOrganizationConformancePackStatusesResponse)
-> Either String Int
-> Either
     String DescribeOrganizationConformancePackStatusesResponse
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
    DescribeOrganizationConformancePackStatuses

instance
  Prelude.NFData
    DescribeOrganizationConformancePackStatuses

instance
  Core.ToHeaders
    DescribeOrganizationConformancePackStatuses
  where
  toHeaders :: DescribeOrganizationConformancePackStatuses -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeOrganizationConformancePackStatuses -> 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.DescribeOrganizationConformancePackStatuses" ::
                          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
    DescribeOrganizationConformancePackStatuses
  where
  toJSON :: DescribeOrganizationConformancePackStatuses -> Value
toJSON
    DescribeOrganizationConformancePackStatuses' {Maybe Natural
Maybe [Text]
Maybe Text
organizationConformancePackNames :: Maybe [Text]
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:organizationConformancePackNames:DescribeOrganizationConformancePackStatuses' :: DescribeOrganizationConformancePackStatuses -> Maybe [Text]
$sel:limit:DescribeOrganizationConformancePackStatuses' :: DescribeOrganizationConformancePackStatuses -> Maybe Natural
$sel:nextToken:DescribeOrganizationConformancePackStatuses' :: DescribeOrganizationConformancePackStatuses -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (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,
              (Text
"OrganizationConformancePackNames" 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]
organizationConformancePackNames
            ]
        )

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

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

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

-- |
-- Create a value of 'DescribeOrganizationConformancePackStatusesResponse' 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:
--
-- 'organizationConformancePackStatuses', 'describeOrganizationConformancePackStatusesResponse_organizationConformancePackStatuses' - A list of @OrganizationConformancePackStatus@ objects.
--
-- 'nextToken', 'describeOrganizationConformancePackStatusesResponse_nextToken' - The nextToken string returned on a previous page that you use to get the
-- next page of results in a paginated response.
--
-- 'httpStatus', 'describeOrganizationConformancePackStatusesResponse_httpStatus' - The response's http status code.
newDescribeOrganizationConformancePackStatusesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeOrganizationConformancePackStatusesResponse
newDescribeOrganizationConformancePackStatusesResponse :: Int -> DescribeOrganizationConformancePackStatusesResponse
newDescribeOrganizationConformancePackStatusesResponse
  Int
pHttpStatus_ =
    DescribeOrganizationConformancePackStatusesResponse' :: Maybe [OrganizationConformancePackStatus]
-> Maybe Text
-> Int
-> DescribeOrganizationConformancePackStatusesResponse
DescribeOrganizationConformancePackStatusesResponse'
      { $sel:organizationConformancePackStatuses:DescribeOrganizationConformancePackStatusesResponse' :: Maybe [OrganizationConformancePackStatus]
organizationConformancePackStatuses =
          Maybe [OrganizationConformancePackStatus]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeOrganizationConformancePackStatusesResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeOrganizationConformancePackStatusesResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | A list of @OrganizationConformancePackStatus@ objects.
describeOrganizationConformancePackStatusesResponse_organizationConformancePackStatuses :: Lens.Lens' DescribeOrganizationConformancePackStatusesResponse (Prelude.Maybe [OrganizationConformancePackStatus])
describeOrganizationConformancePackStatusesResponse_organizationConformancePackStatuses :: (Maybe [OrganizationConformancePackStatus]
 -> f (Maybe [OrganizationConformancePackStatus]))
-> DescribeOrganizationConformancePackStatusesResponse
-> f DescribeOrganizationConformancePackStatusesResponse
describeOrganizationConformancePackStatusesResponse_organizationConformancePackStatuses = (DescribeOrganizationConformancePackStatusesResponse
 -> Maybe [OrganizationConformancePackStatus])
-> (DescribeOrganizationConformancePackStatusesResponse
    -> Maybe [OrganizationConformancePackStatus]
    -> DescribeOrganizationConformancePackStatusesResponse)
-> Lens'
     DescribeOrganizationConformancePackStatusesResponse
     (Maybe [OrganizationConformancePackStatus])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConformancePackStatusesResponse' {Maybe [OrganizationConformancePackStatus]
organizationConformancePackStatuses :: Maybe [OrganizationConformancePackStatus]
$sel:organizationConformancePackStatuses:DescribeOrganizationConformancePackStatusesResponse' :: DescribeOrganizationConformancePackStatusesResponse
-> Maybe [OrganizationConformancePackStatus]
organizationConformancePackStatuses} -> Maybe [OrganizationConformancePackStatus]
organizationConformancePackStatuses) (\s :: DescribeOrganizationConformancePackStatusesResponse
s@DescribeOrganizationConformancePackStatusesResponse' {} Maybe [OrganizationConformancePackStatus]
a -> DescribeOrganizationConformancePackStatusesResponse
s {$sel:organizationConformancePackStatuses:DescribeOrganizationConformancePackStatusesResponse' :: Maybe [OrganizationConformancePackStatus]
organizationConformancePackStatuses = Maybe [OrganizationConformancePackStatus]
a} :: DescribeOrganizationConformancePackStatusesResponse) ((Maybe [OrganizationConformancePackStatus]
  -> f (Maybe [OrganizationConformancePackStatus]))
 -> DescribeOrganizationConformancePackStatusesResponse
 -> f DescribeOrganizationConformancePackStatusesResponse)
-> ((Maybe [OrganizationConformancePackStatus]
     -> f (Maybe [OrganizationConformancePackStatus]))
    -> Maybe [OrganizationConformancePackStatus]
    -> f (Maybe [OrganizationConformancePackStatus]))
-> (Maybe [OrganizationConformancePackStatus]
    -> f (Maybe [OrganizationConformancePackStatus]))
-> DescribeOrganizationConformancePackStatusesResponse
-> f DescribeOrganizationConformancePackStatusesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OrganizationConformancePackStatus]
  [OrganizationConformancePackStatus]
  [OrganizationConformancePackStatus]
  [OrganizationConformancePackStatus]
-> Iso
     (Maybe [OrganizationConformancePackStatus])
     (Maybe [OrganizationConformancePackStatus])
     (Maybe [OrganizationConformancePackStatus])
     (Maybe [OrganizationConformancePackStatus])
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
  [OrganizationConformancePackStatus]
  [OrganizationConformancePackStatus]
  [OrganizationConformancePackStatus]
  [OrganizationConformancePackStatus]
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.
describeOrganizationConformancePackStatusesResponse_nextToken :: Lens.Lens' DescribeOrganizationConformancePackStatusesResponse (Prelude.Maybe Prelude.Text)
describeOrganizationConformancePackStatusesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeOrganizationConformancePackStatusesResponse
-> f DescribeOrganizationConformancePackStatusesResponse
describeOrganizationConformancePackStatusesResponse_nextToken = (DescribeOrganizationConformancePackStatusesResponse -> Maybe Text)
-> (DescribeOrganizationConformancePackStatusesResponse
    -> Maybe Text
    -> DescribeOrganizationConformancePackStatusesResponse)
-> Lens'
     DescribeOrganizationConformancePackStatusesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConformancePackStatusesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeOrganizationConformancePackStatusesResponse' :: DescribeOrganizationConformancePackStatusesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeOrganizationConformancePackStatusesResponse
s@DescribeOrganizationConformancePackStatusesResponse' {} Maybe Text
a -> DescribeOrganizationConformancePackStatusesResponse
s {$sel:nextToken:DescribeOrganizationConformancePackStatusesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeOrganizationConformancePackStatusesResponse)

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

instance
  Prelude.NFData
    DescribeOrganizationConformancePackStatusesResponse