{-# 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.SSOAdmin.ListPermissionSetProvisioningStatus
-- 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)
--
-- Lists the status of the permission set provisioning requests for a
-- specified SSO instance.
--
-- This operation returns paginated results.
module Amazonka.SSOAdmin.ListPermissionSetProvisioningStatus
  ( -- * Creating a Request
    ListPermissionSetProvisioningStatus (..),
    newListPermissionSetProvisioningStatus,

    -- * Request Lenses
    listPermissionSetProvisioningStatus_nextToken,
    listPermissionSetProvisioningStatus_filter,
    listPermissionSetProvisioningStatus_maxResults,
    listPermissionSetProvisioningStatus_instanceArn,

    -- * Destructuring the Response
    ListPermissionSetProvisioningStatusResponse (..),
    newListPermissionSetProvisioningStatusResponse,

    -- * Response Lenses
    listPermissionSetProvisioningStatusResponse_permissionSetsProvisioningStatus,
    listPermissionSetProvisioningStatusResponse_nextToken,
    listPermissionSetProvisioningStatusResponse_httpStatus,
  )
where

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
import Amazonka.SSOAdmin.Types

-- | /See:/ 'newListPermissionSetProvisioningStatus' smart constructor.
data ListPermissionSetProvisioningStatus = ListPermissionSetProvisioningStatus'
  { -- | The pagination token for the list API. Initially the value is null. Use
    -- the output of previous API calls to make subsequent calls.
    ListPermissionSetProvisioningStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters results based on the passed attribute value.
    ListPermissionSetProvisioningStatus -> Maybe OperationStatusFilter
filter' :: Prelude.Maybe OperationStatusFilter,
    -- | The maximum number of results to display for the assignment.
    ListPermissionSetProvisioningStatus -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the SSO instance under which the operation will be executed.
    -- For more information about ARNs, see
    -- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
    -- in the /Amazon Web Services General Reference/.
    ListPermissionSetProvisioningStatus -> Text
instanceArn :: Prelude.Text
  }
  deriving (ListPermissionSetProvisioningStatus
-> ListPermissionSetProvisioningStatus -> Bool
(ListPermissionSetProvisioningStatus
 -> ListPermissionSetProvisioningStatus -> Bool)
-> (ListPermissionSetProvisioningStatus
    -> ListPermissionSetProvisioningStatus -> Bool)
-> Eq ListPermissionSetProvisioningStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPermissionSetProvisioningStatus
-> ListPermissionSetProvisioningStatus -> Bool
$c/= :: ListPermissionSetProvisioningStatus
-> ListPermissionSetProvisioningStatus -> Bool
== :: ListPermissionSetProvisioningStatus
-> ListPermissionSetProvisioningStatus -> Bool
$c== :: ListPermissionSetProvisioningStatus
-> ListPermissionSetProvisioningStatus -> Bool
Prelude.Eq, ReadPrec [ListPermissionSetProvisioningStatus]
ReadPrec ListPermissionSetProvisioningStatus
Int -> ReadS ListPermissionSetProvisioningStatus
ReadS [ListPermissionSetProvisioningStatus]
(Int -> ReadS ListPermissionSetProvisioningStatus)
-> ReadS [ListPermissionSetProvisioningStatus]
-> ReadPrec ListPermissionSetProvisioningStatus
-> ReadPrec [ListPermissionSetProvisioningStatus]
-> Read ListPermissionSetProvisioningStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPermissionSetProvisioningStatus]
$creadListPrec :: ReadPrec [ListPermissionSetProvisioningStatus]
readPrec :: ReadPrec ListPermissionSetProvisioningStatus
$creadPrec :: ReadPrec ListPermissionSetProvisioningStatus
readList :: ReadS [ListPermissionSetProvisioningStatus]
$creadList :: ReadS [ListPermissionSetProvisioningStatus]
readsPrec :: Int -> ReadS ListPermissionSetProvisioningStatus
$creadsPrec :: Int -> ReadS ListPermissionSetProvisioningStatus
Prelude.Read, Int -> ListPermissionSetProvisioningStatus -> ShowS
[ListPermissionSetProvisioningStatus] -> ShowS
ListPermissionSetProvisioningStatus -> String
(Int -> ListPermissionSetProvisioningStatus -> ShowS)
-> (ListPermissionSetProvisioningStatus -> String)
-> ([ListPermissionSetProvisioningStatus] -> ShowS)
-> Show ListPermissionSetProvisioningStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPermissionSetProvisioningStatus] -> ShowS
$cshowList :: [ListPermissionSetProvisioningStatus] -> ShowS
show :: ListPermissionSetProvisioningStatus -> String
$cshow :: ListPermissionSetProvisioningStatus -> String
showsPrec :: Int -> ListPermissionSetProvisioningStatus -> ShowS
$cshowsPrec :: Int -> ListPermissionSetProvisioningStatus -> ShowS
Prelude.Show, (forall x.
 ListPermissionSetProvisioningStatus
 -> Rep ListPermissionSetProvisioningStatus x)
-> (forall x.
    Rep ListPermissionSetProvisioningStatus x
    -> ListPermissionSetProvisioningStatus)
-> Generic ListPermissionSetProvisioningStatus
forall x.
Rep ListPermissionSetProvisioningStatus x
-> ListPermissionSetProvisioningStatus
forall x.
ListPermissionSetProvisioningStatus
-> Rep ListPermissionSetProvisioningStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPermissionSetProvisioningStatus x
-> ListPermissionSetProvisioningStatus
$cfrom :: forall x.
ListPermissionSetProvisioningStatus
-> Rep ListPermissionSetProvisioningStatus x
Prelude.Generic)

-- |
-- Create a value of 'ListPermissionSetProvisioningStatus' 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', 'listPermissionSetProvisioningStatus_nextToken' - The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
--
-- 'filter'', 'listPermissionSetProvisioningStatus_filter' - Filters results based on the passed attribute value.
--
-- 'maxResults', 'listPermissionSetProvisioningStatus_maxResults' - The maximum number of results to display for the assignment.
--
-- 'instanceArn', 'listPermissionSetProvisioningStatus_instanceArn' - The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
newListPermissionSetProvisioningStatus ::
  -- | 'instanceArn'
  Prelude.Text ->
  ListPermissionSetProvisioningStatus
newListPermissionSetProvisioningStatus :: Text -> ListPermissionSetProvisioningStatus
newListPermissionSetProvisioningStatus Text
pInstanceArn_ =
  ListPermissionSetProvisioningStatus' :: Maybe Text
-> Maybe OperationStatusFilter
-> Maybe Natural
-> Text
-> ListPermissionSetProvisioningStatus
ListPermissionSetProvisioningStatus'
    { $sel:nextToken:ListPermissionSetProvisioningStatus' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListPermissionSetProvisioningStatus' :: Maybe OperationStatusFilter
filter' = Maybe OperationStatusFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPermissionSetProvisioningStatus' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceArn:ListPermissionSetProvisioningStatus' :: Text
instanceArn = Text
pInstanceArn_
    }

-- | The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
listPermissionSetProvisioningStatus_nextToken :: Lens.Lens' ListPermissionSetProvisioningStatus (Prelude.Maybe Prelude.Text)
listPermissionSetProvisioningStatus_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPermissionSetProvisioningStatus
-> f ListPermissionSetProvisioningStatus
listPermissionSetProvisioningStatus_nextToken = (ListPermissionSetProvisioningStatus -> Maybe Text)
-> (ListPermissionSetProvisioningStatus
    -> Maybe Text -> ListPermissionSetProvisioningStatus)
-> Lens
     ListPermissionSetProvisioningStatus
     ListPermissionSetProvisioningStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetProvisioningStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPermissionSetProvisioningStatus
s@ListPermissionSetProvisioningStatus' {} Maybe Text
a -> ListPermissionSetProvisioningStatus
s {$sel:nextToken:ListPermissionSetProvisioningStatus' :: Maybe Text
nextToken = Maybe Text
a} :: ListPermissionSetProvisioningStatus)

-- | Filters results based on the passed attribute value.
listPermissionSetProvisioningStatus_filter :: Lens.Lens' ListPermissionSetProvisioningStatus (Prelude.Maybe OperationStatusFilter)
listPermissionSetProvisioningStatus_filter :: (Maybe OperationStatusFilter -> f (Maybe OperationStatusFilter))
-> ListPermissionSetProvisioningStatus
-> f ListPermissionSetProvisioningStatus
listPermissionSetProvisioningStatus_filter = (ListPermissionSetProvisioningStatus
 -> Maybe OperationStatusFilter)
-> (ListPermissionSetProvisioningStatus
    -> Maybe OperationStatusFilter
    -> ListPermissionSetProvisioningStatus)
-> Lens
     ListPermissionSetProvisioningStatus
     ListPermissionSetProvisioningStatus
     (Maybe OperationStatusFilter)
     (Maybe OperationStatusFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetProvisioningStatus' {Maybe OperationStatusFilter
filter' :: Maybe OperationStatusFilter
$sel:filter':ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Maybe OperationStatusFilter
filter'} -> Maybe OperationStatusFilter
filter') (\s :: ListPermissionSetProvisioningStatus
s@ListPermissionSetProvisioningStatus' {} Maybe OperationStatusFilter
a -> ListPermissionSetProvisioningStatus
s {$sel:filter':ListPermissionSetProvisioningStatus' :: Maybe OperationStatusFilter
filter' = Maybe OperationStatusFilter
a} :: ListPermissionSetProvisioningStatus)

-- | The maximum number of results to display for the assignment.
listPermissionSetProvisioningStatus_maxResults :: Lens.Lens' ListPermissionSetProvisioningStatus (Prelude.Maybe Prelude.Natural)
listPermissionSetProvisioningStatus_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPermissionSetProvisioningStatus
-> f ListPermissionSetProvisioningStatus
listPermissionSetProvisioningStatus_maxResults = (ListPermissionSetProvisioningStatus -> Maybe Natural)
-> (ListPermissionSetProvisioningStatus
    -> Maybe Natural -> ListPermissionSetProvisioningStatus)
-> Lens
     ListPermissionSetProvisioningStatus
     ListPermissionSetProvisioningStatus
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetProvisioningStatus' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPermissionSetProvisioningStatus
s@ListPermissionSetProvisioningStatus' {} Maybe Natural
a -> ListPermissionSetProvisioningStatus
s {$sel:maxResults:ListPermissionSetProvisioningStatus' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPermissionSetProvisioningStatus)

-- | The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
listPermissionSetProvisioningStatus_instanceArn :: Lens.Lens' ListPermissionSetProvisioningStatus Prelude.Text
listPermissionSetProvisioningStatus_instanceArn :: (Text -> f Text)
-> ListPermissionSetProvisioningStatus
-> f ListPermissionSetProvisioningStatus
listPermissionSetProvisioningStatus_instanceArn = (ListPermissionSetProvisioningStatus -> Text)
-> (ListPermissionSetProvisioningStatus
    -> Text -> ListPermissionSetProvisioningStatus)
-> Lens
     ListPermissionSetProvisioningStatus
     ListPermissionSetProvisioningStatus
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetProvisioningStatus' {Text
instanceArn :: Text
$sel:instanceArn:ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Text
instanceArn} -> Text
instanceArn) (\s :: ListPermissionSetProvisioningStatus
s@ListPermissionSetProvisioningStatus' {} Text
a -> ListPermissionSetProvisioningStatus
s {$sel:instanceArn:ListPermissionSetProvisioningStatus' :: Text
instanceArn = Text
a} :: ListPermissionSetProvisioningStatus)

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

instance
  Prelude.NFData
    ListPermissionSetProvisioningStatus

instance
  Core.ToHeaders
    ListPermissionSetProvisioningStatus
  where
  toHeaders :: ListPermissionSetProvisioningStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListPermissionSetProvisioningStatus -> 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
"SWBExternalService.ListPermissionSetProvisioningStatus" ::
                          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
    ListPermissionSetProvisioningStatus
  where
  toJSON :: ListPermissionSetProvisioningStatus -> Value
toJSON ListPermissionSetProvisioningStatus' {Maybe Natural
Maybe Text
Maybe OperationStatusFilter
Text
instanceArn :: Text
maxResults :: Maybe Natural
filter' :: Maybe OperationStatusFilter
nextToken :: Maybe Text
$sel:instanceArn:ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Text
$sel:maxResults:ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Maybe Natural
$sel:filter':ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> Maybe OperationStatusFilter
$sel:nextToken:ListPermissionSetProvisioningStatus' :: ListPermissionSetProvisioningStatus -> 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
"Filter" Text -> OperationStatusFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OperationStatusFilter -> Pair)
-> Maybe OperationStatusFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OperationStatusFilter
filter',
            (Text
"MaxResults" 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
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceArn)
          ]
      )

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

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

-- | /See:/ 'newListPermissionSetProvisioningStatusResponse' smart constructor.
data ListPermissionSetProvisioningStatusResponse = ListPermissionSetProvisioningStatusResponse'
  { -- | The status object for the permission set provisioning operation.
    ListPermissionSetProvisioningStatusResponse
-> Maybe [PermissionSetProvisioningStatusMetadata]
permissionSetsProvisioningStatus :: Prelude.Maybe [PermissionSetProvisioningStatusMetadata],
    -- | The pagination token for the list API. Initially the value is null. Use
    -- the output of previous API calls to make subsequent calls.
    ListPermissionSetProvisioningStatusResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPermissionSetProvisioningStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPermissionSetProvisioningStatusResponse
-> ListPermissionSetProvisioningStatusResponse -> Bool
(ListPermissionSetProvisioningStatusResponse
 -> ListPermissionSetProvisioningStatusResponse -> Bool)
-> (ListPermissionSetProvisioningStatusResponse
    -> ListPermissionSetProvisioningStatusResponse -> Bool)
-> Eq ListPermissionSetProvisioningStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPermissionSetProvisioningStatusResponse
-> ListPermissionSetProvisioningStatusResponse -> Bool
$c/= :: ListPermissionSetProvisioningStatusResponse
-> ListPermissionSetProvisioningStatusResponse -> Bool
== :: ListPermissionSetProvisioningStatusResponse
-> ListPermissionSetProvisioningStatusResponse -> Bool
$c== :: ListPermissionSetProvisioningStatusResponse
-> ListPermissionSetProvisioningStatusResponse -> Bool
Prelude.Eq, ReadPrec [ListPermissionSetProvisioningStatusResponse]
ReadPrec ListPermissionSetProvisioningStatusResponse
Int -> ReadS ListPermissionSetProvisioningStatusResponse
ReadS [ListPermissionSetProvisioningStatusResponse]
(Int -> ReadS ListPermissionSetProvisioningStatusResponse)
-> ReadS [ListPermissionSetProvisioningStatusResponse]
-> ReadPrec ListPermissionSetProvisioningStatusResponse
-> ReadPrec [ListPermissionSetProvisioningStatusResponse]
-> Read ListPermissionSetProvisioningStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPermissionSetProvisioningStatusResponse]
$creadListPrec :: ReadPrec [ListPermissionSetProvisioningStatusResponse]
readPrec :: ReadPrec ListPermissionSetProvisioningStatusResponse
$creadPrec :: ReadPrec ListPermissionSetProvisioningStatusResponse
readList :: ReadS [ListPermissionSetProvisioningStatusResponse]
$creadList :: ReadS [ListPermissionSetProvisioningStatusResponse]
readsPrec :: Int -> ReadS ListPermissionSetProvisioningStatusResponse
$creadsPrec :: Int -> ReadS ListPermissionSetProvisioningStatusResponse
Prelude.Read, Int -> ListPermissionSetProvisioningStatusResponse -> ShowS
[ListPermissionSetProvisioningStatusResponse] -> ShowS
ListPermissionSetProvisioningStatusResponse -> String
(Int -> ListPermissionSetProvisioningStatusResponse -> ShowS)
-> (ListPermissionSetProvisioningStatusResponse -> String)
-> ([ListPermissionSetProvisioningStatusResponse] -> ShowS)
-> Show ListPermissionSetProvisioningStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPermissionSetProvisioningStatusResponse] -> ShowS
$cshowList :: [ListPermissionSetProvisioningStatusResponse] -> ShowS
show :: ListPermissionSetProvisioningStatusResponse -> String
$cshow :: ListPermissionSetProvisioningStatusResponse -> String
showsPrec :: Int -> ListPermissionSetProvisioningStatusResponse -> ShowS
$cshowsPrec :: Int -> ListPermissionSetProvisioningStatusResponse -> ShowS
Prelude.Show, (forall x.
 ListPermissionSetProvisioningStatusResponse
 -> Rep ListPermissionSetProvisioningStatusResponse x)
-> (forall x.
    Rep ListPermissionSetProvisioningStatusResponse x
    -> ListPermissionSetProvisioningStatusResponse)
-> Generic ListPermissionSetProvisioningStatusResponse
forall x.
Rep ListPermissionSetProvisioningStatusResponse x
-> ListPermissionSetProvisioningStatusResponse
forall x.
ListPermissionSetProvisioningStatusResponse
-> Rep ListPermissionSetProvisioningStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPermissionSetProvisioningStatusResponse x
-> ListPermissionSetProvisioningStatusResponse
$cfrom :: forall x.
ListPermissionSetProvisioningStatusResponse
-> Rep ListPermissionSetProvisioningStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPermissionSetProvisioningStatusResponse' 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:
--
-- 'permissionSetsProvisioningStatus', 'listPermissionSetProvisioningStatusResponse_permissionSetsProvisioningStatus' - The status object for the permission set provisioning operation.
--
-- 'nextToken', 'listPermissionSetProvisioningStatusResponse_nextToken' - The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
--
-- 'httpStatus', 'listPermissionSetProvisioningStatusResponse_httpStatus' - The response's http status code.
newListPermissionSetProvisioningStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPermissionSetProvisioningStatusResponse
newListPermissionSetProvisioningStatusResponse :: Int -> ListPermissionSetProvisioningStatusResponse
newListPermissionSetProvisioningStatusResponse
  Int
pHttpStatus_ =
    ListPermissionSetProvisioningStatusResponse' :: Maybe [PermissionSetProvisioningStatusMetadata]
-> Maybe Text -> Int -> ListPermissionSetProvisioningStatusResponse
ListPermissionSetProvisioningStatusResponse'
      { $sel:permissionSetsProvisioningStatus:ListPermissionSetProvisioningStatusResponse' :: Maybe [PermissionSetProvisioningStatusMetadata]
permissionSetsProvisioningStatus =
          Maybe [PermissionSetProvisioningStatusMetadata]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListPermissionSetProvisioningStatusResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListPermissionSetProvisioningStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The status object for the permission set provisioning operation.
listPermissionSetProvisioningStatusResponse_permissionSetsProvisioningStatus :: Lens.Lens' ListPermissionSetProvisioningStatusResponse (Prelude.Maybe [PermissionSetProvisioningStatusMetadata])
listPermissionSetProvisioningStatusResponse_permissionSetsProvisioningStatus :: (Maybe [PermissionSetProvisioningStatusMetadata]
 -> f (Maybe [PermissionSetProvisioningStatusMetadata]))
-> ListPermissionSetProvisioningStatusResponse
-> f ListPermissionSetProvisioningStatusResponse
listPermissionSetProvisioningStatusResponse_permissionSetsProvisioningStatus = (ListPermissionSetProvisioningStatusResponse
 -> Maybe [PermissionSetProvisioningStatusMetadata])
-> (ListPermissionSetProvisioningStatusResponse
    -> Maybe [PermissionSetProvisioningStatusMetadata]
    -> ListPermissionSetProvisioningStatusResponse)
-> Lens'
     ListPermissionSetProvisioningStatusResponse
     (Maybe [PermissionSetProvisioningStatusMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetProvisioningStatusResponse' {Maybe [PermissionSetProvisioningStatusMetadata]
permissionSetsProvisioningStatus :: Maybe [PermissionSetProvisioningStatusMetadata]
$sel:permissionSetsProvisioningStatus:ListPermissionSetProvisioningStatusResponse' :: ListPermissionSetProvisioningStatusResponse
-> Maybe [PermissionSetProvisioningStatusMetadata]
permissionSetsProvisioningStatus} -> Maybe [PermissionSetProvisioningStatusMetadata]
permissionSetsProvisioningStatus) (\s :: ListPermissionSetProvisioningStatusResponse
s@ListPermissionSetProvisioningStatusResponse' {} Maybe [PermissionSetProvisioningStatusMetadata]
a -> ListPermissionSetProvisioningStatusResponse
s {$sel:permissionSetsProvisioningStatus:ListPermissionSetProvisioningStatusResponse' :: Maybe [PermissionSetProvisioningStatusMetadata]
permissionSetsProvisioningStatus = Maybe [PermissionSetProvisioningStatusMetadata]
a} :: ListPermissionSetProvisioningStatusResponse) ((Maybe [PermissionSetProvisioningStatusMetadata]
  -> f (Maybe [PermissionSetProvisioningStatusMetadata]))
 -> ListPermissionSetProvisioningStatusResponse
 -> f ListPermissionSetProvisioningStatusResponse)
-> ((Maybe [PermissionSetProvisioningStatusMetadata]
     -> f (Maybe [PermissionSetProvisioningStatusMetadata]))
    -> Maybe [PermissionSetProvisioningStatusMetadata]
    -> f (Maybe [PermissionSetProvisioningStatusMetadata]))
-> (Maybe [PermissionSetProvisioningStatusMetadata]
    -> f (Maybe [PermissionSetProvisioningStatusMetadata]))
-> ListPermissionSetProvisioningStatusResponse
-> f ListPermissionSetProvisioningStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PermissionSetProvisioningStatusMetadata]
  [PermissionSetProvisioningStatusMetadata]
  [PermissionSetProvisioningStatusMetadata]
  [PermissionSetProvisioningStatusMetadata]
-> Iso
     (Maybe [PermissionSetProvisioningStatusMetadata])
     (Maybe [PermissionSetProvisioningStatusMetadata])
     (Maybe [PermissionSetProvisioningStatusMetadata])
     (Maybe [PermissionSetProvisioningStatusMetadata])
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
  [PermissionSetProvisioningStatusMetadata]
  [PermissionSetProvisioningStatusMetadata]
  [PermissionSetProvisioningStatusMetadata]
  [PermissionSetProvisioningStatusMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
listPermissionSetProvisioningStatusResponse_nextToken :: Lens.Lens' ListPermissionSetProvisioningStatusResponse (Prelude.Maybe Prelude.Text)
listPermissionSetProvisioningStatusResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPermissionSetProvisioningStatusResponse
-> f ListPermissionSetProvisioningStatusResponse
listPermissionSetProvisioningStatusResponse_nextToken = (ListPermissionSetProvisioningStatusResponse -> Maybe Text)
-> (ListPermissionSetProvisioningStatusResponse
    -> Maybe Text -> ListPermissionSetProvisioningStatusResponse)
-> Lens' ListPermissionSetProvisioningStatusResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetProvisioningStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPermissionSetProvisioningStatusResponse' :: ListPermissionSetProvisioningStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPermissionSetProvisioningStatusResponse
s@ListPermissionSetProvisioningStatusResponse' {} Maybe Text
a -> ListPermissionSetProvisioningStatusResponse
s {$sel:nextToken:ListPermissionSetProvisioningStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPermissionSetProvisioningStatusResponse)

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

instance
  Prelude.NFData
    ListPermissionSetProvisioningStatusResponse