{-# 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.ListVersionsByFunction
(
ListVersionsByFunction (..),
newListVersionsByFunction,
listVersionsByFunction_marker,
listVersionsByFunction_maxItems,
listVersionsByFunction_functionName,
ListVersionsByFunctionResponse (..),
newListVersionsByFunctionResponse,
listVersionsByFunctionResponse_nextMarker,
listVersionsByFunctionResponse_versions,
listVersionsByFunctionResponse_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 ListVersionsByFunction = ListVersionsByFunction'
{
ListVersionsByFunction -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListVersionsByFunction -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
ListVersionsByFunction -> Text
functionName :: Prelude.Text
}
deriving (ListVersionsByFunction -> ListVersionsByFunction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
$c/= :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
== :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
$c== :: ListVersionsByFunction -> ListVersionsByFunction -> Bool
Prelude.Eq, ReadPrec [ListVersionsByFunction]
ReadPrec ListVersionsByFunction
Int -> ReadS ListVersionsByFunction
ReadS [ListVersionsByFunction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVersionsByFunction]
$creadListPrec :: ReadPrec [ListVersionsByFunction]
readPrec :: ReadPrec ListVersionsByFunction
$creadPrec :: ReadPrec ListVersionsByFunction
readList :: ReadS [ListVersionsByFunction]
$creadList :: ReadS [ListVersionsByFunction]
readsPrec :: Int -> ReadS ListVersionsByFunction
$creadsPrec :: Int -> ReadS ListVersionsByFunction
Prelude.Read, Int -> ListVersionsByFunction -> ShowS
[ListVersionsByFunction] -> ShowS
ListVersionsByFunction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVersionsByFunction] -> ShowS
$cshowList :: [ListVersionsByFunction] -> ShowS
show :: ListVersionsByFunction -> String
$cshow :: ListVersionsByFunction -> String
showsPrec :: Int -> ListVersionsByFunction -> ShowS
$cshowsPrec :: Int -> ListVersionsByFunction -> ShowS
Prelude.Show, forall x. Rep ListVersionsByFunction x -> ListVersionsByFunction
forall x. ListVersionsByFunction -> Rep ListVersionsByFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVersionsByFunction x -> ListVersionsByFunction
$cfrom :: forall x. ListVersionsByFunction -> Rep ListVersionsByFunction x
Prelude.Generic)
newListVersionsByFunction ::
Prelude.Text ->
ListVersionsByFunction
newListVersionsByFunction :: Text -> ListVersionsByFunction
newListVersionsByFunction Text
pFunctionName_ =
ListVersionsByFunction'
{ $sel:marker:ListVersionsByFunction' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListVersionsByFunction' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:functionName:ListVersionsByFunction' :: Text
functionName = Text
pFunctionName_
}
listVersionsByFunction_marker :: Lens.Lens' ListVersionsByFunction (Prelude.Maybe Prelude.Text)
listVersionsByFunction_marker :: Lens' ListVersionsByFunction (Maybe Text)
listVersionsByFunction_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunction' {Maybe Text
marker :: Maybe Text
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListVersionsByFunction
s@ListVersionsByFunction' {} Maybe Text
a -> ListVersionsByFunction
s {$sel:marker:ListVersionsByFunction' :: Maybe Text
marker = Maybe Text
a} :: ListVersionsByFunction)
listVersionsByFunction_maxItems :: Lens.Lens' ListVersionsByFunction (Prelude.Maybe Prelude.Natural)
listVersionsByFunction_maxItems :: Lens' ListVersionsByFunction (Maybe Natural)
listVersionsByFunction_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunction' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListVersionsByFunction
s@ListVersionsByFunction' {} Maybe Natural
a -> ListVersionsByFunction
s {$sel:maxItems:ListVersionsByFunction' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListVersionsByFunction)
listVersionsByFunction_functionName :: Lens.Lens' ListVersionsByFunction Prelude.Text
listVersionsByFunction_functionName :: Lens' ListVersionsByFunction Text
listVersionsByFunction_functionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunction' {Text
functionName :: Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
functionName} -> Text
functionName) (\s :: ListVersionsByFunction
s@ListVersionsByFunction' {} Text
a -> ListVersionsByFunction
s {$sel:functionName:ListVersionsByFunction' :: Text
functionName = Text
a} :: ListVersionsByFunction)
instance Core.AWSPager ListVersionsByFunction where
page :: ListVersionsByFunction
-> AWSResponse ListVersionsByFunction
-> Maybe ListVersionsByFunction
page ListVersionsByFunction
rq AWSResponse ListVersionsByFunction
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVersionsByFunction
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVersionsByFunctionResponse (Maybe Text)
listVersionsByFunctionResponse_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 ListVersionsByFunction
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListVersionsByFunctionResponse (Maybe [FunctionConfiguration])
listVersionsByFunctionResponse_versions
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.$ ListVersionsByFunction
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVersionsByFunction (Maybe Text)
listVersionsByFunction_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVersionsByFunction
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVersionsByFunctionResponse (Maybe Text)
listVersionsByFunctionResponse_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 ListVersionsByFunction where
type
AWSResponse ListVersionsByFunction =
ListVersionsByFunctionResponse
request :: (Service -> Service)
-> ListVersionsByFunction -> Request ListVersionsByFunction
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 ListVersionsByFunction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListVersionsByFunction)))
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 Text
-> Maybe [FunctionConfiguration]
-> Int
-> ListVersionsByFunctionResponse
ListVersionsByFunctionResponse'
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
"NextMarker")
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
"Versions" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListVersionsByFunction where
hashWithSalt :: Int -> ListVersionsByFunction -> Int
hashWithSalt Int
_salt ListVersionsByFunction' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
instance Prelude.NFData ListVersionsByFunction where
rnf :: ListVersionsByFunction -> ()
rnf ListVersionsByFunction' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
instance Data.ToHeaders ListVersionsByFunction where
toHeaders :: ListVersionsByFunction -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListVersionsByFunction where
toPath :: ListVersionsByFunction -> ByteString
toPath ListVersionsByFunction' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> 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
"/versions"
]
instance Data.ToQuery ListVersionsByFunction where
toQuery :: ListVersionsByFunction -> QueryString
toQuery ListVersionsByFunction' {Maybe Natural
Maybe Text
Text
functionName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:functionName:ListVersionsByFunction' :: ListVersionsByFunction -> Text
$sel:maxItems:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Natural
$sel:marker:ListVersionsByFunction' :: ListVersionsByFunction -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 ListVersionsByFunctionResponse = ListVersionsByFunctionResponse'
{
ListVersionsByFunctionResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListVersionsByFunctionResponse -> Maybe [FunctionConfiguration]
versions :: Prelude.Maybe [FunctionConfiguration],
ListVersionsByFunctionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
$c/= :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
== :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
$c== :: ListVersionsByFunctionResponse
-> ListVersionsByFunctionResponse -> Bool
Prelude.Eq, Int -> ListVersionsByFunctionResponse -> ShowS
[ListVersionsByFunctionResponse] -> ShowS
ListVersionsByFunctionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVersionsByFunctionResponse] -> ShowS
$cshowList :: [ListVersionsByFunctionResponse] -> ShowS
show :: ListVersionsByFunctionResponse -> String
$cshow :: ListVersionsByFunctionResponse -> String
showsPrec :: Int -> ListVersionsByFunctionResponse -> ShowS
$cshowsPrec :: Int -> ListVersionsByFunctionResponse -> ShowS
Prelude.Show, forall x.
Rep ListVersionsByFunctionResponse x
-> ListVersionsByFunctionResponse
forall x.
ListVersionsByFunctionResponse
-> Rep ListVersionsByFunctionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVersionsByFunctionResponse x
-> ListVersionsByFunctionResponse
$cfrom :: forall x.
ListVersionsByFunctionResponse
-> Rep ListVersionsByFunctionResponse x
Prelude.Generic)
newListVersionsByFunctionResponse ::
Prelude.Int ->
ListVersionsByFunctionResponse
newListVersionsByFunctionResponse :: Int -> ListVersionsByFunctionResponse
newListVersionsByFunctionResponse Int
pHttpStatus_ =
ListVersionsByFunctionResponse'
{ $sel:nextMarker:ListVersionsByFunctionResponse' :: Maybe Text
nextMarker =
forall a. Maybe a
Prelude.Nothing,
$sel:versions:ListVersionsByFunctionResponse' :: Maybe [FunctionConfiguration]
versions = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListVersionsByFunctionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listVersionsByFunctionResponse_nextMarker :: Lens.Lens' ListVersionsByFunctionResponse (Prelude.Maybe Prelude.Text)
listVersionsByFunctionResponse_nextMarker :: Lens' ListVersionsByFunctionResponse (Maybe Text)
listVersionsByFunctionResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunctionResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListVersionsByFunctionResponse
s@ListVersionsByFunctionResponse' {} Maybe Text
a -> ListVersionsByFunctionResponse
s {$sel:nextMarker:ListVersionsByFunctionResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListVersionsByFunctionResponse)
listVersionsByFunctionResponse_versions :: Lens.Lens' ListVersionsByFunctionResponse (Prelude.Maybe [FunctionConfiguration])
listVersionsByFunctionResponse_versions :: Lens'
ListVersionsByFunctionResponse (Maybe [FunctionConfiguration])
listVersionsByFunctionResponse_versions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunctionResponse' {Maybe [FunctionConfiguration]
versions :: Maybe [FunctionConfiguration]
$sel:versions:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Maybe [FunctionConfiguration]
versions} -> Maybe [FunctionConfiguration]
versions) (\s :: ListVersionsByFunctionResponse
s@ListVersionsByFunctionResponse' {} Maybe [FunctionConfiguration]
a -> ListVersionsByFunctionResponse
s {$sel:versions:ListVersionsByFunctionResponse' :: Maybe [FunctionConfiguration]
versions = Maybe [FunctionConfiguration]
a} :: ListVersionsByFunctionResponse) 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
listVersionsByFunctionResponse_httpStatus :: Lens.Lens' ListVersionsByFunctionResponse Prelude.Int
listVersionsByFunctionResponse_httpStatus :: Lens' ListVersionsByFunctionResponse Int
listVersionsByFunctionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVersionsByFunctionResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVersionsByFunctionResponse
s@ListVersionsByFunctionResponse' {} Int
a -> ListVersionsByFunctionResponse
s {$sel:httpStatus:ListVersionsByFunctionResponse' :: Int
httpStatus = Int
a} :: ListVersionsByFunctionResponse)
instance
Prelude.NFData
ListVersionsByFunctionResponse
where
rnf :: ListVersionsByFunctionResponse -> ()
rnf ListVersionsByFunctionResponse' {Int
Maybe [FunctionConfiguration]
Maybe Text
httpStatus :: Int
versions :: Maybe [FunctionConfiguration]
nextMarker :: Maybe Text
$sel:httpStatus:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Int
$sel:versions:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Maybe [FunctionConfiguration]
$sel:nextMarker:ListVersionsByFunctionResponse' :: ListVersionsByFunctionResponse -> Maybe Text
..} =
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 Maybe [FunctionConfiguration]
versions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus