{-# 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.Lambda.ListAliases
(
ListAliases (..),
newListAliases,
listAliases_functionVersion,
listAliases_marker,
listAliases_maxItems,
listAliases_functionName,
ListAliasesResponse (..),
newListAliasesResponse,
listAliasesResponse_aliases,
listAliasesResponse_nextMarker,
listAliasesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAliases = ListAliases'
{
ListAliases -> Maybe Text
functionVersion :: Prelude.Maybe Prelude.Text,
ListAliases -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListAliases -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
ListAliases -> Text
functionName :: Prelude.Text
}
deriving (ListAliases -> ListAliases -> Bool
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]
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
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. 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)
newListAliases ::
Prelude.Text ->
ListAliases
newListAliases :: Text -> ListAliases
newListAliases Text
pFunctionName_ =
ListAliases'
{ $sel:functionVersion:ListAliases' :: Maybe Text
functionVersion = forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListAliases' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListAliases' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:functionName:ListAliases' :: Text
functionName = Text
pFunctionName_
}
listAliases_functionVersion :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Text)
listAliases_functionVersion :: Lens' ListAliases (Maybe Text)
listAliases_functionVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Maybe Text
functionVersion :: Maybe Text
$sel:functionVersion:ListAliases' :: ListAliases -> Maybe Text
functionVersion} -> Maybe Text
functionVersion) (\s :: ListAliases
s@ListAliases' {} Maybe Text
a -> ListAliases
s {$sel:functionVersion:ListAliases' :: Maybe Text
functionVersion = Maybe Text
a} :: ListAliases)
listAliases_marker :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Text)
listAliases_marker :: Lens' ListAliases (Maybe Text)
listAliases_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Maybe Text
marker :: Maybe Text
$sel:marker:ListAliases' :: ListAliases -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListAliases
s@ListAliases' {} Maybe Text
a -> ListAliases
s {$sel:marker:ListAliases' :: Maybe Text
marker = Maybe Text
a} :: ListAliases)
listAliases_maxItems :: Lens.Lens' ListAliases (Prelude.Maybe Prelude.Natural)
listAliases_maxItems :: Lens' ListAliases (Maybe Natural)
listAliases_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListAliases' :: ListAliases -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListAliases
s@ListAliases' {} Maybe Natural
a -> ListAliases
s {$sel:maxItems:ListAliases' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListAliases)
listAliases_functionName :: Lens.Lens' ListAliases Prelude.Text
listAliases_functionName :: Lens' ListAliases Text
listAliases_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliases' {Text
functionName :: Text
$sel:functionName:ListAliases' :: ListAliases -> Text
functionName} -> Text
functionName) (\s :: ListAliases
s@ListAliases' {} Text
a -> ListAliases
s {$sel:functionName:ListAliases' :: Text
functionName = Text
a} :: ListAliases)
instance Core.AWSPager ListAliases where
page :: ListAliases -> AWSResponse ListAliases -> Maybe ListAliases
page ListAliases
rq AWSResponse ListAliases
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAliases
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAliasesResponse (Maybe Text)
listAliasesResponse_nextMarker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAliases
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAliasesResponse (Maybe [AliasConfiguration])
listAliasesResponse_aliases
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.$ ListAliases
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAliases (Maybe Text)
listAliases_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAliases
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAliasesResponse (Maybe Text)
listAliasesResponse_nextMarker
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 ListAliases where
type AWSResponse ListAliases = ListAliasesResponse
request :: (Service -> Service) -> ListAliases -> Request ListAliases
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAliases
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAliases)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [AliasConfiguration]
-> Maybe Text -> Int -> ListAliasesResponse
ListAliasesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Aliases" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextMarker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListAliases where
hashWithSalt :: Int -> ListAliases -> Int
hashWithSalt Int
_salt ListAliases' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
functionVersion :: Maybe Text
$sel:functionName:ListAliases' :: ListAliases -> Text
$sel:maxItems:ListAliases' :: ListAliases -> Maybe Natural
$sel:marker:ListAliases' :: ListAliases -> Maybe Text
$sel:functionVersion:ListAliases' :: ListAliases -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
functionVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
instance Prelude.NFData ListAliases where
rnf :: ListAliases -> ()
rnf ListAliases' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
functionVersion :: Maybe Text
$sel:functionName:ListAliases' :: ListAliases -> Text
$sel:maxItems:ListAliases' :: ListAliases -> Maybe Natural
$sel:marker:ListAliases' :: ListAliases -> Maybe Text
$sel:functionVersion:ListAliases' :: ListAliases -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
functionVersion
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 Maybe Natural
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
instance Data.ToHeaders ListAliases where
toHeaders :: ListAliases -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListAliases where
toPath :: ListAliases -> ByteString
toPath ListAliases' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
functionVersion :: Maybe Text
$sel:functionName:ListAliases' :: ListAliases -> Text
$sel:maxItems:ListAliases' :: ListAliases -> Maybe Natural
$sel:marker:ListAliases' :: ListAliases -> Maybe Text
$sel:functionVersion:ListAliases' :: ListAliases -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2015-03-31/functions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
ByteString
"/aliases"
]
instance Data.ToQuery ListAliases where
toQuery :: ListAliases -> QueryString
toQuery ListAliases' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
functionVersion :: Maybe Text
$sel:functionName:ListAliases' :: ListAliases -> Text
$sel:maxItems:ListAliases' :: ListAliases -> Maybe Natural
$sel:marker:ListAliases' :: ListAliases -> Maybe Text
$sel:functionVersion:ListAliases' :: ListAliases -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"FunctionVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
functionVersion,
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 ListAliasesResponse = ListAliasesResponse'
{
ListAliasesResponse -> Maybe [AliasConfiguration]
aliases :: Prelude.Maybe [AliasConfiguration],
ListAliasesResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListAliasesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAliasesResponse -> ListAliasesResponse -> Bool
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]
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
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. 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)
newListAliasesResponse ::
Prelude.Int ->
ListAliasesResponse
newListAliasesResponse :: Int -> ListAliasesResponse
newListAliasesResponse Int
pHttpStatus_ =
ListAliasesResponse'
{ $sel:aliases:ListAliasesResponse' :: Maybe [AliasConfiguration]
aliases = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListAliasesResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAliasesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAliasesResponse_aliases :: Lens.Lens' ListAliasesResponse (Prelude.Maybe [AliasConfiguration])
listAliasesResponse_aliases :: Lens' ListAliasesResponse (Maybe [AliasConfiguration])
listAliasesResponse_aliases = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliasesResponse' {Maybe [AliasConfiguration]
aliases :: Maybe [AliasConfiguration]
$sel:aliases:ListAliasesResponse' :: ListAliasesResponse -> Maybe [AliasConfiguration]
aliases} -> Maybe [AliasConfiguration]
aliases) (\s :: ListAliasesResponse
s@ListAliasesResponse' {} Maybe [AliasConfiguration]
a -> ListAliasesResponse
s {$sel:aliases:ListAliasesResponse' :: Maybe [AliasConfiguration]
aliases = Maybe [AliasConfiguration]
a} :: ListAliasesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAliasesResponse_nextMarker :: Lens.Lens' ListAliasesResponse (Prelude.Maybe Prelude.Text)
listAliasesResponse_nextMarker :: Lens' ListAliasesResponse (Maybe Text)
listAliasesResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAliasesResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListAliasesResponse' :: ListAliasesResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListAliasesResponse
s@ListAliasesResponse' {} Maybe Text
a -> ListAliasesResponse
s {$sel:nextMarker:ListAliasesResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListAliasesResponse)
listAliasesResponse_httpStatus :: Lens.Lens' ListAliasesResponse Prelude.Int
listAliasesResponse_httpStatus :: Lens' ListAliasesResponse Int
listAliasesResponse_httpStatus = 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 where
rnf :: ListAliasesResponse -> ()
rnf ListAliasesResponse' {Int
Maybe [AliasConfiguration]
Maybe Text
httpStatus :: Int
nextMarker :: Maybe Text
aliases :: Maybe [AliasConfiguration]
$sel:httpStatus:ListAliasesResponse' :: ListAliasesResponse -> Int
$sel:nextMarker:ListAliasesResponse' :: ListAliasesResponse -> Maybe Text
$sel:aliases:ListAliasesResponse' :: ListAliasesResponse -> Maybe [AliasConfiguration]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AliasConfiguration]
aliases
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus