{-# 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.IAM.ListAccountAliases
-- 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 account alias associated with the Amazon Web Services account
-- (Note: you can have only one). For information about using an Amazon Web
-- Services account alias, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html Using an alias for your Amazon Web Services account ID>
-- in the /IAM User Guide/.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListAccountAliases
  ( -- * Creating a Request
    ListAccountAliases (..),
    newListAccountAliases,

    -- * Request Lenses
    listAccountAliases_marker,
    listAccountAliases_maxItems,

    -- * Destructuring the Response
    ListAccountAliasesResponse (..),
    newListAccountAliasesResponse,

    -- * Response Lenses
    listAccountAliasesResponse_marker,
    listAccountAliasesResponse_isTruncated,
    listAccountAliasesResponse_httpStatus,
    listAccountAliasesResponse_accountAliases,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAccountAliases' smart constructor.
data ListAccountAliases = ListAccountAliases'
  { -- | Use this parameter only when paginating results and only after you
    -- receive a response indicating that the results are truncated. Set it to
    -- the value of the @Marker@ element in the response that you received to
    -- indicate where the next call should start.
    ListAccountAliases -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this only when paginating results to indicate the maximum number of
    -- items you want in the response. If additional items exist beyond the
    -- maximum you specify, the @IsTruncated@ response element is @true@.
    --
    -- If you do not include this parameter, the number of items defaults to
    -- 100. Note that IAM might return fewer results, even when there are more
    -- results available. In that case, the @IsTruncated@ response element
    -- returns @true@, and @Marker@ contains a value to include in the
    -- subsequent call that tells the service where to continue from.
    ListAccountAliases -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListAccountAliases -> ListAccountAliases -> Bool
(ListAccountAliases -> ListAccountAliases -> Bool)
-> (ListAccountAliases -> ListAccountAliases -> Bool)
-> Eq ListAccountAliases
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]
(Int -> ReadS ListAccountAliases)
-> ReadS [ListAccountAliases]
-> ReadPrec ListAccountAliases
-> ReadPrec [ListAccountAliases]
-> Read 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
(Int -> ListAccountAliases -> ShowS)
-> (ListAccountAliases -> String)
-> ([ListAccountAliases] -> ShowS)
-> Show ListAccountAliases
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. ListAccountAliases -> Rep ListAccountAliases x)
-> (forall x. Rep ListAccountAliases x -> ListAccountAliases)
-> Generic ListAccountAliases
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)

-- |
-- Create a value of 'ListAccountAliases' 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:
--
-- 'marker', 'listAccountAliases_marker' - Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
--
-- 'maxItems', 'listAccountAliases_maxItems' - Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
newListAccountAliases ::
  ListAccountAliases
newListAccountAliases :: ListAccountAliases
newListAccountAliases =
  ListAccountAliases' :: Maybe Text -> Maybe Natural -> ListAccountAliases
ListAccountAliases'
    { $sel:marker:ListAccountAliases' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListAccountAliases' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
listAccountAliases_marker :: Lens.Lens' ListAccountAliases (Prelude.Maybe Prelude.Text)
listAccountAliases_marker :: (Maybe Text -> f (Maybe Text))
-> ListAccountAliases -> f ListAccountAliases
listAccountAliases_marker = (ListAccountAliases -> Maybe Text)
-> (ListAccountAliases -> Maybe Text -> ListAccountAliases)
-> Lens
     ListAccountAliases ListAccountAliases (Maybe Text) (Maybe Text)
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)

-- | Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
listAccountAliases_maxItems :: Lens.Lens' ListAccountAliases (Prelude.Maybe Prelude.Natural)
listAccountAliases_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListAccountAliases -> f ListAccountAliases
listAccountAliases_maxItems = (ListAccountAliases -> Maybe Natural)
-> (ListAccountAliases -> Maybe Natural -> ListAccountAliases)
-> Lens
     ListAccountAliases
     ListAccountAliases
     (Maybe Natural)
     (Maybe Natural)
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
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAccountAliases
ListAccountAliasesResponse
rs
            ListAccountAliasesResponse
-> Getting (First Bool) ListAccountAliasesResponse Bool
-> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListAccountAliasesResponse
-> Const (First Bool) ListAccountAliasesResponse
Lens' ListAccountAliasesResponse (Maybe Bool)
listAccountAliasesResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListAccountAliasesResponse
 -> Const (First Bool) ListAccountAliasesResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListAccountAliasesResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAccountAliases
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListAccountAliases
ListAccountAliasesResponse
rs
            ListAccountAliasesResponse
-> Getting (First Text) ListAccountAliasesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAccountAliasesResponse
-> Const (First Text) ListAccountAliasesResponse
Lens' ListAccountAliasesResponse (Maybe Text)
listAccountAliasesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAccountAliasesResponse
 -> Const (First Text) ListAccountAliasesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAccountAliasesResponse 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 ListAccountAliases
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAccountAliases -> Maybe ListAccountAliases
forall a. a -> Maybe a
Prelude.Just (ListAccountAliases -> Maybe ListAccountAliases)
-> ListAccountAliases -> Maybe ListAccountAliases
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAccountAliases
rq
          ListAccountAliases
-> (ListAccountAliases -> ListAccountAliases) -> ListAccountAliases
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAccountAliases -> Identity ListAccountAliases
Lens
  ListAccountAliases ListAccountAliases (Maybe Text) (Maybe Text)
listAccountAliases_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAccountAliases -> Identity ListAccountAliases)
-> Maybe Text -> ListAccountAliases -> ListAccountAliases
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAccountAliases
ListAccountAliasesResponse
rs
          ListAccountAliasesResponse
-> Getting (First Text) ListAccountAliasesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAccountAliasesResponse
-> Const (First Text) ListAccountAliasesResponse
Lens' ListAccountAliasesResponse (Maybe Text)
listAccountAliasesResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAccountAliasesResponse
 -> Const (First Text) ListAccountAliasesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAccountAliasesResponse 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 ListAccountAliases where
  type
    AWSResponse ListAccountAliases =
      ListAccountAliasesResponse
  request :: ListAccountAliases -> Request ListAccountAliases
request = Service -> ListAccountAliases -> Request ListAccountAliases
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAccountAliases
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAccountAliases)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListAccountAliases))
-> Logger
-> Service
-> Proxy ListAccountAliases
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAccountAliases)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListAccountAliasesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Bool -> Int -> [Text] -> ListAccountAliasesResponse
ListAccountAliasesResponse'
            (Maybe Text
 -> Maybe Bool -> Int -> [Text] -> ListAccountAliasesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Bool -> Int -> [Text] -> ListAccountAliasesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either
  String (Maybe Bool -> Int -> [Text] -> ListAccountAliasesResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> [Text] -> ListAccountAliasesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsTruncated")
            Either String (Int -> [Text] -> ListAccountAliasesResponse)
-> Either String Int
-> Either String ([Text] -> ListAccountAliasesResponse)
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))
            Either String ([Text] -> ListAccountAliasesResponse)
-> Either String [Text] -> Either String ListAccountAliasesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AccountAliases" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [Text]) -> Either String [Text]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListAccountAliases

instance Prelude.NFData ListAccountAliases

instance Core.ToHeaders ListAccountAliases where
  toHeaders :: ListAccountAliases -> ResponseHeaders
toHeaders = ResponseHeaders -> ListAccountAliases -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.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
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListAccountAliases" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems
      ]

-- | Contains the response to a successful ListAccountAliases request.
--
-- /See:/ 'newListAccountAliasesResponse' smart constructor.
data ListAccountAliasesResponse = ListAccountAliasesResponse'
  { -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListAccountAliasesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates whether there are more items to return. If your
    -- results were truncated, you can make a subsequent pagination request
    -- using the @Marker@ request parameter to retrieve more items. Note that
    -- IAM might return fewer than the @MaxItems@ number of results even when
    -- there are more results available. We recommend that you check
    -- @IsTruncated@ after every call to ensure that you receive all your
    -- results.
    ListAccountAliasesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListAccountAliasesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of aliases associated with the account. Amazon Web Services
    -- supports only one alias per account.
    ListAccountAliasesResponse -> [Text]
accountAliases :: [Prelude.Text]
  }
  deriving (ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool
(ListAccountAliasesResponse -> ListAccountAliasesResponse -> Bool)
-> (ListAccountAliasesResponse
    -> ListAccountAliasesResponse -> Bool)
-> Eq ListAccountAliasesResponse
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]
(Int -> ReadS ListAccountAliasesResponse)
-> ReadS [ListAccountAliasesResponse]
-> ReadPrec ListAccountAliasesResponse
-> ReadPrec [ListAccountAliasesResponse]
-> Read 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
(Int -> ListAccountAliasesResponse -> ShowS)
-> (ListAccountAliasesResponse -> String)
-> ([ListAccountAliasesResponse] -> ShowS)
-> Show ListAccountAliasesResponse
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.
 ListAccountAliasesResponse -> Rep ListAccountAliasesResponse x)
-> (forall x.
    Rep ListAccountAliasesResponse x -> ListAccountAliasesResponse)
-> Generic ListAccountAliasesResponse
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)

-- |
-- Create a value of 'ListAccountAliasesResponse' 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:
--
-- 'marker', 'listAccountAliasesResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'isTruncated', 'listAccountAliasesResponse_isTruncated' - A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
--
-- 'httpStatus', 'listAccountAliasesResponse_httpStatus' - The response's http status code.
--
-- 'accountAliases', 'listAccountAliasesResponse_accountAliases' - A list of aliases associated with the account. Amazon Web Services
-- supports only one alias per account.
newListAccountAliasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAccountAliasesResponse
newListAccountAliasesResponse :: Int -> ListAccountAliasesResponse
newListAccountAliasesResponse Int
pHttpStatus_ =
  ListAccountAliasesResponse' :: Maybe Text
-> Maybe Bool -> Int -> [Text] -> ListAccountAliasesResponse
ListAccountAliasesResponse'
    { $sel:marker:ListAccountAliasesResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListAccountAliasesResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAccountAliasesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:accountAliases:ListAccountAliasesResponse' :: [Text]
accountAliases = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
listAccountAliasesResponse_marker :: Lens.Lens' ListAccountAliasesResponse (Prelude.Maybe Prelude.Text)
listAccountAliasesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListAccountAliasesResponse -> f ListAccountAliasesResponse
listAccountAliasesResponse_marker = (ListAccountAliasesResponse -> Maybe Text)
-> (ListAccountAliasesResponse
    -> Maybe Text -> ListAccountAliasesResponse)
-> Lens' ListAccountAliasesResponse (Maybe Text)
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)

-- | A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
listAccountAliasesResponse_isTruncated :: Lens.Lens' ListAccountAliasesResponse (Prelude.Maybe Prelude.Bool)
listAccountAliasesResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> ListAccountAliasesResponse -> f ListAccountAliasesResponse
listAccountAliasesResponse_isTruncated = (ListAccountAliasesResponse -> Maybe Bool)
-> (ListAccountAliasesResponse
    -> Maybe Bool -> ListAccountAliasesResponse)
-> Lens' ListAccountAliasesResponse (Maybe Bool)
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)

-- | The response's http status code.
listAccountAliasesResponse_httpStatus :: Lens.Lens' ListAccountAliasesResponse Prelude.Int
listAccountAliasesResponse_httpStatus :: (Int -> f Int)
-> ListAccountAliasesResponse -> f ListAccountAliasesResponse
listAccountAliasesResponse_httpStatus = (ListAccountAliasesResponse -> Int)
-> (ListAccountAliasesResponse
    -> Int -> ListAccountAliasesResponse)
-> Lens
     ListAccountAliasesResponse ListAccountAliasesResponse Int Int
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)

-- | A list of aliases associated with the account. Amazon Web Services
-- supports only one alias per account.
listAccountAliasesResponse_accountAliases :: Lens.Lens' ListAccountAliasesResponse [Prelude.Text]
listAccountAliasesResponse_accountAliases :: ([Text] -> f [Text])
-> ListAccountAliasesResponse -> f ListAccountAliasesResponse
listAccountAliasesResponse_accountAliases = (ListAccountAliasesResponse -> [Text])
-> (ListAccountAliasesResponse
    -> [Text] -> ListAccountAliasesResponse)
-> Lens
     ListAccountAliasesResponse ListAccountAliasesResponse [Text] [Text]
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) (([Text] -> f [Text])
 -> ListAccountAliasesResponse -> f ListAccountAliasesResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListAccountAliasesResponse
-> f ListAccountAliasesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListAccountAliasesResponse