{-# 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.IAM.ListAccountAliases
(
ListAccountAliases (..),
newListAccountAliases,
listAccountAliases_marker,
listAccountAliases_maxItems,
ListAccountAliasesResponse (..),
newListAccountAliasesResponse,
listAccountAliasesResponse_isTruncated,
listAccountAliasesResponse_marker,
listAccountAliasesResponse_httpStatus,
listAccountAliasesResponse_accountAliases,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAccountAliases = ListAccountAliases'
{
ListAccountAliases -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListAccountAliases -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
}
deriving (ListAccountAliases -> ListAccountAliases -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccountAliases -> ListAccountAliases -> Bool
$c/= :: ListAccountAliases -> ListAccountAliases -> Bool
== :: ListAccountAliases -> ListAccountAliases -> Bool
$c== :: ListAccountAliases -> ListAccountAliases -> Bool
Prelude.Eq, ReadPrec [ListAccountAliases]
ReadPrec ListAccountAliases
Int -> ReadS ListAccountAliases
ReadS [ListAccountAliases]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccountAliases]
$creadListPrec :: ReadPrec [ListAccountAliases]
readPrec :: ReadPrec ListAccountAliases
$creadPrec :: ReadPrec ListAccountAliases
readList :: ReadS [ListAccountAliases]
$creadList :: ReadS [ListAccountAliases]
readsPrec :: Int -> ReadS ListAccountAliases
$creadsPrec :: Int -> ReadS ListAccountAliases
Prelude.Read, Int -> ListAccountAliases -> ShowS
[ListAccountAliases] -> ShowS
ListAccountAliases -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccountAliases] -> ShowS
$cshowList :: [ListAccountAliases] -> ShowS
show :: ListAccountAliases -> String
$cshow :: ListAccountAliases -> String
showsPrec :: Int -> ListAccountAliases -> ShowS
$cshowsPrec :: Int -> ListAccountAliases -> ShowS
Prelude.Show, forall x. Rep ListAccountAliases x -> ListAccountAliases
forall x. ListAccountAliases -> Rep ListAccountAliases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAccountAliases x -> ListAccountAliases
$cfrom :: forall x. ListAccountAliases -> Rep ListAccountAliases x
Prelude.Generic)
newListAccountAliases ::
ListAccountAliases
newListAccountAliases :: ListAccountAliases
newListAccountAliases =
ListAccountAliases'
{ $sel:marker:ListAccountAliases' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListAccountAliases' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing
}
listAccountAliases_marker :: Lens.Lens' ListAccountAliases (Prelude.Maybe Prelude.Text)
listAccountAliases_marker :: Lens' ListAccountAliases (Maybe Text)
listAccountAliases_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAliases' {Maybe Text
marker :: Maybe Text
$sel:marker:ListAccountAliases' :: ListAccountAliases -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListAccountAliases
s@ListAccountAliases' {} Maybe Text
a -> ListAccountAliases
s {$sel:marker:ListAccountAliases' :: Maybe Text
marker = Maybe Text
a} :: ListAccountAliases)
listAccountAliases_maxItems :: Lens.Lens' ListAccountAliases (Prelude.Maybe Prelude.Natural)
listAccountAliases_maxItems :: Lens' ListAccountAliases (Maybe Natural)
listAccountAliases_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAliases' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListAccountAliases' :: ListAccountAliases -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListAccountAliases
s@ListAccountAliases' {} Maybe Natural
a -> ListAccountAliases
s {$sel:maxItems:ListAccountAliases' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListAccountAliases)
instance Core.AWSPager ListAccountAliases where
page :: ListAccountAliases
-> AWSResponse ListAccountAliases -> Maybe ListAccountAliases
page ListAccountAliases
rq AWSResponse ListAccountAliases
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAccountAliases
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAccountAliasesResponse (Maybe Bool)
listAccountAliasesResponse_isTruncated
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. Maybe a -> Bool
Prelude.isNothing
( AWSResponse ListAccountAliases
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAccountAliasesResponse (Maybe Text)
listAccountAliasesResponse_marker
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.$ ListAccountAliases
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAccountAliases (Maybe Text)
listAccountAliases_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAccountAliases
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAccountAliasesResponse (Maybe Text)
listAccountAliasesResponse_marker
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 ListAccountAliases where
type
AWSResponse ListAccountAliases =
ListAccountAliasesResponse
request :: (Service -> Service)
-> ListAccountAliases -> Request ListAccountAliases
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAccountAliases
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListAccountAliases)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ListAccountAliasesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Bool
-> Maybe Text -> Int -> [Text] -> ListAccountAliasesResponse
ListAccountAliasesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsTruncated")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AccountAliases"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
)
)
instance Prelude.Hashable ListAccountAliases where
hashWithSalt :: Int -> ListAccountAliases -> Int
hashWithSalt Int
_salt ListAccountAliases' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:maxItems:ListAccountAliases' :: ListAccountAliases -> Maybe Natural
$sel:marker:ListAccountAliases' :: ListAccountAliases -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
instance Prelude.NFData ListAccountAliases where
rnf :: ListAccountAliases -> ()
rnf ListAccountAliases' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:maxItems:ListAccountAliases' :: ListAccountAliases -> Maybe Natural
$sel:marker:ListAccountAliases' :: ListAccountAliases -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems
instance Data.ToHeaders ListAccountAliases where
toHeaders :: ListAccountAliases -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListAccountAliases where
toPath :: ListAccountAliases -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListAccountAliases where
toQuery :: ListAccountAliases -> QueryString
toQuery ListAccountAliases' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:maxItems:ListAccountAliases' :: ListAccountAliases -> Maybe Natural
$sel:marker:ListAccountAliases' :: ListAccountAliases -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListAccountAliases" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxItems
]
data ListAccountAliasesResponse = ListAccountAliasesResponse'
{
ListAccountAliasesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
ListAccountAliasesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListAccountAliasesResponse -> Int
httpStatus :: Prelude.Int,
ListAccountAliasesResponse -> [Text]
accountAliases :: [Prelude.Text]
}
deriving (ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool
$c/= :: ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool
== :: ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool
$c== :: ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool
Prelude.Eq, ReadPrec [ListAccountAliasesResponse]
ReadPrec ListAccountAliasesResponse
Int -> ReadS ListAccountAliasesResponse
ReadS [ListAccountAliasesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccountAliasesResponse]
$creadListPrec :: ReadPrec [ListAccountAliasesResponse]
readPrec :: ReadPrec ListAccountAliasesResponse
$creadPrec :: ReadPrec ListAccountAliasesResponse
readList :: ReadS [ListAccountAliasesResponse]
$creadList :: ReadS [ListAccountAliasesResponse]
readsPrec :: Int -> ReadS ListAccountAliasesResponse
$creadsPrec :: Int -> ReadS ListAccountAliasesResponse
Prelude.Read, Int -> ListAccountAliasesResponse -> ShowS
[ListAccountAliasesResponse] -> ShowS
ListAccountAliasesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccountAliasesResponse] -> ShowS
$cshowList :: [ListAccountAliasesResponse] -> ShowS
show :: ListAccountAliasesResponse -> String
$cshow :: ListAccountAliasesResponse -> String
showsPrec :: Int -> ListAccountAliasesResponse -> ShowS
$cshowsPrec :: Int -> ListAccountAliasesResponse -> ShowS
Prelude.Show, forall x.
Rep ListAccountAliasesResponse x -> ListAccountAliasesResponse
forall x.
ListAccountAliasesResponse -> Rep ListAccountAliasesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAccountAliasesResponse x -> ListAccountAliasesResponse
$cfrom :: forall x.
ListAccountAliasesResponse -> Rep ListAccountAliasesResponse x
Prelude.Generic)
newListAccountAliasesResponse ::
Prelude.Int ->
ListAccountAliasesResponse
newListAccountAliasesResponse :: Int -> ListAccountAliasesResponse
newListAccountAliasesResponse Int
pHttpStatus_ =
ListAccountAliasesResponse'
{ $sel:isTruncated:ListAccountAliasesResponse' :: Maybe Bool
isTruncated =
forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListAccountAliasesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAccountAliasesResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:accountAliases:ListAccountAliasesResponse' :: [Text]
accountAliases = forall a. Monoid a => a
Prelude.mempty
}
listAccountAliasesResponse_isTruncated :: Lens.Lens' ListAccountAliasesResponse (Prelude.Maybe Prelude.Bool)
listAccountAliasesResponse_isTruncated :: Lens' ListAccountAliasesResponse (Maybe Bool)
listAccountAliasesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAliasesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListAccountAliasesResponse
s@ListAccountAliasesResponse' {} Maybe Bool
a -> ListAccountAliasesResponse
s {$sel:isTruncated:ListAccountAliasesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListAccountAliasesResponse)
listAccountAliasesResponse_marker :: Lens.Lens' ListAccountAliasesResponse (Prelude.Maybe Prelude.Text)
listAccountAliasesResponse_marker :: Lens' ListAccountAliasesResponse (Maybe Text)
listAccountAliasesResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAliasesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListAccountAliasesResponse
s@ListAccountAliasesResponse' {} Maybe Text
a -> ListAccountAliasesResponse
s {$sel:marker:ListAccountAliasesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListAccountAliasesResponse)
listAccountAliasesResponse_httpStatus :: Lens.Lens' ListAccountAliasesResponse Prelude.Int
listAccountAliasesResponse_httpStatus :: Lens' ListAccountAliasesResponse Int
listAccountAliasesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAliasesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAccountAliasesResponse
s@ListAccountAliasesResponse' {} Int
a -> ListAccountAliasesResponse
s {$sel:httpStatus:ListAccountAliasesResponse' :: Int
httpStatus = Int
a} :: ListAccountAliasesResponse)
listAccountAliasesResponse_accountAliases :: Lens.Lens' ListAccountAliasesResponse [Prelude.Text]
listAccountAliasesResponse_accountAliases :: Lens' ListAccountAliasesResponse [Text]
listAccountAliasesResponse_accountAliases = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccountAliasesResponse' {[Text]
accountAliases :: [Text]
$sel:accountAliases:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> [Text]
accountAliases} -> [Text]
accountAliases) (\s :: ListAccountAliasesResponse
s@ListAccountAliasesResponse' {} [Text]
a -> ListAccountAliasesResponse
s {$sel:accountAliases:ListAccountAliasesResponse' :: [Text]
accountAliases = [Text]
a} :: ListAccountAliasesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListAccountAliasesResponse where
rnf :: ListAccountAliasesResponse -> ()
rnf ListAccountAliasesResponse' {Int
[Text]
Maybe Bool
Maybe Text
accountAliases :: [Text]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:accountAliases:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> [Text]
$sel:httpStatus:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> Int
$sel:marker:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> Maybe Text
$sel:isTruncated:ListAccountAliasesResponse' :: ListAccountAliasesResponse -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
accountAliases