{-# 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.GetOrganizationConfigRuleDetailedStatus
-- 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 detailed status for each member account within an organization
-- for a given organization config rule.
--
-- This operation returns paginated results.
module Amazonka.Config.GetOrganizationConfigRuleDetailedStatus
  ( -- * Creating a Request
    GetOrganizationConfigRuleDetailedStatus (..),
    newGetOrganizationConfigRuleDetailedStatus,

    -- * Request Lenses
    getOrganizationConfigRuleDetailedStatus_filters,
    getOrganizationConfigRuleDetailedStatus_nextToken,
    getOrganizationConfigRuleDetailedStatus_limit,
    getOrganizationConfigRuleDetailedStatus_organizationConfigRuleName,

    -- * Destructuring the Response
    GetOrganizationConfigRuleDetailedStatusResponse (..),
    newGetOrganizationConfigRuleDetailedStatusResponse,

    -- * Response Lenses
    getOrganizationConfigRuleDetailedStatusResponse_organizationConfigRuleDetailedStatus,
    getOrganizationConfigRuleDetailedStatusResponse_nextToken,
    getOrganizationConfigRuleDetailedStatusResponse_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:/ 'newGetOrganizationConfigRuleDetailedStatus' smart constructor.
data GetOrganizationConfigRuleDetailedStatus = GetOrganizationConfigRuleDetailedStatus'
  { -- | A @StatusDetailFilters@ object.
    GetOrganizationConfigRuleDetailedStatus
-> Maybe StatusDetailFilters
filters :: Prelude.Maybe StatusDetailFilters,
    -- | The @nextToken@ string returned on a previous page that you use to get
    -- the next page of results in a paginated response.
    GetOrganizationConfigRuleDetailedStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of @OrganizationConfigRuleDetailedStatus@ returned on
    -- each page. If you do not specify a number, Config uses the default. The
    -- default is 100.
    GetOrganizationConfigRuleDetailedStatus -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The name of organization config rule for which you want status details
    -- for member accounts.
    GetOrganizationConfigRuleDetailedStatus -> Text
organizationConfigRuleName :: Prelude.Text
  }
  deriving (GetOrganizationConfigRuleDetailedStatus
-> GetOrganizationConfigRuleDetailedStatus -> Bool
(GetOrganizationConfigRuleDetailedStatus
 -> GetOrganizationConfigRuleDetailedStatus -> Bool)
-> (GetOrganizationConfigRuleDetailedStatus
    -> GetOrganizationConfigRuleDetailedStatus -> Bool)
-> Eq GetOrganizationConfigRuleDetailedStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOrganizationConfigRuleDetailedStatus
-> GetOrganizationConfigRuleDetailedStatus -> Bool
$c/= :: GetOrganizationConfigRuleDetailedStatus
-> GetOrganizationConfigRuleDetailedStatus -> Bool
== :: GetOrganizationConfigRuleDetailedStatus
-> GetOrganizationConfigRuleDetailedStatus -> Bool
$c== :: GetOrganizationConfigRuleDetailedStatus
-> GetOrganizationConfigRuleDetailedStatus -> Bool
Prelude.Eq, ReadPrec [GetOrganizationConfigRuleDetailedStatus]
ReadPrec GetOrganizationConfigRuleDetailedStatus
Int -> ReadS GetOrganizationConfigRuleDetailedStatus
ReadS [GetOrganizationConfigRuleDetailedStatus]
(Int -> ReadS GetOrganizationConfigRuleDetailedStatus)
-> ReadS [GetOrganizationConfigRuleDetailedStatus]
-> ReadPrec GetOrganizationConfigRuleDetailedStatus
-> ReadPrec [GetOrganizationConfigRuleDetailedStatus]
-> Read GetOrganizationConfigRuleDetailedStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOrganizationConfigRuleDetailedStatus]
$creadListPrec :: ReadPrec [GetOrganizationConfigRuleDetailedStatus]
readPrec :: ReadPrec GetOrganizationConfigRuleDetailedStatus
$creadPrec :: ReadPrec GetOrganizationConfigRuleDetailedStatus
readList :: ReadS [GetOrganizationConfigRuleDetailedStatus]
$creadList :: ReadS [GetOrganizationConfigRuleDetailedStatus]
readsPrec :: Int -> ReadS GetOrganizationConfigRuleDetailedStatus
$creadsPrec :: Int -> ReadS GetOrganizationConfigRuleDetailedStatus
Prelude.Read, Int -> GetOrganizationConfigRuleDetailedStatus -> ShowS
[GetOrganizationConfigRuleDetailedStatus] -> ShowS
GetOrganizationConfigRuleDetailedStatus -> String
(Int -> GetOrganizationConfigRuleDetailedStatus -> ShowS)
-> (GetOrganizationConfigRuleDetailedStatus -> String)
-> ([GetOrganizationConfigRuleDetailedStatus] -> ShowS)
-> Show GetOrganizationConfigRuleDetailedStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOrganizationConfigRuleDetailedStatus] -> ShowS
$cshowList :: [GetOrganizationConfigRuleDetailedStatus] -> ShowS
show :: GetOrganizationConfigRuleDetailedStatus -> String
$cshow :: GetOrganizationConfigRuleDetailedStatus -> String
showsPrec :: Int -> GetOrganizationConfigRuleDetailedStatus -> ShowS
$cshowsPrec :: Int -> GetOrganizationConfigRuleDetailedStatus -> ShowS
Prelude.Show, (forall x.
 GetOrganizationConfigRuleDetailedStatus
 -> Rep GetOrganizationConfigRuleDetailedStatus x)
-> (forall x.
    Rep GetOrganizationConfigRuleDetailedStatus x
    -> GetOrganizationConfigRuleDetailedStatus)
-> Generic GetOrganizationConfigRuleDetailedStatus
forall x.
Rep GetOrganizationConfigRuleDetailedStatus x
-> GetOrganizationConfigRuleDetailedStatus
forall x.
GetOrganizationConfigRuleDetailedStatus
-> Rep GetOrganizationConfigRuleDetailedStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetOrganizationConfigRuleDetailedStatus x
-> GetOrganizationConfigRuleDetailedStatus
$cfrom :: forall x.
GetOrganizationConfigRuleDetailedStatus
-> Rep GetOrganizationConfigRuleDetailedStatus x
Prelude.Generic)

-- |
-- Create a value of 'GetOrganizationConfigRuleDetailedStatus' 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:
--
-- 'filters', 'getOrganizationConfigRuleDetailedStatus_filters' - A @StatusDetailFilters@ object.
--
-- 'nextToken', 'getOrganizationConfigRuleDetailedStatus_nextToken' - The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
--
-- 'limit', 'getOrganizationConfigRuleDetailedStatus_limit' - The maximum number of @OrganizationConfigRuleDetailedStatus@ returned on
-- each page. If you do not specify a number, Config uses the default. The
-- default is 100.
--
-- 'organizationConfigRuleName', 'getOrganizationConfigRuleDetailedStatus_organizationConfigRuleName' - The name of organization config rule for which you want status details
-- for member accounts.
newGetOrganizationConfigRuleDetailedStatus ::
  -- | 'organizationConfigRuleName'
  Prelude.Text ->
  GetOrganizationConfigRuleDetailedStatus
newGetOrganizationConfigRuleDetailedStatus :: Text -> GetOrganizationConfigRuleDetailedStatus
newGetOrganizationConfigRuleDetailedStatus
  Text
pOrganizationConfigRuleName_ =
    GetOrganizationConfigRuleDetailedStatus' :: Maybe StatusDetailFilters
-> Maybe Text
-> Maybe Natural
-> Text
-> GetOrganizationConfigRuleDetailedStatus
GetOrganizationConfigRuleDetailedStatus'
      { $sel:filters:GetOrganizationConfigRuleDetailedStatus' :: Maybe StatusDetailFilters
filters =
          Maybe StatusDetailFilters
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetOrganizationConfigRuleDetailedStatus' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:limit:GetOrganizationConfigRuleDetailedStatus' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:organizationConfigRuleName:GetOrganizationConfigRuleDetailedStatus' :: Text
organizationConfigRuleName =
          Text
pOrganizationConfigRuleName_
      }

-- | A @StatusDetailFilters@ object.
getOrganizationConfigRuleDetailedStatus_filters :: Lens.Lens' GetOrganizationConfigRuleDetailedStatus (Prelude.Maybe StatusDetailFilters)
getOrganizationConfigRuleDetailedStatus_filters :: (Maybe StatusDetailFilters -> f (Maybe StatusDetailFilters))
-> GetOrganizationConfigRuleDetailedStatus
-> f GetOrganizationConfigRuleDetailedStatus
getOrganizationConfigRuleDetailedStatus_filters = (GetOrganizationConfigRuleDetailedStatus
 -> Maybe StatusDetailFilters)
-> (GetOrganizationConfigRuleDetailedStatus
    -> Maybe StatusDetailFilters
    -> GetOrganizationConfigRuleDetailedStatus)
-> Lens
     GetOrganizationConfigRuleDetailedStatus
     GetOrganizationConfigRuleDetailedStatus
     (Maybe StatusDetailFilters)
     (Maybe StatusDetailFilters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationConfigRuleDetailedStatus' {Maybe StatusDetailFilters
filters :: Maybe StatusDetailFilters
$sel:filters:GetOrganizationConfigRuleDetailedStatus' :: GetOrganizationConfigRuleDetailedStatus
-> Maybe StatusDetailFilters
filters} -> Maybe StatusDetailFilters
filters) (\s :: GetOrganizationConfigRuleDetailedStatus
s@GetOrganizationConfigRuleDetailedStatus' {} Maybe StatusDetailFilters
a -> GetOrganizationConfigRuleDetailedStatus
s {$sel:filters:GetOrganizationConfigRuleDetailedStatus' :: Maybe StatusDetailFilters
filters = Maybe StatusDetailFilters
a} :: GetOrganizationConfigRuleDetailedStatus)

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

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

-- | The name of organization config rule for which you want status details
-- for member accounts.
getOrganizationConfigRuleDetailedStatus_organizationConfigRuleName :: Lens.Lens' GetOrganizationConfigRuleDetailedStatus Prelude.Text
getOrganizationConfigRuleDetailedStatus_organizationConfigRuleName :: (Text -> f Text)
-> GetOrganizationConfigRuleDetailedStatus
-> f GetOrganizationConfigRuleDetailedStatus
getOrganizationConfigRuleDetailedStatus_organizationConfigRuleName = (GetOrganizationConfigRuleDetailedStatus -> Text)
-> (GetOrganizationConfigRuleDetailedStatus
    -> Text -> GetOrganizationConfigRuleDetailedStatus)
-> Lens
     GetOrganizationConfigRuleDetailedStatus
     GetOrganizationConfigRuleDetailedStatus
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationConfigRuleDetailedStatus' {Text
organizationConfigRuleName :: Text
$sel:organizationConfigRuleName:GetOrganizationConfigRuleDetailedStatus' :: GetOrganizationConfigRuleDetailedStatus -> Text
organizationConfigRuleName} -> Text
organizationConfigRuleName) (\s :: GetOrganizationConfigRuleDetailedStatus
s@GetOrganizationConfigRuleDetailedStatus' {} Text
a -> GetOrganizationConfigRuleDetailedStatus
s {$sel:organizationConfigRuleName:GetOrganizationConfigRuleDetailedStatus' :: Text
organizationConfigRuleName = Text
a} :: GetOrganizationConfigRuleDetailedStatus)

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

instance
  Prelude.NFData
    GetOrganizationConfigRuleDetailedStatus

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

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

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

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

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

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

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

instance
  Prelude.NFData
    GetOrganizationConfigRuleDetailedStatusResponse