{-# 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 #-}
module Amazonka.Organizations.ListCreateAccountStatus
(
ListCreateAccountStatus (..),
newListCreateAccountStatus,
listCreateAccountStatus_maxResults,
listCreateAccountStatus_nextToken,
listCreateAccountStatus_states,
ListCreateAccountStatusResponse (..),
newListCreateAccountStatusResponse,
listCreateAccountStatusResponse_createAccountStatuses,
listCreateAccountStatusResponse_nextToken,
listCreateAccountStatusResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListCreateAccountStatus = ListCreateAccountStatus'
{
ListCreateAccountStatus -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListCreateAccountStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCreateAccountStatus -> Maybe [CreateAccountState]
states :: Prelude.Maybe [CreateAccountState]
}
deriving (ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
$c/= :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
== :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
$c== :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
Prelude.Eq, ReadPrec [ListCreateAccountStatus]
ReadPrec ListCreateAccountStatus
Int -> ReadS ListCreateAccountStatus
ReadS [ListCreateAccountStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCreateAccountStatus]
$creadListPrec :: ReadPrec [ListCreateAccountStatus]
readPrec :: ReadPrec ListCreateAccountStatus
$creadPrec :: ReadPrec ListCreateAccountStatus
readList :: ReadS [ListCreateAccountStatus]
$creadList :: ReadS [ListCreateAccountStatus]
readsPrec :: Int -> ReadS ListCreateAccountStatus
$creadsPrec :: Int -> ReadS ListCreateAccountStatus
Prelude.Read, Int -> ListCreateAccountStatus -> ShowS
[ListCreateAccountStatus] -> ShowS
ListCreateAccountStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCreateAccountStatus] -> ShowS
$cshowList :: [ListCreateAccountStatus] -> ShowS
show :: ListCreateAccountStatus -> String
$cshow :: ListCreateAccountStatus -> String
showsPrec :: Int -> ListCreateAccountStatus -> ShowS
$cshowsPrec :: Int -> ListCreateAccountStatus -> ShowS
Prelude.Show, forall x. Rep ListCreateAccountStatus x -> ListCreateAccountStatus
forall x. ListCreateAccountStatus -> Rep ListCreateAccountStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCreateAccountStatus x -> ListCreateAccountStatus
$cfrom :: forall x. ListCreateAccountStatus -> Rep ListCreateAccountStatus x
Prelude.Generic)
newListCreateAccountStatus ::
ListCreateAccountStatus
newListCreateAccountStatus :: ListCreateAccountStatus
newListCreateAccountStatus =
ListCreateAccountStatus'
{ $sel:maxResults:ListCreateAccountStatus' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCreateAccountStatus' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:states:ListCreateAccountStatus' :: Maybe [CreateAccountState]
states = forall a. Maybe a
Prelude.Nothing
}
listCreateAccountStatus_maxResults :: Lens.Lens' ListCreateAccountStatus (Prelude.Maybe Prelude.Natural)
listCreateAccountStatus_maxResults :: Lens' ListCreateAccountStatus (Maybe Natural)
listCreateAccountStatus_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatus' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCreateAccountStatus
s@ListCreateAccountStatus' {} Maybe Natural
a -> ListCreateAccountStatus
s {$sel:maxResults:ListCreateAccountStatus' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCreateAccountStatus)
listCreateAccountStatus_nextToken :: Lens.Lens' ListCreateAccountStatus (Prelude.Maybe Prelude.Text)
listCreateAccountStatus_nextToken :: Lens' ListCreateAccountStatus (Maybe Text)
listCreateAccountStatus_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCreateAccountStatus
s@ListCreateAccountStatus' {} Maybe Text
a -> ListCreateAccountStatus
s {$sel:nextToken:ListCreateAccountStatus' :: Maybe Text
nextToken = Maybe Text
a} :: ListCreateAccountStatus)
listCreateAccountStatus_states :: Lens.Lens' ListCreateAccountStatus (Prelude.Maybe [CreateAccountState])
listCreateAccountStatus_states :: Lens' ListCreateAccountStatus (Maybe [CreateAccountState])
listCreateAccountStatus_states = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatus' {Maybe [CreateAccountState]
states :: Maybe [CreateAccountState]
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
states} -> Maybe [CreateAccountState]
states) (\s :: ListCreateAccountStatus
s@ListCreateAccountStatus' {} Maybe [CreateAccountState]
a -> ListCreateAccountStatus
s {$sel:states:ListCreateAccountStatus' :: Maybe [CreateAccountState]
states = Maybe [CreateAccountState]
a} :: ListCreateAccountStatus) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSPager ListCreateAccountStatus where
page :: ListCreateAccountStatus
-> AWSResponse ListCreateAccountStatus
-> Maybe ListCreateAccountStatus
page ListCreateAccountStatus
rq AWSResponse ListCreateAccountStatus
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCreateAccountStatus
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCreateAccountStatusResponse (Maybe Text)
listCreateAccountStatusResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCreateAccountStatus
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCreateAccountStatusResponse (Maybe [CreateAccountStatus])
listCreateAccountStatusResponse_createAccountStatuses
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListCreateAccountStatus
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCreateAccountStatus (Maybe Text)
listCreateAccountStatus_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCreateAccountStatus
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCreateAccountStatusResponse (Maybe Text)
listCreateAccountStatusResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListCreateAccountStatus where
type
AWSResponse ListCreateAccountStatus =
ListCreateAccountStatusResponse
request :: (Service -> Service)
-> ListCreateAccountStatus -> Request ListCreateAccountStatus
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListCreateAccountStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListCreateAccountStatus)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [CreateAccountStatus]
-> Maybe Text -> Int -> ListCreateAccountStatusResponse
ListCreateAccountStatusResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreateAccountStatuses"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListCreateAccountStatus where
hashWithSalt :: Int -> ListCreateAccountStatus -> Int
hashWithSalt Int
_salt ListCreateAccountStatus' {Maybe Natural
Maybe [CreateAccountState]
Maybe Text
states :: Maybe [CreateAccountState]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CreateAccountState]
states
instance Prelude.NFData ListCreateAccountStatus where
rnf :: ListCreateAccountStatus -> ()
rnf ListCreateAccountStatus' {Maybe Natural
Maybe [CreateAccountState]
Maybe Text
states :: Maybe [CreateAccountState]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CreateAccountState]
states
instance Data.ToHeaders ListCreateAccountStatus where
toHeaders :: ListCreateAccountStatus -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSOrganizationsV20161128.ListCreateAccountStatus" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListCreateAccountStatus where
toJSON :: ListCreateAccountStatus -> Value
toJSON ListCreateAccountStatus' {Maybe Natural
Maybe [CreateAccountState]
Maybe Text
states :: Maybe [CreateAccountState]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Key
"States" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CreateAccountState]
states
]
)
instance Data.ToPath ListCreateAccountStatus where
toPath :: ListCreateAccountStatus -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListCreateAccountStatus where
toQuery :: ListCreateAccountStatus -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListCreateAccountStatusResponse = ListCreateAccountStatusResponse'
{
ListCreateAccountStatusResponse -> Maybe [CreateAccountStatus]
createAccountStatuses :: Prelude.Maybe [CreateAccountStatus],
ListCreateAccountStatusResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCreateAccountStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
$c/= :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
== :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
$c== :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
Prelude.Eq, Int -> ListCreateAccountStatusResponse -> ShowS
[ListCreateAccountStatusResponse] -> ShowS
ListCreateAccountStatusResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCreateAccountStatusResponse] -> ShowS
$cshowList :: [ListCreateAccountStatusResponse] -> ShowS
show :: ListCreateAccountStatusResponse -> String
$cshow :: ListCreateAccountStatusResponse -> String
showsPrec :: Int -> ListCreateAccountStatusResponse -> ShowS
$cshowsPrec :: Int -> ListCreateAccountStatusResponse -> ShowS
Prelude.Show, forall x.
Rep ListCreateAccountStatusResponse x
-> ListCreateAccountStatusResponse
forall x.
ListCreateAccountStatusResponse
-> Rep ListCreateAccountStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCreateAccountStatusResponse x
-> ListCreateAccountStatusResponse
$cfrom :: forall x.
ListCreateAccountStatusResponse
-> Rep ListCreateAccountStatusResponse x
Prelude.Generic)
newListCreateAccountStatusResponse ::
Prelude.Int ->
ListCreateAccountStatusResponse
newListCreateAccountStatusResponse :: Int -> ListCreateAccountStatusResponse
newListCreateAccountStatusResponse Int
pHttpStatus_ =
ListCreateAccountStatusResponse'
{ $sel:createAccountStatuses:ListCreateAccountStatusResponse' :: Maybe [CreateAccountStatus]
createAccountStatuses =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCreateAccountStatusResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListCreateAccountStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listCreateAccountStatusResponse_createAccountStatuses :: Lens.Lens' ListCreateAccountStatusResponse (Prelude.Maybe [CreateAccountStatus])
listCreateAccountStatusResponse_createAccountStatuses :: Lens' ListCreateAccountStatusResponse (Maybe [CreateAccountStatus])
listCreateAccountStatusResponse_createAccountStatuses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatusResponse' {Maybe [CreateAccountStatus]
createAccountStatuses :: Maybe [CreateAccountStatus]
$sel:createAccountStatuses:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe [CreateAccountStatus]
createAccountStatuses} -> Maybe [CreateAccountStatus]
createAccountStatuses) (\s :: ListCreateAccountStatusResponse
s@ListCreateAccountStatusResponse' {} Maybe [CreateAccountStatus]
a -> ListCreateAccountStatusResponse
s {$sel:createAccountStatuses:ListCreateAccountStatusResponse' :: Maybe [CreateAccountStatus]
createAccountStatuses = Maybe [CreateAccountStatus]
a} :: ListCreateAccountStatusResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listCreateAccountStatusResponse_nextToken :: Lens.Lens' ListCreateAccountStatusResponse (Prelude.Maybe Prelude.Text)
listCreateAccountStatusResponse_nextToken :: Lens' ListCreateAccountStatusResponse (Maybe Text)
listCreateAccountStatusResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCreateAccountStatusResponse
s@ListCreateAccountStatusResponse' {} Maybe Text
a -> ListCreateAccountStatusResponse
s {$sel:nextToken:ListCreateAccountStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCreateAccountStatusResponse)
listCreateAccountStatusResponse_httpStatus :: Lens.Lens' ListCreateAccountStatusResponse Prelude.Int
listCreateAccountStatusResponse_httpStatus :: Lens' ListCreateAccountStatusResponse Int
listCreateAccountStatusResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListCreateAccountStatusResponse
s@ListCreateAccountStatusResponse' {} Int
a -> ListCreateAccountStatusResponse
s {$sel:httpStatus:ListCreateAccountStatusResponse' :: Int
httpStatus = Int
a} :: ListCreateAccountStatusResponse)
instance
Prelude.NFData
ListCreateAccountStatusResponse
where
rnf :: ListCreateAccountStatusResponse -> ()
rnf ListCreateAccountStatusResponse' {Int
Maybe [CreateAccountStatus]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
createAccountStatuses :: Maybe [CreateAccountStatus]
$sel:httpStatus:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Int
$sel:nextToken:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe Text
$sel:createAccountStatuses:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe [CreateAccountStatus]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [CreateAccountStatus]
createAccountStatuses
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus