{-# 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.GameLift.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)
--
-- Retrieves all aliases for this AWS account. You can filter the result
-- set by alias name and\/or routing strategy type. Use the pagination
-- parameters to retrieve results in sequential pages.
--
-- Returned aliases are not listed in any particular order.
--
-- __Related actions__
--
-- CreateAlias | ListAliases | DescribeAlias | UpdateAlias | DeleteAlias |
-- ResolveAlias |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
--
-- This operation returns paginated results.
module Amazonka.GameLift.ListAliases
  ( -- * Creating a Request
    ListAliases (..),
    newListAliases,

    -- * Request Lenses
    listAliases_routingStrategyType,
    listAliases_nextToken,
    listAliases_name,
    listAliases_limit,

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

    -- * Response Lenses
    listAliasesResponse_aliases,
    listAliasesResponse_nextToken,
    listAliasesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.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

-- | Represents the input for a request operation.
--
-- /See:/ 'newListAliases' smart constructor.
data ListAliases = ListAliases'
  { -- | The routing type to filter results on. Use this parameter to retrieve
    -- only aliases with a certain routing type. To retrieve all aliases, leave
    -- this parameter empty.
    --
    -- Possible routing types include the following:
    --
    -- -   __SIMPLE__ -- The alias resolves to one specific fleet. Use this
    --     type when routing to active fleets.
    --
    -- -   __TERMINAL__ -- The alias does not resolve to a fleet but instead
    --     can be used to display a message to the user. A terminal alias
    --     throws a TerminalRoutingStrategyException with the RoutingStrategy
    --     message embedded.
    ListAliases -> Maybe RoutingStrategyType
routingStrategyType :: Prelude.Maybe RoutingStrategyType,
    -- | A token that indicates the start of the next sequential page of results.
    -- Use the token that is returned with a previous call to this operation.
    -- To start at the beginning of the result set, do not specify a value.
    ListAliases -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A descriptive label that is associated with an alias. Alias names do not
    -- need to be unique.
    ListAliases -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return. Use this parameter with
    -- @NextToken@ to get results as a set of sequential pages.
    ListAliases -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  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:
--
-- 'routingStrategyType', 'listAliases_routingStrategyType' - The routing type to filter results on. Use this parameter to retrieve
-- only aliases with a certain routing type. To retrieve all aliases, leave
-- this parameter empty.
--
-- Possible routing types include the following:
--
-- -   __SIMPLE__ -- The alias resolves to one specific fleet. Use this
--     type when routing to active fleets.
--
-- -   __TERMINAL__ -- The alias does not resolve to a fleet but instead
--     can be used to display a message to the user. A terminal alias
--     throws a TerminalRoutingStrategyException with the RoutingStrategy
--     message embedded.
--
-- 'nextToken', 'listAliases_nextToken' - A token that indicates the start of the next sequential page of results.
-- Use the token that is returned with a previous call to this operation.
-- To start at the beginning of the result set, do not specify a value.
--
-- 'name', 'listAliases_name' - A descriptive label that is associated with an alias. Alias names do not
-- need to be unique.
--
-- 'limit', 'listAliases_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages.
newListAliases ::
  ListAliases
newListAliases :: ListAliases
newListAliases =
  ListAliases' :: Maybe RoutingStrategyType
-> Maybe Text -> Maybe Text -> Maybe Natural -> ListAliases
ListAliases'
    { $sel:routingStrategyType:ListAliases' :: Maybe RoutingStrategyType
routingStrategyType = Maybe RoutingStrategyType
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAliases' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListAliases' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListAliases' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The routing type to filter results on. Use this parameter to retrieve
-- only aliases with a certain routing type. To retrieve all aliases, leave
-- this parameter empty.
--
-- Possible routing types include the following:
--
-- -   __SIMPLE__ -- The alias resolves to one specific fleet. Use this
--     type when routing to active fleets.
--
-- -   __TERMINAL__ -- The alias does not resolve to a fleet but instead
--     can be used to display a message to the user. A terminal alias
--     throws a TerminalRoutingStrategyException with the RoutingStrategy
--     message embedded.
listAliases_routingStrategyType :: Lens.Lens' ListAliases (Prelude.Maybe RoutingStrategyType)
listAliases_routingStrategyType :: (Maybe RoutingStrategyType -> f (Maybe RoutingStrategyType))
-> ListAliases -> f ListAliases
listAliases_routingStrategyType = (ListAliases -> Maybe RoutingStrategyType)
-> (ListAliases -> Maybe RoutingStrategyType -> ListAliases)
-> Lens
     ListAliases
     ListAliases
     (Maybe RoutingStrategyType)
     (Maybe RoutingStrategyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Maybe RoutingStrategyType
routingStrategyType :: Maybe RoutingStrategyType
$sel:routingStrategyType:ListAliases' :: ListAliases -> Maybe RoutingStrategyType
routingStrategyType} -> Maybe RoutingStrategyType
routingStrategyType) (\s :: ListAliases
s@ListAliases' {} Maybe RoutingStrategyType
a -> ListAliases
s {$sel:routingStrategyType:ListAliases' :: Maybe RoutingStrategyType
routingStrategyType = Maybe RoutingStrategyType
a} :: ListAliases)

-- | A token that indicates the start of the next sequential page of results.
-- Use the token that is returned with a previous call to this operation.
-- To start at the beginning of the result set, do not specify a value.
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)

-- | A descriptive label that is associated with an alias. Alias names do not
-- need to be unique.
listAliases_name :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Text)
listAliases_name :: (Maybe Text -> f (Maybe Text)) -> ListAliases -> f ListAliases
listAliases_name = (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
name :: Maybe Text
$sel:name:ListAliases' :: ListAliases -> Maybe Text
name} -> Maybe Text
name) (\s :: ListAliases
s@ListAliases' {} Maybe Text
a -> ListAliases
s {$sel:name:ListAliases' :: Maybe Text
name = Maybe Text
a} :: ListAliases)

-- | The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages.
listAliases_limit :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Natural)
listAliases_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListAliases -> f ListAliases
listAliases_limit = (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
limit :: Maybe Natural
$sel:limit:ListAliases' :: ListAliases -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListAliases
s@ListAliases' {} Maybe Natural
a -> ListAliases
s {$sel:limit:ListAliases' :: Maybe Natural
limit = Maybe Natural
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 [Alias] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAliases
ListAliasesResponse
rs
            ListAliasesResponse
-> Getting (First [Alias]) ListAliasesResponse [Alias]
-> Maybe [Alias]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Alias] -> Const (First [Alias]) (Maybe [Alias]))
-> ListAliasesResponse -> Const (First [Alias]) ListAliasesResponse
Lens' ListAliasesResponse (Maybe [Alias])
listAliasesResponse_aliases ((Maybe [Alias] -> Const (First [Alias]) (Maybe [Alias]))
 -> ListAliasesResponse
 -> Const (First [Alias]) ListAliasesResponse)
-> (([Alias] -> Const (First [Alias]) [Alias])
    -> Maybe [Alias] -> Const (First [Alias]) (Maybe [Alias]))
-> Getting (First [Alias]) ListAliasesResponse [Alias]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Alias] -> Const (First [Alias]) [Alias])
-> Maybe [Alias] -> Const (First [Alias]) (Maybe [Alias])
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 [Alias] -> Maybe Text -> Int -> ListAliasesResponse
ListAliasesResponse'
            (Maybe [Alias] -> Maybe Text -> Int -> ListAliasesResponse)
-> Either String (Maybe [Alias])
-> 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 [Alias]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Aliases" Either String (Maybe (Maybe [Alias]))
-> Maybe [Alias] -> Either String (Maybe [Alias])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Alias]
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
"GameLift.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
Maybe RoutingStrategyType
limit :: Maybe Natural
name :: Maybe Text
nextToken :: Maybe Text
routingStrategyType :: Maybe RoutingStrategyType
$sel:limit:ListAliases' :: ListAliases -> Maybe Natural
$sel:name:ListAliases' :: ListAliases -> Maybe Text
$sel:nextToken:ListAliases' :: ListAliases -> Maybe Text
$sel:routingStrategyType:ListAliases' :: ListAliases -> Maybe RoutingStrategyType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RoutingStrategyType" Text -> RoutingStrategyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RoutingStrategyType -> Pair)
-> Maybe RoutingStrategyType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RoutingStrategyType
routingStrategyType,
            (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
"Name" 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
name,
            (Text
"Limit" 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
limit
          ]
      )

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

-- | Represents the returned data in response to a request operation.
--
-- /See:/ 'newListAliasesResponse' smart constructor.
data ListAliasesResponse = ListAliasesResponse'
  { -- | A collection of alias resources that match the request parameters.
    ListAliasesResponse -> Maybe [Alias]
aliases :: Prelude.Maybe [Alias],
    -- | A token that indicates where to resume retrieving results on the next
    -- call to this operation. If no token is returned, these results represent
    -- the end of the list.
    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' - A collection of alias resources that match the request parameters.
--
-- 'nextToken', 'listAliasesResponse_nextToken' - A token that indicates where to resume retrieving results on the next
-- call to this operation. If no token is returned, these results represent
-- the end of the list.
--
-- 'httpStatus', 'listAliasesResponse_httpStatus' - The response's http status code.
newListAliasesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAliasesResponse
newListAliasesResponse :: Int -> ListAliasesResponse
newListAliasesResponse Int
pHttpStatus_ =
  ListAliasesResponse' :: Maybe [Alias] -> Maybe Text -> Int -> ListAliasesResponse
ListAliasesResponse'
    { $sel:aliases:ListAliasesResponse' :: Maybe [Alias]
aliases = Maybe [Alias]
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_
    }

-- | A collection of alias resources that match the request parameters.
listAliasesResponse_aliases :: Lens.Lens' ListAliasesResponse (Prelude.Maybe [Alias])
listAliasesResponse_aliases :: (Maybe [Alias] -> f (Maybe [Alias]))
-> ListAliasesResponse -> f ListAliasesResponse
listAliasesResponse_aliases = (ListAliasesResponse -> Maybe [Alias])
-> (ListAliasesResponse -> Maybe [Alias] -> ListAliasesResponse)
-> Lens' ListAliasesResponse (Maybe [Alias])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliasesResponse' {Maybe [Alias]
aliases :: Maybe [Alias]
$sel:aliases:ListAliasesResponse' :: ListAliasesResponse -> Maybe [Alias]
aliases} -> Maybe [Alias]
aliases) (\s :: ListAliasesResponse
s@ListAliasesResponse' {} Maybe [Alias]
a -> ListAliasesResponse
s {$sel:aliases:ListAliasesResponse' :: Maybe [Alias]
aliases = Maybe [Alias]
a} :: ListAliasesResponse) ((Maybe [Alias] -> f (Maybe [Alias]))
 -> ListAliasesResponse -> f ListAliasesResponse)
-> ((Maybe [Alias] -> f (Maybe [Alias]))
    -> Maybe [Alias] -> f (Maybe [Alias]))
-> (Maybe [Alias] -> f (Maybe [Alias]))
-> ListAliasesResponse
-> f ListAliasesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Alias] [Alias] [Alias] [Alias]
-> Iso
     (Maybe [Alias]) (Maybe [Alias]) (Maybe [Alias]) (Maybe [Alias])
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 [Alias] [Alias] [Alias] [Alias]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token that indicates where to resume retrieving results on the next
-- call to this operation. If no token is returned, these results represent
-- the end of the list.
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