{-# 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.ListAccountAssignmentCreationStatus
-- 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 creation
-- requests for a specified SSO instance.
--
-- This operation returns paginated results.
module Amazonka.SSOAdmin.ListAccountAssignmentCreationStatus
  ( -- * Creating a Request
    ListAccountAssignmentCreationStatus (..),
    newListAccountAssignmentCreationStatus,

    -- * Request Lenses
    listAccountAssignmentCreationStatus_nextToken,
    listAccountAssignmentCreationStatus_filter,
    listAccountAssignmentCreationStatus_maxResults,
    listAccountAssignmentCreationStatus_instanceArn,

    -- * Destructuring the Response
    ListAccountAssignmentCreationStatusResponse (..),
    newListAccountAssignmentCreationStatusResponse,

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

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

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

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

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

instance
  Core.AWSPager
    ListAccountAssignmentCreationStatus
  where
  page :: ListAccountAssignmentCreationStatus
-> AWSResponse ListAccountAssignmentCreationStatus
-> Maybe ListAccountAssignmentCreationStatus
page ListAccountAssignmentCreationStatus
rq AWSResponse ListAccountAssignmentCreationStatus
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAccountAssignmentCreationStatus
ListAccountAssignmentCreationStatusResponse
rs
            ListAccountAssignmentCreationStatusResponse
-> Getting
     (First Text) ListAccountAssignmentCreationStatusResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAccountAssignmentCreationStatusResponse
-> Const (First Text) ListAccountAssignmentCreationStatusResponse
Lens' ListAccountAssignmentCreationStatusResponse (Maybe Text)
listAccountAssignmentCreationStatusResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAccountAssignmentCreationStatusResponse
 -> Const (First Text) ListAccountAssignmentCreationStatusResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) ListAccountAssignmentCreationStatusResponse 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 ListAccountAssignmentCreationStatus
forall a. Maybe a
Prelude.Nothing
    | Maybe [AccountAssignmentOperationStatusMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAccountAssignmentCreationStatus
ListAccountAssignmentCreationStatusResponse
rs
            ListAccountAssignmentCreationStatusResponse
-> Getting
     (First [AccountAssignmentOperationStatusMetadata])
     ListAccountAssignmentCreationStatusResponse
     [AccountAssignmentOperationStatusMetadata]
-> Maybe [AccountAssignmentOperationStatusMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AccountAssignmentOperationStatusMetadata]
 -> Const
      (First [AccountAssignmentOperationStatusMetadata])
      (Maybe [AccountAssignmentOperationStatusMetadata]))
-> ListAccountAssignmentCreationStatusResponse
-> Const
     (First [AccountAssignmentOperationStatusMetadata])
     ListAccountAssignmentCreationStatusResponse
Lens'
  ListAccountAssignmentCreationStatusResponse
  (Maybe [AccountAssignmentOperationStatusMetadata])
listAccountAssignmentCreationStatusResponse_accountAssignmentsCreationStatus
              ((Maybe [AccountAssignmentOperationStatusMetadata]
  -> Const
       (First [AccountAssignmentOperationStatusMetadata])
       (Maybe [AccountAssignmentOperationStatusMetadata]))
 -> ListAccountAssignmentCreationStatusResponse
 -> Const
      (First [AccountAssignmentOperationStatusMetadata])
      ListAccountAssignmentCreationStatusResponse)
-> (([AccountAssignmentOperationStatusMetadata]
     -> Const
          (First [AccountAssignmentOperationStatusMetadata])
          [AccountAssignmentOperationStatusMetadata])
    -> Maybe [AccountAssignmentOperationStatusMetadata]
    -> Const
         (First [AccountAssignmentOperationStatusMetadata])
         (Maybe [AccountAssignmentOperationStatusMetadata]))
-> Getting
     (First [AccountAssignmentOperationStatusMetadata])
     ListAccountAssignmentCreationStatusResponse
     [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 ListAccountAssignmentCreationStatus
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAccountAssignmentCreationStatus
-> Maybe ListAccountAssignmentCreationStatus
forall a. a -> Maybe a
Prelude.Just (ListAccountAssignmentCreationStatus
 -> Maybe ListAccountAssignmentCreationStatus)
-> ListAccountAssignmentCreationStatus
-> Maybe ListAccountAssignmentCreationStatus
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAccountAssignmentCreationStatus
rq
          ListAccountAssignmentCreationStatus
-> (ListAccountAssignmentCreationStatus
    -> ListAccountAssignmentCreationStatus)
-> ListAccountAssignmentCreationStatus
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAccountAssignmentCreationStatus
-> Identity ListAccountAssignmentCreationStatus
Lens
  ListAccountAssignmentCreationStatus
  ListAccountAssignmentCreationStatus
  (Maybe Text)
  (Maybe Text)
listAccountAssignmentCreationStatus_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAccountAssignmentCreationStatus
 -> Identity ListAccountAssignmentCreationStatus)
-> Maybe Text
-> ListAccountAssignmentCreationStatus
-> ListAccountAssignmentCreationStatus
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAccountAssignmentCreationStatus
ListAccountAssignmentCreationStatusResponse
rs
          ListAccountAssignmentCreationStatusResponse
-> Getting
     (First Text) ListAccountAssignmentCreationStatusResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAccountAssignmentCreationStatusResponse
-> Const (First Text) ListAccountAssignmentCreationStatusResponse
Lens' ListAccountAssignmentCreationStatusResponse (Maybe Text)
listAccountAssignmentCreationStatusResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAccountAssignmentCreationStatusResponse
 -> Const (First Text) ListAccountAssignmentCreationStatusResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) ListAccountAssignmentCreationStatusResponse 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
    ListAccountAssignmentCreationStatus
  where
  type
    AWSResponse ListAccountAssignmentCreationStatus =
      ListAccountAssignmentCreationStatusResponse
  request :: ListAccountAssignmentCreationStatus
-> Request ListAccountAssignmentCreationStatus
request = Service
-> ListAccountAssignmentCreationStatus
-> Request ListAccountAssignmentCreationStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAccountAssignmentCreationStatus
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListAccountAssignmentCreationStatus)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAccountAssignmentCreationStatus))
-> Logger
-> Service
-> Proxy ListAccountAssignmentCreationStatus
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListAccountAssignmentCreationStatus)))
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 -> ListAccountAssignmentCreationStatusResponse
ListAccountAssignmentCreationStatusResponse'
            (Maybe [AccountAssignmentOperationStatusMetadata]
 -> Maybe Text
 -> Int
 -> ListAccountAssignmentCreationStatusResponse)
-> Either String (Maybe [AccountAssignmentOperationStatusMetadata])
-> Either
     String
     (Maybe Text -> Int -> ListAccountAssignmentCreationStatusResponse)
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
"AccountAssignmentsCreationStatus"
                            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 -> ListAccountAssignmentCreationStatusResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> ListAccountAssignmentCreationStatusResponse)
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 -> ListAccountAssignmentCreationStatusResponse)
-> Either String Int
-> Either String ListAccountAssignmentCreationStatusResponse
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
    ListAccountAssignmentCreationStatus

instance
  Prelude.NFData
    ListAccountAssignmentCreationStatus

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

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

-- | /See:/ 'newListAccountAssignmentCreationStatusResponse' smart constructor.
data ListAccountAssignmentCreationStatusResponse = ListAccountAssignmentCreationStatusResponse'
  { -- | The status object for the account assignment creation operation.
    ListAccountAssignmentCreationStatusResponse
-> Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsCreationStatus :: 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.
    ListAccountAssignmentCreationStatusResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAccountAssignmentCreationStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAccountAssignmentCreationStatusResponse
-> ListAccountAssignmentCreationStatusResponse -> Bool
(ListAccountAssignmentCreationStatusResponse
 -> ListAccountAssignmentCreationStatusResponse -> Bool)
-> (ListAccountAssignmentCreationStatusResponse
    -> ListAccountAssignmentCreationStatusResponse -> Bool)
-> Eq ListAccountAssignmentCreationStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccountAssignmentCreationStatusResponse
-> ListAccountAssignmentCreationStatusResponse -> Bool
$c/= :: ListAccountAssignmentCreationStatusResponse
-> ListAccountAssignmentCreationStatusResponse -> Bool
== :: ListAccountAssignmentCreationStatusResponse
-> ListAccountAssignmentCreationStatusResponse -> Bool
$c== :: ListAccountAssignmentCreationStatusResponse
-> ListAccountAssignmentCreationStatusResponse -> Bool
Prelude.Eq, ReadPrec [ListAccountAssignmentCreationStatusResponse]
ReadPrec ListAccountAssignmentCreationStatusResponse
Int -> ReadS ListAccountAssignmentCreationStatusResponse
ReadS [ListAccountAssignmentCreationStatusResponse]
(Int -> ReadS ListAccountAssignmentCreationStatusResponse)
-> ReadS [ListAccountAssignmentCreationStatusResponse]
-> ReadPrec ListAccountAssignmentCreationStatusResponse
-> ReadPrec [ListAccountAssignmentCreationStatusResponse]
-> Read ListAccountAssignmentCreationStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccountAssignmentCreationStatusResponse]
$creadListPrec :: ReadPrec [ListAccountAssignmentCreationStatusResponse]
readPrec :: ReadPrec ListAccountAssignmentCreationStatusResponse
$creadPrec :: ReadPrec ListAccountAssignmentCreationStatusResponse
readList :: ReadS [ListAccountAssignmentCreationStatusResponse]
$creadList :: ReadS [ListAccountAssignmentCreationStatusResponse]
readsPrec :: Int -> ReadS ListAccountAssignmentCreationStatusResponse
$creadsPrec :: Int -> ReadS ListAccountAssignmentCreationStatusResponse
Prelude.Read, Int -> ListAccountAssignmentCreationStatusResponse -> ShowS
[ListAccountAssignmentCreationStatusResponse] -> ShowS
ListAccountAssignmentCreationStatusResponse -> String
(Int -> ListAccountAssignmentCreationStatusResponse -> ShowS)
-> (ListAccountAssignmentCreationStatusResponse -> String)
-> ([ListAccountAssignmentCreationStatusResponse] -> ShowS)
-> Show ListAccountAssignmentCreationStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccountAssignmentCreationStatusResponse] -> ShowS
$cshowList :: [ListAccountAssignmentCreationStatusResponse] -> ShowS
show :: ListAccountAssignmentCreationStatusResponse -> String
$cshow :: ListAccountAssignmentCreationStatusResponse -> String
showsPrec :: Int -> ListAccountAssignmentCreationStatusResponse -> ShowS
$cshowsPrec :: Int -> ListAccountAssignmentCreationStatusResponse -> ShowS
Prelude.Show, (forall x.
 ListAccountAssignmentCreationStatusResponse
 -> Rep ListAccountAssignmentCreationStatusResponse x)
-> (forall x.
    Rep ListAccountAssignmentCreationStatusResponse x
    -> ListAccountAssignmentCreationStatusResponse)
-> Generic ListAccountAssignmentCreationStatusResponse
forall x.
Rep ListAccountAssignmentCreationStatusResponse x
-> ListAccountAssignmentCreationStatusResponse
forall x.
ListAccountAssignmentCreationStatusResponse
-> Rep ListAccountAssignmentCreationStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAccountAssignmentCreationStatusResponse x
-> ListAccountAssignmentCreationStatusResponse
$cfrom :: forall x.
ListAccountAssignmentCreationStatusResponse
-> Rep ListAccountAssignmentCreationStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAccountAssignmentCreationStatusResponse' 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:
--
-- 'accountAssignmentsCreationStatus', 'listAccountAssignmentCreationStatusResponse_accountAssignmentsCreationStatus' - The status object for the account assignment creation operation.
--
-- 'nextToken', 'listAccountAssignmentCreationStatusResponse_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', 'listAccountAssignmentCreationStatusResponse_httpStatus' - The response's http status code.
newListAccountAssignmentCreationStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAccountAssignmentCreationStatusResponse
newListAccountAssignmentCreationStatusResponse :: Int -> ListAccountAssignmentCreationStatusResponse
newListAccountAssignmentCreationStatusResponse
  Int
pHttpStatus_ =
    ListAccountAssignmentCreationStatusResponse' :: Maybe [AccountAssignmentOperationStatusMetadata]
-> Maybe Text -> Int -> ListAccountAssignmentCreationStatusResponse
ListAccountAssignmentCreationStatusResponse'
      { $sel:accountAssignmentsCreationStatus:ListAccountAssignmentCreationStatusResponse' :: Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsCreationStatus =
          Maybe [AccountAssignmentOperationStatusMetadata]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListAccountAssignmentCreationStatusResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListAccountAssignmentCreationStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The status object for the account assignment creation operation.
listAccountAssignmentCreationStatusResponse_accountAssignmentsCreationStatus :: Lens.Lens' ListAccountAssignmentCreationStatusResponse (Prelude.Maybe [AccountAssignmentOperationStatusMetadata])
listAccountAssignmentCreationStatusResponse_accountAssignmentsCreationStatus :: (Maybe [AccountAssignmentOperationStatusMetadata]
 -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
-> ListAccountAssignmentCreationStatusResponse
-> f ListAccountAssignmentCreationStatusResponse
listAccountAssignmentCreationStatusResponse_accountAssignmentsCreationStatus = (ListAccountAssignmentCreationStatusResponse
 -> Maybe [AccountAssignmentOperationStatusMetadata])
-> (ListAccountAssignmentCreationStatusResponse
    -> Maybe [AccountAssignmentOperationStatusMetadata]
    -> ListAccountAssignmentCreationStatusResponse)
-> Lens'
     ListAccountAssignmentCreationStatusResponse
     (Maybe [AccountAssignmentOperationStatusMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAssignmentCreationStatusResponse' {Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsCreationStatus :: Maybe [AccountAssignmentOperationStatusMetadata]
$sel:accountAssignmentsCreationStatus:ListAccountAssignmentCreationStatusResponse' :: ListAccountAssignmentCreationStatusResponse
-> Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsCreationStatus} -> Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsCreationStatus) (\s :: ListAccountAssignmentCreationStatusResponse
s@ListAccountAssignmentCreationStatusResponse' {} Maybe [AccountAssignmentOperationStatusMetadata]
a -> ListAccountAssignmentCreationStatusResponse
s {$sel:accountAssignmentsCreationStatus:ListAccountAssignmentCreationStatusResponse' :: Maybe [AccountAssignmentOperationStatusMetadata]
accountAssignmentsCreationStatus = Maybe [AccountAssignmentOperationStatusMetadata]
a} :: ListAccountAssignmentCreationStatusResponse) ((Maybe [AccountAssignmentOperationStatusMetadata]
  -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
 -> ListAccountAssignmentCreationStatusResponse
 -> f ListAccountAssignmentCreationStatusResponse)
-> ((Maybe [AccountAssignmentOperationStatusMetadata]
     -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
    -> Maybe [AccountAssignmentOperationStatusMetadata]
    -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
-> (Maybe [AccountAssignmentOperationStatusMetadata]
    -> f (Maybe [AccountAssignmentOperationStatusMetadata]))
-> ListAccountAssignmentCreationStatusResponse
-> f ListAccountAssignmentCreationStatusResponse
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.
listAccountAssignmentCreationStatusResponse_nextToken :: Lens.Lens' ListAccountAssignmentCreationStatusResponse (Prelude.Maybe Prelude.Text)
listAccountAssignmentCreationStatusResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAccountAssignmentCreationStatusResponse
-> f ListAccountAssignmentCreationStatusResponse
listAccountAssignmentCreationStatusResponse_nextToken = (ListAccountAssignmentCreationStatusResponse -> Maybe Text)
-> (ListAccountAssignmentCreationStatusResponse
    -> Maybe Text -> ListAccountAssignmentCreationStatusResponse)
-> Lens' ListAccountAssignmentCreationStatusResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAssignmentCreationStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAccountAssignmentCreationStatusResponse' :: ListAccountAssignmentCreationStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAccountAssignmentCreationStatusResponse
s@ListAccountAssignmentCreationStatusResponse' {} Maybe Text
a -> ListAccountAssignmentCreationStatusResponse
s {$sel:nextToken:ListAccountAssignmentCreationStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAccountAssignmentCreationStatusResponse)

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

instance
  Prelude.NFData
    ListAccountAssignmentCreationStatusResponse