{-# 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.WorkMail.ListAliases
-- 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)
--
-- Creates a paginated call to list the aliases associated with a given
-- entity.
--
-- This operation returns paginated results.
module Amazonka.WorkMail.ListAliases
  ( -- * Creating a Request
    ListAliases (..),
    newListAliases,

    -- * Request Lenses
    listAliases_nextToken,
    listAliases_maxResults,
    listAliases_organizationId,
    listAliases_entityId,

    -- * Destructuring the Response
    ListAliasesResponse (..),
    newListAliasesResponse,

    -- * Response Lenses
    listAliasesResponse_aliases,
    listAliasesResponse_nextToken,
    listAliasesResponse_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.WorkMail.Types

-- | /See:/ 'newListAliases' smart constructor.
data ListAliases = ListAliases'
  { -- | The token to use to retrieve the next page of results. The first call
    -- does not contain any tokens.
    ListAliases -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in a single call.
    ListAliases -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier for the organization under which the entity exists.
    ListAliases -> Text
organizationId :: Prelude.Text,
    -- | The identifier for the entity for which to list the aliases.
    ListAliases -> Text
entityId :: Prelude.Text
  }
  deriving (ListAliases -> ListAliases -> Bool
(ListAliases -> ListAliases -> Bool)
-> (ListAliases -> ListAliases -> Bool) -> Eq ListAliases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAliases -> ListAliases -> Bool
$c/= :: ListAliases -> ListAliases -> Bool
== :: ListAliases -> ListAliases -> Bool
$c== :: ListAliases -> ListAliases -> Bool
Prelude.Eq, ReadPrec [ListAliases]
ReadPrec ListAliases
Int -> ReadS ListAliases
ReadS [ListAliases]
(Int -> ReadS ListAliases)
-> ReadS [ListAliases]
-> ReadPrec ListAliases
-> ReadPrec [ListAliases]
-> Read ListAliases
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAliases]
$creadListPrec :: ReadPrec [ListAliases]
readPrec :: ReadPrec ListAliases
$creadPrec :: ReadPrec ListAliases
readList :: ReadS [ListAliases]
$creadList :: ReadS [ListAliases]
readsPrec :: Int -> ReadS ListAliases
$creadsPrec :: Int -> ReadS ListAliases
Prelude.Read, Int -> ListAliases -> ShowS
[ListAliases] -> ShowS
ListAliases -> String
(Int -> ListAliases -> ShowS)
-> (ListAliases -> String)
-> ([ListAliases] -> ShowS)
-> Show ListAliases
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAliases] -> ShowS
$cshowList :: [ListAliases] -> ShowS
show :: ListAliases -> String
$cshow :: ListAliases -> String
showsPrec :: Int -> ListAliases -> ShowS
$cshowsPrec :: Int -> ListAliases -> ShowS
Prelude.Show, (forall x. ListAliases -> Rep ListAliases x)
-> (forall x. Rep ListAliases x -> ListAliases)
-> Generic ListAliases
forall x. Rep ListAliases x -> ListAliases
forall x. ListAliases -> Rep ListAliases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAliases x -> ListAliases
$cfrom :: forall x. ListAliases -> Rep ListAliases x
Prelude.Generic)

-- |
-- Create a value of 'ListAliases' 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', 'listAliases_nextToken' - The token to use to retrieve the next page of results. The first call
-- does not contain any tokens.
--
-- 'maxResults', 'listAliases_maxResults' - The maximum number of results to return in a single call.
--
-- 'organizationId', 'listAliases_organizationId' - The identifier for the organization under which the entity exists.
--
-- 'entityId', 'listAliases_entityId' - The identifier for the entity for which to list the aliases.
newListAliases ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'entityId'
  Prelude.Text ->
  ListAliases
newListAliases :: Text -> Text -> ListAliases
newListAliases Text
pOrganizationId_ Text
pEntityId_ =
  ListAliases' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListAliases
ListAliases'
    { $sel:nextToken:ListAliases' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAliases' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationId:ListAliases' :: Text
organizationId = Text
pOrganizationId_,
      $sel:entityId:ListAliases' :: Text
entityId = Text
pEntityId_
    }

-- | The token to use to retrieve the next page of results. The first call
-- does not contain any tokens.
listAliases_nextToken :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Text)
listAliases_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListAliases -> f ListAliases
listAliases_nextToken = (ListAliases -> Maybe Text)
-> (ListAliases -> Maybe Text -> ListAliases)
-> Lens ListAliases ListAliases (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAliases' :: ListAliases -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAliases
s@ListAliases' {} Maybe Text
a -> ListAliases
s {$sel:nextToken:ListAliases' :: Maybe Text
nextToken = Maybe Text
a} :: ListAliases)

-- | The maximum number of results to return in a single call.
listAliases_maxResults :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Natural)
listAliases_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAliases -> f ListAliases
listAliases_maxResults = (ListAliases -> Maybe Natural)
-> (ListAliases -> Maybe Natural -> ListAliases)
-> Lens ListAliases ListAliases (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAliases' :: ListAliases -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAliases
s@ListAliases' {} Maybe Natural
a -> ListAliases
s {$sel:maxResults:ListAliases' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAliases)

-- | The identifier for the organization under which the entity exists.
listAliases_organizationId :: Lens.Lens' ListAliases Prelude.Text
listAliases_organizationId :: (Text -> f Text) -> ListAliases -> f ListAliases
listAliases_organizationId = (ListAliases -> Text)
-> (ListAliases -> Text -> ListAliases)
-> Lens ListAliases ListAliases Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Text
organizationId :: Text
$sel:organizationId:ListAliases' :: ListAliases -> Text
organizationId} -> Text
organizationId) (\s :: ListAliases
s@ListAliases' {} Text
a -> ListAliases
s {$sel:organizationId:ListAliases' :: Text
organizationId = Text
a} :: ListAliases)

-- | The identifier for the entity for which to list the aliases.
listAliases_entityId :: Lens.Lens' ListAliases Prelude.Text
listAliases_entityId :: (Text -> f Text) -> ListAliases -> f ListAliases
listAliases_entityId = (ListAliases -> Text)
-> (ListAliases -> Text -> ListAliases)
-> Lens ListAliases ListAliases Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Text
entityId :: Text
$sel:entityId:ListAliases' :: ListAliases -> Text
entityId} -> Text
entityId) (\s :: ListAliases
s@ListAliases' {} Text
a -> ListAliases
s {$sel:entityId:ListAliases' :: Text
entityId = Text
a} :: ListAliases)

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

instance Prelude.NFData ListAliases

instance Core.ToHeaders ListAliases where
  toHeaders :: ListAliases -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAliases -> 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
"WorkMailService.ListAliases" ::
                          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 ListAliases where
  toJSON :: ListAliases -> Value
toJSON ListAliases' {Maybe Natural
Maybe Text
Text
entityId :: Text
organizationId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:entityId:ListAliases' :: ListAliases -> Text
$sel:organizationId:ListAliases' :: ListAliases -> Text
$sel:maxResults:ListAliases' :: ListAliases -> Maybe Natural
$sel:nextToken:ListAliases' :: ListAliases -> 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
"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
"OrganizationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
organizationId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EntityId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
entityId)
          ]
      )

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

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

-- | /See:/ 'newListAliasesResponse' smart constructor.
data ListAliasesResponse = ListAliasesResponse'
  { -- | The entity\'s paginated aliases.
    ListAliasesResponse -> Maybe [Text]
aliases :: Prelude.Maybe [Prelude.Text],
    -- | The token to use to retrieve the next page of results. The value is
    -- \"null\" when there are no more results to return.
    ListAliasesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAliasesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAliasesResponse -> ListAliasesResponse -> Bool
(ListAliasesResponse -> ListAliasesResponse -> Bool)
-> (ListAliasesResponse -> ListAliasesResponse -> Bool)
-> Eq ListAliasesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAliasesResponse -> ListAliasesResponse -> Bool
$c/= :: ListAliasesResponse -> ListAliasesResponse -> Bool
== :: ListAliasesResponse -> ListAliasesResponse -> Bool
$c== :: ListAliasesResponse -> ListAliasesResponse -> Bool
Prelude.Eq, ReadPrec [ListAliasesResponse]
ReadPrec ListAliasesResponse
Int -> ReadS ListAliasesResponse
ReadS [ListAliasesResponse]
(Int -> ReadS ListAliasesResponse)
-> ReadS [ListAliasesResponse]
-> ReadPrec ListAliasesResponse
-> ReadPrec [ListAliasesResponse]
-> Read ListAliasesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAliasesResponse]
$creadListPrec :: ReadPrec [ListAliasesResponse]
readPrec :: ReadPrec ListAliasesResponse
$creadPrec :: ReadPrec ListAliasesResponse
readList :: ReadS [ListAliasesResponse]
$creadList :: ReadS [ListAliasesResponse]
readsPrec :: Int -> ReadS ListAliasesResponse
$creadsPrec :: Int -> ReadS ListAliasesResponse
Prelude.Read, Int -> ListAliasesResponse -> ShowS
[ListAliasesResponse] -> ShowS
ListAliasesResponse -> String
(Int -> ListAliasesResponse -> ShowS)
-> (ListAliasesResponse -> String)
-> ([ListAliasesResponse] -> ShowS)
-> Show ListAliasesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAliasesResponse] -> ShowS
$cshowList :: [ListAliasesResponse] -> ShowS
show :: ListAliasesResponse -> String
$cshow :: ListAliasesResponse -> String
showsPrec :: Int -> ListAliasesResponse -> ShowS
$cshowsPrec :: Int -> ListAliasesResponse -> ShowS
Prelude.Show, (forall x. ListAliasesResponse -> Rep ListAliasesResponse x)
-> (forall x. Rep ListAliasesResponse x -> ListAliasesResponse)
-> Generic ListAliasesResponse
forall x. Rep ListAliasesResponse x -> ListAliasesResponse
forall x. ListAliasesResponse -> Rep ListAliasesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAliasesResponse x -> ListAliasesResponse
$cfrom :: forall x. ListAliasesResponse -> Rep ListAliasesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAliasesResponse' 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:
--
-- 'aliases', 'listAliasesResponse_aliases' - The entity\'s paginated aliases.
--
-- 'nextToken', 'listAliasesResponse_nextToken' - The token to use to retrieve the next page of results. The value is
-- \"null\" when there are no more results to return.
--
-- 'httpStatus', 'listAliasesResponse_httpStatus' - The response's http status code.
newListAliasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAliasesResponse
newListAliasesResponse :: Int -> ListAliasesResponse
newListAliasesResponse Int
pHttpStatus_ =
  ListAliasesResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListAliasesResponse
ListAliasesResponse'
    { $sel:aliases:ListAliasesResponse' :: Maybe [Text]
aliases = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAliasesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAliasesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The entity\'s paginated aliases.
listAliasesResponse_aliases :: Lens.Lens' ListAliasesResponse (Prelude.Maybe [Prelude.Text])
listAliasesResponse_aliases :: (Maybe [Text] -> f (Maybe [Text]))
-> ListAliasesResponse -> f ListAliasesResponse
listAliasesResponse_aliases = (ListAliasesResponse -> Maybe [Text])
-> (ListAliasesResponse -> Maybe [Text] -> ListAliasesResponse)
-> Lens' ListAliasesResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliasesResponse' {Maybe [Text]
aliases :: Maybe [Text]
$sel:aliases:ListAliasesResponse' :: ListAliasesResponse -> Maybe [Text]
aliases} -> Maybe [Text]
aliases) (\s :: ListAliasesResponse
s@ListAliasesResponse' {} Maybe [Text]
a -> ListAliasesResponse
s {$sel:aliases:ListAliasesResponse' :: Maybe [Text]
aliases = Maybe [Text]
a} :: ListAliasesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListAliasesResponse -> f ListAliasesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListAliasesResponse
-> f ListAliasesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use to retrieve the next page of results. The value is
-- \"null\" when there are no more results to return.
listAliasesResponse_nextToken :: Lens.Lens' ListAliasesResponse (Prelude.Maybe Prelude.Text)
listAliasesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAliasesResponse -> f ListAliasesResponse
listAliasesResponse_nextToken = (ListAliasesResponse -> Maybe Text)
-> (ListAliasesResponse -> Maybe Text -> ListAliasesResponse)
-> Lens' ListAliasesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliasesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAliasesResponse' :: ListAliasesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAliasesResponse
s@ListAliasesResponse' {} Maybe Text
a -> ListAliasesResponse
s {$sel:nextToken:ListAliasesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAliasesResponse)

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

instance Prelude.NFData ListAliasesResponse