{-# 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.ListAccountAssignmentDeletionStatus
-- 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 Amazon Web Services account assignment deletion
-- requests for a specified SSO instance.
--
-- This operation returns paginated results.
module Amazonka.SSOAdmin.ListAccountAssignmentDeletionStatus
  ( -- * Creating a Request
    ListAccountAssignmentDeletionStatus (..),
    newListAccountAssignmentDeletionStatus,

    -- * Request Lenses
    listAccountAssignmentDeletionStatus_nextToken,
    listAccountAssignmentDeletionStatus_filter,
    listAccountAssignmentDeletionStatus_maxResults,
    listAccountAssignmentDeletionStatus_instanceArn,

    -- * Destructuring the Response
    ListAccountAssignmentDeletionStatusResponse (..),
    newListAccountAssignmentDeletionStatusResponse,

    -- * Response Lenses
    listAccountAssignmentDeletionStatusResponse_accountAssignmentsDeletionStatus,
    listAccountAssignmentDeletionStatusResponse_nextToken,
    listAccountAssignmentDeletionStatusResponse_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:/ 'newListAccountAssignmentDeletionStatus' smart constructor.
data ListAccountAssignmentDeletionStatus = ListAccountAssignmentDeletionStatus'
  { -- | The pagination token for the list API. Initially the value is null. Use
    -- the output of previous API calls to make subsequent calls.
    ListAccountAssignmentDeletionStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters results based on the passed attribute value.
    ListAccountAssignmentDeletionStatus -> Maybe OperationStatusFilter
filter' :: Prelude.Maybe OperationStatusFilter,
    -- | The maximum number of results to display for the assignment.
    ListAccountAssignmentDeletionStatus -> 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/.
    ListAccountAssignmentDeletionStatus -> Text
instanceArn :: Prelude.Text
  }
  deriving (ListAccountAssignmentDeletionStatus
-> ListAccountAssignmentDeletionStatus -> Bool
(ListAccountAssignmentDeletionStatus
 -> ListAccountAssignmentDeletionStatus -> Bool)
-> (ListAccountAssignmentDeletionStatus
    -> ListAccountAssignmentDeletionStatus -> Bool)
-> Eq ListAccountAssignmentDeletionStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccountAssignmentDeletionStatus
-> ListAccountAssignmentDeletionStatus -> Bool
$c/= :: ListAccountAssignmentDeletionStatus
-> ListAccountAssignmentDeletionStatus -> Bool
== :: ListAccountAssignmentDeletionStatus
-> ListAccountAssignmentDeletionStatus -> Bool
$c== :: ListAccountAssignmentDeletionStatus
-> ListAccountAssignmentDeletionStatus -> Bool
Prelude.Eq, ReadPrec [ListAccountAssignmentDeletionStatus]
ReadPrec ListAccountAssignmentDeletionStatus
Int -> ReadS ListAccountAssignmentDeletionStatus
ReadS [ListAccountAssignmentDeletionStatus]
(Int -> ReadS ListAccountAssignmentDeletionStatus)
-> ReadS [ListAccountAssignmentDeletionStatus]
-> ReadPrec ListAccountAssignmentDeletionStatus
-> ReadPrec [ListAccountAssignmentDeletionStatus]
-> Read ListAccountAssignmentDeletionStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccountAssignmentDeletionStatus]
$creadListPrec :: ReadPrec [ListAccountAssignmentDeletionStatus]
readPrec :: ReadPrec ListAccountAssignmentDeletionStatus
$creadPrec :: ReadPrec ListAccountAssignmentDeletionStatus
readList :: ReadS [ListAccountAssignmentDeletionStatus]
$creadList :: ReadS [ListAccountAssignmentDeletionStatus]
readsPrec :: Int -> ReadS ListAccountAssignmentDeletionStatus
$creadsPrec :: Int -> ReadS ListAccountAssignmentDeletionStatus
Prelude.Read, Int -> ListAccountAssignmentDeletionStatus -> ShowS
[ListAccountAssignmentDeletionStatus] -> ShowS
ListAccountAssignmentDeletionStatus -> String
(Int -> ListAccountAssignmentDeletionStatus -> ShowS)
-> (ListAccountAssignmentDeletionStatus -> String)
-> ([ListAccountAssignmentDeletionStatus] -> ShowS)
-> Show ListAccountAssignmentDeletionStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccountAssignmentDeletionStatus] -> ShowS
$cshowList :: [ListAccountAssignmentDeletionStatus] -> ShowS
show :: ListAccountAssignmentDeletionStatus -> String
$cshow :: ListAccountAssignmentDeletionStatus -> String
showsPrec :: Int -> ListAccountAssignmentDeletionStatus -> ShowS
$cshowsPrec :: Int -> ListAccountAssignmentDeletionStatus -> ShowS
Prelude.Show, (forall x.
 ListAccountAssignmentDeletionStatus
 -> Rep ListAccountAssignmentDeletionStatus x)
-> (forall x.
    Rep ListAccountAssignmentDeletionStatus x
    -> ListAccountAssignmentDeletionStatus)
-> Generic ListAccountAssignmentDeletionStatus
forall x.
Rep ListAccountAssignmentDeletionStatus x
-> ListAccountAssignmentDeletionStatus
forall x.
ListAccountAssignmentDeletionStatus
-> Rep ListAccountAssignmentDeletionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAccountAssignmentDeletionStatus x
-> ListAccountAssignmentDeletionStatus
$cfrom :: forall x.
ListAccountAssignmentDeletionStatus
-> Rep ListAccountAssignmentDeletionStatus x
Prelude.Generic)

-- |
-- Create a value of 'ListAccountAssignmentDeletionStatus' 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', 'listAccountAssignmentDeletionStatus_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'', 'listAccountAssignmentDeletionStatus_filter' - Filters results based on the passed attribute value.
--
-- 'maxResults', 'listAccountAssignmentDeletionStatus_maxResults' - The maximum number of results to display for the assignment.
--
-- 'instanceArn', 'listAccountAssignmentDeletionStatus_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/.
newListAccountAssignmentDeletionStatus ::
  -- | 'instanceArn'
  Prelude.Text ->
  ListAccountAssignmentDeletionStatus
newListAccountAssignmentDeletionStatus :: Text -> ListAccountAssignmentDeletionStatus
newListAccountAssignmentDeletionStatus Text
pInstanceArn_ =
  ListAccountAssignmentDeletionStatus' :: Maybe Text
-> Maybe OperationStatusFilter
-> Maybe Natural
-> Text
-> ListAccountAssignmentDeletionStatus
ListAccountAssignmentDeletionStatus'
    { $sel:nextToken:ListAccountAssignmentDeletionStatus' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListAccountAssignmentDeletionStatus' :: Maybe OperationStatusFilter
filter' = Maybe OperationStatusFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAccountAssignmentDeletionStatus' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceArn:ListAccountAssignmentDeletionStatus' :: 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.
listAccountAssignmentDeletionStatus_nextToken :: Lens.Lens' ListAccountAssignmentDeletionStatus (Prelude.Maybe Prelude.Text)
listAccountAssignmentDeletionStatus_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAccountAssignmentDeletionStatus
-> f ListAccountAssignmentDeletionStatus
listAccountAssignmentDeletionStatus_nextToken = (ListAccountAssignmentDeletionStatus -> Maybe Text)
-> (ListAccountAssignmentDeletionStatus
    -> Maybe Text -> ListAccountAssignmentDeletionStatus)
-> Lens
     ListAccountAssignmentDeletionStatus
     ListAccountAssignmentDeletionStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAssignmentDeletionStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAccountAssignmentDeletionStatus' :: ListAccountAssignmentDeletionStatus -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAccountAssignmentDeletionStatus
s@ListAccountAssignmentDeletionStatus' {} Maybe Text
a -> ListAccountAssignmentDeletionStatus
s {$sel:nextToken:ListAccountAssignmentDeletionStatus' :: Maybe Text
nextToken = Maybe Text
a} :: ListAccountAssignmentDeletionStatus)

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

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

-- | 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/.
listAccountAssignmentDeletionStatus_instanceArn :: Lens.Lens' ListAccountAssignmentDeletionStatus Prelude.Text
listAccountAssignmentDeletionStatus_instanceArn :: (Text -> f Text)
-> ListAccountAssignmentDeletionStatus
-> f ListAccountAssignmentDeletionStatus
listAccountAssignmentDeletionStatus_instanceArn = (ListAccountAssignmentDeletionStatus -> Text)
-> (ListAccountAssignmentDeletionStatus
    -> Text -> ListAccountAssignmentDeletionStatus)
-> Lens
     ListAccountAssignmentDeletionStatus
     ListAccountAssignmentDeletionStatus
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAssignmentDeletionStatus' {Text
instanceArn :: Text
$sel:instanceArn:ListAccountAssignmentDeletionStatus' :: ListAccountAssignmentDeletionStatus -> Text
instanceArn} -> Text
instanceArn) (\s :: ListAccountAssignmentDeletionStatus
s@ListAccountAssignmentDeletionStatus' {} Text
a -> ListAccountAssignmentDeletionStatus
s {$sel:instanceArn:ListAccountAssignmentDeletionStatus' :: Text
instanceArn = Text
a} :: ListAccountAssignmentDeletionStatus)

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

instance
  Prelude.NFData
    ListAccountAssignmentDeletionStatus

instance
  Core.ToHeaders
    ListAccountAssignmentDeletionStatus
  where
  toHeaders :: ListAccountAssignmentDeletionStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListAccountAssignmentDeletionStatus -> 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.ListAccountAssignmentDeletionStatus" ::
                          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
    ListAccountAssignmentDeletionStatus
  where
  toJSON :: ListAccountAssignmentDeletionStatus -> Value
toJSON ListAccountAssignmentDeletionStatus' {Maybe Natural
Maybe Text
Maybe OperationStatusFilter
Text
instanceArn :: Text
maxResults :: Maybe Natural
filter' :: Maybe OperationStatusFilter
nextToken :: Maybe Text
$sel:instanceArn:ListAccountAssignmentDeletionStatus' :: ListAccountAssignmentDeletionStatus -> Text
$sel:maxResults:ListAccountAssignmentDeletionStatus' :: ListAccountAssignmentDeletionStatus -> Maybe Natural
$sel:filter':ListAccountAssignmentDeletionStatus' :: ListAccountAssignmentDeletionStatus -> Maybe OperationStatusFilter
$sel:nextToken:ListAccountAssignmentDeletionStatus' :: ListAccountAssignmentDeletionStatus -> 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
    ListAccountAssignmentDeletionStatus
  where
  toPath :: ListAccountAssignmentDeletionStatus -> ByteString
toPath = ByteString -> ListAccountAssignmentDeletionStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'ListAccountAssignmentDeletionStatusResponse' 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:
--
-- 'accountAssignmentsDeletionStatus', 'listAccountAssignmentDeletionStatusResponse_accountAssignmentsDeletionStatus' - The status object for the account assignment deletion operation.
--
-- 'nextToken', 'listAccountAssignmentDeletionStatusResponse_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', 'listAccountAssignmentDeletionStatusResponse_httpStatus' - The response's http status code.
newListAccountAssignmentDeletionStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAccountAssignmentDeletionStatusResponse
newListAccountAssignmentDeletionStatusResponse :: Int -> ListAccountAssignmentDeletionStatusResponse
newListAccountAssignmentDeletionStatusResponse
  Int
pHttpStatus_ =
    ListAccountAssignmentDeletionStatusResponse' :: Maybe [AccountAssignmentOperationStatusMetadata]
-> Maybe Text -> Int -> ListAccountAssignmentDeletionStatusResponse
ListAccountAssignmentDeletionStatusResponse'
      { $sel:accountAssignmentsDeletionStatus:ListAccountAssignmentDeletionStatusResponse' :: Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsDeletionStatus =
          Maybe [AccountAssignmentOperationStatusMetadata]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListAccountAssignmentDeletionStatusResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListAccountAssignmentDeletionStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The status object for the account assignment deletion operation.
listAccountAssignmentDeletionStatusResponse_accountAssignmentsDeletionStatus :: Lens.Lens' ListAccountAssignmentDeletionStatusResponse (Prelude.Maybe [AccountAssignmentOperationStatusMetadata])
listAccountAssignmentDeletionStatusResponse_accountAssignmentsDeletionStatus :: (Maybe [AccountAssignmentOperationStatusMetadata]
 -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
-> ListAccountAssignmentDeletionStatusResponse
-> f ListAccountAssignmentDeletionStatusResponse
listAccountAssignmentDeletionStatusResponse_accountAssignmentsDeletionStatus = (ListAccountAssignmentDeletionStatusResponse
 -> Maybe [AccountAssignmentOperationStatusMetadata])
-> (ListAccountAssignmentDeletionStatusResponse
    -> Maybe [AccountAssignmentOperationStatusMetadata]
    -> ListAccountAssignmentDeletionStatusResponse)
-> Lens'
     ListAccountAssignmentDeletionStatusResponse
     (Maybe [AccountAssignmentOperationStatusMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAssignmentDeletionStatusResponse' {Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsDeletionStatus :: Maybe [AccountAssignmentOperationStatusMetadata]
$sel:accountAssignmentsDeletionStatus:ListAccountAssignmentDeletionStatusResponse' :: ListAccountAssignmentDeletionStatusResponse
-> Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsDeletionStatus} -> Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsDeletionStatus) (\s :: ListAccountAssignmentDeletionStatusResponse
s@ListAccountAssignmentDeletionStatusResponse' {} Maybe [AccountAssignmentOperationStatusMetadata]
a -> ListAccountAssignmentDeletionStatusResponse
s {$sel:accountAssignmentsDeletionStatus:ListAccountAssignmentDeletionStatusResponse' :: Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsDeletionStatus = Maybe [AccountAssignmentOperationStatusMetadata]
a} :: ListAccountAssignmentDeletionStatusResponse) ((Maybe [AccountAssignmentOperationStatusMetadata]
  -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
 -> ListAccountAssignmentDeletionStatusResponse
 -> f ListAccountAssignmentDeletionStatusResponse)
-> ((Maybe [AccountAssignmentOperationStatusMetadata]
     -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
    -> Maybe [AccountAssignmentOperationStatusMetadata]
    -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
-> (Maybe [AccountAssignmentOperationStatusMetadata]
    -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
-> ListAccountAssignmentDeletionStatusResponse
-> f ListAccountAssignmentDeletionStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AccountAssignmentOperationStatusMetadata]
  [AccountAssignmentOperationStatusMetadata]
  [AccountAssignmentOperationStatusMetadata]
  [AccountAssignmentOperationStatusMetadata]
-> Iso
     (Maybe [AccountAssignmentOperationStatusMetadata])
     (Maybe [AccountAssignmentOperationStatusMetadata])
     (Maybe [AccountAssignmentOperationStatusMetadata])
     (Maybe [AccountAssignmentOperationStatusMetadata])
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
  [AccountAssignmentOperationStatusMetadata]
  [AccountAssignmentOperationStatusMetadata]
  [AccountAssignmentOperationStatusMetadata]
  [AccountAssignmentOperationStatusMetadata]
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.
listAccountAssignmentDeletionStatusResponse_nextToken :: Lens.Lens' ListAccountAssignmentDeletionStatusResponse (Prelude.Maybe Prelude.Text)
listAccountAssignmentDeletionStatusResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAccountAssignmentDeletionStatusResponse
-> f ListAccountAssignmentDeletionStatusResponse
listAccountAssignmentDeletionStatusResponse_nextToken = (ListAccountAssignmentDeletionStatusResponse -> Maybe Text)
-> (ListAccountAssignmentDeletionStatusResponse
    -> Maybe Text -> ListAccountAssignmentDeletionStatusResponse)
-> Lens' ListAccountAssignmentDeletionStatusResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAssignmentDeletionStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAccountAssignmentDeletionStatusResponse' :: ListAccountAssignmentDeletionStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAccountAssignmentDeletionStatusResponse
s@ListAccountAssignmentDeletionStatusResponse' {} Maybe Text
a -> ListAccountAssignmentDeletionStatusResponse
s {$sel:nextToken:ListAccountAssignmentDeletionStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAccountAssignmentDeletionStatusResponse)

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

instance
  Prelude.NFData
    ListAccountAssignmentDeletionStatusResponse